text
stringlengths
4
1.02M
meta
dict
__version__=''' $Id$ ''' import os, sys, glob, shutil def specialOption(n): v = False while n in sys.argv: v = True sys.argv.remove(n) return v #defaults for these options may be configured in local-setup.cfg #[OPTIONS] #no-download-t1-files=yes #ignore-system-libart=yes # if used on comman...
{ "content_hash": "fa48b1da04743c09459b8b77ebd556ce", "timestamp": "", "source": "github", "line_count": 550, "max_line_length": 143, "avg_line_length": 38.35636363636364, "alnum_prop": 0.4932688661357603, "repo_name": "Distrotech/reportlab", "id": "913e93b08081323ae8289a9667e9c10048787fe0", "size":...
"""Util functions to parse yaml config data.""" from src.common.utils import common_utils class Error(Exception): """Base exception class for all errors in this module.""" pass # pylint:disable=unnecessary-pass class ConfigPathNotFoundError(Error): """Error thrown when config data file is missing.""" ...
{ "content_hash": "70767c8f7b46dbd1908eae8e6cf3e2b3", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 73, "avg_line_length": 26.91358024691358, "alnum_prop": 0.6087155963302753, "repo_name": "GoogleCloudPlatform/professional-services", "id": "692a98859128e001e43714b757c25d788...
from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING from msrest import Deserializer, Serializer from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from .. import models from ._configuration import ServiceBusManagementClientConfiguratio...
{ "content_hash": "1d0586f644eb14e13555a243ffe3c93e", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 272, "avg_line_length": 48.84615384615385, "alnum_prop": 0.7152469577666428, "repo_name": "Azure/azure-sdk-for-python", "id": "749cedf823ea9bb4cc0d212938cdc12618447a9f", "...
from distutils.core import setup setup( name = 'genomespaceio', packages = ['genomespaceio'], # this must be the same as the name above version = '0.13', description = 'A library for reading and writing files to GenomeSpace (http://www.genomespace.org)', author = 'Ted Liefeld', author_email = 'jliefeld@clou...
{ "content_hash": "b9235e8d27b91c0f57af87e4e3d86bdf", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 110, "avg_line_length": 35.89473684210526, "alnum_prop": 0.6964809384164223, "repo_name": "GenomeSpace/genomespace_io", "id": "8d66e425baf80346433ce260af66315f34494964", "s...
import sys from lib import unigraph from lib import search def usage(): print("usage:", sys.argv[0], "graph.txt", "vertex") print() print("list vertices reachable from the source vertex") if "__main__" == __name__: if 3 > len(sys.argv): usage() else: vertex = int(sys.argv[2]) ...
{ "content_hash": "ce89b5fc28326b98b3e59df0500fbd5d", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 59, "avg_line_length": 25.433333333333334, "alnum_prop": 0.5583224115334207, "repo_name": "skhal/algorithms_old", "id": "058b52e86326ad69e703fc9677b14fec30919c63", "size": ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('seednetwork', '0003_add_memberinfo_usda'), ] operations = [ migrations.AddField( model_name='memberinfo', name='external_url...
{ "content_hash": "7fa0bdebe7906e379ae6823ebbb64a80", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 52, "avg_line_length": 21.5, "alnum_prop": 0.599483204134367, "repo_name": "RockinRobin/seednetwork", "id": "99cdafee21db6fb4bdde44fcb60719244918d3ef", "size": "459", "bi...
def test_pass(): assert True
{ "content_hash": "866ab50b3c3367b96cb98529ec790232", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 16, "avg_line_length": 16, "alnum_prop": 0.65625, "repo_name": "bergren2/plunder", "id": "d793007cad19395f867b2ffda7bba9599f94ffaf", "size": "32", "binary": false, "copi...
""" Point segment module """ from copy import deepcopy import sys import traceback import numpy as np from .point import Point from .utils import pairwise from .smooth import with_no_strategy, with_extrapolation, with_inverse from .smooth import NO_STRATEGY, INVERSE_STRATEGY, EXTRAPOLATE_STRATEGY from .location impor...
{ "content_hash": "57783655580768546b56657c30173699", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 109, "avg_line_length": 30.047904191616766, "alnum_prop": 0.5628736548425668, "repo_name": "ruipgil/TrackToTrip", "id": "eccd2b0079e17e9d7c48d5cafe48d3388aa18a7f", "size":...
import io from lxml import etree import six import webtest from keystone.auth import controllers as auth_controllers from keystone.common import serializer from keystone.openstack.common import jsonutils from keystone import tests from keystone.tests import default_fixtures class RestfulTestCase(tests.TestCase): ...
{ "content_hash": "174c4c7f3bfd8c70b74258908e69f048", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 79, "avg_line_length": 36.049586776859506, "alnum_prop": 0.6114167812929848, "repo_name": "rodrigods/keystone", "id": "f181b975f67f1013b315e1a584d8a0ee7d22dc2c", "size": "...
class Solution(object): def findRadius(self, houses, heaters): """ :type houses: List[int] :type heaters: List[int] :rtype: int """ res = -1 heaters.sort() for h in houses: i = bisect.bisect_left(heaters, h) left_dist = h - heat...
{ "content_hash": "f089f4a7fcb0ea96ce0eb6d8106d4dcd", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 76, "avg_line_length": 33.8, "alnum_prop": 0.5187376725838264, "repo_name": "Mlieou/oj_solutions", "id": "71266808684edda99a18e6b3ff19e0a116592ef3", "size": "507", "binar...
class StateBase(object): """ Base class of all possible States within AWS State Language Supported types: "Pass", "Task", "Choice", "Wait", "Succeed", "Fail", "Parallel", "Ext" """ def __init__(self, Name=None, Type=None, Comment=""): if not Name: raise Exception("Name must be specified") if not isinstan...
{ "content_hash": "982da95ad6b2e6d436cff829a90c85fa", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 106, "avg_line_length": 26.867924528301888, "alnum_prop": 0.6573033707865169, "repo_name": "gford1000/awssl", "id": "53c1a4b5e1b750e96dba465ab52ca2feab11c8cc", "size": "142...
import numpy as np from PySide import QtGui, QtCore import sharppy.sharptab as tab from sharppy.viz.barbs import drawBarb from sharppy.sharptab.constants import * import platform ## routine written by Kelton Halbert ## keltonhalbert@ou.edu __all__ = ['backgroundKinematics', 'plotKinematics'] class backgroundKinemati...
{ "content_hash": "a2bea4f3a76fdda87cf5c2c23d5cbb13", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 131, "avg_line_length": 41.509302325581395, "alnum_prop": 0.574429940052664, "repo_name": "blizzardwarriorwx/SHARPpy", "id": "ce8215c0d22391eba0fd74f7a2ef76de894feccf", "s...
from math import asin from math import degrees class TestCase: def __init__(self, v, d): self.velocity = v self.distance = d def initialize_test_cases(lines): global test_cases for index, item in enumerate(lines): if index > 0: items = item.split(' ') if (...
{ "content_hash": "3d2590e19b03a32486823fbac6642845", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 96, "avg_line_length": 34.51111111111111, "alnum_prop": 0.5660012878300065, "repo_name": "laichunpongben/CodeJam", "id": "a183ba88732b17155278aa2fd7e8b48915f8f142", "size":...
from importlib import import_module from django.conf.urls import url, include class PrefixedUrlconf(object): def __init__(self, prefix): self.prefix = prefix @property def urlpatterns(self): url_module = import_module('opendebates.urls') return [ pattern ...
{ "content_hash": "bad7a4373b72ca065c1aed7ab17e39b4", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 94, "avg_line_length": 29, "alnum_prop": 0.5846394984326019, "repo_name": "caktus/django-opendebates", "id": "7c5c2b067734d2a393f7c8df035f7771d7943587", "size": "638", "b...
import random import time import functools import math import os import stat import string import logging import threading import io from collections import defaultdict from s3transfer.compat import rename_file from s3transfer.compat import seekable MAX_PARTS = 10000 # The maximum file size you can upload via S3 per...
{ "content_hash": "d682e7d9f80f5274a5cb648d5d2ce8e2", "timestamp": "", "source": "github", "line_count": 700, "max_line_length": 79, "avg_line_length": 35.677142857142854, "alnum_prop": 0.6031873148073997, "repo_name": "VirtueSecurity/aws-extender", "id": "5ca4d9f066236188d803d962bb3c293e6bd3e8ac", ...
from pyramid.view import view_config, forbidden_view_config from pyramid.httpexceptions import HTTPFound from pyramid.security import remember from pyramid.session import signed_serialize from pyramid_ldap import get_ldap_connector import logging from twonicornweb.views import ( site_layout, local_authenticate,...
{ "content_hash": "266d48b8953437d97679a157813c7e04", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 106, "avg_line_length": 31, "alnum_prop": 0.6036866359447005, "repo_name": "CityGrid/twonicorn", "id": "9b00f50128e8846c53eabe30822d8d630ad08fef", "size": "2982", "binary...
''' You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters. For example, given: s: "barfoothefoobarman" words: ["foo", "bar"] You sho...
{ "content_hash": "017db56059d3fad7660c26518f6f2ca1", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 233, "avg_line_length": 36.354166666666664, "alnum_prop": 0.5077363896848137, "repo_name": "gavinfish/leetcode-share", "id": "f3bac4995c6f65f784f50e4d214332ad33ff9ba0", "si...
"""Tests the load_orgs_pipeline.""" from tests.unittest_utils import ForsetiTestCase import json import mock # pylint: disable=line-too-long from google.cloud.security.common.data_access import errors as data_access_errors from google.cloud.security.common.data_access import organization_dao as org_dao from google.cl...
{ "content_hash": "eb1e799361ec9f81fea628bca0d4717b", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 81, "avg_line_length": 37.270833333333336, "alnum_prop": 0.6743991056456121, "repo_name": "thenenadx/forseti-security", "id": "1f972f930f907463a764e1346e329c0ba1e424a3", "s...
import os from oslo_config import cfg from oslo_log import log as logging from bork_api.clients.git_client import RepoManager from bork_api.clients.storage_client import LocalStorage from bork_api.models import Image, Deployment, Recipe, CookBook CONF = cfg.CONF LOG = logging.getLogger(__name__) def images_cleanu...
{ "content_hash": "32bda931295e390555674d0c4deb82a8", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 63, "avg_line_length": 27.59493670886076, "alnum_prop": 0.5619266055045872, "repo_name": "Fiware/ops.Validator", "id": "671c072a9b543c8831adc380c1d237cf3429d1fe", "size": "...
from .arm_client import AzureResourceManagerClient from .compute_client import AzureComputeClient from .graph_client import AzureGraphClient from .network_client import AzureNetworkClient from .pricing_client import AzurePricingClient from .resources_client import AzureResourcesClient __all__ = [ 'AzureResourceMan...
{ "content_hash": "64db949a69bc77b3178b21fe7db4e798", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 50, "avg_line_length": 31, "alnum_prop": 0.7935483870967742, "repo_name": "hail-is/hail", "id": "4e9d523073a73e54b12a5e7cb3633fd2a980fb45", "size": "465", "binary": false...
""" Cert manager manages x509 certificates. **Related Flags** :cert_topic: What :mod:`rpc` topic to listen to (default: `cert`). :cert_manager: The module name of a class derived from :class:`manager.Manager` (default: :class:`nova.cert.manager.Manager`). """ import base64 from nov...
{ "content_hash": "8e41ef06c87589727352f86322f074bb", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 77, "avg_line_length": 32.127272727272725, "alnum_prop": 0.6632710809281268, "repo_name": "usc-isi/nova", "id": "4cc392d692bbc31343b2a441999e4d6e74f3181e", "size": "2419", ...
"""Utilities for probability distributions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib import linalg from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework ...
{ "content_hash": "6d93f6323adffab96116f000e4067d21", "timestamp": "", "source": "github", "line_count": 475, "max_line_length": 89, "avg_line_length": 39.8421052631579, "alnum_prop": 0.67889035667107, "repo_name": "ychfan/tensorflow", "id": "869b5698e57d199755ce1686a74a1eafe3b73e7d", "size": "19614...
""" The :mod:`sklearn.pls` module implements Partial Least Squares (PLS). """ # Author: Edouard Duchesnay <edouard.duchesnay@cea.fr> # License: BSD 3 clause from ..base import BaseEstimator, RegressorMixin, TransformerMixin from ..utils import check_array, check_consistent_length from ..externals import six import w...
{ "content_hash": "6cda6bb8a958354cadc7f6bf843aa658", "timestamp": "", "source": "github", "line_count": 796, "max_line_length": 81, "avg_line_length": 36.13944723618091, "alnum_prop": 0.5801439149024924, "repo_name": "lazywei/scikit-learn", "id": "8e77bd5eb0f75552484ac9a675f1fe444f65a306", "size": ...
"""Add host column to EPG and concrete devices Revision ID: 1b58ffa871bb Revises: f1ca776aafab Create Date: 2018-03-12 12:23:39.608507 """ # revision identifiers, used by Alembic. revision = '1b58ffa871bb' down_revision = 'f1ca776aafab' branch_labels = None depends_on = None from alembic import op import sqlalchemy...
{ "content_hash": "593a2b771620571f93e013f75ce9b093", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 68, "avg_line_length": 24.651162790697676, "alnum_prop": 0.6679245283018868, "repo_name": "noironetworks/aci-integration-module", "id": "5e13a52a7f94def6edbe34eb46baece5c82a7...
import csv import datetime __author__ = 'abdullah' from api.models import Content, Device, Software, StageMaterial, Contest, Composition, User from django.core.management import BaseCommand class Command(BaseCommand): # Show this when the user types help help = "Create base contents and save to database" ...
{ "content_hash": "4e945dd31f5bc3d0948111dec014f7b3", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 121, "avg_line_length": 36.97959183673469, "alnum_prop": 0.5732155997056659, "repo_name": "haliciyazilim/beste-yarismasi", "id": "7995d338c38efb3d51f0060dc7ad300f287be6a7", ...
""" Utilities for managing the sending of messages via SMS and other channels """ import squawk.gateway import squawk.models import uuid from collections import defaultdict from django.template import Context from django.template import Template from django.conf import settings from squawk import DisabledContactError f...
{ "content_hash": "49f0436070892a8601adbbc275617846", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 94, "avg_line_length": 38.04907975460123, "alnum_prop": 0.6347952273460175, "repo_name": "aquamatt/RedFlash", "id": "99ea5ac0c2b011ea2d473bbcbc10ab90a0949b90", "size": "63...
import multiprocessing class MyProcess(multiprocessing.Process): def run(self): print ('called run method in %s' %self.name) return if __name__ == '__main__': jobs = [] for i in range(5): p = MyProcess() jobs.append(p) p.start() p.join()
{ "content_hash": "f2092daa460540ad391c30ba6c49e12b", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 52, "avg_line_length": 18.823529411764707, "alnum_prop": 0.50625, "repo_name": "IdiosyncraticDragon/Reading-Notes", "id": "da5e8d6d72cbe53ddacc07880856632e5f37e8ac", "size"...
"""Support for Ambient Weather Station sensors.""" from __future__ import annotations from datetime import datetime from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, SensorStateClass, ) from homeassistant.config_entries import ConfigEntry from home...
{ "content_hash": "36b2964028501862e11b16481ff2a58b", "timestamp": "", "source": "github", "line_count": 648, "max_line_length": 87, "avg_line_length": 32.43518518518518, "alnum_prop": 0.6672851841278904, "repo_name": "home-assistant/home-assistant", "id": "c5b8b57297ffb8f5024895f65cc1755d7262d505", ...
from sqlalchemy import and_, or_, inspect from datetime import timedelta, datetime, date from ggrc.models import Notification, NotificationType, ObjectType from ggrc import db """ exposed functions handle_workflow_modify, handle_cycle_task_group_object_task_put, handle_cycle_created, handle_cycle_mod...
{ "content_hash": "f6334bcfe27e68c1d30266cbe015a59d", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 79, "avg_line_length": 32.649532710280376, "alnum_prop": 0.6789752397309289, "repo_name": "hasanalom/ggrc-core", "id": "3e4e0a961c1acf1af382d4a2394b1c87c969bed4", "size": ...
"""Example for spinner that looks like loader """ from __future__ import unicode_literals import os import time import sys import random sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from halo import Halo spinner = Halo(text='Downloading dataset.zip', spinner='dots') try: spinner....
{ "content_hash": "80b6a277bb46cc2a506edadddaa65257", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 76, "avg_line_length": 25.272727272727273, "alnum_prop": 0.7068345323741008, "repo_name": "ManrajGrover/halo", "id": "5a770d2f7b273527786aad6a1d24eeb9f5a4a1de", "size": "58...
""" Tests of the PyNNNumpyIO and PyNNTextIO classes """ from __future__ import with_statement, division import numpy import quantities as pq import os try: import unittest2 as unittest except ImportError: import unittest from neo.core import Segment, AnalogSignal, SpikeTrain from neo.io import PyNNNumpyIO, P...
{ "content_hash": "b7a05313020157a66b4f3a76f4260656", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 104, "avg_line_length": 35.81858407079646, "alnum_prop": 0.57183446571958, "repo_name": "tkf/neo", "id": "609bb240c80c360a41f6f761a91c5839cf18910f", "size": "8113", "bin...
from pynos import device from st2actions.runners.pythonrunner import Action class bgp_recursion(Action): def run(self, **kwargs): conn = (str(kwargs.pop('ip')), str(kwargs.pop('port'))) auth = (str(kwargs.pop('username')), str(kwargs.pop('password'))) test = kwargs.pop('test', False) ...
{ "content_hash": "ddca8d9bf49bd663cd609e04660ead55", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 73, "avg_line_length": 32.529411764705884, "alnum_prop": 0.5840867992766727, "repo_name": "tonybaloney/st2contrib", "id": "ff96ab6243e26dc58c6429a8a90fbdeef2701fc7", "size"...
""" The python basic types generators """ import random from string import ascii_letters from datetime import date, datetime, timedelta from decimal import Decimal def weighted_choice(choices): """ Supposes that choices is sequence of two elements items, where first one is the probability and se...
{ "content_hash": "ba02ea586217f27e6336148aeec05519", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 87, "avg_line_length": 27.64625850340136, "alnum_prop": 0.5809547244094488, "repo_name": "abakar/django-whatever", "id": "7bcef0c73727fdbb76151559c4b27c665b126078", "size"...
""" Base plugin (non-GUI) """ import math import threading import time import weakref from typing import Optional, Tuple from electroncash.address import Address from electroncash.bitcoin import COINBASE_MATURITY from electroncash.plugins import BasePlugin, hook, daemon_command from electroncash.i18n import _, ngette...
{ "content_hash": "c081ec21e5ed41a67162bf430d2ad74a", "timestamp": "", "source": "github", "line_count": 668, "max_line_length": 158, "avg_line_length": 42.377245508982035, "alnum_prop": 0.6083086053412463, "repo_name": "fyookball/electrum", "id": "e78719f1978e2ff8646360cfa331a425fb0fbf2a", "size": ...
"""Core implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing ver...
{ "content_hash": "0143b0e848c2b4ab81682b9ab2a77e76", "timestamp": "", "source": "github", "line_count": 1161, "max_line_length": 80, "avg_line_length": 33.45650301464255, "alnum_prop": 0.5863862214556034, "repo_name": "HuimingCheng/AutoGrading", "id": "e2343dd430806dd73c70aa4a0b71893a6d7b950f", "si...
from openprocurement.auctions.core.utils import ( opresource, ) from openprocurement.auctions.dgf.views.other.complaint import ( AuctionComplaintResource, ) @opresource(name='dgfFinancialAssets:Auction Complaints', collection_path='/auctions/{auction_id}/complaints', path='/auctions/{a...
{ "content_hash": "a2cc8b2eeb55a3768725c821c3fb9c3c", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 68, "avg_line_length": 37, "alnum_prop": 0.7441441441441441, "repo_name": "openprocurement/openprocurement.auctions.dgf", "id": "7ad32091c4f29c779e31ff07e55e3100562193d4", ...
import argparse, os, cPickle, sys, numpy, ntpath from pyAudioAnalysis import audioFeatureExtraction as aF from pyAudioAnalysis import audioBasicIO from pyAudioAnalysis import audioTrainTest as aT from pyAudioAnalysis import audioSegmentation as aS import matplotlib.pyplot as plt import io import os import shutil import...
{ "content_hash": "605ddbcae9a06b64397fbb2ad6f38bb4", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 217, "avg_line_length": 67.94915254237289, "alnum_prop": 0.43452232476926916, "repo_name": "MikeMpapa/EEG-Sequence-Learning", "id": "48d50d5ea5b6c95ed63a462b3c6d1eba63883195...
"""Keras convolution layers and image transformation layers. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.eager import context from tensorflow.python.framework import tensor_shape from tensorflow.python.keras import activations...
{ "content_hash": "340968f6b91425448abd3be4e079870c", "timestamp": "", "source": "github", "line_count": 2673, "max_line_length": 104, "avg_line_length": 42.61391694725028, "alnum_prop": 0.626976393022378, "repo_name": "apark263/tensorflow", "id": "30b919cc0a9038cf0eeb10a240105fbabd591efa", "size": ...
def index(): rows = db((db.activity.type=='project')&(db.activity.status=='accepted')).select() if rows: return dict(projects=rows) else: return plugin_flatpage() @auth.requires_login() def apply(): project = db.activity[request.args(1)] partaker = db((db.partaker.activity == reque...
{ "content_hash": "68878ce0be2b6aac082b76366c9a6504", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 117, "avg_line_length": 39.265306122448976, "alnum_prop": 0.6481288981288982, "repo_name": "tectronics/web2conf", "id": "bee74c1f191a3599ac8754ec67bfd97da72ad32f", "size": ...
from .stable_dar import StableDAR from .dar import DAR, AR from .har import HAR from .preprocess import extract_driver __all__ = ['DAR', 'HAR', 'AR', 'StableDAR', 'extract_driver', ]
{ "content_hash": "20516e4afead16ff92f73fffe2f167f3", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 38, "avg_line_length": 20, "alnum_prop": 0.5333333333333333, "repo_name": "RPGOne/Skynet", "id": "1ababe31615a2b39832606e03b7005a8f1b59811", "size": "240", "binary": fals...
from django.conf import settings from django.db.models import Q from django.http import Http404 from django.shortcuts import get_object_or_404 from rest_framework import status from rest_framework.authentication import BaseAuthentication from rest_framework.decorators import (api_view, authentication_classes, ...
{ "content_hash": "9469b6e662e55840c0eac04c30d6ca1b", "timestamp": "", "source": "github", "line_count": 454, "max_line_length": 79, "avg_line_length": 37.28854625550661, "alnum_prop": 0.6295705593951207, "repo_name": "spasovski/zamboni", "id": "ed11d6e6ad871ec47d5eb14d3ae1417847d2c7df", "size": "16...
from __future__ import unicode_literals import os import mopidy from mopidy import config, exceptions, ext __version__ = '0.1' class GMusicExtension(ext.Extension): dist_name = 'Mopidy-GMusic' ext_name = 'gmusic' version = __version__ def get_default_config(self): conf_file = os.path.joi...
{ "content_hash": "a0e0a1befaaf93466cd83ad44f35b48e", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 77, "avg_line_length": 24.91891891891892, "alnum_prop": 0.6366594360086768, "repo_name": "shapr/mopidy-gmusic", "id": "fed5dec71038f746b427f61d89bf5f30b617fed4", "size": "9...
from __future__ import absolute_import from flask import abort from werkzeug.exceptions import ServiceUnavailable from r5d4.analytics import Analytics from r5d4.flask_redis import get_conf_db, get_data_db from r5d4.mapping_functions import DIMENSION_EXPANSION_MAP from r5d4.utility import construct_key def combinatori...
{ "content_hash": "13a4f949ef95e6648f894804d05edac6", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 74, "avg_line_length": 34.565891472868216, "alnum_prop": 0.52164162368244, "repo_name": "practo/r5d4", "id": "3fe0df42eafcdf30b1cf7c9a92659bdad4ddf8a6", "size": "4459", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('hubs', '0002_auto_20160929_0301'), ] operations = [ migrations.AlterField( model_name='hub', ...
{ "content_hash": "38a66ae3d0c46ffe65f36d13b3b2d374", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 121, "avg_line_length": 24.94736842105263, "alnum_prop": 0.6286919831223629, "repo_name": "j-windsor/iRiot-WebApp", "id": "498ccb93a7e6f845d85c34ed3bb85983187d44c3", "size"...
import leancloud #from leancloud import User from leancloud import Object leancloud.init('73b6c6p6lgs8s07m6yaq5jeu7e19j3i3x7fdt234ufxw9ity', 'h5lu7ils6mutvirgrxeodo6xfuqcgxh4ny0bdar3utl076cu') class Mail(Object): @property def subject(self): return self.get('subject') @subject.setter def subje...
{ "content_hash": "a846fd34061f19023f4b4c8163d3d6f8", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 118, "avg_line_length": 28.55, "alnum_prop": 0.7320490367775832, "repo_name": "iforgotid/webmail", "id": "b0aa10106452535300a90b75969db8ae3e1253d9", "size": "571", "binar...
from mock import patch import unittest import urllib2 from weblab.experiment.devices.http import HttpDevice, WlHttpDeviceURLErrorError, WlHttpDeviceHTTPErrorError, WlHttpDeviceError from test.util.fakeobjects import fakeaddinfourl class HttpDeviceTestCase(unittest.TestCase): @patch('urllib2.urlopen') def te...
{ "content_hash": "f4901fc97ccb004407d2fe64a6125725", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 127, "avg_line_length": 28.280701754385966, "alnum_prop": 0.642059553349876, "repo_name": "ganeshgore/myremolab", "id": "5f032d4a954be7ce27b345e2f3e709989c45125a", "size": ...
""" WSGI config for ExpLosion 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.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ExpLosion.settings") from django.co...
{ "content_hash": "70d670e3744be1c1cfad1b2543ac23c2", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 28.071428571428573, "alnum_prop": 0.7760814249363868, "repo_name": "mbatchkarov/ExpLosion", "id": "4b889248c2b07683a584ae971ed22527fec3d3bb", "size":...
import _plotly_utils.basevalidators class CustomdataValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="customdata", parent_name="choropleth", **kwargs): super(CustomdataValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_n...
{ "content_hash": "0a01bd65ecef3bcc6ec0cc2874b660bb", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 85, "avg_line_length": 37.45454545454545, "alnum_prop": 0.6359223300970874, "repo_name": "plotly/plotly.py", "id": "2de9dea3e96ddf815aad0f613c88f4e9ef0a1520", "size": "412"...
try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': 'Python client for Microsoft\'s Project Oxford web language model', 'author': 'Will Fitzgerald', 'url': 'https://github.com/willf/oxford_language_model', 'download_url': 'https://git...
{ "content_hash": "ac52ef7548c049b5bc63e2aaf839d64f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 86, "avg_line_length": 30.68421052631579, "alnum_prop": 0.6638078902229846, "repo_name": "willf/oxford_language_model", "id": "3672fbcd05d82c347b97adb12ccebd4b0efba2dc", "s...
import numpy as np from bayesnet.tensor.constant import Constant from bayesnet.tensor.tensor import Tensor from bayesnet.function import Function class Swapaxes(Function): def __init__(self, axis1, axis2): self.axis1 = axis1 self.axis2 = axis2 def forward(self, x): x = self._convert2...
{ "content_hash": "f6c596d13e8780342f7874c687f9d2ea", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 82, "avg_line_length": 23.46511627906977, "alnum_prop": 0.6164519326065411, "repo_name": "ctgk/BayesianNetwork", "id": "ce3434ad4b31d6c7c037a73ad418f3a7903196f2", "size": "...
from zoo.chronos.autots.deprecated.feature.utils import save_config from zoo.chronos.autots.deprecated.feature.abstract import BaseFeatureTransformer from zoo.chronos.utils import deprecated import sklearn from sklearn.preprocessing import StandardScaler import pandas as pd import numpy as np import json from packagin...
{ "content_hash": "6c5ee89975b03eea1f16d3c8b1d3e945", "timestamp": "", "source": "github", "line_count": 573, "max_line_length": 100, "avg_line_length": 44.931937172774866, "alnum_prop": 0.5584168414510992, "repo_name": "intel-analytics/analytics-zoo", "id": "2469da8a0b3c764be26c6db695ae065b35f81cc0",...
"""Tests the version bumper activity.""" from rever import vcsutils from rever.logger import current_logger from rever.main import env_main REVER_XSH = """ $ACTIVITIES = ['version_bump'] $DAG['version_bump'].args = [[ ('init.py', r'__version__\s*=.*', "__version__ = '$VERSION'"), ('appveyor.yml', r'version:\...
{ "content_hash": "2b22b51728bd3a0483190b09c49c0460", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 89, "avg_line_length": 31.18421052631579, "alnum_prop": 0.5873417721518988, "repo_name": "scopatz/rever", "id": "d20b2346697401b78c50262e74f2da3979483fed", "size": "1185", ...
"""test deprecated module """ __revision__ = 0 if __revision__: import Bastion print Bastion # false positive (#10061) import stringfile print stringfile
{ "content_hash": "e73cf997ca8a4f0be481a3d2de6d5193", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 29, "avg_line_length": 14.833333333333334, "alnum_prop": 0.6348314606741573, "repo_name": "dbbhattacharya/kitsune", "id": "72fb79502c1c633f1f1457c962c217afd4c86280", "size"...
import sys, os sys.path.insert(0, "thirdparty/") sys.path.insert(0, "core/") sys.path.insert(0, "modules/") sys.path.insert(0, "modules/config/") import config from BotModule import BotModule from BotCore import FSIBot # Open config file cfg = config.Config(file("bot.config")) botcfg = cfg.bot bot = FSIBot(botcfg) #...
{ "content_hash": "590049bc840d99b5f8c35654f0abdd5f", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 109, "avg_line_length": 23.545454545454547, "alnum_prop": 0.7316602316602316, "repo_name": "fsi-hska/fsiBot", "id": "1f8c71a7b3c60c7ec085aad8026968ae0d96ea2d", "size": "724...
import sys,os,os.path from zstacklib.utils import log from zstacklib.utils import linux import zstacklib.utils.iptables as iptables import appliancevm log.configure_log('/var/log/zstack/zstack-appliancevm.log') logger = log.get_logger(__name__) def main(): usage = 'usage: python -c "from appliancevm imp...
{ "content_hash": "57857a3fd29ab83ab26274200dbbd8ea", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 108, "avg_line_length": 34.17142857142857, "alnum_prop": 0.6086956521739131, "repo_name": "ghxandsky/zstack-utility", "id": "e9046bda5a318f239e8782acad21d78693283ae6", "siz...
import fnmatch import itertools import logging import os import requests from six.moves import urllib from . import rpcclient, dcos_url_path from ..clients.rpcclient import verify_ssl from ..errors import DCOSException logger = logging.getLogger(__name__) COMPLETED_TASK_STATES = [ "TASK_FINISHED", "TASK_KILLED...
{ "content_hash": "50cb992e2bc8fd2b5132d0264be8dff5", "timestamp": "", "source": "github", "line_count": 981, "max_line_length": 120, "avg_line_length": 30.14169215086646, "alnum_prop": 0.5444553417430417, "repo_name": "mesosphere/marathon", "id": "7df2e64979213076ab4275c8beb17fe2b49e36d9", "size": ...
import pytest from formulaic.materializers.types import ScopedFactor from formulaic.parser.types import Factor class TestScopedFactor: @pytest.fixture def scoped_factor(self): return ScopedFactor(Factor("a")) @pytest.fixture def scoped_factor_reduced(self): return ScopedFactor(Factor...
{ "content_hash": "d1fd922956f00431fb1ad753c5a24a48", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 66, "avg_line_length": 32.73529411764706, "alnum_prop": 0.6738544474393531, "repo_name": "matthewwardrop/formulaic", "id": "715958d941ef457754b8f8e2fafe8db1023f7354", "size...
import logging from solitude.middleware import get_oauth_key, get_transaction_id def getLogger(name=None): logger = logging.getLogger(name) return SolitudeAdapter(logger) # This really should be fulfilled by a logging filter which would remove the # need to do all this crap. However I've got no i...
{ "content_hash": "55682ab1201e8f76ef18f948fda419fd", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 33.935483870967744, "alnum_prop": 0.6539923954372624, "repo_name": "muffinresearch/solitude", "id": "52d23672ce9824cbedaa2045948c104ea0b9787a", "size...
from gi.repository import Gtk class ButtonWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Button Demo") self.set_border_width(10) hbox = Gtk.Box(spacing=6) self.add(hbox) button = Gtk.Button("Click Me") button.connect("clicked", self.on_cl...
{ "content_hash": "88c6c483590d4fa2bb015ea744576e4b", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 59, "avg_line_length": 28.945945945945947, "alnum_prop": 0.6209150326797386, "repo_name": "lichengshuang/createvhost", "id": "abd1a9895c0408432cd70b3048994863089cda7e", "si...
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 = "MovingAverage", cycle_length = 12, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 0);
{ "content_hash": "0b2a5b56210cf1f5e4f349d805b9bf2d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 173, "avg_line_length": 39, "alnum_prop": 0.7142857142857143, "repo_name": "antoinecarme/pyaf", "id": "ba3601cc1cd8e9d380a86cdba6657358a78a71c5", "size": "273", "binary": ...
import errno import librosa import matplotlib, matplotlib.pyplot as plt import numpy import os import os.path import sklearn import urllib.request def init(): plt.style.use('seaborn-muted') #plt.rcParams['figure.figsize'] = (14, 5) plt.rcParams['axes.grid'] = True plt.rcParams['axes.spines.left'] = Fal...
{ "content_hash": "3d147df295df27f0075edd07392bf10a", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 124, "avg_line_length": 41.78947368421053, "alnum_prop": 0.6178481468154012, "repo_name": "stevetjoa/stanford-mir", "id": "641657f97e63667f2464bbdfa363e25898cd18ae", "size...
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Tickfont(_BaseLayoutHierarchyType): # class properties # -------------------- _parent_path_str = "layout.polar.angularaxis" _path_str = "layout.polar.angularaxis.tickfont" _valid_props ...
{ "content_hash": "b877a92bdadcd3103eac366f78282045", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 84, "avg_line_length": 37.440528634361236, "alnum_prop": 0.5601835510060007, "repo_name": "plotly/python-api", "id": "671860b4c0c90c9d87ff23ecabded6deb3bf2d9c", "size": "8...
import itertools import re import requests import textwrap SPIRV_HTML_SPEC_URL = 'https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html' SPIRV_JSON_SPEC_URL = 'https://raw.githubusercontent.com/KhronosGroup/SPIRV-Headers/master/include/spirv/unified1/spirv.core.grammar.json' AUTOGEN_OP_DEF_SEPARATOR = '\n...
{ "content_hash": "a08ce3837c1fe83c4cebb5ef9f1a942e", "timestamp": "", "source": "github", "line_count": 940, "max_line_length": 138, "avg_line_length": 33.755319148936174, "alnum_prop": 0.644500472738733, "repo_name": "endlessm/chromium-browser", "id": "5854a74509cdefdca5c9834947016e51080c222a", "s...
import logging from seedbox import config, config_renderer from seedbox.config_renderer.ignition.base import BaseIgnitionPackage log = logging.getLogger(__name__) class KubeProxyPackage(BaseIgnitionPackage): def get_files(self): user = self.cluster.k8s_kube_proxy_user if not user: lo...
{ "content_hash": "203ab2127b520876434f673a2eae66e5", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 115, "avg_line_length": 33.21212121212121, "alnum_prop": 0.5191605839416058, "repo_name": "nailgun/seedbox", "id": "fb4938f1fa15c81ca42584b240cf026c46b33088", "size": "1096...
import copy import mock import netaddr from oslo_serialization import jsonutils import six from webob import exc from nova.api.openstack.compute import hypervisors \ as hypervisors_v21 from nova.cells import utils as cells_utils from nova import exception from nova import objects from nova import test from no...
{ "content_hash": "60737a9f2037bc661ea3d36f799ffbec", "timestamp": "", "source": "github", "line_count": 1274, "max_line_length": 79, "avg_line_length": 41.65070643642072, "alnum_prop": 0.5513634736068447, "repo_name": "Juniper/nova", "id": "2932a133972e5c136fe3856f5e10b5aaa89e54fe", "size": "53703"...
from django.views.generic import TemplateView from horizon import usage class ProjectOverview(usage.UsageView): table_class = usage.TenantUsageTable usage_class = usage.TenantUsage template_name = 'nova/overview/usage.html' def get_data(self): super(ProjectOverview, self).get_data() ...
{ "content_hash": "01e52a0e28a6808d702cf48758418539", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 47, "avg_line_length": 25.294117647058822, "alnum_prop": 0.727906976744186, "repo_name": "savi-dev/horizon", "id": "7840b75d11a4c57abd1c00f10772aa8af31c13c7", "size": "1239...
from order.utils import create_order_objects, is_orderable, resolve_labels, \ resolve_order_item_related_set_name, sanitize_order def post_save(sender, instance, created, **kwargs): """ After save create order instance for sending instance for orderable models. """ # Only create order model in...
{ "content_hash": "43fc1a7663df6ac1f6fdda3043306cb5", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 79, "avg_line_length": 38.06060606060606, "alnum_prop": 0.64171974522293, "repo_name": "praekelt/django-order", "id": "d04c9846b9f3b9f3fe06a327158c948f0a9bd2e2", "size": "1...
import flask import flask.ext.stacksentinel app = flask.Flask(__name__) app.debug = False # # Just a couple of example handlers. The second will generate a URL for testing. # @app.route('/') def hello_world(): return flask.Response("Extension installed: %s" % flask.ext.stacksentinel, mimetype='text/plain') @app....
{ "content_hash": "19570b1b7eb9ec3675c824b92eab9a53", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 101, "avg_line_length": 27.807692307692307, "alnum_prop": 0.7233748271092669, "repo_name": "StackSentinel/stacksentinel-flask", "id": "889b981abdf7ade08c02874117bc68b98208cab...
import xlsxwriter import math # Create a function that will behave like a worksheet write() method. # # This function takes a float and if it is NaN then it writes a blank cell # instead. It should take the parameters shown below and return the return # value from the called worksheet write_*() method. # def ignore_na...
{ "content_hash": "553e0d8e0e8af408ea38a89f90c151c3", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 76, "avg_line_length": 32.96875, "alnum_prop": 0.7251184834123223, "repo_name": "jmcnamara/XlsxWriter", "id": "1f4c3cbe1735ed87d645c9e39e39a99c3b2f8893", "size": "1327", ...
""" Expose each GPU devices directly """ from __future__ import print_function, absolute_import, division import functools from numba import servicelib from .driver import hsa as driver class _culist(object): """A thread local list of GPU instances """ def __init__(self): self._lst = None @p...
{ "content_hash": "17e4f0b87b41e4241807acb4e6017bb8", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 67, "avg_line_length": 20.66906474820144, "alnum_prop": 0.569439610163592, "repo_name": "pombredanne/numba", "id": "2daf05691164a47a05d3b132a154f83cd4ae84f8", "size": "287...
from __future__ import absolute_import import bbcode from pybb import defaults from pybb.util import load_class from pybb.engines.base import BaseMarkupEngine, BaseQuoteEngine class BBCodeMarkupEngine(BaseMarkupEngine): simple_formatters = { 'left': ('<div style="text-align:left;">%(value)s</div>', None...
{ "content_hash": "739c700a9239b9283c0533ee45da6d76", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 193, "avg_line_length": 38.43055555555556, "alnum_prop": 0.5919768702565956, "repo_name": "thoas/pybbm", "id": "781c1e2b54f57d37a52c8cfa85b8e93459aedaf3", "size": "2767", ...
from ggrc import db from ggrc.models.mixins import Base class Event(Base, db.Model): __tablename__ = 'events' action = db.Column( db.Enum(u'POST', u'PUT', u'DELETE', u'BULK', u'GET'), nullable=False, ) resource_id = db.Column(db.Integer) resource_type = db.Column(db.String) revisions = db.re...
{ "content_hash": "54535505c1f0b7916549214c01955a7a", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 73, "avg_line_length": 20.979591836734695, "alnum_prop": 0.5836575875486382, "repo_name": "j0gurt/ggrc-core", "id": "9535f5f89733b2aee97554c14fea42f1cfd3c47e", "size": "114...
from test_framework.blocktools import ( COINBASE_MATURITY, create_coinbase, create_block, add_witness_commitment, MAX_BLOCK_SIGOPS_WEIGHT, WITNESS_SCALE_FACTOR, ) from test_framework.messages import ( COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, SEQUENCE_FINAL, )...
{ "content_hash": "a826c275d7ad0d9e46f0c8bb24e0f48a", "timestamp": "", "source": "github", "line_count": 1758, "max_line_length": 363, "avg_line_length": 57.377133105802045, "alnum_prop": 0.6373712438905907, "repo_name": "fanquake/bitcoin", "id": "31a6b31225a082c4a61562f014b7799de35ff543", "size": "...
"""Tests for the helper for building projects from source.""" import os import unittest from l2tdevtools import build_helper from l2tdevtools import projects from tests import test_lib class BuildHelperFactoryTest(test_lib.BaseTestCase): """Tests the factory class for build helpers.""" def testNewBuildHelper(...
{ "content_hash": "59b49724a9b012e8339b153f52a2af61", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 73, "avg_line_length": 31.72972972972973, "alnum_prop": 0.7291311754684838, "repo_name": "log2timeline/l2tdevtools", "id": "8d39a99d4c799edcd1d4cce6f7153025b1e8f81a", "size...
import multiprocessing import random import threading import time from concurrent import futures import grpc from src.proto.grpc.testing import control_pb2 from src.proto.grpc.testing import services_pb2_grpc from src.proto.grpc.testing import stats_pb2 from tests.qps import benchmark_client from tests.qps import ben...
{ "content_hash": "1009a710dbed5c6ff1fdb9455a859032", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 79, "avg_line_length": 39.901162790697676, "alnum_prop": 0.6124143960367187, "repo_name": "murgatroid99/grpc", "id": "41e2403c8fc9ad2a1caba88c3b3487fab299ae4f", "size": "7...
import logging from pandas import Series, DataFrame, concat from ramp.builders import build_target_safe from ramp.features.base import to_feature, ComboFeature, Feature, AllDataFeature from ramp.modeling import fit_model, generate_test from ramp.utils import get_single_column, reindex_safe class TrainedFeature(Featu...
{ "content_hash": "b526822ddcd17544685c69798f030197", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 111, "avg_line_length": 38.593939393939394, "alnum_prop": 0.5942211055276382, "repo_name": "kvh/ramp", "id": "51dfb026d4e5a419bbdc81193635afe2a58455b3", "size": "6368", ...
import math def classify_input(network, input_data, positive_classification_predicate): input_shape = (network.layers[0].weights.shape[1], 1) return positive_classification_predicate(network.compute_outputs(input_data.reshape(input_shape))[-1]) def measure_error(network, test_data_set): errors = [networ...
{ "content_hash": "a0eecd255bcfedaf89cab7f256dd4848", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 116, "avg_line_length": 45.93333333333333, "alnum_prop": 0.6915820029027576, "repo_name": "frugs/PyTextDocumentClassifier", "id": "60d63a1b1e97b197eb77e19bae0a308e60e44274", ...
"""Provides device triggers for switches.""" from __future__ import annotations import voluptuous as vol from homeassistant.components.device_automation import toggle_entity from homeassistant.const import CONF_DOMAIN from homeassistant.core import CALLBACK_TYPE, HomeAssistant from homeassistant.helpers.trigger impor...
{ "content_hash": "fe38aeb4b74e93d8a1b7a0ff6746329e", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 87, "avg_line_length": 32.02439024390244, "alnum_prop": 0.753998476770754, "repo_name": "mezz64/home-assistant", "id": "499b04bbaf3ab729565d74a89a61aaa6cc8d0aa4", "size": "...
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # This work is licensed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain...
{ "content_hash": "e482d8c2f09571308246d7a7b730957d", "timestamp": "", "source": "github", "line_count": 591, "max_line_length": 165, "avg_line_length": 50.96277495769881, "alnum_prop": 0.6190776586208041, "repo_name": "microsoft/DiscoFaceGAN", "id": "d888a90dd23c1a941b5fb501afec1efcb763b5ea", "size...
STAT_SUCCESS = 'success' STAT_FAILURE = 'failure' STAT_INVALID_PARAMS = 'invalid_parameters' class LogException(Exception): """用来记录日志的异常 只有一个参数: status. """ def __init__(self, status): self.__status = status @property def status(self): return self.__status class Dict(dict)...
{ "content_hash": "7e3822a805199d9ecc6d5d9f765f062b", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 49, "avg_line_length": 19.5, "alnum_prop": 0.5675213675213675, "repo_name": "jelly-ape/dts_server", "id": "8a28a9c366ba4c3e0136a84a4ff9b1ce332174f2", "size": "679", "bina...
class EmptyTraceImporter(object): """Imports empty traces.""" def __init__(self, model, event_data, import_priority=0): pass @staticmethod def CanImport(event_data): if isinstance(event_data, list): return len(event_data) == 0 elif isinstance(event_data, basestring): return len(event_da...
{ "content_hash": "f1244b5ade50158f1a556db600fcc112", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 59, "avg_line_length": 23.333333333333332, "alnum_prop": 0.6642857142857143, "repo_name": "ChromiumWebApps/chromium", "id": "df664c020891b45305c13314b9f112b8fd82404e", "siz...
from textwrap import dedent import pytest from bokeh.models import FuncTickFormatter, Slider flexx = pytest.importorskip("flexx") def test_functickformatter_from_py_func_no_args(): def convert_to_minutes(): return tick * 60 # noqa formatter = FuncTickFormatter.from_py_func(convert_to_minutes) ...
{ "content_hash": "177eccd7467e36d97427302ce83767a3", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 94, "avg_line_length": 29.195121951219512, "alnum_prop": 0.6524644945697577, "repo_name": "azjps/bokeh", "id": "f610ba0b8ffdb004c63f46a79e31d5b533c5f60b", "size": "2394", ...
import os, shutil import plistlib import errno from sys import argv from mod_pbxproj import XcodeProject projectPath = argv[1] frameworkPath = argv[2] def log(x): with open('GBiOSBuildProcessLog.txt', 'a') as f: f.write(x + "\n") log('------------------------------------------------------------\n') log(' ...
{ "content_hash": "826c99c249f79f6f81f78e0ec5225950", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 114, "avg_line_length": 35.24786324786325, "alnum_prop": 0.5834141610087293, "repo_name": "nairs77/GB-Unity-Plugin", "id": "da5f3116d8e57fe2ceca7ce11a5df3c412113208", "siz...
import py.test import unittest class MyPlufinSchedulerTester(unittest.TestCase): @classmethod def setUpClass(cls): pass @classmethod def tearDownClass(cls): pass def setUp(self): pass def tearDown(self): pass
{ "content_hash": "7eaae84a5fe488ad3bd38a0a6c31a020", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 49, "avg_line_length": 16.11764705882353, "alnum_prop": 0.6204379562043796, "repo_name": "mrmcmuffinz/rpi.alarm", "id": "5ac74ed0878cc6e9c944be3521161f8a9427452e", "size": ...
''' Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get the top element. getMin() -- Retrieve the minimum element in the stack. ''' # Use one queue class MinStack: # i...
{ "content_hash": "f6f96ee4e71c20ffd6433eef2d202901", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 117, "avg_line_length": 24.36111111111111, "alnum_prop": 0.5347776510832383, "repo_name": "UmassJin/Leetcode", "id": "5170e968e7c4fd426417e932d638972e848f4142", "size": "17...
import os import sys sys.path.insert(0, os.path.abspath('../..')) sys.path.insert(0, os.path.abspath('..')) # standard imports import configargparse as argparse import numpy as np import h5py import vigra import time import glob import logging from skimage.external import tifffile def get_num_frames(options): if l...
{ "content_hash": "f38f4a20a6f6f4a1b350f39a616e7981", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 158, "avg_line_length": 43.61206896551724, "alnum_prop": 0.6181063451274955, "repo_name": "chaubold/hytra", "id": "237acdb30d83199e6ceeb9ee883a1ae03638e89f", "size": "1023...
from django.shortcuts import render_to_response from django.template import RequestContext def angular_view(request): context = RequestContext(request) return render_to_response('index.html', context_instance=context)
{ "content_hash": "63b9ec3e8c50f9e9da35b055fe5ffaaa", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 69, "avg_line_length": 37.666666666666664, "alnum_prop": 0.8008849557522124, "repo_name": "Laimiux/mydeatree", "id": "7eb20cc5c142ce2834555e3244b71dea484595b3", "size": "226...
import numpy as np import matplotlib.pyplot as plt import seaborn as sns from scipy.stats import norm from matplotlib_scalebar.scalebar import ScaleBar def plot_morph(ax, df_paths, view, plot_axon, plot_basal_dendrites, plot_apical_dendrites): if view == 'xy': axis0 = 0 axis1 = 1 elif view == ...
{ "content_hash": "24df4b9af79adc8ca69b4302fda2d0d3", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 119, "avg_line_length": 34.38562091503268, "alnum_prop": 0.6027371222201102, "repo_name": "huangziwei/MorphoPy", "id": "54af9ab4217b3231660ae3f418d5a867c26610a8", "size": ...
"""Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression.""" # Authors: Mathieu Blondel <mathieu@mblondel.org> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from .base import BaseEstimator, RegressorMixin, MultiOutputMixin from .metrics.pairwi...
{ "content_hash": "4d7200d0a6b8ef40c8667509c77499a2", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 79, "avg_line_length": 40.26190476190476, "alnum_prop": 0.6347723240685985, "repo_name": "ndingwall/scikit-learn", "id": "119b27e9084ae34b13c479834671b239c1078d6d", "size"...
NAME = 'Edgecast / Verizon Digital media' def is_waf(self): if self.matchheader(('Server', '^ECD \\(.*?\\)$')): return True if self.matchheader(('Server', '^ECS \\(.*?\\)$')): return True return False
{ "content_hash": "80e503991b59e0cb1d0b1d812d955f7d", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 55, "avg_line_length": 28.625, "alnum_prop": 0.5502183406113537, "repo_name": "sandrogauci/wafw00f", "id": "bff05da117299233274c4b965c389c4856d6afd1", "size": "252", "bina...
"""Package of Sodoku solvers as a graph coloring.""" __all__ = ['io', 'coloring', 'coloring']
{ "content_hash": "59c6bb7094d8ca64ea970e35e200debe", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 52, "avg_line_length": 47, "alnum_prop": 0.6276595744680851, "repo_name": "jlramalheira/sudoku", "id": "e4321125c50e3168c171ba453df62eeb72022c4d", "size": "94", "binary": ...
from tempfile import NamedTemporaryFile from airflow.contrib.hooks.gcs_hook import (GoogleCloudStorageHook, _parse_gcs_url) from airflow.contrib.operators.s3_list_operator import S3ListOperator from airflow.exceptions import AirflowException from airflow.hooks.S3_hook import...
{ "content_hash": "7f6446494ad4ed9b77e89baa9469a3b7", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 80, "avg_line_length": 40.516129032258064, "alnum_prop": 0.5691348195329087, "repo_name": "sid88in/incubator-airflow", "id": "5dd355a6fd3317b2d225070706c563878cbbd1c1", "s...
""" ===================================== Cross-Correlation (Phase Correlation) ===================================== In this example, we use phase correlation to identify the relative shift between two similar-sized images. The ``register_translation`` function uses cross-correlation in Fourier space, optionally emp...
{ "content_hash": "74aa392d6b7b814896464ddc4b976766", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 78, "avg_line_length": 29.857142857142858, "alnum_prop": 0.7165991902834008, "repo_name": "ClinicalGraphics/scikit-image", "id": "c558e107fa387ec51b3f4d05bb785cbd611856f0", ...
import sys # This module exists to give users an indication that they need to have # a version of python compatible with the RLBot framework. # Otherwise people might find out by in-the-guts error messages # after quite a while of the runner launching. minimum_python_version = (3, 6) # Deliberately using old string f...
{ "content_hash": "36fa6fffef7139d8053586a649bf9a7b", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 101, "avg_line_length": 41.35294117647059, "alnum_prop": 0.7553342816500711, "repo_name": "drssoccer55/RLBot", "id": "9d2ecaf45d4e2347dfba18c3b82505e08c98dd83", "size": "70...
from bokeh.layouts import column from bokeh.models import CustomJS, ColumnDataSource, Slider from bokeh.plotting import Figure, output_file, show output_file("callback.html") x = [x*0.005 for x in range(0, 200)] y = x source = ColumnDataSource(data=dict(x=x, y=y)) plot = Figure(plot_width=400, plot_height=400) plot...
{ "content_hash": "dadad6ecbd840c667d67455d54371821", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 66, "avg_line_length": 27.964285714285715, "alnum_prop": 0.6602809706257982, "repo_name": "ptitjano/bokeh", "id": "bf5865171113dea39a1ceaa282c3e4aa73c47f5f", "size": "783",...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_blood_razor_pirate_weak_zab_m.iff" result.attribute_template_id = 9 result.stfName("npc_name","zabrak_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "69c1a23650f69096e546a1bdaaff15e3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 83, "avg_line_length": 24.46153846153846, "alnum_prop": 0.6981132075471698, "repo_name": "anhstudios/swganh", "id": "f4954a45b7414aec264b4dab368cdda0cd855cd4", "size": "463...
import sys from django.conf import settings from django.core import exceptions from base import BaseBackend # mostly for backend compatibility default_backends = ( ("email", "notification.backends.email.EmailBackend"), ) def load_backends(): backends = [] for medium_id, bits in enumerate(getattr(setting...
{ "content_hash": "c43d878985bdc9cffe6af684d63aab9f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 117, "avg_line_length": 39.22857142857143, "alnum_prop": 0.6525855790240349, "repo_name": "brosner/django-notification", "id": "c1bd97155a11d6ffac9a254106efc7a72405d117", "...
import collections from paddle.trainer_config_helpers.layers import LayerOutput from paddle.v2.layer import parse_network from paddle.proto import TrainerConfig_pb2 __all__ = ["dump_v2_config"] def dump_v2_config(topology, save_path, binary=False): """ Dump the network topology to a specified file. This fu...
{ "content_hash": "d839a687e9ade4d1f00fdf31e7051432", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 80, "avg_line_length": 43.224489795918366, "alnum_prop": 0.6543909348441926, "repo_name": "putcn/Paddle", "id": "5dc2111e379fd39b40e1e9bcf2e577b57b101a68", "size": "2727", ...
""" base.py ------------- The base class for `Visual` objects """ import abc from ..util import ABC class Visuals(ABC): """ Parent of Visual classes. """ @abc.abstractproperty def kind(self): pass @abc.abstractmethod def update_vertices(self): pass @abc.abstractmet...
{ "content_hash": "545f96ccb90f8b1e8d31bb8d3de1e8bb", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 66, "avg_line_length": 17.571428571428573, "alnum_prop": 0.5548780487804879, "repo_name": "dajusc/trimesh", "id": "37424c4133237e69c605f2cdbf6be2dab2b44b42", "size": "984",...
import os import json import subprocess as sp import re import tempfile from crossref.restful import Works, Etiquette import bibtexparser import papers from papers.config import cached from papers import logger from papers.encoding import family_names, latex_to_unicode my_etiquette = Etiquette('papers', papers.__ver...
{ "content_hash": "75b95e01ae15a7d2147f19a93969dc77", "timestamp": "", "source": "github", "line_count": 388, "max_line_length": 119, "avg_line_length": 30.6520618556701, "alnum_prop": 0.5970739090221139, "repo_name": "perrette/myref", "id": "ab430e7c62c0181e5f12e9296edd465c7110e0b8", "size": "11893...