text
stringlengths
4
1.02M
meta
dict
import csnd6 class Audio: def __init__(self): engine = csnd6.Csound() engine.SetOption("-odac") engine.Compile("message.csd") thread = csnd6.CsoundPerformanceThread(engine) thread.Play() self.engine = engine self.thread = thread ...
{ "content_hash": "f4a03c754e7063ed7863d5f31638dcdd", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 102, "avg_line_length": 27.476190476190474, "alnum_prop": 0.5389948006932409, "repo_name": "silky/csound-expression", "id": "1b0b8409d83d758d15a8f90f879d57e637cb28ed", "siz...
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.pr...
{ "content_hash": "1712ef9020c9180203bb28b7978fe8a6", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 382, "avg_line_length": 40.21348314606742, "alnum_prop": 0.7393126571668064, "repo_name": "dweinstein/finsky", "id": "400fbb1d84d1f0438bfda4f81278b6a77e3230a7", "size": "36...
import collections import configparser import io import os import sys import textwrap import unittest import warnings from test import support class SortedDict(collections.UserDict): def items(self): return sorted(self.data.items()) def keys(self): return sorted(self.data.keys()) def va...
{ "content_hash": "97bf0c76a6b0f87aa3cec3270e46cbbb", "timestamp": "", "source": "github", "line_count": 1780, "max_line_length": 84, "avg_line_length": 40.46179775280899, "alnum_prop": 0.5502346505234512, "repo_name": "samuelhavron/heroku-buildpack-python", "id": "09c229a612ee45efb51a59276d2214971174...
""" This is unittest file for parse methods in scenario.py """ import os from pydnstest.scenario import parse_config def test_parse_config__trust_anchor(): """Checks if trust-anchors are separated into files according to domain.""" anchor1 = u'domain1.com.\t3600\tIN\tDS\t11901 7 1 aaaaaaaaaaaaaaaaaaaaaaaaaaa...
{ "content_hash": "a915a1699a8b61fe53332cb65767a150", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 95, "avg_line_length": 51.8235294117647, "alnum_prop": 0.6889897843359818, "repo_name": "CZ-NIC/deckard", "id": "d8cdea1697f4b366d432a0cf08f7a33c72614bac", "size": "881", ...
"""This script helps identify entries in PubChem.tsv that systematically lead to incorrect groundings and should therefore be removed.""" import os import re from indra.databases import chebi_client if __name__ == '__main__': # Basic positioning here = os.path.dirname(os.path.abspath(__file__)) kb_dir = o...
{ "content_hash": "db86387382af3694ffe940a168a853ea", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 77, "avg_line_length": 38.37931034482759, "alnum_prop": 0.5561545372866128, "repo_name": "clulab/bioresources", "id": "9f705e7bd772d400ab52742ddeec33d35876aa72", "size": "1...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import json import os from collections import defaultdict import six from pex.pex_info import PexInfo from twitter.common.collections import OrderedSet from pants.ba...
{ "content_hash": "e97f7b242fd1b67aba7be994b0974719", "timestamp": "", "source": "github", "line_count": 415, "max_line_length": 100, "avg_line_length": 43.2289156626506, "alnum_prop": 0.6854515050167224, "repo_name": "fkorotkov/pants", "id": "19daf533b7ab97b698480f47aa456a06a4769159", "size": "1808...
from __future__ import absolute_import, division, print_function, unicode_literals import logging import sys from botocore.exceptions import ClientError import mock from c7n.exceptions import PolicyValidationError from c7n.executor import MainThreadExecutor from c7n.resources.ebs import ( CopyInstanceTags, E...
{ "content_hash": "d85d54b2c842f381ca476952cc2e3fef", "timestamp": "", "source": "github", "line_count": 587, "max_line_length": 88, "avg_line_length": 33.756388415672916, "alnum_prop": 0.5110269997476659, "repo_name": "FireballDWF/cloud-custodian", "id": "2e5b8fb8c691d37bd38f41fe8cfc78402b2ef6dc", ...
import StringIO import json import logging import random import urllib import urllib2 import sys import re # for sending images from PIL import Image import multipart # standard app engine imports from google.appengine.api import urlfetch from google.appengine.ext import ndb import webapp2 reload(sys) sys.setdefault...
{ "content_hash": "0c061625a6485420e43364a002666197", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 194, "avg_line_length": 34.985915492957744, "alnum_prop": 0.47718733225979604, "repo_name": "anaboth/anabot", "id": "ac8339e9db64fcd3e3e1e5d6f45113f15131acb1", "size": "74...
""" Tests for django.core.servers. """ from __future__ import unicode_literals import contextlib import errno import os import socket from django.core.exceptions import ImproperlyConfigured from django.test import LiveServerTestCase, override_settings from django.utils._os import upath from django.utils....
{ "content_hash": "818e95a2dd01d971e57ac730dc2c8011", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 99, "avg_line_length": 34.69117647058823, "alnum_prop": 0.6078846969054684, "repo_name": "yephper/django", "id": "c4112db286742d8a909871ab32c88782c4b8cfb7", "size": "7108"...
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='authdog', version='0.1', description='', author='', author_email='', install_requires=[ "pec...
{ "content_hash": "616c258543eb25b3c2092dd4ab64bc30", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 48, "avg_line_length": 21.904761904761905, "alnum_prop": 0.6391304347826087, "repo_name": "chenbillcat/AuthDog", "id": "d5f58fd923a2a6dfa1d6ce6594aa6f1cf44c46a4", "size": "...
""" Minimal example showing the use of the CalltipsMode. """ import logging logging.basicConfig(level=logging.DEBUG) import sys from pyqode.qt import QtWidgets from pyqode.core.api import CodeEdit from pyqode.python.backend import server from pyqode.python.modes import CalltipsMode if __name__ == '__main__': app...
{ "content_hash": "5f434fa56041a03f997636515f850955", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 52, "avg_line_length": 24.615384615384617, "alnum_prop": 0.7046875, "repo_name": "zwadar/pyqode.python", "id": "d59ea0eda4f74e6f3e2b701317ea38ab165e7ff2", "size": "640", ...
"""Tests for VariantCalling CLIF python wrappers.""" from absl.testing import absltest from third_party.nucleus.io import fasta from third_party.nucleus.io import sam from third_party.nucleus.util import ranges from deepvariant import testdata from deepvariant.protos import deepvariant_pb2 from deepvariant.python ...
{ "content_hash": "a37dd729387baf88a6d00982ab5722d0", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 77, "avg_line_length": 31.18032786885246, "alnum_prop": 0.7003154574132492, "repo_name": "google/deepvariant", "id": "c570de3efc48b7c8727b9bd4f41a4ab31d8571b6", "size": "34...
'''------------------------------------------------------------------------- Copyright IBM Corp. 2015, 2015 All Rights Reserved Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/...
{ "content_hash": "632605d8b7f5b0d774e7bfd085dc9eff", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 87, "avg_line_length": 45.95454545454545, "alnum_prop": 0.6508407517309595, "repo_name": "Open-I-Beam/swift-storlets", "id": "a8fa904cfec90559f37b0840ecfb19255f7c268b", "si...
import boto3 class __AWS(object): def __init__(self, profile_name=None, region_name=None): self._client_cache = {} self._session = boto3.session.Session( region_name=region_name, profile_name=profile_name) def create_client(self, client_name): if client_name not in self._...
{ "content_hash": "8623d202e5042e57f048414fc48c5481", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 67, "avg_line_length": 27.12, "alnum_prop": 0.6283185840707964, "repo_name": "ryansb/kappa", "id": "65a6986bf789cd5cd0cfb429f6a6bf2ec8b02cb0", "size": "1226", "binary": f...
""" This program demonstrates the various animation classes available in salabim. """ import salabim as sim env = sim.Environment(trace=False) env.animate(True) env.modelname("Demo animation classes") env.background_color("20%gray") sim.AnimatePolygon(spec=(100, 100, 300, 100, 200, 190), text="This is\na polygon") si...
{ "content_hash": "c84dca8f1a542a07912ecfb658cbaf15", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 99, "avg_line_length": 33.51219512195122, "alnum_prop": 0.735080058224163, "repo_name": "salabim/salabim", "id": "d145f972cbf87a26a9ccbf1709e7881082675fb9", "size": "1396",...
''' This class lets us keep the user ids and passwords outside of the git repo. This is basically a port of the equivalent I added to Bruno's old stats code. Owain Kenway ''' class Secrets: def __init__(self): import configparser import os.path self.filename = os.path.join(os.path.exp...
{ "content_hash": "5caadc88f36780f039a5480ec9feffad", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 91, "avg_line_length": 37.89090909090909, "alnum_prop": 0.5580614203454894, "repo_name": "owainkenwayucl/stats-plus-plus", "id": "a770aef9cd06d622792762ee7319b331750397fb", ...
from __future__ import absolute_import, division, print_function from stripe import api_requestor, error, util, six from stripe.stripe_object import StripeObject from stripe.six.moves.urllib.parse import quote_plus class APIResource(StripeObject): @classmethod def retrieve(cls, id, api_key=None, **params): ...
{ "content_hash": "0653b3fcff328fbba074dc3d98302679", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 79, "avg_line_length": 32.10614525139665, "alnum_prop": 0.5738646250217505, "repo_name": "stripe/stripe-python", "id": "c2bcd8c61c5688d30392e4b8e67fb7d06a48b6c7", "size": ...
from collections import OrderedDict from typing import Dict, Type from .base import TraceServiceTransport from .grpc import TraceServiceGrpcTransport from .grpc_asyncio import TraceServiceGrpcAsyncIOTransport # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[TraceService...
{ "content_hash": "6c385fe4852568f92c04c145e25c72c9", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 83, "avg_line_length": 32, "alnum_prop": 0.8020833333333334, "repo_name": "googleapis/python-trace", "id": "556989a1c428860b3e0bbdcf2dfea637fea62123", "size": "1176", "bi...
import time import json import pprint import hashlib import struct import re import base64 import httplib import sys from multiprocessing import Process ERR_SLEEP = 15 MAX_NONCE = 1000000L settings = {} pp = pprint.PrettyPrinter(indent=4) class BitcoinRPC: OBJID = 1 def __init__(self, host, ...
{ "content_hash": "541b2ef93de9852722c1d61551fe0066", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 84, "avg_line_length": 26.317073170731707, "alnum_prop": 0.620636391720729, "repo_name": "PCATLMarketing/sovereigncoin", "id": "b1a400361b6dc89623ead413b9c85eab7b7acf21", ...
def sumSqDigs(number): # This works number = str(number) digs = [] for dig in number: digs.append(dig) squares = [] for item in digs: squares.append(int(item) ** 2) return sum(squares) start = 26 current = start while current != 1: print(current) current = sumSqDigs(...
{ "content_hash": "f16e616cc18a0de5042e3a331f3ceda4", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 38, "avg_line_length": 17.2, "alnum_prop": 0.6075581395348837, "repo_name": "vdrey/Project-Programs", "id": "883e3ce9916a1f33028db5c22a90395231b76ac1", "size": "825", "bi...
from django.http import JsonResponse from django.views.generic import ( View, TemplateView ) from language.generator import random_nltk_phrase as random_phrase class JSONResponseMixin(object): """ A mixin that can render a JSON response """ def render_to_json_response(self, context, **respo...
{ "content_hash": "5edee84c381234722acc43df639988e3", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 75, "avg_line_length": 25.304347826086957, "alnum_prop": 0.6374570446735395, "repo_name": "benjsto/ronquixote", "id": "68d522d3b6639a8ed671dcd7dfded91f9ece80f7", "size": "1...
import numpy as np from csv import reader import os def get_one_hot_rep(id): base = np.zeros(25) base[id-1] = 1 return base def flat_dataset(dataset): flatten_dataset = list() for sample in dataset: flatten_sample = list() for elem in sample: flatten_sample += list(...
{ "content_hash": "20ffb6ade5448818dade0395b2c53d0a", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 104, "avg_line_length": 27.338709677419356, "alnum_prop": 0.5616519174041298, "repo_name": "saaryab/dataHack2017-teamSAMI", "id": "a3e0fc2dd2f1d528a32ed30bb2ce9de30dca2f2b", ...
from .resource import Resource class AppServiceCertificateResource(Resource): """Key Vault container ARM resource for a certificate that is purchased through Azure. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource Id. :vartype id: str...
{ "content_hash": "a1e6fe591aabe754f069d4db7c3b9581", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 124, "avg_line_length": 40.67796610169491, "alnum_prop": 0.6408333333333334, "repo_name": "SUSE/azure-sdk-for-python", "id": "1219de2b3cbfe43c714a2eca47089cbaf309d7a6", "si...
""" Module for abstract serializer/unserializer base classes. """ from io import BytesIO from django.db import models from django.utils.encoding import smart_unicode from django.utils import six class SerializerDoesNotExist(KeyError): """The requested serializer was not found.""" pass class SerializationErr...
{ "content_hash": "d673f78ab37d4a2a1afc9f44d202a247", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 102, "avg_line_length": 32.50568181818182, "alnum_prop": 0.6044397832546757, "repo_name": "azurestandard/django", "id": "19886f7d53c334b933c11059dd59ed6ef067f8de", "size":...
"""This build tool generates the VirtualBox library.py Main COM API.""" from xml.dom import minidom import os import re import hashlib try: import __builtin__ as builtin except ImportError: import builtins as builtin def pythonic_name(name): s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name) name = re....
{ "content_hash": "40d0551cddd570a4cd53b4b51ab916eb", "timestamp": "", "source": "github", "line_count": 788, "max_line_length": 100, "avg_line_length": 29.049492385786802, "alnum_prop": 0.5163164562491809, "repo_name": "mjdorma/pyvbox", "id": "c802d3e08658f7d8c8dcd8535378b3002c864c96", "size": "228...
"""Test the replica_set_connection module.""" import copy import datetime import os import signal import socket import sys import time import thread import traceback import unittest sys.path[0:0] = [""] from nose.plugins.skip import SkipTest from bson.son import SON from bson.tz_util import utc from pymongo.connect...
{ "content_hash": "e157d6bd997ccab52c41e7766f6a4bb7", "timestamp": "", "source": "github", "line_count": 742, "max_line_length": 85, "avg_line_length": 37.13072776280323, "alnum_prop": 0.5898878443613662, "repo_name": "mburakergenc/Malware-Detection-using-Machine-Learning", "id": "e51464b210d95e471510...
from django.core.management.base import BaseCommand from django.contrib.auth import get_user_model from utils.user_utils import local_day_range class Command(BaseCommand): """Users should only have a single DailyProgress instance, per day. This command will delete duplicates, but only for *today*. """ ...
{ "content_hash": "89fd011eb4fce2230502deac570c3dac", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 76, "avg_line_length": 38.6, "alnum_prop": 0.5989637305699482, "repo_name": "izzyalonso/tndata_backend", "id": "bc7b65e3915cb1a193f9d370dbe856ce94012000", "size": "965", ...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models if_modified_func = """ CREATE OR REPLACE FUNCTION if_modified_func() RETURNS TRIGGER AS $body$ DECLARE row pgaudit_loggedaction; include_values boolean; log_diffs boolean; h_old hstore; h_new ...
{ "content_hash": "574f14f019a57284bbbec65bda5cde04", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 120, "avg_line_length": 43.33009708737864, "alnum_prop": 0.542684293076406, "repo_name": "StefanKjartansson/django-postgres-audit", "id": "58c494357b146d396ae43d84a6340d36d5...
import flask import auth import config from main import app import model.user as user #import User#, UserVdr github_config = dict( access_token_method='POST', access_token_url='https://github.com/login/oauth/access_token', authorize_url='https://github.com/login/oauth/authorize', base_url='https://api....
{ "content_hash": "e2df1d3def70989ef2e032310007f300", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 91, "avg_line_length": 31.82089552238806, "alnum_prop": 0.6547842401500938, "repo_name": "chdb/DhammaMap1", "id": "47d393ec3527c56e44981fde0e936613d4426dbf", "size": "2199"...
import mock from nova import context from nova import objects from nova import test from nova.tests import fixtures from nova.tests.unit import cast_as_call from nova.tests.unit import fake_network from nova.tests.unit import fake_server_actions class ComputeManagerTestCase(test.TestCase): def setUp(self): ...
{ "content_hash": "0b60dc94473ff94ea9a5fbcb954c34e7", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 78, "avg_line_length": 49.35820895522388, "alnum_prop": 0.6322951315391594, "repo_name": "mikalstill/nova", "id": "77ee20b078e773a4143e34626d3c056094c1813d", "size": "3880"...
import numpy as np import bct from sklearn.externals import joblib from my_settings import (bands, source_folder) from sklearn.ensemble import AdaBoostClassifier from sklearn.cross_validation import (StratifiedKFold, cross_val_score, permutation_test_score) from sklearn.grid_searc...
{ "content_hash": "781bdda376a9398a59adbf321b7adb03", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 78, "avg_line_length": 30.208955223880597, "alnum_prop": 0.5909090909090909, "repo_name": "MadsJensen/RP_scripts", "id": "1295343a45f1242437266f85654ef67e7ada0802", "size":...
from __future__ import absolute_import from django.conf.urls import patterns, include, url from .routers import user_router urlpatterns = patterns('userdata.api1.views', url(r'^', include(user_router.urls)), )
{ "content_hash": "9995df69e66fe63b1ac734f085ad9035", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 60, "avg_line_length": 26.666666666666668, "alnum_prop": 0.6666666666666666, "repo_name": "jsalva/crux", "id": "0d1daeab7a8e2f99419acc8b0834be61afc9db30", "size": "240", "...
from .base import BaseChart class BaseYuiChart(BaseChart): def get_data(self): data = super(BaseYuiChart, self).get_data() header = self.header data_only = data[1:] rows = [] for row in data_only: rows.append(dict(zip(header, row))) return rows def ...
{ "content_hash": "36977517cb00e13defdcf758bde57612", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 75, "avg_line_length": 23.327272727272728, "alnum_prop": 0.6289945440374123, "repo_name": "agiliq/django-graphos", "id": "567779c4ae2ac0bff587cd5a614b8d4d7302d187", "size"...
"""Home of estimator related functions. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from tensorflow.python.client import session from tensorflow.python.estimator import estimator as estimator_lib from tensorflow.python.estimator import exp...
{ "content_hash": "88e1fa75c9c263015d82487b1ee33fa4", "timestamp": "", "source": "github", "line_count": 487, "max_line_length": 85, "avg_line_length": 37.89733059548254, "alnum_prop": 0.653012570437798, "repo_name": "allenlavoie/tensorflow", "id": "8043242b709e9df961b0241437070a8e1dc0c8ec", "size":...
__author__ = 'Alfredo Saglimbeni' from distutils.core import setup from setuptools import setup, find_packages setup(name = "clean-image-crop-uploader", version = "0.2.999", description = "Clean Image Crop Uploader (CICU) provides AJAX file upload and image CROP functionalities for ImageFields with a simple w...
{ "content_hash": "f41eef1b9a83ca680c0f7f7f6c2f18d8", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 209, "avg_line_length": 37.333333333333336, "alnum_prop": 0.6448412698412699, "repo_name": "DOOMer/clean-image-crop-uploader-v3", "id": "09559673e8cf784b52692eaecbf071bdec939...
"""Test KAK over optimization""" import unittest import numpy as np from qiskit import QuantumCircuit, QuantumRegister, transpile from qiskit.circuit.library import CU1Gate from qiskit.test import QiskitTestCase class TestKAKOverOptim(QiskitTestCase): """Tests to verify that KAK decomposition does not over o...
{ "content_hash": "e11db6946a9d9eb5ebe8b9596ace02f1", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 61, "avg_line_length": 26.89090909090909, "alnum_prop": 0.5456389452332657, "repo_name": "QISKit/qiskit-sdk-py", "id": "58f792a348cf2980569e95607b3ae6e99e84e2cb", "size": "...
from cadnano.gui.controllers.viewrootcontroller import ViewRootController from .partitem import PartItem import cadnano.util as util from PyQt5.QtCore import pyqtSignal, QObject from PyQt5.QtWidgets import QGraphicsRectItem class SliceRootItem(QGraphicsRectItem): """ PathRootItem is the root item in the PathV...
{ "content_hash": "02f625947fc956e660654c8d8844b3d9", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 79, "avg_line_length": 31.402439024390244, "alnum_prop": 0.657864077669903, "repo_name": "JMMolenaar/cadnano2.5", "id": "8d4d0f9bf3ffa1291d06a72db96cca5611de8233", "size": ...
import pymongo from pymongo import MongoClient client = MongoClient('proximus.modulusmongo.net:27017') client.tepO9seb.authenticate('nasahack', 'hacking4nasa') db = client.tepO9seb if __name__ == '__main__': res = db.datasets.find({}, {"_id": 0, "identifier": 1, "title": 1, "source": 1, "description_ngram_np": 1}...
{ "content_hash": "ad6bdd92ac98350f1fb506c6aeb1862a", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 111, "avg_line_length": 31.433333333333334, "alnum_prop": 0.5832449628844114, "repo_name": "jonroberts/nasaMining", "id": "e0c30d0762efeacbd9ba7657d17f864928ebe335", "size"...
from pygments.token import Token def create_toolbar_tokens_func(get_vi_mode_enabled, get_is_refreshing): """ Return a function that generates the toolbar tokens. """ assert callable(get_vi_mode_enabled) token = Token.Toolbar def get_toolbar_tokens(cli): result = [] result.appe...
{ "content_hash": "57ca3e3b6f9f09a1ff5fd30e7f2ccf14", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 71, "avg_line_length": 32.26315789473684, "alnum_prop": 0.5791190864600326, "repo_name": "dbcli/vcli", "id": "7e427fc6f26ae72195b712d439aa2f17899f6a70", "size": "1226", "...
import math import os import random import imp common = imp.load_source("common", "/home/easyctf/easyctf/api/program-data/generators/common.py") def insert(original, new, pos): return original[:pos] + str(new) + original[pos:] def generate(full_path): try: chosen = random.sample(set(common.strings), 10) change...
{ "content_hash": "adcf4dfa0e1482b80c37007af1b85bce", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 97, "avg_line_length": 25.833333333333332, "alnum_prop": 0.6232258064516129, "repo_name": "EasyCTF/easyctf-2015", "id": "166239cd4cd3c0ee432c753b08f13c733088fff3", "size": ...
import pygame, sys, os, random from pygame.locals import * pygame.init() os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (50, 40) windowSurface = pygame.display.set_mode((1800, 980), 0, 32) pygame.display.set_caption('CLICK!') basicFont = pygame.font.SysFont(None, 23) mainClock = pygame.time.Clock() BLACK = (0, 0, ...
{ "content_hash": "7854714c34d23bab51453db7a893ec62", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 110, "avg_line_length": 30.755102040816325, "alnum_prop": 0.5802919708029197, "repo_name": "PietPtr/Expand", "id": "fe783fc8a4c89d96b77f8ebfaeed8f415c1b35ef", "size": "3014...
import os from decimal import Decimal from django.conf import global_settings EMAIL_FROM = "Test <test@server.com>" SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) ALLOWED_HOSTS = ['*'] MANAGERS = ADMINS DATAB...
{ "content_hash": "4e55c9e47e9cdd0f6cb5a253a281388d", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 85, "avg_line_length": 23.837662337662337, "alnum_prop": 0.6475074911468265, "repo_name": "andresriancho/django-plans", "id": "8b7e9b28a59be4068d27b386ad433e69b179ed6e", "...
from time import time from abc import abstractmethod from Controller.AbstractDrawingObject import AbstractDrawingObject from Controller.QtToolBox import QtToolBox __author__ = 'jbecirovski' class BaseMobileObject(AbstractDrawingObject): def __init__(self, x=-9999, y=-9999, theta=0): AbstractDrawingObject...
{ "content_hash": "b513990eda1449f1507f401f7ba7ec94", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 92, "avg_line_length": 27.630769230769232, "alnum_prop": 0.5918708240534521, "repo_name": "RoboCupULaval/UI-Debug", "id": "59a82dabeb6ece4d8b9aa8a15c66138ca412253c", "size"...
""" Module for checking the matching of braces in expressions. There are two functions here: * `match_brackets_slow`: a slow and naive implementation, mainly used as a show for the idea on how to prove the other algorithms correctness; * `match_brackets_greedy`: a greedy algorithm that works in linear time. The "sl...
{ "content_hash": "9cfa0a881cf6c9a472a69537c29182b0", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 79, "avg_line_length": 34.61744966442953, "alnum_prop": 0.620201628538193, "repo_name": "vsego/misc", "id": "8b2ef3ed46bf87a5f093eac81a17e8a436d94b46", "size": "5182", "...
from os.path import join import unittest import logging import types class TestBase(unittest.TestCase): @classmethod def _create_tests(cls, globals, **funcs): for name, func in funcs.items(): newfunc = types.FunctionType( name=name, code=func.__code__, glob...
{ "content_hash": "20df2ccf87bc96df37aa565ad1013648", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 75, "avg_line_length": 33.911764705882355, "alnum_prop": 0.5333911535125759, "repo_name": "thisch/python-falafel", "id": "4234c75047cd415ebd597bddd5a89d738329c607", "size":...
"""Conv2d with L2-normalized weights option.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint:disable=g-direct-tensorflow-import from tensorflow.contrib.framework.python.ops import variables from tensorflow.contrib.layers.python.layers import init...
{ "content_hash": "340df82940c45bcc8da46f2b6a075fa7", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 82, "avg_line_length": 35.112, "alnum_prop": 0.620414673046252, "repo_name": "google-coral/imprinting-training", "id": "4c7664cfca5ca7dd42ff6e43c2c0f9c8e6adf413", "size": ...
import pyyacp.datatable as datatable from pyyacp.table_structure_helper import AdvanceStructureDetector SAMPLES_PATH = "sample_csvs" from os import listdir from os.path import isfile, join onlyfiles = [join(SAMPLES_PATH, f) for f in listdir(SAMPLES_PATH) if isfile(join(SAMPLES_PATH, f))] for csv_file in onlyfiles:...
{ "content_hash": "41ba9cfb69534e851c72deee573080ef", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 104, "avg_line_length": 28.03448275862069, "alnum_prop": 0.7207872078720787, "repo_name": "ODInfoBiz/pyyacp", "id": "f18e5d8c3b0e4e6172983ca58588c918459d83cb", "size": "861...
""" Upgrades a configuration from a mapping file. Mapping files have a series of search/replace instructions in the form s/<old_value>/<new_value>/ This will rewrite the configurations if any changes are required. """ import logging import sys import os, glob, string import desktop.conf import desktop.log from deskto...
{ "content_hash": "88f574052d384a09f6ddedfccd7069bb", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 126, "avg_line_length": 34.87671232876713, "alnum_prop": 0.6319717203456402, "repo_name": "kawamon/hue", "id": "c5f4909dfd8e850aadff8f0c98b02799b41c8930", "size": "3337", ...
from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.template import RequestContext from django.contrib.auth.models import User from django.http import Http404 from todo.models import Todo def TodoView(request): template_name = 'todo/todo.html' todolist ...
{ "content_hash": "2f1e948332c05d6dae94e032af60e364", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 106, "avg_line_length": 33.47222222222222, "alnum_prop": 0.6724757952973721, "repo_name": "kwailamchan/programming-languages", "id": "3aa812dff1dbbea57b7cd9ec94203235862b48f...
import base64 from collections import defaultdict, OrderedDict from functools import wraps import hashlib import logging import os import threading import time import types from google.appengine.api import memcache as mod_memcache from google.appengine.ext import db, ndb, deferred from mcfw.consts import MISSING from...
{ "content_hash": "b1141d2a1deca95bee6efc9c402ab2c7", "timestamp": "", "source": "github", "line_count": 393, "max_line_length": 132, "avg_line_length": 39.040712468193384, "alnum_prop": 0.5491755197810076, "repo_name": "our-city-app/oca-backend", "id": "deaf78359112201811feff43c96ed9bf74e57e22", "s...
import kchan.timedtext as timedtext ID3_START = "TAG" ID3_LENGTH = 128 SIZE_LENGTH = 6 START_TAG = "LYRICSBEGIN" END_TAG = "LYRICS200" SIZE_OFFSET = -(SIZE_LENGTH + len(END_TAG) + ID3_LENGTH) FIELD_ID_LENGTH = 3 FIELD_SIZE_LENGTH = 5 def read(filepath): """Read Lyrics3 v2.00 data from an mp3 file Args: ...
{ "content_hash": "e423bc5375491c68310d1c60abd61ea7", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 94, "avg_line_length": 31.386363636363637, "alnum_prop": 0.5999275887038378, "repo_name": "ichung/karaoke-chan", "id": "24b822cdd59ec11e61f1754f89ad6c1d49729a70", "size": ...
import argparse import sys import traceback import numpy as np import pandas as pd import scipy as sp import scikits.bootstrap as bootstrap from learners.logistic_regression import LogisticRegression from libsvm_format import read_libsvm class InputDataError(Exception): pass def shuffle_data(df): return d...
{ "content_hash": "f66e4746d0ae9e1826d77d126976c88b", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 102, "avg_line_length": 32.398058252427184, "alnum_prop": 0.5762661072819898, "repo_name": "drsmithization/reconditorium", "id": "7856e0fa3c525bdfcafa96d529a7f85b15e25f2a", ...
import copy from functools import partial import json import os import requests import sys import subprocess import time import traceback try: import urlparse except ImportError: from urllib import parse as urlparse UPSTREAMABLE_PATH = 'tests/wpt/web-platform-tests/' NO_SYNC_SIGNAL = '[no-wpt-sync]' def upstr...
{ "content_hash": "cab0472e1db1a1d083d3675bef9ece90", "timestamp": "", "source": "github", "line_count": 494, "max_line_length": 121, "avg_line_length": 37.030364372469634, "alnum_prop": 0.5960203356475154, "repo_name": "servo-automation/upstream-wpt-sync-webhook", "id": "d147496d15d1ca49a83842cf73e51...
from collections import OrderedDict import datetime from django.db import models from django.conf import settings from django import forms from django.utils.translation import gettext_lazy as _ from django.core.exceptions import PermissionDenied from django.template.response import TemplateResponse from django.contrib...
{ "content_hash": "05411ee30b04ddc765f505b3d6db6115", "timestamp": "", "source": "github", "line_count": 705, "max_line_length": 94, "avg_line_length": 33.0468085106383, "alnum_prop": 0.5562709245428792, "repo_name": "fin/froide", "id": "ee25b3ae305a72da69bc56fa946c0497a7bc395b", "size": "23298", ...
''' REST API implementation: + Flask Requires: + MySQL + SqlAlchemy ''' __author__ = "monchitos82" __copyright__ = "Ramon Fierro, 2015" __credits__ = "monchitos82" __maintainer__ = "monchitos82" __email__ = "monchitos82@gmail.com" __status__ = "" from flask import Flask, session, abort from ...
{ "content_hash": "81d7126635c4b3a2ee9fbb7f5bddbe4c", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 94, "avg_line_length": 29.33783783783784, "alnum_prop": 0.6784891754951635, "repo_name": "monchitos82/shop", "id": "a4420307f01dea4c3f2af7693f7a75695881c92e", "size": "2196...
import unittest from jondis.tests.manager import Manager class BaseJondisTest(unittest.TestCase): def setUp(self): self.manager = Manager() self.start() def start(self): """We always need to run the base setup, so we might as well just call start() instead of using super() o...
{ "content_hash": "e407d0302c3993425e2b9fb648eaffae", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 78, "avg_line_length": 27.285714285714285, "alnum_prop": 0.6108202443280978, "repo_name": "zhihu/jondis", "id": "9f30db617d6f2e3b266ce2135a25ee615eb16d27", "size": "573", ...
"""Tests for the ClimaCell Weather API integration."""
{ "content_hash": "756793bf9cfd1bcd49110d52df5b3f60", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 54, "avg_line_length": 55, "alnum_prop": 0.7454545454545455, "repo_name": "kennedyshead/home-assistant", "id": "04ebc3c14c39c2ca32c46ac7b83582416ebb1eb0", "size": "55", "b...
import numpy as np import pandas as pd from datetime import datetime from sklearn.metrics import accuracy_score from sklearn.metrics import confusion_matrix from sklearn.svm import LinearSVC from sklearn.model_selection import train_test_split from sklearn.preprocessing import normalize from test_feature_sets import ge...
{ "content_hash": "a94adf054cde43bf9902c3a9b0131760", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 109, "avg_line_length": 30.215686274509803, "alnum_prop": 0.6203763789746918, "repo_name": "tjkemp/image-tractor", "id": "e48432811ea64002f6631bdcb644c0de22b3d2e9", "size":...
import unittest from kattis import k_different ############################################################################### class SampleInput(unittest.TestCase): '''Problem statement sample inputs and outputs''' def test_sample_input_1(self): '''Run and assert problem statement sample 1 input and ...
{ "content_hash": "9e68e7030213ebf4cc148424bd42bd7c", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 87, "avg_line_length": 32.72727272727273, "alnum_prop": 0.5333333333333333, "repo_name": "ivanlyon/exercises", "id": "879baa703f2061670c19d6b3efa08b9a185f0841", "size": "72...
import os from flask import Flask, url_for, redirect, render_template, request from flask_sqlalchemy import SQLAlchemy from wtforms import form, fields, validators import flask_admin as admin import flask_login as login from flask_admin.contrib import sqla from flask_admin import helpers, expose from werkzeug.security ...
{ "content_hash": "136c32d5a58c1d00f86d66145433becb", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 132, "avg_line_length": 32.122727272727275, "alnum_prop": 0.6431300410358002, "repo_name": "flask-admin/flask-admin", "id": "b29803841f3bafc31f8232286c84fdba6a74fa8e", "si...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "7d681dc6ee2300735b7bf3c559d8dce2", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 136, "avg_line_length": 35.701492537313435, "alnum_prop": 0.6433946488294314, "repo_name": "radicalbit/ambari", "id": "e23e18b57048b8736193607e878ebe0e5acf254a", "size": "2...
import threading from PyQt5.QtGui import QCursor from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QSlider, QToolTip from electrum.i18n import _ class FeeSlider(QSlider): def __init__(self, window, config, callback): QSlider.__init__(self, Qt.Horizontal) self.config = config self....
{ "content_hash": "895ccd3ca2c6d755cdac195cda6aa065", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 123, "avg_line_length": 34.1875, "alnum_prop": 0.5513711151736745, "repo_name": "neocogent/electrum", "id": "25be72b8637a48f331912b83c9474610f110c7f8", "size": "2735", "b...
from __future__ import print_function, division import math import ui import messages_from_ui class GtkUI(object): """Gtk+ UI class.""" def __init__(self, font): """Initialize the UI instance.""" pass def start(self, bridge): """Start the UI event loop.""" bridge.attach...
{ "content_hash": "15ac4f4c5243107aef541eccc1d3f742", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 76, "avg_line_length": 26.294871794871796, "alnum_prop": 0.5, "repo_name": "meatich/NeoSFML", "id": "96244060e17d2f36e714a8f1962e72990161d188", "size": "4102", "binary":...
import logging import numpy as np from lcc.stars_processing.utilities.base_descriptor import BaseDescriptor from lcc.stars_processing.utilities.compare import ComparativeBase from lcc.stars_processing.utilities.symbolic_representation import SymbolicRepresentation from lcc.utils.data_analysis import compute_bins cla...
{ "content_hash": "366a96fd1197b01fdddbce978213d6b9", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 106, "avg_line_length": 32.53333333333333, "alnum_prop": 0.594672131147541, "repo_name": "mavrix93/LightCurvesClassifier", "id": "9db1923cd32bdb0c0f7f9f9e8094538e1b2f7030", ...
from zeit.cms.i18n import MessageFactory as _ import zc.form.field import zc.form.interfaces import zeit.cms.content.field import zeit.cms.content.sources import zeit.cms.interfaces import zeit.cms.repository.interfaces import zeit.cms.tagging.interfaces import zope.component.interfaces import zope.interface import zop...
{ "content_hash": "fc8e6b6907ad4062a100725b10e26747", "timestamp": "", "source": "github", "line_count": 705, "max_line_length": 79, "avg_line_length": 30.2709219858156, "alnum_prop": 0.659997188510379, "repo_name": "ZeitOnline/zeit.cms", "id": "e82f8d0b8cdae93c2d8d2fa21fe4b58ac2690847", "size": "21...
from hail.utils.java import Env from hail.typecheck import typecheck, enumeration from typing import Dict, List @typecheck(path=str, mode=enumeration('r', 'w', 'x', 'rb', 'wb', 'xb'), buffer_size=int) def hadoop_open(path: str, mode: str = 'r', buffer_size: int = 8192): """Open a file throug...
{ "content_hash": "524b45560fb4325b93df2124b1dd8c97", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 86, "avg_line_length": 28.33877551020408, "alnum_prop": 0.595275817370013, "repo_name": "cseed/hail", "id": "1a7742377dab20fb2a10abecd35ef6c00cdd8887", "size": "6943", "...
''' Created on 20 Nov 2014 Copyright (c) 2014 Brendan Gray and Sylvermyst Technologies 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 limit...
{ "content_hash": "6e5c1a5d10524a785b7b7673fd134258", "timestamp": "", "source": "github", "line_count": 456, "max_line_length": 210, "avg_line_length": 31.614035087719298, "alnum_prop": 0.5374583795782464, "repo_name": "Sylvermyst-Technologies/Onnapt", "id": "ce229502a62e6979ad7f34a55a1a32cf340088f9"...
"""Tests for NetApp e-series iscsi volume driver.""" import copy import json import re import mock import requests from six.moves import urllib from cinder import exception from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers.netapp import common from cinder.volume.drive...
{ "content_hash": "0a67adb8eaf8e424e2b3a745d88f295e", "timestamp": "", "source": "github", "line_count": 1031, "max_line_length": 79, "avg_line_length": 50.926285160038795, "alnum_prop": 0.5695648033520617, "repo_name": "tlakshman26/cinder-bug-fix-volume-conversion-full", "id": "e48d89861314ee4f7d594a...
from google.cloud import accessapproval_v1 def sample_list_approval_requests(): # Create a client client = accessapproval_v1.AccessApprovalClient() # Initialize request argument(s) request = accessapproval_v1.ListApprovalRequestsMessage( ) # Make the request page_result = client.list_app...
{ "content_hash": "f3ce4c054fda70a40cd42f0e7bba5e04", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 76, "avg_line_length": 27.05263157894737, "alnum_prop": 0.7392996108949417, "repo_name": "googleapis/python-access-approval", "id": "88050532ceaf79fac8c208daf57ceac42b6f3718"...
import time import subprocess class ImageCreator: IMAGE_FREQUENCY=30 IMAGE_FOLDER="/storage/pic/" def __init__(self): self.last_img = 0; def createFilename(self): now = time.time() return self.IMAGE_FOLDER + "image-" + time.strftime("%Y%m%d%H%M%S") + ".jpg" def createImage(self): now = time.time() ...
{ "content_hash": "a7086f4c7f8a04f8a23d0579fa204d3d", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 97, "avg_line_length": 23.607142857142858, "alnum_prop": 0.6096822995461422, "repo_name": "Ajnasz/seccampi", "id": "61f2e91c31cd43b2b29768b4a4203cc71eda21af", "size": "661"...
import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/500...
{ "content_hash": "96ff6d10250debc73c7174ce1b7e6808", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 101, "avg_line_length": 29.29741379310345, "alnum_prop": 0.5400912167132559, "repo_name": "XiaosongWei/crosswalk-test-suite", "id": "0eb6725f9db8a2e68c5455186edf35616240647f...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Benchmark.name' db.alter_column('webscript_backend_benchmark', 'name', self.gf('django.db.models.fields.CharField...
{ "content_hash": "ea3f52417724b770c7415edbaf8b534e", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 182, "avg_line_length": 75.30081300813008, "alnum_prop": 0.556359317641978, "repo_name": "sbarman/webscript_db", "id": "89d0cf315cd1e6f81e1e413bba8c5a239f5f9467", "size": ...
from pandac.PandaModules import DepthOffsetAttrib, NodePath, Vec3, Vec4, TextNode from direct.directnotify import DirectNotifyGlobal from direct.fsm.FSM import FSM from direct.interval.FunctionInterval import Wait from direct.interval.IntervalGlobal import Func, LerpHprInterval, LerpScaleInterval, LerpFunctionInterval ...
{ "content_hash": "e4e5d6f21fe538575bd78ce713b32f3c", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 476, "avg_line_length": 47.41917808219178, "alnum_prop": 0.6781257222093829, "repo_name": "ksmit799/Toontown-Source", "id": "7c610924e77a6fae1934713e93e4126f21461c03", "si...
import random, sys from rpython.flowspace.operation import op from rpython.rlib import debug from rpython.rlib.rarithmetic import is_valid_int from rpython.rtyper.lltypesystem import lltype, llmemory from rpython.tool.sourcetools import func_with_new_name # ____________________________________________________________ ...
{ "content_hash": "52be74bdfbf4a719ccd375a2cbf96c23", "timestamp": "", "source": "github", "line_count": 763, "max_line_length": 91, "avg_line_length": 28.588466579292266, "alnum_prop": 0.6403520836198597, "repo_name": "oblique-labs/pyVM", "id": "630ceca9e3382183b70ab419f174cd9387d73d17", "size": "2...
from os import system import univention.uldap as ul from univention_openvpn_common import maxvpnusers lo = ul.getMachineConnection() maxu = 5 lobs = lo.search('(univentionOpenvpnLicense=*)') for lob in lobs: key = lob[1].get('univentionOpenvpnLicense', [None])[0] mu = maxvpnusers(0, key) if mu > maxu: ma...
{ "content_hash": "6fb6fcae4f3228eba01dd766f95f7123", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 104, "avg_line_length": 31, "alnum_prop": 0.6480938416422287, "repo_name": "bytemine/univention-openvpn", "id": "acb8e7a3cf3298e5821a35db8f5ad92f1247394d", "size": "2439", ...
import os.path as op import warnings from collections import namedtuple from nose.tools import assert_raises import numpy as np from mne import io, read_events, Epochs from mne import pick_types from mne.utils import run_tests_if_main, requires_scipy_version from mne.channels import read_layout from mne.viz import ...
{ "content_hash": "9a116b1737041bd0c57447e746630245", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 78, "avg_line_length": 32.348314606741575, "alnum_prop": 0.6172282042375825, "repo_name": "dgwakeman/mne-python", "id": "6521094f3b1d9950e8572dab7b50914e5c381bd6", "size":...
"""Test parenthetics.py.""" def test_evaluate_parens_0(): """Test first case.""" from parenthetics import evaluate_parens assert evaluate_parens('') == 0 def test_evaluate_parens_01(): """Test second case.""" from parenthetics import evaluate_parens assert evaluate_parens('()') == 0 def te...
{ "content_hash": "0af869f9fbd059685b2557542feb5715", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 44, "avg_line_length": 24.516129032258064, "alnum_prop": 0.65, "repo_name": "palindromed/data-structures2", "id": "02d92ec1b9102a74851d50d45df9e0420f8ff91e", "size": "786",...
"""SCons.Tool.aixc++ Tool-specific initialization for IBM xlC / Visual Age C++ compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is h...
{ "content_hash": "57117396bf0607a3b8012ad4ca8a63f7", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 117, "avg_line_length": 38.76744186046512, "alnum_prop": 0.7696460707858428, "repo_name": "kayhayen/Nuitka", "id": "4a78edaf3fe465172ee199ae428badb576e921bb", "size": "1667...
import logging, sys from logging import DEBUG, INFO, WARNING, ERROR FRAME = DEBUG - 5 LOG_NAMES = {'frame': FRAME, 'debug': DEBUG, 'info': INFO, 'warning': WARNING, 'error': ERROR} SORTED_NAMES = tuple(k for k, v in sorted(LOG_NAMES.items())) VERBOSE_FMT = '\ %(asctime)s,%(msecs)d %(levelname)-7s [%(file...
{ "content_hash": "d354a76413a580fdcaf5a2ece277e30c", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 80, "avg_line_length": 32.263803680981596, "alnum_prop": 0.6560182544209926, "repo_name": "rec/BiblioPixel", "id": "f529c4813f8b75165f779bbc899273cd0287474c", "size": "525...
import uuid from mock import Mock from mock import patch from novaclient import exceptions as nova_exceptions from trove.cluster.models import Cluster from trove.cluster.models import ClusterTasks from trove.cluster.models import DBCluster from trove.common import exception from trove.common import remote from trove...
{ "content_hash": "0ebceb7e2e424a82715f2c0ae5de839b", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 79, "avg_line_length": 44.185483870967744, "alnum_prop": 0.5529597858489992, "repo_name": "zhangg/trove", "id": "ba8c76a3deb65dca44c8020fe444db6810051031", "size": "17039"...
"""Functions to work with classification models.""" import collections import operator import numpy as np Class = collections.namedtuple('Class', ['id', 'score']) def input_details(interpreter, key): """Returns input details by specified key.""" return interpreter.get_input_details()[0][key] def input_size(in...
{ "content_hash": "286eaf6ee3840196f95854a28cacd6a4", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 77, "avg_line_length": 29.387096774193548, "alnum_prop": 0.7074643249176729, "repo_name": "google-coral/tflite", "id": "abcf62d38a30160680cd732f8d522be61622420a", "size": "...
"""`VideoStimulus`, `BostonTrain`, `GirlPool`""" from os.path import dirname, join import numpy as np from math import isclose import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation from skimage.color import rgb2gray from skimage.transform import (resize as vid_resize, rotate as vid_rotate, ...
{ "content_hash": "e5be3a934d50bafb338e7ec1978de610", "timestamp": "", "source": "github", "line_count": 769, "max_line_length": 104, "avg_line_length": 40.070221066319895, "alnum_prop": 0.5668202764976958, "repo_name": "mbeyeler/pulse2percept", "id": "a81c01278bbc3afcf342960c60a09e3b64280891", "siz...
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from pants.backend.jvm.targets.scala_library import ScalaLibrary class ScalacPlugin(ScalaLibrary): """Defines a target that produces a scalac_plugin.""" def __i...
{ "content_hash": "0fab08c376ecc68b4c8e975bab0bc644", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 93, "avg_line_length": 34, "alnum_prop": 0.6890756302521008, "repo_name": "Ervii/garage-time", "id": "c355024fa29c168fd6a3d13533b6ade563bdc14e", "size": "861", "binary": ...
"""Minification helpers. This module provides enhanced versions of the ``javascript_link`` and ``stylesheet_link`` helpers in ``webhelpers.html.tags``. These versions add two additional arguments: javascript_link(url, minified=False, combined=False) stylesheet_link(url, combined=False) * **minified**: If true, redu...
{ "content_hash": "47d0bf1fb4a4c246188d12dde9a2d276", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 78, "avg_line_length": 31.592741935483872, "alnum_prop": 0.595405232929164, "repo_name": "ryanpetrello/draughtcraft", "id": "8faed889916fb05540641205dee47bc0b43eb70f", "si...
from .nn_classifier import * from .nn_image_reader import * from .nn_image_schema import * from .tree_model import *
{ "content_hash": "de79235756cf4081796b4d2702ac4fde", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 30, "avg_line_length": 29.25, "alnum_prop": 0.7435897435897436, "repo_name": "intel-analytics/BigDL", "id": "54cd5e2611c1e57c4176eb9dedb913d1493dd5e9", "size": "704", "bin...
from __future__ import absolute_import from django import forms from django.contrib import messages from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.utils.translation import ugettext_lazy as _ from sentry.api import client from sentry.web.frontend.base import TeamV...
{ "content_hash": "b7e79f6cc63a58411bad4f8d71b83f07", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 93, "avg_line_length": 29.09090909090909, "alnum_prop": 0.6421875, "repo_name": "JamesMura/sentry", "id": "546dfe0739de71247ab5dbc7b9d2f1aca6d3610e", "size": "1280", "bin...
""" .. moduleauthor:: Gabriel Martin Becedillas Ruiz <gabriel.becedillas@gmail.com> """ from pyalgotrade.stratanalyzer import returns from pyalgotrade import warninghelpers from pyalgotrade import broker import datetime class PositionState(object): def onEnter(self, position): pass # Raise an excep...
{ "content_hash": "5ad51111df98477af0304e6b0640b104", "timestamp": "", "source": "github", "line_count": 501, "max_line_length": 200, "avg_line_length": 45.26746506986028, "alnum_prop": 0.6789981921601481, "repo_name": "cgqyh/pyalgotrade-mod", "id": "c7919c5b72fbea0f2b79a011b7e7ee7f5d1176cb", "size"...
from django.apps import AppConfig class DefaultConfig(AppConfig): name = 'default'
{ "content_hash": "fd57d0ecdbb518b0d2021287fa73c775", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 17.8, "alnum_prop": 0.7528089887640449, "repo_name": "atulmishra-one/repose-academy", "id": "26fe47f5b6909e8985080c23be6fb597113d2953", "size": "89", ...
from __future__ import absolute_import, print_function import logging import json import bokeh.server.tornado as tornado from bokeh.application import Application from bokeh.client import pull_session from bokeh.server.views.static_handler import StaticHandler from .utils import ManagedServerLoop, url, http_get lo...
{ "content_hash": "ed2eff239cd1ddf61316c58ea5eb5c70", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 94, "avg_line_length": 39.68702290076336, "alnum_prop": 0.6408924793229467, "repo_name": "dennisobrien/bokeh", "id": "109e52fa91cc31ac5adfcb944886b1c89b4ba521", "size": "5...
""" Created on Sat Nov 18 12:27:16 2017 @author: Stefan Peidli This script reads sgf files from a file directory, converts them into pairs of "current board - next move" and stores them either in a dictionary or in a sqlite3 database. """ import os from collections import defaultdict from Board import * from Filters...
{ "content_hash": "1215273d62acf7445506fa6fde88c422", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 183, "avg_line_length": 43.36521739130435, "alnum_prop": 0.5732905554441547, "repo_name": "stefanpeidli/GoNet", "id": "61eddfa4d6fe9359fa77088a788b9bcd02ce14c6", "size": "...
import types import warnings import pickle import re from copy import deepcopy from functools import partial, wraps from inspect import signature import numpy as np from scipy import sparse from scipy.stats import rankdata import joblib from . import IS_PYPY from .. import config_context from ._testing import _get_ar...
{ "content_hash": "7cc04bdb7fcc1539fcf40226b87c0299", "timestamp": "", "source": "github", "line_count": 3423, "max_line_length": 112, "avg_line_length": 35.120654396728014, "alnum_prop": 0.6073133806917433, "repo_name": "amueller/scikit-learn", "id": "effa77cea260984ace75d8662a4ca4d4787078e1", "siz...
""" Flask-RESTful request parsers which help enforce argument needs for IB types: * Order * Contract """ from flask_restful import reqparse __author__ = 'Jason Haury' # --------------------------------------------------------------------- # ORDER PARSER # ------------------------------------------------------------...
{ "content_hash": "3b3d8a3009fd0e1c079f2f25d38cc969", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 140, "avg_line_length": 70.21951219512195, "alnum_prop": 0.6193122612018062, "repo_name": "hamx0r/ibrest", "id": "67c65d1b9de9d5285559892ac278cbc5fb312b98", "size": "2879",...
"""Unit tests for FC Zone Manager.""" from unittest import mock from cinder import exception from cinder.tests.unit import test from cinder.volume import configuration as conf from cinder.zonemanager.drivers import fc_zone_driver from cinder.zonemanager import fc_zone_manager fabric_name = 'BRCD_FAB_3' init_target_m...
{ "content_hash": "fdfe974d4b69a925cbe66951392919e7", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 79, "avg_line_length": 41.8515625, "alnum_prop": 0.6010826955385477, "repo_name": "openstack/cinder", "id": "ec9fcd72c9b8c6b7a2c211865be986f675e731e4", "size": "6064", "...
from __future__ import unicode_literals from django.contrib import admin from django.db.models import Max from django.template.context import Context from django.template.loader import get_template from django.utils.translation import ugettext_lazy as _ from adminsortable2.admin import SortableAdminMixin, Polymorphic...
{ "content_hash": "ceaffcb249725682f8f680ba72926397", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 104, "avg_line_length": 44.449438202247194, "alnum_prop": 0.7171385237613751, "repo_name": "nimbis/django-shop", "id": "816b19ea971cf1879080107f5864598c3d41620f", "size": "...
import collections from capstone import * from capstone.x86 import * import pwndbg.arch import pwndbg.memory import pwndbg.regs import pwndbg.typeinfo groups = {v:k for k,v in globals().items() if k.startswith('X86_GRP_')} ops = {v:k for k,v in globals().items() if k.startswith('X86_OP_')} regs = {v:k for k,v i...
{ "content_hash": "e4a630685053de17c3c3f5a0cac68401", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 83, "avg_line_length": 30.179775280898877, "alnum_prop": 0.5241995532390171, "repo_name": "anthraxx/pwndbg", "id": "983f69d0dbf4a8b9c5f3f4da18c8869e8eede089", "size": "541...
import functools import pytest from sentry.exceptions import InvalidConfiguration from sentry.testutils.cases import TestCase from sentry.utils.redis import ( ClusterManager, _shared_pool, get_cluster_from_options ) make_manager = functools.partial( ClusterManager, { 'redis.clusters': { ...
{ "content_hash": "ce06a20faf71669a48356abaad22c31c", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 73, "avg_line_length": 24.5, "alnum_prop": 0.4873663751214772, "repo_name": "daevaorn/sentry", "id": "579647e6a5aa8279321f08927cde949f76e7f6cd", "size": "2058", "binary":...
from typing import Dict from vnpy.event import Event, EventEngine from vnpy.trader.engine import MainEngine from vnpy.trader.ui import QtCore, QtGui, QtWidgets from vnpy.trader.ui.widget import ( MsgCell, TimeCell, BaseMonitor ) from ..base import ( APP_NAME, EVENT_PORTFOLIO_LOG, EVENT_PORTFOLI...
{ "content_hash": "cf94c8ce494531d02c19f84a295473c9", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 83, "avg_line_length": 28.98861047835991, "alnum_prop": 0.5938236680810938, "repo_name": "bigdig/vnpy", "id": "6e03099f37926b14bb1b10f5b989003a73d23eb6", "size": "12834", ...
import sys from collections import OrderedDict from urllib import parse from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.db.models import Manager from django.db.models.query import QuerySet from django.urls import NoReverseMatch, Resolver404, get_script_prefix, resolve from djang...
{ "content_hash": "32dc10c7c56f0c572c5af371d285bf99", "timestamp": "", "source": "github", "line_count": 563, "max_line_length": 90, "avg_line_length": 35.88809946714032, "alnum_prop": 0.6112348428606781, "repo_name": "tomchristie/django-rest-framework", "id": "c9870078427f7b828630dd7bad971eecb3c1b8f1...
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Rangebreak(_BaseLayoutHierarchyType): # class properties # -------------------- _parent_path_str = "layout.xaxis" _path_str = "layout.xaxis.rangebreak" _valid_props = { "bounds"...
{ "content_hash": "da9cb46abb77d1969742d22248ad7e30", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 84, "avg_line_length": 34.602094240837694, "alnum_prop": 0.5596156755938871, "repo_name": "plotly/python-api", "id": "8a80af7c7de169a13d1b43615af49e4798938830", "size": "1...
''' ==================================================================== Copyright (c) 2003-2010 Barry A Scott. All rights reserved. This software is licensed as described in the file LICENSE.txt, which you should have received as part of this distribution. ======================================================...
{ "content_hash": "d106bd6129ab4a7fd45264cc1c4fb59e", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 114, "avg_line_length": 37, "alnum_prop": 0.5363636363636364, "repo_name": "barry-scott/scm-workbench", "id": "43bfed18e771c50f43056b2dc3ec80caa0161887", "size": "8140", ...