text
stringlengths
4
1.02M
meta
dict
import os import signal import subprocess import sys import time import unittest class SIGUSR1Exception(Exception): pass class InterProcessSignalTests(unittest.TestCase): def setUp(self): self.got_signals = {'SIGHUP': 0, 'SIGUSR1': 0, 'SIGALRM': 0} def sighup_handler(self, signum, frame): ...
{ "content_hash": "d196ef48334647c6dbe950d3c127912a", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 75, "avg_line_length": 34.095238095238095, "alnum_prop": 0.5715782122905028, "repo_name": "MalloyPower/parsing-python", "id": "d3ae170983bc36a2f54bd8c9b1bc32e7caee7ffb", "s...
from __future__ import unicode_literals import pytest # Note: "chromosomes" worked previous the bug fix @pytest.mark.models('en') @pytest.mark.parametrize('word,lemmas', [("chromosomes", ["chromosome"]), ("endosomes", ["endosome"]), ("colocalizes", ["colocaliz", "colocalize"])]) def test_issue781(EN, word, lemmas): ...
{ "content_hash": "74c18348dcebb6ea3b627665db31b06a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 149, "avg_line_length": 42, "alnum_prop": 0.6991341991341992, "repo_name": "aikramer2/spaCy", "id": "805e6822831708166c769ff88f6435b198c05888", "size": "478", "binary": f...
#!python3 # -*- coding:utf-8 -*- import os import sys import time import ctypes import shutil import subprocess IsPy3 = sys.version_info[0] >= 3 if IsPy3: import winreg else: import codecs import _winreg as winreg BuildType = 'Release' IsRebuild = True Build = 'Rebuild' Update = False Copy = False CleanAl...
{ "content_hash": "fc2efed7abbb701b4c05bdc757f5028d", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 195, "avg_line_length": 38.23380281690141, "alnum_prop": 0.5922051130921683, "repo_name": "xylsxyls/xueyelingshuang", "id": "83df2336909bd1a9e4c835462e4c194a72bc3f79", "si...
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 brandName = "Demisto REST API" instanceName = demisto.args().get('instanceName') allInstances = demisto.getModules() brandInstances = [instanceName for instanceName in allInstances if allInstances[instanceName]['brand'].lower( ) ...
{ "content_hash": "c8474c8c0f3d0c17e7e000650c4466a9", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 128, "avg_line_length": 49.92857142857143, "alnum_prop": 0.7625178826895566, "repo_name": "VirusTotal/content", "id": "8056f628dd8d8d3d2ea875eb6a06cfa03e744b1b", "size": "6...
from aorm import * orm.connect_sqlite3( 'test.db' ) # # Models # class Users(Model): @property def posts(self): return Posts.all({ 'author':self.id, }) class Posts(Model): pass class Raw(Model): pass # # Helpers # # HELPERS def mkuser(email, password): u=Users.create() u.email=ema...
{ "content_hash": "9ef2070ff19cb2f80fb1cb9971f49848", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 63, "avg_line_length": 16.227848101265824, "alnum_prop": 0.6326053042121685, "repo_name": "maxdoom-com/aorm", "id": "bccddc432a5313d7a49fc06d604d9350cd76be72", "size": "130...
""" KubeVirt API This is KubeVirt API an add-on for Kubernetes. OpenAPI spec version: 1.0.0 Contact: kubevirt-dev@googlegroups.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1FeatureState(object): ...
{ "content_hash": "c95195ccf0b6a9763903d84da5154cef", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 103, "avg_line_length": 25.69918699186992, "alnum_prop": 0.5336918696614995, "repo_name": "kubevirt/client-python", "id": "a12f43c6257d249e2821b45fdfb0329dba9bec41", "size...
""" EventAdmin shell commands Provides commands to the Pelix shell to work with the EventAdmin service :author: Thomas Calmant :copyright: Copyright 2016, Thomas Calmant :license: Apache License 2.0 :version: 0.6.4 .. Copyright 2016 Thomas Calmant Licensed under the Apache License, Version 2.0 (the "Licens...
{ "content_hash": "3e131dcbef3a9a91443143309302cf29", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 80, "avg_line_length": 27.689655172413794, "alnum_prop": 0.6147779161477792, "repo_name": "isandlaTech/cohorte-devtools", "id": "5e2053e1df56fe40cd2c87385073c1aa4e209436", ...
from mds.api.v1 import v2compatlib from mds.mrs.models import SavedProcedure from mds.core.models import Subject __all__ = ['run'] def run(): subject = Subject.objects.get(uuid="26da580a-fc75-4f1a-92b2-be54e2865ceb") sp = SavedProcedure.objects.get(guid="5bcf6e9d-73a3-48db-9359-e1f110d3019f") encounter, o...
{ "content_hash": "6229e5e049f75f3ed3ea9d8c7f53fe6f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 80, "avg_line_length": 34, "alnum_prop": 0.7352941176470589, "repo_name": "dekatzenel/team-k", "id": "c87fa6b6b71a054e0c9a1299fd0298433a91fe10", "size": "442", "binary": ...
from __future__ import absolute_import from traits.trait_value import *
{ "content_hash": "8512fbbf434e3268ea90dd8213c2908f", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 38, "avg_line_length": 36, "alnum_prop": 0.7777777777777778, "repo_name": "enthought/etsproxy", "id": "9f8e491c6c763e080b82cd5102efb7f933256517", "size": "87", "binary": f...
from __future__ import division from future.builtins import zip import numpy as np import matplotlib.pyplot as plt from matplotlib import collections from matplotlib import transforms from matplotlib import ticker __all__ = ['hinton'] # TODO: Add yutils.mpl._coll to mpltools and use that for square collection. class...
{ "content_hash": "dbdbd90afb0bfde6b6f287da24011672", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 78, "avg_line_length": 35.40816326530612, "alnum_prop": 0.6389048991354467, "repo_name": "matteoicardi/mpltools", "id": "08c3a9565536ab5452e7ec5f65e8e1fb5b4112ab", "size": ...
import os from django.utils import unittest from django.test import RequestFactory, TestCase from django.conf import settings import django.template.context from django.template import Template, Context, RequestContext from django.template.response import (TemplateResponse, SimpleTemplateResponse, ...
{ "content_hash": "adca60501856ca01d7cf35d16e6fc5b9", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 91, "avg_line_length": 38.13461538461539, "alnum_prop": 0.6433434190620272, "repo_name": "heracek/django-nonrel", "id": "f658b35ac38b309a5c7b61f62f565fa6242d3bc5", "size":...
import json from json import JSONEncoder import logging import re import importlib import inspect from ._token import Token from ._token_kind import TokenKind from ._version import VERSION from ._diagnostic import Diagnostic JSON_FIELDS = ["Name", "Version", "VersionString", "Navigation", "Tokens", "Diagnostics", "Pa...
{ "content_hash": "d851df06d08421a261dbea0ee4843c33", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 146, "avg_line_length": 35.37786259541985, "alnum_prop": 0.6013593699428201, "repo_name": "tg-msft/azure-sdk-tools", "id": "cd2edf39c44edb6d8e8cd36457764d6ae18ff3e2", "siz...
""" Django settings for UCLGoProject project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ impo...
{ "content_hash": "195030243582023a51257171bfdd0942", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 113, "avg_line_length": 30.844036697247706, "alnum_prop": 0.6702855443188578, "repo_name": "ribeiro-ucl/UCLGoProject", "id": "e01ffc741cda0c71c12f786a5bd2b03b05c0dc4d", "s...
import autoinstall_lib as atl from waflib import Logs import os.path as osp from waflib import Logs from waflib import Context from waflib import Errors import sys import waflib version = "lapack-3.3.1" tool = "lapack-3.3.1" lapack_funcs = "dtrsv dpotrf dpotrs dpotri dtrtri dtrmm dtrmv dgeqrf dormqr dsyev dgesvd dsym...
{ "content_hash": "e817534221d837ffa48bd66dfc36d43c", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 208, "avg_line_length": 49.916363636363634, "alnum_prop": 0.6431849639396809, "repo_name": "baudren/montepython_public", "id": "d087317d5d519ca34170ea39d5cff747b3d9cb00", ...
from __future__ import absolute_import, print_function, unicode_literals import logging import os import sys import six from . import config, django, install def execute(): # Log info and above to console logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) config_data = config...
{ "content_hash": "2be116e2b96cfa7d917acbb78cebf2d9", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 98, "avg_line_length": 41.90769230769231, "alnum_prop": 0.5436857562408223, "repo_name": "Glasgow2015/team-10", "id": "b9fca0c3acb99e51f46dce41c54e9c3f930531ce", "size": "2...
from __future__ import unicode_literals from setuptools import setup, find_packages install_requires = [ "Jinja2", "boto>=2.20.0", "flask", "httpretty>=0.6.1", "requests", "xmltodict", "six", "werkzeug", ] extras_require = { # No builtin OrderedDict before 2.7 ':python_version=...
{ "content_hash": "6775d5bf112f4229a78a5d45cdcf8de3", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 67, "avg_line_length": 27.361702127659573, "alnum_prop": 0.588646967340591, "repo_name": "2mf/moto", "id": "a65f5e15ed9d1fb9846d30e2914d602c1ff2a19a", "size": "1308", "bi...
import option class Quit(option.Option): """ grape q Quits grape. Usage: grape-q """ def __init__(self): super(Quit, self).__init__() self._key = "q" self._section = "Other" def description(self): return "Quit." def execute(self, args): ret...
{ "content_hash": "3e6993b9c8aae65f8c4516200171fdaf", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 39, "avg_line_length": 15.958333333333334, "alnum_prop": 0.5248041775456919, "repo_name": "robinson96/GRAPE", "id": "11621c6a9d75d97dddfd733067e774a70c622e99", "size": "383...
import os import cv2 import numpy def getImageFromData(): dataDir = os.path.join(os.path.dirname(__file__), '..', 'data') files = os.listdir(dataDir) for f in files: if f.endswith('.jpg') or f.endswith('.png'): return os.path.join(dataDir, f) return None def showImage(image, wa...
{ "content_hash": "e236208ad93a9f361309c583d1dbfcbb", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 91, "avg_line_length": 23.4375, "alnum_prop": 0.6038518518518519, "repo_name": "kyokushin/EBookChecker", "id": "177cebcaab8601d60bfa3e78bca8efcdf38d27bb", "size": "3508", ...
from oslo.config import cfg import taskflow.engines from taskflow.patterns import linear_flow from taskflow.utils import misc from cinder import exception from cinder import flow_utils from cinder.openstack.common import log as logging from cinder.openstack.common import timeutils from cinder import policy from cinder...
{ "content_hash": "c21fb8aec1269d5280e8efeae96981d6", "timestamp": "", "source": "github", "line_count": 706, "max_line_length": 79, "avg_line_length": 43.89660056657224, "alnum_prop": 0.5813945984318027, "repo_name": "Thingee/cinder", "id": "8ef6bb5067d571fba39f8647bd7cb1f8db394f6d", "size": "31565...
""" The client module is used to create a client connection to the publisher The data structure needs to be: {'enc': 'clear', 'load': {'fun': '<mod.callable>', 'arg':, ('arg1', 'arg2', ...), 'tgt': '<glob or id>', 'key': '<read in the key file>'} """ import logging ...
{ "content_hash": "a7280e02b478a1012028e0f7e39cfd51", "timestamp": "", "source": "github", "line_count": 2274, "max_line_length": 120, "avg_line_length": 35.191732629727355, "alnum_prop": 0.5077849698847875, "repo_name": "saltstack/salt", "id": "deb82bd74869db7c99b13d1b1416812bfc719f02", "size": "80...
from lino_book.projects.polly.settings import * from lino.utils import i2d class Site(Site): title = Site.verbose_name + " demo" the_demo_date = i2d(20141023) SITE = Site(globals()) DEBUG = True # the following line should always be commented out in a checked-in version # DATABASES['default']['NAME'] = ':me...
{ "content_hash": "69952ffb4e74465df98c6c7d6d63631d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 75, "avg_line_length": 25.153846153846153, "alnum_prop": 0.7064220183486238, "repo_name": "khchine5/book", "id": "5e9e54b0748894ba09de3963b4489854e75437af", "size": "327", ...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['BoxCox'] , ['Lag1Trend'] , ['NoCycle'] , ['SVR'] );
{ "content_hash": "700852ec7d42db162a33bbb2929e7ba6", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 74, "avg_line_length": 36.75, "alnum_prop": 0.6938775510204082, "repo_name": "antoinecarme/pyaf", "id": "1b54a6e20d5fb57e00034ede0f239783551d5711", "size": "147", "binary"...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Torrent', fields=[ ('id', models.AutoField(verbose_name='ID', serialize...
{ "content_hash": "0a1b44f14d8fa786ca39905d3b9cd468", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 114, "avg_line_length": 31.46153846153846, "alnum_prop": 0.5464547677261614, "repo_name": "xspager/openbaybrowser", "id": "67e6db4d673d07f8374ebed26dc9daef529fc5c9", "size"...
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union import warnings from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore import grpc # type: ignore...
{ "content_hash": "35ca50a5174e512488b06210c75c3308", "timestamp": "", "source": "github", "line_count": 431, "max_line_length": 88, "avg_line_length": 44.593967517401396, "alnum_prop": 0.6127471383975026, "repo_name": "googleapis/python-dataflow-client", "id": "094b22b62004edf222eb6bcef16174aced8c48a...
import os from simulux.utils import load_json from simulux.constants import DIST_DEFAULTS_PATH DEFAULT_LAYOUT = os.path.join(DIST_DEFAULTS_PATH, 'memory_layout.json') def load_layout(layout_file=None): ''' Load the layout from the config file (structured and hierarchical) ''' if not layout_file: ...
{ "content_hash": "6a22510c5d3ae9de8bf75aed5358bb84", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 114, "avg_line_length": 32.535714285714285, "alnum_prop": 0.5091108671789243, "repo_name": "zbal/simulux", "id": "f90aab8cc7862dc0add608a06b6ffbcca316fe6c", "size": "4555"...
''' SlapComp GUI - HUD Panel Widget ~~~~~~~~~~~~ ''' from PySide import QtCore, QtGui HUD_DEFAULT_SIZE = (0, 0, 300, 75) HUD_OPACITY = .5 HUD_CORNER_RADIUS = (3, 3) HUD_BG_COLOR = QtGui.QColor(80, 80, 80, 255) HUD_TEXT_COLOR = QtGui.QColor(240, 240, 240, 255) HUD_BORDER_COLOR = QtCore.Qt.black HUD_BORDER_SIZE = 2 H...
{ "content_hash": "62840b8d279a3394871cfdab7e0557fb", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 75, "avg_line_length": 27.890243902439025, "alnum_prop": 0.6519457804984696, "repo_name": "fcnmx/dccui", "id": "69b72a4cb20a34cc97565c79f31d69705f15744b", "size": "2287", ...
import logging import data_pipeline.audit.connection_factory as audit_conn_factory import data_pipeline.constants.const as const from .exceptions import InvalidArgumentsError from .extractor import Extractor from abc import ABCMeta, abstractmethod logger = logging.getLogger(__name__) def get_prev_run_cdcs(audit_co...
{ "content_hash": "e2fe698d0d9c24ca7b6ce034dff52fc3", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 75, "avg_line_length": 33.225806451612904, "alnum_prop": 0.5616504854368932, "repo_name": "iagcl/data_pipeline", "id": "cdb0ad167d14cde09a951c244bef33bc64159653", "size": ...
from __future__ import unicode_literals import re import urlparse AUTHOR = u'Bee' SITENAME = u'Bee - a NoSQL database running in a Lua application server' SITEURL = 'http://bee.org' PATH = 'content' THEME = "theme" TIMEZONE = 'Europe/Moscow' DEFAULT_LANG = u'en' PLUGINS = ['plugins.beautifulsite'] # Feed generatio...
{ "content_hash": "f1b4e716f6a6d26b435ec318fa36ce47", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 82, "avg_line_length": 21.089285714285715, "alnum_prop": 0.6486028789161727, "repo_name": "venkatarajasekhar/bee", "id": "a0910d15012eeec65ee3bb27e08dcc7a42f7d89c", "size":...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest im...
{ "content_hash": "f4dc45593523ac01d41abd447d5a355d", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 105, "avg_line_length": 21.714285714285715, "alnum_prop": 0.6820175438596491, "repo_name": "mbohlool/client-python", "id": "2728f1dc288701f66f877aee642e9422c9f25683", "size...
import os import sys import traceback from .text_opts import * try: basestring except NameError: basestring = str # basic error for API class ASTFError(Exception): def __init__(self, msg): self.msg = str(msg) self.stack = traceback.extract_stack() def __str__(self): self.tb ...
{ "content_hash": "7830d5f485c0102a2276f6bd3eccf66d", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 114, "avg_line_length": 33.43421052631579, "alnum_prop": 0.5505706414797323, "repo_name": "kisel/trex-core", "id": "b910e83f3fdf82efefdbbd32b3c445423ba00c87", "size": "2541...
from __future__ import absolute_import from geocoder.base import Base from geocoder.location import Location class Ipinfo(Base): """ API Reference ------------- https://ipinfo.io """ provider = 'ipinfo' method = 'geocode' def __init__(self, location='', **kwargs): self.locatio...
{ "content_hash": "a4cecafcbd2cc37acbdbbc19b84ee3a0", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 79, "avg_line_length": 22.8375, "alnum_prop": 0.5473453749315819, "repo_name": "akittas/geocoder", "id": "b6b0724e277e94565f27db1f83606bb066886e81", "size": "1861", "bina...
import sys if sys.version_info[0:2] < (2, 7) or \ sys.version_info[0:2] in ( (3, 0), (3, 1) ): try: import unittest2 as unittest except ImportError: import unittest else: import unittest from pysmi.parser.smi import parserFactory from pysmi.codegen.pysnmp import PySnmpCodeGen from pysmi.c...
{ "content_hash": "d6b1548216c8cdc57cd449efd99a95ee", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 103, "avg_line_length": 28.60989010989011, "alnum_prop": 0.6191665066256962, "repo_name": "bnavarma/netsnmp", "id": "d2f8b7e44437e0eb9809853351175c27e0255825", "size": "52...
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[ [TestAction.create_mini_vm, 'vm1', 'cluster=cluster1'], [TestAction.change_vm_ha, 'vm1'], [TestAction.create_min...
{ "content_hash": "122e26dab4dbce115e03d8e97b9b0536", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 104, "avg_line_length": 40.36065573770492, "alnum_prop": 0.6986190089358245, "repo_name": "zstackio/zstack-woodpecker", "id": "c9c6ddd0f2fab79891588432d3ad2fd2f8cc6c77", "s...
"""Snippet representation after parsing.""" import re import vim import textwrap from UltiSnips import _vim from UltiSnips.compatibility import as_unicode from UltiSnips.indent_util import IndentUtil from UltiSnips.text import escape from UltiSnips.text_objects import SnippetInstance from UltiSnips.text_objects._pyt...
{ "content_hash": "6891a16c11bfcde57b247ed60eaf4eb8", "timestamp": "", "source": "github", "line_count": 475, "max_line_length": 80, "avg_line_length": 31.894736842105264, "alnum_prop": 0.5371617161716171, "repo_name": "yslin/tools-zodlin", "id": "4106ac36fc999cf7af03e119227a00a523e3dfe8", "size": "...
import tables as tb class MyClass: foo = 'bar' # An object of my custom class. myObject = MyClass() with tb.open_file('test.h5', 'w') as h5f: h5f.root._v_attrs.obj = myObject # store the object print(h5f.root._v_attrs.obj.foo) # retrieve it # Delete class of stored object and reopen the file. del My...
{ "content_hash": "624b7a60f2a6bd3dcd6b03796c18f3d1", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 62, "avg_line_length": 27.40740740740741, "alnum_prop": 0.6810810810810811, "repo_name": "FrancescAlted/PyTables", "id": "710a705418b34d2354443b608df719c410c42829", "size":...
def shared_item_save_doc_template_values(url_root): """ Show documentation about sharedItemSave """ required_query_parameter_list = [ { 'name': 'voter_device_id', 'value': 'string', # boolean, integer, long, string 'description': 'An 88 charac...
{ "content_hash": "709f619572b4ac565ff982473d34dbc1", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 116, "avg_line_length": 46.49180327868852, "alnum_prop": 0.4883638928067701, "repo_name": "wevote/WeVoteServer", "id": "bb8bcfc329fadefc4d0090e3a9d51ef71cc948cf", "size": ...
try: import unittest2 as unittest except ImportError: import unittest import datetime import app_config app_config.DATABASE_NAME = 'carebot_test.db' from util.config import Config from util.analytics import GoogleAnalytics class TestAnalytics(unittest.TestCase): def test_median(self): values = [...
{ "content_hash": "d0fa2dcf1eef9e04bec0b82182bbc27c", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 47, "avg_line_length": 22.42105263157895, "alnum_prop": 0.715962441314554, "repo_name": "thecarebot/carebot", "id": "c8f51a578319e0b433526f9f1314535ea1b7e8ab", "size": "448...
import time from selenium import webdriver driver = webdriver.Chrome(executable_path='/home/ezequiel/webdriver/chromedriver') # Optional argument, if not specified will search path. driver.get('http://www.google.com/'); time.sleep(5) # Let the user actually see something! search_box = driver.find_element_by_name...
{ "content_hash": "895c1b1212c35dbc3a089136e96487ef", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 139, "avg_line_length": 22.65, "alnum_prop": 0.7527593818984547, "repo_name": "zecruel/sand_box", "id": "7414ff515c6b161cad4d2b5c5c38aa9857c18fc6", "size": "453", "binary...
"""Auto-generated file, do not edit by hand. KM metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_KM = PhoneMetadata(id='KM', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='1\\d', possible_number_pattern='\\d{2}'...
{ "content_hash": "cc48a5c18e549c54268a9116d6ff08ad", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 141, "avg_line_length": 66.25, "alnum_prop": 0.7333333333333333, "repo_name": "vicky2135/lucious", "id": "6404f678854d7c9c7fa0cc2221ef7321e7f42c9a", "size": "795", "binar...
class SessionHelper: def __init__(self, app): self.app = app def login(self, username, password): wd = self.app.wd self.app.open_home_page() wd.find_element_by_name("user").click() wd.find_element_by_name("user").clear() wd.find_element_by_name("user").send_keys...
{ "content_hash": "c1ded57ce6d5679329fe551b555b0e4d", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 84, "avg_line_length": 30.25531914893617, "alnum_prop": 0.5646976090014064, "repo_name": "iakibardin/python_training", "id": "4181cc9ab749a63375599d7b2c89c91bc9ac00d7", "si...
import sys from builtins import object from desktop.lib.exceptions_renderable import PopupException from desktop.lib.i18n import smart_unicode if sys.version_info[0] > 2: from django.utils.translation import gettext as _ else: from django.utils.translation import ugettext as _ def get_api(request, interface): ...
{ "content_hash": "f06b2ac9afaadb8433f7aaf02d9744ea", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 125, "avg_line_length": 27.37007874015748, "alnum_prop": 0.6962025316455697, "repo_name": "kawamon/hue", "id": "89d75b210c0905615e0c38c237fe4a0e68cc924c", "size": "4268", ...
"""Home Assistant representation of an UPnP/IGD.""" import asyncio from ipaddress import IPv4Address from typing import List, Mapping from async_upnp_client import UpnpFactory from async_upnp_client.aiohttp import AiohttpSessionRequester from async_upnp_client.profiles.igd import IgdDevice from homeassistant.helpers....
{ "content_hash": "faa3d76c2d400e0e105822eb9055294d", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 86, "avg_line_length": 31.17142857142857, "alnum_prop": 0.6223648029330889, "repo_name": "mKeRix/home-assistant", "id": "05113b8f9f6a223ec571b1b6972722a568e845a9", "size":...
"""Unittest for reflection.py, which also indirectly tests the output of the pure-Python protocol compiler. """ import copy import gc import operator import six import struct try: import unittest2 as unittest except ImportError: import unittest from google.protobuf import unittest_import_pb2 from google.protobuf ...
{ "content_hash": "7dea6e54682db157235c45ea29be489f", "timestamp": "", "source": "github", "line_count": 2943, "max_line_length": 101, "avg_line_length": 41.142711518858306, "alnum_prop": 0.7021794967088691, "repo_name": "heke123/chromium-crosswalk", "id": "752f2f5d90cb6a750c9cd27cb0153d7db9165252", ...
import numpy as np from sklearn.datasets import make_blobs from sklearn.ensemble import RandomForestClassifier from sklearn.calibration import CalibratedClassifierCV from sklearn.metrics import log_loss import pandas as pd from ga_css_5prime import MatchUtils import tempfile from sklearn import preprocessing np.random...
{ "content_hash": "ca6e0fe28b8ff7686bce8afc01073276", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 150, "avg_line_length": 32.05, "alnum_prop": 0.672386895475819, "repo_name": "tapomay/libgenetic", "id": "aa5f9132b70faad90db6d3fcdff1997c0ca8c843", "size": "5128", "bin...
from guizero import App, TextBox, Text, Slider, PushButton, Picture, Combo, CheckBox, ButtonGroup, Box app = App(title="different sizes", width = 700, height=700) text = Text(app, "lets change some sizes", width=20, height=2) text_box = TextBox(app, "some text", width=50) slider = Slider(app, width=300, height=30) ...
{ "content_hash": "f954b07cddc618871141f1b907ad0d88", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 102, "avg_line_length": 27.892857142857142, "alnum_prop": 0.6850192061459667, "repo_name": "lawsie/guizero", "id": "a035cfa719c78ee8dc72e5d1f8f07415b50b9848", "size": "781"...
import yaml import os import sys import textwrap from ..functional_test import TestCase class GeneratorTest(TestCase): def test_needy_variables(self): empty_directory = os.path.join(self.path(), 'empty') os.makedirs(empty_directory) default_suffix = 'default-suffix' with open(os.p...
{ "content_hash": "1e6716f63cf560767cfcb78ec03e4a40", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 100, "avg_line_length": 36.73684210526316, "alnum_prop": 0.5372492836676218, "repo_name": "ccbrown/needy", "id": "b6f5e52904de991003ea961fb589d62ab31155e6", "size": "1396",...
from __future__ import print_function import datetime import threading import xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer from xml.sax.saxutils import escape import idaapi import idautils import idc # Wait for any processing to get done idaapi.autoWait() # On Windows with NTFS filesystem a filepath ...
{ "content_hash": "02304ccb332c0a29b3f8577de7795ed4", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 105, "avg_line_length": 27.28187919463087, "alnum_prop": 0.6396063960639606, "repo_name": "0xddaa/pwndbg", "id": "fe7d3738e4bcb4b4bd0bd6fdd20dc6956dbdd008", "size": "4111"...
"""Utility functions for writing decorators (which modify docstrings).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys def get_qualified_name(function): # Python 3 if hasattr(function, '__qualname__'): return function.__qualname__ ...
{ "content_hash": "d7d5c14624902b7ab72bcc0f40570c04", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 75, "avg_line_length": 26.66111111111111, "alnum_prop": 0.6622212961033549, "repo_name": "frreiss/tensorflow-fred", "id": "f63f2e6055a1c1c119f83053769404e4b7ed76ad", "size...
""" parser.http package (imdb package). This package provides the IMDbHTTPAccessSystem class used to access IMDb's data through the web interface. the imdb.IMDb function will return an instance of this class when called with the 'accessSystem' argument set to "http" or "web" or "html" (this is the default). Copyright...
{ "content_hash": "98508cf5e0acfcfebd46aac6fb7e628b", "timestamp": "", "source": "github", "line_count": 843, "max_line_length": 350, "avg_line_length": 45.80189798339264, "alnum_prop": 0.6171298334671467, "repo_name": "boxed/CMi", "id": "16f8518df3daeb08a5e82202253226306d5201e0", "size": "38611", ...
from boto import handler import xml.sax class Rule(object): """ A Lifcycle rule for an S3 bucket. :ivar id: Unique identifier for the rule. The value cannot be longer than 255 characters. :ivar prefix: Prefix identifying one or more objects to which the rule applies. :iva...
{ "content_hash": "5836634d0fe3780853afdc7292f4c1fc", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 77, "avg_line_length": 31.710280373831775, "alnum_prop": 0.5773651635720601, "repo_name": "yyuu/botornado", "id": "7ca6b61d9eeefc3ea6949dc3a935c6963d050fd3", "size": "4493...
"""Red Hat Enterprise Linux Linux specific platform info.""" import platform from gcimagebundlelib import linux class RHEL(linux.LinuxPlatform): """Red Hat Enterprise Linux specific information.""" @staticmethod def IsThisPlatform(root='/'): (distribution, _, _) = platform.linux_distribution() if d...
{ "content_hash": "fbd4e0a066c497009564fe24501302d2", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 60, "avg_line_length": 23, "alnum_prop": 0.679549114331723, "repo_name": "tytso/compute-image-packages", "id": "9ebf1ef5afad0b47ff9d25087b3c803569e90872", "size": "1215", ...
import warnings from ..base import BaseEstimator, TransformerMixin from ..utils.validation import _allclose_dense_sparse def _identity(X): """The identity function.""" return X class FunctionTransformer(TransformerMixin, BaseEstimator): """Constructs a transformer from an arbitrary callable. A Fun...
{ "content_hash": "331c5dd27fb72bf3f040b70121ea7250", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 87, "avg_line_length": 32.36666666666667, "alnum_prop": 0.6048746996223824, "repo_name": "amueller/scikit-learn", "id": "345cc96bb1c2eef00b73a543a93f16f15c03835c", "size":...
from marshmallow import Schema, fields, post_load, EXCLUDE from ..resource import Resource from collections import namedtuple class Activity(Resource): """ https://dev.chartmogul.com/v1.0/reference#list-customer-subscriptions """ _path = "/activities" _root_key = 'entries' _many = namedtuple('...
{ "content_hash": "fb5e458aae025b76bd863df08008c852", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 85, "avg_line_length": 40.14705882352941, "alnum_prop": 0.6593406593406593, "repo_name": "chartmogul/chartmogul-python", "id": "1e599a24751b4c2a5e44acad96a679107b59b18c", "...
""" Generating and counting primes. """ import random from bisect import bisect from primetest import isprime from sympy.core.numbers import integer_nthroot # Using arrays for sieving instead of lists greatly reduces # memory consumption from array import array as _array def _arange(a, b): ar = _array('l', [0]*...
{ "content_hash": "ee27eae6a38fc992d8a2e1008c726c52", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 81, "avg_line_length": 28.632390745501286, "alnum_prop": 0.5216376369186568, "repo_name": "tarballs-are-good/sympy", "id": "d489a7c083b1ae2738ba8d5f57ed3483703596b8", "siz...
from django.core.management.base import BaseCommand, CommandError from django.db import transaction from assopy import models as amodels from conference import models as cmodels from p3 import models class Command(BaseCommand): """ """ @transaction.atomic def handle(self, *args, **options): fo...
{ "content_hash": "a4bc8be92dee199b5ddc1cd12c820cf2", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 84, "avg_line_length": 34.58536585365854, "alnum_prop": 0.5557122708039492, "repo_name": "EuroPython/epcon", "id": "7828b7fe4c60f3b84410f998d39f99e5e5d94e8f", "size": "1419...
""" @file shuffle_lines.py @brief shuffle lines in a file @author ChenglongChen """ import sys import csv import random import numpy as np from string import atoi def main(): # collect argvs seed = atoi(sys.argv[1]) file_in = sys.argv[2] file_out = sys.argv[3] # read with open(file_in) as in...
{ "content_hash": "33756e915e6cc1c130132eca2c02af96", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 37, "avg_line_length": 16.142857142857142, "alnum_prop": 0.5893805309734513, "repo_name": "ChenglongChen/caffe-windows", "id": "469fd11903e9dfa96cea103ec2b58539f1b49146", "...
"""Blueprint for the /packages endpoint. If a package is *not* in the ``PRIVATE_EGGS`` set, pryvate will redirect the client to another CheeseShop. However if a package *is* in ``PRIVATE_EGGS`` but the ``filename`` is not available, it will return a ``404`` response, otherwise it will return a ``200`` response with th...
{ "content_hash": "400862c3a65f16e0180ce11fbdacdac7", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 72, "avg_line_length": 43.875, "alnum_prop": 0.7236467236467237, "repo_name": "Dinoshauer/pryvate", "id": "ecee2806e4660f774c85f7c1645f7fa976141123", "size": "351", "binar...
""" A reader for the simple .pry config file format. The format is as follows: base = basedirectory coverage = coveragedirectory exclude = newline separated paths excluded from coverage The special _magic flag is needed to allow pry to run cov...
{ "content_hash": "dec8c1c49a8c8059086b71856006949c", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 79, "avg_line_length": 36.395833333333336, "alnum_prop": 0.5082999427590155, "repo_name": "cortesi/pry", "id": "495fcd13a12a2dbc5545f358fa8facc11117f764", "size": "1747", ...
import random from django import template register = template.Library() def _lower_and_upper(a, b): a = a or 0 if a and not b: b = 0 elif not (a or b): b = 1 return min(a, b), max(a, b) @register.simple_tag() def rand_float(a=None, b=None): lower, upper = _lower_and_upper(a, b...
{ "content_hash": "c715b72b85acb1beb79a35290e3fd80e", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 77, "avg_line_length": 19.264705882352942, "alnum_prop": 0.6244274809160305, "repo_name": "OmegaDroid/gtfo", "id": "c6f3c02cea2a7db4a125c33d8368d58873d05458", "size": "655"...
logger.info("Loading 2 objects to table teams_team...") # fields: id, ref, name loader.save(create_teams_team(1,u'E',['Eupen', '', ''])) loader.save(create_teams_team(2,u'S',['St. Vith', '', ''])) loader.flush_deferred_objects()
{ "content_hash": "e26d669bddadbaa0dfdc038534576388", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 59, "avg_line_length": 38.333333333333336, "alnum_prop": 0.6478260869565218, "repo_name": "lino-framework/book", "id": "e3d2d31af2866296e853ea6765cf5e65fe6a2a6c", "size": "2...
from django import forms import app.models from django.forms.util import ErrorList class AppForm(forms.Form): name = forms.CharField(max_length=100, help_text=u'Enter a name for the App') description = forms.CharField(max_length=200, help_text=u'Enter a description', widget=forms.Textarea) ...
{ "content_hash": "615088babe4a3452260939b9c7877e64", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 49, "avg_line_length": 30.866666666666667, "alnum_prop": 0.7084233261339092, "repo_name": "creativepsyco/panex-web", "id": "442084130c86e4f4bd096af5040e1e5dfa5a050e", "size...
""" Support for exposing a templated binary sensor. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.template/ """ import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.components.binary_sensor i...
{ "content_hash": "89a1736d9701f14a628be8ef1c436026", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 79, "avg_line_length": 36.26482213438735, "alnum_prop": 0.5937874659400545, "repo_name": "nugget/home-assistant", "id": "605ab24a26417091eec01ce5e09294025f71a0b8", "size":...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('home', '0006_auto_20161101_0622'), ] operations = [ migrations.AlterField( model_name='movie', ...
{ "content_hash": "ab2ecb2f57efae734ab56dc3de0046d6", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 203, "avg_line_length": 32.44117647058823, "alnum_prop": 0.5738893925657298, "repo_name": "huzaifafaruqui/Movies-Website", "id": "8facb5f9eab42b53da86e36cda38c4e62676433d", ...
import variadic, go ############### Non Variadic ############## nonvarResult = variadic.NonVariFunc(1, go.Slice_int([2,3,4]),5) print("NonVariadic 1+[2+3+4]+5 = %d" % nonvarResult) ############### Variadic Over Int ############## varResult = variadic.VariFunc(1,2,3,4,5) print("Variadic 1+2+3+4+5 = %d" % varResult) #...
{ "content_hash": "018ad05f59117dd3ce47ac9b6a83b40e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 125, "avg_line_length": 40, "alnum_prop": 0.6206521739130435, "repo_name": "go-python/gopy", "id": "b53f80f4b31eced624ac0b25bfcdbd5b138d5045", "size": "1084", "binary": f...
""" SoftLayer.tests.CLI.modules.vs.vs_create_tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :license: MIT, see LICENSE for more details. """ import sys import tempfile from unittest import mock as mock from SoftLayer.fixtures import SoftLayer_Product_Package as SoftLayer_Product_Package from SoftLayer import...
{ "content_hash": "0f8e1212b01bbbe586e2262720514919", "timestamp": "", "source": "github", "line_count": 736, "max_line_length": 110, "avg_line_length": 44.650815217391305, "alnum_prop": 0.4783495116088002, "repo_name": "allmightyspiff/softlayer-python", "id": "468bc5339299357e5ced8ac57c498f0cf04b6602...
import sys from neutronclient.common import exceptions from neutronclient.neutron.v2_0.vpn import ipsec_site_connection from neutronclient.tests.unit import test_cli20 class CLITestV20IPsecSiteConnectionJSON(test_cli20.CLITestV20Base): # TODO(pcm): Remove, once peer-cidr is deprecated completely def test_cr...
{ "content_hash": "30745a27b38b68992fc42315b6ad3667", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 78, "avg_line_length": 42.27936507936508, "alnum_prop": 0.5363417930620213, "repo_name": "rackerlabs/rackspace-python-neutronclient", "id": "8ead88f2a9f0cbc56ec433f77cb8b197...
from app import db from hashlib import md5 class User(db.Model): id = db.Column(db.Integer, primary_key=True) nickname = db.Column(db.String(64), index=True, unique=True) email = db.Column(db.String(120), index=True, unique=True) posts = db.relationship('Post', backref='author', lazy='dynamic') ab...
{ "content_hash": "7cec855b2127743a064a74c14a30bc5f", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 114, "avg_line_length": 28.54385964912281, "alnum_prop": 0.6004917025199754, "repo_name": "jtara1/SimpleFlaskWebsite", "id": "d66a01bda4b103d7e0fe76255a3a432efd2f2981", "si...
import numpy as np import matplotlib.pyplot as plt import sys import os import random import time import json import cPickle import math from scipy import io import matplotlib from matplotlib import pylab import matplotlib.pyplot as plt import matplotlib.patches as patches from collections import Counter, defaultdi...
{ "content_hash": "08ac198f2e59bb66f0a677ad01c48e9c", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 83, "avg_line_length": 34.79324894514768, "alnum_prop": 0.5685180693669658, "repo_name": "google/VRD", "id": "1e1b5e33c8214bdde65629d199a6b32a57989243", "size": "8822", ...
import unittest from os.path import join as joinpath import ffmpymedia from tests import TEST_FILE_PATH class TestMediaUse(unittest.TestCase): def test_compare_two_files(self): # User1 wants to compare two media files to see if their stream layouts are the same. # First he passes the same file...
{ "content_hash": "d5a1d601982c212bc54c1c1e3d187094", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 988, "avg_line_length": 85.67391304347827, "alnum_prop": 0.6691195128140066, "repo_name": "flaviocpontes/ffmpymedia", "id": "deb07be72390f2147631738e63f8d050ef7b7569", "siz...
import os from gppylib.test.unit.gp_unittest import GpTestCase, run_tests from gppylib.commands import gp from gppylib.db import dbconn class Context(object): filename = os.path.join(gp.get_masterdatadir(), 'gpexpand.status') dbname = os.getenv('PGDATABASE', 'postgres') dburl = dbconn.DbURL(dbname=dbname)...
{ "content_hash": "b89d465bb714f8062fea6f9eaec99f06", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 85, "avg_line_length": 30.909774436090224, "alnum_prop": 0.6059352955485283, "repo_name": "jmcatamney/gpdb", "id": "a63f304dd1e2ff0a23e6199de77b4ba3e90b37e1", "size": "837...
import unittest from webkitpy.common.net.networktransaction import NetworkTransaction, NetworkTimeout from webkitpy.common.system.logtesting import LoggingTestCase from webkitpy.thirdparty.autoinstalled.mechanize import HTTPError class NetworkTransactionTest(LoggingTestCase): exception = Exception("Test exceptio...
{ "content_hash": "e28014f83a27c64aea77f8420ab79232", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 92, "avg_line_length": 38.98461538461538, "alnum_prop": 0.6428571428571429, "repo_name": "Xperia-Nicki/android_platform_sony_nicki", "id": "c4cd4e0b8cfb93c6226e14adc6626bea7c...
"""Keras implementation of the Layer-wise Adaptive Rate Scaling (LARS) optimizer. Original paper: [Large batch training of convolutional networks] (https://arxiv.org/pdf/1708.03888.pdf). Code adapted from Algorithm 1 in [Large Batch Optimization for Deep Learning: Training BERT in 76 minutes](https://arxiv.org/abs/19...
{ "content_hash": "2ba09c5930a13ab822c72a7741b33994", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 86, "avg_line_length": 40.74301675977654, "alnum_prop": 0.6412998765939942, "repo_name": "google-research/public-data-in-dpfl", "id": "4b48cf2c7b699f637507c79d2a8a973eb9b779...
"""Training and Predicting Cifar10 with Mutant Networks. The networks mutate their architecture using genetic algorithms. Author: Lucas David -- <ld492@drexel.edu> Licence: MIT License 2016 (c) """ import logging import artificial as art import numpy as np import tensorflow as tf from artificial.utils.experiments i...
{ "content_hash": "6ecf597b4d28fa304d1c0362410727b3", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 78, "avg_line_length": 31.514018691588785, "alnum_prop": 0.5954922894424673, "repo_name": "Comp-UFSCar/neural-networks-2", "id": "ee59b627dabe65c3f9d1307a3cd82f758adbce99", ...
import ast import sys import os import json import math class Nb_classifier: def __init__(self, model): self.model = model def classify(self, file_path): contents = open(file_path, "r").read() delimiters = ['.', ',', '$', '(', ')', '!', '\n', '"', ':', ';', '!', '?', "'", '&', ...
{ "content_hash": "19177d55095cbe240de7380dffc64b36", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 217, "avg_line_length": 55.2289156626506, "alnum_prop": 0.6472513089005235, "repo_name": "vswamy/NLP", "id": "653bc8803a6d149a9d0c46220077988ca69dca6d", "size": "4584", "...
import datetime import mock from oslo_config import cfg from oslo_utils import timeutils import testtools from manila.common import constants from manila import context from manila import db from manila.db.sqlalchemy import api as sqa_api from manila.db.sqlalchemy import models as sqa_models from manila import except...
{ "content_hash": "4e49162e61c58d534c9cab43b2a669eb", "timestamp": "", "source": "github", "line_count": 1523, "max_line_length": 79, "avg_line_length": 42.78135259356533, "alnum_prop": 0.5176499478175456, "repo_name": "vponomaryov/manila", "id": "af28fcda0c0eee1b8b02033057072c182cb7bc96", "size": "...
"""Tests for the stats_store classes.""" from grr.lib import aff4 from grr.lib import data_store from grr.lib import flags from grr.lib import rdfvalue from grr.lib import stats from grr.lib import test_lib from grr.lib import timeseries from grr.lib.aff4_objects import stats_store class StatsStoreTest(test_lib....
{ "content_hash": "ae528de6fcf05faa8d61d1c0044d464a", "timestamp": "", "source": "github", "line_count": 1013, "max_line_length": 80, "avg_line_length": 39.454096742349456, "alnum_prop": 0.6563164610803913, "repo_name": "pombredanne/grr", "id": "79e940786bd31fc8a4475a030c50a847a8383d6a", "size": "39...
"""Implementing communication to MySQL servers """ import sys import socket import logging import os import weakref from collections import deque import constants import conversion import protocol import errors import utils import cursor logger = logging.getLogger('myconnpy') class MySQLBaseSocket(object): """B...
{ "content_hash": "17c83bfb08863cb19bfa18dd78e0c293", "timestamp": "", "source": "github", "line_count": 589, "max_line_length": 82, "avg_line_length": 31.39049235993209, "alnum_prop": 0.5621721023311158, "repo_name": "ekristen/mythboxee", "id": "a00dc409a4cac735880c57715397ff7711805f20", "size": "1...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Gloss.tjspeculate' db.delete_column('dictionary_gloss', 'tjspeculate') def backwards(self, orm): # A...
{ "content_hash": "a6eb79d75e7ad404715e416900372e2d", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 146, "avg_line_length": 74.14814814814815, "alnum_prop": 0.5462037962037962, "repo_name": "Signbank/BSL-signbank", "id": "a005b5d0a4ffc69f0d1792818b43a9345b02ab08", "size"...
import diventi.accounts.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('accounts', '0134_auto_20190512_1601'), ] operations = [ migrations.AlterModelManagers( name='diventiuser', managers=[ ('object...
{ "content_hash": "a5ed5b916611c8de57173a8cfdfb993c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 22.38888888888889, "alnum_prop": 0.5831265508684863, "repo_name": "flavoi/diventi", "id": "97f68ca4de9144ffb94ad74c3f266c9f5e9a0d03", "size": "452", ...
import logging import classad from ornithology import * logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) @action def submitJobInputFailureAP(default_condor): return default_condor.submit( { "log": "job_ap_input.log", "executable": "/bin/sleep", "argum...
{ "content_hash": "095b834578940281aeb92c7c33570876", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 125, "avg_line_length": 33.786407766990294, "alnum_prop": 0.6755747126436782, "repo_name": "htcondor/htcondor", "id": "8a4e4bbb09492ab146a31efc59767d931f9a6b3d", "size": "...
import os # contents of: remotecmd.py def simple(arg): return arg + 1 def listdir(path): return os.listdir(path) if __name__ == "__channelexec__": for item in channel: channel.send(eval(item))
{ "content_hash": "b207dde856e2dd7a182c621b023dd6ab", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 33, "avg_line_length": 15.571428571428571, "alnum_prop": 0.6238532110091743, "repo_name": "alfredodeza/execnet", "id": "5d3fd99594f7b9009a1c7d5f6b273877bab2d8ba", "size": "...
"""Zookeeper Serializers, Deserializers, and NamedTuple objects""" from collections import namedtuple import struct import six from kazoo.exceptions import EXCEPTIONS from kazoo.protocol.states import ZnodeStat from kazoo.security import ACL from kazoo.security import Id # Struct objects with formats compiled bool_...
{ "content_hash": "970c83abe5053aca7bf74f5f86796232", "timestamp": "", "source": "github", "line_count": 449, "max_line_length": 77, "avg_line_length": 28.870824053452115, "alnum_prop": 0.6043354161845252, "repo_name": "kawamon/hue", "id": "80fa4d1048205e07ecb034dbd1d5e62272d17c61", "size": "12963",...
"""empty message Revision ID: 35099fc974d2 Revises: ae00e7974dca Create Date: 2017-05-19 17:01:48.878196 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '35099fc974d2' down_revision = 'ae00e7974dca' branch_labels = None depends_on = None def upgrade(): op...
{ "content_hash": "ff4e91c6d6b68e49ababc26054412ea7", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 117, "avg_line_length": 29.642857142857142, "alnum_prop": 0.7192771084337349, "repo_name": "nailgun/seedbox", "id": "652f515638fabbdc29fa03743668cd7f3bcdf458", "size": "830...
from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Float, Set, Alias ) from openpyxl.descriptors.excel import ExtensionList from openpyxl.descriptors.nested import ( NestedNoneSet, NestedSet, NestedBool, NestedFloat, ) from .data_source...
{ "content_hash": "c13b98c7dd34da7d629c5a90074a6593", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 99, "avg_line_length": 29.933333333333334, "alnum_prop": 0.6158129175946548, "repo_name": "kawamon/hue", "id": "942509f197fa5baceb84d0c49c08024ad58ced4d", "size": "1832", ...
"""Support for Enigma2 media players.""" from openwebif.api import CreateDevice import voluptuous as vol from homeassistant.components.media_player import MediaPlayerEntity from homeassistant.components.media_player.const import ( MEDIA_TYPE_TVSHOW, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PREVIOUS_T...
{ "content_hash": "9201f7fae9fc447ce2461e1fb3b7dc22", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 85, "avg_line_length": 30.911439114391143, "alnum_prop": 0.6373403366360272, "repo_name": "FreekingDean/home-assistant", "id": "1c32b1ab805272c3b7c8593a9b1c385e93812605", ...
"""Ops to manipulate lists of tensors.""" # pylint: disable=g-bad-name from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_...
{ "content_hash": "9694636191d98783e08dc3c3d55fb5d2", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 81, "avg_line_length": 33.21406727828746, "alnum_prop": 0.6888868428321517, "repo_name": "jendap/tensorflow", "id": "87409eb2ac6f962caacc566c4a6a9fd7e0e3c184", "size": "11...
""" Compile a very strict subset of Python (in which the only types are floats) to WASM. """ from time import time as perf_counter # cause perf_counter not available in pypy3 import ast import wasmfun as wf class Context: def __init__(self): self.instructions = [] self.names = {} s...
{ "content_hash": "657092a61ee5c11d65212b3d46b283b2", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 115, "avg_line_length": 39.51764705882353, "alnum_prop": 0.5693162647613377, "repo_name": "almarklein/wasmfun", "id": "1aeb1ef1d51b6773c45e0ed7651e5256010cef1d", "size": "...
from wtforms.fields import BooleanField, FileField, SelectField, TextAreaField from wtforms.fields.html5 import EmailField from wtforms.validators import DataRequired, Email, InputRequired, Optional, ValidationError from indico.util.i18n import _ from indico.util.placeholders import get_missing_placeholders, render_pl...
{ "content_hash": "eeb8aeaa7d9f4bf8ae0be0b8c1799f14", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 119, "avg_line_length": 57.80434782608695, "alnum_prop": 0.6615268898081986, "repo_name": "pferreir/indico", "id": "36e0560e797c608a4142a603885b759d94beba3f", "size": "2873...
import os import time import hashlib import warnings from tempfile import mkdtemp from shutil import rmtree from twisted.trial import unittest from twisted.internet import defer from scrapy.contrib.pipeline.files import FilesPipeline, FSFilesStore from scrapy.item import Item, Field from scrapy.http import Request, R...
{ "content_hash": "f4fb1e4dbbf6b5ca07f0df8b0a419594", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 123, "avg_line_length": 40.845360824742265, "alnum_prop": 0.6296062594649167, "repo_name": "ramiro/scrapy", "id": "0a1737c44945dd2fb3da03e2c03c09264c84b25f", "size": "7924...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('contacts', '0001_initial'), ] operations = [ migrations.AddField( model_name='field', name='is_active', field=mo...
{ "content_hash": "a6a797c1460fb19bfec0c67da84b1ae9", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 94, "avg_line_length": 26.916666666666668, "alnum_prop": 0.5820433436532507, "repo_name": "xkmato/casepro", "id": "5f62eba3b02940928bb80420c990bd34e5580f97", "size": "670",...
import pytest from _plotly_utils.basevalidators import BaseDataValidator from plotly.graph_objs import Scatter, Bar, Box # Fixtures # -------- @pytest.fixture() def validator(): return BaseDataValidator( class_strs_map={"scatter": "Scatter", "bar": "Bar", "box": "Box"}, plotly_name="prop", ...
{ "content_hash": "626377262e9c7aca1031f98fb6d4083a", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 84, "avg_line_length": 28.04964539007092, "alnum_prop": 0.643236409608091, "repo_name": "plotly/python-api", "id": "f8d50b28da46409a89735dae4d65dbc89dfb5ac5", "size": "395...
#!/usr/bin/env python2 # # Copyright (c) 2009, Roboterclub Aachen e.V. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright #...
{ "content_hash": "cb13640bdc0039ef8ffe80691b1ff69c", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 152, "avg_line_length": 37.842794759825324, "alnum_prop": 0.6848603738749135, "repo_name": "dergraaf/xpcc", "id": "5f70c530495159f9ad3dd0dba898b23e6d5fdd03", "size": "8666...
'''OpenGL extension EXT.shader_image_load_store This module customises the behaviour of the OpenGL.raw.GL.EXT.shader_image_load_store to provide a more Python-friendly API Overview (from the spec) This extension provides GLSL built-in functions allowing shaders to load from, store to, and perform atomic read-mo...
{ "content_hash": "94ed145a0ef7ef99cbdd3ae80296e0ab", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 75, "avg_line_length": 56.274193548387096, "alnum_prop": 0.8091143594153053, "repo_name": "frederica07/Dragon_Programming_Process", "id": "eee3b184433a5321ee653a17431e5fdad60...
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns( 'record.views', # Examples: # url(r'^$', 'dzhops.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^list/$', 'record', name='record_list'), ur...
{ "content_hash": "7ef71a5f61be3b84e07dff011cca05bb", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 60, "avg_line_length": 31.416666666666668, "alnum_prop": 0.6392572944297082, "repo_name": "Hasal/dzhops", "id": "c01dff86a35a8d632dd6189faa7c80a0e1816fcd", "size": "401", ...
def sequentialSearch(alist, item): pos = 0 found = False while pos < len(alist) and not found: if alist[pos] == item: found = True else: pos = pos+1 return found testlist = [1, 2, 32, 8, 17, 19, 42, 13, 0] print(sequentialSearch(testlist, 3)) print(sequenti...
{ "content_hash": "71caadfcde852332192851cd201fce71", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 43, "avg_line_length": 22.866666666666667, "alnum_prop": 0.5743440233236151, "repo_name": "robin1885/algorithms-exercises-using-python", "id": "7d0f9541364c6b6dc7ec61901b12eb...
from analytics.flask_api_server import app if __name__ == "__main__": app.run()
{ "content_hash": "2933e631ca1f2a5c9634df8855a3f7c2", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 42, "avg_line_length": 21.25, "alnum_prop": 0.611764705882353, "repo_name": "codeforfrankfurt/PolBotCheck", "id": "fa7369d0c5fb695c80805a575bb8e697277444e9", "size": "85", ...
"""Implementation of python-orcid library.""" from bs4 import BeautifulSoup import requests import simplejson as json import sys from lxml import etree if sys.version_info[0] == 2: from urllib import urlencode string_types = basestring, else: from urllib.parse import urlencode string_types = str, SEA...
{ "content_hash": "0ecd092ebb99a43fd99998c08f26d1cd", "timestamp": "", "source": "github", "line_count": 759, "max_line_length": 81, "avg_line_length": 38.37022397891963, "alnum_prop": 0.541084366308416, "repo_name": "ORCID/python-orcid", "id": "9bd79ff82c1cf5c49e8eb3b097f781f1a25a4428", "size": "29...
import csv import numpy as np from sklearn.svm import SVR import matplotlib.pyplot as plt # plt.switch_backend('newbackend') dates = [] prices = [] def get_data(filename): with open(filename, 'r') as csvfile: csvFileReader = csv.reader(csvfile) next(csvFileReader) # skipping column names for row in csvFileRea...
{ "content_hash": "30c07553a20475a92c6ac8bdff33a16c", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 128, "avg_line_length": 35.224489795918366, "alnum_prop": 0.7056778679026651, "repo_name": "stephen2run/EcoDataLearn", "id": "6326ac398bfcbb8547c7a9c893febafd28cb392d", "si...
import gnupg, tarfile import shutil import os import tarfile def sanitise_keys(keys): sanitised_all = {} for key in keys: sanitised_key = {} sanitised_key['date'] = key['date'] sanitised_key['expires'] = key['expires'] sanitised_key['fingerprint'] = key['fingerprint'] sa...
{ "content_hash": "1065c2f92c6f9f5d09ea45cc5c76cbbd", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 207, "avg_line_length": 38.76068376068376, "alnum_prop": 0.6606394707828004, "repo_name": "picrin/VAIDA_OLD", "id": "f5cfb5886702782170b2bdd21110f41d3e8120ee", "size": "45...
from six import PY3 import sys if PY3: from xmlrpc.server import SimpleXMLRPCServer else: from SimpleXMLRPCServer import SimpleXMLRPCServer from remoteserver import announce_port class Documentation(SimpleXMLRPCServer): def __init__(self, port=8270, port_file=None): SimpleXMLRPCServer.__init__(...
{ "content_hash": "01b61f5a107edad9100415744920de69", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 67, "avg_line_length": 28.324324324324323, "alnum_prop": 0.6498091603053435, "repo_name": "userzimmermann/robotframework-python3", "id": "2a615436dcd939a64af6c584db109bf87f49...