text
stringlengths
4
1.02M
meta
dict
""" Refresh any files in ../virtualenv_support/ that come from elsewhere """ import os try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen import sys here = os.path.dirname(__file__) support_location = os.path.join(here, '..', 'virtualenv_support') embedded_location = os.pa...
{ "content_hash": "ba0075d9940f0003dd8cb5507eaca5b2", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 116, "avg_line_length": 32.295081967213115, "alnum_prop": 0.6131979695431472, "repo_name": "msabramo/virtualenv", "id": "66274b4424963e88a90f509a8a618f792a7bfa2f", "size": ...
from selenium.webdriver.common.keys import Keys from tests.integration.tests.test_fileinput import Test as TestFileInput from . import VisualTest class Test(VisualTest): urls = TestFileInput.urls def test_test_default_usecase(self): self.driver.get('%s%s' % (self.live_server_url, TestFileInput.test_...
{ "content_hash": "dbe4c5e06f1c3ef593c03afb55d30434", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 103, "avg_line_length": 50.66, "alnum_prop": 0.6936439005132254, "repo_name": "sourabhdattawad/django-material", "id": "77a1e66058030b3eedccca4f6bcd422a0647c30c", "size": "...
""" Main Random Variables Module Defines abstract random variable type. Contains interfaces for probability space object (PSpace) as well as standard operators, P, E, sample, density, where See Also ======== sympy.stats.crv sympy.stats.frv sympy.stats.rv_interface """ from __future__ import print_function, division ...
{ "content_hash": "1f20d8b0d83e5c1433bd7c197ada2817", "timestamp": "", "source": "github", "line_count": 1107, "max_line_length": 96, "avg_line_length": 27.883468834688347, "alnum_prop": 0.6135030939190721, "repo_name": "rahuldan/sympy", "id": "89d705d1aed1ccca9420c4723eca36397b984ebf", "size": "308...
from oslo_config import cfg import pkg_resources from neutron._i18n import _ MIGRATION_ENTRYPOINTS = 'neutron.db.alembic_migrations' migration_entrypoints = { entrypoint.name: entrypoint for entrypoint in pkg_resources.iter_entry_points(MIGRATION_ENTRYPOINTS) } INSTALLED_SUBPROJECTS = [project_ for project_...
{ "content_hash": "754779412554f79c6f7ee5655b0d5b45", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 76, "avg_line_length": 32.77272727272727, "alnum_prop": 0.5818307905686546, "repo_name": "huntxu/neutron", "id": "b02f177ce3eefcd2a16d5b0b555fbfabf94d2e9f", "size": "2015",...
""" Example Airflow DAG that shows interactions with Google Cloud Firestore. Prerequisites ============= This example uses two Google Cloud projects: * ``GCP_PROJECT_ID`` - It contains a bucket and a firestore database. * ``G_FIRESTORE_PROJECT_ID`` - it contains the Data Warehouse based on the BigQuery service. Sav...
{ "content_hash": "3097b0318cce3523a3fc51e3cd86ab43", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 107, "avg_line_length": 36.209150326797385, "alnum_prop": 0.6756317689530686, "repo_name": "nathanielvarona/airflow", "id": "90591c085ad51957f11e8d603096f582795729ef", "si...
""" DVR Disaster Victim Registry This module is to provide a view on those Persons who have been affected by the disaster - they may be eligible to be placed on a beneficiary list to receive food, NFIs or cash-for-work from NGOs - if they have suffered financial loss, they may be eligible for compe...
{ "content_hash": "5b8fcd3ab64ea278ddfa508d83864eea", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 110, "avg_line_length": 31.3, "alnum_prop": 0.645367412140575, "repo_name": "ptressel/sahana-eden-madpub", "id": "e3d3b69042cdcfff3fd114b496c3a45cc9234a54", "size": "651", ...
""" Example demonstrating showing a quad. Like hello_quad1.py, but now with Texture2D and VertexBuffer, and optionally using an ElementBuffer to draw the vertices. """ import time import numpy as np from vispy import gloo from vispy import app # Create a texture im1 = np.zeros((100, 100, 3), 'float32') im1[:50, :, ...
{ "content_hash": "b44a511ac941bb005811977d19447755", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 79, "avg_line_length": 28.42452830188679, "alnum_prop": 0.5867905741785596, "repo_name": "dchilds7/Deysha-Star-Formation", "id": "43e2aed6fb6ea269f56afaa599275277d8db2994", ...
import importlib import inspect import os import re import sys import tempfile from io import StringIO from pathlib import Path from django.conf.urls import url from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.db import DatabaseError, connection from django.shortcu...
{ "content_hash": "51720d55c5e659bd1ef97e3c9eb6ccff", "timestamp": "", "source": "github", "line_count": 1154, "max_line_length": 117, "avg_line_length": 43.30069324090121, "alnum_prop": 0.6158218095219036, "repo_name": "jpic/django", "id": "e67d392d64fd3ccff2af46e9016ba1dd44f7e471", "size": "49973"...
from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('images', '0014_auto_20180629_2250'), ] operations = [ migrations.AddField( mo...
{ "content_hash": "5fedecae9a121d4ba6ab9e662427b4c5", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 98, "avg_line_length": 27.055555555555557, "alnum_prop": 0.6365503080082136, "repo_name": "bit-bots/imagetagger", "id": "65060c6742b1ef23169958bbe45e3568215ecd99", "size": ...
''' //---------------------------------------------------------------------------- // Name: msp6info.py // Purpose: Information for msp6prog about button. // // Author: Watson Huang <wats0n.edx@gmail.com> // // Created: 01/19, 2015 // Copyright: (c) 2015 by Watson Huang // License: MIT License...
{ "content_hash": "559890aed7eab4d1c3d9faa3071f6652", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 115, "avg_line_length": 45.83050847457627, "alnum_prop": 0.6963757396449705, "repo_name": "wats0n/msp6prog", "id": "3124bfbb512f3e8fc96807568075d1182d28d38e", "size": "2704...
from unittest import TestCase import numpy from six.moves import xrange import theano from theano.tests import unittest_tools as utt import theano.sandbox.rng_mrg from ..basic_ops import GpuFromHost, HostFromGpu from ..elemwise import GpuElemwise from .config import mode_with_gpu, test_ctx_name class T_Scan(TestCa...
{ "content_hash": "328bf60fc554f02a90d79d62ab7dabf7", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 77, "avg_line_length": 39.634854771784234, "alnum_prop": 0.47634003350083753, "repo_name": "cmdunkers/DeeperMind", "id": "e6326987b6241bf3b7b222e188d94588efbc3512", "size"...
import os import shutil import time from datetime import datetime from itertools import groupby from operator import itemgetter # ============= enthought library imports ======================= from apptools.preferences.preference_binding import bind_preference from git import Repo, GitCommandError, NoSuchPathError fr...
{ "content_hash": "af5b37f9414bd44614692fde0b92a8fe", "timestamp": "", "source": "github", "line_count": 1914, "max_line_length": 120, "avg_line_length": 37.47544409613375, "alnum_prop": 0.5213305821994201, "repo_name": "UManPychron/pychron", "id": "8c7b1b616b2811e9a9931cf1739dd56b94b76b00", "size":...
import argparse import numpy as np from eval_proposal import ANETproposal def main(ground_truth_filename, proposal_filename, max_avg_nr_proposals=100, tiou_thresholds=np.linspace(0.5, 0.95, 10), subset='validation', verbose=True, check_status=True): anet_proposal = ANETproposal(ground_truth_fil...
{ "content_hash": "870bd40fdf53f11850954834f54e0c25", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 82, "avg_line_length": 46.05714285714286, "alnum_prop": 0.6215880893300249, "repo_name": "activitynet/ActivityNet", "id": "48c730703d95cc5115b47b83dff84116d5eef21a", "size"...
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 # noqa: F401 # noqa: F401 # noqa: F401 # noqa: F401 # Disable insecure warnings requests.packages.urllib3.disable_warnings() '''CONSTANTS''' BATCH_SIZE = 2000 DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' DEPROVISIONED_STATUS = 'DEPROV...
{ "content_hash": "7b1b8cfb2db5b8cdd83a510078e05b5f", "timestamp": "", "source": "github", "line_count": 1020, "max_line_length": 118, "avg_line_length": 37.42745098039216, "alnum_prop": 0.5713537300922046, "repo_name": "VirusTotal/content", "id": "d8e53a5b841031a36aa4b80e19a1b46cf2db2857", "size": ...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "None", sigma = 0.0, exog_count = 100, ar_order = 0);
{ "content_hash": "fc65a6f30c4dc2aba2affd24d3b427be", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 161, "avg_line_length": 37.285714285714285, "alnum_prop": 0.7011494252873564, "repo_name": "antoinecarme/pyaf", "id": "b5d67a905e15287872748bd380781895dd8baa56", "size": "26...
""" Package for interacting on the network at a high level. """ import random import pickle import asyncio from logging import getLogger from kademlia.protocol import KademliaProtocol from kademlia.utils import digest from kademlia.storage import ForgetfulStorage from kademlia.node import Node from kademlia.crawling i...
{ "content_hash": "ab0407a6a93ad00deea8a0bce1196d38", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 94, "avg_line_length": 36.986111111111114, "alnum_prop": 0.6035799223932907, "repo_name": "faisalburhanudin/kademlia", "id": "8dcaf683c4ad2633c1cabe4f50d38e32098a6566", "s...
from oslo_config import cfg from oslo_middleware import cors def set_config_defaults(): """This method updates all configuration default values.""" set_cors_middleware_defaults() def set_cors_middleware_defaults(): """Update default configuration options for oslo.middleware.""" # CORS Defaults #...
{ "content_hash": "500f9c289b1e8dac14f0aee931f6174b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 76, "avg_line_length": 41.225806451612904, "alnum_prop": 0.39593114241001565, "repo_name": "muraliselva10/cloudkitty", "id": "534eb58bcb5ba0671f14892653bdfa91fbc8df60", "si...
from __future__ import division import argparse import resource import gc import av parser = argparse.ArgumentParser() parser.add_argument('-c', '--count', type=int, default=5) parser.add_argument('-f', '--frames', type=int, default=100) parser.add_argument('--print', dest='print_', action='store_true') parser.add_...
{ "content_hash": "20d75b40a08d6335b9b5d0d9d118834c", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 103, "avg_line_length": 24.953125, "alnum_prop": 0.5817157169693175, "repo_name": "markreidvfx/PyAV", "id": "4f20c7275ea6722f50d2428a0d4ca0dc2f1173da", "size": "1597", "b...
from __future__ import unicode_literals, division, absolute_import import logging import re import random from flexget import plugin from flexget.event import event log = logging.getLogger('torrent_cache') MIRRORS = ['http://torrage.com/torrent/', 'https://torcache.net/torrent/', 'http://zoink....
{ "content_hash": "1cca4eee07aff31ee612ecdf5dba7949", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 93, "avg_line_length": 35.36585365853659, "alnum_prop": 0.5889655172413794, "repo_name": "camon/Flexget", "id": "f5074fa49d491f5fbec7069d751511ccf7777ab5", "size": "1450", ...
import json import athletemodel import yate names = athletemodel.get_names_from_store() print(yate.start_response('application/json')) print(json.dumps(sorted(names)))
{ "content_hash": "ae9504bec3d76982cb07cd57dcd4bea5", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 46, "avg_line_length": 19, "alnum_prop": 0.783625730994152, "repo_name": "leobarros/use_cabeca_python", "id": "7851b618b704173fa8ce7e207cf180f4eb1406fb", "size": "198", "b...
"""ActiveMaster definition.""" from config_bootstrap import Master class TryserverChromiumAndroid(Master.Master4a): project_name = 'TryserverChromiumAndroid' master_port = 21401 slave_port = 31401 master_port_alt = 26401 buildbot_url = 'https://build.chromium.org/p/tryserver.chromium.android/' buildbucket...
{ "content_hash": "fc30fafefd0f1fb75337366f1548efc5", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 75, "avg_line_length": 36.083333333333336, "alnum_prop": 0.7736720554272517, "repo_name": "eunchong/build", "id": "9d8df554ceda5f0844bb4f4c326363d6818edf58", "size": "768",...
from Products.ZenRelations.RelSchema import ToManyCont, ToOne from Products.ZenModel.Device import Device class EMCIsilonDevice(Device): _relations = Device._relations + ( ('emcisilon_chassises', ToManyCont(ToOne, 'ZenPacks.community.EMCIsilon.EMCIsilonChassis', 'emcisilon_chassis...
{ "content_hash": "6a594396c7cccf5155bacf4c1e4dea26", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 69, "avg_line_length": 37.41509433962264, "alnum_prop": 0.5985879979828542, "repo_name": "linkslice/ZenPacks.community.EMCIsilon", "id": "7ec6ded134fa0a253645a4ff4ed5edfbdb17...
"""Tests for the blog admin page.""" from __future__ import annotations import logging from core import feconf from core.domain import config_domain from core.domain import config_services from core.tests import test_utils from typing import List class BlogAdminPageTests(test_utils.GenericTestBase): """Checks...
{ "content_hash": "b381e1f0dd0f88cdc34fb4383620e02c", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 79, "avg_line_length": 35.569182389937104, "alnum_prop": 0.5876580320042436, "repo_name": "oppia/oppia", "id": "c27dda210d2262207f78eb81b739f7fc5df7d6f0", "size": "11916",...
""" Support for coverage analysis. """ from peyotl.utility import get_logger import unittest import shutil import os _LOG = get_logger(__name__) PEYOTL_COVERAGE_ANALYSIS_AVAILABLE = False try: from setuptools import Command except ImportError: _LOG.warn("setuptools.Command could not be imported: setuptools e...
{ "content_hash": "77934446e81b2a03131d2128409dc87a", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 114, "avg_line_length": 37.806451612903224, "alnum_prop": 0.4988623435722412, "repo_name": "OpenTreeOfLife/peyotl", "id": "fcc416b7529c9514be10530fdba46bad81af0bc6", "size"...
__test__ = False if __name__ == '__main__': import eventlet eventlet.monkey_patch() # Leaving unpatched select methods in the select module is a recipe # for trouble and this test makes sure we don't do that. # # Issues: # * https://bitbucket.org/eventlet/eventlet/issues/167 # * https:...
{ "content_hash": "d0fb721b7f083c108567681fa4f8a001", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 71, "avg_line_length": 28.09375, "alnum_prop": 0.5984427141268076, "repo_name": "kawamon/hue", "id": "a761e1e364a5344ec56eb4db2b27e60e4281df4b", "size": "899", "binary": ...
""" This module provides convenient functions to transform sympy expressions to lambda functions which can be used to calculate numerical values very fast. """ from __future__ import print_function, division import inspect import textwrap from sympy.core.compatibility import (exec_, is_sequence, iterable, NotIte...
{ "content_hash": "6d705c0933bdd995c898c3fd760479b3", "timestamp": "", "source": "github", "line_count": 671, "max_line_length": 110, "avg_line_length": 34.8822652757079, "alnum_prop": 0.6095018371357771, "repo_name": "souravsingh/sympy", "id": "aab0444b3a23427989a7cb37e26206514ee03041", "size": "23...
import sys import os import csv from statsd import StatsClient from sklearn.cross_validation import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.metrics import classification_report, confusion_matrix, accuracy_score from itertools import chain import pycrfsuite statsd = StatsClient(...
{ "content_hash": "6e334fe74c59fe83c3bc9dfe4de195fe", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 87, "avg_line_length": 22.855967078189302, "alnum_prop": 0.7005761613251711, "repo_name": "networkdynamics/attribution-extraction", "id": "c454146e4d7539724b5b1d1bbddd42d2e2...
import os import copy from itertools import izip import pymetis from distributions.io.stream import json_load import distributions.lp.clustering import loom.group from loom.group import METIS_ARGS_TEMPFILE from loom.group import find_consensus_grouping from nose.tools import assert_almost_equal from nose.tools import a...
{ "content_hash": "f1ece17d428b82e62ad225e78cd395a6", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 75, "avg_line_length": 31.428571428571427, "alnum_prop": 0.5841818181818181, "repo_name": "fritzo/loom", "id": "6fad23574d2d0be7148428e5594a3e5a9276525a", "size": "7077", ...
""" WSGI config for simplerec 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.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
{ "content_hash": "aff7e010b851a138a3d612ab02129482", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.6875, "alnum_prop": 0.7721518987341772, "repo_name": "dan-passaro/django-recommend", "id": "5123b7c34d33fd0f8ca1a5af877347f442e8a079", "size": "39...
from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors import LinkExtractor import scrapy import os # IN the special case of the wto disputes, we need to get the list of all disputes, so we run this script preliminarily: execfile("./fetchjson.py") # Now we build the scraper: # Fir...
{ "content_hash": "4ff53ef146bcb46fff497f25284e0ad7", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 120, "avg_line_length": 32.2, "alnum_prop": 0.7249334516415262, "repo_name": "trcook/wto_python_scrape", "id": "3230b0c971b8dfb4e1cadf1d93bf8dbb3e44239e", "size": "1127", ...
""" Unit tests for alias_management.py. """ import boto3 from botocore.exceptions import ClientError import pytest import alias_management @pytest.mark.parametrize('error_code, stop_on_action', [ (None, None), ('TestException', 'stub_create_key'), ('TestException', 'stub_create_alias'), ('TestExcept...
{ "content_hash": "bfba3f78c7a542800d0d6a649a7b0e5a", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 104, "avg_line_length": 39.627450980392155, "alnum_prop": 0.6625432953983177, "repo_name": "awsdocs/aws-doc-sdk-examples", "id": "9dcb331e4b1ea41709fc064dccc6b7de86007a32", ...
from __future__ import print_function from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.neutron.v2_0 import network from neutronclient.neutron.v2_0 import router from neutronclient.openstack.common.gettextutils import _ PERFECT_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f" class AddNetworkToDhcpAgent(...
{ "content_hash": "177106074523846811d7ca99bf3faca0", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 78, "avg_line_length": 36.29501915708812, "alnum_prop": 0.5855589570357859, "repo_name": "cboling/SDNdbg", "id": "db702b5bfff26db7476658c412c07598d5c27a92", "size": "10111...
from __future__ import unicode_literals import functools import itertools import operator # import os import re from .common import InfoExtractor from ..compat import ( compat_HTTPError, # compat_urllib_parse_unquote, # compat_urllib_parse_unquote_plus, # compat_urllib_parse_urlparse, ) from ..utils i...
{ "content_hash": "10bf314f178b1ad9ab3db4155f1979de", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 128, "avg_line_length": 35.328990228013026, "alnum_prop": 0.5069149917020099, "repo_name": "achang97/YouTunes", "id": "3428458afa987fb3eb8c3be061742cefce6e2734", "size": "...
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.abspath('.')) # -- General conf...
{ "content_hash": "db88f7b23efcfc50c6b9c4359f028427", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 80, "avg_line_length": 32.893382352941174, "alnum_prop": 0.7044819492567341, "repo_name": "mattjmcnaughton/sdep", "id": "71ed982c468255f8e7ecd33f9880de5a4445f959", "size":...
import eventlet import mock from ovs.db import idl from ovs import poller from neutron.agent.ovsdb.native import connection from neutron.agent.ovsdb.native import idlutils from neutron.tests import base class TestOVSNativeConnection(base.BaseTestCase): def setUp(self): super(TestOVSNativeConnection, sel...
{ "content_hash": "085cbae9f813aec9c163fe9c0d7b0823", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 78, "avg_line_length": 46.3, "alnum_prop": 0.6431485481161507, "repo_name": "cloudbase/neutron", "id": "0b0ea091a29053834a228c5063822ef00bfc209b", "size": "4774", "binary...
''' $Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $ ''' from cStringIO import StringIO from datetime import datetime, timedelta from struct import unpack, calcsize from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo from pytz.tzinfo import memorized_datetime, memorized_timedelta def build_tzinfo...
{ "content_hash": "135605adc44e983e6974d92b11398d5f", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 77, "avg_line_length": 35.151785714285715, "alnum_prop": 0.5664211328422657, "repo_name": "pombreda/django-hotclub", "id": "56b8397da5185000d935d5f2c2125e088e0531c4", "siz...
from __future__ import division from __future__ import unicode_literals import codecs import os import re from django.contrib import messages from django.contrib.auth import logout as logout from django.contrib.auth.decorators import login_required from django.contrib.auth.signals import user_logged_in from django.ht...
{ "content_hash": "5d3470a272e17ba78afcf19bec388726", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 114, "avg_line_length": 29.41907514450867, "alnum_prop": 0.5964240102171137, "repo_name": "dulrich15/spot", "id": "0a7ff2339148d85bb923f8e18a9a0d6cc7f750e4", "size": "1017...
from six import iteritems, string_types from toolz import valmap, complement, compose import toolz.curried.operator as op from zipline.utils.preprocess import preprocess def ensure_upper_case(func, argname, arg): if isinstance(arg, string_types): return arg.upper() else: raise TypeError( ...
{ "content_hash": "933ed817ab7286bcf108f8a87d2907ee", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 104, "avg_line_length": 27.21818181818182, "alnum_prop": 0.56312625250501, "repo_name": "ChinaQuants/zipline", "id": "23001ac8fd12eb7bf09ace3715d45f1fa4d882e1", "size": "5...
import unittest import botocore.session class TestService(unittest.TestCase): def setUp(self): self.session = botocore.session.get_session() def test_get_endpoint_with_no_region(self): # Test global endpoint service such as iam. service = self.session.get_service('iam') endpo...
{ "content_hash": "7973bdf87e06082517fbd69dc379f853", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 69, "avg_line_length": 26, "alnum_prop": 0.6602564102564102, "repo_name": "jonparrott/botocore", "id": "efe4934ca4be5cd4e0ac87f4f2743dd2486cfdaa", "size": "1609", "binary...
""" Author: AsherYang Email : ouyangfan1991@gmail.com Date : 2018/7/5 Desc : 后台管理系统, 添加商品handler manager api handler """ import sys sys.path.append('../') import tornado.web from constant import ResponseCode from FFStoreJsonEncoder import * from mgrsys.PermissionManager import PermissionManager from net.GetGoods ...
{ "content_hash": "ec99491f5dccd855e68ff091166b31fe", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 110, "avg_line_length": 41.22727272727273, "alnum_prop": 0.5525542080117604, "repo_name": "AsherYang/ThreeLine", "id": "8242764795eecb7294b4311c248500a2f70acf98", "size": ...
from django.db.models import Manager, Sum from django.db.models.query import RawQuerySet from kolibri.content.models import AssessmentMetaData, ChannelMetadataCache, ContentNode, File from le_utils.constants import content_kinds from rest_framework import serializers from .content_db_router import default_database_is_...
{ "content_hash": "19ab5ba66350a9b42ebadf30e171e56f", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 126, "avg_line_length": 41.791304347826085, "alnum_prop": 0.6657303370786517, "repo_name": "rtibbles/kolibri", "id": "6dec239b7051a56f3df7a39f9ffa55f9b3849a74", "size": "9...
""" convert.py Convert music from command line. Place music in music directory (or other configured directory) and then run this script. """ import os from lib.config import config as cf from lib.sclog import sclog import lib.utils as utils clear = cf.flags.get('clear') def main(clear=clear): """ Converts sourc...
{ "content_hash": "3cfc9023bf5f7dcaeff1136dece6e849", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 76, "avg_line_length": 26.804878048780488, "alnum_prop": 0.6915377616014559, "repo_name": "hexagrahamaton/soundcube", "id": "12c86e273d6e08023baa92e4ab0d4eb66426773d", "siz...
from cloudbaseinit import exception from cloudbaseinit.openstack.common import log as logging from cloudbaseinit.osutils import factory as osutils_factory from cloudbaseinit.plugins.common import base from cloudbaseinit.plugins.common import constants from cloudbaseinit.utils.windows import security from cloudbaseinit....
{ "content_hash": "b5654300e062b84397571ffa10644503", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 79, "avg_line_length": 45.06521739130435, "alnum_prop": 0.6114327062228654, "repo_name": "whiteear/cloudbase-init", "id": "9211abc61a66703c9ac307829fd8707b87c358ac", "size"...
from lxml import html from django.core.management.base import BaseCommand, CommandError from engine.models import WebPage from engine.crawler import get_page_links class Command(BaseCommand): def handle(self, *args, **options): pages = WebPage.objects.only(*['url', 'raw_html']).filter( crawled...
{ "content_hash": "baf57f4b4914a562bef4f5a14dcfc7d7", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 66, "avg_line_length": 25.916666666666668, "alnum_prop": 0.6077170418006431, "repo_name": "tanguy-s/ucl-search-engine", "id": "4edbe0ca93a4bf89a3890d6a0029d8d41bb5589d", "s...
import os import re import typing class Styles(object): Normal = 'Normal' Heading = 'Heading' Heading1 = 'Heading1' Heading2 = 'Heading2' Diagram = 'Diagram' Metadata = 'Metadata' def parse(source): lines = source.splitlines() states = [] state = StartState() for line in lin...
{ "content_hash": "01d3f13b44dbe179a84d602210574bd6", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 73, "avg_line_length": 28.685185185185187, "alnum_prop": 0.5237249838605552, "repo_name": "donkirkby/domiculture", "id": "a4a0a97bd084af06c215aaf98d574f2c037d4682", "size"...
from threading import Thread import time class ThreadFirst(Thread): def run(self): for i in range(5): time.sleep(1) print('hi') ThreadFirst().start()
{ "content_hash": "2e1a8dbc914392d43aa3d0479a197891", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 28, "avg_line_length": 17.181818181818183, "alnum_prop": 0.5925925925925926, "repo_name": "int19h/PTVS", "id": "7d1d0d8a374748439e8d07d6a69c9bf0a154cc78", "size": "189", ...
from __future__ import print_function from tkinter import filedialog from tkinter import * from astride import Streak import glob import sys import shutil import os import tkinter as tk import matplotlib.pyplot as plt from astropy.io import fits import numpy as np class _Args: file_pathin = "" file_pathout = ...
{ "content_hash": "9a759dc13fcf82c99ded8e6eebd82f90", "timestamp": "", "source": "github", "line_count": 423, "max_line_length": 137, "avg_line_length": 30.91725768321513, "alnum_prop": 0.55918336137024, "repo_name": "teuben/pyASC", "id": "8ff50fc4c9c10a9f186ec3fc9b7e6e8415ce5732", "size": "13140", ...
import numpy as np from .TimeField import TimeField class TimeMassField(TimeField): def __add__(self, other): if not (isinstance(other, self.__class__)): raise ( Exception( "The two operands must be both children of " + str(self__class__) ) ...
{ "content_hash": "ff0087c639ff82fc74d4a6748d8e8ea2", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 85, "avg_line_length": 29.125, "alnum_prop": 0.5085836909871244, "repo_name": "MPIBGC-TEE/CompartmentalSystems", "id": "5f23b15542f73e1d255aa4b5ddcc421f7f00dc75", "size": "...
from utils import load_mat import pylab as pl import numpy as np from sklearn.cluster import KMeans data = load_mat('heightWeight') data = data['heightWeightData'] markers = 'Dox' colors = 'rgb' for i in range(3): KM_model = KMeans(init='k-means++', n_clusters=i+1) labels = KM_model.fit_predict(data[:, [1, 2]...
{ "content_hash": "14c15d12103165e892933cb57d2daec0", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 56, "avg_line_length": 30.565217391304348, "alnum_prop": 0.6073968705547653, "repo_name": "shangliy/ee660", "id": "5a8515150880e617e915243bf4737ba788ce9011", "size": "726",...
"""OS related QA tests. """ import os import os.path from ganeti import utils from ganeti import constants from ganeti import pathutils from qa import qa_config from qa import qa_utils from qa import qa_error from qa_utils import AssertCommand, AssertIn, AssertNotIn _TEMP_OS_NAME = "TEMP-Ganeti-QA-OS" _TEMP_OS_P...
{ "content_hash": "d228ee5694f19b83e76c64b16dbd7a23", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 80, "avg_line_length": 27.388646288209607, "alnum_prop": 0.5808354591836735, "repo_name": "ganeti/ganeti", "id": "32c385897afa35bddb2734051525825f29a4512b", "size": "7638"...
from flask_wtf import FlaskForm from wtforms import validators, StringField, SubmitField class SdrForm(FlaskForm): command = StringField('Command', [ validators.DataRequired(), ],default='rtl_sdr -f 100122000 -g 40 -s 2500000 -n 25000000 sdr-capture-$(date +%Y-%m-%d:%H:%M:%S).dat') submit = SubmitF...
{ "content_hash": "ad315d9d6a61c5774cfda0b533a7ce33", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 109, "avg_line_length": 41.5, "alnum_prop": 0.6927710843373494, "repo_name": "t4skforce/PenTestingUnit", "id": "49be1a983103971aa8fa4daa19a914408d0352c8", "size": "332", "...
import unittest from prf.tests.prf_testcase import PrfTestCase from prf.mongodb import get_document_cls class TestMongoDB(PrfTestCase): def setUp(self): super(TestMongoDB, self).setUp() self.drop_databases()
{ "content_hash": "c209214fc2a77dd8b6a2e4cc04841393", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 46, "avg_line_length": 21.09090909090909, "alnum_prop": 0.728448275862069, "repo_name": "vahana/prf", "id": "7b61eb32add1f013ebcab84c3f35d5abcb413551", "size": "232", "bi...
from __future__ import unicode_literals from django.conf.urls import url from django.contrib.auth import views as auth_views from django.views.generic import RedirectView from . import views from .models import Article, DateArticle date_based_info_dict = { 'queryset': Article.objects.all(), 'date_...
{ "content_hash": "a705a60df49437a930b30740aa02b54a", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 95, "avg_line_length": 28.520833333333332, "alnum_prop": 0.6596055514974434, "repo_name": "yephper/django", "id": "31e5e052d3567fb07249a0ff831efa94acba99c0", "size": "1405"...
from flask import current_app as app @app.route('/') def index(): return 'Hello from %s' % app.config.SERVICE_NAME
{ "content_hash": "122ac7e985575454ebb631a6d042ef72", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 49, "avg_line_length": 19.666666666666668, "alnum_prop": 0.6949152542372882, "repo_name": "hamaxx/mlask", "id": "8b9201916eb5fdda6ab1be145abc389efeea55d6", "size": "143", ...
import click import re import sys import matplotlib matplotlib.use('pdf') import matplotlib.pyplot as plt import numpy as np from matplotlib.backends.backend_pdf import PdfPages from datetime import datetime # Usage something like: # merge_callers.py -t TUMOR -n NORMAL -m1 MuTect1.vcf -m2 MuTect2.vcf -s strelka.vcf -i...
{ "content_hash": "cf615fa16bda123a54ee8c9c34250fb4", "timestamp": "", "source": "github", "line_count": 397, "max_line_length": 401, "avg_line_length": 52.76070528967254, "alnum_prop": 0.5580063019192208, "repo_name": "SciLifeLab/CAW", "id": "ccef82985f689935d8d854efdecb9a170c14466c", "size": "2097...
import unittest from itertools import islice from django.test.runner import DiscoverRunner from refarm_test_utils.results import TimedResult class RefarmTestRunner(DiscoverRunner): """Check every test is tagged and show slowest tests table.""" def __init__(self, *args, top_slow=0, check_tags=True, rerun_fa...
{ "content_hash": "69ad1e749defe543f5407af670be3381", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 97, "avg_line_length": 36.59615384615385, "alnum_prop": 0.5627955859169732, "repo_name": "fidals/refarm-site", "id": "af4c3aa28a41e2e19c1fbbb80f8791fcb54af1f4", "size": "3...
""" Test different error functions as isolated units. """ from unittest import mock from espei.optimizers.opt_mcmc import EmceeOptimizer from espei.utils import database_symbols_to_fit import numpy as np import pytest import pickle import scipy.stats from tinydb import where from pycalphad import Database, Model, var...
{ "content_hash": "36b536f29ea79f736eb2172f0441da8d", "timestamp": "", "source": "github", "line_count": 637, "max_line_length": 222, "avg_line_length": 42.602825745682885, "alnum_prop": 0.6829906404303928, "repo_name": "PhasesResearchLab/ESPEI", "id": "e04972c18f5ba42b6b83b7bfc17ccf934b7449b8", "si...
from rest_framework import serializers from . import models class RepositorySerializer(serializers.HyperlinkedModelSerializer): class Meta: model = models.Repository fields = ('id', 'name', 'state') class PresentationSerializer(serializers.HyperlinkedModelSerializer): fullname = serialize...
{ "content_hash": "8d4cca72dd2c639d402e5a4dc76b7a7f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 69, "avg_line_length": 23.65, "alnum_prop": 0.7040169133192389, "repo_name": "fladi/qraz", "id": "aba410f454f28c9152547c47c21ac4a82534dc5b", "size": "520", "binary": fals...
""" This script creates a pile of compile-fail tests check that all the derives have spans that point to the fields, rather than the #[derive(...)] line. sample usage: src/etc/generate-deriving-span-tests.py """ import sys, os, datetime, stat TEST_DIR = os.path.abspath( os.path.join(os.path.dirname(__file__), '....
{ "content_hash": "43e40ce33eb0b2c76d3bed5aa92ba9c7", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 96, "avg_line_length": 29.80327868852459, "alnum_prop": 0.5992849284928493, "repo_name": "defuz/rust", "id": "eeb1b89472b3d36c82c14413fc2aa7d3804d1c04", "size": "4118", ...
from django.conf.urls import * urlpatterns = patterns('actividades.fadcanic.views', url(r'^$', 'filtro_programa', name='filtro_programa'), )
{ "content_hash": "ea6f0491e54b4557ed0cfe08436655b3", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 62, "avg_line_length": 30.6, "alnum_prop": 0.673202614379085, "repo_name": "shiminasai/plataforma_fadcanic", "id": "116627394d6b2db70b043bee1b06269eaaa6c758", "size": "153",...
import json import sys import os import argparse import string import datetime import time from numerous import Numerous, numerousKey, \ NumerousError, NumerousAuthError, NumerousMetricConflictError # # usage # nr [ -c credspec ] [ -t limit ] [-D] [-jknNqwy+/ABEIMPS] [ m1 [v1] ]... # add...
{ "content_hash": "2f5a0221e884ddbec51e58cf18262780", "timestamp": "", "source": "github", "line_count": 1383, "max_line_length": 157, "avg_line_length": 38.417208966015906, "alnum_prop": 0.553725696862472, "repo_name": "outofmbufs/Nappy", "id": "da0dd29ede9a1355eb1f4fed1420713d94e3cfed", "size": "5...
from kubernetes_py.models.v1.PodTemplateSpec import PodTemplateSpec from kubernetes_py.models.v1beta1.DeploymentStrategy import DeploymentStrategy from kubernetes_py.models.v1beta1.LabelSelector import LabelSelector from kubernetes_py.models.v1beta1.RollbackConfig import RollbackConfig class DeploymentSpec(object): ...
{ "content_hash": "cfdc0908b956f6cc24504268386acc99", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 112, "avg_line_length": 36.53416149068323, "alnum_prop": 0.5423325399523972, "repo_name": "froch/kubernetes-py", "id": "ff7870c228d5c5d797aa33e2a8fa630be708ccb4", "size": ...
from calvin.actor.actor import Actor, manage, condition, stateguard class Deselect(Actor): """ Route token from 'case_true' or 'case_false' to 'data' port depending on 'select' Deselect assumes 'false' or 'true' as input, values outside that range will default to 'case_false'. Inputs: case...
{ "content_hash": "f125a18c31ce1c55935d0568e96f2f20", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 85, "avg_line_length": 29.036363636363635, "alnum_prop": 0.5604257983719474, "repo_name": "EricssonResearch/calvin-base", "id": "c948e90e0ec2b22505009021cdab943084998159", ...
from airflow.utils import import_module_attrs as _import_module_attrs # These need to be integrated first as other operators depend on them _import_module_attrs(globals(), { 'check_operator': [ 'CheckOperator', 'ValueCheckOperator', 'IntervalCheckOperator', ], }) _operators = { 'ba...
{ "content_hash": "d1714bf89f45ae5c4a873c589ee33ce1", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 69, "avg_line_length": 32.411764705882355, "alnum_prop": 0.6415607985480943, "repo_name": "storpipfugl/airflow", "id": "535abe8cd8e9e94d185f3856575d014b6f0f71c1", "size": "...
"""Distributional RL agent using quantile regression. This loss is computed as in "Distributional Reinforcement Learning with Quantile Regression" - Dabney et. al, 2017" """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from batch_rl.multi_head import at...
{ "content_hash": "25a912335492550f5f66e0276505789e", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 80, "avg_line_length": 43.49756097560976, "alnum_prop": 0.6585174386004261, "repo_name": "google-research/batch_rl", "id": "df0a3d2a6ae9eeae254f5c415c3a4770a895c967", "siz...
"""Entity, follower and following documents""" __all__ = ['Entity'] from warnings import warn from mongoengine import * from mongoengine.queryset import DoesNotExist from mongoengine.signals import post_save from tentd.documents import * from tentd.utils import json_attributes, set_attributes class QuerySetPropert...
{ "content_hash": "3ad23ef6225672dec1768f23b6977054", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 76, "avg_line_length": 30.204301075268816, "alnum_prop": 0.642933428266287, "repo_name": "pytent/pytentd", "id": "7ae2a18b290669874dae46474237cd59ee9c3b93", "size": "2809",...
from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework.views import APIView from weather.models import Weather from weather.serializers import WeatherSerializer import datetime class WeatherReporter(APIView): def reporter(...
{ "content_hash": "bba1252c72db7f29a031590731c34bb2", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 89, "avg_line_length": 34.525, "alnum_prop": 0.6357711803041275, "repo_name": "TeamEmily/Emily_server", "id": "2b39289130c9ec2c14c2478db3960a695eaa0246", "size": "1389", ...
from google.cloud import logging_v2 async def sample_delete_bucket(): # Create a client client = logging_v2.ConfigServiceV2AsyncClient() # Initialize request argument(s) request = logging_v2.DeleteBucketRequest( name="name_value", ) # Make the request await client.delete_bucket(r...
{ "content_hash": "3e5cfd8f8d152e4dacc25ced8eb7f620", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 63, "avg_line_length": 23.647058823529413, "alnum_prop": 0.7164179104477612, "repo_name": "googleapis/gapic-generator-python", "id": "6633aa3c4344afe75d7889133f129a062bf4b4be...
"""Tests for compiler_opt.tools.extract_ir.""" # pylint: disable=protected-access import os.path from absl import flags from absl.testing import absltest from compiler_opt.tools import extract_ir flags.FLAGS['num_workers'].allow_override = True class ExtractIrTest(absltest.TestCase): def test_one_conversion(se...
{ "content_hash": "c3c510284d1d18eee9dddbe3ccb34cda", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 80, "avg_line_length": 44.55191256830601, "alnum_prop": 0.6407457377652398, "repo_name": "google/ml-compiler-opt", "id": "95c70be98ec939a29a0bd68340273ea2c2b33af1", "size"...
from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^app/', include('app.foo.urls')), # Uncomment the next line to enable admin documentation: # (r'^...
{ "content_hash": "4853abcc475bd77bca1cced83f3760b1", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 65, "avg_line_length": 30, "alnum_prop": 0.6458333333333334, "repo_name": "miracle2k/feedplatform", "id": "4115354894f6fc143f922e2443a2ef55c5b52379", "size": "480", "bina...
from __future__ import absolute_import from django.conf import settings import pika import logging import ujson import random import time import threading import atexit from collections import defaultdict from zerver.lib.utils import statsd from typing import Any, Callable # This simple queuing library doesn't expos...
{ "content_hash": "9c9fd169bfe3dc214bf74565e75e43a1", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 109, "avg_line_length": 38.68265682656826, "alnum_prop": 0.627778307736335, "repo_name": "Frouk/zulip", "id": "c08d8dec73e7f4f70a00e79ab83792aac3168615", "size": "10483", ...
from common.methods import set_progress import os import json, tempfile from google.cloud import storage from resourcehandlers.gce.models import GCEHandler from django.conf import settings from pathlib import Path def create_client(rh): json_fd, json_path = tempfile.mkstemp() json_dict = {'client_email': rh....
{ "content_hash": "a8a913cd28226369e07f1b05247dccb9", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 97, "avg_line_length": 29.52542372881356, "alnum_prop": 0.6435132032146957, "repo_name": "CloudBoltSoftware/cloudbolt-forge", "id": "698b649d14a966f4022b51532e8366f688b840ee"...
""" Copyright 2012 GroupDocs. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
{ "content_hash": "79f1b8773a453c9849dcd4f5d5a84efd", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 77, "avg_line_length": 30.161290322580644, "alnum_prop": 0.6887700534759358, "repo_name": "liosha2007/temporary-groupdocs-python3-sdk", "id": "2e0c59e6bfc51767e56ab31e57989d8...
"""Module only used to log the number of followers to a file""" from datetime import datetime from selenium.common.exceptions import NoSuchElementException def log_follower_num(browser, username): """Prints and logs the current number of followers to a seperate file""" browser.get('https://www.instagram.c...
{ "content_hash": "7c05913f0125e4483349035ba671cf12", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 118, "avg_line_length": 38.583333333333336, "alnum_prop": 0.6727861771058316, "repo_name": "juanchoabdon/insta-data-science", "id": "a0108ebb6dc0deaa40009add33375673714cee55"...
""" Django settings for GTFSBuilder project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pa...
{ "content_hash": "230508a3ebffc5381b97da9dcfcfe167", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 71, "avg_line_length": 27.172727272727272, "alnum_prop": 0.6901973904315825, "repo_name": "MarconiMediaGroup/GTFS-Builder", "id": "2c333e5550547fc501d28267da0f42348ee77de3",...
from searchengine.index.index import Index from searchengine.parser import RequestDocument def binary_independance_retrieval(request, index, nb_answers): """ Parameters: request, list of documents, common words and number of answers required Result : a sorted list of k document ids ranked by pertinence ...
{ "content_hash": "c07a069193a7dce4a0fce293aa6f7f29", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 87, "avg_line_length": 38.705882352941174, "alnum_prop": 0.6899696048632219, "repo_name": "Neki/searchengine", "id": "059cb8edf18e845b800e2bbabbf3fd5685c5e3e6", "size": "65...
from sugar3.activity import bundlebuilder bundlebuilder.start()
{ "content_hash": "b04ff093401018a3a3d62e2e43a5bf0e", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 41, "avg_line_length": 32, "alnum_prop": 0.859375, "repo_name": "MrNex/Matter.py", "id": "5dc0ff42becda414545503ab7897d49749c7925b", "size": "824", "binary": false, "cop...
"""VRNN classes.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import namedtuple import functools import sonnet as snt import tensorflow as tf from fivo.models import base VRNNState = namedtuple("VRNNState", "rnn_state latent_encod...
{ "content_hash": "524ddc4319a47e6ccaee608c0b0c8afd", "timestamp": "", "source": "github", "line_count": 557, "max_line_length": 80, "avg_line_length": 45.50448833034111, "alnum_prop": 0.6724927010179121, "repo_name": "tombstone/models", "id": "4e2552088c19f141a75d791d2be0d0a5238ed87c", "size": "260...
import os import shutil from errno import ENOENT, EEXIST import hashlib import sys from os.path import abspath, realpath, join as joinpath import platform import re import six from conans.util.log import logger import tarfile import stat def make_read_only(path): for root, _, files in os.walk(path): for f...
{ "content_hash": "2718381690dd39b9ec0b9b7563044498", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 97, "avg_line_length": 26.34926470588235, "alnum_prop": 0.614762104088182, "repo_name": "lasote/conan", "id": "c5e5ae5c72122c9d9313d6daa4bd527fa5baba37", "size": "7167", ...
import unittest import nengo import time import numpy as np import matplotlib.pyplot as plt from brainspawn.simulator.sim_manager import SimManager from brainspawn.sample_networks.two_dimensional_rep import model, sin, cos, neurons class SimManagerTests(unittest.TestCase): """Test cases for SimManager """ ...
{ "content_hash": "ab98c303af3add8249ac2926d7bc6e4e", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 113, "avg_line_length": 32.945945945945944, "alnum_prop": 0.5787530762920426, "repo_name": "chairmanmeow50/Brainspawn", "id": "c0174e34c629ca26b496bf8a6f69643fb7961215", "s...
import errno import inspect import os import sys from contextlib import contextmanager from functools import update_wrapper from itertools import repeat from ._unicodefun import _verify_python_env from .exceptions import Abort from .exceptions import BadParameter from .exceptions import ClickException from .exceptions...
{ "content_hash": "0724a4b8356a32f679a05b29a019885b", "timestamp": "", "source": "github", "line_count": 2070, "max_line_length": 88, "avg_line_length": 38.285990338164254, "alnum_prop": 0.5805405541815979, "repo_name": "rochacbruno/dynaconf", "id": "b7124df4fb15b278db20f596f696ef74212b086b", "size"...
"""Trains an OpenAI Baselines DQN agent on bsuite. Note that OpenAI Gym is not installed with bsuite by default. See also github.com/openai/baselines for more information. """ from absl import app from absl import flags from baselines import deepq import bsuite from bsuite import sweep from bsuite.baselines.utils...
{ "content_hash": "2474f9eda8211840766ff04075535a85", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 107, "avg_line_length": 35.53846153846154, "alnum_prop": 0.7061087061087061, "repo_name": "deepmind/bsuite", "id": "598801fbeb568716faa3641371943bfc1544516a", "size": "490...
from sklearn2sql_heroku.tests.classification import generic as class_gen class_gen.test_model("SVC_poly" , "BinaryClass_100" , "duckdb")
{ "content_hash": "8df3496e6911d63a65cc6ae0c658624a", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 72, "avg_line_length": 34.75, "alnum_prop": 0.7697841726618705, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "3a86462ed398e8e2f01c75e0ba071465caf73092", "size": "13...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.payload import Payload from pants.contrib.node.targets.node_package import NodePackage class NodeModule(NodePackage): """A Node module.""" def ...
{ "content_hash": "c55deecdba1fed56a8cc413b471891cf", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 99, "avg_line_length": 49.44827586206897, "alnum_prop": 0.6687587168758717, "repo_name": "cevaris/pants", "id": "f8eff28667734188477592b93277d052b224fa77", "size": "1581", ...
from random import randint import pytest from pynq import Overlay from pynq.lib.pmod import Pmod_DevMode from pynq.lib.pmod import PMODA from pynq.lib.pmod import PMODB from pynq.lib.pmod import PMOD_SWCFG_IIC0_TOPROW from pynq.lib.pmod import PMOD_SWCFG_IIC0_BOTROW from pynq.lib.pmod import PMOD_SWCFG_DIOALL from pynq...
{ "content_hash": "27c5d972d69911fcf4e8ad22e1bfa0ca", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 76, "avg_line_length": 33.114285714285714, "alnum_prop": 0.6807592752372735, "repo_name": "cathalmccabe/PYNQ", "id": "74bb4b2c695fe4023f51a7eb431f7026ca01fe03", "size": "39...
__author__ = 'nick.york' __license__ = 'https://www.apache.org/licenses/LICENSE-2.0' __copyright__ = 'Copyright (c) 2015 Virtual Instruments Corporation. All rights reserved.' __date__ = '2015-02-22' __version__ = '1.0' import sys, os, optparse import json class Entity: def __init__(self, name, wwn): self...
{ "content_hash": "3b06159521337047ebaf063e1dde274e", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 427, "avg_line_length": 37.25, "alnum_prop": 0.6375838926174496, "repo_name": "signalpillar/tools", "id": "d204e7bbf0a747ee07fab998384f82cc408e2b54", "size": "2855", "bin...
from django.apps import AppConfig class ProposalConfig(AppConfig): name = 'proposal'
{ "content_hash": "6bdba227038e46c2cfcdf55483b78d33", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 18.2, "alnum_prop": 0.7582417582417582, "repo_name": "rg3915/orcamentos", "id": "e9ae9b6c47a581cd43c29d5f5e653e62ea3d095e", "size": "91", "binary": ...
""" run coverage after patching """ #pylint: disable=W0611,wrong-import-order import test.run.patch from coverage.cmdline import main import sys if __name__ == '__main__': sys.exit(main())
{ "content_hash": "3e728f7a96d73a1c367d92d004044521", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 41, "avg_line_length": 21.666666666666668, "alnum_prop": 0.6923076923076923, "repo_name": "davedoesdev/python-jwt", "id": "6de49ef4b3a429c85057d7eebe141f81dc6fd517", "size":...
import mock from neutron import context from neutron.tests.unit.plugins.ml2 import test_plugin from networking_odl.common import constants as const from networking_odl.ml2 import mech_driver as driver class TestODLShim(test_plugin.Ml2PluginV2TestCase): def setUp(self): super(TestODLShim, self).setUp() ...
{ "content_hash": "ddf30b813b6e8adf0f82fab28bfd2279", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 78, "avg_line_length": 46.523809523809526, "alnum_prop": 0.5186796315250768, "repo_name": "FedericoRessi/networking-odl", "id": "e2ceda56c82d31e9c52cad03a7c6491411405f1d", ...
from finance import db from finance.models.account import Account class Transaction(db.Model): """Transaction Record of the transaction """ transaction_id = db.Column(db.Integer, primary_key=True) account_debit_id = db.Column(db.Integer, db.ForeignKey('account.ac...
{ "content_hash": "f4c682b6dbe9775042416e48c7d4596c", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 72, "avg_line_length": 34.81818181818182, "alnum_prop": 0.5374860126818352, "repo_name": "reinbach/finance", "id": "1157b555f4c958ec1027c657d06bcd0c8285445b", "size": "2681...
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.create_volume, 'volume1', 'cluster=cluster1', ...
{ "content_hash": "98a0e23d1f7ebce14a18f219a127ed12", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 104, "avg_line_length": 40.92307692307692, "alnum_prop": 0.6921052631578948, "repo_name": "zstackio/zstack-woodpecker", "id": "b01ecdb8ae9721161cc965e78f2c1ae54a430f36", "s...
#!/usr/bin/env python3 # Copyright (c) 2014-2017 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Copyright (c) 2017 CEVAP ''' Script to generate list of seed nodes for chainparams.cpp. This script expect...
{ "content_hash": "624618a752554cef55e7ae44a3d95ada", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 98, "avg_line_length": 31.31654676258993, "alnum_prop": 0.5704112106593154, "repo_name": "aspaas/ion", "id": "1c3b301f1807dcfd044bd7569726ac637e4756fe", "size": "4353", ...
import asyncio import unittest from hbmqtt.mqtt.unsubscribe import UnsubscribePacket, UnubscribePayload from hbmqtt.mqtt.packet import PacketIdVariableHeader from hbmqtt.adapters import BufferReader class UnsubscribePacketTest(unittest.TestCase): def setUp(self): self.loop = asyncio.new_event_loop() ...
{ "content_hash": "b0efa7603101ccfae6c5cafbff265105", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 85, "avg_line_length": 38.8, "alnum_prop": 0.7051546391752578, "repo_name": "beerfactory/hbmqtt", "id": "fc97c022c3ae08dd54650e858b52dd78816668f4", "size": "1060", "binar...
import pytest import copy from blitzdb import Document import six @pytest.fixture(scope="function") def mockup_backend(): class Backend(object): def __init__(self): self.attributes = {'foo': 'bar', 'baz': 123} def get(self, DocumentClass, pk): return DocumentClass(copy...
{ "content_hash": "29dcfa310f9f63d5aa040987f878e70b", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 82, "avg_line_length": 20.6318407960199, "alnum_prop": 0.5760790933204726, "repo_name": "kylewm/blitzdb", "id": "5ef1a4e1bed4868fa43e957be80bad8a4a660ee6", "size": "4147",...
from __future__ import absolute_import import unittest import doctest import os import r5d4 from r5d4 import app from r5d4.analytics_worker import start_analytics_worker from r5d4.analytics_manager import AnalyticsManager from r5d4.test_settings import REDIS_UNIX_SOCKET_PATH, REDIS_HOST, \ REDIS_PORT, CONFIG_DB d...
{ "content_hash": "9d28aa625ac20a1b58d2c52a98fe603e", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 69, "avg_line_length": 31.352941176470587, "alnum_prop": 0.683552220137586, "repo_name": "practo/r5d4", "id": "325bb4ab3a4edf9aef8ec7847365bca55ce40930", "size": "1621", ...
import subprocess import os import json import sys def bctest(testDir, testObj, exeext): execprog = testObj['exec'] + exeext execargs = testObj['args'] execrun = [execprog] + execargs stdinCfg = None inputData = None if "input" in testObj: filename = testDir + "/" + testObj['input'] inputData = open(filenam...
{ "content_hash": "953e4fdcb7eabc16406545a5d727a7ad", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 121, "avg_line_length": 26.08, "alnum_prop": 0.7085889570552147, "repo_name": "duality-solutions/Sequence", "id": "aed79d6ab34b213a5ec7fed3ca4cd1d9d97d75b3", "size": "1646"...
import random import numpy as np import torch from torchvision import transforms as T from torchvision.transforms import functional as F def pad_if_smaller(img, size, fill=0): min_size = min(img.size) if min_size < size: ow, oh = img.size padh = size - oh if oh < size else 0 padw = si...
{ "content_hash": "1ace1afb37416255654c72ed87af1369", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 82, "avg_line_length": 26.99, "alnum_prop": 0.6005928121526491, "repo_name": "pytorch/vision", "id": "518048db2faef36297c4a47c700d7235434fcc0b", "size": "2699", "binary"...
from . import gxapi_cy from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref ### endblock ClassImports ### block Header # NOTICE: The code generator will not replace the code in this block ### endblock Header ### block ClassImplementation # NOTICE: Do not edit anything here, it is generated code class GX...
{ "content_hash": "20c5455c9a818f05157d19e97464fbe1", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 413, "avg_line_length": 33.99233716475096, "alnum_prop": 0.5962578899909828, "repo_name": "GeosoftInc/gxpy", "id": "3a1c65833b4a75c1f66a1eccfe14381ab4800d92", "size": "898...
from ._storage_management_client import StorageManagementClient __all__ = ['StorageManagementClient'] try: from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass from ._version import VERSION __version__ = VERSION
{ "content_hash": "28a26bd32140bc64f2b83ccd8636128f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 63, "avg_line_length": 21.416666666666668, "alnum_prop": 0.7198443579766537, "repo_name": "Azure/azure-sdk-for-python", "id": "f6821446dc1aae8b9079cc67e0479e132abc506b", "s...
"""Layout for columns.""" from math import floor, inf from .absolute import absolute_layout from .percent import resolve_percentages def columns_layout(context, box, bottom_space, skip_stack, containing_block, page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins): ...
{ "content_hash": "83ff2cd94ba587a61321e04f14226267", "timestamp": "", "source": "github", "line_count": 409, "max_line_length": 79, "avg_line_length": 41.603911980440095, "alnum_prop": 0.5619417019275975, "repo_name": "Kozea/WeasyPrint", "id": "deb7e17f5bc0076ace3a393d12cd1a8cd57591cb", "size": "17...