text
stringlengths
4
1.02M
meta
dict
""" Created on Tue Apr 28 23:15:29 2015 @author: ddboline """ import os import matplotlib matplotlib.use('Agg') import pylab as pl from pandas.tools.plotting import scatter_matrix def create_html_page_of_plots(list_of_plots, prefix='html'): """ create html page with png files """ if not os.path.exist...
{ "content_hash": "ed205d5c72434c215d415744b2619cc8", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 75, "avg_line_length": 30.753846153846155, "alnum_prop": 0.5652826413206603, "repo_name": "abhishek-ch/kaggle_facebook_recruiting_human_or_bot", "id": "86f7b5c4f36b9ae477913e...
import re import uuid from xml.dom import minidom from eventlet import greenthread from lxml import etree import mock from mox3 import mox from oslo_concurrency.fixture import lockutils as lock_fixture from nova.compute import utils as compute_utils from nova import exception from nova.network import linux_net from n...
{ "content_hash": "e7600c89d90ed08bbbe69f66218d8201", "timestamp": "", "source": "github", "line_count": 699, "max_line_length": 79, "avg_line_length": 45.464949928469245, "alnum_prop": 0.5571428571428572, "repo_name": "HybridF5/nova", "id": "6a203a19147cd41cb9ce715868e5311578c4c5db", "size": "32436...
from django import forms from models import Package from models import Project, ProjectCategory class ProjectFormEdit(forms.Form): choices = [] for package in Package.objects.all(): choices.append((package.id, str(package))) package = forms.ChoiceField(choices=choices) username = forms.Char...
{ "content_hash": "112d7e4caaa6f9130770ef26674bbf0b", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 73, "avg_line_length": 31.737704918032787, "alnum_prop": 0.6291322314049587, "repo_name": "youprofit/rust-ci-1", "id": "776a6f285930ec80d4e1e7eb107a55287fd0caaa", "size": "...
import sys from ev3dev2 import Device if sys.version_info < (3, 4): raise SystemError('Must be using Python 3.4 or higher') class PowerSupply(Device): """ A generic interface to read data from the system's power_supply class. Uses the built-in legoev3-battery if none is specified. """ SYSTEM...
{ "content_hash": "7fa3ddda972dd53b86fd6fbc0959f2ac", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 109, "avg_line_length": 29.337209302325583, "alnum_prop": 0.6091954022988506, "repo_name": "rhempel/ev3dev-lang-python", "id": "d33c38fcd2fd190a771864ee7dde5bc472e56bd5", "...
import os import glob from subprocess import check_output bigipaddr = "10.1.1.4" for f in glob.glob('./*.json.deploy'): print f os.system("./scripts/deploy_iapp_bigip.py -r " + bigipaddr + " " + f)
{ "content_hash": "cf399690331b8391436d7b9eeb8df8f8", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 73, "avg_line_length": 23, "alnum_prop": 0.6570048309178744, "repo_name": "plcharbonneau/jenkins_demo", "id": "6e7353b5bb14da47b698b30612ea8ee355b2fc7f", "size": "392", "b...
from __future__ import unicode_literals import os import unittest from copy import copy from decimal import Decimal from django.conf import settings from django.contrib.gis.geos import HAS_GEOS from django.db import connection from django.test import TestCase, override_settings from django.utils._os import upath if ...
{ "content_hash": "010b5aa3d36bd7a11c17fdd00c2ba958", "timestamp": "", "source": "github", "line_count": 341, "max_line_length": 105, "avg_line_length": 42.023460410557185, "alnum_prop": 0.6280530355896721, "repo_name": "cloudera/hue", "id": "2f5fe58d48bdefc0673b2ad222b5d8f384b4bd4e", "size": "14355...
#!/usr/bin/env python3 import argparse import glob import os import shutil import sys from typing import List ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(ZULIP_PATH) import pygments from scripts.lib import clean_unused_caches from scripts.lib.zulip_tools ...
{ "content_hash": "28827416364979097d3c3afd63bea42b", "timestamp": "", "source": "github", "line_count": 393, "max_line_length": 96, "avg_line_length": 31.798982188295167, "alnum_prop": 0.6103064735536529, "repo_name": "andersk/zulip", "id": "acc1856ff0e41434243c71b39eb802f82b15ddfd", "size": "12497...
import logging from twisted.internet import reactor, ssl from txjsonrpc.web.jsonrpc import Proxy from OpenSSL import SSL from twisted.python import log def printValue(value): print "Result: %s" % str(value) def printError(error): print 'error', error def shutDown(data): print "Shutting down reactor..." ...
{ "content_hash": "cf38c32a7eb9dfe520b10b2b3dc2e857", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 87, "avg_line_length": 29.27659574468085, "alnum_prop": 0.6911337209302325, "repo_name": "medialab/txjsonrpc", "id": "bec17d266f70a7c281147ef79d78f9fa5dd58dc7", "size": "13...
from .curl_connector import CurlConnector
{ "content_hash": "289e07d9a579a652eee698c709d6714c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 41, "avg_line_length": 42, "alnum_prop": 0.8571428571428571, "repo_name": "wing3s/flask-chatterbot", "id": "4777971d89c17c49e6e916454855764c4c1672ea", "size": "42", "binar...
import unittest import cli import swarm_worker class CliTest(unittest.TestCase): def test_parse_arguments(self): args = cli.parse_arguments(['--template', 'test.template', '--target', '/etc/target.file']) self.assertEqual(args.template, 'test.template') self.assertEqual(args.target, '/et...
{ "content_hash": "dc59bdad4849bd45a3d87a301b9149a3", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 106, "avg_line_length": 36.78888888888889, "alnum_prop": 0.5623678646934461, "repo_name": "rycus86/docker-pygen", "id": "91fd7d5610ebcfa346f730c18a3f889b6004484d", "size": ...
from __future__ import print_function import argparse import glob import os.path import subprocess import sys SWIFTSHADER_SUPPRESSIONS = [ 'images/write_image2d_r32f.amber', 'images/write_image2d_rg32f.amber', 'images/write_image2d_rgba32f.amber', 'images/write_image2d_r32ui.amber', 'images/write_...
{ "content_hash": "2333871270f036dff9b10286441d94ff", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 86, "avg_line_length": 33.44285714285714, "alnum_prop": 0.6373344724476719, "repo_name": "google/clspv", "id": "73d56965c5d4d54903c7586b546192cf1e2d715f", "size": "2968", ...
import json from six.moves import urllib from cinder import context from cinder import exception from cinder.tests.unit import fake_snapshot from cinder.tests.unit import fake_volume from cinder.tests.unit.volume.drivers.dell_emc import scaleio from cinder.tests.unit.volume.drivers.dell_emc.scaleio import mocks cla...
{ "content_hash": "3f87c3991a353e11ed02e53009aae20a", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 75, "avg_line_length": 37.093023255813954, "alnum_prop": 0.590282131661442, "repo_name": "Datera/cinder", "id": "9623b2ca03dd52fce597b9aea5e2fb69d35fb85e", "size": "3832", ...
from msrest.serialization import Model class SubscriptionCreateOrUpdateParameters(Model): """Parameters supplied to the Create Or Update Subscription operation. :param location: Subscription data center location. :type location: str :param type: Resource manager type of the resource. :type type: ...
{ "content_hash": "637985ea6223e95d4138bea71187cdfb", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 458, "avg_line_length": 57.09345794392523, "alnum_prop": 0.6988050417416926, "repo_name": "rjschwei/azure-sdk-for-python", "id": "8fc8179f69936afa362391d12ce5bec7916cecde", ...
import pkg_resources import numpy as np import skyfield from skyfield.api import load from skyfield.functions import load_bundled_npy def main(): print('Skyfield version: {0}'.format(skyfield.__version__)) print('jplephem version: {0}'.format(version_of('jplephem'))) print('sgp4 version: {0}'.format(versio...
{ "content_hash": "aea4fa99c8bbead872e908f519a64ed6", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 69, "avg_line_length": 31.771428571428572, "alnum_prop": 0.6429856115107914, "repo_name": "skyfielders/python-skyfield", "id": "75114d4ff7fdcc0bf7bf33f5e30774df5befcc90", "...
import unittest import numpy as np from helper import get_name from numpy.testing import assert_almost_equal from onnx import helper from onnx.defs import onnx_opset_version from onnx.mapping import NP_TYPE_TO_TENSOR_TYPE import onnxruntime as onnxrt from onnxruntime.capi._pybind_state import OrtDevice as C_OrtDevice...
{ "content_hash": "472b4c47f64a4e385ccd81928f39b0a2", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 110, "avg_line_length": 38.44805194805195, "alnum_prop": 0.5936497213308563, "repo_name": "microsoft/onnxruntime", "id": "ff1c0d17fd3ec62ca724097c2aa1f45c505b9c2b", "size"...
'''Tools to parse directories of DFT calculations''' from .vasp import VaspParser from .pwscf import PwscfParser
{ "content_hash": "47f2561b06906ccc7da4c3a3d0dd6771", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 52, "avg_line_length": 28.5, "alnum_prop": 0.7894736842105263, "repo_name": "CitrineInformatics/pif-dft", "id": "b4cb5eabf4a795aef1c799808c059a4ce486a6ce", "size": "114", ...
from django.test import TestCase from django.test.utils import override_settings from django.contrib.auth import signals @override_settings(USE_TZ=False) class SignalTestCase(TestCase): urls = 'django.contrib.auth.tests.urls' fixtures = ['authtestdata.json'] def listener_login(self, user, **kwargs): ...
{ "content_hash": "920adbfb10f9b814c192ab4701f39ad3", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 78, "avg_line_length": 37.857142857142854, "alnum_prop": 0.6679245283018868, "repo_name": "chrishas35/django-travis-ci", "id": "7730ab0952f1dd08d3dd931ab6c0ea9af210b5a2", "...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('arguments', '0003_auto_20161114_0750'), ] operations = [ migrations.RenameField( model_name='argument', old_name='premise1_if_clause...
{ "content_hash": "291ba9bb574b046adc93e13397eb78ba", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 49, "avg_line_length": 23.26086956521739, "alnum_prop": 0.5626168224299065, "repo_name": "amstart/demo", "id": "f2053d28747caf9e5817847f88e83faa5d21a9db", "size": "608", ...
from incuna_test_utils.testcases.urls import URLTestCase from .. import views class TestURLs(URLTestCase): """Ensure the urls work.""" def test_auth_token_url(self): self.assert_url_matches_view( view=views.GetAuthToken, expected_url='/auth', url_name='user_manage...
{ "content_hash": "4b68908381d6162c93c40d69aa0fc78a", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 74, "avg_line_length": 35.72, "alnum_prop": 0.6035834266517357, "repo_name": "incuna/django-user-management", "id": "cd911233c2076940a4aa72f78b3cf4f8498d0802", "size": "267...
import re class Pattern(object): def __init__(self, name, regex, actions=None): self.name = name self.regex = re.compile(regex) if isinstance(regex, basestring) else regex self.actions = actions def __repr__(self): return "Pattern(%r, %r, %r)" % (self.name, self.regex.pattern, ...
{ "content_hash": "97da63b2de9043c499c3db869f797e84", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 130, "avg_line_length": 28.860759493670887, "alnum_prop": 0.5090643274853801, "repo_name": "brownhead/mono-markup", "id": "efd4f81d36a85f769cc03d56f23c54426e1e947c", "size...
import treq from twisted.internet import reactor from twisted.internet.defer import inlineCallbacks, returnValue from gtxamqp.pool import pool from tests import utils # get a new client from the client pool client = pool.get(rabbitmq_conf=utils.generate_rabbitmq_config()) num_of_jokes_to_publish = 10 @inlineCallbac...
{ "content_hash": "603b9b4db913e4714377500bccc5fdb9", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 72, "avg_line_length": 28.566666666666666, "alnum_prop": 0.662777129521587, "repo_name": "devsenexx/gtxamqp", "id": "de16dce6f76185d59b00a873ab2c294199f045b5", "size": "171...
from clang.cindex import Cursor, Index from bears.c_languages.codeclone_detection.ClangCountingConditions import ( get_identifier_name, is_function_declaration, is_literal, is_reference) from bears.c_languages.codeclone_detection.CountVector import CountVector class ClangCountVectorCreator: """ This obje...
{ "content_hash": "0324ddaf78a1f313763680d49694d2fe", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 79, "avg_line_length": 39.17741935483871, "alnum_prop": 0.6179497735693701, "repo_name": "IPMITMO/statan", "id": "36c8d0bc0a2b741dfd503c2ef6a58b2cb6c96b31", "size": "4858"...
import pytest import vcr from pygrabbit import PyGrabbit @pytest.fixture def grab(): @vcr.use_cassette('fixtures/vcr_cassettes/pygrabbit.yaml', record_mode='new_episodes') def make_grabbit(url): return PyGrabbit.url(url) return make_grabbit class TestPyGrabbitTitle: def...
{ "content_hash": "07df4142005a7bbb4155973481150f02", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 257, "avg_line_length": 40.41428571428571, "alnum_prop": 0.6564156945917285, "repo_name": "eka/pygrabbit", "id": "9ea23d9018963c61d261db172bcb2ff27f902e73", "size": "2829",...
import os import os.path import sys import urllib from robot.errors import DataError from .encoding import decode_from_system from .platform import WINDOWS from .robottypes import is_unicode if WINDOWS: CASE_INSENSITIVE_FILESYSTEM = True else: try: CASE_INSENSITIVE_FILESYSTEM = os.listdir('/tmp') ==...
{ "content_hash": "cca77eeab0c46bb00f77d948ba6f20c9", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 83, "avg_line_length": 36.03174603174603, "alnum_prop": 0.6317180616740088, "repo_name": "un33k/robotframework", "id": "df9bc48ea1e3487848d40384b0022c17832f9cdf", "size": ...
"""Utilities for dealing with file paths.""" import os def join(path, *paths): """Joins given path pieces with the appropriate separator. This function is useful for joining parts of a path that could at times refer to either a GCS path or a local path. In particular, this is useful for ensuring Windows co...
{ "content_hash": "7087477f861566c7539ba94be1b456d6", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 37.54838709677419, "alnum_prop": 0.7044673539518901, "repo_name": "xsm110/Apache-Beam", "id": "6b3b978fdbe106300559fcdd315d70510c59f2bb", "size": "19...
"""Strategies for creating new instances of Engine types. These are semi-private implementation classes which provide the underlying behavior for the "strategy" keyword argument available on :func:`~sqlalchemy.engine.create_engine`. Current available options are ``plain``, ``threadlocal``, and ``mock``. New strategi...
{ "content_hash": "417229d87bc4142e715690e22bb79444", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 76, "avg_line_length": 34.06692913385827, "alnum_prop": 0.5552987403212759, "repo_name": "denny820909/builder", "id": "2db1bfcc56bef32c2f23cfd1311640f7ac42b8bf", "size": "...
from core.models import Size from rest_framework import serializers from api.v2.serializers.fields.base import UUIDHyperlinkedIdentityField class SizeSummarySerializer(serializers.HyperlinkedModelSerializer): url = UUIDHyperlinkedIdentityField( view_name='api:v2:size-detail', ) class Meta: ...
{ "content_hash": "5f4f949c362462064bc01cd5a95ba506", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 71, "avg_line_length": 24.842105263157894, "alnum_prop": 0.5815677966101694, "repo_name": "CCI-MOC/GUI-Backend", "id": "7dd62e4ea72925583c33ebf095f0790c4837e6db", "size": "...
from pyvisdk.thirdparty import Enum DiagnosticPartitionStorageType = Enum( 'directAttached', 'networkAttached', )
{ "content_hash": "84a592a4600895c0f5bacfb2ad1a4629", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 38, "avg_line_length": 17.714285714285715, "alnum_prop": 0.7580645161290323, "repo_name": "xuru/pyvisdk", "id": "8f557774412ed52e1cef1e2b52b3a7e9b971c89b", "size": "249", ...
def str2tuple(s, sep='/'): """ Given the string representation of a tagged token, return the corresponding tuple representation. The rightmost occurrence of *sep* in *s* will be used to divide *s* into a word string and a tag string. If *sep* does not occur in *s*, return (s, None). >>> f...
{ "content_hash": "f148946a0ffdeed46e070950472e3e98", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 69, "avg_line_length": 32, "alnum_prop": 0.6138059701492538, "repo_name": "syllog1sm/TextBlob", "id": "0e9269b6b4c84774c6544c21ad5fd9a490dddc54", "size": "2406", "binary"...
""" Editra Business Model Library: """ __author__ = "Cody Precord <cprecord@editra.org>" __cvsid__ = "$Id: __init__.py 69798 2011-11-23 02:59:40Z CJP $" __revision__ = "$Revision: 69798 $" #-----------------------------------------------------------------------------# # Text Utils from searcheng impor...
{ "content_hash": "314522ceba9637e5b11fcf8f085e3937", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 79, "avg_line_length": 20.871794871794872, "alnum_prop": 0.6130221130221131, "repo_name": "ktan2020/legacy-automation", "id": "0df19c57b137ab5f2e1c986ba521311f07f96fb3", "s...
"""Runs all matched benchmark suites on an Android device. This script probes the Android phone via `adb` and uses the device information to filter and run suitable benchmarks and optionally captures Tracy traces on the Android phone. It expects that `adb` is installed, and there is iree tools cross-compiled towards ...
{ "content_hash": "2d2f59b36cddab2457806d5efebb9120", "timestamp": "", "source": "github", "line_count": 406, "max_line_length": 80, "avg_line_length": 40.751231527093594, "alnum_prop": 0.6601390148080991, "repo_name": "google/iree", "id": "705592c7ca6b19a73369e68a956449322c2ed937", "size": "16785",...
from lettuce import step from lettuce import world from http_server import build_response @step('a code of (\d+)') def a_code(step, code): world.code = int(code) @step('I build the response') def call_build_response(step): world.response = build_response(world.code, "placeholder data") @step('I receive (....
{ "content_hash": "d6a45bd096c250d1bbbb206fe7ab1a5e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 67, "avg_line_length": 23.27777777777778, "alnum_prop": 0.6992840095465394, "repo_name": "markcharyk/GeventServer", "id": "b0478c8c4092b66dac99fea074f9ba7d7709c755", "size"...
import time from gtestm import cli from gtestm.netcfg import config from gtestm.run import linear from gtestm.run import general from gtestm.run import parallel from gtestm.utils import testdata def comp_serial_parallel(): cfg = config.Config() serial_td = testdata.TestData() parallel_td = testdata.Test...
{ "content_hash": "93cd1563c0bd41ae62e6471223464d8c", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 88, "avg_line_length": 27.181818181818183, "alnum_prop": 0.6343366778149386, "repo_name": "AlterionX/CSGeist", "id": "26450a84e807e694776abb98fa768991fa57ef65", "size": "18...
import __builtin__ __builtin__.NoneType = type(None) class Object(object): """ Our own base class. Contains methods to simplify serialization. """ __version__ = 0 nosave = [ ] def __getstate__(self): rv = vars(self).copy() for f in self.nosave: if f in rv: ...
{ "content_hash": "fa2e87788308f8ce95699c8a8426ed30", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 74, "avg_line_length": 21.21212121212121, "alnum_prop": 0.5578571428571428, "repo_name": "kfcpaladin/sze-the-game", "id": "fb72fc7375fee4d99fa461378472d2bcaa937789", "size"...
descr = """Image Processing SciKit Provide image processing capabilities to SciPy, including: - Image IO without PIL dependencies - Image warping (wrappers based on ndimage) - Connected components - Color-space manipulations - Linear space-invariant filters - Hough transform - Shortest paths - Grey-level co-occurre...
{ "content_hash": "4f6828c4831232e22e09fcc62d837fb3", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 75, "avg_line_length": 33.87692307692308, "alnum_prop": 0.5958219800181653, "repo_name": "mahipal/SciPy-Image-Kit", "id": "b5cbe5e78485c5403a906708b9d148c4d1b8468b", "size"...
from tqdm import tqdm from scipy.interpolate import interp1d import pandas as pd import numpy as np import wisps from wisps import drop_nan from astropy.coordinates import SkyCoord #import pymc3 as pm from wisps.simulations import HS, MAG_LIMITS, Rsun, Zsun, custom_volume, SELECTION_FUNCTION, SPGRID import wisps.simu...
{ "content_hash": "1484dcebbddfa762811000c3e1d8a5ab", "timestamp": "", "source": "github", "line_count": 472, "max_line_length": 135, "avg_line_length": 35.67584745762712, "alnum_prop": 0.6576993883247224, "repo_name": "caganze/wisps", "id": "4b584410bda0e183b42c0b7f14915f1a49beab5c", "size": "16926...
import os import re import sys from setuptools import setup, find_packages needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) pytest_runner = ['pytest-runner'] if needs_pytest else [] def find_version(*paths): fname = os.path.join(*paths) with open(fname) as fhandler: version_file = fhan...
{ "content_hash": "c2d298f643371147fec9b3c1ca3119b5", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 79, "avg_line_length": 29.25423728813559, "alnum_prop": 0.6251448435689455, "repo_name": "douban/pymesos", "id": "43503c4e9abe8e2b35dc3c04f8469181b0a1f166", "size": "1726",...
""" Created on 18 Aug 2016 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) """ from scs_core.sync.interval_timer import IntervalTimer from scs_core.sync.runner import Runner # -------------------------------------------------------------------------------------------------------------------- class Timed...
{ "content_hash": "29742dfcb90c1a44128825fdab2f6eac", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 118, "avg_line_length": 28.262295081967213, "alnum_prop": 0.37064965197215777, "repo_name": "south-coast-science/scs_core", "id": "6e7b430073e04730cca1caf188f5a1b0669a3f52", ...
"""tests/build/test_build_gene.py Tests for genes that are built on the variants """ from scout.build.variant.gene import build_gene def test_build_gene(): ## GIVEN information about a gene and a transcript transcript_info = { "functional_annotations": ["transcript_ablation"], "transcript_i...
{ "content_hash": "df2741218f15e97ed5898b201fc9cefd", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 80, "avg_line_length": 31.43362831858407, "alnum_prop": 0.5968468468468469, "repo_name": "Clinical-Genomics/scout", "id": "e679e4a48589933c980fdac863dfc7aa11e69aa0", "size...
import cPickle import unittest import multiprocessing import multiprocessing.pool import nose.tools as ntools import numpy from smqtk.algorithms.classifier.libsvm import LibSvmClassifier from smqtk.representation import \ ClassificationElementFactory, \ DescriptorElementFactory from smqtk.representation.class...
{ "content_hash": "b62d4edb2cc9aa41a1646ccb9466df2f", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 85, "avg_line_length": 42.19571865443425, "alnum_prop": 0.4825337005363096, "repo_name": "Purg/SMQTK", "id": "a2a67d6f4e56e152403333e8869c08bc970cfb4b", "size": "13798", ...
"""Tests for ImageCache class and helper functions.""" import datetime import os import tempfile import time from unittest import mock import uuid from oslo_utils import uuidutils from ironic.common import exception from ironic.common import image_service from ironic.common import images from ironic.common import ut...
{ "content_hash": "d1fcd5447bde4bd428239f5ad628b5f0", "timestamp": "", "source": "github", "line_count": 802, "max_line_length": 79, "avg_line_length": 47.913965087281795, "alnum_prop": 0.5946600046842064, "repo_name": "openstack/ironic", "id": "ffe6bed09a9a2c8112f4ce43a88674517cdc8efa", "size": "39...
from __future__ import print_function import itertools verbose = False happiness = {} people = set() #f = open('inputs/input13_test.txt') f = open('inputs/input13.txt') for line in f: split_line = line.split() person1 = split_line[0] direction = split_line[2] amount = int(split_line[3]) person2...
{ "content_hash": "e78f092c12785f605a333fdafe0d3da1", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 69, "avg_line_length": 26.174603174603174, "alnum_prop": 0.6519102486355367, "repo_name": "jjhelmus/adventofcode", "id": "1ba1f4de77128d05e58f3cd50d90def814c088f0", "size":...
import sys import threading _tls = threading.local() import pyuv from flower.core.channel import channel from flower.core.sched import tasklet, getcurrent, schedule def get_fd(io): if not isinstance(io, int): if hasattr(io, 'fileno'): if callable(io.fileno): fd = io.fileno() ...
{ "content_hash": "53b35475ffcde00fbd4e4d88004c6282", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 69, "avg_line_length": 21.3781512605042, "alnum_prop": 0.5605345911949685, "repo_name": "benoitc/flower", "id": "f3d13cff94f2b098fa1d668212f9e95579358f37", "size": "2637",...
"""Policy Engine For <Project_name>""" from oslo_config import cfg from oslo_policy import opts as policy_opts from oslo_policy import policy from <project_name> import exception CONF = cfg.CONF policy_opts.set_defaults(cfg.CONF, 'policy.json') _ENFORCER = None def init(): global _ENFORCER if not _ENFORC...
{ "content_hash": "5e7b26b528e4f63acd7a30a3851a7fa3", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 77, "avg_line_length": 32.38157894736842, "alnum_prop": 0.6432344575375863, "repo_name": "hahaps/openstack-project-generator", "id": "cc71aa71961ff6f29d8dd0e4877ecf743b80fd95...
call_script = 1 # (call_script,<script_id>), try_end = 3 # (try_end), try_begin = 4 # (try_begin), else_try = 5 # (else_try), try_for_range ...
{ "content_hash": "4aad6c70fbbbf22484fb2f7816c9bec6", "timestamp": "", "source": "github", "line_count": 1667, "max_line_length": 337, "avg_line_length": 84.36772645470906, "alnum_prop": 0.5673452264986739, "repo_name": "qt911025/pw_module_system", "id": "7bf412e0f1bcd275470bbce5d9a9da5a6facd751", "...
import cPickle import gzip import shutil import pprint from os import listdir from os.path import isfile, join from PIL import Image from resizeimage import resizeimage import numpy as np def readFilesName(path): return [f for f in listdir(path) if isfile(join(path, f))] def arrayOfPngFile(file): im = Ima...
{ "content_hash": "2dae490fc2579158365b9b1444d900ec", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 151, "avg_line_length": 26.285714285714285, "alnum_prop": 0.6497584541062802, "repo_name": "avicorp/firstLook", "id": "403cf9a5ed113a95bdbc4f492f444205b5afa19d", "size": "1...
"""Config flow for Netatmo.""" import logging import uuid import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_SHOW_ON_MAP from homeassistant.core import callback from homeassistant.helpers import config_entry_oauth2_flow, config_validation as cv from .const import (...
{ "content_hash": "01357c3f2024246e25829d5daca76f56", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 86, "avg_line_length": 33.76303317535545, "alnum_prop": 0.5606400898371702, "repo_name": "tboyce021/home-assistant", "id": "6217ef1a0e641e0147b47d89563eadb5f93f749e", "siz...
from faker import Factory from homes_to_let.models import LettingFavourite from homes_to_let.factories.letting_factory import LettingFactory from homes.factories.user_factory import UserFactory import factory fake = Factory.create('en_GB') class LettingFavouriteFactory(factory.DjangoModelFactory): class Meta:...
{ "content_hash": "19650cf3bc38cdba61d0c321e284cfba", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 65, "avg_line_length": 24.88888888888889, "alnum_prop": 0.7924107142857143, "repo_name": "bertnotbob/django-property", "id": "dba0bc1a0a63f65a92ccab3aa5b555e5ea9c8101", "si...
import socket owner = "Krazy6446" server = "irc.swiftirc.net" botnick = "ItchyBot" ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ircsock.connect((server, 6667)) ircsock.send("USER " + botnick + " " + botnick + " " + botnick + " :TwitchyBot by " + owner + "\n") ircsock.send("NICK " + botnick + "...
{ "content_hash": "6f42b51e09563debc2fd33368b892789", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 99, "avg_line_length": 21.78787878787879, "alnum_prop": 0.5938803894297635, "repo_name": "krazeh/Twitchy-Bot", "id": "8a70241122f689920cc037a46a3d6f4aac8d98bc", "size": "71...
import logging # don't output warnings from scapy, kthx logging.getLogger("scapy.runtime").setLevel(logging.ERROR) from scapy.all import IP, TCP, send from random import randint import argparse import time import os # globals global maxPort global lastPosition global fileSize maxPort = 65535 asciiMax = 127 lastPositio...
{ "content_hash": "a86beda88e938f080d6f6d6a3944d669", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 84, "avg_line_length": 36.66019417475728, "alnum_prop": 0.698093220338983, "repo_name": "cstyan/8505A1", "id": "692449f82992142d11d0a144809cd3997ce322bc", "size": "3776", ...
import gc import os import platform import pwd import sys def get_sysinfo(): return { 'pid': get_pid(), 'mem': get_memory(), 'gcobj': get_biggest_gc_objects(), } def get_pid(): return os.getpid() def get_memory(pid=None): vsz, rss = 0, 0 if platform.sys...
{ "content_hash": "bc16fbe6b3d55b0faf514fc45699116e", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 73, "avg_line_length": 26.79032258064516, "alnum_prop": 0.5219747140276941, "repo_name": "douban/douban-utils", "id": "ec2324041babcf0fc2044d47de6a67f6a9536ed6", "size": "1...
import sys import os from rpython.config.config import OptionDescription, BoolOption, IntOption, ArbitraryOption, FloatOption from rpython.config.config import ChoiceOption, StrOption, Config, ConflictConfigError from rpython.config.config import ConfigError from rpython.config.support import detect_number_of_processor...
{ "content_hash": "149c9188ef99843d3865d7fcbd8faa3d", "timestamp": "", "source": "github", "line_count": 423, "max_line_length": 176, "avg_line_length": 46.74231678486998, "alnum_prop": 0.5829455796075258, "repo_name": "oblique-labs/pyVM", "id": "b4e86424a6884efaeb6ae605ca07f54e11059d66", "size": "1...
"""Unit Tests for volume transfers.""" import datetime import mock from cinder import context from cinder import exception from cinder import objects from cinder import quota from cinder import test from cinder.tests.unit import fake_constants as fake from cinder.tests.unit import utils from cinder.transfer import a...
{ "content_hash": "ae20b0dd4a7fb460a2bfe889f9dabff8", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 78, "avg_line_length": 45.92982456140351, "alnum_prop": 0.5814362108479756, "repo_name": "cloudbase/cinder", "id": "ccc7bfe7cfc70381c91758f0fd0fba4ae9de5299", "size": "137...
import json import pycurl from io import BytesIO import getopt import errno import re import sys import socket import MySQLdb class Job: name = None status = None user = None queue = None start = None finish = None mapred = None yarn = None class JobNode: elapsed = 0 map = 0 reduce = 0 class Node: h...
{ "content_hash": "7a678770b211931cabc708111941c722", "timestamp": "", "source": "github", "line_count": 578, "max_line_length": 254, "avg_line_length": 27.71280276816609, "alnum_prop": 0.6138094643526033, "repo_name": "MetaCenterCloudPuppet/cesnet-site_hadoop", "id": "1be9d6721dc9846b7267456ebd7c5979...
from rest_framework import serializers from test_rest.models import Animal from test_rest.models import Plant class AnimalSerializer(serializers.ModelSerializer): class Meta: model = Animal class PlantSerializer(serializers.ModelSerializer): class Meta: model = Plant
{ "content_hash": "d4492da22a20bb8e268258a51a82528e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 52, "avg_line_length": 22.76923076923077, "alnum_prop": 0.7601351351351351, "repo_name": "sorenh/angular-django-rest-resource", "id": "d050ebbce800c4f88202e04c8f397cc6a181e37...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Comment.author' db.add_column('blogs_comment', 'author', self.gf('django.db.models.fields.rela...
{ "content_hash": "1525df0f7c781b2ed8ffd4f8935962a9", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 182, "avg_line_length": 88.84453781512605, "alnum_prop": 0.5394655947032395, "repo_name": "carquois/blobon", "id": "82f2f6a436cb4cf44375136fa83e165599c1ea6c", "size": "211...
"""Download NYC election results from the Board of Elections website. @author n.o.franklin (at) gmail.com @date 2018-01-20 This code is governed by the Apache License at http://www.apache.org/licenses/LICENSE-2.0.txt. Copyright 2018 Google. """ import csv import logging import pandas as pd import re import sys fro...
{ "content_hash": "1c24be5c2eb86aa08d57177cbace645f", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 96, "avg_line_length": 33.056497175141246, "alnum_prop": 0.5337549136899675, "repo_name": "UnitedThruAction/Data", "id": "900c4acf1684da8342a518403c6df0baf0af8cb7", "size"...
import unittest import sqlite3 as sqlite def func_returntext(): return "foo" def func_returnunicode(): return "bar" def func_returnint(): return 42 def func_returnfloat(): return 3.14 def func_returnnull(): return None def func_returnblob(): return b"blob" def func_raiseexception(): 5/0 de...
{ "content_hash": "81f9f9fceb4157d9b00acbe5bc5dd486", "timestamp": "", "source": "github", "line_count": 390, "max_line_length": 102, "avg_line_length": 31.407692307692308, "alnum_prop": 0.5922932484284431, "repo_name": "MalloyPower/parsing-python", "id": "c165423727115a8d9e130b7ecdea025c5288303c", ...
from __future__ import print_function import platform import os import random import re import shlex import signal import subprocess import sys import tempfile import elftools # filetype needs to be imported here because pnacl-driver injects calls to # filetype.ForceFileType into argument parse actions. # TODO(dschuf...
{ "content_hash": "7c06e9e72b456af6bdc611c9117a769d", "timestamp": "", "source": "github", "line_count": 884, "max_line_length": 90, "avg_line_length": 31.005656108597286, "alnum_prop": 0.6424896931664782, "repo_name": "endlessm/chromium-browser", "id": "d210a021f6a7d79bc30bcd4be466eee9c831ff56", "s...
import datetime import logging import os import sqlparse from redash.query_runner import ( NotSupported, register, BaseSQLQueryRunner, TYPE_STRING, TYPE_BOOLEAN, TYPE_DATE, TYPE_DATETIME, TYPE_INTEGER, TYPE_FLOAT, ) from redash.settings import cast_int_or_default from redash.utils im...
{ "content_hash": "d1e1bc317f9d04c5e94aa38ade5feff7", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 89, "avg_line_length": 30.425837320574164, "alnum_prop": 0.5381349268752949, "repo_name": "getredash/redash", "id": "5728968869dd4d59c9c8055ce7cef13436450345", "size": "63...
""" This module contains easy to use functions and classes for creating a secure chat. """ __author__ = 'Elias Frantar, Gary Ye' __version__ = '1.0'
{ "content_hash": "8a29b4f26bc120cfbff41b74f5e2a6ea", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 76, "avg_line_length": 21.428571428571427, "alnum_prop": 0.6733333333333333, "repo_name": "gye-tgm/spychat", "id": "f456f0345c87b81f681f74cde39a6caee7f88d9d", "size": "150",...
"""Syntactic manipulation of trees.""" import logging import copy import os import warnings import networkx as nx from tulip.spec.ast import nodes from tulip.spec import parser # inline: # import tulip.graphics as _graphics __all__ = [ 'Tree', 'ast_to_labeled_graph', 'check_for_undefined_identifiers', 'su...
{ "content_hash": "e817ffc59741b2dd55478d07f7c66a18", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 78, "avg_line_length": 30.888402625820568, "alnum_prop": 0.5589402096911307, "repo_name": "tulip-control/tulip-control", "id": "d24c7d2a33a67a3a58f4ad7b60ce81497ec0c024", ...
import libraries import os import new import test import unittest import sys import glob def get_suites(): dir = os.path.dirname(os.path.abspath(sys.modules[__name__].__file__)) suites = [] for testFile in glob.glob(dir + os.sep + 'test/test_*.py'): testModuleName = os.path.basename(testFile)[:-len('.py')] tes...
{ "content_hash": "d6403e5d014fdbc92d8ecbe7921760b1", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 87, "avg_line_length": 21.851063829787233, "alnum_prop": 0.667964946445959, "repo_name": "sparkslabs/kamaelia", "id": "af8649cdfc0a116abb28d1202e06b0aabb270869", "size": "2...
import sys from PyQt4 import QtGui, QtCore import matplotlib matplotlib.use("qt4agg") from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure class GUI(QtGui.QMainWindo...
{ "content_hash": "aec4be831f744d17ff1990f4f7c8c94c", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 94, "avg_line_length": 38.56962025316456, "alnum_prop": 0.6320971447325238, "repo_name": "chilleo/ALPHA", "id": "97675d9d92f5fdde63c46efad5d7c83014ac81f5", "size": "3047", ...
from atom.mixins import AdminTestCaseMixin from test_plus import TestCase from poradnia.events.factories import EventFactory from poradnia.events.models import Event from poradnia.users.factories import UserFactory class EventAdminTestCase(AdminTestCaseMixin, TestCase): user_factory_cls = UserFactory factory...
{ "content_hash": "aca25054afc398aa37390ec9d39616eb", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 55, "avg_line_length": 29.833333333333332, "alnum_prop": 0.8184357541899442, "repo_name": "watchdogpolska/poradnia", "id": "b859813b9c5c768051ce3a0943cba95a56903a04", "size...
from collections import Callable # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # From http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ident except ImportError: fr...
{ "content_hash": "0d123f95727cc1f65bc58e34cb8bd624", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 87, "avg_line_length": 33.97019867549669, "alnum_prop": 0.5483965298762062, "repo_name": "antiface/dsp-testbed", "id": "c5e8807aad020f30d7b5dfcfd707de179f19ccdd", "size": ...
import hashlib import collections from androguard.core import androconf from androguard.core.bytecodes.apk import * from androguard.core.bytecodes.dvm import * from androguard.core.analysis.analysis import * from androguard.decompiler.decompiler import * from androguard.misc import save_session, load_session class S...
{ "content_hash": "a31552f0e696289b30b87746882dcdf9", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 103, "avg_line_length": 32.63, "alnum_prop": 0.5612932883849219, "repo_name": "Fuzion24/androguard", "id": "fae9b0df986ba3acf7ce5d999a5c8f6ff3c35eee", "size": "6526", "b...
"""Step implementations for changelogs.""" from asserts import assert_equal from behave import then # pylint: disable=no-name-in-module @then("the {item} changelog reads") @then("the changelog reads") def check_changelog(context, item=None): """Check that the changelog contains the text.""" item_path = f"{i...
{ "content_hash": "ab1f40a24d8b4f6cf82229f25bb4d809", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 65, "avg_line_length": 38.92857142857143, "alnum_prop": 0.6954128440366972, "repo_name": "ICTU/quality-time", "id": "4ac53396d0cda7b8127c10855ff66e52c22110c5", "size": "545...
import argparse import shutil import os import tempfile import subprocess DESCRIPTION = """caca - Copy And Convert Audio. A very simple one-shot parallel audio converter that behaves a lot like cp""" args = None def detect_utils(): tools = ['flac', 'lame', 'oggenc'] for tool in tools: if not shutil....
{ "content_hash": "7313a71d5a1dd16c78635585f1d41a4a", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 126, "avg_line_length": 33.826388888888886, "alnum_prop": 0.6364196263600903, "repo_name": "Nukesor/caca", "id": "e9549413e42255f8bc03e6e40afd976f2ebb777d", "size": "4913"...
""" Calculate the ratings matrix using linear win-difference ratio Notation is used from the following paper: http://www.phys.utk.edu/sorensen/ranking/Documentation/Sorensen_documentation_v1.pdf """ from pathlib import Path import logging from scipy.optimize import lsq_linear from scipy.sparse import coo_matrix im...
{ "content_hash": "f0ad228a99a2cb0262e302b865db954c", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 114, "avg_line_length": 36.93607305936073, "alnum_prop": 0.6642353813821239, "repo_name": "rynecarbone/power_ranker", "id": "28ced4429ef5fa3d657ec42142b5ace45ccb649c", "si...
from django.shortcuts import get_object_or_404, render_to_response from django.http import HttpResponse, HttpResponseBadRequest, QueryDict from django.views.decorators.csrf import csrf_protect from django.core.exceptions import PermissionDenied from django.template import RequestContext from smartsnippets_inherit.model...
{ "content_hash": "e97f0c6b88626e0b070ebd042c751497", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 78, "avg_line_length": 39.916666666666664, "alnum_prop": 0.6670146137787056, "repo_name": "pbs/django-cms-smartsnippets", "id": "41750578c4fe407d99a5d59c2d364cc1e1b15659", ...
import psycopg2 class py2psql: # private member # host : URL or IP # port : postgresql server port # db : as a string # tb : as a string # user : as a string # pwd : as a string # data : as a dictionary, { colName : colValue } # columns : save table schema # datatype : save...
{ "content_hash": "74f9699cdcf48f7edb4ec73080f03232", "timestamp": "", "source": "github", "line_count": 791, "max_line_length": 156, "avg_line_length": 33.86472819216182, "alnum_prop": 0.48325680367342366, "repo_name": "jiankaiwang/seed", "id": "18a12003354f06e8b3f76650d6755794a4159a2c", "size": "2...
'''OpenGL extension ARB.point_sprite Automatically generated by the get_gl_extensions script, do not edit! ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_ARB_point_sprite' _DEPRECATED = False GL_POINT_SPRITE_ARB ...
{ "content_hash": "e0ee6ff01e2252aa9e7e3bb445ea9df1", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 36.5, "alnum_prop": 0.7701674277016742, "repo_name": "Universal-Model-Converter/UMC3.0a", "id": "55b6067e274b3c8c57b1f2320be4e7013dfce00a", "size": "...
import ftplib import StringIO import zipfile import parser_libxml import lxml #from helper import DBConnector import psycopg2 import datetime import sys,os,traceback from helper import DBConnector def get_zip_data(filename,callback): ftp = ftplib.FTP("ftp.zakupki.gov.ru", "free", "free") file = ftp...
{ "content_hash": "948e7d3998c74f4f9602a5d4b73e6a64", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 193, "avg_line_length": 35.08988764044944, "alnum_prop": 0.579250720461095, "repo_name": "Dixon3/zakpars", "id": "d5cab1a82e6821a613f5be075f03b53f2dfd8e64", "size": "3170",...
import speech_recognition as sr #Import the speech recognition library import wordToNum #To convert nums to integers #from eqSolver import eqSolver from sympy import * #Necessary for commented out code, but comment this import if not using them #Setup speech r = sr.Recognizer() #Creates a variable to listen to the audi...
{ "content_hash": "586ba131c3d6a829a4a2a3b0a9091caa", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 342, "avg_line_length": 60.564516129032256, "alnum_prop": 0.7145139813581891, "repo_name": "Alex-Gurung/MathSpeech", "id": "58fca407fd96031b0f5fb02b213496e0d749b107", "size...
"""\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available as methods of the socket object. Functions: socket() -- create a new socket object socketpai...
{ "content_hash": "dd141be8c2e839ca27ca5033cd8d1bac", "timestamp": "", "source": "github", "line_count": 615, "max_line_length": 87, "avg_line_length": 36.00650406504065, "alnum_prop": 0.5475523843930635, "repo_name": "ojii/sandlib", "id": "f2febfeea50b1928a371c0fcb222269ace7b787b", "size": "22237",...
import numpy as np import binvox_rw import numba import mcubes @numba.jit(forceobj=True) def get_voxel_resolution(pc, patch_size): """ This function takes in a pointcloud and returns the resolution of a voxel given that there will be a fixed number of voxels. For example if patch_size is 40, then we...
{ "content_hash": "bc2d789ad7bf7e8e31f107c9e86f48fb", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 120, "avg_line_length": 39.25, "alnum_prop": 0.6589906908378246, "repo_name": "CRLab/curvox", "id": "253f31442daffdbb2a0345446c3248a2e27ccec2", "size": "14287", "binary"...
""" The Carnegie Mellon Pronouncing Dictionary [cmudict.0.6] ftp://ftp.cs.cmu.edu/project/speech/dict/ Copyright 1998 Carnegie Mellon University File Format: Each line consists of an uppercased word, a counter (for alternative pronunciations), and a transcription. Vowels are marked for stress (1=primary, 2=secondary,...
{ "content_hash": "db831621ff05286b781d517726715582", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 78, "avg_line_length": 37.44318181818182, "alnum_prop": 0.5332321699544765, "repo_name": "haya14busa/alc-etm-searcher", "id": "ea8c770e7eb43ddd4401e7885ca73be86bc4f46a", "s...
import json import logging from datetime import datetime from enum import Enum, unique from typing import Dict, List, Optional, Tuple import click import yaml import ray._private.services as services from ray._private.thirdparty.tabulate.tabulate import tabulate from ray.experimental.state.api import ( StateApiCl...
{ "content_hash": "d081d35f4522bcad54e7b9ba3b53124b", "timestamp": "", "source": "github", "line_count": 1120, "max_line_length": 88, "avg_line_length": 26.738392857142856, "alnum_prop": 0.6101779810999433, "repo_name": "ray-project/ray", "id": "3040fe8df7b51393bcaf9fa394665e49003371bf", "size": "29...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '__first__'), ] operations = [ migrations.CreateModel( name='GoogleMap', fields=[ ('cmsplugin_ptr', mo...
{ "content_hash": "40e43f6a5b7e4d12f15278c0502bd6df", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 352, "avg_line_length": 75.34883720930233, "alnum_prop": 0.6006172839506173, "repo_name": "macs03/demo-cms", "id": "790020a6fea96543b32a88bfb06cd00b72445702", "size": "3264...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('categories', '0001_initial'), ('products_catalogue', '0003_product_catalogue_restaurant'), ] operations = [ migrations.RemoveField( ...
{ "content_hash": "2bb8af5270afe4aa70ba1060fcbf54f2", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 113, "avg_line_length": 27.347826086956523, "alnum_prop": 0.6089030206677265, "repo_name": "jojoriveraa/titulacion-NFCOW", "id": "94e547beecc92d666ab8b52fde1d4c18dd70fe0d", ...
from django.apps import AppConfig class CommonConfig(AppConfig): name = 'saywiti.common'
{ "content_hash": "35060e8597049c299f9d893a76be2660", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 19, "alnum_prop": 0.7578947368421053, "repo_name": "erickgnavar/saywiti", "id": "e2bf787a2d0dcb68c9842425e505b995daa5173c", "size": "95", "binary": ...
import sys import os import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('.')) # -- ...
{ "content_hash": "b1e217f83721002e228f45b19eaf895b", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 79, "avg_line_length": 32.13090909090909, "alnum_prop": 0.7041647804436396, "repo_name": "bolverk/kobra", "id": "da353bf3a0626a0a3761886414ad7dcd8b0bc331", "size": "9254",...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest from mock import ANY from ansible.module_utils.network.fortios.fortios import FortiOSHandler try: from ansible.modules.network.fortios import fortios_system_vdom_netflow except ImportError: ...
{ "content_hash": "923b9bd7011091e1bc8c83bff833429a", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 133, "avg_line_length": 35.459119496855344, "alnum_prop": 0.6369279886484569, "repo_name": "thaim/ansible", "id": "5d776847edb24386c08e6c4a7459b5dd56b2cc0a", "size": "6334...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Difference'] , ['MovingMedian'] , ['Seasonal_Minute'] , ['AR'] );
{ "content_hash": "9651747aeec332c11a025fe26d0a5610", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 88, "avg_line_length": 40.25, "alnum_prop": 0.7142857142857143, "repo_name": "antoinecarme/pyaf", "id": "0d6bc06f90d18e603550680a67fd74d8a998eb7d", "size": "161", "binary"...
import unittest import IECore import IECoreGL import Gaffer import GafferUI import GafferUITest class StandardStyleTest( GafferUITest.TestCase ) : def testColorAccessors( self ) : s = GafferUI.StandardStyle() i = 0 for n in GafferUI.StandardStyle.Color.names : if n=="LastColor" : continue ...
{ "content_hash": "31ab39b40e4e7eead83efd8473f74da6", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 68, "avg_line_length": 19.288888888888888, "alnum_prop": 0.6463133640552995, "repo_name": "DoubleNegativeVisualEffects/gaffer", "id": "e7e3f6bb156271ba5081e8476e88b1b2194d0c2...
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import ProjectOption from sentry.testutils import APITestCase class ReleaseTokenGetTest(APITestCase): def test_simple(self): project = self.create_project( name='foo', ) tok...
{ "content_hash": "a20e7799f308cf308d833f8ecc9ee8f7", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 91, "avg_line_length": 29.19736842105263, "alnum_prop": 0.5912573231185219, "repo_name": "jean/sentry", "id": "8387857cf537d75437b7a4feffd27b6deabc27ad", "size": "2244", ...
from win32com.shell import shell, shellcon import win32api import os def testSHFileOperation(file_cnt): temp_dir=os.environ['temp'] orig_fnames=[win32api.GetTempFileName(temp_dir,'sfo')[0] for x in range(file_cnt)] new_fnames=[os.path.join(temp_dir,'copy of '+os.path.split(orig_fnames[x])[1]) for x in rang...
{ "content_hash": "7d00d07a9d5f0917c01f513af744643c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 127, "avg_line_length": 45.648648648648646, "alnum_prop": 0.7199526346950859, "repo_name": "ArcherSys/ArcherSys", "id": "e4b53034dd4946287d9e8e458c50ec0fab6db194", "size": ...
import os import tempfile import six import unittest BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0, BASE_DIR) from auth import create_app from auth.models import db, users, Role from flask_security.utils import encrypt_password from lxml import etree with open(BASE_DIR +...
{ "content_hash": "12e914e97301f76e6fa6d8e32efb2941", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 86, "avg_line_length": 34.39823008849557, "alnum_prop": 0.6207872395163365, "repo_name": "datashaman/wifidog-auth-flask", "id": "0e0a0698cafeaba8aae192f92a8fb92b7912c159", ...
from django.http import HttpResponse, HttpResponseRedirect from django.views.generic.simple import direct_to_template from django.core.urlresolvers import reverse from django.db import connection, transaction from django.shortcuts import get_object_or_404 from helpers.shortcuts import set_message from forms import Fort...
{ "content_hash": "010fec41faceeadeff9f690feec21bb8", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 92, "avg_line_length": 35.14754098360656, "alnum_prop": 0.6240671641791045, "repo_name": "gnrfan/chichafortunes", "id": "042e6a71cf63e39da719076548954fba9bb7b856", "size": ...
from pyflink.testing.test_case_utils import PyFlinkTestCase class ShellExampleTests(PyFlinkTestCase): """ If these tests failed, please fix these examples code and copy them to shell.py """ def test_batch_case(self): from pyflink.shell import b_env, bt_env, FileSystem, OldCsv, DataTypes, Sche...
{ "content_hash": "e5b4c675a6577ec77a43d49e78f90bef", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 91, "avg_line_length": 38.734177215189874, "alnum_prop": 0.5049019607843137, "repo_name": "kaibozhou/flink", "id": "eaee9d83d50f4b9f046d6acaa240d1c5f407286a", "size": "4018...
from collections import OrderedDict from typing import Dict, Type from .base import DatasetServiceTransport from .grpc import DatasetServiceGrpcTransport from .grpc_asyncio import DatasetServiceGrpcAsyncIOTransport # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[Datase...
{ "content_hash": "822e544b9c01289e18cc8e3ec15a8f4a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 85, "avg_line_length": 33, "alnum_prop": 0.8080808080808081, "repo_name": "googleapis/python-aiplatform", "id": "07bc11c0c89728531bb6f151d4b7274cecdabe3b", "size": "1194", ...
from parse_folder import ParseFolderTask from create_db import CreateDbTask from analyze_db import AnalyzeDbTask
{ "content_hash": "2ff6aec56eed9280379c4efee2bb1ad5", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 40, "avg_line_length": 37.666666666666664, "alnum_prop": 0.8672566371681416, "repo_name": "crohkohl/DIGITS", "id": "636a7dd465c10fd77c83b426010469306fd7820c", "size": "183",...
from __future__ import absolute_import import struct import sys from uproot3._util import _tobytes class Cursor(object): def __init__(self, index): self.index = index def skip(self, numbytes): self.index += numbytes def update_fields(self, sink, format, *args): sink.write(format...
{ "content_hash": "511c1bd8a521d92f36b853e107424707", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 77, "avg_line_length": 28.344444444444445, "alnum_prop": 0.5907487259898079, "repo_name": "scikit-hep/uproot", "id": "4d2110da33be00fc155513e06207954dffe14345", "size": "26...
""" L{twisted.words} support for Instance Messenger. """ from twisted.internet import defer from twisted.internet import error from twisted.python import log from twisted.python.failure import Failure from twisted.spread import pb from twisted.words.im.locals import ONLINE, OFFLINE, AWAY from twisted.words.im import...
{ "content_hash": "1744c5c4927c09c668ec556e074819ed", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 106, "avg_line_length": 37.26953125, "alnum_prop": 0.6269783041609894, "repo_name": "berendkleinhaneveld/VTK", "id": "04d14e997d333c79164c5d8f76207578ebf3127f", "size": "9...
""" A WebIDL parser. """ from ply import lex, yacc import re import os import traceback import math # Machinery def parseInt(literal): string = literal sign = 0 base = 0 if string[0] == '-': sign = -1 string = string[1:] else: sign = 1 if string[0] == '0' and len(str...
{ "content_hash": "832bc4229f5e20b64dc139d92b54848a", "timestamp": "", "source": "github", "line_count": 5027, "max_line_length": 139, "avg_line_length": 36.481400437636765, "alnum_prop": 0.5595827517012738, "repo_name": "hyundukkim/WATT", "id": "f9113004071b4fa2ce8f26bafa95a1b4b01c2826", "size": "1...
"""Utilities of network. Message format: Compressed JSON string { "type": "text", # Other information ... } """ import json from ..utils.error import GameError __author__ = 'fyabc' # Exceptions. class NetworkError(GameError): pass class ServerFull(GameError): def __init__(self, server): ...
{ "content_hash": "f1629649e870cffc8ff878f1d9dd9aa6", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 96, "avg_line_length": 19.706422018348626, "alnum_prop": 0.5972998137802608, "repo_name": "fyabc/MiniGames", "id": "86674b22b13dc713cc15a9d88d66f12f1568afca", "size": "219...
import json import uuid from typing import List from dateutil.parser import parse from cerebralcortex.kernel.DataStoreEngine.Metadata.Metadata import Metadata from cerebralcortex.kernel.datatypes.datastream import DataStream, DataPoint class StoreData: def store_stream(self, datastream: DataStream, type): ...
{ "content_hash": "de83d88783be278d4fb29c3f352772f7", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 120, "avg_line_length": 41.37579617834395, "alnum_prop": 0.500307881773399, "repo_name": "aungkonazim/CerebralCortex", "id": "1db4ef0c3f9f29bf36a271c864e986a253f72349", "s...
import os import time import unittest import numpy as np from collections import namedtuple, defaultdict import cereal.messaging as messaging from cereal import log from system.hardware import TICI, HARDWARE from selfdrive.manager.process_config import managed_processes BMX = { ('bmx055', 'acceleration'), ('bmx05...
{ "content_hash": "42fc9dee53e707d20207d235e8c57fb3", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 129, "avg_line_length": 30.16296296296296, "alnum_prop": 0.6423133595284872, "repo_name": "commaai/openpilot", "id": "c6fe33129ad3ff1275f78c7490c800cb561c31b0", "size": "8...
import unittest import numpy as np from systemds.context import SystemDSContext class TestSource_01(unittest.TestCase): sds: SystemDSContext = None @classmethod def setUpClass(cls): cls.sds = SystemDSContext() @classmethod def tearDownClass(cls): cls.sds.close() def test_0...
{ "content_hash": "bd7b638ed6205c5886e50a2e228bcca8", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 89, "avg_line_length": 32.27142857142857, "alnum_prop": 0.5427180168216025, "repo_name": "apache/incubator-systemml", "id": "00cb14b827695bfebfb497e26fd4d876aee06702", "siz...