text
stringlengths
4
1.02M
meta
dict
from django.contrib import admin from .models import FAQ, GenericCopy, Menu, MenuLink @admin.register(GenericCopy) class GenericCopyAdmin(admin.ModelAdmin): list_display = ("key", "content", "conference") @admin.register(FAQ) class FAQAdmin(admin.ModelAdmin): list_display = ("conference",) @admin.registe...
{ "content_hash": "d518f79241bba4b82eeda8b7ca609ccf", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 56, "avg_line_length": 23.541666666666668, "alnum_prop": 0.7168141592920354, "repo_name": "patrick91/pycon", "id": "7cb32ee2cd72ed67e07f05e4bdc3de92ba93f08c", "size": "565"...
from distutils.core import setup setup(# package information name="transientSources", version="0.0.1dev", description='', long_description=''' ''', # What code to include as packages packages=['transientSources'], packagedir={'transientSources':'transientSources'}, # Wha...
{ "content_hash": "a734cc3e346486800a3de8953e83b046", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 76, "avg_line_length": 41.15, "alnum_prop": 0.479951397326853, "repo_name": "rbiswas4/calibrate_spectra", "id": "ced519b869232eeb9a7f2a171aefc654787d60ce", "size": "878", ...
import abc import six from neutron.api import extensions from neutron.api.v2 import base from neutron import manager BRIDGE = 'bridge' BRIDGES = '%ss' % BRIDGE RESOURCE_ATTRIBUTE_MAP = { BRIDGES: { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, ...
{ "content_hash": "2f62e0255b12cabce331d0ecadddc036", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 71, "avg_line_length": 29.42452830188679, "alnum_prop": 0.5732606604680988, "repo_name": "JoeMido/networking-midonet", "id": "978d27022705e79cc873e783a77a86eb6dc8096e", "s...
from rest_framework import serializers from .models import Meeting, Topic, Presentor class PresentorSerializer(serializers.ModelSerializer): email = serializers.SerializerMethodField() def get_email(self, obj): request = self.context.get('request') if request and request.user.is_staff: ...
{ "content_hash": "863045afc74d2bf2bca1432b4ab02159", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 65, "avg_line_length": 23.4375, "alnum_prop": 0.5635555555555556, "repo_name": "tanyaschlusser/chipy.org", "id": "d011833c14eb9886e0eda7894db7dc59940814e8", "size": "1125",...
import asposecellscloud from asposecellscloud.CellsApi import CellsApi from asposecellscloud.CellsApi import ApiException import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi apiKey = "XXXXX" #sepcify App Key appSid = "XXXXX" #sepcify App SID apiServer = "http://api.aspose.com/v1.1" data_fol...
{ "content_hash": "ced912554db7f23f5828078899a903b4", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 97, "avg_line_length": 33.95348837209303, "alnum_prop": 0.7143835616438357, "repo_name": "asposecells/Aspose_Cells_Cloud", "id": "90826792c7486bedfa757943754925bda4bc3d69", ...
from collections import OrderedDict import pytest import pandasdmx from pandasdmx import Request from .data import BASE_PATH as test_data_path test_data_path = test_data_path / "INSEE" DATAFLOW_FP = test_data_path / "dataflow.xml" DATASETS = { "IPI-2010-A21": { "data-fp": test_data_path / "IPI-2010-A2...
{ "content_hash": "9406353712d9d3451f3444f36a6fe591", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 88, "avg_line_length": 32.045801526717554, "alnum_prop": 0.5936160076226774, "repo_name": "dr-leo/pandaSDMX", "id": "e5e7611e98ab2929c6e3afb653d85ecb72983e86", "size": "42...
desc="""calling a function""" setup=""" """ cleanup=""" """ notes=""" To call a function which is part of a package, or a function which is part of another schema, use dotted notation like this: <ul> <li>package_name.function_name <li>schema_name.function_name <li>schema_name.package_name.function_name </ul> <p> Par...
{ "content_hash": "8d6bb276ecaededc53c454df6a58acbf", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 71, "avg_line_length": 24.73469387755102, "alnum_prop": 0.6806930693069307, "repo_name": "marhar/sqlminus", "id": "4eed58158eb0a3115d1d4c428fed271d29dd0a3d", "size": "1453"...
from msrest.serialization import Model class JobAction(Model): """JobAction. :param type: Gets or sets the job action type. Possible values include: 'Http', 'Https', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic' :type type: str or :class:`JobActionType <azure.mgmt.scheduler.models.JobAct...
{ "content_hash": "8c415ea5727d3f8eb66f8a599a16f0a4", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 170, "avg_line_length": 49.14, "alnum_prop": 0.689051689051689, "repo_name": "lmazuel/azure-sdk-for-python", "id": "6dcf9f3aaef2026aabb1aab7ee148a85447177ed", "size": "2931...
"""Test the Foscam config flow.""" from unittest.mock import patch from libpyfoscam.foscam import ( ERROR_FOSCAM_AUTH, ERROR_FOSCAM_CMD, ERROR_FOSCAM_UNAVAILABLE, ERROR_FOSCAM_UNKNOWN, ) from homeassistant import config_entries, data_entry_flow from homeassistant.components.foscam import config_flow ...
{ "content_hash": "7451e272644a3e5c99d098f95ded5ff3", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 88, "avg_line_length": 32.17004048582996, "alnum_prop": 0.6390636798389127, "repo_name": "w1ll1am23/home-assistant", "id": "e8bdb6900f220772b38b5100a7282fab5a333b77", "siz...
base_url = 'http://www.pythonchallenge.com/pc/def/{}.html' print base_url.format(str(2**38))
{ "content_hash": "893be11676e7cb82f7dc1e5060c40bce", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 58, "avg_line_length": 31, "alnum_prop": 0.6989247311827957, "repo_name": "joeeoj/python-challenge-practice", "id": "def88c86c98a706f2a4e9a311949fd1abd05e3c5", "size": "195"...
"""Provides device automations for ZHA devices that emit events.""" import voluptuous as vol import homeassistant.components.automation.event as event from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA from homeassistant.components.device_automation.exceptions import ( InvalidDeviceAutomati...
{ "content_hash": "b2da484a2be8fb4c65ea201216b3a1b2", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 85, "avg_line_length": 31.34065934065934, "alnum_prop": 0.6711079943899019, "repo_name": "pschmitt/home-assistant", "id": "5f842d7f3804af3ad310e13ce593932333c4807c", "size"...
from contextlib import contextmanager import os @contextmanager def test_file(path): try: open_file = open(path, 'w') yield open_file finally: open_file.close() if os.path.exists(path): os.unlink(path)
{ "content_hash": "4c7aae86ea026fe0e9fd4f818ce12e16", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 37, "avg_line_length": 21.25, "alnum_prop": 0.6039215686274509, "repo_name": "ActiveState/code", "id": "2a3384de931a4a8655013657313a52f9c61c5faf", "size": "255", "binary"...
from testtools import TestCase from twisted.internet.defer import succeed from fusion_util import tap class TapTests(TestCase): """ Tests for `fusion_util.tap.tap`. """ def test_tap(self): """ L{fusion_util.tap.tap} calls a function with a result and optional positional and ...
{ "content_hash": "b9c9333dd8fa44bb323235802f778db2", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 26.93548387096774, "alnum_prop": 0.6035928143712574, "repo_name": "fusionapp/fusion-util", "id": "198daf788dd9016ef6f6351277f1111d49f00632", "size": ...
pip install wikipedia import wikipedia wikipedia.search('Dynamic Connectivity') results = wikipedia.search('Dynamic Connectivity') results wikipedia.search('Leo Editor') leo_results = wikipedia.search('Leo Editor') leo_results page_name = results[0] page = wikipedia.page(page_name) page page.title page.html() ...
{ "content_hash": "c16e46b837a6b3fc748b1b397e0ad0f3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 50, "avg_line_length": 13.538461538461538, "alnum_prop": 0.7698863636363636, "repo_name": "satishgoda/learning", "id": "9e3b5f796ffe810444822cea2468c820513dfc99", "size": "...
import json import datetime from twisted.python import log from twisted.internet import defer from autobahn import util from autobahn.wamp import auth from autobahn.wamp import types from autobahn.twisted.wamp import ApplicationSession, RouterSession from autobahn.twisted.websocket import WampWebSocketServerProtocol...
{ "content_hash": "c83d6d6375f8c8c38377b79799fea8a0", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 141, "avg_line_length": 28.70472440944882, "alnum_prop": 0.6311891372925524, "repo_name": "luhn/AutobahnPython", "id": "4a4d5a5bff5a0da809f47d437e80d11bd5b85fde", "size": ...
import sqlite3 import collections from itertools import tee, ifilterfalse from gemini_subjects import Subject def map_samples_to_indices(c): """Return a dict mapping samples names (key) to sample indices in the numpy genotype arrays (value). """ sample_to_idx = {} c.execute("select sample_id, n...
{ "content_hash": "b1bb94e35c5cbb8e31d467274432e6c6", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 87, "avg_line_length": 32.513953488372096, "alnum_prop": 0.5508189686002432, "repo_name": "poojavade/Genomics_Docker", "id": "549a46143e293b42ce700a2fbb9072539e91694e", "s...
import unittest import pywraps2 as s2 class PyWrapS2TestCase(unittest.TestCase): def testContainsIsWrappedCorrectly(self): london = s2.S2LatLngRect(s2.S2LatLng.FromDegrees(51.3368602, 0.4931979), s2.S2LatLng.FromDegrees(51.7323965, 0.1495211)) e14lj = s2.S2LatLngRect(s2.S2LatLn...
{ "content_hash": "b2c549c958dc95ecfde931c8edba347b", "timestamp": "", "source": "github", "line_count": 449, "max_line_length": 80, "avg_line_length": 40.16035634743875, "alnum_prop": 0.6955967169476486, "repo_name": "graetzer/arangodb", "id": "1c6f68846c62b9e7f64a6ae1acb38cfa1e62ab0a", "size": "18...
from tick.base import actual_kwargs from tick.base.learner import LearnerGLM from .model_linreg import ModelLinReg class LinearRegression(LearnerGLM): """ Linear regression learner, with many choices of penalization and solvers. Parameters ---------- C : `float`, default=1e3 Level of p...
{ "content_hash": "df3bb6092115b2a6d764d8df29683227", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 84, "avg_line_length": 36.108108108108105, "alnum_prop": 0.6087200598802395, "repo_name": "Dekken/tick", "id": "68b009472e0092a3002aec4271cb92533fed5a11", "size": "5369", ...
from .base import SourceTestCase class TestCase(SourceTestCase): generator = 'delimited' output_name = 'chinook_tracks_csv.json' def generate(self): path = self.input_path('chinook_tracks.csv') client = self.module.Client(uri=path) return client.generate()
{ "content_hash": "1d93bbaa4ca7d93aa5427299f06abedf", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 52, "avg_line_length": 26.90909090909091, "alnum_prop": 0.6756756756756757, "repo_name": "chop-dbhi/prov-extractor", "id": "2ad0146390d390d7939dd0c0016c6561716a17ee", "size...
from smv import * from smv.dqm import * from smv.iomod import SmvCsvInputFile from smv.conn import SmvHdfsEmptyConn from pyspark.sql.functions import col, lit class D1(SmvCsvStringData): def schemaStr(self): return "k:String;v:Integer" def dataStr(self): return "a,1;b,2" class T(SmvCsvInputFil...
{ "content_hash": "770bd0108d54ea062b43f583d8b4d5bd", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 114, "avg_line_length": 30.964285714285715, "alnum_prop": 0.6643598615916955, "repo_name": "TresAmigosSD/SMV", "id": "83ed74ea64bfe166026a3922504f619284e05d94", "size": "14...
import os, sys, tempfile, unittest import lxml.etree as etree ECMDS_INSTALL_DIR = os.path.normpath(os.path.join( os.path.dirname(os.path.realpath(sys.argv[0])), "..", ".." )) ECMDS_TEST_DATA_DIR = os.path.join( ECMDS_INSTALL_DIR, "test", "ut", "data", "plugin_picture" )...
{ "content_hash": "2475bf5c39259b93e7ea1d72f81cbffe", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 93, "avg_line_length": 31.561290322580646, "alnum_prop": 0.5222812755519215, "repo_name": "tobijk/ecromedos", "id": "da0ad1b570f78317c20bf3d165320d49885a3e4d", "size": "49...
from __future__ import absolute_import import os if os.environ.get('USE_TWISTED', False): from twisted.internet.defer import inlineCallbacks, Deferred, returnValue from twisted.internet.defer import succeed, DeferredList from twisted.python import log from twisted.trial import unittest from six i...
{ "content_hash": "9c3d3ef094b6ff35184983139cceaa8f", "timestamp": "", "source": "github", "line_count": 759, "max_line_length": 189, "avg_line_length": 39.361001317523055, "alnum_prop": 0.570276150627615, "repo_name": "tomwire/AutobahnPython", "id": "9cd081afc675426687d153b1663dca12ff825c96", "size...
"""Module containing class `CalendarMonth`.""" import functools @functools.total_ordering class CalendarMonth: """ A calendar month, with a year and a month. A `CalendarMonth` object has integer `year` and `month` attributes. `CalendarMonth` objects are immutable, hashable, and totall...
{ "content_hash": "e2be9de774cb4e769c309d178d537e7f", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 78, "avg_line_length": 24.88235294117647, "alnum_prop": 0.5254981425194191, "repo_name": "HaroldMills/Vesper", "id": "66b253f6784cf72ea001d99ac47b54cb06512b1d", "size": "2...
import os from pathlib import Path import re import tempfile import pytest from versionner.cli import execute from versionner.config import Config from test.streamcatcher import catch_streams def bootstrap_env(): dir = tempfile.TemporaryDirectory() os.chdir(dir.name) execute('ver', ['init']) retu...
{ "content_hash": "51bbfc1bb0f76daee239ee5dab8160f9", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 110, "avg_line_length": 23.436363636363637, "alnum_prop": 0.6167571761055082, "repo_name": "mysz/versionner", "id": "561d7ac24532dcd832785d1184f0003d5e9ca73f", "size": "131...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} DOCUMENTATION = """ --- module: eos_command version_added: "2.1" author: "Peter Sprygada (@privateip)" short_description: Run arbitrary commands on an Arista EOS device description:...
{ "content_hash": "5dd704edf9969f77f2450047fb3b6125", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 82, "avg_line_length": 29.81779661016949, "alnum_prop": 0.6389086258348728, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "52dc321dbee5d1010483aecc186248ffa4de...
import requests import json class BadCommandStatus(Exception): def __init__(self, content): self.content = content def __str__(self): return "Bad executed command status in response content:\n %s" % str(self.content) class BadStatusCode(Exception): def __init__(self, response): ...
{ "content_hash": "7cfc7b8be7d960a21a317aa69a0a13fb", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 90, "avg_line_length": 31.278688524590162, "alnum_prop": 0.5964360587002097, "repo_name": "2gis/vmmaster-client", "id": "c3c483047b66beb279f82a8307a22a1b6aed8c2f", "size": ...
import pytest from anchore_engine.subsys.object_store import S3ObjectStorageDriver class TestS3ObjectStorageDriver: @pytest.mark.parametrize( "param", [ pytest.param( { "uri": "s3://bucket/key", "expected": ("bucket", "key"), ...
{ "content_hash": "915b8b30265bf910c4027e5db3f64b01", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 82, "avg_line_length": 27.434782608695652, "alnum_prop": 0.4461172741679873, "repo_name": "anchore/anchore-engine", "id": "6be1a5bbd7b975bb7b34c4b40f2501f6b0e45035", "size"...
"""Jumping Tasks.""" from gym_jumping_task.envs.jumping_colors_task import COLORS from gym_jumping_task.envs.jumping_colors_task import JumpTaskEnvWithColors from gym_jumping_task.envs.jumping_coordinates_task import JumpTaskEnvWithCoordinates from gym_jumping_task.envs.jumping_task import JumpTaskEnv
{ "content_hash": "21a2b581ce5636f4509cf95225b6aa9e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 85, "avg_line_length": 50.666666666666664, "alnum_prop": 0.8388157894736842, "repo_name": "google-research/jumping-task", "id": "556eed4e45a65eeac15b29174f0627fda77e5244", "...
import logging import os import subprocess as subprocess import shutil import sys import tempfile from telemetry.core import util from telemetry.core.chrome import browser_backend from telemetry.core.chrome import cros_util class DesktopBrowserBackend(browser_backend.BrowserBackend): """The backend for controlling ...
{ "content_hash": "bc289ef8b1a840e73ea14130c6320dcd", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 80, "avg_line_length": 30.459627329192546, "alnum_prop": 0.6500815660685155, "repo_name": "timopulkkinen/BubbleFish", "id": "4e94d9364ee74c7801de70faefed7ec3cc880dd7", "si...
import ast from typing import ( Any, Dict, List, ) class ArgumentVisitor(ast.NodeVisitor): """Reports which arguments a function contains.""" def __init__(self, *args, **kwargs): # type: (List[Any], Dict[str, Any]) -> None # https://github.com/python/mypy/issues/5887 supe...
{ "content_hash": "f90168fda4ed30b83647085c00df5519", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 78, "avg_line_length": 30.571428571428573, "alnum_prop": 0.5740987983978638, "repo_name": "terrencepreilly/darglint", "id": "6ea7536a99cd631987cb96eb586dcdb9dd6e546d", "siz...
import unittest from .storage_test_tables import StorageTestTables from .storage_test_methods import StorageTestMethods try: from builtins import range except ImportError: pass import tempfile import os from sqlalchemy import create_engine, MetaData import time from flask_prose import Storage class StorageTes...
{ "content_hash": "3c881f99c1adcc2e493bda316370737f", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 83, "avg_line_length": 25.2972972972973, "alnum_prop": 0.7158119658119658, "repo_name": "slippers/Flask-Prose", "id": "6044f4849acf88f652f86b38b51bdbef4105eb59", "size": "9...
from tempest.api.identity import base from tempest.common.utils import data_utils from tempest.lib import exceptions as lib_exc from tempest import test class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest): def _get_role_params(self): user = self.setup_test_user() tenant = self.tenants_clien...
{ "content_hash": "033d0969c4f4af9db6144098a6418f37", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 77, "avg_line_length": 48.684647302904565, "alnum_prop": 0.5934543594988494, "repo_name": "sebrandon1/tempest", "id": "7116913e44f5de0e1c096682afa58aa203385d54", "size": "...
import sys from setuptools import setup from setuptools.extension import Extension if sys.platform.startswith("darwin"): # Do something different for mac pass setup( name="travis_testing", version="0.0.1", url='http://github.com/CTPUG/pygame_cffi', license='MIT', description="A package ...
{ "content_hash": "050a6136fc5ec76fe1eb871c8374c00e", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 71, "avg_line_length": 25.743589743589745, "alnum_prop": 0.601593625498008, "repo_name": "drnlm/travis-testing", "id": "9ba33c03945f306d993ae2528bc5673803cd58d8", "size": "...
from django.http import HttpResponseRedirect from django.conf import settings from django.utils.deprecation import MiddlewareMixin from re import compile EXEMPT_URLS = [compile(settings.LOGIN_URL.lstrip('/'))] if hasattr(settings, 'LOGIN_EXEMPT_URLS'): EXEMPT_URLS += [compile(expr) for expr in settings.LOGIN_EXEMP...
{ "content_hash": "95604818e48f709190e012d3b0073b25", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 78, "avg_line_length": 44.15625, "alnum_prop": 0.7416843595187544, "repo_name": "forestdussault/olc_webportalv2", "id": "57c551840a57262921e1d1e4c977a91b6a96905a", "size": ...
""" The :mod:`sklearn.model_selection._split` module includes classes and functions to split the data based on a preset strategy. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # Ragha...
{ "content_hash": "8727b9cbcefaf0b4b367dd90ad36c962", "timestamp": "", "source": "github", "line_count": 2136, "max_line_length": 79, "avg_line_length": 36.16058052434457, "alnum_prop": 0.5933919393052732, "repo_name": "chrsrds/scikit-learn", "id": "730ba12f88ad4e2308aa6fc50d24fddaf811322a", "size":...
import club_lib as ccl CLUB_WELCOME_MSG = ( ''' Welcome to the Cotton Club Info Terminal. Enter commands or -h. ''') CLUB_CLOSE_MSG = 'Bye!' print (CLUB_WELCOME_MSG) # Create club object (Open Club) cotton_club = ccl.Club('Cotton Club') # Add random visitors cotton_club.add_visitors_randoom(10) # N...
{ "content_hash": "365626cd3f3596297ce8328082defe3e", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 69, "avg_line_length": 23.29824561403509, "alnum_prop": 0.6024096385542169, "repo_name": "radisvaliullin/test_task_0", "id": "ff80356852a68335cac6d7bc9233ca60862940d7", "si...
from marshmallow import post_load from marshmallow_sqlalchemy import field_for from models import ma, User, Device, Measurement class UserSchema(ma.Schema): id = field_for(User, 'id', dump_only=True) class Meta: # Fields to expose fields = ('id', 'name', 'username') model = User @...
{ "content_hash": "8e8d1173496872d1278e8d4ba3be2370", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 53, "avg_line_length": 23.58974358974359, "alnum_prop": 0.6206521739130435, "repo_name": "KMSkelton/cgm_flask", "id": "0d3ab4fa9eb8f307c28999aaf0b29e8a745bff5c", "size": "9...
""" pdbtm.py Basic parsing for the PDBTM:Protein Data Bank of Transmembrane Proteins. This is currently only used to extract a list of PDB identifiers. Created by Shane O'Connor 2014 """ # We use xml.etree.ElementTree at present which runs slowly compared to xml.sax but the code is quicker to read/write. import io f...
{ "content_hash": "a6d279c851041ded87e1a4b207edda0c", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 154, "avg_line_length": 38.854838709677416, "alnum_prop": 0.6044001660440017, "repo_name": "Kortemme-Lab/klab", "id": "fdf92e39ac3c1a4269d6ee1789b50a786fba2c39", "size": "...
class ICAPResponseHeader (object): __slots__ = ['info', 'version', 'code', 'status', 'headers', 'header_string', 'offsets', 'content_length', 'body_complete'] def __init__ (self, version, code, status, headers, header_string, offsets, content_length, body_complete): self.info = version, code, status self.version...
{ "content_hash": "785c803a8b883c065a55b62ea28fd01b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 124, "avg_line_length": 39.90909090909091, "alnum_prop": 0.7300683371298405, "repo_name": "PrFalken/exaproxy", "id": "2fab7151d9265f4268a39b884681b4f519af3cf9", "size": "87...
"""Definition of various recurrent neural network cells.""" from __future__ import print_function import warnings import functools from .. import symbol, init, ndarray from ..base import string_types, numeric_types def _cells_state_shape(cells): return sum([c.state_shape for c in cells], []) def _cells_state_i...
{ "content_hash": "de5c7feaaddd4ad1acc09da3f965758c", "timestamp": "", "source": "github", "line_count": 1452, "max_line_length": 108, "avg_line_length": 42.03099173553719, "alnum_prop": 0.5532779498271314, "repo_name": "mlperf/training_results_v0.6", "id": "92cb910e21c51b4e3950eec731554b13bb848e60", ...
""" A list of valid values for the 'platform_id' identifier code in FT_CharMapRec and FT_SfntName structures. TT_PLATFORM_APPLE_UNICODE Used by Apple to indicate a Unicode character map and/or name entry. See TT_APPLE_ID_XXX for corresponding 'encoding_id' values. Note that name entries in this format are code...
{ "content_hash": "8c05effb6845ec7c28ba298f641347ec", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 79, "avg_line_length": 30.4, "alnum_prop": 0.7266746411483254, "repo_name": "glumpy/glumpy", "id": "7b3c3974a71b65d6eab14e828b5c8820cb895134", "size": "2012", "binary": f...
""" WSGI config for nexus_django project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO...
{ "content_hash": "31164aff889758c4695333c28d4b3e90", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.125, "alnum_prop": 0.7711442786069652, "repo_name": "utarsuno/urbtek", "id": "cebf5e38d042a7114f0f3d86d6b153150f1bc5ce", "size": "402", "binary"...
"""Wraps toco interface with python lazy loader.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # We need to import pywrap_tensorflow prior to the toco wrapper. # pylint: disable=invalud-import-order,g-bad-import-order from tensorflow.python import pywra...
{ "content_hash": "ed7aaad32aae8ee7e14e81055b12b346", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 80, "avg_line_length": 34.724137931034484, "alnum_prop": 0.7269116186693148, "repo_name": "renyi533/tensorflow", "id": "213f31c6fe4f8339ed3f2ed3b69a379df2db1e66", "size": "...
import os import sys try: import unittest2 as unittest except ImportError: import unittest from paste.deploy import loadapp from urlmap.test.util import make_app HERE = os.path.dirname(os.path.abspath(__file__)) sys.path.append(HERE) class Test(unittest.TestCase): """Throw error when path specified as 'd...
{ "content_hash": "9bbf2ea73027856f994eb6db20357913", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 70, "avg_line_length": 24.238095238095237, "alnum_prop": 0.7151277013752456, "repo_name": "zefciu/urlmap", "id": "ec0e37147d400035deb05d29dcdd94c8b2fd80a9", "size": "509", ...
if __name__ == "__main__": import sys sys.path.append('..') import logging from Top import Top log = logging.getLogger(__name__) class Topology(Top): """ Basically, it is just a named dictionary of dictionaries, adapted to store connectivity matrix For NBO topologies, atomic indexing starts...
{ "content_hash": "17d5a4293202b40afc5fa4b4a8cabd64", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 61, "avg_line_length": 19.533333333333335, "alnum_prop": 0.565415244596132, "repo_name": "mtthwflst/terse", "id": "87bce52cf120ac84841ceed90bdeed4aa776675d", "size": "879",...
import scrapy class TutorialItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() pass ## Adding container to hold scraped data using scrapy.Item as the parent class class DmozItem(scrapy.Item): title = scrapy.Field() link = scrapy.Field() desc = scrapy.Field...
{ "content_hash": "b11fe4071af4ccdf7c566aa0fffcbf8e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 78, "avg_line_length": 24.846153846153847, "alnum_prop": 0.6934984520123839, "repo_name": "sgangi03/big-data-python-class", "id": "71809610bbac2c9ef424e40cc609d4c4401825c8", ...
import collections import mock import testscenarios from ceilometer.central import manager from ceilometer.objectstore import swift from ceilometer.tests import base from keystoneclient import exceptions from swiftclient import client as swift_client load_tests = testscenarios.load_tests_apply_scenarios ACCOUNTS =...
{ "content_hash": "14e93dc3de980390d359fe6b2c63323a", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 72, "avg_line_length": 38.648, "alnum_prop": 0.5723452701304078, "repo_name": "citrix-openstack-build/ceilometer", "id": "e89e260dcdb2700c3997dfd68a06dcc510f06111", "size"...
from __future__ import print_function from cloudmesh_base.logger import LOGGER from cloudmesh.cm_mongo import cm_MongoBase from cloudmesh_base.ConfigDict import ConfigDict import os from pprint import pprint # ---------------------------------------------------------------------- # SETTING UP A LOGGER # --------------...
{ "content_hash": "eacae71d87eac25ff4edbfe531327564", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 80, "avg_line_length": 26.747663551401867, "alnum_prop": 0.48951781970649894, "repo_name": "rajpushkar83/cloudmesh", "id": "4fbfa81699dc7496f72c2f158788a4c7a4250781", "siz...
""" Store only meta data but no real data (except from store state of nodes) """ import logging import os import yaml from pySPACE.resources.dataset_defs.base import BaseDataset from pySPACE.tools.filesystem import get_author class DummyDataset(BaseDataset): """ Class to store only meta data of collection Th...
{ "content_hash": "88965e125465d06afe6f42f1265a8c99", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 89, "avg_line_length": 33.97674418604651, "alnum_prop": 0.6036960985626283, "repo_name": "pyspace/pyspace", "id": "5536b5da89bf626f577224d9eb50f218b135b4e6", "size": "1461"...
from .analysis import * from .connectivity import * version = "0.1.4"
{ "content_hash": "29904b7e7e08795644085d4482b892b9", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 27, "avg_line_length": 17.75, "alnum_prop": 0.704225352112676, "repo_name": "NeuroDataDesign/seelviz", "id": "e8eb22036705d68f8661db614b335d3e32427311", "size": "71", "bin...
from telemetry.page import page_test from measurements import smoothness_controller class Smoothness(page_test.PageTest): def __init__(self): super(Smoothness, self).__init__() self._smoothness_controller = None @classmethod def CustomizeBrowserOptions(cls, options): options.AppendExtraBrowserArgs...
{ "content_hash": "e92a08e212d44ba199dfef914f395fcb", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 78, "avg_line_length": 33, "alnum_prop": 0.7509469696969697, "repo_name": "ltilve/chromium", "id": "04551340286a52c996b2df886b76ae22252b73b1", "size": "1219", "binary": f...
"""Helper functions which don't fit anywhere else""" import ast import inspect import os import re import hashlib import warnings from collections import deque from contextlib import contextmanager from importlib import import_module from pkgutil import iter_modules from textwrap import dedent from w3lib.html import r...
{ "content_hash": "a0b08706f11113d5d252e05ffa8235ad", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 99, "avg_line_length": 32.84584980237154, "alnum_prop": 0.6450060168471721, "repo_name": "dangra/scrapy", "id": "081cd33f1aa8280b3e56301136f79ce70d65cb79", "size": "8310",...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.dirname(os.path.dirname(__file...
{ "content_hash": "17aa144d26989076a517304b13b967bd", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 79, "avg_line_length": 26.4, "alnum_prop": 0.6864801864801865, "repo_name": "lobnek/pyaddepar", "id": "a847b8808406e0f46900a06f251503edf63a7157", "size": "1739", "binary"...
"""Support for IHC switches.""" from homeassistant.components.switch import SwitchDevice from . import IHC_CONTROLLER, IHC_DATA, IHC_INFO from .const import CONF_OFF_ID, CONF_ON_ID from .ihcdevice import IHCDevice from .util import async_pulse, async_set_bool def setup_platform(hass, config, add_entities, discovery_...
{ "content_hash": "27dcde1717ebb23ca2d192e44712bf57", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 79, "avg_line_length": 36.220588235294116, "alnum_prop": 0.5935850588712952, "repo_name": "auduny/home-assistant", "id": "6d3a72a3b661cdb5f25626c6f3fcaa0b7e59847c", "size":...
import copy from abc import ABC, abstractmethod from collections import defaultdict from typing import Any, Callable, Dict, Hashable, Union import torch from pyro.ops.welford import WelfordCovariance class StreamingStats(ABC): """ Abstract base class for streamable statistics of trees of tensors. Deriv...
{ "content_hash": "1ffcdfcae65acb81b7f12c11218af68c", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 84, "avg_line_length": 32.18248175182482, "alnum_prop": 0.58777500567022, "repo_name": "uber/pyro", "id": "1886b265a11686e87161d30e5e0ff29850dd0bcf", "size": "8903", "bi...
from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import # pyeq2 is a collection of equations expressed as Python classes # # Copyright (C) 2013 James R. Phillips # 2548 Vera Cruz Drive # Birmingham, AL 35235 USA # # email: zunzun@zunzun.com # ...
{ "content_hash": "3eab8891d562a13a2947987e077242ac", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 148, "avg_line_length": 42.68341708542714, "alnum_prop": 0.6317400518012715, "repo_name": "jamesrp/pyeq2", "id": "9dabd21f8a9e1fff59190c4650c293a675efdb52", "size": "8494"...
from orator.orm import Model class User(Model): __fillable__ = ["name"]
{ "content_hash": "0a3ab25e0fc2b298b3215641027b710f", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 28, "avg_line_length": 13.166666666666666, "alnum_prop": 0.6329113924050633, "repo_name": "sdispater/orator", "id": "75b600d5c9a38404e42cc6d25418dac0dd1c9bc0", "size": "104"...
from pyvisdk.thirdparty import Enum HostNumericSensorHealthState = Enum( 'green', 'red', 'unknown', 'yellow', )
{ "content_hash": "54b21316d5fb4de190c0f143de4365ad", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 36, "avg_line_length": 14.444444444444445, "alnum_prop": 0.6461538461538462, "repo_name": "xuru/pyvisdk", "id": "14d1b67f80f1275082d1e3c57d62c18c0d0bb8df", "size": "255", ...
import logging import pytest from src.piece import Color from src.game import Game from src.position import Position, Square from src.util import to_algebraic, to_numeric from tst.util import InvalidMoveException from tst.util import DidNotFindAllLegalMovesException from tst.standard_starting_position_data import pos...
{ "content_hash": "110b0631c4ab8908d0a99f22ee1e85b7", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 109, "avg_line_length": 38.142857142857146, "alnum_prop": 0.6991260923845194, "repo_name": "mcqueenjordan/chess-engine", "id": "51dd96f6fbc2be67d1f60ad390f4000e6f3596c3", "...
"""Component for the Somfy MyLink device supporting the Synergy API.""" import asyncio import logging from somfy_mylink_synergy import SomfyMyLinkSynergy import voluptuous as vol from homeassistant.components.cover import ENTITY_ID_FORMAT from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeas...
{ "content_hash": "3e931a4e0853f50dc37edbf27bc44905", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 88, "avg_line_length": 30.331632653061224, "alnum_prop": 0.6509671993271657, "repo_name": "adrienbrault/home-assistant", "id": "40240306dc473f6ba3731c5f41aaad8182f5ade2", ...
import io from setuptools import find_packages, setup with io.open('README.rst', 'rt', encoding='utf8') as f: readme = f.read() setup( name='websitemixer', version='1.0.0', url='https://websitemixer.com', license='MIT', maintainer='Brad Derstine', maintainer_email='brad@bizzartech.com', ...
{ "content_hash": "c14c742f812ec6138f3e3e80fc3b7096", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 69, "avg_line_length": 22.448275862068964, "alnum_prop": 0.5990783410138248, "repo_name": "bderstine/WebsiteMixer-App-Base", "id": "52a50ce3fb3bc7df6be32ac29fc3bec7a161630d",...
from neutron_lib import context from neutron_lib import exceptions from neutron.db import db_base_plugin_v2 as base_plugin from neutron.db.quota import api as quota_api from neutron.db.quota import driver from neutron.objects import quota as quota_obj from neutron.quota import resource from neutron.tests import base f...
{ "content_hash": "4c84f8817998512c43fded2aca38cee0", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 79, "avg_line_length": 44.90807799442897, "alnum_prop": 0.6193400322540628, "repo_name": "openstack/neutron", "id": "8334ae9ffc2a517e6191920c61fa192823937441", "size": "16...
from minimop.hardware.ftRadar import FTRadar radar = FTRadar() while True: radar.update()
{ "content_hash": "ce99fb4af01d8853b29cf6ab0f3b87c9", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 44, "avg_line_length": 13.857142857142858, "alnum_prop": 0.7319587628865979, "repo_name": "eXpire163/minimop", "id": "f6d9693526cb09333fbd2a588470ae998c2cc4f5", "size": "97"...
import os import re from urlparse import urlparse def get_env(src): ret = {} for l in src.splitlines(): mat = re.match('export\s+([^=]+)="?([^"]+)"?', l) if mat: groups = mat.groups() ret[groups[0]] = groups[1] return ret def test_celery_not_running(host): with...
{ "content_hash": "a4c054d3b13e0056d5d73d2e63e17a4c", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 57, "avg_line_length": 23.136363636363637, "alnum_prop": 0.5756385068762279, "repo_name": "FireCARES/firecares-ansible", "id": "1628f9293afddaee33ab46b06b906139d3f9368a", "...
import os, sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CourseBuilder.settings") from django.core.management import execute_from_command_line import CourseBuilder.startup as startup startup.run() execute_from_command_line(sys.argv)
{ "content_hash": "a4df8690831d916f4b544f7868e0fd45", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 77, "avg_line_length": 36, "alnum_prop": 0.71875, "repo_name": "Darkmer/masterchief", "id": "fa806a6b9251488d1986a1430dee32441cf2d646", "size": "310", "binary": false, "...
import os import ycm_core # These are the compilation flags that will be used in case there's no # compilation database set (by default, one is not set). # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. flags = [ '-Wall', '-Wextra', '-Werror', # '-Wc++98-compat', '-Wno-long-long', '-Wno-v...
{ "content_hash": "261d9138246aad2c107ded617dcf162b", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 80, "avg_line_length": 27.64788732394366, "alnum_prop": 0.6688741721854304, "repo_name": "chxuan/czrpc", "id": "858802b020876d13e7aeb2f030a97cbd4695852f", "size": "7289", ...
"""Support for LiteJet lights.""" import logging from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_TRANSITION, SUPPORT_BRIGHTNESS, SUPPORT_TRANSITION, LightEntity, ) from .const import CONF_DEFAULT_TRANSITION, DOMAIN _LOGGER = logging.getLogger(__name__) ATTR_NUMBER = "number" ...
{ "content_hash": "ca07a4a85685dffb374f004f182e6fec", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 87, "avg_line_length": 32.008, "alnum_prop": 0.6323419145213697, "repo_name": "aronsky/home-assistant", "id": "172e46c441ac5bcbadd3225168b5452a9d203e29", "size": "4001", ...
import pytest import numpy as np pytest.importorskip("xgboost") import xgboost as xgb import vaex.ml.xgboost import vaex.ml.datasets # the parameters of the model params_multiclass = { 'learning_rate': 0.1, # learning rate 'max_depth': 3, # max depth of the tree 'colsample_bytree': 0.8, # s...
{ "content_hash": "36c4581798fb25301f5479d9d3067210", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 126, "avg_line_length": 43.56737588652482, "alnum_prop": 0.6273807585870096, "repo_name": "maartenbreddels/vaex", "id": "c490278068d3b15c8a075fd5ed3929953727ea1f", "size":...
import logging import tornado.auth import tornado.escape import tornado.ioloop import tornado.options import tornado.web import os.path import uuid from tornado.options import define, options define("port", default=8888, help="run on the given port", type=int) class Application(tornado.web.Application): def __i...
{ "content_hash": "72ffa0b9cec10b5766d042cd8eba0b27", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 79, "avg_line_length": 30.769784172661872, "alnum_prop": 0.6053308393733926, "repo_name": "cloudkick/cast-site", "id": "b9ad716b21116889f97b023402a3ff049f2339fd", "size": ...
import setuptools # isort:skip # noqa import distutils # isort:skip # noqa
{ "content_hash": "d183f760f25013315393cdfb5b2b0992", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 38, "avg_line_length": 38.5, "alnum_prop": 0.7402597402597403, "repo_name": "omry/omegaconf", "id": "aa0c875c59f1a4fe5aaa5cff742b0e290627105e", "size": "152", "binary": fa...
""" Draws an simple RGB image - Left-drag pans the plot. - Mousewheel up and down zooms the plot in and out. - Pressing "z" brings up the Zoom Box, and you can click-drag a rectangular region to zoom. If you use a sequence of zoom boxes, pressing alt-left-arrow and alt-right-arrow moves you forwards and backw...
{ "content_hash": "7fb62bb23d37fac5ee3830c845f84ed8", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 80, "avg_line_length": 34.235955056179776, "alnum_prop": 0.5428290121430915, "repo_name": "tommy-u/chaco", "id": "c6bd340c3590c3d8f6b30ffc011e7b3cd20e5451", "size": "3069",...
class Session: def __init__(self): self.current_dialogue_topic = None self.active_topics = [] self.reset_flag = False def set_current_dialogue_topic(self, current_dialogue): self.current_dialogue_topic = current_dialogue def get_current_dialogue_topic(self): retur...
{ "content_hash": "861e37d229615c627ca5718320b47166", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 59, "avg_line_length": 25.863636363636363, "alnum_prop": 0.6467486818980668, "repo_name": "amos-ws17/amos-ws17-proj1", "id": "8e8a92d65e628167a5c067a3d93b3d3042ee0503", "si...
from __future__ import absolute_import from .base import Filter import re EXTENSION_EXC_VALUES = re.compile('|'.join((re.escape(x) for x in ( # Random plugins/extensions 'top.GLOBALS', # See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error. html 'originalCreateNotification', 'can...
{ "content_hash": "92c0dee949294ceea8a36e71c9375029", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 107, "avg_line_length": 32.80232558139535, "alnum_prop": 0.6334633108826657, "repo_name": "zenefits/sentry", "id": "80e63ad55dba5d3ae8bdb080132089f72a670516", "size": "2821...
from os import environ from distutils.core import setup, Extension # define the name of the extension to use extension_name = 'thrift_nicejson' extension_version = '1.0' # define the directories to search for include files # to get this to work, you may need to include the path # to your boost installation. Mine...
{ "content_hash": "b7f6db4f44ae4e61089e4ab43d08a77a", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 96, "avg_line_length": 39.09756097560975, "alnum_prop": 0.66126013724267, "repo_name": "chetmurthy/thrift-nicejson", "id": "a5b3c05aa605a4c74957ba467f8ed3f884d9a4d5", "size...
from django.conf import settings from django.conf.urls import include, url from django.core import urlresolvers from django.utils.html import format_html, format_html_join from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import Permission from wagtail.wagtailcore import hooks fro...
{ "content_hash": "cc52510ccb3ab623db4f9d8b96dd4ec1", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 120, "avg_line_length": 30.702380952380953, "alnum_prop": 0.694067468010857, "repo_name": "serzans/wagtail", "id": "61e6fd393c13ff2b7b64ee21ca4559a1e0428d3b", "size": "2579...
''' Created on Nov 27, 2014 @author: Sarraju ''' import smtpd, threading, asyncore, socket, os from datetime import datetime last_eml = "" class SMTPSimulationServer(smtpd.SMTPServer): def process_message(self, peer, mailfrom, rcpttos, data): self.thread = threading.Thread(self.storeEmail(...
{ "content_hash": "806c365f639baecdba975178daad8634", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 85, "avg_line_length": 26.043956043956044, "alnum_prop": 0.47848101265822784, "repo_name": "SVSagi/simple_smtp_simulator_py", "id": "854e5cbf5de62ac51532aae63e6dbaf1e466bcdf"...
import MalmoPython import os import sys import time import random sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) # flush print output immediately items = {'red_flower':'flower', 'apple':'apple', 'iron_sword':'sword', 'iron_pickaxe':'pickaxe', 'diamond_sword':'sword' ...
{ "content_hash": "c03ec5f788381b5ac3368baa98b91ca9", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 123, "avg_line_length": 31.16793893129771, "alnum_prop": 0.6274797942689199, "repo_name": "tnarik/malmo", "id": "07301f811dc0ecd7c423f3ab3d8ba49f0fb62564", "size": "5421",...
import os import tempfile import unittest import mock import numpy import pytest import six import chainer from chainer import backend from chainer.backends import cuda from chainer.backends import intel64 from chainer import link from chainer import links from chainer import optimizers from chainer.serializers impor...
{ "content_hash": "ba36a733d4e7b120548d0e3f4b751b46", "timestamp": "", "source": "github", "line_count": 684, "max_line_length": 79, "avg_line_length": 32.53216374269006, "alnum_prop": 0.5904188387560668, "repo_name": "niboshi/chainer", "id": "71bf791afdcbbf848f5eab6448aa1d69030c4aea", "size": "2225...
import os, sys from glob import glob from re import sub import argparse def escape(s): s = s.decode() lookup = { "\0": "\\0", "\t": "\\t", "\n": '\\n"\n"', "\r": "\\r", "\\": "\\\\", '"': '\\"', } return '""\n"{}"'.format("".join([lookup[x] if x in looku...
{ "content_hash": "4cb73e2106df15e3d22ef11b27247d3d", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 94, "avg_line_length": 31.34328358208955, "alnum_prop": 0.6230952380952381, "repo_name": "bvernoux/micropython", "id": "f1169a34d4bdd76b43ff56021131b3209c76fe08", "size": ...
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8' # The master toctree document. master...
{ "content_hash": "33967b8dc4befc199ac3d29448cfc027", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 79, "avg_line_length": 31.296969696969697, "alnum_prop": 0.7124322230828815, "repo_name": "a25kk/hcn", "id": "e1442ed3cb26d644a6a79f04a681aab375702b4a", "size": "5999", ...
import sys import unittest import Tkinter as tkinter import ttk from test.test_support import requires, run_unittest, swap_attr from test_ttk.support import AbstractTkTest, destroy_default_root requires('gui') class LabeledScaleTest(AbstractTkTest, unittest.TestCase): def tearDown(self): self...
{ "content_hash": "6d887d4b306467de554abaed66c923e0", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 79, "avg_line_length": 36.72852233676976, "alnum_prop": 0.5811190119760479, "repo_name": "Jeff-Tian/mybnb", "id": "9273febbac8df97a7c582d88ae0a705783fe463a", "size": "1068...
from .core.log import RedisPub class RedisPubMixin(object): def get_conf(self, name): try: from flask import Flask if isinstance(self, Flask): return self.config[name] except ImportError: pass try: from celery import Celery ...
{ "content_hash": "490c3865d8362ae7f229727e290a92d0", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 58, "avg_line_length": 23.82758620689655, "alnum_prop": 0.5311143270622286, "repo_name": "Answeror/torabot", "id": "d1d51c399ec7170f38d24e7627e9f1eb7da83322", "size": "691"...
from functools import partial from typing import Any, Dict, Optional from inspect import signature import re from django.http import HttpRequest, HttpResponse from zerver.decorator import api_key_only_webhook_view from zerver.lib.request import REQ, has_request_variables from zerver.lib.response import json_success f...
{ "content_hash": "f808517d671da2b45673e88ea887490d", "timestamp": "", "source": "github", "line_count": 399, "max_line_length": 103, "avg_line_length": 39.899749373433586, "alnum_prop": 0.6197236180904523, "repo_name": "tommyip/zulip", "id": "8dd99cdd94fc92b9fc669203de5bc34689fdfc8d", "size": "1592...
import collections import sys import unicodedata counter = collections.Counter() for line in sys.stdin: for c in line.strip(): counter[c] += 1 for c, count in counter.most_common(): print("{} {} {} {}".format(c,count,unicodedata.name(c, "WHOKNOWS"), unicodedata.category(c)))
{ "content_hash": "162a70d4b01c80a8c0be26450affa181", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 97, "avg_line_length": 23.076923076923077, "alnum_prop": 0.66, "repo_name": "psmit/kaldi-recipes", "id": "5bc0c4c9fdbc07cc794bd855f0059ffa1e0649be", "size": "324", "binar...
from django.db import models from django.db.models.deletion import ProtectedError from ..config import HARD_DELETE_NOCASCADE from ..models import SafeDeleteModel from .testcase import SafeDeleteTestCase class NoCascadeModel(SafeDeleteModel): _safedelete_policy = HARD_DELETE_NOCASCADE class CascadeChild(models....
{ "content_hash": "0869636db9ad6329cfbc4c910bad0ddc", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 55, "avg_line_length": 22.357894736842105, "alnum_prop": 0.641713747645951, "repo_name": "makinacorpus/django-safedelete", "id": "f1d70531c50ff8683bb905525c837cc83035b604", ...
import re import sqlparse from sqlparse.tokens import Name from collections import defaultdict from .sql_literals.main import get_literals white_space_regex = re.compile("\\s+", re.MULTILINE) def _compile_regex(keyword): # Surround the keyword with word boundaries and replace interior whitespace # with whit...
{ "content_hash": "de4d48e4b7a8d18aa2e2fbc0fb48cfa1", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 79, "avg_line_length": 29.78846153846154, "alnum_prop": 0.6507424144609425, "repo_name": "dbcli/sqlcomplete", "id": "d9231d67a83637a816a468152879d89e12a171ff", "size": "154...
from setuptools import setup, find_packages from setuptools.command.install import install as _install def read(filename): try: with open(filename) as f: return f.read() except NameError: with open(filename, 'r') as f: return f.read() long_description = u'\n\n'.join([r...
{ "content_hash": "8be6621563c8e3276904f4861e919da8", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 93, "avg_line_length": 32.391304347826086, "alnum_prop": 0.5194630872483221, "repo_name": "tychota/saruman", "id": "3badbbf77dc3c65c0e418569e911549f76cdcddb", "size": "2258...
"""Python wrappers for reader Datasets.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.data.ops import dataset_ops from tensorflow.python.data.util import convert from tensorflow.python.framework import dtypes from tensorflow.pytho...
{ "content_hash": "2e7466fd0511962df7bcf4d176ae28ac", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 80, "avg_line_length": 36.463667820069205, "alnum_prop": 0.6696716644524577, "repo_name": "dancingdan/tensorflow", "id": "d08da6704caf8b6c3bc94b49d0fce6ecb8157a75", "size"...
from .memory_usage import Plugin
{ "content_hash": "a6e46778c05931e7bb4c337687c5fc86", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 32, "avg_line_length": 33, "alnum_prop": 0.8181818181818182, "repo_name": "camerongray1515/Honours-Project", "id": "b9bc7fb566ded2abb9ebbefe6f1cd6968a7a59f0", "size": "33", ...
import importlib import inspect import functools from .symtab import * ATTRIB_COMPONENT = '_pype_component' def component(func): """ Marks a functions as compatible for exposing as a component in PyPE. Parameters ---------- func: function Function to be marked as compatible for exposing as...
{ "content_hash": "a6e9891936d8dea93b826864f34e9ffd", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 84, "avg_line_length": 28.757575757575758, "alnum_prop": 0.6628029504741834, "repo_name": "cs207-project/TimeSeries", "id": "d3e063e2b74aea9a7cd5a7a3d20b4e74c0c41177", "siz...
#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-2-Clause import os import argparse import itertools # Makefile-fuzz-generated.am is created from this template. MAKEFILE_FUZZ = """# SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2018 Intel Corporation # All rights reserved. if ENABLE_TCTI_FUZZING TESTS_FU...
{ "content_hash": "79a03d18e92ee1ba95b7bfca5a91492a", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 86, "avg_line_length": 30.645522388059703, "alnum_prop": 0.6134177523438451, "repo_name": "tpm2-software/tpm2-tss", "id": "87807d30e87113d9e4adb8dc61d2ff6d2942a850", "size...
from kinds import lowercase_first_word class Token(object): """ Represents the specification for a Token in the TokenSyntax file. """ def __init__(self, name, kind, text=None, is_keyword=False): self.name = name self.kind = kind self.text = text or "" self.is_keyword =...
{ "content_hash": "6dc1168e3a42e3083c2bed0e86d832de", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 76, "avg_line_length": 35.479166666666664, "alnum_prop": 0.5866118614210217, "repo_name": "frootloops/swift", "id": "83411eca234e632efe7491dac12f200040a456f0", "size": "51...
import sys import argparse ap = argparse.ArgumentParser() ap.add_argument("bedfile", help="File with allowable regions.") ap.add_argument("countsFile", help="Original counts file.") ap.add_argument("countsOut", help="Filtered counts file.") args = ap.parse_args() bedFile = open(args.bedfile) queries = { "/".join(lin...
{ "content_hash": "13d87041d156ba048dd6ac814b7701e8", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 69, "avg_line_length": 28.789473684210527, "alnum_prop": 0.7020109689213894, "repo_name": "yunlongliukm/chm1_scripts", "id": "b51ddb51242e436d4f487214adf19f3031d6e72b", "si...
"""Validate device conditions.""" from __future__ import annotations from typing import TYPE_CHECKING, Protocol, cast import voluptuous as vol from homeassistant.const import CONF_DOMAIN from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv from homeassistant.helpers....
{ "content_hash": "efca19fff24b7147ed07d678134316ba", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 87, "avg_line_length": 34.890625, "alnum_prop": 0.7375727720555306, "repo_name": "rohitranjan1991/home-assistant", "id": "1c226ee8c29296e7a9ee247a50d2a725e31a7bfd", "size":...
import re import math from .base import units class Length(object): def __init__(self, content, mode='x', parent=None): if not content: self._unit = None self._value = 0 self._computed_value = 0 return re_number = r'[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[e...
{ "content_hash": "b2867463c2104223662622f20833f01f", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 75, "avg_line_length": 28.434782608695652, "alnum_prop": 0.48827726809378186, "repo_name": "glumpy/glumpy", "id": "5909ea0fe89a0e855352e39462a7130f464168cc", "size": "2232"...
""" Talon.One API Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage ap...
{ "content_hash": "2116579e6fc7e8fc90f446c852f3bd3b", "timestamp": "", "source": "github", "line_count": 384, "max_line_length": 732, "avg_line_length": 36.3125, "alnum_prop": 0.6252151462994836, "repo_name": "talon-one/talon_one.py", "id": "72b79c649e987b1df89239f7ffa606c9f21fc7b5", "size": "13961"...
""" Author: Junhong Chen """ import os import sys import argparse import re #-------------------- Arguments -------------------- #argParser = argparse.ArgumentParser( description="Create a degenerate FASTA from original FASTA and GTF") #argParser.add_argument('--fasta', help="Reference sequence (FASTA format)") #arg...
{ "content_hash": "f2c8199a1dfc19fa368b807b87ce85b0", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 136, "avg_line_length": 40.703252032520325, "alnum_prop": 0.5234195545790472, "repo_name": "macmanes-lab/MCBS913", "id": "73ca0c84c0652de07fa8eb5799b77dee31f6d01f", "size"...
import pytest from spacy.tokens import Doc, Span, DocBin from spacy.training import Example from spacy.training.converters.conllu_to_docs import conllu_to_docs from spacy.lang.en import English from spacy.kb import KnowledgeBase from spacy.vocab import Vocab from spacy.language import Language from spacy.util import en...
{ "content_hash": "cc086f25e80852661f1aaec24d82fd20", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 111, "avg_line_length": 35.08764940239044, "alnum_prop": 0.619393664130805, "repo_name": "spacy-io/spaCy", "id": "6dbbc233bb445f474fab3433f07659a8177df3b7", "size": "8807"...
import mock from oslo_config import cfg from neutron.agent.linux import dhcp from neutron.agent.linux import ip_lib from neutron.common import utils as common_utils from neutron.conf.agent import common as config from neutron.conf.agent import dhcp as dhcp_conf from neutron.conf import common as common_conf from neutr...
{ "content_hash": "680c0d321475b82e07497e09b70b2024", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 79, "avg_line_length": 44.54666666666667, "alnum_prop": 0.5267883867105657, "repo_name": "eayunstack/neutron", "id": "0fa1fdb871e44463082424c67759417a718f3ef5", "size": "39...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('stats', '0004_auto_20171128_1516'), ] operations = [ migrations.AddField( model_name='activitylevel', name='text', ...
{ "content_hash": "59d013428c1ece86f40237f3c317a4a7", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 65, "avg_line_length": 27.129032258064516, "alnum_prop": 0.5576694411414982, "repo_name": "airportmarc/the416life", "id": "01f3e07c5589854d2290447c915e8354ee10c9ac", "size"...