text
stringlengths
4
1.02M
meta
dict
from __future__ import print_function import io import os import sys import json import multiprocessing class Setup(object): OPT_BOOL = {"Y": True, "n": False} OPT_SIGNATURE = {"Y": "optional", "n": "required"} OPT_FILE_FORMAT = ["csv", "json"] OPT_DIALECTS = {"abs": "Azure Blob Storage", "aqs": "Azur...
{ "content_hash": "ad6d5e7c8593b9dfc2820d905ae1a497", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 196, "avg_line_length": 41.63636363636363, "alnum_prop": 0.599617903930131, "repo_name": "wunderlist/hamustro", "id": "b89025f836a6e06650259013a3b44e60a010731b", "size": "...
from django.contrib import admin from models import TransactionStatus, SofortTransaction class TransactionStatusInline(admin.TabularInline): model = TransactionStatus readonly_fields = ('status', 'reason', 'created_at') can_delete = False extra = 0 class TransactionAdmin(admin.ModelAdmin): date_...
{ "content_hash": "d73b4b6c2944309778b793bdaa759202", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 145, "avg_line_length": 37.758620689655174, "alnum_prop": 0.6904109589041096, "repo_name": "piquadrat/django-shop-sofortpayment", "id": "312f46872ded0e83036701e3a7e2851c27d89...
def skip_has_account_middleware(func): """ Decorator to exempt certain views from the HasAccountMiddleware check """ func.skip_has_account_middleware = True return func
{ "content_hash": "c2ab3010e183e87b981dfe0cdb8d8cbd", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 73, "avg_line_length": 31.5, "alnum_prop": 0.708994708994709, "repo_name": "ulope/guardhouse", "id": "736b3b119925c714ec3dcb932439bf48674d19f1", "size": "190", "binary": f...
""" Django settings for ecommerce project. Generated by 'django-admin startproject' using Django 1.8. 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 path...
{ "content_hash": "8829e194b166aa65fe5a724dfe775c95", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 87, "avg_line_length": 24.80536912751678, "alnum_prop": 0.6920995670995671, "repo_name": "joshdavies89/e-commerce", "id": "e4adc543a818eac7837af56a761a016dcc23ab42", "size...
"""Client support for network related api calls.""" import json from hil.client.base import ClientBase from hil.client.base import check_reserved_chars class Network(ClientBase): """Consists of calls to query and manipulate network related objects and relations. """ def list(self): """Lists ...
{ "content_hash": "1193ec3b9579d64ba710c2262d5803d0", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 75, "avg_line_length": 35.2, "alnum_prop": 0.6006493506493507, "repo_name": "CCI-MOC/haas", "id": "0c405e087c325427f19a5ecc1dcb53201924d43a", "size": "2464", "binary": fa...
import unittest from pale import Resource, ResourcePatch from pale.fields import (BaseField, IntegerField, ListField, ResourceField, ResourceListField, StringField) class Stats(object): def __init__(self): self.logins = 0 class Counter(object): def __init__(self, key, value=0): self...
{ "content_hash": "74a243f57bc0294c46f18e0821b754ef", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 78, "avg_line_length": 26.125, "alnum_prop": 0.5902255639097744, "repo_name": "Loudr/pale", "id": "08d21518f2493ebe538718ec6342e35d5a1f85f9", "size": "2950", "binary": f...
""" A full GN block has the following computation steps 1. Compute updated edge attributes 2. Aggregate edge attributes per node 3. Compute updated node attributes 4. Aggregate edge attributes globally 5. Aggregate node attributes globally 6. Compute updated global attribute [1] https://arxiv.org/pdf/1806.01261....
{ "content_hash": "ad3138f851ccde13881b29be30baeeaa", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 115, "avg_line_length": 38.89949748743719, "alnum_prop": 0.61619945743444, "repo_name": "materialsvirtuallab/megnet", "id": "8f40d62cea2eacf7fadd75dd891697581fc0d2a4", "si...
from __future__ import division, print_function, unicode_literals import cv2 import numpy as np NORM_SIZE = (1100, 800) MERGE_SIZE = (700, 530) # ID number field NUM_FIELD = np.array([[450, 210], [920, 270]], dtype='int') NUM_TITLE = np.array([[0, 0], [70, 60]], dtype='int') # Name field NAME_FIELD = np.array([[340, ...
{ "content_hash": "7997c59f3f395abc56f695ef51851b32", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 125, "avg_line_length": 31.240506329113924, "alnum_prop": 0.654578606158833, "repo_name": "trangnm58/idrec", "id": "c32a025b13c748110567cd852bce8d79d778813e", "size": "493...
def application(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) body = '<h1>Hello, %s!</h1>' % (environ['PATH_INFO'][1:] or 'web2') return [body.encode('utf-8')]
{ "content_hash": "20bfae7b10435f309ade7b49ba7d51f6", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 71, "avg_line_length": 42.2, "alnum_prop": 0.6018957345971564, "repo_name": "PeytonXu/learn-python", "id": "5de3a52b9e1735b90d8e73af1129e15207461c74", "size": "211", "bina...
from ._assets import ( Asset, Equity, Future, make_asset_array, CACHE_FILE_TEMPLATE ) from .assets import ( AssetFinder, AssetConvertible, AssetFinderCachedEquities ) __all__ = [ 'Asset', 'Equity', 'Future', 'AssetFinder', 'AssetFinderCachedEquities', 'AssetConve...
{ "content_hash": "2b606277821acd75807dfb1c73d8c035", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 32, "avg_line_length": 16.565217391304348, "alnum_prop": 0.6167979002624672, "repo_name": "nborggren/zipline", "id": "51b4358add28ba73d17c4b23b26ec0b752b4e7f6", "size": "96...
import warnings from odin.compatibility import deprecated class TestDeprecated: def test_function_deprecation_warning(self): @deprecated("No longer used.", category=UserWarning) def deprecated_function(): pass with warnings.catch_warnings(record=True) as warning_log: ...
{ "content_hash": "e15ded3624996751d54e6eea4ec0459e", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 91, "avg_line_length": 32.64705882352941, "alnum_prop": 0.6216216216216216, "repo_name": "python-odin/odin", "id": "46240ab8a91f8efe408c495d4d5c7b9d71966981", "size": "1110...
import logging import time import uuid import os import Queue import pytest from chatexchange.client import Client from chatexchange import events import live_testing logger = logging.getLogger(__name__) TEST_ROOMS = [ ('stackexchange.com', '14219'), # Charcoal Sandbox ] if (os.environ.get('TRAVIS_BUILD_I...
{ "content_hash": "e773f88a14d095dd50f718f672def405", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 81, "avg_line_length": 35.08205128205128, "alnum_prop": 0.6019587779564392, "repo_name": "hichris1234/ChatExchange", "id": "cba4cd1843bb9947e4bfcd28708deb08c2526223", "siz...
import os import unittest from Constants.PathConstants import PathConstants from Constants.MessageKeys import MessageKeys from Domain.Presentation import Presentation class PresentationTest(unittest.TestCase): def setUp(self): self.presentation = Presentation() self.presentation_filenames = ["a....
{ "content_hash": "c860072eed7dd3b1b5207736249a103c", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 138, "avg_line_length": 51.111111111111114, "alnum_prop": 0.7247282608695652, "repo_name": "RemuTeam/Remu", "id": "3a54acf423c25af4729de6d24208de89802d2f4d", "size": "3680"...
from __future__ import division import os.path import random import urllib from datetime import datetime try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from PIL import Image from django.db import models from django.conf import settings from django.core.urlresolvers impo...
{ "content_hash": "2f585f64a7ce8e9e4c9ab8a9267a213b", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 103, "avg_line_length": 35.89, "alnum_prop": 0.6057397603789356, "repo_name": "mollyproject/mollyproject", "id": "44938bd29fae370c0dd23018a15f394e26eff55d", "size": "3589"...
"""Functions and classes related to optimization (weight updates). Source: https://github.com/google-research/bert """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import tensorflow as tf def create_optimizer(loss, init_...
{ "content_hash": "cc6fae0dd6721a15cc24d2b00ed59e8e", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 78, "avg_line_length": 34.40340909090909, "alnum_prop": 0.6340214698596202, "repo_name": "google-research/google-research", "id": "58126fd26bf6816b5e8ae6fe055393db494407bf",...
from __future__ import unicode_literals import datetime import math import os import re import tokenize import unittest import warnings from django.core.validators import RegexValidator, EmailValidator from django.db import models, migrations from django.db.migrations.writer import MigrationWriter, SettingsReference ...
{ "content_hash": "99f471cfe2397edbae4c98b556cec16c", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 126, "avg_line_length": 45.85558583106267, "alnum_prop": 0.6405609364786975, "repo_name": "webostin/django-btc", "id": "5e7e8b75cdac54bd84f14749be1aa5eaec565e47", "size": ...
from django.core.management.base import BaseCommand from dashboard.models import User, App, APICall, Webhook, WebhookTriggerHistory class Command(BaseCommand): help = 'Cleans Dashboard of everything' def handle(self, *args, **options): string = input("THIS WILL WIPE THESE MODELS ARE YOU S...
{ "content_hash": "b9a54e8188b59c65d60b4bc6d9788cf2", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 79, "avg_line_length": 35.55555555555556, "alnum_prop": 0.6078125, "repo_name": "uclapi/uclapi", "id": "975a8fb496a42ce8f844e09b00e9d873ba96e0c1", "size": "640", "binary"...
import os import re import sys INCLUDE_DIRECTIVE_RE = re.compile(r'^#include "(.*)"') RUNTIME_LAYER_HEADERS = [ 'runtime/vm/isolate.h', 'runtime/vm/object.h', 'runtime/vm/raw_object.h', 'runtime/vm/thread.h', ] SHOULD_NOT_DEPEND_ON_RUNTIME = [ 'runtime/vm/allocation.h', 'runtime/vm/growable_a...
{ "content_hash": "a2b50d11663c1d3694e8b0efb817837c", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 80, "avg_line_length": 34.747899159663866, "alnum_prop": 0.5535671100362757, "repo_name": "dart-lang/sdk", "id": "e8c955a0ee078a6ed2cc225e9f63e276252e2767", "size": "4631"...
import marioai __all__ = ['Task'] class Task(object): '''A task handles communication with the environment. It decides how to evaluate the observations, potentially returning reinforcement rewards or fitness values. Furthermore it is a filter for what should be visible to the agent. Also, it can p...
{ "content_hash": "12200764e3442d106d412299d27bdf6e", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 76, "avg_line_length": 27.584615384615386, "alnum_prop": 0.5939765755716676, "repo_name": "renatopp/marioai", "id": "6073a7e4b07b8bb418789a838223c849f706f3f8", "size": "179...
import logging from django.conf.urls import url from django.core.exceptions import ImproperlyConfigured from .views import ActivitiesGenericObjectView from .views import ActivitiesView from .views import ActivityDeleteView from .views import ActivityEditView from .views import ActivityRepliesView from .views import A...
{ "content_hash": "4f8bc37319fc3c5036e40aeab9ab004c", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 143, "avg_line_length": 43.264, "alnum_prop": 0.6288831360946746, "repo_name": "InfoAgeTech/django-activities", "id": "293656d862d1d2de5de4b4e9cd9d2a14f3ed34df", "size": "...
''' Created on Nov 23, 2010 @author: bolme ''' import svm import numpy as np import tempfile import os class UntrainedClassifierError(Exception): pass class _LabelMap: '''Converts class labels back and forth to integer codes.''' def __init__(self): '''Create and initialze the mapping.''' ...
{ "content_hash": "ceea0f7687c5df7dd98a5ce20d2348f0", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 121, "avg_line_length": 29.44701986754967, "alnum_prop": 0.5469470369953896, "repo_name": "mikeseven/pyvision", "id": "317cd6fe128375681bc1069db8bdf7a13ed7fe98", "size": "...
import sys import json import time import random import hashlib import operator import bitcoinrpc import pybitcointools from decimal import * HEXSPACE='21' #change this to 21 if your hex decode is malformed, system dependent value if len(sys.argv) > 1 and "--force" not in sys.argv: print "Takes a list of bitcoin...
{ "content_hash": "ef923027b8268cac10b3db3479067345", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 378, "avg_line_length": 40.607438016528924, "alnum_prop": 0.6887147654421492, "repo_name": "thehobbit85/coinpowers", "id": "0575e096f2ad5737836607956afc98eb767fcdef", "siz...
""" commswave ========= Takes device communications up and down according to a timefunction. Comms will be working whenever the timefunction returns non-zero. Configurable parameters:: { "timefunction" : A timefunction definition "threshold" : (optional) Comms will only work when the timefunction ...
{ "content_hash": "23c6fe11ce677a7486cf13687e83c373", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 228, "avg_line_length": 48.65060240963855, "alnum_prop": 0.6619613670133729, "repo_name": "DevicePilot/synth", "id": "da77e9a33aefa09030505cc60fe92fd3ecc85acf", "size": "40...
""" BostonBikr.py will allow the user to import a map (from a SQL database or local files) and run path-finding calculations on it. """ from math import sin, cos, sqrt, atan2, acos, radians from Queue import Queue from sets import Set #import pymysql as mdb import pickle import networkx as nx import matplotlib.pyplot ...
{ "content_hash": "0db3a672a39d88f7a2246634cac6bcf8", "timestamp": "", "source": "github", "line_count": 561, "max_line_length": 139, "avg_line_length": 34.06951871657754, "alnum_prop": 0.6107361481714016, "repo_name": "gaurav-kaushik/BostonBikr", "id": "bf7617a5528db8f714ca07aea6d7cac5982ed152", "s...
import sys import gzip allS = gzip.open(sys.argv[2]) allPeaks = {} otherPeaks = {} otherPercs = {} otherIntervals = {} for i in range(1, 23): allPeaks["chr%d" % i] = [] otherPeaks["chr%d" % i] = [] # read in all autosomal peaks for line in allS: parts = line.strip().split() chrom = parts[0] if ch...
{ "content_hash": "e4fba9394a326b5753fba3babc6db2d5", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 281, "avg_line_length": 30.536585365853657, "alnum_prop": 0.5191693290734825, "repo_name": "shendurelab/cfDNA", "id": "f31a74c06db8814db96fa897bca071fecd021029", "size": "...
import copy import unittest import numpy import chainer from chainer.backends import cuda from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr from chainer.testing import condition class TestHuffmanTree(unittest.TestCase): def test_empty(self...
{ "content_hash": "3ec22ea545d9573f084149d03e3963a6", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 75, "avg_line_length": 32.747747747747745, "alnum_prop": 0.5716643741403026, "repo_name": "aonotas/chainer", "id": "ead908e34f0b92f27203a893fd73b975f7759894", "size": "363...
import numpy as np from skimage.util import img_as_float class FeatureDetector(object): def __init__(self): self.keypoints_ = np.array([]) def detect(self, image): """Detect keypoints in image. Parameters ---------- image : 2D array Input image. ...
{ "content_hash": "0e7184a87652f5aa03ed1adf871e2185", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 79, "avg_line_length": 29.354037267080745, "alnum_prop": 0.5854845535336437, "repo_name": "chintak/scikit-image", "id": "8ee2baf8470ae3d11bb94141fd35015ce6685bcc", "size":...
""" Support for Västtrafik public transport. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.vasttrafik/ """ from datetime import datetime from datetime import timedelta import logging import voluptuous as vol import homeassistant.helpers.config_...
{ "content_hash": "c2579ba4d5f3feec9328b4da049dea6d", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 75, "avg_line_length": 33.28378378378378, "alnum_prop": 0.6033292732440114, "repo_name": "HydrelioxGitHub/home-assistant", "id": "8148a5c2fc7bdf2b43ce0e8303595a0e81ded94a", ...
import json import numpy as np from shapely.geometry import LineString, Point from modules.planning.proto import planning_pb2 from common.statistical_analyzer import StatisticalAnalyzer from common.statistical_analyzer import PrintColors from common.distribution_analyzer import DistributionAnalyzer from common.error_c...
{ "content_hash": "07bfaef0f24b314587b500f4c88037b4", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 89, "avg_line_length": 39.924778761061944, "alnum_prop": 0.5777457608334257, "repo_name": "msbeta/apollo", "id": "6c3b8912e4c474a21cd09731f9bd120d70dddc15", "size": "9807"...
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): # Adding model 'CoreReplicationTopology' db.create_table(u'physical_corereplicationtopology', ( ...
{ "content_hash": "9a4e4d9e8e29c7594085933b9287ae13", "timestamp": "", "source": "github", "line_count": 419, "max_line_length": 239, "avg_line_length": 93.05489260143199, "alnum_prop": 0.5647088997178764, "repo_name": "globocom/database-as-a-service", "id": "c5b0a451ae0ab151b1753db5639378cda17e65b7",...
"""Test the wallet.""" from decimal import Decimal import time from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_array_result, assert_equal, assert_fee_amount, assert_raises_rpc_error, connect_nodes_bi, wait_until, ) class WalletTest(Bitco...
{ "content_hash": "d29ffe4c3c45a09493fa3eac9c434874", "timestamp": "", "source": "github", "line_count": 530, "max_line_length": 193, "avg_line_length": 50.74716981132075, "alnum_prop": 0.6284949434860202, "repo_name": "nikkitan/bitcoin", "id": "ce04110240e6da032b6346492ac01e14214752a0", "size": "27...
class CException(Exception): message = '' err_no = -1 def __init__(self, err_no, message=''): self.err_no = err_no self.message = message def __str__(self): if self.message == '': return ('An Unknown C exception occurred! Error: {}' .format(self....
{ "content_hash": "2d2c238d8029bae6d8c88f169afb290f", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 78, "avg_line_length": 46.03846153846154, "alnum_prop": 0.55583402951824, "repo_name": "jvanbrug/netflix", "id": "73eaa654fd5d80916001b71ff9e995c2f9885703", "size": "3591",...
import os from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account # To set up environmental variables, see http://twil.io/secure account_sid = os.environ['TWILIO_ACCOUNT_SID'] auth_token = os.environ['TWILIO_AUTH_TOKEN'] client = Client(account_sid, auth_token) token = client.tok...
{ "content_hash": "20882f1f751c54c02bd8f674f6255eda", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 62, "avg_line_length": 32.27272727272727, "alnum_prop": 0.7661971830985915, "repo_name": "TwilioDevEd/api-snippets", "id": "1df0c780a0bd1e6796fadf8ac8e5ea3e55afbb7e", "size...
def reduce_columns(question): """ Coursera formats survey responses as columns per available responses for multiple choice questions. This function reduces the dimensionality of each question to a single column. Typically the input should look like: question = reduce_columns(survey[survey_ques...
{ "content_hash": "eac584afd3d43cd67b1ded432283b734", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 118, "avg_line_length": 30.825, "alnum_prop": 0.5904298459042985, "repo_name": "mnky9800n/GT-Coursera-Data-Wrangler", "id": "496d27b39f42e7c92dfeb07126b90d0ee14c7eec", "siz...
__version__ = '0.14.2a0' from . import hdrs # noqa from .protocol import * # noqa from .connector import * # noqa from .client import * # noqa from .errors import * # noqa from .helpers import * # noqa from .parsers import * # noqa from .streams import * # noqa from .multidict import * # noqa __all__ = (cl...
{ "content_hash": "c7596d9b060c05cb316764144d68b5b0", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 35, "avg_line_length": 25.130434782608695, "alnum_prop": 0.5173010380622838, "repo_name": "saghul/aiohttp", "id": "ff5dd4100e935c976968f92cbd7ee21d8c566e0d", "size": "647",...
""" Device for Zigbee Home Automation. For more details about this component, please refer to the documentation at https://home-assistant.io/integrations/zha/ """ import asyncio from datetime import timedelta from enum import Enum import logging import time import zigpy.exceptions import zigpy.quirks from zigpy.profi...
{ "content_hash": "f4f862d99d892468203c577ced4994aa", "timestamp": "", "source": "github", "line_count": 513, "max_line_length": 87, "avg_line_length": 33.853801169590646, "alnum_prop": 0.5836932112627397, "repo_name": "qedi-r/home-assistant", "id": "e5d1678ad6fa314cae030f7ffdaf68c5a039d381", "size"...
import shlex import subprocess import tempest.cli as cli from tempest.openstack.common import log as logging from tempest.tests import base LOG = logging.getLogger(__name__) class StressFrameworkTest(base.TestCase): """Basic test for the stress test framework. """ def _cmd(self, cmd, param): ""...
{ "content_hash": "e983ecb252c33a1f3ca4560169cb58db", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 69, "avg_line_length": 31.525, "alnum_prop": 0.5408406026962728, "repo_name": "vmahuli/tempest", "id": "5a334c53902f2b942527155fc6b18dc0b09ca11d", "size": "1896", "binary...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf def get_options(option_type): """ option_type: string 'training' or 'diplay' or 'visualize' """ # name tf.app.flags.DEFINE_string("training_name","allrob_v1","name of...
{ "content_hash": "20eda44beb5e531b4fad71a783b16668", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 133, "avg_line_length": 55.013513513513516, "alnum_prop": 0.7054777695897814, "repo_name": "TheTazza/StRADRL", "id": "a702acde9726e733d34c4242843d96d3bb334416", "size": "40...
"""Test ESPEI's database utilities Tests in here are heavily parameterized and represent a large fraction of the number of tests, but a small amount of coverage. """ from pycalphad import variables as v import pytest import symengine from symengine import Piecewise, Symbol import espei.refdata from espei.database_ut...
{ "content_hash": "3275b95afd58fb069086a16c60fc7d2a", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 110, "avg_line_length": 36.46218487394958, "alnum_prop": 0.6084351233002996, "repo_name": "PhasesResearchLab/ESPEI", "id": "a46320575a8b745038009680e358c43a637be46e", "siz...
from tempfile import NamedTemporaryFile from pprint import pformat from itertools import product from sklearn import tree import pandas as pd from collections import Counter from six import StringIO from drain import util, step def explore(steps, reload=False): return StepFrame(index=step.load(steps, reload=rel...
{ "content_hash": "b5ff04bfd0fa45c88ff650398f6c48b4", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 96, "avg_line_length": 35.34754098360656, "alnum_prop": 0.6160838512197384, "repo_name": "potash/drain", "id": "c54427a3400d2b655c2109be327495431bfad944", "size": "10781",...
__author__ = 'Charles Hong' __emailID__ = 'csh6cw' from helper import greeting from goodbye import farewell from quack import quack if __name__ == '__main__': greeting('hello') quack('(quack)') quack('Surprise!') farewell('goodbye')
{ "content_hash": "09676bc468b144edd073f56c1a3a3c4a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 28, "avg_line_length": 20.916666666666668, "alnum_prop": 0.6374501992031872, "repo_name": "charleshong/cs3240-labdemo", "id": "1214e02f5d57ac620e5d70e07e2d1f8193a2adc1", "s...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('system', '0001_initial'), ] operations = [ migrations.CreateModel( name='DeviceGroup', fiel...
{ "content_hash": "10d83a9dc7bff991785268a296111d71", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 128, "avg_line_length": 32.71875, "alnum_prop": 0.5749761222540593, "repo_name": "buzzsurfr/lbm", "id": "751a5ca861727ed330e2549739b9a2c38d849e5d", "size": "1119", "binar...
from sklearn_explain.tests.skl_datasets import skl_datasets_test as skltest skltest.test_class_dataset_and_model("iris" , "AdaBoostClassifier_1")
{ "content_hash": "3576ebd972dbe7ad89938336ae846f20", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 75, "avg_line_length": 37, "alnum_prop": 0.7972972972972973, "repo_name": "antoinecarme/sklearn_explain", "id": "39728194ac402fbf8d043700b8dc7485ed61e397", "size": "148", ...
"""Tool to interactively call sl4a methods. SL4A (Scripting Layer for Android) is an RPC service exposing API calls on Android. Original version: https://github.com/damonkohler/sl4a Fork in AOSP (can make direct system privileged calls): https://android.googlesource.com/platform/external/sl4a/ Also allows access to...
{ "content_hash": "36db2cc5256b4a7921408a2bb61a4e53", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 80, "avg_line_length": 30.48076923076923, "alnum_prop": 0.6561514195583596, "repo_name": "l-meng/mobly", "id": "1006ff8800aa860c2d122f84b80ac8ce4fcba422", "size": "2188", ...
from .._abstract.abstract import BaseAGSServer import json from parameters import ClusterProtocol ######################################################################## class Clusters(BaseAGSServer): """ This resource is a collection of all the clusters created within your site. The Create Cluster operati...
{ "content_hash": "41d4d7ab6207757c3b5d2710c153214e", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 83, "avg_line_length": 42.79100529100529, "alnum_prop": 0.49057187017001547, "repo_name": "achapkowski/ArcREST", "id": "60577b1ac5fe3a6fed1ca95e0dc19f54680f8b6e", "size": ...
"""State variables for analysis solutions such as powerflow. """ from CIM14.CDPSM.GIS_Connectivity.IEC61970.StateVariables.SvTapStep import SvTapStep nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14?profile=http://iec.ch/TC57/2007/profile#StateVariables" nsPrefix = "cimStateVariables"
{ "content_hash": "f920b4512b3faed6326ce72b1085fc4d", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 105, "avg_line_length": 36.25, "alnum_prop": 0.7931034482758621, "repo_name": "rwl/PyCIM", "id": "b0a900115bb920ed5f5fdce22c994c34287a8f78", "size": "1390", "binary": fals...
"""Test the Foscam config flow.""" from unittest.mock import patch from libpyfoscam.foscam import ( ERROR_FOSCAM_AUTH, ERROR_FOSCAM_CMD, ERROR_FOSCAM_UNAVAILABLE, ERROR_FOSCAM_UNKNOWN, ) from homeassistant import config_entries, data_entry_flow from homeassistant.components.foscam import config_flow ...
{ "content_hash": "8e053f4ccbf65a334fc484c91c77b456", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 88, "avg_line_length": 32.02429149797571, "alnum_prop": 0.6359039190897599, "repo_name": "toddeye/home-assistant", "id": "63c30c16babe562d7699f88b9abed88ac7270665", "size"...
import numpy as np def read(filename): f = open(filename) names = f.readline().strip('\n#').split(' ') dtype = np.concatenate((['int', 'int'], (36*'float ').split(' ')[:-1])) f.close() stat = np.genfromtxt(filename, dtype=dtype, names=names, skiprows=1) return stat
{ "content_hash": "f3860ecb75cdc79ec0a519c0beb56860", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 75, "avg_line_length": 32.333333333333336, "alnum_prop": 0.5979381443298969, "repo_name": "salomanders/NbodyPythonTools", "id": "3109a74a4d1673d44bfafd97c7126d2ec1caf769", "...
"""Different policy losses.""" import gin from seed_rl.agents.policy_gradient.modules import constraints from seed_rl.agents.policy_gradient.modules import logging_module import tensorflow as tf @gin.configurable class AdvantagePreprocessor(tf.Module): """Advantages preprocessor.""" def __init__(self, normalize...
{ "content_hash": "04df54deb8fc18aac7631a32b29d3311", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 80, "avg_line_length": 39.07327586206897, "alnum_prop": 0.685273028130171, "repo_name": "google-research/seed_rl", "id": "9a71641fe1247abb28aa320cb56884374fa7616d", "size"...
import unittest import os import time import sys import random import math import functools import contextlib import tempfile import numpy as np from PIL import Image, ImageEnhance import paddle import paddle.fluid as fluid from paddle.dataset.common import download from paddle.fluid.contrib.slim.quantization import Po...
{ "content_hash": "d6951429d4bf3f6c45e53f123eb810d2", "timestamp": "", "source": "github", "line_count": 524, "max_line_length": 113, "avg_line_length": 31.103053435114504, "alnum_prop": 0.5403730519082096, "repo_name": "luotao1/Paddle", "id": "37daeab1186299f23da8e90101ad12926ebde7f9", "size": "169...
"""Numpy utility functions.""" # Could penalize minimum volume for RBFs. # Could penalize heavily if another quadric has higher weight within this quad's # radius. # Plot fraction in which 1 quadrics has 90% or more of the total weight. # If total weight is below epsilon, don't show (or show which those are). Set # th...
{ "content_hash": "b53ca19df8e046a846615c1fa44211b9", "timestamp": "", "source": "github", "line_count": 431, "max_line_length": 80, "avg_line_length": 36.80278422273782, "alnum_prop": 0.6332744924977934, "repo_name": "google/ldif", "id": "1ccf547bab1af07520b77677d9bb7724287ac99f", "size": "16456", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0056_auto_20171030_1446'), ] operations = [ migrations.AddField( model_name='partner', name='title', fie...
{ "content_hash": "f16462188850676209fe156b22aef71b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 22.055555555555557, "alnum_prop": 0.5944584382871536, "repo_name": "OKThess/website", "id": "7cf4ea82ce6550def9eba116a7dec3eec4d5cb23", "size": "470"...
import itertools from abc import ABCMeta, abstractmethod from qiime2.core.util import tuplize, ImmutableBase def maximal_antichain(*types): maximal_elements = {} # easy to delete, retains order for t in types: placed = False for e in list(maximal_elements): if e <= t: ...
{ "content_hash": "455ae485dc542795f4406ff8eefcdb6c", "timestamp": "", "source": "github", "line_count": 640, "max_line_length": 79, "avg_line_length": 31.096875, "alnum_prop": 0.55712993668978, "repo_name": "thermokarst/qiime2", "id": "2102a933d29dd52008c03a5d094cc36fd194d090", "size": "20252", "...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using PrettyGood.Util; namespace PrettyGood.LastFm { public class FoundArtist { internal FoundArtist(XmlElement el) { this.name = Xml.GetTextOfSubElement(el, "name"); ...
{ "content_hash": "2827ecc312a899de8798b6b514583a9f", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 66, "avg_line_length": 24.939393939393938, "alnum_prop": 0.5759416767922235, "repo_name": "madeso/prettygood", "id": "8b1058c5f3d19ab6ab737e0c62a01808f56c5280", "size": "82...
import unittest import matchcompiler class MatchCompilerTest(unittest.TestCase): def setUp(self): self.mc = matchcompiler.MatchCompiler(verify_mode=False) def test_parseMatch(self): self.assertEqual(self.mc.parseMatch(' Token::Match(tok, ";") ', 2), [ 'Token::Match(...
{ "content_hash": "262434dda2055459ee55ffb5ad8651c2", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 145, "avg_line_length": 48.25714285714286, "alnum_prop": 0.5994671403197158, "repo_name": "chillbu/cblib", "id": "a2ce1b68796d1a57d6307fd78302b516750c706d", "size": "7527"...
from lxml import etree from nova.api.openstack.compute.contrib import floating_ip_pools from nova import context from nova import network from nova import test from nova.tests.api.openstack import fakes def fake_get_floating_ip_pools(self, context): return [{'name': 'nova'}, {'name': 'other'}] clas...
{ "content_hash": "a91a99d48fd887031115a6429936a4f0", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 73, "avg_line_length": 37.08620689655172, "alnum_prop": 0.6294746629474663, "repo_name": "pombredanne/MOG", "id": "a12d41e6edee985f27042e2005756bc52381c930", "size": "2811"...
from zerver.models import UserProfile, UserActivity, UserActivityInterval, Message from django.utils.timezone import utc from typing import Any, Dict, List, Sequence, Set from datetime import datetime, timedelta # Return the amount of Zulip usage for this user between the two # given dates def seconds_usage_between(...
{ "content_hash": "4afe43fc18a446e36ad3e8980d654eae", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 98, "avg_line_length": 42.26315789473684, "alnum_prop": 0.651307596513076, "repo_name": "mahim97/zulip", "id": "aacb272924f6020e4a2b3c7970731601e97fd7e8", "size": "828", ...
""" With Transcrypt, we are running in javascript environment, hence pythonic introspection is not available at runtime, making do with decorators instead. """ from pybble.pebblejs import console tests = [] def test(wrapped): tests.append(wrapped) def wrapper(): return wrapped return wrapper() ...
{ "content_hash": "a1b85ef66301a40e2874a5df6d821990", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 66, "avg_line_length": 17.153846153846153, "alnum_prop": 0.7017937219730942, "repo_name": "hiway/pybble", "id": "91c3a5641a9c65f94505031a7dcbfd7ba78f6105", "size": "446", ...
from spamhandling import check_if_spam, check_if_spam_json from datahandling import add_blacklisted_user, add_whitelisted_user from parsing import get_user_from_url import pytest import os test_data_inputs = [] with open("test/data_test_spamhandling.txt", "r") as f: test_data_inputs = f.readlines() @pytest.mark....
{ "content_hash": "5b9132314bbba2d2fba5a3eadedf9eb5", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 146, "avg_line_length": 53.074074074074076, "alnum_prop": 0.6515468713654339, "repo_name": "ArtOfCode-/SmokeDetector", "id": "bbb1e03c3551a8486bdfde797679d6cc4fd18945", "si...
""" Encapsulates Functionality for Generating Code Snippets for a Task Description. """ from config import LANGUAGE from code_snippet_providers.github_code_snippet_provider import GithubCodeSnippetProvider class CodeSnippetGenerator(object): """ Encapsulates Functionality for Generating Code Snippets for a Task ...
{ "content_hash": "16823149730627814552d070e49ecbdf", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 104, "avg_line_length": 40.36842105263158, "alnum_prop": 0.6988265971316818, "repo_name": "berjc/code-complete", "id": "170cea495426d8b918309d206e682943cbe75cd3", "size": "...
import mock from neutron_lib import context from neutron_lib import exceptions as lib_exc from neutron_lib.plugins import constants as plugins_constants from neutron_lib.plugins import directory from neutron_lib.services.qos import constants as qos_consts from oslo_config import cfg from oslo_utils import uuidutils fr...
{ "content_hash": "59a7b3f83a2db9a88a739f76dcbc61e5", "timestamp": "", "source": "github", "line_count": 884, "max_line_length": 79, "avg_line_length": 47.522624434389144, "alnum_prop": 0.5860271363960962, "repo_name": "eayunstack/neutron", "id": "509e7e0ce11ff50d951be5f3b86a5b8a213060d5", "size": "...
from __future__ import unicode_literals, division, absolute_import import logging from sqlalchemy import desc from flexget import plugin from flexget.event import event from flexget.entry import Entry log = logging.getLogger('emit_series') try: from flexget.plugins.filter.series import SeriesTask, Episode, Rele...
{ "content_hash": "b763f5c76b38dbe0ca7e7d35fe72a331", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 120, "avg_line_length": 44.91724137931035, "alnum_prop": 0.5436818670351604, "repo_name": "asm0dey/Flexget", "id": "133713f415071bb3224f5b7281853ba6644b50e6", "size": "651...
import logging import constants import dignities import translate sign_idx = 0 deg_idx = 1 sun_idx = 0 class AstraChart: def __init__(self, chartname, person, chart_data): self.chart_degrees = None self.chartname = chartname self.person = person self.chart_data = chart_data # Cu...
{ "content_hash": "d88cfc379bd4142bad671dc60516a84b", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 104, "avg_line_length": 37.13265306122449, "alnum_prop": 0.5916460566089585, "repo_name": "astraknots/ncis", "id": "96e8dfa2d85a63255a149315aff5455a34bd366f", "size": "3657...
import sys from fabric.api import * from fabric.colors import green, red, green, yellow from fabric.contrib.files import exists from fabric.contrib import * from django.template import Template import os import layout_settings #set_operating_system() """ Basic commands: """ def show_help(): """ help ...
{ "content_hash": "b5a69a5de95bc2fc17393a4c38d37b79", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 127, "avg_line_length": 25.526315789473685, "alnum_prop": 0.6511340206185567, "repo_name": "Miki-AG/ngLaunchpad", "id": "797ca479ca6711f234d8f455444fc8f6709cc8a9", "size": ...
from __future__ import absolute_import __version__ = "0.6" default_app_config = 'baldr.app.BaldrAppConfig' def _ensure_registration(): """ Ensure that model type resolvers and validation tools are registered with Odin. This provides support for Django Models and use of Django Validators in Odin resource...
{ "content_hash": "9fe5abb8a937ab5e2db59fe6333326b9", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 91, "avg_line_length": 27.642857142857142, "alnum_prop": 0.7131782945736435, "repo_name": "timsavage/baldr", "id": "fb53e692a01921bb061c984f21e096aafabab419", "size": "411"...
"""Classificateur de publications. Classifie les publications reçues suivant le médium d'apparition de celles-ci (voir publications.py pour les types de publications gérés. """ import re __author__ = "Anas Hilama, Moncef Baazet" class Classifier(object): def __init__(self, pubs_types): """Construit un c...
{ "content_hash": "02118bac8cef73ca84d212664cbdba30", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 77, "avg_line_length": 36.542857142857144, "alnum_prop": 0.5934323690383112, "repo_name": "mobajm/resextract", "id": "f74cda0c5f72aa62b51f124174a3a35e9b6fa1f9", "size": "13...
import log MAGIC = "DEADBEEF" ADD = "ADD" REMOVE = "REMOVE" TOKEN = ";" logger = log.setup_logger("StringParser") def validate_string(input_string): if not input_string: logger.error("String is null") return output_string = input_string.strip().upper() if not output_string.startswith(MAGIC...
{ "content_hash": "e5a38f421796402b5893a7163958317b", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 103, "avg_line_length": 28.186046511627907, "alnum_prop": 0.6138613861386139, "repo_name": "bobbyphilip/learn_python", "id": "d8dccddc0a9abe34961b5009719e33716cf0cfd1", "si...
import os from .tc import * from . import build from . import monkey class Re2cTask(build.BuildTask): def __init__(self, project, sourcePath, builtDir, workingDir, toolchain, outputExt='.cpp'): super().__init__(project) self.sourcePath = sourcePath self.builtDir = builtDir self.work...
{ "content_hash": "2d9d682f9bee516cf83fe7c323804e52", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 113, "avg_line_length": 39.30263157894737, "alnum_prop": 0.5612654837629729, "repo_name": "fifoforlifo/pynja", "id": "938a8dcc1f388647c4d0e19e0b6e7072189e62a3", "size": "5...
from __future__ import unicode_literals from django.db import migrations import json def forwards(apps, schema_editor): ch_m = apps.all_models['chat'] Message = ch_m['message'] with open('old_smileys_info.json') as old_file: data_old = json.load(old_file) with open('chat/static/smileys/info....
{ "content_hash": "02b5887c715512c61f4f3ded5b242f79", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 88, "avg_line_length": 30.037037037037038, "alnum_prop": 0.5690505548705302, "repo_name": "Deathangel908/djangochat", "id": "e7f234c5064984d93165890d3a1dadc5134b182d", "siz...
''' This file shows examples on how to use the scripts in project ''' from fileparser import do_one_pdb from Config import * import os,sys,io import gzip from vector_gen import pdb_container,fake_pdb_container from mapping import * from job_dispatcher import dock_dispatcher #PDB_tar=['1uwj'] #do_one_pdb('100d') #A=...
{ "content_hash": "8901577662d44dbd409871fdd8baf5cc", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 108, "avg_line_length": 24.875, "alnum_prop": 0.6909547738693468, "repo_name": "Reimilia/pdb_sth", "id": "9b6c865e42e3f82090f9e5166b805ee27cbfac75", "size": "1194", "bina...
import sys import datetime as dt from optparse import OptionParser from bigdl.optim.optimizer import Adagrad from zoo.common.nncontext import init_nncontext from zoo.feature.text import TextSet from zoo.models.textclassification import TextClassifier if __name__ == "__main__": parser = OptionParser() parser....
{ "content_hash": "83416b458c36b140683226318003ad27", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 98, "avg_line_length": 52.56578947368421, "alnum_prop": 0.6523153942428035, "repo_name": "intel-analytics/analytics-zoo", "id": "9baec7d45743f20ebab5ec90f0ffcfc6aef996c7", ...
import boto3 from datetime import datetime import json from boto3.dynamodb.conditions import Key from enum import Enum from decimal import Decimal from sns_boomerang.settings import util, TABLE_JOBS, TABLE_TOPICS dynamo = boto3.resource('dynamodb') sns_resource = boto3.resource('sns') sns_client = boto3.client('sns')...
{ "content_hash": "fe3a0847049200abcd60b7f0629c559e", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 110, "avg_line_length": 30.231155778894472, "alnum_prop": 0.555186170212766, "repo_name": "zdjohn/sns-boomerang", "id": "99bb3f9e91a2b5ae3913af2b43c78b8bbb92da2a", "size":...
import sys from oauth2client.client import OAuth2Credentials from printapp import app, mongo, oauthcredentials def add_fake_credentials(email, hasprinter=True): token = 'fakeoauth.py|noprinter' if hasprinter: token = 'fakeoauth.py' credentials = OAuth2Credentials(token, token, token, ...
{ "content_hash": "43cc461a83439828f749ac907c124522", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 71, "avg_line_length": 31.225, "alnum_prop": 0.5836669335468375, "repo_name": "jglamine/calvinwebprint", "id": "f2feb704062b30414f527c549314793693eea985", "size": "1396", ...
r"""Implements the general form of the loss. This is the simplest way of using this loss. No parameters will be tuned automatically, it's just a simple function that takes in parameters (likely hand-tuned ones) and return a loss. For an adaptive loss, look at adaptive.py or distribution.py. """ import jax import jax....
{ "content_hash": "561ff7b9ecd562fb6d95c90d740552b6", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 79, "avg_line_length": 38.02298850574713, "alnum_prop": 0.6635429262394196, "repo_name": "google-research/google-research", "id": "5e34a953cde5d316a917e6da26f4b229f0d3724b", ...
__version__='''$Id$''' __doc__="""most basic test possible that makes a PDF. Useful if you want to test that a really minimal PDF is healthy, since the output is about the smallest thing we can make.""" from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation setOutDir(__name__) imp...
{ "content_hash": "471a494b1d3581f37e03a21c17aed0a8", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 144, "avg_line_length": 33.91111111111111, "alnum_prop": 0.6513761467889908, "repo_name": "makinacorpus/reportlab-ecomobile", "id": "27b5f038205ba7385dcfe8153bcb5a9d6cab0f86"...
""" Traceplot rank_vlines Bokeh =========================== _thumb: .1, .8 """ import arviz as az data = az.load_arviz_data("non_centered_eight") ax = az.plot_trace(data, var_names=("tau", "mu"), kind="rank_vlines", backend="bokeh")
{ "content_hash": "0abe6b19b1a91f8b621747f404ae83f6", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 86, "avg_line_length": 23.5, "alnum_prop": 0.5829787234042553, "repo_name": "mcmcplotlib/mcmcplotlib", "id": "274e5b205d806f62cbab28518e0701c3e8210d9e", "size": "235", "b...
import math import Pyro4, time, psutil import random #import sqlite3 as sqlite #import datetime as dt #perhaps needs to be set somewhere else Pyro4.config.HMAC_KEY='pRivAt3Key' #lists for return stressValues = [] runStartTimeList= [] runDurations = [] MALLOC_LIMIT = 4095 import sys from Library impor...
{ "content_hash": "49bb2023432b53776ab2c6fb486ff70e", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 619, "avg_line_length": 50.23809523809524, "alnum_prop": 0.6797788309636651, "repo_name": "cragusa/cocoma", "id": "67c3fd052a5776a796fd85958dfb5ed7c2717c35", "size": "7043...
"""Classes for representing collections for the Google Cloud Firestore API.""" from google.api_core import gapic_v1 from google.api_core import retry as retries from google.cloud.firestore_v1.base_collection import ( BaseCollectionReference, _item_to_document_ref, ) from google.cloud.firestore_v1 import ( ...
{ "content_hash": "2f78c53961a8c135852e21fb024779bf", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 95, "avg_line_length": 39.723684210526315, "alnum_prop": 0.6242685215855139, "repo_name": "googleapis/python-firestore", "id": "52847a3dcf0fcf4961b94a8815eb5a8a2c6872e3", ...
from utils.dockerutil import DockerUtil from utils.service_discovery.config_stores import get_config_store, SD_CONFIG_BACKENDS def sd_configcheck(agentConfig, configs): """Trace how the configuration objects are loaded and from where. Also print containers detected by the agent and templates from the conf...
{ "content_hash": "9122556531c182dd29e8a35c70fbf07c", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 101, "avg_line_length": 38.31481481481482, "alnum_prop": 0.6022232962783953, "repo_name": "pmav99/praktoras", "id": "60b4ba3ec56ada83112b532d770d0429c0de03e6", "size": "222...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0005_auto_20170507_2026'), ] operations = [ migrations.AlterField( model_name='post', name='click_count', ...
{ "content_hash": "3328c93e0814eb48dcbb6928aac5e30a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 22.555555555555557, "alnum_prop": 0.603448275862069, "repo_name": "r26zhao/django_blog", "id": "c14c8e32c047b9c9fd19759ada4df849926576bc", "size": "4...
"""A file interface for handling local and remote data files. The goal of datasource is to abstract some of the file system operations when dealing with data files so the researcher doesn't have to know all the low-level details. Through datasource, a researcher can obtain and use a file with one function call, regard...
{ "content_hash": "d2d0a34ac750c7ee2bdf5d810dfd5118", "timestamp": "", "source": "github", "line_count": 636, "max_line_length": 82, "avg_line_length": 32.4496855345912, "alnum_prop": 0.5845527667409632, "repo_name": "NirBenTalLab/proorigami-cde-package", "id": "957e7cb1827aec3c5476e95d40e47fc28f4b1c2...
import optparse import os import shutil import sys from bridge_generator import BridgeGenerator from interface_generator import InterfaceGenerator from java_class import JavaClassLoader from string import Template from wrapper_generator import WrapperGenerator # Classes list that have to generate bridge and wrap code...
{ "content_hash": "f98ffd74aa20fbd9e1d81585cbb557c6", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 79, "avg_line_length": 35.94512195121951, "alnum_prop": 0.6810856658184903, "repo_name": "alex-zhang/crosswalk", "id": "243615a0da462c7d69d22365394daec85b371628", "size": ...
from typing import Optional, Tuple from enum import IntEnum from ..tl.types import InputPeerUser, InputPeerChat, InputPeerChannel class SessionState: """ Stores the information needed to fetch updates and about the current user. * user_id: 64-bit number representing the user identifier. * dc_id: 32-b...
{ "content_hash": "ecd6e3dc7555c4725b01928656bcbc2d", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 100, "avg_line_length": 31.630769230769232, "alnum_prop": 0.60068093385214, "repo_name": "LonamiWebs/Telethon", "id": "5025dd3883e48ff1a5b6c44564743b0577f0d3d2", "size": "...
import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import requests from tensorflow.python.framework import ops ops.reset_default_graph() # Create graph sess = tf.Session() # Load the data housing_url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data' housing_hea...
{ "content_hash": "1c4de6915d5a6a456a6aa791aaa62362", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 122, "avg_line_length": 41.28735632183908, "alnum_prop": 0.6801224944320713, "repo_name": "benjaminoh1/tensorflowcookbook", "id": "2d0f53770bb33dbff10fcf879e63c56f0d579531", ...
from django.urls import path, reverse_lazy import django.contrib.auth.views as auth_views urlpatterns = [ path('login/', auth_views.LoginView.as_view(), name='login'), path('logout/', auth_views.LogoutView.as_view(next_page=reverse_lazy('login')), name='logout'), ]
{ "content_hash": "040e18172f20fcf29e32859fc2206c04", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 99, "avg_line_length": 34.5, "alnum_prop": 0.7101449275362319, "repo_name": "mjtamlyn/archery-scoring", "id": "f955400a1546bb5ee3d01424ad4fb74448e5f29c", "size": "276", "b...
import re from functools import reduce from pyparsing import ( infixNotation, opAssoc, Optional, Literal, CharsNotIn, ParseException, ) from logging import Filter, _levelNames import six from django.apps import apps from django.db import models from django.conf import settings from awx.main.u...
{ "content_hash": "f859206293c821267c817f6df3f990ca", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 117, "avg_line_length": 32.75595238095238, "alnum_prop": 0.5288933309104125, "repo_name": "wwitzel3/awx", "id": "eaf8c805b6c26c68966198a5c0931470c378db8e", "size": "11006"...
from collections import namedtuple # just a helper ClampMethod = namedtuple('ClampMethod', 'name returntype argtypes throws ' 'method_annotations parameter_annotations')
{ "content_hash": "ca4fa27c8ee7aec7aefec1a590aa5853", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 74, "avg_line_length": 39.2, "alnum_prop": 0.7091836734693877, "repo_name": "alvin319/CarnotKE", "id": "202c11aeb3b3a65bd10d510e720eb0324267a3f3", "size": "196", "binary":...
import paramiko class GetAixData: def __init__(self, ip, ssh_port, timeout, usr, pwd, use_key_file, key_file, get_serial_info, get_hardware_info, get_os_details, get_cpu_info, get_memory_info, ignore_domain, upload_ipv6, debug): self.machine_name = ip self...
{ "content_hash": "fd669872b04d46035e3643af4b9c01d2", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 106, "avg_line_length": 41.61494252873563, "alnum_prop": 0.44966164894351607, "repo_name": "device42/nix_bsd_mac_inventory", "id": "55f5edb4d0a5833362bc8fb578fdeb7fc3db1e61"...
import os from datetime import datetime import json directory = r'C:\Source\hq\data\supervisor_export_all_08-08-2009\export\BRAC\CHW\commcare\input' out_directory = r'C:\Source\hq\data\supervisor_export_all_08-08-2009\brac-pf' domain = "BRAC" #domain = "Pathfinder" files = os.listdir(directory) count = 0 for file i...
{ "content_hash": "8fe06c5be0592edde8517886da1f44ce", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 96, "avg_line_length": 35.875, "alnum_prop": 0.5860627177700348, "repo_name": "fredwilliam/PMO", "id": "26710028aaa2812ef0ada3c39f8b6f2d855dc287", "size": "1481", "binary...
""" Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.25 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from kubernete...
{ "content_hash": "54d741c474fee396ee07b124d69fcfcf", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 197, "avg_line_length": 32.179611650485434, "alnum_prop": 0.6014481822295972, "repo_name": "kubernetes-client/python", "id": "cbdefa1c3bfc4934a8da74fecaaa118fd8d41c0c", "s...
from HTMLParser import HTMLParser import os from sgmllib import SGMLParser import urlparse __author__ = 'Kelvin' import urllib2 class FileDownloader(object): def __init__(self, file_url, save_path='./', min_size=0): self.url = file_url self.save_path = save_path self.min_size = min_size ...
{ "content_hash": "b01f34123d50449bb6f6898edda8c9d7", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 104, "avg_line_length": 28.25179856115108, "alnum_prop": 0.5215176979882862, "repo_name": "seawaywen/memodir_skels", "id": "8cb084532bdfa352ca1b766b0a5b6492b2837781", "siz...
import logging import json from logging import StreamHandler, Formatter from ethereum.utils import bcolors, isnumeric DEFAULT_LOGLEVEL = 'INFO' JSON_FORMAT = '%(message)s' PRINT_FORMAT = '%(levelname)s:%(name)s\t%(message)s' TRACE = 5 known_loggers = set() log_listeners = [] # add level trace into logging def ...
{ "content_hash": "bab1e77ab004fe3d0f4100aa6da1c247", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 93, "avg_line_length": 29.60655737704918, "alnum_prop": 0.618078626799557, "repo_name": "vaporry/pyethereum", "id": "eb9d59c324ab8fbe42fdea67a4cb82e51f1a2b8b", "size": "72...
{ '(Recipient)': '(Empfänger)', "'Cancel' will indicate an asset log entry did not occur": "'Abbrechen' zeigt an, dass ein Asset Log Eintrag nicht eingetreten ist", "A location that specifies the geographic area for this region. This can be a location from the location hierarchy, or a 'group location', or a location th...
{ "content_hash": "bf7be0dd8934886aa9a5f6350cc048a4", "timestamp": "", "source": "github", "line_count": 4712, "max_line_length": 931, "avg_line_length": 60.47453310696095, "alnum_prop": 0.7668797989865102, "repo_name": "raj454raj/eden", "id": "c092b5aecbe20aa85b08b397344eb999320180f9", "size": "287...
from bluesky.plans import rel_scan from bluesky.callbacks import LiveTable, LivePlot subs = [LiveTable(['diff_xh', 'xray_eye2_stats1_total', 'xray_eye2_stats2_total']), LivePlot('xray_eye2_stats1_total', 'diff_xh')] print ( ' Motor is diff.xh, camera is xray_eye2') RE(rel_scan([xray_eye2], diff.xh, -.1, .1, ...
{ "content_hash": "3e083b320280f1f20cb2e4f60a250f06", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 84, "avg_line_length": 41.25, "alnum_prop": 0.6848484848484848, "repo_name": "NSLS-II-CHX/ipython_ophyd", "id": "98f0d2260581707d7959a4879f56ccc58e4d174c", "size": "331", ...
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineRes...
{ "content_hash": "88960b0ec20972c028c9d0eb9268d673", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 227, "avg_line_length": 42.704301075268816, "alnum_prop": 0.6347098073775651, "repo_name": "Azure/azure-sdk-for-python", "id": "a231f467725ed28a9fe927d2c9ce28b2030334f4", ...
from codecs import open # To use a consistent encoding from os import path from setuptools import setup HERE = path.dirname(path.abspath(__file__)) # Get version info ABOUT = {} with open(path.join(HERE, 'datadog_checks', 'hikaricp', '__about__.py')) as f: exec(f.read(), ABOUT) # Get the long description from ...
{ "content_hash": "5f5db4fdd70b2e9a595d749e69fba72d", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 81, "avg_line_length": 30.266666666666666, "alnum_prop": 0.652863436123348, "repo_name": "DataDog/integrations-extras", "id": "ef0720dec0e65bdcdda056c2c2ec87b7d6dccf8a", "s...
""" ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual <introduction>`. """ print(__doc__) # Autho...
{ "content_hash": "2f9031c1426dc577c5e5f0a51dc79b72", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 78, "avg_line_length": 36.31818181818182, "alnum_prop": 0.7108886107634543, "repo_name": "xyguo/scikit-learn", "id": "d9c2b570336a7d24c41e66daf2d05e181a2e9b65", "size": "23...
import datetime import hashlib import sys from contextlib import closing from urllib2 import urlopen from south.db import db from south.logger import get_logger from south.v2 import DataMigration from django.db import models from django.conf import settings logger = get_logger() class Migration(DataMigration): @...
{ "content_hash": "0c9ce79d2b60aec3f3f3b2abad3efa47", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 182, "avg_line_length": 66.37898089171975, "alnum_prop": 0.5431079978889796, "repo_name": "iiman/mytardis", "id": "f28f8e610c078b432b9f2273a6abfb0804afb886", "size": "2086...
""" A pure-Python PDF library with an increasing number of capabilities. See README for links to FAQ, documentation, homepage, etc. """ __author__ = "Mathieu Fenniak" __author_email__ = "biziqe@mathieu.fenniak.net" __maintainer__ = "Phaseit, Inc." __maintainer_email = "PyPDF2@phaseit.net" import string import math i...
{ "content_hash": "a0c8189559966a46e9c05b1f5e98a3f8", "timestamp": "", "source": "github", "line_count": 2971, "max_line_length": 137, "avg_line_length": 41.97542914843487, "alnum_prop": 0.5595025218709155, "repo_name": "Ashaba/rms", "id": "9979414ff021c6bcfc9839e9f1575f3ffff8ecba", "size": "126327"...
"""Example script to create a exe of the breakout example using py2exe. """ __version__ = "$Id:$" __docformat__ = "reStructuredText" import os from distutils.core import setup import py2exe import pymunk # Fix to make py2exe include some dlls it needs but doesnt include by default. origIsSystemDLL = py2exe.build_exe...
{ "content_hash": "27eab9438ab00a787e95a2d5f989f0ff", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 98, "avg_line_length": 31.225806451612904, "alnum_prop": 0.7004132231404959, "repo_name": "saintdragon2/python-3-lecture-2015", "id": "903f0c250f1d9a7c30367c76f93d80abb6e0c50...