text
stringlengths
4
1.02M
meta
dict
import httplib from authorize import gen_xml as xml class BaseApi(object): """ Base Api object. NOTE: It's important that you make sure that your Authorize dashboard uses the same delimiter and encapsulator that you are using in your API objects. If you don't check this it could happen that t...
{ "content_hash": "b222deeaa8b61bd426b9683eb7afa036", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 76, "avg_line_length": 37.89010989010989, "alnum_prop": 0.58207656612529, "repo_name": "imtapps/authorize", "id": "344f9cfd630bc10175c7e7df8051ea9ef616e85c", "size": "3448"...
"""Tests for the Policy.""" from absl.testing import absltest from group_testing import policy from group_testing import state from group_testing.group_selectors import random from group_testing.group_selectors import split import jax import jax.numpy as np import jax.test_util class PolicyTest(jax.test_util.JaxTest...
{ "content_hash": "d96a63a0f0c3ac1fe8d512e6088ea89c", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 76, "avg_line_length": 32.57142857142857, "alnum_prop": 0.7010233918128655, "repo_name": "google-research/group_testing", "id": "8ba2d2b46e24c79317f5af00f6f3ae1b023ef6fb", ...
"""Class for bitcoind node under test""" import contextlib import decimal import errno from enum import Enum import http.client import json import logging import os import re import subprocess import tempfile import time import urllib.parse import collections import shlex import sys from .authproxy import JSONRPCExce...
{ "content_hash": "be0ee3a1469ec176fd0565ae5c1458af", "timestamp": "", "source": "github", "line_count": 583, "max_line_length": 173, "avg_line_length": 41.37907375643225, "alnum_prop": 0.6094760404576356, "repo_name": "CryptArc/bitcoin", "id": "55e6d4caa6aa64769d52bb2cf125160229b40a42", "size": "24...
from celery.task import task from make_mozilla.bsd import BSDRegisterConstituent import commonware.log import funfactory.log_settings # Magic voodoo required to make logging work. log = commonware.log.getLogger('mk.tasks') @task def register_email_address_as_constituent(email_address, group): log.info('Running re...
{ "content_hash": "6dcd919caa235eefd182279d7b784aa1", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 76, "avg_line_length": 38.72727272727273, "alnum_prop": 0.8028169014084507, "repo_name": "mozilla/make.mozilla.org", "id": "18a5302175cdbe3061a9545a4b882e343d85c9ea", "size...
from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from openstack_dashboard.dashboards.project.vpn import views urlpatterns = patterns('openstack_dashboard.dashboards.project.vpn.views', url(r'^$', views.IndexView.as_view(), name='index'), url(r'^addikepolicy$', vie...
{ "content_hash": "5e0537cba04300fd27bca65ba51a0b9d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 75, "avg_line_length": 53.088235294117645, "alnum_prop": 0.6747922437673131, "repo_name": "aaronorosen/horizon-congress", "id": "0de3a3836097d6a30b67f564d513fb45d8ac048d", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='TodoItem', fields=[ ('id', models.AutoField(auto_created=True, primary_...
{ "content_hash": "a7a2c1af0008d707be8183cb33a11af5", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 114, "avg_line_length": 35, "alnum_prop": 0.5444444444444444, "repo_name": "pauloromeira/todo_lab", "id": "7ad2eebe0b9ce64710385acc17f4a3e5aeabd7e1", "size": "1284", "bin...
from malcolm.yamlutil import check_yaml_names, make_block_creator attribute_block = make_block_creator(__file__, "attribute_block.yaml") directory_monitor_block = make_block_creator(__file__, "directory_monitor_block.yaml") double_trigger_block = make_block_creator(__file__, "double_trigger_block.yaml") scan_runner_bl...
{ "content_hash": "4a06e7a720168c3b2f8f94d126545d50", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 86, "avg_line_length": 55.8, "alnum_prop": 0.7365591397849462, "repo_name": "dls-controls/pymalcolm", "id": "c0d308ba7395ca5fa75fc5dc0ba0f03375680150", "size": "558", "bi...
import json import logging import os import re import sys import urllib from collections import defaultdict from HTMLParser import HTMLParser from tests.common.impala_connection import ImpalaConnection, create_connection from tests.common.impala_connection import create_ldap_connection from time import sleep, time lo...
{ "content_hash": "c7d3cecb14500f6aeeb513436db68a88", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 90, "avg_line_length": 41.65853658536585, "alnum_prop": 0.6734192037470726, "repo_name": "ibmsoe/ImpalaPPC", "id": "17dc37cffa7f87696a72afe89aafd6d24ea6b9dc", "size": "938...
from keystoneclient import base class DomainQuota(base.Resource): """Represents an domain Quota. """ pass class DomainQuotaManager(base.CrudManager): """Manager class for manipulating domains Quota.""" resource_class = DomainQuota collection_key = 'domains' key = 'domain' def get(s...
{ "content_hash": "d6d538d45faa8bf149f2d338d7aa0016", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 61, "avg_line_length": 23.333333333333332, "alnum_prop": 0.6464285714285715, "repo_name": "raildo/python-keystoneclient", "id": "48af532d675ae9a698b3b1e163db9b1da59fcf1d", ...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class AccountLogout(Choreography): def __init__(self, temboo_session): """ Create a...
{ "content_hash": "354643064f9571c3b9a111fb244e0b93", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 164, "avg_line_length": 37.375, "alnum_prop": 0.7142857142857143, "repo_name": "jordanemedlock/psychtruths", "id": "c267b622229a223947d3c7fa558589f5f2e56856", "size": "2926...
from __future__ import absolute_import from twisted.internet.defer import inlineCallbacks from twisted.internet.endpoints import clientFromString from twisted.words.protocols import irc from autobahn import wamp from autobahn.twisted.wamp import ApplicationSession from autobahn.wamp.exception import ApplicationError ...
{ "content_hash": "d6025914044f298d02dfb9f9fb5fee1b", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 84, "avg_line_length": 26.952380952380953, "alnum_prop": 0.6159010600706714, "repo_name": "dash-dash/AutobahnPython", "id": "a78c836491d1706a575da21151b3932b4dd5403a", "si...
""" This module provides classes and methods used to describe deformations and strains, including applying those deformations to structure objects and generating deformed structure sets for further calculations. """ import numpy as np import scipy import itertools import collections from monty.dev import deprecated ...
{ "content_hash": "17126d4ac4b5c9bc08d940d0628ad3e4", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 80, "avg_line_length": 34.142322097378276, "alnum_prop": 0.6036638876700308, "repo_name": "montoyjh/pymatgen", "id": "03ecd8a8a830a9def897f99cf6c6b5523693bb53", "size": "9...
import codecs import sys import os import base64 import re import datetime import subprocess import traceback from smtpd import SMTPServer from django.core.management.base import BaseCommand from django.utils.encoding import force_unicode, force_str from dju_common.settings import DJU_EMAIL_DEBUG_PATH, DJU_EMAIL_DEBUG_...
{ "content_hash": "26bbba6505b6077e9e25c710f7ee1af0", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 111, "avg_line_length": 39.191489361702125, "alnum_prop": 0.5171009771986971, "repo_name": "liminspace/dju-common", "id": "543317724ea8c951e0f2929170854e7fc4d4fc83", "size"...
from oslo_config import cfg import oslo_messaging import time class ServerControlEndpoint(object): # `target` is used to match the endpoint to handle the message. # Only the namespace and the version of the message match that of this `target`, # this `Endpoint` handle the message. # Generally, please ...
{ "content_hash": "55a488aea8cbf0d0a3584324f8b5736f", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 123, "avg_line_length": 34.32142857142857, "alnum_prop": 0.6784599375650364, "repo_name": "xgfone/snippet", "id": "b4dc422f5a6fa6d725e7b2f24496b5cb16c4fbaf", "size": "1940"...
import logging import krakenex import sys from datetime import datetime, timedelta from bot import Bot logger = logging.getLogger(__name__) class Trader(Bot): RISE = 'rise' FALL = 'fall' kapi = None trade_amount = 10.0 # Euro profit_percent = 10 change = {'type': None, 'counter': 0} ...
{ "content_hash": "01927a6c7e7a1a145bff85639bc8a32b", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 84, "avg_line_length": 37.468468468468465, "alnum_prop": 0.4907429670593893, "repo_name": "ricco386/trader-bot", "id": "13b3ea0409c94692d3fe12d7f3a49cc48d1aa70f", "size": ...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('user', '0023_merge_20170818_0831'), ] operations = [ migrations.RenameModel( old_name='Frame', new_name='Skill', ), ]
{ "content_hash": "1a979b97175ee47924f9873b09c1bf06", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 45, "avg_line_length": 18.705882352941178, "alnum_prop": 0.5786163522012578, "repo_name": "internship2016/sovolo", "id": "0ed21c2c3ec0c614d68584bf627ca308b0d84fe9", "size":...
import heapq from .KBucket import KBucket class Route(object): def __init__(self, service, loop, kSize, selfNode): self.service = service self.loop = loop self.selfNode = selfNode self.ksize = kSize self.buckets = [KBucket(0, 2 ** 160, self.ksize)] def getBucket(self,...
{ "content_hash": "a394317da2ab1980575cc89cee943878", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 89, "avg_line_length": 36.583333333333336, "alnum_prop": 0.54707668944571, "repo_name": "SkyZH/ddcm-protocol", "id": "897bb8f4b60d6e15d0afe490445baf9f8784b712", "size": "26...
import os.path as op from collections import namedtuple import re import numpy as np from datetime import datetime, timezone from .._digitization import _make_dig_points from ..base import BaseRaw from ..meas_info import create_info from ..tag import _coil_trans_to_loc from ..utils import _read_segments_file, _mult_ca...
{ "content_hash": "d90e448ebc1418d8ada64a77409d7fa1", "timestamp": "", "source": "github", "line_count": 534, "max_line_length": 79, "avg_line_length": 38.69288389513109, "alnum_prop": 0.5527538476430162, "repo_name": "wmvanvliet/mne-python", "id": "3a1584f62a335842bf550484a6742536a58bd7b7", "size":...
import zipfile from django import forms from django.forms import ModelForm from django.forms.models import inlineformset_factory from .models import Challenge, Rule, ChallengeComment, Entry, EntryComment, EntryScreenshot class ChallengeForm(ModelForm): class Meta: model = Challenge fields = ('na...
{ "content_hash": "0b59072fdc5dc40b12765d2482b46e58", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 105, "avg_line_length": 26.26984126984127, "alnum_prop": 0.5549848942598188, "repo_name": "mavroskardia/codechallenge", "id": "1ed8ef392a5d2b2a1c869473a5bb08b71faa56d8", "...
""" flaskbb.app ~~~~~~~~~~~~~~~~~~~~ manages the app creation and configuration process :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ import os import logging import datetime from flask import Flask, request from flask.ext.login import current_user # ...
{ "content_hash": "d05fdf813b8e3b3d1ffb17b26396f286", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 81, "avg_line_length": 30.743396226415094, "alnum_prop": 0.6568061863262551, "repo_name": "mattcaldwell/flaskbb", "id": "bf4d604b7596663e0db4168fd450271d31bef310", "size":...
from modules.setup.app import app from modules import helpers from flask import redirect, request, url_for, flash, session as login_session import json import requests import os import sys ROOT_DIR = os.path.dirname(sys.modules['__main__'].__file__) client_secret_path = os.path.join( ROOT_DIR, 'client_secrets/gh_c...
{ "content_hash": "544325190c9e82be229f7fc4e79445d2", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 106, "avg_line_length": 41.42307692307692, "alnum_prop": 0.5947075208913649, "repo_name": "stonescar/item-catalog", "id": "c6177b5fc1c3e6ea5a12da14ccf00b73dfffb34d", "size"...
from django.test import TestCase from taskmaster.models import * class DependencyTestCase(TestCase): def setUp(self): self.group = JobGroup.objects.create(name="pizza maker group") self.job1 = self.group.new_job(name="tony job") self.job2 = self.group.new_job(name="steve job") self.job3 = self.group.new_job(n...
{ "content_hash": "9ef343c6e9d1abaefa1aff675cdeb6c6", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 91, "avg_line_length": 38.91525423728814, "alnum_prop": 0.7395470383275261, "repo_name": "ChrisCooper/pipeline-nanny", "id": "f7c794f972d44b78afc2314fa98bed6bcc422765", "si...
class ActorGraph(): def __init__(self): self.actors = [] def add(self, obj): self.actors.append(obj)
{ "content_hash": "25c619747c25879d8faf00d9fff55f6c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 31, "avg_line_length": 19.142857142857142, "alnum_prop": 0.5074626865671642, "repo_name": "fos/fos-legacy", "id": "4dbfde6a6eb137c786afe05beff44f2bf1023a2f", "size": "136", ...
"""Provides the most used functions in a nicely wrapped API. This module defines a global environment, so that most methods can be called without the need to specify an environment or a FormulaManager. Functions trying to access the global environment should use the method get_global_env(). Keep in mind that the globa...
{ "content_hash": "ebf662130cd42222a7d72c8ca83ac9ce", "timestamp": "", "source": "github", "line_count": 524, "max_line_length": 79, "avg_line_length": 35.37595419847328, "alnum_prop": 0.6528564492636348, "repo_name": "idkwim/pysmt", "id": "a9a2f5bda7cf394d0fdc8cb2df353163a9661f2f", "size": "19187",...
"""Multi-layer Perceptron """ # Authors: Issam H. Laradji <issam.laradji@gmail.com> # Andreas Mueller # Jiyuan Qian # License: BSD 3 clause import numpy as np from abc import ABCMeta, abstractmethod from scipy.optimize import fmin_l_bfgs_b import warnings from ..base import BaseEstimator, Classifi...
{ "content_hash": "b777e7233ce2e488453c7f338a76a3a1", "timestamp": "", "source": "github", "line_count": 1267, "max_line_length": 79, "avg_line_length": 39.431728492501975, "alnum_prop": 0.5855884707766214, "repo_name": "giorgiop/scikit-learn", "id": "9f1d1320d196e2fd3abe307940b1bad5ddec1d12", "size...
from players.player_reinforce_1 import * # PLAYER REINFORCE class player_reinforce_1A( player_reinforce_1 ): NUM_FRAMES = 1 LEARNING_RATE = 1e-4 REWARD_DISCOUNT = 0.99 ### __INIT__ def __init__( self ): player_reinforce_1.__init__( self ) # PROCESS OBSERVATION def proces...
{ "content_hash": "5112d5fcf5a53bab9157e7225e940f1b", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 97, "avg_line_length": 27.642857142857142, "alnum_prop": 0.5271317829457365, "repo_name": "NiloFreitas/Deep-Reinforcement-Learning", "id": "a56e9a5bdd9400c6ce042b835142d1f0e0...
''' Written by Thilina Rajapakse https://github.com/ThilinaRajapakse/BERT_binary_text_classification/blob/master/converter.py ''' from __future__ import absolute_import, division, print_function import csv import os import sys import logging logger = logging.getLogger() csv.field_size_limit(2147483647) # Increase CS...
{ "content_hash": "a036b3b36cdafebff45df5eb6876b7e4", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 94, "avg_line_length": 34.649484536082475, "alnum_prop": 0.6084498661112764, "repo_name": "tedunderwood/fiction", "id": "cd75bce19b52b72df4e01602c80ce9ef9f5243fa", "size": ...
from devito.data import FULL __all__ = ['make_clause_reduction'] def make_clause_reduction(symbols): args = [] for i in symbols: if i.is_Indexed: f = i.function bounds = [] for k, d in zip(i.indices, f.dimensions): if k.is_Number: ...
{ "content_hash": "94d6a228085b348781bd5366dd7c658b", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 74, "avg_line_length": 34.34782608695652, "alnum_prop": 0.47341772151898737, "repo_name": "opesci/devito", "id": "a986f2255e75fe2362ec99f531dba7a4d190675f", "size": "790", ...
from livestreamer.compat import str, bytes, parse_qs from livestreamer.plugins import Plugin, PluginError, NoStreamsError from livestreamer.stream import HTTPStream, StreamType from livestreamer.utils import urlget, verifyjson import re import json class Youtube(Plugin): @classmethod def can_handle_url(self, ...
{ "content_hash": "41b053ea8f5be555867512a62dbfdebd", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 84, "avg_line_length": 27.568421052631578, "alnum_prop": 0.5574646811760214, "repo_name": "derekzhang79/livestreamer", "id": "20fb1a985bd6a3d2e0bf9c3e125ee2d96b7eb0ad", "si...
''' Setup script for pyramid_mongo_scaffolds. ''' from setuptools import setup, find_packages requires = [ 'pyramid>=1.4,<1.5', ] scaffolds = """ [pyramid.scaffold] mongoengine = pyramid_mongo_scaffolds:PyramidMongoengineTemplate mongokit = pyramid_mongo_scaffolds:PyramidMongokitTemplate ming = pyramid_mongo...
{ "content_hash": "4ce9fa9cfd313175972a0e38f80d8971", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 66, "avg_line_length": 25.476190476190474, "alnum_prop": 0.6869158878504673, "repo_name": "mukund-kri/pyramid-mongo-scaffolds", "id": "83b83c84e61b27684b5721cfbdae073daa9cbdd...
import parser as p storeUrl = '/tmp/view-source_https___www.ulmart.ru.html' # storeUrl = 'https://ulmart.ru' mainMenuClass = 'li.b-list__item.b-dropdown.b-dropdown_catalog-menu.dropdown.dropdown_catalog-menu > a' shopId = 0 def product_process(url: str, params: dict): page = params['page'] if hasattr(params, 'p...
{ "content_hash": "628a804833c4a279ad283e539984bf6a", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 103, "avg_line_length": 26, "alnum_prop": 0.607940446650124, "repo_name": "StixoTvorec/py-try", "id": "77fa5c8477d7f168a6dbdd4203a3dd4ff2823fc6", "size": "850", "binary":...
import rrd_config as C import re import subprocess import os values = [None] * len(C.Ups._fields) apc = subprocess.Popen(['apcaccess'], stdout=subprocess.PIPE) while True: line = apc.stdout.readline() if not line: break for i in range(0, len(C.Ups._fields)): if line.startswith(C.Ups._field...
{ "content_hash": "ae41722d08f22cf6aa45f0694bd3a322", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 82, "avg_line_length": 29.09090909090909, "alnum_prop": 0.571875, "repo_name": "rain87/pc-health", "id": "a77d1114e72318b4e7c14b86a60b992134b3055f", "size": "659", "binar...
import sys import os.path sys.path.append(os.path.join(os.path.dirname(__file__), '..')) # Remaining imports. import analysis import ast import data import optparse import nparser import plankton import re import schedule import token # Encapsulates the compilation of an individual module. class ModuleCompile(objec...
{ "content_hash": "ca5cbd9ceb3a4df3b70bef037201721c", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 80, "avg_line_length": 29.61111111111111, "alnum_prop": 0.6744840525328331, "repo_name": "tundra/neutrino", "id": "b15abb600b17205172e0496737c7a9a12c6b128a", "size": "5445...
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', url(r'^$', 'CloudBroWeb.views.home', name='home'), url(r'^blog/', include('blog.urls', namespace='blog')), url(r'^twitch/', include('twitc...
{ "content_hash": "e09dde8b013f80a64df574ff681f4464", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 84, "avg_line_length": 49.111111111111114, "alnum_prop": 0.5158371040723982, "repo_name": "nicka101/CloudBroWeb", "id": "8f568ce4d8ed5804231d95b1e906136e248b69fb", "size": "...
import sys from ovirtcli.infrastructure.options import OvirtCliOptionParser from ovirtcli.infrastructure.context import OvirtCliExecutionContext from ovirtcli.infrastructure.object import create from ovirtcli.shell.engineshell import EngineShell def main(): # Parse the command line: parser = create(OvirtCliOp...
{ "content_hash": "52968b1f3611bb95f4cf8b49578812f8", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 74, "avg_line_length": 29.76, "alnum_prop": 0.7379032258064516, "repo_name": "oVirt/ovirt-engine-cli", "id": "ac7d5ced2198f04e03f1e960bdfe458059be6214", "size": "1336", "...
"""Gather conmats.""" import re import numpy as np import itertools as iter from itertools import combinations from mne.viz import circular_layout, plot_connectivity_circle def _atoi(text): """Get digit.""" return int(text) if text.isdigit() else text def natural_keys(text): """alist.sort(key=natural_...
{ "content_hash": "9e6885e5b1174c3a0493c201dbd41f86", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 79, "avg_line_length": 35.42384105960265, "alnum_prop": 0.534679379323238, "repo_name": "neuropycon/ephypype", "id": "ee4dfed5af1c994dd443d0e1f0cf21d50f4df545", "size": "5...
import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASES = { "default": { "ENGINE": 'django.db.backends.mysql', "NAME": 'election', "USER": 'electionUser', "PASSWORD": 'electionPass', "HOST": '', ...
{ "content_hash": "a65bcd574b36f9349d7dd6a125c17315", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 88, "avg_line_length": 25.897435897435898, "alnum_prop": 0.6732673267326733, "repo_name": "MasonM/django-elect", "id": "95c9c059f37c438aa7fb71bc956f67b78e3a7a78", "size": "...
import sys def caller_module(level: int = 2, sys=sys): """This function is taken from Pyramid Web Framework - ``pyramid.path.caller_module``.""" module_globals = sys._getframe(level).f_globals module_name = module_globals.get('__name__') or '__main__' module = sys.modules[module_name] return modul...
{ "content_hash": "8fb4483fa19eb43ce4fed57e9c6e7eb6", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 94, "avg_line_length": 38.72727272727273, "alnum_prop": 0.6314553990610329, "repo_name": "avanov/solo", "id": "8ddc035a706c109df5a7d1bb3d54f7a686517a99", "size": "852", "...
import os if os.getenv("GEVENT") == "true": from easypy.gevent import apply_patch apply_patch() import logging import logging.config from easypy import logging as easypy_logging logging.addLevelName(logging.WARN, "WARN") # instead of "WARNING", so that it takes less space... logging.addLevelName(logging.NOTS...
{ "content_hash": "37aa4a8c20abfc726a77af6c8eda36ac", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 150, "avg_line_length": 43.9375, "alnum_prop": 0.7354196301564723, "repo_name": "weka-io/easypy", "id": "f64359fb6bb52f978037944484a68213670f7279", "size": "703", "binary...
import _plotly_utils.basevalidators class CmaxValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="cmax", parent_name="sunburst.marker", **kwargs): super(CmaxValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "ffc7ee72022b55b18fb8396ef191fd03", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 84, "avg_line_length": 39.083333333333336, "alnum_prop": 0.6140724946695096, "repo_name": "plotly/plotly.py", "id": "2966493d56a12043d33383e61eb47b8249caef73", "size": "469...
from django.conf.urls import url from awx.api.views import ( WorkflowJobNodeList, WorkflowJobNodeDetail, WorkflowJobNodeSuccessNodesList, WorkflowJobNodeFailureNodesList, WorkflowJobNodeAlwaysNodesList, WorkflowJobNodeCredentialsList, ) urls = [ url(r'^$', WorkflowJobNodeList.as_view(), n...
{ "content_hash": "9fed00f2b8ba79ff7647cc63409deba6", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 132, "avg_line_length": 45.18181818181818, "alnum_prop": 0.704225352112676, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "809ee515f06fa03deeb770bf81431...
from datetime import datetime from unittest.mock import Mock import pytest from airflow import settings from airflow.models import DAG from airflow.models.baseoperator import BaseOperator from airflow.operators.dummy import DummyOperator from airflow.ti_deps.deps.trigger_rule_dep import TriggerRuleDep from airflow.ut...
{ "content_hash": "efa464849c0a0cce63018f636a2cd982", "timestamp": "", "source": "github", "line_count": 597, "max_line_length": 109, "avg_line_length": 34.482412060301506, "alnum_prop": 0.5184591469931021, "repo_name": "apache/incubator-airflow", "id": "bbdb84679cb1b950ad035afaa24cf216f0bdc6b7", "s...
import uuid import pytest from django_q.brokers import get_broker from django_q.cluster import Cluster from django_q.conf import Conf from django_q.monitor import get_ids, info, monitor from django_q.status import Stat from django_q.tasks import async_task @pytest.mark.django_db def test_monitor(monkeypatch): c...
{ "content_hash": "93806a83e875e2f6d0717bcf227c8ad9", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 73, "avg_line_length": 23.673076923076923, "alnum_prop": 0.6295694557270511, "repo_name": "Koed00/django-q", "id": "a7a7980bb3e2cea3d79bb50917f370a3bc8b385f", "size": "1231...
import numpy as np from .backends import CSVBackend try: basestring except NameError: stringtype = str else: stringtype = basestring __all__ = ["postprocess", "make_plots"] def postprocess(backend=None, temperature=1.0, cut=0, compression_assert=None, resample_log_X=0, ...
{ "content_hash": "21aab05e3265aa72cbab4ba3d6eb6a3d", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 78, "avg_line_length": 33.17272727272727, "alnum_prop": 0.5939526810998447, "repo_name": "eggplantbren/DNest4", "id": "3bd3329111a463324928e954d1f593df372f923f", "size": "...
import warnings import numpy as np import scipy.stats as sps from .abstract_transformation import AbstractTransformation from ..utils import priors from ..utils.param import Param as Hyperparameter def truncate_inputs(func): """ Decorator function. Truncates the inputs ...
{ "content_hash": "5f73a492e101bcc582a016d09eab72b7", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 103, "avg_line_length": 31.19178082191781, "alnum_prop": 0.6078173034694774, "repo_name": "fmaguire/BayeHem", "id": "2afed4c738e4409b4280511bfc910e68abccaae6", "size": "119...
from neutron.openstack.common import log as logging from quark import network_strategy STRATEGY = network_strategy.STRATEGY LOG = logging.getLogger(__name__) class UnmanagedDriver(object): """Unmanaged network driver. Returns a bridge... """ def __init__(self): self.load_config() def l...
{ "content_hash": "a04004ae096083fb344a796d4dc2d8e6", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 73, "avg_line_length": 35.270270270270274, "alnum_prop": 0.5950191570881226, "repo_name": "jkoelker/quark", "id": "35fdc982a780624bc365bbac3aa5a74d1837a028", "size": "3224"...
from __future__ import unicode_literals from django.apps import AppConfig class HomeAppConfig(AppConfig): name = 'home_app'
{ "content_hash": "d539612531b68ba7fa3bd1c77f0daf9c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 18.714285714285715, "alnum_prop": 0.7480916030534351, "repo_name": "shahjalalh/homely", "id": "ec60a3ef7c7e83c926f5bfd0fe36084ae10f8ecf", "size": "131...
"""The data layer used during training to train a R*CNN network. AttributesRoIDataLayer implements a Caffe Python layer. """ import caffe from fast_rcnn.config import cfg from attr_roi_data_layer.minibatch import get_minibatch import numpy as np import yaml from multiprocessing import Process, Queue # import pdb cla...
{ "content_hash": "1ff34d66c985cfddfd34f56e84b01205", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 75, "avg_line_length": 36.79865771812081, "alnum_prop": 0.5898230895495167, "repo_name": "gkioxari/RstarCNN", "id": "983d3fc4692ccbe212296c511989b36c516a7880", "size": "59...
""" This module contains convenience functions for getting a coordinate object for a named object by querying SESAME and getting the first returned result. Note that this is intended to be a convenience, and is very simple. If you need precise coordinates for an object you should find the appropriate reference for that...
{ "content_hash": "43473d0f119cd4d95ca9f3ec831776c8", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 91, "avg_line_length": 33.2, "alnum_prop": 0.6316695352839932, "repo_name": "joergdietrich/astropy", "id": "90d6d66d4147e8ae2c845bc43138b45530f5efad", "size": "5875", "b...
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DjangoWebProject.settings") # This application object is used by the development server # as well as any WSGI server configured to use this file. from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
{ "content_hash": "7e7ad1f08b0f4c885620b903f55a7625", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 76, "avg_line_length": 41.714285714285715, "alnum_prop": 0.8047945205479452, "repo_name": "nayak16/TartanHacks-2015", "id": "75bf82329649b3e957bc2a44d312d34dad67966b", "size...
from __future__ import print_function from RSA import gen_keys from RSA import crypt import json import os import getpass import argparse import base64 from builtins import input class Session(object): def __init__(self, load=True): self.public = None self.private = None self.contacts = ...
{ "content_hash": "e23d13a1991ba188e2ee8889229bb5bd", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 113, "avg_line_length": 37.664, "alnum_prop": 0.6166100254885302, "repo_name": "DocSohl/Azeroth", "id": "6303dc7d33ace0195e4d89a7420dd747c69ed5b5", "size": "4708", "bina...
import time from oslo_log import log as logging from oslo_service import loopingcall from oslo_utils import units from cinder import coordination from cinder import exception from cinder.i18n import _ from cinder.volume.drivers.dell_emc.powermax import utils LOG = logging.getLogger(__name__) WRITE_DISABLED = "Write...
{ "content_hash": "5be97c83d6108a5eb46f1b46b2bca9ae", "timestamp": "", "source": "github", "line_count": 731, "max_line_length": 79, "avg_line_length": 43.224350205198355, "alnum_prop": 0.567142450232617, "repo_name": "openstack/cinder", "id": "638fc4c1eecdfc3cbde86552b49c0d653e778b65", "size": "322...
from collections import Counter from typing import Dict, List, Optional, Union from tensorflow.keras.callbacks import Callback as KerasCallback from ray.air import session from ray.train.tensorflow import TensorflowCheckpoint from ray.util.annotations import PublicAPI class _Callback(KerasCallback): """Base cla...
{ "content_hash": "ed39ca75393d687aa92c568e8e52ef0b", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 78, "avg_line_length": 33.518324607329845, "alnum_prop": 0.563730084348641, "repo_name": "ray-project/ray", "id": "92759ac6fa91a6213df1a72b53a76925d7f29119", "size": "6402...
from thumbor.filters import BaseFilter, filter_method from thumbor.ext.filters import _saturation class Filter(BaseFilter): @filter_method(BaseFilter.DecimalNumber) def saturation(self, change): mode, data = self.engine.image_data_as_rgb() imgdata = _saturation.apply(mode, change, data) ...
{ "content_hash": "a5f05a7e5d002b031f0355c3c12990d1", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 55, "avg_line_length": 35.8, "alnum_prop": 0.723463687150838, "repo_name": "gi11es/thumbor", "id": "3e4acaed8b9e593c30cc36a8430c17d567889fe6", "size": "610", "binary": fa...
from django.utils.translation import ugettext_lazy as _ from django.views.generic import (View, ListView, DetailView, CreateView, UpdateView, DeleteView) from django.contrib.auth.decorators import login_required from django.shortcuts import redirect from django.http import HttpRespon...
{ "content_hash": "5f74958126f4c3b7036ca0b0273e303f", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 78, "avg_line_length": 31.464285714285715, "alnum_prop": 0.720771850170261, "repo_name": "ozgurgunes/django-filizver", "id": "c636265afcfa90f97638d659828c517765064701", "si...
import logging, os, sys, tempfile, shutil def findInPath(fileName, path=os.environ['PATH']): dirs = path.split(os.pathsep) for dir in dirs: if os.path.isfile(os.path.join(dir, fileName)): return os.path.join(dir, fileName) if sys.platform in ('cygwin', 'win32'): if os.pa...
{ "content_hash": "ae0e2a049788b945dc30b533003f11a1", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 150, "avg_line_length": 37.84444444444444, "alnum_prop": 0.63671951458211, "repo_name": "windmill/windmill", "id": "8f425b4bd64e7d852bc8258337d26ccabb0bc402", "size": "580...
from .model import Swagger from .visitor import OpenAPIResolveVisitor from ...parser import Parser class OpenAPIParser(Parser): @staticmethod def parse(schema): component = Swagger.unmarshal(schema) component.accept(OpenAPIResolveVisitor(schema)) return component
{ "content_hash": "a0e13c620762f4eeaea89fb922fc2e38", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 55, "avg_line_length": 24.916666666666668, "alnum_prop": 0.7357859531772575, "repo_name": "pennsignals/aptos", "id": "2257a982d9c3c675be31beee253f11dfed7d01dd", "size": "29...
from sqlalchemy import Column, Table, ForeignKey, types from sqlalchemy.ext.mutable import Mutable #from werkzeug import generate_password_hash, check_password_hash from geoalchemy2 import Geometry from flask.ext.login import UserMixin from .constants import * from ..extensions import db from ..utils import get_curren...
{ "content_hash": "3751166e01ffdfebc0e72540ca7df325", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 65, "avg_line_length": 33.029411764705884, "alnum_prop": 0.7257346393588602, "repo_name": "wandonye/vshare", "id": "682a9fc26dc3f920697094870a6e4e392b5b21b8", "size": "1154...
import logging, os, shutil, tarfile from app.modules.common.pipeline import * from app.modules.common.task import * from app.modules.common.errors import * from app.modules.common.network import * log = logging.getLogger(__name__) class DeployTomcatTask(Task): ''' tomcat_source_path tomcat_depl...
{ "content_hash": "c5dc8a9978c23132ee19b4acc3ff9274", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 107, "avg_line_length": 34.25, "alnum_prop": 0.629683698296837, "repo_name": "ssls/beetle-agent", "id": "d232619abcc4e17bb657b58e9b0add94516bce93", "size": "2071", "binar...
"""Support for Clementine Music Player as media player.""" from datetime import timedelta import logging import time from clementineremote import ClementineRemote import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice from homeassistant.components.media_player.co...
{ "content_hash": "78dea083da2ad84455041973ffda3a7c", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 84, "avg_line_length": 28.858974358974358, "alnum_prop": 0.6035835924774174, "repo_name": "Teagan42/home-assistant", "id": "9e05b831359fdd8be79d75fe5ebd02b2205bec02", "siz...
from django.test import TestCase from tests.test_mixin.models import Account, Contact, Proxy2Contact from salesforce.backend.test_helpers import current_user, uid_version as uid def refresh(obj): """ Get the same object refreshed from the same db. """ db = obj._state.db return type(obj).objects.us...
{ "content_hash": "5c41d9f51caa0f9d2a8104fad99c7cca", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 115, "avg_line_length": 43.44736842105263, "alnum_prop": 0.6535433070866141, "repo_name": "hynekcer/django-salesforce", "id": "849ddaa077b7bd4622e582603175b6d412c23389", "s...
"""completed bool on logs Revision ID: 1455d9c95734 Revises: 1ecc5d85f815 Create Date: 2015-09-25 13:34:37.684253 """ # revision identifiers, used by Alembic. revision = '1455d9c95734' down_revision = '1ecc5d85f815' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by A...
{ "content_hash": "b25420525b0e33f3fa8a6865d6ffc2bf", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 83, "avg_line_length": 35.029411764705884, "alnum_prop": 0.670864819479429, "repo_name": "jeffthemaximum/jeffPD", "id": "594cb70d670b22d35463d042436490029ff3030e", "size": ...
"""Tests for py_builtins module.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import six from tensorflow.python.autograph.operators import data_structures from tensorflow.python.autograph.operators import py_builtins from tensorflow.pytho...
{ "content_hash": "4a5ffe11d696699426d54e3a7023f60b", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 79, "avg_line_length": 36.24786324786325, "alnum_prop": 0.6571563310539967, "repo_name": "AnishShah/tensorflow", "id": "a021263ffa8ae29dd04527823b2e3f372acc2f4d", "size": ...
import datetime from flask import Markup, url_for from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey, Date, Text from sqlalchemy.orm import relationship from app import db from flask.ext.appbuilder.models.mixins import AuditMixin, BaseMixin, FileColumn, ImageColumn from flask.ext.appbuilder.fil...
{ "content_hash": "7800e3fd2d8c6d8f4ca74941d2354ef4", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 104, "avg_line_length": 42.61666666666667, "alnum_prop": 0.6171294485725459, "repo_name": "zhounanshu/Flask-AppBuilder", "id": "c713a0dd50451f5ef64629935f11aa89cb4a2227", "...
""" HVAC channels module for Zigbee Home Automation. For more details about this component, please refer to the documentation at https://home-assistant.io/integrations/zha/ """ from __future__ import annotations import asyncio from collections import namedtuple from typing import Any from zigpy.exceptions import Zig...
{ "content_hash": "27be89f43620385239f273589f9e5174", "timestamp": "", "source": "github", "line_count": 444, "max_line_length": 88, "avg_line_length": 36.08783783783784, "alnum_prop": 0.5932097609686077, "repo_name": "sander76/home-assistant", "id": "6b0cd9e5e28f8fa388b2cded25a60e805f885241", "size...
import six from syn.five import xrange from nose.tools import assert_raises from syn.type.a import (Type, ValuesType, MultiType, TypeType, AnyType, TypeExtension, Set, Schema) from syn.base_utils import is_hashable, feq from syn.base_utils import ngzwarn, on_error, elog from syn.globals import ...
{ "content_hash": "be2c6c0a827c2bb60d937a86c6f57d74", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 80, "avg_line_length": 27.568115942028985, "alnum_prop": 0.561980864262433, "repo_name": "mbodenhamer/syn", "id": "9c7c66bfd8bd8d92b963b2f14a13506b6cf6434b", "size": "9511...
""" Bottle is a fast and simple micro-framework for small web applications. It offers request dispatching (Routes) with url parameter support, templates, a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and template engines - all in a single file and with no dependencies other than the Python S...
{ "content_hash": "771dff95ca78fb2480f88b859022eec0", "timestamp": "", "source": "github", "line_count": 3567, "max_line_length": 103, "avg_line_length": 39.62573591253154, "alnum_prop": 0.5808412041458841, "repo_name": "Gehn/JustABlog", "id": "4da3557f2f1e15c288d06b2162a9f9a5f53c406c", "size": "141...
from __future__ import unicode_literals from __future__ import print_function import os import sys import traceback import logging from time import time from datetime import datetime from random import choice from io import open import click import sqlparse from prompt_toolkit import CommandLineInterface, Application...
{ "content_hash": "2c3b72e31ff11ef23c96bd0653d5ff2b", "timestamp": "", "source": "github", "line_count": 689, "max_line_length": 115, "avg_line_length": 41.471698113207545, "alnum_prop": 0.5614544690977812, "repo_name": "jinstrive/mycli", "id": "640633c0e25feb94ab619f75c76eaf90d9c5cb5b", "size": "28...
"""Presubmit script for ui/accessibility.""" import os, re AX_IDL = 'ui/accessibility/ax_enums.idl' AUTOMATION_IDL = 'chrome/common/extensions/api/automation.idl' def InitialLowerCamelCase(unix_name): words = unix_name.split('_') return words[0] + ''.join(word.capitalize() for word in words[1:]) # Given a full ...
{ "content_hash": "b0a839d5b2382c99a58b284c99fcf4c5", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 34.68131868131868, "alnum_prop": 0.6387832699619772, "repo_name": "Samsung/ChromiumGStreamerBackend", "id": "ef41ab093348f5b1dd6d8f57890d00785c688324",...
from amqpstorm.management.basic import Basic from amqpstorm.tests.utility import FakeHTTPClient from amqpstorm.tests.utility import TestFramework class BasicTests(TestFramework): def test_basic_get_with_payload(self): def on_post_with_payload(name): return [{'payload': name}] api = B...
{ "content_hash": "f35ee3b5f2c5e8095b7d3947d1c62bb2", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 65, "avg_line_length": 31.875, "alnum_prop": 0.6640522875816993, "repo_name": "eandersson/amqp-storm", "id": "1e99da37404cf29b14333a406e90c8ae02380490", "size": "765", "b...
"""Extracts information about symbols loaded from other .bzl files.""" import ast from collections import namedtuple LoadSymbol = namedtuple('LoadSymbol', ['label', 'symbol', 'alias']) """Information about a symbol loaded from another .bzl file.""" class LoadExtractorError(Exception): """Error raised by LoadExtra...
{ "content_hash": "a9d99b7940bd099e0f01ea98d37cd162", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 75, "avg_line_length": 32.45918367346939, "alnum_prop": 0.6233888714240805, "repo_name": "bazelbuild/skydoc", "id": "e083a3d926fc80d7d6efe6eb8001375666d0b0f2", "size": "378...
def gpu_queue(options): """ Queued up containers waiting for GPU resources """ import docker import json import time from vent.helpers.meta import GpuUsage status = (False, None) print("gpu queue", str(options)) print("gpu queue", str(GpuUsage(base_dir="/vent/", ...
{ "content_hash": "88469a67d21bc80b22ef1a6b82aaa3b4", "timestamp": "", "source": "github", "line_count": 440, "max_line_length": 122, "avg_line_length": 45.77045454545455, "alnum_prop": 0.4334376086200904, "repo_name": "bpagon13/vent", "id": "92cea9690c5a3c72b29b312afa838eb2cb9b139f", "size": "20139...
""" Cisco_IOS_XR_show_fpd_loc_ng_oper This module contains a collection of YANG definitions for Cisco IOS\-XR show\-fpd\-loc\-ng package operational data. This module contains definitions for the following management objects\: show\-fpd\: Show hw\-module fpd Copyright (c) 2013\-2016 by Cisco Systems, Inc. All rig...
{ "content_hash": "7e93871a46228df68009c391c9b7a689", "timestamp": "", "source": "github", "line_count": 1048, "max_line_length": 248, "avg_line_length": 31.920801526717558, "alnum_prop": 0.47965802768062654, "repo_name": "111pontes/ydk-py", "id": "b18c388ba69ebf9caeae70c0ae3b6a486afb557c", "size": ...
from flask import Flask from flask.ext.restplus import Api app = Flask("dmon-agent") api = Api(app, version='0.0.6', title='DICE Monitoring Agent API', description="RESTful API for the DICE Monitoring Platform Agent (dmon-agent)", ) # changes the descriptor on the Swagger WUI and appends to api ...
{ "content_hash": "46a1fc530fed900155b8678e515d8d2a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 89, "avg_line_length": 36.90909090909091, "alnum_prop": 0.7142857142857143, "repo_name": "igabriel85/IeAT-DICE-Repository", "id": "2fb065c51850c140d246677c1d256c0ea77893b0", ...
import urwid class Popup(urwid.WidgetWrap): """ Creates a popup menu on top of another BoxWidget. Attributes: selected -- Contains the item the user has selected by pressing <RETURN>, or None if nothing has been selected. """ selected = None def __init__(self, menu_list...
{ "content_hash": "6a3c8cf934d00b77aa7960e7e279e2b3", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 77, "avg_line_length": 32, "alnum_prop": 0.571078431372549, "repo_name": "toxinu/pyhn", "id": "3a3a51d28de7d9f58a57ce154ec724a9fe5fe933", "size": "1656", "binary": false,...
from django.contrib import admin from . import models admin.site.register(models.SpectralIndicesTask) admin.site.register(models.UserHistory) admin.site.register(models.ToolInfo) admin.site.register(models.ResultType)
{ "content_hash": "80705b4d0486a17d62d68b063b5fe0e5", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 47, "avg_line_length": 31.285714285714285, "alnum_prop": 0.8401826484018264, "repo_name": "ceos-seo/data_cube_ui", "id": "a9acd9fe8abae712417d9545e3b6a123f88d4530", "size": ...
from iotronicclient.common import utils from iotronicclient.v1 import board_shell from iotronicclient.v1 import plugin_injection_shell from iotronicclient.v1 import plugin_shell COMMAND_MODULES = [ board_shell, plugin_shell, plugin_injection_shell, ] def enhance_parser(parser, subparsers, cmd_mapper): ...
{ "content_hash": "4e48fb9744aa2dbf4f70055bc41f8cc3", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 69, "avg_line_length": 32.76, "alnum_prop": 0.6971916971916972, "repo_name": "MDSLab/python-iotronicclient", "id": "6589eef7884eb4d622b5a6eb21cad2955b7e659b", "size": "1393...
"""Tool for converting raw object detection data into the COCO format.""" import abc import collections import hashlib import json import os from typing import Any, Generator, Iterable, Mapping, MutableMapping, Optional, Set, Tuple import six import tensorflow.compat.v1 as tf import tensorflow_datasets.public_api as t...
{ "content_hash": "fa6db3c628b3f85192dd2f33948957ba", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 90, "avg_line_length": 35.854651162790695, "alnum_prop": 0.5973731149667586, "repo_name": "tensorflow/tpu", "id": "9596c77a7f1239b108a6a9a95d66160814844821", "size": "1302...
from functools import wraps from django.contrib.auth.decorators import login_required as dj_login_required from constance import config def login_required(func): @wraps(func) def func_wrapper(*args, **kwargs): if config.ENABLE_PERMISSION: return dj_login_required(func)(*args, **kwargs) ...
{ "content_hash": "9f7e71b3c833957749b5509895fcce2b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 28.357142857142858, "alnum_prop": 0.6775818639798489, "repo_name": "ctripcorp/tars", "id": "fab835843e0cc4e64ab76d8321603034f7c46130", "size": "397",...
import asposebarcodecloud from asposebarcodecloud.BarcodeApi import BarcodeApi from asposebarcodecloud.BarcodeApi import ApiException import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi from asposestoragecloud.StorageApi import ResponseMessage import ConfigParser config = Conf...
{ "content_hash": "a61db0b08bca5178b8924b9ffda0e88a", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 161, "avg_line_length": 33.078125, "alnum_prop": 0.6939064714218234, "repo_name": "farooqsheikhpk/Aspose_BarCode_Cloud", "id": "0be9b77501ab9c06fc30a71206ff5a51835b2ff5", "...
from statsmodels.regression.linear_model import OLS from sklearn import cross_validation import numpy as N def get_balanced_folds(y,nfolds,pthresh=0.8): """ This function uses anova across CV folds to find a set of folds that are balanced in their distriutions of the X value - see Kohavi, 1995 ""...
{ "content_hash": "6fe3637255ab91d009b465b3f6078486", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 70, "avg_line_length": 25.774193548387096, "alnum_prop": 0.6220275344180225, "repo_name": "poldracklab/poldracklab-base", "id": "c105a3be73ecc53656e68c113e8a505ef9485f96", ...
from __future__ import absolute_import, unicode_literals import collections from django import forms from django.core.exceptions import ValidationError from django.forms.utils import ErrorList from django.utils.encoding import python_2_unicode_compatible from django.utils.functional import cached_property from django...
{ "content_hash": "dd21262328d805209cccc2daa8d0fe2d", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 146, "avg_line_length": 38.06395348837209, "alnum_prop": 0.629295860699557, "repo_name": "stevenewey/wagtail", "id": "94a73a563e67042faced81214e4e1f0096e1e43a", "size": "6...
import unittest import pyxb.binding.datatypes as xsd class Test_decimal (unittest.TestCase): def testRange (self): self.fail("Datatype decimal test not implemented") if __name__ == '__main__': unittest.main()
{ "content_hash": "c6b4dcd557d476c2e33207f7f29da82c", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 58, "avg_line_length": 25.22222222222222, "alnum_prop": 0.6872246696035242, "repo_name": "jonfoster/pyxb1", "id": "c0e71d85ebc8eb0667e988b4492ecf12e269f25f", "size": "227", ...
import mechanize import urllib import re import sys ################################################################################ # Constantes ################################################################################ ### URLs MAIN_URL = 'http://www.daconline.unicamp.br/altmatr/menupublico.do' REQUEST_URL = ...
{ "content_hash": "69239c330eabeaa7772244e28810feb2", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 215, "avg_line_length": 37.604651162790695, "alnum_prop": 0.5611214182642754, "repo_name": "cacounicamp/gda", "id": "d1cb0611f45cee1dae985b72070f19ba6f44f157", "size": "51...
''' Script used to query Wikipedia for summary of object ''' import sys import wikipedia import nltk def main(): # Check that we have the right number of arguments if (len(sys.argv) != 2): print 'Incorrect number of arguments; please pass in only one string that contains the query' exit() # Get the noun...
{ "content_hash": "a5787b456973145b824c4afc90849e11", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 95, "avg_line_length": 25.307692307692307, "alnum_prop": 0.682370820668693, "repo_name": "christopher18/Celsearch", "id": "af91a026133b1be1420f6839e26701ff6e7f6cfd", "size"...
import json from unittest import mock import os import pytest import tempfile import zipfile from django.conf import settings from django.forms import ValidationError from django.utils.encoding import force_text from waffle.testutils import override_switch from olympia import amo from olympia.addons.models import Ca...
{ "content_hash": "1743a98a1ba141893ff5f72b902f7ecd", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 79, "avg_line_length": 44.031007751937985, "alnum_prop": 0.6369131455399061, "repo_name": "kumar303/olympia", "id": "479ac43e4b3ca164afb58d892cc74a3f7f9eae22", "size": "17...
from chatterbot import ChatBot # Create a new instance of a ChatBot bot = ChatBot( 'Default Response Example Bot', storage_adapter='chatterbot.storage.JsonFileStorageAdapter', logic_adapters=[ { 'import_path': 'chatterbot.logic.BestMatch' }, { 'import_path':...
{ "content_hash": "8ce8a07be2663c0417aac55e8885ac12", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 92, "avg_line_length": 28.8125, "alnum_prop": 0.6464208242950108, "repo_name": "davizucon/ChatterBot", "id": "18bdd5bd6e297e28ca12d35b874661200a182763", "size": "946", "b...
import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFo...
{ "content_hash": "63fb670a3b1475223be6e144d1d8b8d2", "timestamp": "", "source": "github", "line_count": 642, "max_line_length": 234, "avg_line_length": 44.94392523364486, "alnum_prop": 0.6451098634504748, "repo_name": "Azure/azure-sdk-for-python", "id": "0c3708764c607e3752bf3d1b514cd9007d331787", "...
"""ImageNet Norm-Free Residual Networks as defined in (Brock et al., 2021). Reference: A. Brock, S. De, and S. L. Smith. Characterizing signal propagation to close the performance gap in unnormalized resnets. International Conference on Learning Representations, 2021. """ from typing import Any, Optional imp...
{ "content_hash": "71fb7125d61caf56a47840a996172dfb", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 77, "avg_line_length": 32.67741935483871, "alnum_prop": 0.5942744323790721, "repo_name": "deepmind/jax_privacy", "id": "4c6f1823342cbba508fe7badc8dec847838bca6a", "size": ...
from inspect import isclass from django.conf import settings from django.core.files.storage import get_storage_class from celery.datastructures import AttributeDict from tower import ugettext_lazy as _ __all__ = ('LOG', 'LOG_BY_ID', 'LOG_KEEP',) class _LOG(object): action_class = None class CREATE_ADDON(_LOG...
{ "content_hash": "2875705a0d45c02720a3cca760d87cdd", "timestamp": "", "source": "github", "line_count": 816, "max_line_length": 79, "avg_line_length": 24.026960784313726, "alnum_prop": 0.6023666224625115, "repo_name": "luckylavish/zamboni", "id": "fbde0d5a5e98d10aeef90fcdab69a3b328969785", "size": ...
import logging import lirc from soco import SoCo from soco.exceptions import SoCoException import config def is_playing(transport_info): state = transport_info['current_transport_state'] if state == 'PLAYING': return True elif state == 'PAUSED_PLAYBACK': return False elif state == 'STO...
{ "content_hash": "bfcf1eb40a6fefab5cbc393bef6a4888", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 128, "avg_line_length": 29.636363636363637, "alnum_prop": 0.5, "repo_name": "prebm/SonosRemote", "id": "1746867d6849f74024a5fa2e5a20bf905eaffe6e", "size": "2032", "binary...
""" pinq.queryable ~~~~~~~~~~~~~~ This module implements the Queryable class for querying iterables using the LINQ api. :copyright: (c) 2016 by David Shriver. :license: MIT, see LICENSE for more details. """ from __future__ import division from .compat import * from .predicates import true from .transforms import id...
{ "content_hash": "a4246e492b4be4729a70571d68d54c85", "timestamp": "", "source": "github", "line_count": 933, "max_line_length": 100, "avg_line_length": 42.91211146838157, "alnum_prop": 0.6265454454629468, "repo_name": "dlshriver/pinq", "id": "463cb93624e1b11e79505c38eff422e8fdfaea90", "size": "4003...
from dataclasses import dataclass, field import torch from omegaconf import II from fairseq import metrics, utils from fairseq.dataclass import ChoiceEnum from fairseq.tasks import register_task from fairseq.tasks.translation import TranslationConfig, TranslationTask from .logsumexp_moe import LogSumExpMoE from .mean...
{ "content_hash": "758cbcfd14ad4b2ae83dd2b0cb74a9fb", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 95, "avg_line_length": 36.873517786561266, "alnum_prop": 0.5694072247829349, "repo_name": "pytorch/fairseq", "id": "1ee9d1b727006841382bd6389e97e4cb2771a112", "size": "950...
import os; print os.access('myOS_file-path.txt', os.R_OK); print os.access('myOS_file-path.txt', os.W_OK); print os.access('myOS_file-path.txt', os.X_OK);
{ "content_hash": "91f3b9328e1db33a853956602d65c9e5", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 47, "avg_line_length": 19.875, "alnum_prop": 0.6729559748427673, "repo_name": "xiaoyong0312/Python-dev", "id": "e1e405ab358d293e823577c56d66356ee974cdac", "size": "297", "...
from django.test import TestCase from rest_framework.test import APITestCase from rest_framework import status from django.core.urlresolvers import reverse from django.core.exceptions import ValidationError from pdc.apps.bindings import models as binding_models from pdc.apps.common.test_utils import TestCaseWithChange...
{ "content_hash": "3067e5b255628940ef290b754114a9a2", "timestamp": "", "source": "github", "line_count": 1564, "max_line_length": 120, "avg_line_length": 51.381713554987215, "alnum_prop": 0.5930115354462986, "repo_name": "lao605/product-definition-center", "id": "ed50e38678259973b375b22ff36286cbcd1f96...
""" test_discrete.py: Test suite for the Gaussian estimator class :class:DiscreteEst` """ from __future__ import print_function import unittest import numpy as np # Add the path to the vampyre package and import it import env env.add_vp_path() import vampyre as vp def discrete_test(zshape=(1000,10), ve...
{ "content_hash": "19639ed24e9c7c374a2e785b55855dd0", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 83, "avg_line_length": 33.24761904761905, "alnum_prop": 0.6304783729590375, "repo_name": "GAMPTeam/vampyre", "id": "87f31980f9d6ca68fa469c3e3a46fdd10a88512a", "size": "349...
import logging import urlparse from django.conf import settings from django.utils.translation import ugettext_lazy as _ from keystoneclient import service_catalog from keystoneclient.v2_0 import client as keystone_client from keystoneclient.v2_0 import tokens from horizon.api import base from horizon import exceptio...
{ "content_hash": "5a8560554c09882f36911e6a4961f4e8", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 79, "avg_line_length": 38.50993377483444, "alnum_prop": 0.5893379191745486, "repo_name": "gyang/horizon", "id": "333afc1f658d2f4f2f64123c09019f3f94c57b51", "size": "12471"...
from flask import render_template, redirect, url_for, flash, request from flask_login import login_user, logout_user, login_required, current_user from . import auth from .. import db from ..email import send_email from ..models.users import User from .forms import LoginForm, RegistrationForm, ChangePasswordForm, Passw...
{ "content_hash": "c896c1040920de497235c06ad7f7fde8", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 112, "avg_line_length": 37.62893081761006, "alnum_prop": 0.6480026742436904, "repo_name": "KevDi/Flashcards", "id": "0a2830052cded23ebaef55168aace0e1593430ad", "size": "59...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tracking', '0005_device_hidden'), ] operations = [ migrations.AlterField( model_name='device', name='hidden', field=models.BooleanField(default=True, ver...
{ "content_hash": "b12cfe0ad23ee78f931b9462781a6b9c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 253, "avg_line_length": 42.73076923076923, "alnum_prop": 0.5634563456345635, "repo_name": "ropable/resource_tracking", "id": "a2e7e65cb59d4c2436f2b26fe77e23d5bc309273", "si...
import _julia import matplotlib.pyplot as plt class Julia: def __init__(self, min_r, max_r, min_i, max_i, z, resolution): self.scores = _julia.Julia(min_r, max_r, min_i, max_i, z, resolution) self._julia = None @property def julia(self): if not self._julia: self...
{ "content_hash": "422945b24d5f67efb6f22f6cfaf16605", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 85, "avg_line_length": 33.77777777777778, "alnum_prop": 0.569078947368421, "repo_name": "jfamestad/julia", "id": "d723e21dae49724bc5accce97377f8a9491a3a81", "size": "912", ...