text
stringlengths
4
1.02M
meta
dict
import collections import operator import pytest from pandas.compat import PY36 import pandas as pd from pandas.tests.extension import base import pandas.util.testing as tm from .array import JSONArray, JSONDtype, make_data @pytest.fixture def dtype(): return JSONDtype() @pytest.fixture def data(): """L...
{ "content_hash": "e8ed34d4c626348c9acebce2e82a6210", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 87, "avg_line_length": 30.08974358974359, "alnum_prop": 0.6362377503195569, "repo_name": "kushalbhola/MyStuff", "id": "bc75ec6aeb2df0ac2a4007a540eba8ee4189cf22", "size": "...
from __future__ import division # For type safety in gaussian_kl_divergence from functools import partial from math import erfc import numpy as np from numpy.random import RandomState import kl import threshold def gaussian_kl_divergence(mu1, s1, mu2, s2): "Return KL(N(mu1,s1)||N(mu2,s2))" # http://stats...
{ "content_hash": "aa72da120526bbf4276054ab291749f9", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 79, "avg_line_length": 34.32222222222222, "alnum_prop": 0.6785367432826157, "repo_name": "probcomp/bayeslite", "id": "74f0475fb2dc4c2ac5945b4984624a7c3c8ac046", "size": "37...
import os import utilities.paths as paths from keras.preprocessing import image import numpy as np import json DRIVE = paths.get_drive(2) # Setup vars # Malisiewicz et al. def non_max_suppression_fast(boxes, overlapThresh): # if there are no boxes, return an empty list if len(boxes) == 0: return [] ...
{ "content_hash": "8c8fbffb8d4ae01aeca297bcf38d1f5a", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 184, "avg_line_length": 39.027027027027025, "alnum_prop": 0.49778393351800554, "repo_name": "HaydenFaulkner/phd", "id": "e9e5739a86933af397a2a6a75e2c1a1a1e606ab3", "size":...
from __future__ import annotations import argparse import ast import collections import enum import io import itertools import os import re import sys from typing import Generator from typing import NamedTuple from typing import Sequence from classify_imports import Import from classify_imports import import_obj_from...
{ "content_hash": "00cb64a34100697428b4079a92661f26", "timestamp": "", "source": "github", "line_count": 838, "max_line_length": 79, "avg_line_length": 33.24463007159905, "alnum_prop": 0.5954987616210201, "repo_name": "asottile/reorder_python_imports", "id": "673ea246bd1d8393e030939bb586ace2c9821bfc",...
"""Parser for the environment markers micro-language defined in PEP 345.""" import ast import os import sys import platform from .compat import python_implementation, string_types from .util import in_venv __all__ = ['interpret'] class Evaluator(object): """ A limited evaluator for Python expressions. ...
{ "content_hash": "0ba30f2bf9ad2d7e67002258c9dacfb3", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 77, "avg_line_length": 33.15217391304348, "alnum_prop": 0.5468852459016393, "repo_name": "ppyordanov/HCI_4_Future_Cities", "id": "72a8540fcb4d2f177263a11493497fc65ea168a4", ...
import os import sys import socket import urllib import string import random import traceback import time class Signal: def __init__(self): self.slots = {} self.meta = {} def ensure(self, func, context=""): if context not in self.slots: self.connect(func, context) ...
{ "content_hash": "40f1e2d39e6cddeade7e5d9acf5b1849", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 101, "avg_line_length": 34.39525691699605, "alnum_prop": 0.41116984601241097, "repo_name": "flipcoder/litebot", "id": "333f65774c1fb5e1068632ac30de3d0952614899", "size": "...
""" Created on Nov 30, 2021 @author: CyberiaResurrection """ import unittest import re import sys sys.path.append('../PyRoute') from Galaxy import Galaxy from Galaxy import Sector class testGalaxy(unittest.TestCase): """ A very simple, barebones test to check that Verge and Reft end up in their correct r...
{ "content_hash": "9a1a726f1830bf4c50ee077596b854ef", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 136, "avg_line_length": 46.663366336633665, "alnum_prop": 0.7031614682792277, "repo_name": "makhidkarun/traveller_pyroute", "id": "a11c3d72105134f3cd78ad0e461a7ff2f92aa01d",...
from datetime import datetime import os import sys from django.core.management.base import BaseCommand, CommandError from workflows import module_importer from workflows.management.commands import export_package_old as export_package from workflows.management.commands import import_package_old as import_package from op...
{ "content_hash": "106c7e69165807770d5d5640cef19569", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 169, "avg_line_length": 45.34532374100719, "alnum_prop": 0.5887672536887196, "repo_name": "xflows/clowdflows-backend", "id": "82051172fb1dd2390c823313dab3ca54b8ff8bb6", "s...
"""Tests for annotation type hint casting.""" from __future__ import unicode_literals from collections import ( deque, Counter ) import json import pytest import six from typingplus import * @pytest.mark.parametrize('type_, expected', [ (AnyStr, six.string_types + (bytes, bytearray)), (str, str), ...
{ "content_hash": "c9a608bc3ddcc659196b16ec819b251d", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 65, "avg_line_length": 32.28703703703704, "alnum_prop": 0.5815887582449096, "repo_name": "contains-io/typingplus", "id": "b5bcde43b6d77223ad68258ffc0919c0b7995804", "size"...
from subprocess import check_output import re import urllib2 import sys oldest = sys.argv[1] last_hash = sys.argv[2] RE_COMMIT_HASH = r"^commit.([0-9a-fA-F]+)$" RE_BUG_NUMBERS = r"(?:cases?|Bug[sz] ?IDs?)[: ] *\d+(?:[,: ] *\d+)*" # The above regex makes mistakes for messages like "bugzid 1: 42 lines added" # Use the ...
{ "content_hash": "3f5b8c629ae4bf242d5ba64634a4053f", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 112, "avg_line_length": 35.888888888888886, "alnum_prop": 0.6460268317853457, "repo_name": "shiliang-spiralwks/Opened-Panda", "id": "ef12e0337fe8d6a31aee712770714b8b9d1ae8a3"...
import pandas as pd import matplotlib.pyplot as plt import sys import numpy as np import scipy as sc import sklearn from sklearn import decomposition from sklearn import cluster import seaborn as sns import math ## what modes can be script run in run_modes = ["find_day_correlated_pcs", "2d-pca-multiplot", "2d-pca-sing...
{ "content_hash": "1c71eedf14aa6a83b4a30dc9fab501e6", "timestamp": "", "source": "github", "line_count": 477, "max_line_length": 142, "avg_line_length": 37.932914046121596, "alnum_prop": 0.7071957554990604, "repo_name": "MacanPN/single-cell-tools", "id": "964c570143b0707867693bcac50cc531b2e72cac", "...
from django.conf.urls import patterns, include, url from .views import ControllPoint urlpatterns = patterns( 'seek.views', url(r'^$', ControllPoint.as_view(), name='controll'), )
{ "content_hash": "fd98024c11032c5ea207002b2ca1187e", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 54, "avg_line_length": 22.75, "alnum_prop": 0.7307692307692307, "repo_name": "HenriqueLR/watchful", "id": "b805991c69334813df43dd3a3ca6473cc8df0bd3", "size": "200", "binar...
catname = "Andromeda" print len(catname) dloc = catname.index("m") print dloc print catname.count("d") print catname[0:5] # Andromeda is a cutie! message = "Andromeda is not a cutie!" print message[0:13] + message[17:25] print("%s %s") % (message[0:12], message[17:25]) print message[::-1] # I'm so happy we have h...
{ "content_hash": "e4eba454dedf913a297a952b4fd195ad", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 62, "avg_line_length": 19.566666666666666, "alnum_prop": 0.6643952299829642, "repo_name": "TruthLacksLyricism/learning-python", "id": "26476f964c16d4fec3e1bf251cb8516979225ad...
from django import forms from django.utils.translation import ugettext_lazy as _ from feincms.admin.editor import ItemEditorForm from feincms_markup.widgets import MarkItUpWidget class MarkupContentAdminForm(ItemEditorForm): """ Admin Form to use markitup editor """ #markup = forms.CharField(widget=Ma...
{ "content_hash": "767db033c44f8153994f03ed9ea54119", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 72, "avg_line_length": 35.96666666666667, "alnum_prop": 0.6478220574606117, "repo_name": "indexofire/feincms-markup", "id": "32512b1942e09864c6ca5832fd75a9ef01ba3b2b", "siz...
from __future__ import unicode_literals from django.contrib import admin from authtools.admin import NamedUserAdmin from .models import Profile from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse User = get_user_model() class UserProfileInline(admin.StackedInline): ...
{ "content_hash": "cbdf336ac4edb9068ae9b4b9b7b63dc0", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 71, "avg_line_length": 33.483870967741936, "alnum_prop": 0.6608863198458574, "repo_name": "The-Akatsuki/thirdp", "id": "886e996e5c14d5b1c4baf056f58f4a0d366f9c58", "size": "...
import requests import json jsonFile=open('LocalConfiguration/accountCredentials.json') accountCredentials=json.load(jsonFile) jsonFile.close() clientID=accountCredentials['Client ID'] redirectURI=accountCredentials['Redirect URI'] scopes=accountCredentials['Scopes'] state=accountCredentials['State'] clientIdString=...
{ "content_hash": "e03415bf53a7a25f1b77e60cd62d9dc7", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 86, "avg_line_length": 24.17391304347826, "alnum_prop": 0.7985611510791367, "repo_name": "luisibanez/github-api-whisperer", "id": "e2150cf5b62d8e289509490e90167d9dfe573315", ...
import os import sys import warnings from itertools import takewhile from django.apps import apps from django.conf import settings from django.core.management.base import BaseCommand, CommandError, no_translations from django.core.management.utils import run_formatters from django.db import DEFAULT_DB_ALIAS, Operation...
{ "content_hash": "8fd7eb924b3c5e0d0c9624110bf6c268", "timestamp": "", "source": "github", "line_count": 403, "max_line_length": 88, "avg_line_length": 42.535980148883375, "alnum_prop": 0.5301015050752538, "repo_name": "solarissmoke/django", "id": "8938fb6309ca58ac85eb983a589565f83e0c36b1", "size": ...
""" Extended math utilities. """ # Authors: Gael Varoquaux # Alexandre Gramfort # Alexandre T. Passos # Olivier Grisel # Lars Buitinck # Stefan van der Walt # Kyle Kastner # Giorgio Patrini # License: BSD 3 clause import numpy as np from sklearn.utils.extm...
{ "content_hash": "4ceca9069a07627ae741b9ba89fece2c", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 83, "avg_line_length": 33.89719626168224, "alnum_prop": 0.6476426799007444, "repo_name": "dask/dask-ml", "id": "623659e85580ca7536a39b901f5e15441a7f60c7", "size": "3627", ...
from pants.testutil.test_base import TestBase from pants_test.contrib.go.targets.go_local_source_test_base import GoLocalSourceTestBase from pants.contrib.go.targets.go_binary import GoBinary class GoBinaryTest(GoLocalSourceTestBase, TestBase): @property def target_type(self): return GoBinary
{ "content_hash": "75d123df3540418472cc33203f1a1ccf", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 89, "avg_line_length": 31.3, "alnum_prop": 0.792332268370607, "repo_name": "tdyas/pants", "id": "151a392076dce91bd2ae5ae7ccb68e7effcc82d3", "size": "445", "binary": false...
from futurist._futures import Future # noqa from futurist._futures import GreenFuture # noqa from futurist._futures import CancelledError # noqa from futurist._futures import TimeoutError # noqa from futurist._futures import GreenThreadPoolExecutor # noqa from futurist._futures import ProcessPoolExecutor # noqa...
{ "content_hash": "e54a530266393d348b8bb8dc26a3ed48", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 61, "avg_line_length": 39.42857142857143, "alnum_prop": 0.8115942028985508, "repo_name": "openstack/futurist", "id": "43231eb697af18fc820e388bcf8e60fd30598e2f", "size": "12...
import salt.client def test_salt_states(): caller = salt.client.Caller() output = caller.sminion.functions['state.highstate']() for k, v in output.items(): assert v['result'], v def test_locale_state(): caller = salt.client.Caller() output = caller.sminion.functions['state.sls']('locale'...
{ "content_hash": "ed11185e5aa9baa5d0e6e52a0362852c", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 72, "avg_line_length": 27.25, "alnum_prop": 0.6381243628950051, "repo_name": "sciboxes/numpybox", "id": "6074b751a4705a4e504fb11e4d4ce9124ae36db0", "size": "981", "binary...
from bigdl.dllib.utils.file_utils import callZooFunc from pyspark.sql.types import IntegerType, ShortType, LongType, FloatType, DecimalType, \ DoubleType, BooleanType from pyspark.sql.functions import broadcast, udf from bigdl.dllib.utils.log4Error import * import warnings from bigdl.dllib.utils.log4Error import * ...
{ "content_hash": "b194b46ca1b8b41e8640c7690abeda92", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 100, "avg_line_length": 40.262172284644194, "alnum_prop": 0.5689302325581396, "repo_name": "yangw1234/BigDL", "id": "1bb9db6cec4c034e78eb77a9c0620da7f8d8b7ce", "size": "11...
from pyBN.learning.structure.constraint.fast_iamb import * from pyBN.learning.structure.constraint.grow_shrink import * from pyBN.learning.structure.constraint.iamb import * from pyBN.learning.structure.constraint.lambda_iamb import * from pyBN.learning.structure.constraint.path_condition import *
{ "content_hash": "14aa20ee65a24e2ea1b19c6027a667eb", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 63, "avg_line_length": 59.6, "alnum_prop": 0.8389261744966443, "repo_name": "ncullen93/pyBN", "id": "e6339908f746d7019ee114d60142b86e58c106b2", "size": "298", "binary": fa...
""" mfupw module. Contains the ModflowUpw class. Note that the user can access the ModflowUpw class as `flopy.modflow.ModflowUpw`. Additional information for this MODFLOW package can be found at the `Online MODFLOW Guide <http://water.usgs.gov/ogw/modflow-nwt/MODFLOW-NWT-Guide/upw_upstream_weighting_package.htm...
{ "content_hash": "07ad055252f69d758ca6a9551618e9aa", "timestamp": "", "source": "github", "line_count": 508, "max_line_length": 95, "avg_line_length": 42.21456692913386, "alnum_prop": 0.5193751457216135, "repo_name": "bdestombe/flopy-1", "id": "be283a93075d09155ce1a1ae2b4fc7bcdb06d93a", "size": "21...
""" This module contains ShowBase, an application framework responsible for opening a graphical display, setting up input devices and creating the scene graph. """ __all__ = ['ShowBase', 'WindowControls'] # This module redefines the builtin import function with one # that prints out every import it does in a hierarch...
{ "content_hash": "d48ac051e4089c1af73842e98390e8c3", "timestamp": "", "source": "github", "line_count": 3205, "max_line_length": 149, "avg_line_length": 39.3984399375975, "alnum_prop": 0.6127011530663964, "repo_name": "chandler14362/panda3d", "id": "bff3b4652c4a7c3654a53e60efa5ca4b5b798e61", "size"...
""" Exceptions for pyproj """ class ProjError(RuntimeError): """Raised when a Proj error occurs.""" internal_proj_error = None def __init__(self, error_message: str) -> None: if self.internal_proj_error is not None: error_message = ( f"{error_message}: (Internal Proj ...
{ "content_hash": "4294080b464c57f69b901fbbc8704092", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 85, "avg_line_length": 23.61111111111111, "alnum_prop": 0.6011764705882353, "repo_name": "ocefpaf/pyproj", "id": "906435407b4ff5476f02a5aa4e931e95c1310758", "size": "850", ...
'''Michael Lange <klappnase (at) freakmail (dot) de> The ToolTip class provides a flexible tooltip widget for Tkinter; it is based on IDLE's ToolTip module which unfortunately seems to be broken (at least the version I saw). INITIALIZATION OPTIONS: anchor : where the text should be positioned inside the widget, ...
{ "content_hash": "3ab07c9e6bdb1b31ae1254ad2aea15fd", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 124, "avg_line_length": 46.21264367816092, "alnum_prop": 0.5886083820420346, "repo_name": "TomT0m/Boolean-c10t", "id": "afaae0a99d98ce5d77d0fdf69c9723334850abf1", "size": ...
from google.cloud import dialogflow_v2 async def sample_list_versions(): # Create a client client = dialogflow_v2.VersionsAsyncClient() # Initialize request argument(s) request = dialogflow_v2.ListVersionsRequest( parent="parent_value", ) # Make the request page_result = client.l...
{ "content_hash": "12be40bfc06960c13d57443d44b9fe0a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 59, "avg_line_length": 25.05, "alnum_prop": 0.7045908183632734, "repo_name": "googleapis/python-dialogflow", "id": "2ad8a6ad3c58caa5f11f5e6e8779b458cbb5adcf", "size": "1886...
"""Classes corresponding to W3C XML Schema components. Class names and behavior should conform to the schema components described in U{XML Schema Part 1: Structures<http://www.w3.org/TR/xmlschema-1/>}. References to sections in the documentation of this module generally refers to that document. Each class has a C{Cre...
{ "content_hash": "c483a17c441525116ced97aa2e4d5624", "timestamp": "", "source": "github", "line_count": 5158, "max_line_length": 219, "avg_line_length": 43.59557968204731, "alnum_prop": 0.6254035736838829, "repo_name": "balanced/PyXB", "id": "36f1d261217f413bdc5aad8c2eccd9570df3a301", "size": "2254...
import argparse import numpy as np import data_parser as dp FLAG = None def get_mean_var(feats): np_target = np.array(feats) mean = np.mean(np_target,0) var = np.var(np_target,0) return mean, var def normalize(feats, mean, var): np_feats = np.array(feats) np_feats = np_feats - mean fe...
{ "content_hash": "36393b117c84bc9fab534b1be8a7da92", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 80, "avg_line_length": 31.105263157894736, "alnum_prop": 0.6446700507614214, "repo_name": "hoaaoh/Audio2Vec", "id": "e5ac4596fae230a876392ccba4a99c424dac11fc", "size": "179...
""" Copyright 2015 ARC Centre of Excellence for Climate Systems Science author: Scott Wales <scott.wales@unimelb.edu.au> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/l...
{ "content_hash": "2a5df7c812bbcb40c5c11b0955e85406", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 72, "avg_line_length": 30.657894736842106, "alnum_prop": 0.7304721030042919, "repo_name": "ScottWales/ftools", "id": "d10fb97cca5e68a5719ee33b277409a26ba042f7", "size": "11...
from pandas.util.decorators import cache_readonly import pandas.util.testing as tm import pandas as pd _ts = tm.makeTimeSeries() class TestData(object): @cache_readonly def ts(self): ts = _ts.copy() ts.name = 'ts' return ts @cache_readonly def series(self): series = ...
{ "content_hash": "373c7c10698e02eb0aca96818db04143", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 49, "avg_line_length": 20.8, "alnum_prop": 0.6121794871794872, "repo_name": "boomsbloom/dtm-fmri", "id": "613961e1c670f0a5561da19b3c756995c6dc86c8", "size": "624", "binar...
from setuptools import setup import multiprocessing # nopep8 VERSION = '0.0.5-1' version_file = open('./orloui/_version.py', 'w') version_file.write("__version__ = '{}'".format(VERSION)) version_file.close() setup( name='orloui', version=VERSION, description='User interface to Orlo', author='Alex For...
{ "content_hash": "d72f29db1041a4d7451c29e8c4ef1124", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 57, "avg_line_length": 23.21212121212121, "alnum_prop": 0.5939947780678851, "repo_name": "al4/orloui", "id": "7021ff477ce8538bfa35de40d73aa027b70de86f", "size": "824", "b...
from autosar.writer.writer_base import ElementWriter import autosar.behavior class XMLModeWriter(ElementWriter): def __init__(self, version, patch): super().__init__(version, patch) def getSupportedXML(self): return 'ModeDeclarationGroup' def getSupportedCode(self): ret...
{ "content_hash": "d15d00183f00c9e93218882991217283", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 138, "avg_line_length": 46.745098039215684, "alnum_prop": 0.6254194630872483, "repo_name": "cogu/autosar", "id": "17412ea7cafcc656f10d90ee4f3809a99f8885fb", "size": "2384",...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("products", "0007_projectairfiles"), ] operations = [ migrations.AddField( model_name="projectairfiles", name="archive", field=models.BooleanField(default...
{ "content_hash": "d0ea74ae96257332b852dbf61b543300", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 53, "avg_line_length": 21.625, "alnum_prop": 0.5895953757225434, "repo_name": "comic/comic-django", "id": "77c7f12615055973d1439124dede5adb19c7367d", "size": "396", "bina...
from openerp import fields, models class Partner(models.Model): _inherit = 'res.partner' instructor = fields.Boolean("Instructor", default=False) session_ids = fields.Many2many('openacademy.session', string="Attended Sessions", readonl...
{ "content_hash": "ab281d521d6a9b870dc3348b207167f3", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 63, "avg_line_length": 30, "alnum_prop": 0.5787878787878787, "repo_name": "JesusZapata/openacademy-project", "id": "4a414e051d3f2be0b4052b9ad0fd344b39347e7a", "size": "354"...
""" File contains necessary utils for module """ from math import exp def normalize(value, k=6): if (value >= 0): return 1.0 - exp(-abs(value/k)) else: return - (1.0 - exp(-abs(value/k))) def to_unicode(s): if isinstance(s, str): return unicode(s, 'utf-8') elif isinstance(s,...
{ "content_hash": "0b44ad75c98bfc25862afc5d7b997586", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 43, "avg_line_length": 18.31578947368421, "alnum_prop": 0.5718390804597702, "repo_name": "nicolay-r/tone-classifier", "id": "c31b711b66926b1f7dc681e51c147c0b4d5c8605", "siz...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Feed.unread_count' db.delete_column(u'feeds_feed', 'unread_count') def ba...
{ "content_hash": "b5e7a76ed022fdd2aa6eb887a89c0e3e", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 195, "avg_line_length": 76.02521008403362, "alnum_prop": 0.5463689620868797, "repo_name": "vincentbernat/feedhq", "id": "eeca8a0e3e347d9a29df17cd31bf6a3b1b58d200", "size":...
""" This file is covered by the LICENSING file in the root of this project. """ from hackathon.hack.hackathon_manager import HackathonManager from hackathon.hack.admin_manager import AdminManager from hackathon.hack.team_manager import TeamManager from hackathon.hack.host_server_manager import DockerHostManager from h...
{ "content_hash": "b5f3c6b64a247791b8eaa8ef5b4fb8cf", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 78, "avg_line_length": 45.09090909090909, "alnum_prop": 0.8508064516129032, "repo_name": "juniwang/open-hackathon", "id": "ac9ef9229a8e0f98293f7065089137c76f4e5a57", "size"...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "1bccddc5cc4d7095bbdda4d8c5d4fa30", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 106, "avg_line_length": 45.5, "alnum_prop": 0.7837041007772715, "repo_name": "arenadata/ambari", "id": "35288c99860ce853de1d763824f182996eb1de3d", "size": "3731", "binary...
from .button import Button from .checkbox import CheckBox from .combobox import ComboBox from .edit import Edit from .frame import Frame from .link import Link from .listitem import ListItem from .radiogroup import RadioGroup from .table import Table from .text import Text
{ "content_hash": "461b26a2b53e3551f97ad6eef5b23792", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 34, "avg_line_length": 27.4, "alnum_prop": 0.8175182481751825, "repo_name": "WesleyPeng/uiXautomation", "id": "3ac6749ae17d81b75c4f026fe9aa1d6f9c33f574", "size": "868", "...
import argparse import os import re import subprocess import sys def main(): parser = argparse.ArgumentParser( description='A script to compile xib and storyboard.', fromfile_prefix_chars='@') parser.add_argument('-o', '--output', required=True, help='Path to output bundle.') p...
{ "content_hash": "0617ffa1c9896016f6e35d6528993d4d", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 62, "avg_line_length": 28.181818181818183, "alnum_prop": 0.6245161290322581, "repo_name": "youtube/cobalt_sandbox", "id": "d53fa1579092b7bdc78a5c8a39c4b2838ba4e346", "size"...
""" tests.utils.py ~~~~~~ :copyright: (c) 2014 by @zizzamia :license: BSD (See LICENSE for details) """ import unittest from flask import g # Imports inside Bombolone import core.utils # Fake text to use in tests TEXT = "This is a test" class TestUtils(unittest.TestCase): def test_get_message(self): "...
{ "content_hash": "fdc5074564df57ea68a5daba37aec974", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 62, "avg_line_length": 27.962025316455698, "alnum_prop": 0.6011770031688547, "repo_name": "katiecheng/Bombolone", "id": "c07a88a3ed14770ddb9ccc0202e8fc9faf90f4b2", "size": ...
''' Created on Feb 28, 2013 @author: czue ''' from copy import copy from datetime import datetime from casexml.apps.case.mock import CaseBlock from corehq.apps.commtrack.const import RequisitionActions, RequisitionStatus, UserRequisitionRoles, notification_template import uuid from corehq.apps.commtrack.models import ...
{ "content_hash": "6c849965fe08959fa50c00e3ec6ec809", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 131, "avg_line_length": 40.29299363057325, "alnum_prop": 0.6062282643060386, "repo_name": "SEL-Columbia/commcare-hq", "id": "ee474f01cdb702ff2e64f08f2d1e66c9e7311747", "si...
from __future__ import division, print_function import argparse import os import time import jnius_config import tensorflow as tf from pycarbon.reader import make_reader from pycarbon.tests.mnist.dataset_with_unischema import DEFAULT_MNIST_DATA_PATH from pycarbon.tests import DEFAULT_CARBONSDK_PATH from pycarbon.co...
{ "content_hash": "ee1230ac329e73aa6d9fd71f5d162e64", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 112, "avg_line_length": 39.87596899224806, "alnum_prop": 0.6401632970451011, "repo_name": "jackylk/incubator-carbondata", "id": "853af762249a414d4886da0268ecf8168f081742", ...
from oslo_log import log as logging from designate.objects.adapters.api_v2 import base from designate import objects from designate import exceptions LOG = logging.getLogger(__name__) class RecordSetAPIv2Adapter(base.APIv2Adapter): ADAPTER_OBJECT = objects.RecordSet MODIFICATIONS = { 'fields': { ...
{ "content_hash": "5f98ec1ef803d9ad817200f5341d419f", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 74, "avg_line_length": 31.831858407079647, "alnum_prop": 0.5159855435084792, "repo_name": "ionrock/designate", "id": "33d4d055ca5d0ca32c4945dc372ec7c8f42522ea", "size": "4...
import datetime from django.utils.encoding import smart_str from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import rsa from django.conf import settings from django.core.management.base import BaseCommand f...
{ "content_hash": "4f363f275eec24fd6d34dc639b737143", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 92, "avg_line_length": 37.883720930232556, "alnum_prop": 0.6586863106200123, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "e2b06bd21e5b986be2b2fdc05606...
from chainer.functions.connection import dilated_convolution_2d from chainer import initializers from chainer import link from chainer import variable class DilatedConvolution2D(link.Link): """Two-dimensional dilated convolutional layer. This link wraps the :func:`~chainer.functions.dilated_convolution_2d` ...
{ "content_hash": "6a99ce3468ca2b7e35aaaf008b880f5c", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 78, "avg_line_length": 35.78417266187051, "alnum_prop": 0.5701648572577402, "repo_name": "ysekky/chainer", "id": "812368302affca0cebb055e26ed0aafba4b6e93f", "size": "4974"...
import configparser import os class Secrets: """ Save secret user information in an ini file """ def __init__(self, file_path): self.secrets = None self.file_path = file_path def create_file_if_not_exists(self): """ Creates secrets file if it doesn't exist ...
{ "content_hash": "e2ca2f8f22af756bcf277d352e949382", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 67, "avg_line_length": 26.166666666666668, "alnum_prop": 0.5684713375796179, "repo_name": "jameslafa/500px-fav-downloader", "id": "fa5dce20bd6f9fc1c9f8601b769464d06136f3fd", ...
""" A stack is the classic abstract data type container implementing a LIFO interface. But we're also interested in how deep our stack gets over its lifetime and, more specifically over the last 'n' operations (set in Stack.DEPTH_HISTORY). """ class KStack: class Empty: def tos(self, stack):...
{ "content_hash": "3f6c66bfdd85f154bce97633a419b10e", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 126, "avg_line_length": 28.61437908496732, "alnum_prop": 0.5612151667428049, "repo_name": "scherrey/ADnD", "id": "ce88ef9ad83fd5b27079f26b8a24d4f7a78aa9a5", "size": "4378"...
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) try: readme = open(os.path.join(here, 'README.md')).read() except IOError: readme = '' setup_requires = [ 'nose>=1.3.0', ] setup( name='detach', version='1.0', description="Fork and detach...
{ "content_hash": "9b590274d1d70a828e2437955df8cead", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 57, "avg_line_length": 26, "alnum_prop": 0.6296703296703297, "repo_name": "BlueDragonX/detach", "id": "e25a9e0c49f967e504c570e4842a6197ac07717a", "size": "910", "binary":...
from urllib.parse import urljoin OAUTH_BASE_ENDPOINT = "account/api/oauth/" AUTH_ENDPOINT = urljoin(OAUTH_BASE_ENDPOINT, 'authorize.htm') USER_ENDPOINT = urljoin(OAUTH_BASE_ENDPOINT, 'user.htm') EMAIL_VALIDATION_ENDPOINT = "/account/validateEmail.htm" EMAIL_VALIDATION_STATUS_ENDPOINT = "/account/api/isEmailValidated...
{ "content_hash": "d501c175d19306901e95429f6173f18b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 70, "avg_line_length": 36.05555555555556, "alnum_prop": 0.7781201848998459, "repo_name": "CityOfNewYork/NYCOpenRecords", "id": "c4af7d52cdb73dcb35c726e2aa79c469bf78fa18", "...
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union import warnings from google.api_core import gapic_v1, grpc_helpers_async, operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google....
{ "content_hash": "0f1497a217a1d8d27808c62401178796", "timestamp": "", "source": "github", "line_count": 406, "max_line_length": 88, "avg_line_length": 43.52463054187192, "alnum_prop": 0.6137739799671779, "repo_name": "googleapis/python-iam", "id": "85ebabb33f8daa1b0a834a3abf5fcb9851d27504", "size":...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_imperial_defector.iff" result.attribute_template_id = 9 result.stfName("npc_name","human_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "7cb84d3503394fba8297ae4119468aa3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 71, "avg_line_length": 23.46153846153846, "alnum_prop": 0.6983606557377049, "repo_name": "obi-two/Rebelion", "id": "9e045194a1564b1749faf649ad609a9894cb1090", "size": "450"...
from morphforge.morphology.conversion.region_to_int_bimap import AutoRegionToIntMapTable from morphforge.morphology.conversion.region_to_int_bimap import RegionToIntMapBiMap from morphforge.morphology.conversion.internal_representation_converter import MorphologyConverter
{ "content_hash": "820663847a348793d0b4baf6f32b6999", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 98, "avg_line_length": 68.5, "alnum_prop": 0.8905109489051095, "repo_name": "mikehulluk/morphforge", "id": "17597cc3fc064c6d2a8ef35d207691e9dce692ff", "size": "1813", "bin...
from django.shortcuts import render from .models import Medicamento, Insumo, Laboratorio from django.core.urlresolvers import reverse_lazy from django.views.generic import ListView, CreateView, UpdateView, DeleteView from .forms import MedicamentoForm, InsumoForm, LaboratorioForm from django.db.models import Q import ...
{ "content_hash": "60196a6575b515c3cf196bd497680108", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 77, "avg_line_length": 32.85064935064935, "alnum_prop": 0.7497529155959676, "repo_name": "andresmauro17/mediapp", "id": "0de84e6b7c98e7f5584793107c9d10c13c39b8d1", "size":...
import unittest from backend.device.thermometer import Thermometer from backend.device.mock import MockMAX31855 import math class ThermometerTests(unittest.TestCase): def setUp(self): self.thermometer = Thermometer(MockMAX31855()) def test_read_c(self): for i in range(10000): temp...
{ "content_hash": "26a532ebca598bb98f7ba2e1e9509dcd", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 62, "avg_line_length": 30.071428571428573, "alnum_prop": 0.7268408551068883, "repo_name": "jimrybarski/piwarmer", "id": "85030edb71e0773efc1a02ca37f5d695eb4aac8b", "size": ...
from dataclasses import dataclass from typing import Any import pytest from _py2tmp.compiler.output_files import load_object_files, ObjectFileContent def pytest_addoption(parser: Any): group = parser.getgroup("tmppy") group.addoption( "--tmppyc_files", action="store", dest="tmppyc_fi...
{ "content_hash": "a7fe0d8390ae129bd33f78c19319a3d8", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 96, "avg_line_length": 30.77777777777778, "alnum_prop": 0.6759927797833934, "repo_name": "google/tmppy", "id": "f13fc9e694c9e1de47c64958fff8bfad3f0e305b", "size": "1706", ...
from click.testing import CliRunner from clifunzone.cli import main def test_main(): runner = CliRunner() result = runner.invoke(main, []) assert result.output == '()\n' assert result.exit_code == 0
{ "content_hash": "d0860011541b6cc1913770488b874052", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 36, "avg_line_length": 19.90909090909091, "alnum_prop": 0.6666666666666666, "repo_name": "Justin-W/clifunland", "id": "0025921cdb6612de5bee351a14056e464f7fb2a4", "size": "2...
import os SETTINGS_DIR = os.path.dirname(__file__) PROJECT_PATH = os.path.join(SETTINGS_DIR, os.pardir) PROEJCT_PATH = os.path.abspath(PROJECT_PATH) DATABASE_PATH = os.path.join(PROJECT_PATH, 'grabber.db') TEMPLATE_PATH = os.path.join(PROJECT_PATH, 'templates') STATIC_PATH = os.path.join(PROJECT_PATH, 'static') DEBUG ...
{ "content_hash": "a628ce07c1ce979cdec81195ddb4e3eb", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 128, "avg_line_length": 33.45945945945946, "alnum_prop": 0.6964458804523425, "repo_name": "benkul/twitterproject", "id": "4a2695927822f25c320b1eb7eae575c93a2309e7", "size"...
""" Provides base classes for working with drivers """ from __future__ import with_statement import sys import time import hashlib import os import socket import random import binascii from libcloud.utils.py3 import b import libcloud.compute.ssh from libcloud.pricing import get_size_price from libcloud.compute.type...
{ "content_hash": "35fe329bcb1e457a26ed8cceab20ab85", "timestamp": "", "source": "github", "line_count": 1512, "max_line_length": 79, "avg_line_length": 32.89021164021164, "alnum_prop": 0.5692941886185401, "repo_name": "jimbobhickville/libcloud", "id": "2b9b18a307e5f7ada53bc85ed26e197526e52c0d", "si...
from __future__ import print_function import os from optparse import make_option import urlparse from jinja2 import BaseLoader, Environment, TemplateNotFound import paramiko from paver.easy import * import yaml def host_task(f): return task(cmdopts([("host=", None, "The host for which to build")])(f)) @host_tas...
{ "content_hash": "a234eb7304d4f41373d519b4e7e03ff5", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 120, "avg_line_length": 37.509433962264154, "alnum_prop": 0.6427313883299799, "repo_name": "leonhandreke/configdich", "id": "5c8702ebf3c9031d2a78305e3b625f1090a136e3", "si...
""" Test loading cifar100. """ import os from dbcollection.utils.test import TestBaseDB # setup name = 'cifar100' task = 'classification' data_dir = os.path.join(os.path.expanduser("~"), 'tmp', 'download_data') verbose = True # Run tester tester = TestBaseDB(name, task, data_dir, verbose) tester.run('download')
{ "content_hash": "36a5812cec1073aa817364896bef8c75", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 72, "avg_line_length": 18.58823529411765, "alnum_prop": 0.7151898734177216, "repo_name": "farrajota/dbcollection", "id": "6d01205e020ed35447405e55d8aa1ac124b8499c", "size":...
__author__ = 'Nils Schmidt' class ShellCmdWrapper: """ Attributes ---------- shell_prefix : str, optional ( default is the class name ) Name of the shell command to be wrapped. process : subprocess32.Popen """ def __init__(self): # TODO: #2: DOC super(ShellCmdWrap...
{ "content_hash": "dc7e3fbb62c386e724c90c28d3336861", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 62, "avg_line_length": 22.52, "alnum_prop": 0.5701598579040853, "repo_name": "miniworld-project/miniworld_core", "id": "90614cb3d95b43ce330b40eb44df877772ff0050", "size": "...
import math from metwit import Metwit from flask import Flask, request, jsonify, render_template app = Flask(__name__) app.debug = True error_codes = { 'NO_RESULTS': 1 } weather_statuses = { 'unknown': 0, 'sunny': 1, 'rainy': 2, 'stormy': 3, 'snowy': 4, 'partly_cloudy': 5, 'cloudy':...
{ "content_hash": "23954ac637841d1f13339712472acebc", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 79, "avg_line_length": 22.423076923076923, "alnum_prop": 0.5604631217838765, "repo_name": "patrick91/MetwitPebble", "id": "451e58094e2cc27341d5a929ddb85255626e5b7d", "size...
from queue import Queue from microrpc import Server queues = {} server = Server() @server.rpc def create(name): if name not in queues: queues[name] = Queue() return True return False @server.rpc def delete(name): if not queues.pop(name, False): return False return True @serve...
{ "content_hash": "50f2b8c5f72be67a52bb6e3ba2da1a03", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 35, "avg_line_length": 15.620689655172415, "alnum_prop": 0.6534216335540839, "repo_name": "jasonjohnson/microq", "id": "2f01368269b9a6a6646084ad88b1861e5dd93688", "size": "...
"""ImportLite setup module. Based on the example at https://github.com/pypa/sampleproject. """ from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setu...
{ "content_hash": "bf2957f7938b67a8e6c50401b3609903", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 63, "avg_line_length": 32.175, "alnum_prop": 0.5656565656565656, "repo_name": "KatrinaE/importlite", "id": "793b19497df9f81dd9891d06fe355e034f9745de", "size": "1287", "bi...
import sqlite3 from utils import error_printer class DBHandler: """ A class which will handle any and all database operations. """ def __init__(self, db_name='blobs.db'): self.db = db_name self.open = False self.conn = self.open_db_conn() self.conn.text_factory = str ...
{ "content_hash": "25c855f3bb7030e2ab24bc1fcd627eb4", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 78, "avg_line_length": 32.75, "alnum_prop": 0.48584092588032507, "repo_name": "GrappigPanda/GithubTODOScraper", "id": "9ebd5cd2ccedec09b6ca8db024209c926306c848", "size": "...
"""Common tests for metaestimators""" import pytest import functools import numpy as np from sklearn.base import BaseEstimator from sklearn.externals.six import iterkeys from sklearn.datasets import make_classification from sklearn.utils.testing import assert_true, assert_false, assert_raises from sklearn.utils.vali...
{ "content_hash": "04832c56ec6e4c1b6cc92dc256ba0231", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 79, "avg_line_length": 36.361702127659576, "alnum_prop": 0.5835771406280476, "repo_name": "vortex-ape/scikit-learn", "id": "1c2d5a0873cd985a2c79501f64291544bf1fd85a", "siz...
from django.contrib import admin from .models import AccountTypes, CashInflow, CashOutflow, ChartOfAccounts admin.site.register(CashInflow) admin.site.register(CashOutflow) admin.site.register(ChartOfAccounts) admin.site.register(AccountTypes)
{ "content_hash": "4e72b0481deee3135b78d227a5c0ef1b", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 74, "avg_line_length": 27.444444444444443, "alnum_prop": 0.8421052631578947, "repo_name": "jrmanrique/ekalay-finance", "id": "a01999b64a2c15a87afbae15cc3d59206eb554aa", "siz...
import warnings from functools import partial import numpy as np from astropy import units as u from astropy.modeling.convolution import Convolution from astropy.modeling.core import SPECIAL_OPERATORS, CompoundModel from astropy.nddata import support_nddata from astropy.utils.console import human_file_size from astro...
{ "content_hash": "42625dc33aae1612838a793afe41f504", "timestamp": "", "source": "github", "line_count": 1069, "max_line_length": 100, "avg_line_length": 41.57717492984097, "alnum_prop": 0.6124735634252801, "repo_name": "astropy/astropy", "id": "9ae234f59819da1fb9649b8d02b8cf86d3397cf5", "size": "44...
from openerp.osv import fields, osv class mrp_workcenter_load(osv.osv_memory): _name = 'mrp.workcenter.load' _description = 'Work Center Load' _columns = { 'time_unit': fields.selection([('day', 'Day by day'),('week', 'Per week'),('month', 'Per month')],'Type of period', required=True), 'm...
{ "content_hash": "e4e501cd83c45ad0737919a8b082fa74", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 143, "avg_line_length": 36.142857142857146, "alnum_prop": 0.583399209486166, "repo_name": "ntiufalara/openerp7", "id": "265c6ddcea04f4e588fe95b9d1e79e17eb187de6", "size": "...
""" Django settings for esite project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
{ "content_hash": "510d7749ce8a33729ee4be17e075ae73", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 95, "avg_line_length": 26.69832402234637, "alnum_prop": 0.6258631512868801, "repo_name": "vollov/filemanager", "id": "fae0a030b82e5d8d15a3963d609df9f0a1783676", "size": "4...
from __future__ import absolute_import from django.db import models from django.utils import timezone from sentry.db.models import FlexibleForeignKey, Model, sane_repr from sentry.utils.cache import memoize from sentry.utils.hashlib import md5 class EventUser(Model): __core__ = False project = FlexibleFore...
{ "content_hash": "afbcbbd43fc54d1e6c8b8f52a275bc63", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 82, "avg_line_length": 34.111111111111114, "alnum_prop": 0.6240111679851094, "repo_name": "Natim/sentry", "id": "18d46930063a99f87c38dc47cad7df74f8ec26e2", "size": "2149", ...
import Adafruit_BBIO.GPIO as GPIO import time import subprocess # Define program constants BUTTON_PIN = 'P9_11' LED_PIN = 'P9_12' # Configure the GPIO pins and set the initial state of variables to track the # state of the button. GPIO.setup(BUTTON_PIN, GPIO.IN) GPIO.setup(LED_PIN, GPIO.OUT) GPIO.output(LED_PIN, G...
{ "content_hash": "3a6bef5c8a369c7e9f7b738fc9dda366", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 77, "avg_line_length": 29.09090909090909, "alnum_prop": 0.7166666666666667, "repo_name": "SpinStabilized/bbb-primer", "id": "4d46c491f9cf3f662ac22651210c7f219262f897", "siz...
_global_iana_crypt_hash_nsp = 'urn:ietf:params:xml:ns:yang:iana-crypt-hash' _global_iana_if_type_nsp = 'urn:ietf:params:xml:ns:yang:iana-if-type' _global_ietf_diffserv_classifier_nsp = 'urn:ietf:params:xml:ns:yang:ietf-diffserv-classifier' _global_ietf_diffserv_policy_nsp = 'urn:ietf:params:xml:ns:yang:ietf-diffserv-po...
{ "content_hash": "cf868605c8f4315162d4b267ea6f9355", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 166, "avg_line_length": 89.88888888888889, "alnum_prop": 0.6824783683559951, "repo_name": "111pontes/ydk-py", "id": "31b94f6398fea4b3ea0bc717a569b80f03bfb9df", "size": "38...
import boto3 import logging import json import datetime import tempfile logger = logging.getLogger() logger.setLevel(logging.INFO) import listRecords def lambda_handler(event, context): bucket = 'ictrp-data' key = 'idlist/ictrp-idlist-non-nct-{}.txt'.format(datetime.datetime.today().strftime('%Y%m%d')) i...
{ "content_hash": "983356bb94ba4c1480d59e44018c23c6", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 99, "avg_line_length": 30.869565217391305, "alnum_prop": 0.676056338028169, "repo_name": "gertvv/ictrp-retrieval", "id": "78efd67996e6b0875ab928a1ea91b336e823c2d8", "size":...
''' Global settings module for Color Switch By @blopker ''' import sublime import os plugin_name = 'ColorSwitch' FOLDER_REL = 'Packages/User/' + plugin_name FOLDER_THEMES_REL = FOLDER_REL + '/themes' FOLDER_ABS = None FOLDER_THEMES_ABS = None PLUGIN_PREF = 'ColorSwitch.sublime-settings' SUBLIME_PREF = 'Preferences.su...
{ "content_hash": "418e364eacfd5868828b07061e30371f", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 75, "avg_line_length": 19.3943661971831, "alnum_prop": 0.690631808278867, "repo_name": "blopker/Color-Switch", "id": "5f7d71c97aaccb46bfcbdc0670ce9f3096e848d2", "size": "13...
"""Settings that need to be set in order to run the tests.""" import os DEBUG = True USE_TZ = True SITE_ID = 1 APP_ROOT = os.path.abspath( os.path.join(os.path.dirname(__file__), '..')) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } MIDDLEWARE...
{ "content_hash": "86a90fdf3856e07b50c16ad90db5eb2c", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 64, "avg_line_length": 25.5974025974026, "alnum_prop": 0.6884830035514967, "repo_name": "fedosov/django-generic-ratings", "id": "59d82cfafa93c754901638c0f83c309c3b1c7109", ...
from bottle import Bottle, route, run, template, static_file, get, jinja2_template as template, post, request, response, redirect import runtime import actions import json import requests from datetime import datetime from dateutil import parser """ GetTimeDiff @param[in] time1, time2 @param[out] timeDiff """ defau...
{ "content_hash": "43ad6177d1add6073434f2e29261e5f0", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 214, "avg_line_length": 41.895833333333336, "alnum_prop": 0.7230233714569866, "repo_name": "sebcreme/SmartAlarmClock", "id": "7722270c0fda10c690b113a801ff6091fefccb27", "si...
from __future__ import print_function import scipy.sparse as sp import csv from coclust.CoclustSpecMod import CoclustSpecMod file_name = "./datasets/classic3.csv" csv_file = open(file_name, 'rb') csv_reader = csv.reader(csv_file, delimiter=",") nb_row, nb_col, nb_clusters = map(int, csv_reader.next()) X = sp.lil_matr...
{ "content_hash": "5c299350c5e1cf5ec7597b7b79be5ea9", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 58, "avg_line_length": 29.166666666666668, "alnum_prop": 0.6828571428571428, "repo_name": "sh4rkman/CoPub", "id": "654b84b31f9e6ef13ee8840edd1ba8fa178e8e01", "size": "700",...
from collections import namedtuple from django.db import models from corehq.apps.data_analytics.const import NOT_SET, DEFAULT_EXPERIENCED_THRESHOLD, DEFAULT_PERFORMANCE_THRESHOLD GIRExportRow = namedtuple('GIRExportRow', 'domain country sector subsector bu self_service test start device ac...
{ "content_hash": "6a103e5d2a5d6f656cebd4b92bc8c709", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 114, "avg_line_length": 48.088, "alnum_prop": 0.6226917318249875, "repo_name": "qedsoftware/commcare-hq", "id": "c4e3ea95dc0be7fbe51a4bd291188d55e1fbe477", "size": "6011",...
"""Helper script to copy files at build time. This is easier than trying to detect whether to use copy, cp, or something else. """ import shutil import typing as T def run(args: T.List[str]) -> int: try: shutil.copy2(args[0], args[1]) except Exception: return 1 return 0
{ "content_hash": "f68ef2b16d16bfdf8e27ff8a13d3ab48", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 80, "avg_line_length": 20.2, "alnum_prop": 0.6534653465346535, "repo_name": "pexip/meson", "id": "acef2a89bf4974cb730a3dcde2b0b88dc114fe16", "size": "379", "binary": fals...
from .resource import Resource class PublicIPAddress(Resource): """Public IP address resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: str :ivar type: Resou...
{ "content_hash": "2f95fca4a88818da661c3d57c3e631aa", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 101, "avg_line_length": 45.67032967032967, "alnum_prop": 0.6470163618864293, "repo_name": "lmazuel/azure-sdk-for-python", "id": "136b42ddce12dbf473bb678eb63f11d736460b2e", ...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('edegal', '0009_auto_20180919_080...
{ "content_hash": "6813db73b9cbe589571933e460e7e617", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 121, "avg_line_length": 31.115384615384617, "alnum_prop": 0.6452410383189122, "repo_name": "conikuvat/edegal", "id": "a4b7be9b8626760ebc8f547f6eb26b6c09d225fd", "size": "88...
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class BitlyAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get('profile_url') def get_avatar_url(self): return self.a...
{ "content_hash": "e677044b07ffb1ab401ff44413b3620b", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 74, "avg_line_length": 27.151515151515152, "alnum_prop": 0.6428571428571429, "repo_name": "AltSchool/django-allauth", "id": "6a80f92c6055b8fa3a42bed5f43eda46f0ebc8a2", "siz...
from string import Template from datetime import date bitcoinDir = "./"; inFile = bitcoinDir+"/share/qt/Info.plist" outFile = "Bells-Qt.app/Contents/Info.plist" version = "unknown"; fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro" for line in open(fileForGrabbingVersion): lineArr = line.replace(" ", "...
{ "content_hash": "26de4ae27c76807eff7887ebc4d90c55", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 69, "avg_line_length": 27.125, "alnum_prop": 0.7081413210445469, "repo_name": "bells-coin/bells-coin", "id": "c6d0a0c184820bbc36ba2337c5676a2c20773e87", "size": "891", "b...
import os import gevent import pkgutil import importlib import trace from work_queue import WorkQueue from sandesh_logger import SandeshLogger from sandesh_client import SandeshClient from sandesh_http import SandeshHttp from sandesh_uve import SandeshUVETypeMaps, SandeshUVEPerTypeMap from sandesh_stats import SandeshS...
{ "content_hash": "ab8312cda9478fedf30b90d429682a04", "timestamp": "", "source": "github", "line_count": 718, "max_line_length": 82, "avg_line_length": 32.6991643454039, "alnum_prop": 0.558821023937303, "repo_name": "JioCloud/contrail-sandesh", "id": "22b3e978106f5bb10eb2ee9b54661aa624736d60", "size...
import glob import matplotlib.pyplot as plt import numpy as np import os import pickle import sys sys.path.append("..") from demo_2_awac import och_2_awac def end_relabel(path): o_size = path['observations'].shape[1] // 2 path['observations'][:, o_size:] = path['observations'][-1, :o_size] path['next_obse...
{ "content_hash": "72d198b6c3d70729623c8afcb4cfb6f9", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 111, "avg_line_length": 35.69230769230769, "alnum_prop": 0.6501436781609196, "repo_name": "google-research/DBAP-algorithm", "id": "16492762cc1f028b472b41af6d30d01d3f43f320", ...
from distutils.core import setup def _read(fname): import os return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='pykmaze', version='0.2.0', description='Keymaze 500-700 communicator', author='Emmanuel Blot', author_email='emmanuel.blot@free.fr', license='MIT...
{ "content_hash": "c79dd7689dd3936f651f551ec6e1f596", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 70, "avg_line_length": 33.878787878787875, "alnum_prop": 0.6118067978533095, "repo_name": "eblot/pykmaze", "id": "7c7a1e8e14afc48a8c148c89f88a62f0a81bbeee", "size": "2290",...
from __future__ import absolute_import, division, print_function class TextLog(object): """ A log superclass which provides string handling methods, intended for logs which will use line-based text. This class does not implement a usable log by itself, and is intended to be subclassed. """ def...
{ "content_hash": "813bdd62a3a339e66741c3b054084020", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 37.42857142857143, "alnum_prop": 0.6889312977099237, "repo_name": "storborg/manhattan", "id": "7bba80aa64117543ca2bff694577304662a1afcb", "size": "52...
""" definitions for Data Types """ # TODO - consider server providing types, similar to commands __all__ = ['dtypes', 'vector', 'datetime', 'matrix'] import numpy as np import json import re from pyspark.sql import types import logging logger = logging.getLogger('sparktk') from datetime import datetime import dateu...
{ "content_hash": "74a5127189b99fb8d9ef4f7ca8fe1612", "timestamp": "", "source": "github", "line_count": 460, "max_line_length": 191, "avg_line_length": 31.93695652173913, "alnum_prop": 0.5890000680688857, "repo_name": "rodorad/spark-tk", "id": "47588a448165c0352758625a1dfd1b6f656fc367", "size": "15...
"""Tests for spline models and fitters""" import unittest.mock as mk import numpy as np import pytest from numpy.testing import assert_allclose from astropy.modeling.core import FittableModel, ModelDefinitionError from astropy.modeling.fitting import ( SplineExactKnotsFitter, SplineInterpolateFitter, SplineSmooth...
{ "content_hash": "a19d90b093463504d24c171afda70e77", "timestamp": "", "source": "github", "line_count": 1495, "max_line_length": 98, "avg_line_length": 36.00401337792642, "alnum_prop": 0.5556236762902687, "repo_name": "lpsinger/astropy", "id": "762dfda74aa2afdfee2a9e2f8e91baf4090c6e95", "size": "53...
import serial import MySQLdb import json # CLASES. class ValorArduino(object): def __init__(self, luz, temperatura, ph, humedad, regando): self.luz = float(luz) self.temperatura = float(temperatura) self.ph = float(ph) self.humedad = float(humedad) self.regando = int(regand...
{ "content_hash": "5e5cdce4906539691a77ef5dd51a0080", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 80, "avg_line_length": 30.407894736842106, "alnum_prop": 0.6668109043704025, "repo_name": "salcedojose/LaLluvia", "id": "3cc1ceeab2776ad282df7df22b6090bff4edb9b7", "size": ...
import re from structs.nest import * def nu(base): def dep(filename): raw = re.sub("(?P<pre>.*)" + base + "/(?P<package>.+)/(?P<module>.+?)\.js$", "\g<package>.\g<module>", filename) return re.sub("/", ".", raw) def pattern(word): return '' + word + '.js' def path(d): qu...
{ "content_hash": "676ab1b2a6144ec384085ebf650a5337", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 120, "avg_line_length": 26.208333333333332, "alnum_prop": 0.48966613672496023, "repo_name": "boltjs/bolt", "id": "fa9692f66604251a515ad407482f094383af6187", "size": "629", ...
from __future__ import unicode_literals from django.db import models, migrations import uuid class Migration(migrations.Migration): dependencies = [ ('visit', '0029_caregiver_key'), ] operations = [ migrations.AlterField( model_name='caregiver', name='key', ...
{ "content_hash": "91e7694a993b11101051b534efc1a1d3", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 84, "avg_line_length": 21.94736842105263, "alnum_prop": 0.6115107913669064, "repo_name": "koebbe/homeworks", "id": "2756f53c5cab874f782d3107bf48d7d86a3d65c3", "size": "441"...
import smtplib from email.mime.text import MIMEText __author__ = 'hiroki' def send_mail(source, destination, message, subject): ''' Send mail. :param source: Address of the source.. :param destination: Address of the destination :param message: Message. :param subject: Subject :return: ...
{ "content_hash": "056bb16baa2bedf4a3a43d77294a824c", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 59, "avg_line_length": 26.238095238095237, "alnum_prop": 0.6533575317604355, "repo_name": "Kokemomo/Kokemomo", "id": "48acef5cb69edb155725f68c9335351dc634e0ac", "size": "59...
from sqlalchemy import orm from ggrc import db from ggrc.models.mixins import Base class ObjectFile(Base, db.Model): __tablename__ = 'object_files' file_id = db.Column(db.String, nullable=False) parent_folder_id = db.Column(db.String, nullable=True) fileable_id = db.Column(db.Integer, nullable=False) file...
{ "content_hash": "ee2d7796994b654f5ba98700ef49313e", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 72, "avg_line_length": 26.420289855072465, "alnum_prop": 0.6500274273176083, "repo_name": "edofic/ggrc-core", "id": "714a6d6953eeced55aae5c4f8116869ee083ce2c", "size": "193...
import unittest from couchdbkit import * from pyramid import testing from .views import * from .models import * import uuid class ModelTests(unittest.TestCase): def setUp(self): self.config = testing.testConfig() def tearDown(self): testing.tearDown() def test_create_user(self): u...
{ "content_hash": "e6078fdc68c2660875cf7b721b7698d8", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 68, "avg_line_length": 22.19047619047619, "alnum_prop": 0.6781115879828327, "repo_name": "adlnet/LR-Lite", "id": "c249e30286dac17d5864ba4701b41de103144fb7", "size": "466", ...
from django.db import models from django.utils.translation import ugettext_lazy as _ from reversion import revisions from autoslug import AutoSlugField from parler.models import TranslatedFields, TranslatableModel from parler.managers import TranslatableQuerySet, TranslatableManager from democracy.models.comment impor...
{ "content_hash": "ede23705dec0d845b27c1fe195d2cad9", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 113, "avg_line_length": 40.62043795620438, "alnum_prop": 0.6972147349505841, "repo_name": "stephawe/kerrokantasi", "id": "5e3c28829922492a76f9b3db3c6503bc313a87d4", "size"...