text
stringlengths
4
1.02M
meta
dict
import os import shutil import addSubproject import option import utility import grapeGit as git import grapeConfig import grapeMenu import checkout # update your custom sparse checkout view class UpdateView(option.Option): """ grape uv - Updates your active submodules and ensures you are on a consistent ...
{ "content_hash": "e1295e1479ef3c61b8e98fed394a1cdb", "timestamp": "", "source": "github", "line_count": 416, "max_line_length": 172, "avg_line_length": 48.75961538461539, "alnum_prop": 0.5505817393019128, "repo_name": "robinson96/GRAPE", "id": "1a8b79a1646af2489018f8d276e2951d30a40f21", "size": "20...
""" This package is dedicated to AXI Load/Store Units (LSU) a others like. Other LSU implementations: * https://github.com/riscv-boom/riscv-boom - has RISC-V LSU in chisel3, read kill, MSHRs * https://github.com/rsd-devel/rsd - has N issue RISC-V LSU * https://github.com/bluespec/Toooba - has RISC-V LSU in BlueSpecVe...
{ "content_hash": "8a7467554a9ba9b958a48848db9d0166", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 88, "avg_line_length": 41, "alnum_prop": 0.7390243902439024, "repo_name": "Nic30/hwtLib", "id": "119f325211db9b4a3a85180561aa7eb5609cfd61", "size": "410", "binary": false...
''' Some simple tests to check that the framework is properly wrapped. ''' import objc import unittest import QuickLookUI class TestQuickLookUI (unittest.TestCase): def testClasses(self): pass # self.assert_( hasattr(QuickLookUI, 'CLASSNAME') ) # self.assert_( isinstance(QuickLookUI.CLASSNA...
{ "content_hash": "7c608bb64651cc82328e40f67282042c", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 92, "avg_line_length": 32.89333333333333, "alnum_prop": 0.6331576813944062, "repo_name": "albertz/music-player", "id": "09c557b9e14581ed336004686ba0e16785df1bdc", "size": "...
import os import numpy as np from tqdm import tqdm import jsonlines DOC_STRIDE = 2048 MAX_LENGTH = 4096 SEED = 42 PROCESS_TRAIN = os.environ.pop("PROCESS_TRAIN", "false") CATEGORY_MAPPING = {"null": 0, "short": 1, "long": 2, "yes": 3, "no": 4} def _get_single_answer(example): def choose_first(answer, is_long_...
{ "content_hash": "55467e92b9eb7441ac2a5ff0f8ec40c0", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 106, "avg_line_length": 34.28484848484848, "alnum_prop": 0.5319073713982676, "repo_name": "huggingface/transformers", "id": "8d2f69031e2ab4c98e780eda85983466b17b23c3", "si...
__author__ = 'Sean Lip' import test_utils class ReaderTest(test_utils.AppEngineTestBase): def testReaderPage(self): """Test the reader exploration page.""" # TODO(sll): Write tests here. pass
{ "content_hash": "74c1dd62f52bfc92cc9b83c3da119348", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 47, "avg_line_length": 20.363636363636363, "alnum_prop": 0.6383928571428571, "repo_name": "sunu/oppia-test-2", "id": "e5e47ff41f5f77c482cb7d83b902b60f4633e50b", "size": "82...
try: # Python 2.x from UserDict import UserDict except ImportError: # Python 3.x from collections import UserDict import pickle from axelrod import Player class DeterministicCache(UserDict): """A class to cache the results of deterministic matches For fixed length matches with no noise betwe...
{ "content_hash": "cee1c025348fc7ae2dbe71b8d303e7d2", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 112, "avg_line_length": 29.62162162162162, "alnum_prop": 0.583257299270073, "repo_name": "ranjinidas/Axelrod", "id": "20c3729962027f29db7cf074e8342adfed76f164", "size": "4...
from google.cloud import dialogflowcx_v3 def sample_validate_flow(): # Create a client client = dialogflowcx_v3.FlowsClient() # Initialize request argument(s) request = dialogflowcx_v3.ValidateFlowRequest( name="name_value", ) # Make the request response = client.validate_flow(re...
{ "content_hash": "7c5d3e351c2e0b96cc44429e8f475bcc", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 55, "avg_line_length": 23.105263157894736, "alnum_prop": 0.7015945330296127, "repo_name": "googleapis/python-dialogflow-cx", "id": "09835241e698e550e0e2c98c9699485ad506b0e6",...
class Error(Exception): """Base Cu2Qu exception class for all other errors.""" class ApproxNotFoundError(Error): def __init__(self, curve): message = "no approximation found: %s" % curve super().__init__(message) self.curve = curve class UnequalZipLengthsError(Error): pass clas...
{ "content_hash": "c46875c6250fbdeec64f5cd71ff7cb41", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 86, "avg_line_length": 29.725806451612904, "alnum_prop": 0.5794899620184482, "repo_name": "googlefonts/fonttools", "id": "74c4c2271aa4a4c8155c01cf9d196161588e76ba", "size":...
""" Filter support """ from nova import loadables class BaseFilter(object): """Base class for all filter classes.""" def _filter_one(self, obj, filter_properties): """Return True if it passes the filter, False otherwise. Override this in a subclass. """ return True def fi...
{ "content_hash": "15bf847027925cae8fb64e3d9fc58223", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 69, "avg_line_length": 30.05263157894737, "alnum_prop": 0.6401050788091068, "repo_name": "yrobla/nova", "id": "59028a542facdd04767c3bd0a415f85bbf83d387", "size": "1787", ...
""" Example: @route(r'/', name='index') class IndexHandler(tornado.web.RequestHandler): pass class Application(tornado.web.Application): def __init__(self): handlers = [ # ... ] + Route.routes() """ import logging from tornado.web import url c...
{ "content_hash": "d28d875bcf2e664b54c27336157dfe53", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 114, "avg_line_length": 29.24, "alnum_prop": 0.585499316005472, "repo_name": "knownsec/workin", "id": "c0008f91d4320bc1944b6dbc1ca4a71952ca185f", "size": "1502", "binary"...
from __future__ import unicode_literals, division, absolute_import import os from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.utils import json try: from flexget.plugins.api_tvdb import lookup_series except ImportError: raise plugin.DependencyError(issued...
{ "content_hash": "5630c1ec97aa5e858a319146296d6c27", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 99, "avg_line_length": 41.89655172413793, "alnum_prop": 0.46139917695473254, "repo_name": "antivirtel/Flexget", "id": "82248978c251031b73f1e61041f48c54a4c967a5", "size": "...
"""Routines for IPv4 and IPv6 addresses, subnets and ranges.""" import sys as _sys import re as _re from netaddr.core import AddrFormatError, AddrConversionError, num_bits, \ DictDotLookup, NOHOST, N, INET_PTON, P, ZEROFILL, Z from netaddr.strategy import ipv4 as _ipv4, ipv6 as _ipv6 from netaddr.compat import ...
{ "content_hash": "284a66d57934ccef453974be04e02ead", "timestamp": "", "source": "github", "line_count": 2041, "max_line_length": 87, "avg_line_length": 34.580107790298875, "alnum_prop": 0.5416560401258182, "repo_name": "JeyZeta/Dangerous", "id": "6fe5102d6989e0d87d10784bd634e97587e1d190", "size": "...
import time import saharaclient.api.base as sab from sahara.openstack.common import timeutils from sahara.tests.integration.tests import base from sahara.tests.integration.tests import edp from sahara.utils import edp as utils_edp class TransientClusterTest(edp.EDPTest): @base.skip_test( 'SKIP_TRANSIENT...
{ "content_hash": "b5b62a393cff85c3a149c5b7d696265c", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 79, "avg_line_length": 40.98837209302326, "alnum_prop": 0.516595744680851, "repo_name": "tellesnobrega/storm_plugin", "id": "45970956e7013970568db1c7cf98e15dd98e3f41", "siz...
from amazon_api_manger import AmazonAPIManger from product import Product class ProductSearcher(object): MAX_RESULTS = 10 def __init__(self, config): self.api = AmazonAPIManger(config).get_api() def search(self, product_group, keyword, browse_node=None): """ :param product_group:...
{ "content_hash": "825e59507042a83c12db7e16eccf5558", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 115, "avg_line_length": 39.43478260869565, "alnum_prop": 0.45755237045203967, "repo_name": "netarachelhershko/amazon_aotumation", "id": "e25f6bc1bba89a7901475a7681032c92fb02b...
import os from swift import __version__ import subprocess import sys import warnings # TODO(Graham Hayes): Remove the following block of code when os-api-ref is # using openstackdocstheme import os_api_ref if getattr(os_api_ref, 'THEME', 'olsosphinx') == 'openstackdocstheme': # We are on the new version with ope...
{ "content_hash": "875008398be9579eef1d0fd5e4f78a70", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 79, "avg_line_length": 31.69683257918552, "alnum_prop": 0.6882226980728051, "repo_name": "prashanthpai/swift", "id": "3ec1303ce518958d6ac342ce9f77aceba1f6ac59", "size": "7...
""" @package mi.dataset.parser.optaa_dj_cspp @file marine-integrations/mi/dataset/parser/optaa_dj_cspp.py @author Joe Padula @brief Parser for the optaa_dj_cspp dataset driver. This parser extends CsppParser located in cspp_base.py. Release notes: Initial Release """ import numpy import re from mi.core.common im...
{ "content_hash": "a79318dbf21957cb4e9596ead441799c", "timestamp": "", "source": "github", "line_count": 373, "max_line_length": 114, "avg_line_length": 39.77479892761394, "alnum_prop": 0.6357508762469668, "repo_name": "vipullakhani/mi-instrument", "id": "7427186dbad6a5af81c248cd138b9edf3ef07335", "...
from django.contrib.admin.utils import quote from django.core import checks from django.db.models import ForeignKey from django.urls import reverse from django.utils.module_loading import import_string from wagtail.admin.checks import check_panels_in_model from wagtail.admin.forms.models import register_form_field_ove...
{ "content_hash": "af90dae935144ce18172a46ecd335813", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 91, "avg_line_length": 33.528169014084504, "alnum_prop": 0.7015332913253518, "repo_name": "rsalmaso/wagtail", "id": "2c990026d9e1073e11266e706a8caa96c6acfaf3", "size": "47...
''' Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram. Above is a histogram where width of each bar is 1, given height = [2,1,5,6,2,3]. The largest rectangle is shown in the shaded area, which has area = 10 uni...
{ "content_hash": "3058d102e15163be8aaace418c4a7999", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 156, "avg_line_length": 24.487179487179485, "alnum_prop": 0.5455497382198953, "repo_name": "weixsong/algorithm", "id": "d1e6094f77e88f4468e2720112abd5c15706d274", "size": "...
import unittest from circleci.error import CircleCIException, BadKeyError, BadVerbError, InvalidFilterError class TestCircleCIError(unittest.TestCase): def setUp(self): self.base = CircleCIException('fake') self.key = BadKeyError('fake') self.verb = BadVerbError('fake') self.filt...
{ "content_hash": "d1d8c381cd2f7615d9b14044f498308e", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 91, "avg_line_length": 33.17857142857143, "alnum_prop": 0.667384284176534, "repo_name": "levlaz/circleci.py", "id": "5b0f90be160bb99b70864905a7da1059571b0537", "size": "951...
import copy import stevedore from glance.common import location_strategy from glance.common.location_strategy import location_order from glance.common.location_strategy import store_type from glance.tests.unit import base class TestLocationStrategy(base.IsolatedUnitTest): """Test routines in glance.common.locat...
{ "content_hash": "ea0d013210727770473940c34d47cb1f", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 79, "avg_line_length": 46.411764705882355, "alnum_prop": 0.5982256020278834, "repo_name": "rajalokan/glance", "id": "bef1a9f9237748414575292fb09616689159d674", "size": "85...
from django.conf.urls import url, include from .views import empty_view urlpatterns = [ url(r'^$', empty_view, name="named-url3"), url(r'^extra/(?P<extra>\w+)/$', empty_view, name="named-url4"), url(r'^(?P<one>\d+)|(?P<two>\d+)/$', empty_view), url(r'^included/', include('urlpatterns_reverse.included...
{ "content_hash": "e299da7ea8193d0051da4c9a09bfade5", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 76, "avg_line_length": 30.818181818181817, "alnum_prop": 0.6224188790560472, "repo_name": "liavkoren/djangoDev", "id": "d8a6a1648145a30afe9e41361c0a713016011828", "size": "...
"""TELNET client class. Based on RFC 854: TELNET Protocol Specification, by J. Postel and J. Reynolds Example: >>> from telnetlib import Telnet >>> tn = Telnet('www.python.org', 79) # connect to finger port >>> tn.write('guido\r\n') >>> print tn.read_all() Login Name TTY Idle When ...
{ "content_hash": "db1506acee290b8e6210065029cf155d", "timestamp": "", "source": "github", "line_count": 662, "max_line_length": 87, "avg_line_length": 32.720543806646525, "alnum_prop": 0.5582383084806796, "repo_name": "neopoly/rubyfox-server", "id": "812bceabb5bad87af31a47ad577f8ec492a4f696", "size...
from contextlib import contextmanager import jinja2 import unittest from nereid.sessions import Session from nereid.contrib.locale import Babel from werkzeug.contrib.sessions import FilesystemSessionStore from nereid import Nereid, current_app from flask.globals import _request_ctx_stack class NereidTestApp(Nereid)...
{ "content_hash": "9354ab1ee55ffdf5ef3172886dd6f2f2", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 79, "avg_line_length": 30.09433962264151, "alnum_prop": 0.6470219435736677, "repo_name": "prakashpp/nereid", "id": "d227c76c41a7bc38530a550fcf0b350c7fc169a9", "size": "334...
''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use sendgrid to send emails - Use MEMCACHIER on Heroku ''' from __future__ import absolute_import, unicode_literals from boto.s3.connection import OrdinaryCallingFormat from django.utils import six from ...
{ "content_hash": "893408be718251aee6c65e83b91e1c94", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 101, "avg_line_length": 37.99236641221374, "alnum_prop": 0.637532650190878, "repo_name": "adandan01/contmon", "id": "f37f52d078ae908589fd3e512a40cbacee31dacf", "size": "50...
""" Utility script used to set metadata on a collection after an upload. Expects metadata in json format as in the adjoining metadata.json file. The format for an individual subject looks like the following, and dates should be formatted as YYYY-MM-DD. "023": { "DOB": "2013-01-04", "scans": [ ["02mon...
{ "content_hash": "7287dfb4a785edc368e5932bc0fe02b4", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 93, "avg_line_length": 33.74657534246575, "alnum_prop": 0.5317637507611123, "repo_name": "girder/monkeybrains", "id": "efcf0b8125a46087d974a5ff2958796073840f6a", "size": "...
from _common import * from _common import _Generator, _Reshaper _truths = ['nprongs'] truths = {_truths[x]:x for x in xrange(len(_truths))} def make_coll(fpath, label=-1): coll = obj.GenCollection(label=label) coll.add_categories(['singletons'], fpath) return coll class Generator(_Generator): def __...
{ "content_hash": "7e0cabd4f29b96cc0563d032951a5f5f", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 86, "avg_line_length": 36.171052631578945, "alnum_prop": 0.4823572208075664, "repo_name": "sidnarayanan/BAdNet", "id": "aad05f94507c1da3c1a850319cfbcc4e5c6c3b1d", "size": "...
"""Built-in instance properties.""" import re from nova import context from nova import db from nova import exception from nova import flags from nova.openstack.common import log as logging from nova import utils FLAGS = flags.FLAGS LOG = logging.getLogger(__name__) INVALID_NAME_REGEX = re.compile("[^\w\.\- ]") d...
{ "content_hash": "24c41494876bba1c87d87628cf3a634b", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 76, "avg_line_length": 30.37125748502994, "alnum_prop": 0.6561514195583596, "repo_name": "usc-isi/nova", "id": "eb8ac706d0c11ec199a21f60454866d70165dc79", "size": "5919", ...
import autocomplete_light from models import City autocomplete_light.register(City, search_fields=("city",))
{ "content_hash": "58993760acd7308876e6820403b64734", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 58, "avg_line_length": 18.666666666666668, "alnum_prop": 0.7857142857142857, "repo_name": "Visgean/django-autocomplete-light", "id": "cf65b5850d5dbeb425edee82d1aa76e190f8b213"...
from celebrerclient.common import utils def Client(version, *args, **kwargs): module = utils.import_versioned_module(version, 'client') client_class = getattr(module, 'Client') return client_class(*args, **kwargs)
{ "content_hash": "95435cb49b12fa8ac9490207e8c3a938", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 61, "avg_line_length": 32.57142857142857, "alnum_prop": 0.7149122807017544, "repo_name": "Mirantis/python-celebrerclient", "id": "23034f65310275ef3d1d75e12b0b364b4dc29880", ...
from __future__ import absolute_import, unicode_literals import collections import contextlib import logging import operator from mopidy import compat, exceptions, models from mopidy.compat import urllib from mopidy.internal import deprecation, validation logger = logging.getLogger(__name__) @contextlib.contextma...
{ "content_hash": "8d192547cb04fa7ae8c1f0a917598230", "timestamp": "", "source": "github", "line_count": 375, "max_line_length": 79, "avg_line_length": 37.432, "alnum_prop": 0.5872337394030064, "repo_name": "quartz55/mopidy", "id": "30064e5af9be7c9c7146576828d8316051ed6f15", "size": "14037", "bina...
""" WSGI config for test_project 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/3.0/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_...
{ "content_hash": "33c6638941e7f3e50e336076da6caef6", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.0625, "alnum_prop": 0.770573566084788, "repo_name": "anx-hnezbeda/anexia-monitoring-django", "id": "4fd53dc0201d9c919a397aa3ada1f6f13d3ca9aa", "si...
import inspect import os import traceback import logging import socket import sys from datetime import datetime import subprocess try: import json except ImportError: import simplejson as json class LogstashFormatterBase(logging.Formatter): def __init__(self, server_type=None, module=None, tags=None, fqd...
{ "content_hash": "a46850d239475268f47f5ec5e9001145", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 106, "avg_line_length": 34.02304147465438, "alnum_prop": 0.5755113097656779, "repo_name": "stopmachine/python-logstash", "id": "e61d35b4d031d3184b4183975e6bffe990198f92", ...
from __future__ import unicode_literals from collections import namedtuple from janome.tokenizer import Tokenizer _TOKENIZER = Tokenizer() def tokenize(text): ''' ユニコード文字列を形態素に分解する ''' return [token.surface for token in _TOKENIZER.tokenize(text)] class Trove(namedtuple('Trove', ...
{ "content_hash": "035ea54edafb98e3adb470e990d14747", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 65, "avg_line_length": 24.746835443037973, "alnum_prop": 0.5652173913043478, "repo_name": "momijiame/jpgrep", "id": "be7b04b0c745fbafd8b64d698722a7b8318d8f23", "size": "239...
import sys if sys.version_info[0] == 2: from ConfigParser import RawConfigParser if sys.version_info[0] >= 3: from configparser import RawConfigParser import json import requests # read configuration file config_file_name = "usermanagement.config" config = RawConfigParser() config.read(config_file_name) # s...
{ "content_hash": "c9be0e068fa6842833ad85df4f94eb49", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 22.753846153846155, "alnum_prop": 0.665314401622718, "repo_name": "adobe-apiplatform/umapi-documentation", "id": "544ac5565458a54e20f2d0cf803ef96cc396a...
from __future__ import print_function, division import json from glob import glob import fitsio import numpy as np import matplotlib as mpl mpl.use('Agg') from matplotlib import pyplot as plt from matplotlib import gridspec from matplotlib.ticker import NullLocator from .extern import ADR, Hyper_PSF3D_PL from .main ...
{ "content_hash": "36fb1b7363b5d2ff0442fa46da84f701", "timestamp": "", "source": "github", "line_count": 451, "max_line_length": 79, "avg_line_length": 36.59423503325942, "alnum_prop": 0.5569558894813379, "repo_name": "kbarbary/cubefit", "id": "b3505b61d1d20becffbc3d75d7eac4db9b18df93", "size": "165...
"""VMRC console drivers.""" import base64 import json from nova import exception from nova import flags from nova import log as logging from nova.virt.vmwareapi import vim_util FLAGS = flags.FLAGS flags.DEFINE_integer('console_vmrc_port', 443, "port for VMware VMRC connecti...
{ "content_hash": "594dd3a10051eeb2861537fe95aea4e7", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 79, "avg_line_length": 31.121951219512194, "alnum_prop": 0.5634796238244514, "repo_name": "termie/nova-migration-demo", "id": "cc8b0cdf57916b0f6e912f96227964c73c23dafe", "...
import matplotlib.pyplot as plt import numpy as np from scipy import stats npoints = 20 # number of integer support points of the distribution minus 1 npointsh = npoints / 2 npointsf = float(npoints) nbound = 4 # bounds for the truncated normal normbound = (1 + 1 / npointsf) * nbound # actual bounds of truncated no...
{ "content_hash": "d1f555435c5da0fb44e0c62ad5a07b8b", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 81, "avg_line_length": 34.79545454545455, "alnum_prop": 0.6949706074461136, "repo_name": "DailyActie/Surrogate-Model", "id": "b442409fccbe4d0e6a57f833addd6c1408ca6dd8", "si...
import argparse from log.dagda_logger import DagdaLogger class CheckCLIParser: # -- Public methods # CheckDockerCLIParser Constructor def __init__(self): super(CheckCLIParser, self).__init__() self.parser = DagdaCheckParser(prog='dagda.py check', usage=check_parser_text) self.par...
{ "content_hash": "8408c50c1416657a06b7327f19e9bf28", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 101, "avg_line_length": 28.63013698630137, "alnum_prop": 0.6196172248803827, "repo_name": "eliasgranderubio/dagda", "id": "64ee5f3cbae1511c08de88779ef2e0f1703e9dc5", "size"...
import copy from oslo_config import cfg from oslo_config import fixture as config_fixture from neutron_lib.api.definitions import portbindings from neutron_lib.plugins.ml2 import api from neutron.tests import base NETWORK_ID = "fake_network" PORT_ID = "fake_port" class FakeNetworkContext(api.NetworkContext): ...
{ "content_hash": "1c61079335eb3aba48d76ea52d060485", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 76, "avg_line_length": 34.04456824512535, "alnum_prop": 0.5659466535755195, "repo_name": "openstack/neutron", "id": "c2b2989f14ebeb16b4aed04dfcd7f98746830465", "size": "12...
""" Django settings for bugbug project. """ import os PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS # Hosts/domain names that are valid for this site; required if DEBUG is False # See https:...
{ "content_hash": "c9056e726b59dea5f4160c2eb8ec339c", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 100, "avg_line_length": 31.042105263157893, "alnum_prop": 0.6968463886063072, "repo_name": "ColCarroll/bugbug", "id": "61bd010e9c6a0ff21621788466bc1867b65a04dc", "size": "...
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from pants.option.ranked_value import RankedValue class OptionValueContainer(object): """A container for option values. Implements the following functionality: ...
{ "content_hash": "09d8bfea4a5b02f442d5094656556211", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 99, "avg_line_length": 40.7, "alnum_prop": 0.7002457002457002, "repo_name": "Ervii/garage-time", "id": "117e0ccd181fe055ac6c67230ed8830d16f7624f", "size": "4217", "binar...
""" filename: committees_response.py description: Responses for committees module. created by: Omar De La Hoz (oed7416@rit.edu) created on: 10/12/17 """ class Response(): ComDoesntExist = {'error': "Committee doesn't exist."} AddSuccess = {'success': 'Committee succesfully created.'} AddError = {"error": "Committee...
{ "content_hash": "bc6ab80a3affb37b0be191132149c921", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 67, "avg_line_length": 37.75, "alnum_prop": 0.7135761589403974, "repo_name": "ritstudentgovernment/chargeflask", "id": "3fcbd6b9029faa6a32462f87dc32c5cbad65dea2", "size": "...
import argparse from os import system ### args parsing parser = argparse.ArgumentParser(description='runs TF/IDF on a directory of text docs') parser.add_argument("-i","--input", help="the input in HDFS", required=True) parser.add_argument("-o", '--output', help="the output in HDFS", required=True ) parser.add_argum...
{ "content_hash": "6eb73b25331409e298134da416c959ec", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 87, "avg_line_length": 28.742857142857144, "alnum_prop": 0.7335984095427436, "repo_name": "project-asap/IReS-Platform", "id": "3a32a874896017869dbd26eaebf114525fe543ad", "s...
from pandac.PandaModules import Point3, VBase3 from toontown.suit.DistributedSellbotBoss import DistributedSellbotBoss from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from toontown.chat import ChatGlobals from toontown.coghq import CogDisguiseGlobals from toontown.suit import Su...
{ "content_hash": "86228ded00234181b10a2ab4874b01b5", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 123, "avg_line_length": 51.35748792270532, "alnum_prop": 0.6450945348509077, "repo_name": "Spiderlover/Toontown", "id": "0de7aa7b5b3f4c53b6affd54807519a651b6f3dd", "size":...
from ansible.module_utils.basic import * class UFWForwards(object): def __init__(self, data, ipv6): self.ufw_chain = "ufw6" if ipv6 else 'ufw' self.nat_rules = [] self.filter_rules = [] self.reroute_data = [] self.port_forward_data = [] args = [ ...
{ "content_hash": "ef5915bdddbf4ede33c6b3ee3304fd01", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 94, "avg_line_length": 32.736559139784944, "alnum_prop": 0.5005748070290688, "repo_name": "EggieCode/ansible-role-ufw", "id": "31adb990bbed879603a2d1017288aa2e1b8a712f", "...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os import sas import sas_testcase from sas_test_harness import SasTestHarnessServer, generateCbsdRecords, generatePpaRecords from util import winnforum_testcase, configurable_testcase, writeC...
{ "content_hash": "c1f8f1c230624212f8ac088bcf58c976", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 97, "avg_line_length": 40.0132625994695, "alnum_prop": 0.6413655949618826, "repo_name": "Wireless-Innovation-Forum/Spectrum-Access-System", "id": "230422ed769abeb1a46f6f185e...
import account_journal import account_partner_ledger
{ "content_hash": "bdc3680c951da71ad7413dc65cc61eb6", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 29, "avg_line_length": 26.5, "alnum_prop": 0.8679245283018868, "repo_name": "vileopratama/vitech", "id": "e424cac8b5da3aaa346b95c3e9f9818a94286688", "size": "153", "binary...
"""Test Home Assistant package util methods.""" import os import pkg_resources import unittest from subprocess import PIPE from distutils.sysconfig import get_python_lib from unittest.mock import call, patch, Mock import homeassistant.util.package as package RESOURCE_DIR = os.path.abspath( os.path.join(os.path.d...
{ "content_hash": "034ef5ae531b0c73bd63dc7c31e6f3b6", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 78, "avg_line_length": 36.58156028368794, "alnum_prop": 0.6421093447072509, "repo_name": "JshWright/home-assistant", "id": "e0682d79f57be2a30ad3e1bfb5ffbc2e75d5eb9d", "siz...
from django.http import HttpRequest, HttpResponse from zerver.decorator import webhook_view from zerver.lib.exceptions import UnsupportedWebhookEventType from zerver.lib.request import REQ, has_request_variables from zerver.lib.response import json_success from zerver.lib.validator import WildValue, check_string, to_w...
{ "content_hash": "f766c5a9ffa9ac40b51deb7d11250c67", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 100, "avg_line_length": 39.16981132075472, "alnum_prop": 0.7025529865125241, "repo_name": "andersk/zulip", "id": "c9ec8d8fcc9319a9fb028298263f606240377159", "size": "4152"...
"""Test that files marked as 'streamable' when 'streaming_allowed' can be named pipes.""" import os from pathlib import Path from typing import cast import pytest from ruamel.yaml.comments import CommentedMap from schema_salad.sourceline import cmap from cwltool.command_line_tool import CommandLineTool from cwltool.c...
{ "content_hash": "f888f718d04dfea17636f3b3d307da29", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 97, "avg_line_length": 25.23148148148148, "alnum_prop": 0.6055045871559633, "repo_name": "common-workflow-language/cwltool", "id": "3c5526592dc6da96bc3521f92d3cf06804d65b41"...
import os COV = None if os.environ.get('FLASK_COVERAGE'): import coverage COV = coverage.coverage(branch=True, include='app/*') COV.start() if os.path.exists('.env'): print("从 .env 导入环境变量") for line in open('.env'): var = line.strip().split('=') if len(var) == 2: os.envi...
{ "content_hash": "a4aa408a6ec4d2f2275fcd00acfcf220", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 74, "avg_line_length": 29.35, "alnum_prop": 0.6482112436115843, "repo_name": "hellckt/micblog", "id": "10c01863c387da510980886629ddb45c6748b14b", "size": "2406", "binary"...
from itertools import product import numpy as np ## Import unit testing librarys try: import unittest2 as unittest except ImportError: import unittest def prod_to_array(*iterables): return np.array(list(product(*iterables)))
{ "content_hash": "6d411e9f571b89cbc597f19d7d696661", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 46, "avg_line_length": 18.53846153846154, "alnum_prop": 0.7510373443983402, "repo_name": "darothen/pyrcel", "id": "86a68a1c72c7ce37f39412e714d63c095e2fd708", "size": "241",...
from stevedore import extension from heat.engine import clients from heat.engine import environment from heat.engine import plugin_manager def _register_resources(env, type_pairs): for res_name, res_class in type_pairs: env.register_class(res_name, res_class) def _register_constraints(env, type_pairs):...
{ "content_hash": "67a3bf97ad08e3f155aa648558fb5f1f", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 79, "avg_line_length": 30.613333333333333, "alnum_prop": 0.688588850174216, "repo_name": "redhat-openstack/heat", "id": "a5d7fadbbe7d516848e9bb887dd47988a21abfcc", "size": ...
"""Tests for doc generator traversal.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys from tensorflow.python.platform import googletest from tensorflow.tools.docs import generate_lib from tensorflow.tools.docs import parser def te...
{ "content_hash": "7f15ad274075b31e08f58b2fbb348417", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 79, "avg_line_length": 31.733050847457626, "alnum_prop": 0.6226465482707971, "repo_name": "chemelnucfin/tensorflow", "id": "863504913e55b9758fc28b51b72d957a2d8a4ece", "siz...
from string import ascii_lowercase, ascii_uppercase, digits natural = digits[1:] + '0' # next line might error out if destination file does not exist with open('../lists/abc.wl', 'r+') as file: for a in range(3, len(ascii_lowercase) + 1): for b in range(len(ascii_lowercase)): if len(ascii_low...
{ "content_hash": "ee57631c82ffc79f9a46fb46acae0345", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 63, "avg_line_length": 44.55555555555556, "alnum_prop": 0.543142144638404, "repo_name": "Videonauth/passgen", "id": "8bc355cb52f86eecfde2cddcc818f2bcd7b5bbc7", "size": "247...
import base64 import time import logging from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.common.exceptions import NoSuchElementException from PIL import Image from io import StringIO, BytesIO from synchronize_util import synchronized, CONSOLE_L...
{ "content_hash": "44d6cc028bf957eea64900bc42f4cf75", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 107, "avg_line_length": 32.034246575342465, "alnum_prop": 0.6369467607440668, "repo_name": "KeithYue/weibo-keywords-crawler", "id": "321a849775e824655942ecde437bbf281050052a...
""" Volume manager manages creating, attaching, detaching, and persistent storage. Persistent storage volumes keep their state independent of instances. You can attach to an instance, terminate the instance, spawn a new instance (even one from a different image) and re-attach the volume with the same data intact. **...
{ "content_hash": "8b6279a12fcdf39d089b9545e9342e7e", "timestamp": "", "source": "github", "line_count": 373, "max_line_length": 80, "avg_line_length": 44.31903485254692, "alnum_prop": 0.555259814893231, "repo_name": "nash-x/hws", "id": "34231a8df0ee53f1251d04484d986a4c2912102e", "size": "17307", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('program', '0005_programusers_is_reg_complete'), ] operations = [ migrations.AddField( model_name='programusers', name='is_pr...
{ "content_hash": "fd4ebf3fd5c90683c431bfcd580e1e17", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 57, "avg_line_length": 22.666666666666668, "alnum_prop": 0.6127450980392157, "repo_name": "airportmarc/the416life", "id": "a7527916d39950ee872e7888aee6cdec272949d6", "size"...
""" HTTP agent logic ~~~~~~~~~~~~~~~~ :author: Sam Gammon <sg@samgammon.com> :copyright: (c) Sam Gammon, 2014 :license: This software makes use of the MIT Open Source License. A copy of this license is included as ``LICENSE.md`` in the root of the project. """ # canteen core & util...
{ "content_hash": "713dc70aa15338f8e88c1beb2c0b1225", "timestamp": "", "source": "github", "line_count": 447, "max_line_length": 80, "avg_line_length": 34.588366890380314, "alnum_prop": 0.6262208136601772, "repo_name": "momentum/canteen", "id": "389c6619177dac0abcad2865f4ce37c8afbf76c9", "size": "15...
from django.db import models # Create your models here. class Pages(models.Model): name = models.CharField(max_length=32) page = models.TextField()
{ "content_hash": "8c2c9768f7e5b7d93072c9b19c88e6b3", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 42, "avg_line_length": 22.571428571428573, "alnum_prop": 0.7215189873417721, "repo_name": "CursosWeb/X-Serv-15.5-Django-CMS", "id": "938ff31af4669c10d3388fb86ba14e72181e41b5",...
from flask import Flask, render_template import pymongo from game import Game import thread app = Flask(__name__) mongo = pymongo.MongoClient() db = mongo['Conway'] @app.route("/") def hello(): return render_template("helloworld.html") @app.route("/test") def test(): return render_template("helloworld.html"...
{ "content_hash": "05f009af61a905902dc7efff49eed2a0", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 45, "avg_line_length": 20, "alnum_prop": 0.658, "repo_name": "nguyenml/PracticePython", "id": "6fbed58751e530cca9dd6c93f30817df94ef1a1c", "size": "500", "binary": false, ...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('submissions', '0004_submission_slug'), ('submissions', '0005_auto_20191102_2010'), ] operations = [ ]
{ "content_hash": "62e66eaee07271b323f647033f30ef3c", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 51, "avg_line_length": 19.083333333333332, "alnum_prop": 0.6244541484716157, "repo_name": "patrick91/pycon", "id": "d39b6ff6d7293d0e283612816683930aad70810b", "size": "278"...
""" The MIT License (MIT) Copyright (c) 2017 LeanIX GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, ...
{ "content_hash": "159865256218270ac2e692b6663a7965", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 105, "avg_line_length": 39.68888888888889, "alnum_prop": 0.7105263157894737, "repo_name": "leanix/leanix-sdk-python", "id": "7bb8b9367b977085381cb9e997a06c8fc453974c", "siz...
""" @author: Aaron Ponti """ from Processor import Processor def process(transaction): """Dropbox entry point. @param transaction, the transaction object """ # # Run registration # prefix = "S3E" version = 2 logDir = "../core-plugins/flow/3/dss/drop-boxes/BIORADS3eDropbox/logs" ...
{ "content_hash": "15e8b19fdc783f251846e3e12410c136", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 74, "avg_line_length": 18.40909090909091, "alnum_prop": 0.6518518518518519, "repo_name": "aarpon/obit_flow_core_technology", "id": "3e0041785f67fca577746113ec516659f29e9495",...
class Formatter: def format(self, match): formatstr = "[{0}] {1}\n{2}:{3}\n{4}\n" return formatstr.format(match.rule.id, match.message, match.filename, match.linenumber, m...
{ "content_hash": "50563ec033b021cc56dbb2d835c8f0d3", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 62, "avg_line_length": 30.678571428571427, "alnum_prop": 0.42491268917345754, "repo_name": "schlueter/ansible-lint", "id": "6c612de56f9ff7bc570b0a77d731e45a33a7b195", "size...
"""The 'binary' module contains all classes related to the Binary protocol. """ # Changed from 'import serial' for PyCMDS import pycmds.project.com_handler as serial import struct import logging import sys # Changed path to accurately import from pycmds.library.zaber.exceptions import TimeoutError, UnexpectedReplyErr...
{ "content_hash": "08ea8ee0a6ecb723bc9e2a6b96fbe65d", "timestamp": "", "source": "github", "line_count": 527, "max_line_length": 96, "avg_line_length": 36.56736242884251, "alnum_prop": 0.5879819417778008, "repo_name": "wright-group/PyCMDS", "id": "f5a96082da2f846dc3130cef91d157be76da095d", "size": "...
""" Print all signature of a python module in alphabet order. Usage: ./print_signature "paddle.fluid" > signature.txt """ from __future__ import print_function import importlib import inspect import collections import sys import pydoc import hashlib member_dict = collections.OrderedDict() experimental_namespac...
{ "content_hash": "ea6cdb1ad1229bef20c501f57c48d4bb", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 80, "avg_line_length": 29.441860465116278, "alnum_prop": 0.5916271721958926, "repo_name": "tensor-tang/Paddle", "id": "486c88dd074e1859e39a664337ab0601c07a5cc5", "size": "3...
import _plotly_utils.basevalidators class NameValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="name", parent_name="layout.yaxis.rangebreak", **kwargs ): super(NameValidator, self).__init__( plotly_name=plotly_name, parent_name=pa...
{ "content_hash": "69700b243ec34161f60bf5083b9b565a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 81, "avg_line_length": 32.15384615384615, "alnum_prop": 0.6028708133971292, "repo_name": "plotly/plotly.py", "id": "347ac646ad36b610bedc79f581fc1d676bde0cc5", "size": "418"...
""" A collection of utility functions. Often these are not the most efficient implementations, especially when dealing with large files, but for most files morphforge has to deal with, they work fine and make code more readable. """ import os.path as fs import hashlib import re import random import os import fnmatch...
{ "content_hash": "fc0ae41ad6388b5445f7c52f8f2ebd07", "timestamp": "", "source": "github", "line_count": 351, "max_line_length": 116, "avg_line_length": 25.655270655270655, "alnum_prop": 0.5878956135480289, "repo_name": "mikehulluk/morphforge", "id": "323be245892e5527ee5fe941574a89b6e1e39a37", "size...
import abc import six from mongoengine import NotUniqueError from st2common import log as logging from st2common.exceptions.db import StackStormDBObjectConflictError from st2common.models.system.common import ResourceReference from st2common.transport.reactor import TriggerDispatcher __all__ = [ 'Access', ...
{ "content_hash": "d90a03d6c9c625a0e2db258066e5d783", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 99, "avg_line_length": 31.2, "alnum_prop": 0.6127730294396961, "repo_name": "grengojbo/st2", "id": "a9cb12a27aeac845afebe299fbbb35f476f0d49b", "size": "9204", "binary": ...
from mc.utils import context_value_setter from .base_task_handler import BaseTaskHandler class WireTaskHandler(BaseTaskHandler): """Performs wirings. Dispatches to :meth:`mc.utils.context_value_setter.set_context_value` task_params: wirings: a list of value_specs, per :meth:`mc.utils.con...
{ "content_hash": "8f60435e973b53e7a92db701ca82d1ea", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 73, "avg_line_length": 30.357142857142858, "alnum_prop": 0.6458823529411765, "repo_name": "aspuru-guzik-group/mission_control", "id": "7822c65a70ade58cadc1e570270b4f583d111a0...
from datetime import date from django.db import models from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.management import call_command from django.dispatch import receiver from django.shortcuts import render, redirect from django.http import HttpResponse from django.views.decor...
{ "content_hash": "c758a6d8aa2a1575b058baac42e8d77b", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 140, "avg_line_length": 29.624434389140273, "alnum_prop": 0.6567893691767221, "repo_name": "chrxr/flowpatrol_old", "id": "42051725b8383ba75d597d3d26632d266f358b2c", "size"...
import base64 import copy import requests import time from xml.etree import ElementTree as ET from oslo_log import log from oslo_serialization import jsonutils import six from manila import exception from manila.i18n import _ from manila.share.drivers.huawei import constants from manila import utils LOG = log.getLog...
{ "content_hash": "2276b582b363926cf84bfcb01b210561", "timestamp": "", "source": "github", "line_count": 1442, "max_line_length": 79, "avg_line_length": 35.64216366158114, "alnum_prop": 0.5209938516616079, "repo_name": "bswartz/manila", "id": "f37d8dcedfbf4dac5d4d861e6131f4c74ced4aa6", "size": "5204...
""" ================================================================= Permutation t-test on source data with spatio-temporal clustering ================================================================= Tests if the evoked response is significantly different between conditions across subjects (simulated here using one ...
{ "content_hash": "12b181bd0c2bd83b2a9d2499777f6241", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 79, "avg_line_length": 43.29608938547486, "alnum_prop": 0.6430967741935484, "repo_name": "agramfort/mne-python", "id": "91a10c8bc9826cdc30106fa736fc9e8b54bada50", "size": ...
"""Auth component configuration hooks. Application that use 'auth' component can override settings defined here by adding the following lines to appengine_config.py: components_auth_UI_APP_NAME = 'My service name' Code flow when this is used: * GAE app starts and loads a module with main WSGI app. * This modul...
{ "content_hash": "0a196b5e358e9389ef64b9449ec3937e", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 31.153846153846153, "alnum_prop": 0.7076543209876544, "repo_name": "pombreda/swarming", "id": "3cd9b7222131320bda8b7ed69581336029b963d9", "size": "21...
""" Master object to combine the layers into a net """ # Imports import json import pathlib import numpy as np from . import layers # Classes class Model(object): """ Model object To build an 8-3-8 autoencoder:: auto = Model('8-3-8', input_size=8) auto.add_layer(layers.FullyConnected(3, ...
{ "content_hash": "0e3efdd621312697cf0a0002a87cf760", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 75, "avg_line_length": 28.476702508960575, "alnum_prop": 0.5443675267463813, "repo_name": "david-joy/bmi203-final", "id": "48fb98ddbf087d6f4ae231caf4e5d310c72fce40", "size...
""" Place files in Dusty containers Assets are files to be put in containers, but which don't live in a repository. Assets are declared in Dusty specs of apps and libraries, and their values are managed with the CLI. Usage: assets list [<app_or_lib>] assets read <asset_key> assets set <asset_key> <local_p...
{ "content_hash": "eac03476ce48a1aec9806c8f020ddb23", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 130, "avg_line_length": 32.44897959183673, "alnum_prop": 0.6415094339622641, "repo_name": "gamechanger/dusty", "id": "258f515cbebcacec4c8b8c01ecfb2f17088d131b", "size": "15...
import pyexcel from rest_framework import viewsets, views, parsers, response, status from bazango.contrib.organization.filters import OrganizationFilterSet from .models import Organization, Category, OrganizationProfileProposedChange from .serializers import (OrganizationSerializer, CategorySerializer, OrganizationPro...
{ "content_hash": "d458c54d46ddaeef4bd4dc2defce2806", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 114, "avg_line_length": 36.529411764705884, "alnum_prop": 0.784219001610306, "repo_name": "rafal-jaworski/bazaNGObackend", "id": "dcaae7c5be4738c1a976a721b83175c6ad142510", ...
""" File: abstract_operator.py Author: Come Bertrand Email: bertrand.cosme@gmail.com Github: https://github.com/ComeBertrand Description: Abstract operator. """ from enum import Enum class OperatorType(Enum): NEIGHBORHOOD = 'Neighborhood' class AbstractOperator(object): """Abstract class describing an oper...
{ "content_hash": "5020ee1f784d7e7d98237bd2c87f6218", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 80, "avg_line_length": 29.695652173913043, "alnum_prop": 0.6300634455832114, "repo_name": "ComeBertrand/metabench", "id": "0a16fdd61f1c1790499aca3338bbb901190849f3", "size"...
from PyQt4.QtGui import QColor, QSizePolicy, QPalette, QPen, QFont from PyQt4.QtCore import Qt, QRectF import pyqtgraph as pg import numpy as np from Orange.data import Table, Domain from Orange.data.variable import ContinuousVariable, StringVariable from Orange.regression.linear import (RidgeRegressionLearner, Polyn...
{ "content_hash": "9c958bfb8e93ac0120f0b74cb71c2960", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 92, "avg_line_length": 34.18518518518518, "alnum_prop": 0.6010834236186349, "repo_name": "qPCR4vir/orange3", "id": "99d330217db7b76b4bd4b5b59288986e4360d719", "size": "923...
from starcheck.parser import *
{ "content_hash": "29ce0dc5310715a7b176f3e9cd8e515f", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 30, "avg_line_length": 31, "alnum_prop": 0.8064516129032258, "repo_name": "sot/mica", "id": "c5b773b97442d64961773de3c2c8085a3c047fa8", "size": "209", "binary": false, "...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/lair/base/shared_lair_base_den_earthen_light.iff" result.attribute_template_id = -1 result.stfName("lair_n","generic_den") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "57e9e84075a254d478cf30d3b7d2a705", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 85, "avg_line_length": 24.153846153846153, "alnum_prop": 0.6942675159235668, "repo_name": "anhstudios/swganh", "id": "2a94f3c1850aad1385516d74925e22c2bcc12a11", "size": "45...
import re from datetime import datetime, timedelta from icalendar import Event, Alarm class Course: def __init__(self, name, occur_time_str, teacher, course_id, credit, location, office_time_str, office): self.__occur_time_str = occur_time_str self.name = name self.location = location ...
{ "content_hash": "ede3240c35c4dd234417e02571411681", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 118, "avg_line_length": 41.77777777777778, "alnum_prop": 0.5529497098646035, "repo_name": "JeromeTan1997/SHUScheduleGenerator", "id": "69cbe9060d9cead2c36239385d4448cf4590d28...
import pprint import tempfile from driver_pete_python_sandbox.download import S3 from driver_pete_python_sandbox.filter_gps import compute_velocities, \ remove_duplicate_points, \ extract_delta_time, extract_delta_dist, remove_stationary_points from driver_pete_python_sandbox.filter_gps_processor import apply_...
{ "content_hash": "4b51420e46c34121a93d84ae657a5caf", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 93, "avg_line_length": 35.646341463414636, "alnum_prop": 0.664385904892234, "repo_name": "driver-pete/driver-pete-python-sandbox", "id": "d9c9fee16fb117e7d242846430ebba100f9...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging import textwrap import pytest from pants.backend.python.tasks.checkstyle.checker import PythonCheckStyleTask from pants.backend.python.tasks.checkstyl...
{ "content_hash": "20b0530af855d65d1e0032f2a7aed13c", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 93, "avg_line_length": 33.0625, "alnum_prop": 0.7107750472589792, "repo_name": "areitz/pants", "id": "706f962ec7f6d5ba18f9c44d7849a0f4e462c8ca", "size": "1734", "binary":...
__author__ = "Kiran Vemuri" __email__ = "kkvemuri@uh.edu" __status__ = "Development" __maintainer__ = "Kiran Vemuri" import logging class Log: """ Class to facilitate logging """ def __init__(self, logfile): """ :param logfile(str): file path to the log file to which logs are to be w...
{ "content_hash": "1a06782660da08760b9d77b0cc9fc029", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 93, "avg_line_length": 25.34285714285714, "alnum_prop": 0.5952649379932357, "repo_name": "DreamForgeContrive/tinyblox", "id": "5c132cc32742b849736dc7b3ded084b7160dd1c9", "s...
"""Trace a subunit stream in reasonable detail and high accuracy.""" import argparse import datetime import functools import os import re import sys import subunit import testtools # NOTE(mtreinish) on python3 anydbm was renamed dbm and the python2 dbm module # was renamed to dbm.ndbm, this block takes that into acc...
{ "content_hash": "931fde72bf0a98efdd5e46042f2e3648", "timestamp": "", "source": "github", "line_count": 343, "max_line_length": 79, "avg_line_length": 36.08454810495627, "alnum_prop": 0.5481942312353559, "repo_name": "dims/os-testr", "id": "315d850142e0863acc61ab36c12a29d2129bdb4a", "size": "13066"...
import ast import os from collections import namedtuple from eg import substitute # Support Python 2 and 3. try: import ConfigParser except: from configparser import ConfigParser # The directory containing example files, relative to the eg executable. The # directory structure is assumed to be: # eg.py* # e...
{ "content_hash": "1cfdadb2683daa259c38a92ad88d0630", "timestamp": "", "source": "github", "line_count": 519, "max_line_length": 80, "avg_line_length": 29.776493256262043, "alnum_prop": 0.6480522841982658, "repo_name": "milouse/eg", "id": "a143cc600dcdb5ae081df222482a2815bf09c92c", "size": "15454", ...
from ansible.module_utils.basic import AnsibleModule def main(): return AnsibleModule( argument_spec=dict( data=dict(default=None), path=dict(default=None, type=str), file=dict(default=None, type=str), ) )
{ "content_hash": "9d0faa73e8c2a96504c308e32040d4e0", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 52, "avg_line_length": 24.363636363636363, "alnum_prop": 0.5932835820895522, "repo_name": "openstack-infra/project-config", "id": "48f8c915545ad8b8cefe761173c408e1cd7576f4", ...
"""Generated test for checking pynos based actions """ import xml.etree.ElementTree as ET from st2tests.base import BaseActionTestCase from bgp_redistribute import bgp_redistribute __all__ = [ 'TestBgpRedistribute' ] class MockCallback(object): # pylint:disable=too-few-public-methods """Class to hold mock c...
{ "content_hash": "7d69fb69b1eae8646c878c591510e094", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 79, "avg_line_length": 32.08196721311475, "alnum_prop": 0.5804803270311701, "repo_name": "tonybaloney/st2contrib", "id": "53b5674d8077133cd0224ef0973ca4a10a2fdaa5", "size":...
import unittest import uuid from fairseq import metrics class TestMetrics(unittest.TestCase): def test_nesting(self): with metrics.aggregate() as a: metrics.log_scalar('loss', 1) with metrics.aggregate() as b: metrics.log_scalar('loss', 2) self.assertEqua...
{ "content_hash": "d2d062b9141c86bb8c94c8564a9737a7", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 72, "avg_line_length": 33.6986301369863, "alnum_prop": 0.5804878048780487, "repo_name": "hfp/libxsmm", "id": "060291808e37d9b69597522519fdf25d4b13d3e3", "size": "2638", "...
import hashlib import hmac import base64 import random import time import urllib import string AUTH_ID = "clientid" SECRET = "supersecret" def prepare_authenticated_uri(uri): """Prepare an authenticated URI. The uri param includes all parameters except id, timestamp, and hash""" uristring = "" t...
{ "content_hash": "7770dc201c8ef79391e0bc6a475a25a6", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 78, "avg_line_length": 28.093023255813954, "alnum_prop": 0.6539735099337748, "repo_name": "daisy/pipeline-issues", "id": "32dbe6befbdb17fb31b42779766e88cd099ab376", "size":...
SUGGESTS_MAIN_PATH = 'suggest' SUGGEST_CREATE = 'suggest_create' SUGGEST_SHOW = 'suggest_show' SUGGEST_UPDATE = 'suggest_update' SUGGEST_INDEX = 'suggest_index' SUGGEST_DELETE = 'suggest_delete' SUGGEST_CLOSE = 'suggest_close' SUGGEST_COMMENT = 'suggest_comment' SUGGEST_COMMENT_LIST = 'suggest_comment_list' SUGGEST_COM...
{ "content_hash": "52c82e283c8979ea109f561a7e66d406", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 49, "avg_line_length": 33.55, "alnum_prop": 0.7719821162444114, "repo_name": "WilJoey/ckanext-tnext", "id": "522c12371fe66596d943acc2dc2e164208aac534", "size": "671", "bi...
import config from sprite import StaticSprite # ----------- Scene ----------- # A scene comprised of a set of layers. class Scene( ): def __init__( self ): self.layers = [] self.actors = [] def addLayer( self, layer ): self.layers.append( layer ) def addActor( self, actor ): self.actors.append( actor ) ...
{ "content_hash": "ce87aef9014da5e256b8078c54b10d76", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 63, "avg_line_length": 20.925925925925927, "alnum_prop": 0.6141592920353982, "repo_name": "lsjroberts/7d7g", "id": "a3b4642ba6bde3f0a1ddad300db20bae3af69c19", "size": "682"...
import csv import logging import subprocess import win32ts def GetActiveSessionID(): """Get the active session ID.""" local_server = win32ts.WTS_CURRENT_SERVER_HANDLE for session in win32ts.WTSEnumerateSessions(local_server): if session['State'] == win32ts.WTSActive: return session['S...
{ "content_hash": "3ed71c6a00c1da52a09cad22a5ea8022", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 79, "avg_line_length": 30.441860465116278, "alnum_prop": 0.6256684491978609, "repo_name": "scheib/chromium", "id": "e3366634f1d0682a5c0d2ba7eb192a846798a8f7", "size": "1472...
import multiprocessing import sys,os pool = multiprocessing.Pool(processes=7) if __name__ == "__main__": cmds = open(sys.argv[1]) results = [] for cmd in cmds: results.append(pool.apply_async(os.system, (cmd.strip(),))) pool.close() pool.join()
{ "content_hash": "6c82339a5360b7157d378035af69f891", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 67, "avg_line_length": 21.846153846153847, "alnum_prop": 0.5985915492957746, "repo_name": "zhmz90/Daily", "id": "e79e74bc2bac60ac013de20b44c23b12c814c9e0", "size": "307", ...
import datetime from django.core import signing from django.test import SimpleTestCase from django.test.utils import freeze_time from django.utils.crypto import InvalidAlgorithm class TestSigner(SimpleTestCase): def test_signature(self): "signature() method should generate a signature" signer = ...
{ "content_hash": "8a2784720e259623152a5807dacc6560", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 94, "avg_line_length": 36.86772486772487, "alnum_prop": 0.5730482204362801, "repo_name": "claudep/django", "id": "6b7268179d73a15e885e1ff538ed9a00ac7cd27e", "size": "6968"...
import urllib2 from BeautifulSoup import BeautifulSoup def scrape(query): # Check for multiple word input if not isinstance(query, basestring): try: query = "+".join(query) except Exception as e: print(e) return None page = urllib2.urlopen("http://www....
{ "content_hash": "c67bab5226806380d483dca10decf311", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 77, "avg_line_length": 31.80851063829787, "alnum_prop": 0.6193979933110368, "repo_name": "ajman1101/BandcampRoulette", "id": "64ebb99974e1130502b720daa44394b86b470f49", "si...
"""compromise game. this example comes from the games introduced in paper A Polynomial-time Nash Equilibrium Algorithm for Repeated Stochastic game.Games by Enrique Munoz de Cote and Michael L. Littman """ import numpy as np from psycholab import game from psycholab import visualizer def create_game(): """Create ...
{ "content_hash": "73117ed1dbe90ff8c2230e34bbeda283", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 26.910112359550563, "alnum_prop": 0.6313152400835073, "repo_name": "google-research/google-research", "id": "f95285fad32db55011cb8ebeea83f06a1b9be2fd",...
def extractIsekaiTranslation(item): """ # Isekai Soul-Cyborg Translations """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or 'preview' in item['title'].lower(): return None if 'Manga' in item['tags']: return None if 'Isekai Maou to Shoukan Shoujo Dorei Ma...
{ "content_hash": "661a59cd915011332b5623d12edba634", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 130, "avg_line_length": 37, "alnum_prop": 0.7094594594594594, "repo_name": "fake-name/ReadableWebProxy", "id": "5b2bddbb58bda4260f0b741c12e5db77351cb722", "size": "592", ...