text stringlengths 4 1.02M | meta dict |
|---|---|
import tutorial #this is our ecto module
printer = tutorial.Hello() #allocate a cell
printer.process() #cause it to execute. | {
"content_hash": "e18fc0ccf60d59bf983b2a9bbb7701ba",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 43,
"avg_line_length": 31.25,
"alnum_prop": 0.768,
"repo_name": "ethanrublee/ecto-release",
"id": "0303f9a4eea95e52f48d0b973c42ce1af7a5abc7",
"size": "147",
"binary": fals... |
import os
import sys
import argparse
import datetime
import time
import sqlite3
import logging
import csv
import struct
import NotionalSQLite
version = '0.6.2'
build = '20131207'
headerfields = (("Signature","sig"),
("Page Size","pagesize"),
("Read Format","readver"),
... | {
"content_hash": "e2e227251470175ad9cb6cca97ed0d51",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 238,
"avg_line_length": 43.34816753926702,
"alnum_prop": 0.5796243734525032,
"repo_name": "NotionalLabs/SQLiteZer",
"id": "e114b444830b349768af8c4a8d7d94b1801dc7c8",
"size... |
""" parquet compat """
from warnings import catch_warnings
from distutils.version import LooseVersion
from pandas import DataFrame, RangeIndex, Int64Index, get_option
from pandas.compat import range
from pandas.io.common import get_filepath_or_buffer
def get_engine(engine):
""" return our implementation """
... | {
"content_hash": "7e2f568122757377715cd3e024f95a39",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 79,
"avg_line_length": 33.18041237113402,
"alnum_prop": 0.5598881466521671,
"repo_name": "DGrady/pandas",
"id": "09603fd6fdcce70a9830139bbcc7b230bc7d7531",
"size": "6437",... |
import threading
import os
import shutil
from PIL import Image, ImageDraw2, ImageDraw, ImageFont, ImageEnhance
import random
count = range(0, 110) # 90 张训练, 20张测试精度
path = './generatedNumberImages'
text = '0123456789X'
def start():
if os.path.exists(path):
shutil.rmtree(path)
os.mkdir(path)
for i... | {
"content_hash": "e4a0bc9930bc494b659683d2147ba85d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 172,
"avg_line_length": 32.44444444444444,
"alnum_prop": 0.6592465753424658,
"repo_name": "KevinGong2013/ChineseIDCardOCR",
"id": "4057e7b55c3b585f2afa8fc75881304aa222d161",
... |
"""
Copyright (c) 2013, SMART Technologies ULC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions an... | {
"content_hash": "d65bc385f56d6f37c438814fc9793373",
"timestamp": "",
"source": "github",
"line_count": 328,
"max_line_length": 123,
"avg_line_length": 24.76829268292683,
"alnum_prop": 0.5164943377646479,
"repo_name": "smysnk/sikuli-framework",
"id": "54b6fc4597711ca572c4a1900807b912f7f39715",
"siz... |
import contextlib
import json
import os
from functools import partial
import pytest
from pip._vendor import pkg_resources
from pip._vendor.packaging.version import Version
from pip._vendor.pkg_resources import Requirement
from pytest import fixture
from prequ._pip_compat import install_req_from_editable, install_req_... | {
"content_hash": "f27bf195e12c0a5bbdf928f0a25be7e0",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 99,
"avg_line_length": 28.420454545454547,
"alnum_prop": 0.6517393042782886,
"repo_name": "suutari-ai/prequ",
"id": "15ca034cda1d893f016afa0bd31aecdecb9836c8",
"size": "50... |
"""
Support for @synchronized blocks
The python class object_lock is a contextmanager for with statements that
can also be used manually.
"""
import objc as _objc
class object_lock(object):
"""
A context manager that implements the same feature as
@synchronized statements in Objective-C. Locking can also
... | {
"content_hash": "bf7160246d26662f004cdbc0b04d088e",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 73,
"avg_line_length": 26.93548387096774,
"alnum_prop": 0.6407185628742516,
"repo_name": "albertz/music-player",
"id": "ea8c14a500f29549960bd5b3d0fbd72bde0eca58",
"size": "... |
"""Install, execute, and parse results from YCSB.
YCSB (the Yahoo! Cloud Serving Benchmark) is a common method of comparing NoSQL
database performance.
https://github.com/brianfrankcooper/YCSB
For PerfKitBenchmarker, we wrap YCSB to:
* Pre-load a database with a fixed number of records.
* Execute a collection of... | {
"content_hash": "f18893fd228b61317a2576d53e6c838b",
"timestamp": "",
"source": "github",
"line_count": 746,
"max_line_length": 80,
"avg_line_length": 35.242627345844504,
"alnum_prop": 0.640561408847134,
"repo_name": "tvansteenburgh/PerfKitBenchmarker",
"id": "f32e1c30317786c9ae1a27c55aed952b64573b86... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/dress/shared_dress_s10.iff"
result.attribute_template_id = 11
result.stfName("wearables_name","dress_s10")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "52cbc3b3c3079667ffec5ec3bbe9366b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 73,
"avg_line_length": 23.692307692307693,
"alnum_prop": 0.7012987012987013,
"repo_name": "anhstudios/swganh",
"id": "d9bf256fda15ef2fd2887c9f0e8f9d15d5f70657",
"size": "45... |
"""CLI app to load VTR files into the database.
"""
import argparse
import datetime
import logging
import os
import sys
import uuid
from pymongo import Connection, ASCENDING
sys.path.append(os.path.dirname(os.path.dirname(sys.argv[0])))
from docket import db
from docket import tasks
def main():
parser = argpar... | {
"content_hash": "67b3c222c5f0cd7128da1c52abf688f5",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 77,
"avg_line_length": 29.870967741935484,
"alnum_prop": 0.5340172786177105,
"repo_name": "dhellmann/athensdocket",
"id": "a57db9f3c8303d1e9f7c36b36454f18edae0e0a2",
"size... |
"""
byceps.services.tourney.dbmodels.match
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2014-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from ....database import db, generate_uuid
class Match(db.Model):
"""A match between two opponents."""
__tablename__ = 'tou... | {
"content_hash": "7a9556cd0af9405bd1172791b47238a0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 68,
"avg_line_length": 23.764705882352942,
"alnum_prop": 0.6361386138613861,
"repo_name": "homeworkprod/byceps",
"id": "428006b4874bde09d9f288369b1d264e4cedfd41",
"size": "... |
"""
This module is deprecated. Please use `airflow.providers.google.cloud.operators.cloud_sql`.
"""
import warnings
from airflow.providers.google.cloud.operators.cloud_sql import (
CloudSQLBaseOperator, CloudSQLCreateInstanceDatabaseOperator, CloudSQLCreateInstanceOperator,
CloudSQLDeleteInstanceDatabaseOpera... | {
"content_hash": "3c330c1d7dcb4ebfebfb429bb7b18ad3",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 109,
"avg_line_length": 34.698412698412696,
"alnum_prop": 0.7118023787740164,
"repo_name": "mtagle/airflow",
"id": "e8e34522ad24895f9fd425a94c491c4b54de0724",
"size": "515... |
from zerver.lib.test_classes import WebhookTestCase
class HomeAssistantHookTests(WebhookTestCase):
STREAM_NAME = 'homeassistant'
URL_TEMPLATE = "/api/v1/external/homeassistant?&api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = 'homeassistant'
def test_simplereq(self) -> None:
expected_topi... | {
"content_hash": "ab9b90547b2ef2a13d700e3399ed13b4",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 91,
"avg_line_length": 46.608695652173914,
"alnum_prop": 0.6548507462686567,
"repo_name": "dhcrzf/zulip",
"id": "0d18ce448d5e9ef60b058bc2ec9e5587b0086dc0",
"size": "1073",
... |
"""Support for Voice mailboxes."""
import asyncio
from contextlib import suppress
from datetime import timedelta
import logging
from aiohttp import web
from aiohttp.web_exceptions import HTTPNotFound
import async_timeout
from homeassistant.components.http import HomeAssistantView
from homeassistant.core import callba... | {
"content_hash": "559c801a628ff7dcda7961b3baa15199",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 79,
"avg_line_length": 30.9765625,
"alnum_prop": 0.6257250945775535,
"repo_name": "jabesq/home-assistant",
"id": "3b5012ec160e8727ba70fcc1496f36b878b40476",
"size": "7930"... |
from django.db import models
from django.conf import settings
from r66 import netutils
from django.utils.translation import ugettext_lazy as _
PPP_MODE_CHOICES = [
('3g-only', _('3G only')),
('3g-pref', _('3G preference')),
('gprs-only', _('GPRS only')),
('gprs-pref', _('GPRS preference')),
('none'... | {
"content_hash": "a6090b7c087de6980185123120bd8691",
"timestamp": "",
"source": "github",
"line_count": 1265,
"max_line_length": 122,
"avg_line_length": 26.286166007905138,
"alnum_prop": 0.5445386743654517,
"repo_name": "ataka-team/django-r66",
"id": "ada0efd590f5983e9fa92c3666dcc3cb9323adc9",
"siz... |
from google.cloud import pubsublite_v1
async def sample_list_subscriptions():
# Create a client
client = pubsublite_v1.AdminServiceAsyncClient()
# Initialize request argument(s)
request = pubsublite_v1.ListSubscriptionsRequest(
parent="parent_value",
)
# Make the request
page_res... | {
"content_hash": "d69a995d8088463d6102006c9e1ba486",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 79,
"avg_line_length": 27,
"alnum_prop": 0.7240740740740741,
"repo_name": "googleapis/python-pubsublite",
"id": "90f5b33ecd4a6f8f62a3451b54979e8a3cfa5be4",
"size": "1564",
... |
import unittest
import imath
import IECore
import Gaffer
import GafferTest
import GafferImage
import GafferImageTest
class ResizeTest( GafferImageTest.ImageTestCase ) :
def testDefaultFormat( self ) :
r = GafferImage.Resize()
self.assertTrue( r["format"].getValue().getDisplayWindow().isEmpty() )
f1 = Gaffe... | {
"content_hash": "ad1c4f5aebb204b648bd977b957b5345",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 125,
"avg_line_length": 36.13868613138686,
"alnum_prop": 0.6666330034336497,
"repo_name": "johnhaddon/gaffer",
"id": "387e827611ad552a9ee0260d65d06d3cf2ba1234",
"size": "1... |
import hashlib
import os, StringIO, pycurl
from tornado.web import *
import sys
import threading
import time
import weakref
from Queue import Queue
from tornado import ioloop
from tornado import stack_context
def threaded(method):
'''
Makes a regular controller action threaded.
'''
@asynchronou... | {
"content_hash": "41367b39366a7f1e228e0a0c1e824459",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 93,
"avg_line_length": 27,
"alnum_prop": 0.5845562543675751,
"repo_name": "PegasusWang/whirlwind",
"id": "3d4271813ed6b3e1f7cac01f6acecbd78c6c7bcf",
"size": "2887",
"bin... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=... | {
"content_hash": "b5d703151d057b2ab81f71948c279b90",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 114,
"avg_line_length": 33.45454545454545,
"alnum_prop": 0.5561594202898551,
"repo_name": "aadithyamd/QandA",
"id": "da9f227eb6189dedd17e9757c345e6c0ae4e4af4",
"size": "112... |
import unittest
from unittest import mock
import pykka
from mopidy import core
from mopidy.internal import deprecation
from mopidy.models import Track
from tests import dummy_backend
@mock.patch.object(core.CoreListener, "send")
class BackendEventsTest(unittest.TestCase):
def setUp(self): # noqa: N802
... | {
"content_hash": "d8e85aee5c876e0a84d14672f731856e",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 80,
"avg_line_length": 34.03738317757009,
"alnum_prop": 0.6532125205930808,
"repo_name": "jodal/mopidy",
"id": "828a19634782d481a78616599358eb7818835413",
"size": "3642",
... |
"""Exceptions of the PPP Core."""
from ppp_libmodule.exceptions import ClientError, BadGateway
| {
"content_hash": "de625179e0eb1835c5136195ca7edb09",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 60,
"avg_line_length": 32,
"alnum_prop": 0.78125,
"repo_name": "ProjetPP/PPP-Core",
"id": "8bc9d80f33144ef2749814c3d931cac2dd4fe14b",
"size": "96",
"binary": false,
"cop... |
import sys
from logger import Logger
def run_modules():
import conf.scans
# Running Module Scans
count = {'mods': 0, 'scans': 0, 'failed_scans': 0}
for mod in conf.scans.enabled_modules:
klass = mod['class']
servers = mod.get('servers', [None])
params = mod.get('params')
... | {
"content_hash": "57e64584e7aa22c47cfd7df0b55f4348",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 101,
"avg_line_length": 28.3,
"alnum_prop": 0.5429917550058893,
"repo_name": "amiraliakbari/server-watch-client",
"id": "fcdd161c237fc877f0aad4e390545e7a5264afd1",
"size": ... |
from django.utils.translation import ugettext_noop as _
from api.mon.graphs import GraphItems
from vms.models import Vm
GRAPH_ITEMS = GraphItems({
'cpu-usage': {
'desc': _('Total compute node CPU consumed by the VM.'),
'items': ('vm.cpu.sys', 'vm.cpu.user'),
'update_interval': GraphItems.... | {
"content_hash": "eaee5e4478368ba57928b94bde295671",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 114,
"avg_line_length": 38.68817204301075,
"alnum_prop": 0.5361311839911062,
"repo_name": "erigones/esdc-ce",
"id": "1d6b912862d9bc716c46d61e4ed506093f7a5a55",
"size": "71... |
from abstractStatelessProxyTestCase import AbstractStatelessProxyTestCase
from ..sipmessaging import SIPURI
from ..siptransport import TLSSIPTransport
from ..sipentity import SIPStatelessProxy
class TestStatelessProxyWithTLSTransport(AbstractStatelessProxyTestCase):
# TODO - need to implement!
pass
| {
"content_hash": "46e197a35fb783b0b82d5c4201e77ba6",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 73,
"avg_line_length": 34.44444444444444,
"alnum_prop": 0.8483870967741935,
"repo_name": "bobjects/BobStack",
"id": "b8cb55d0b3fa8d99784768c1bf5792890dce667e",
"size": "310"... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/base/shared_pet_droid_deed_base.iff"
result.attribute_template_id = 2
result.stfName("deed","unidentified_deed")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "9ffaba28f058374aab056a4d68ed1c41",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 77,
"avg_line_length": 23.76923076923077,
"alnum_prop": 0.6990291262135923,
"repo_name": "anhstudios/swganh",
"id": "bf379d313efc70d421994225205371489d9f3420",
"size": "454... |
import logging
from flask import Response
from flask import request
from flask_restplus import Resource, Namespace
from son_editor.impl import workspaceimpl
from son_editor.util import descriptorutil
from son_editor.util.constants import WORKSPACES
from son_editor.util.descriptorutil import SCHEMA_ID_VNF
from son_edi... | {
"content_hash": "f538ba461975cffd272a6e73ba9792c3",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 83,
"avg_line_length": 27.28,
"alnum_prop": 0.6664222873900293,
"repo_name": "chrz89/upb-son-editor-backend",
"id": "5afd486dd2e0633b5ff1b89773e317b085a8d83f",
"size": "136... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_auto_20150429_2106'),
]
operations = [
migrations.RenameModel(
old_name='Comments',
new_name='Comment',
... | {
"content_hash": "a9fde3f8a015ceb419285962af3a697e",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 44,
"avg_line_length": 19.41176470588235,
"alnum_prop": 0.5878787878787879,
"repo_name": "imakin/imakinweb",
"id": "7edcf7bb8e4275380341949426726f595024190f",
"size": "354"... |
"""Base test case classes for the unit tests"""
import datetime
import functools
import httplib
import logging
import pprint
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.abspath(__file__),
'..', '..', '..', '..', '..', 'keystone')))
import unittest2 as unitt... | {
"content_hash": "22b9f47648bbea08c77cc749232d1035",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 78,
"avg_line_length": 34.17725752508361,
"alnum_prop": 0.5647323612877972,
"repo_name": "pvo/keystone",
"id": "b6866566c1c1ccb3ad119ff5d73d93277e6d140a",
"size": "10848",... |
"""
sphinx.domains.lasso
~~~~~~~~~~~~~~~~~~~~
The Lasso domain, based off of the standard Python and JavaScript domains.
:copyright: Copyright 2013 by Eric Knibbe
:license: BSD, see LICENSE for details.
"""
from docutils import nodes
from sphinx import addnodes
from sphinx.directives import Obje... | {
"content_hash": "b0485a407d7cbe450672296a55c54f8d",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 86,
"avg_line_length": 36.59947643979058,
"alnum_prop": 0.5600457764108433,
"repo_name": "Lemma1/MAC-POSTS",
"id": "a4a5ab8177346dd7d47a3ba9b6870a7a28bd2016",
"size": "140... |
import operator
from datetime import datetime
from functools import partial, wraps
from itertools import chain
from typing import TYPE_CHECKING
import pytz
from future.utils import iteritems
from tabulate import tabulate
from simpleflow import compat
from simpleflow.history import History
from simpleflow.utils import... | {
"content_hash": "9c1a78951a9b42d9ffb2700b305ae0c9",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 83,
"avg_line_length": 24.51702786377709,
"alnum_prop": 0.5730521530496275,
"repo_name": "botify-labs/simpleflow",
"id": "032a537001c3a5bb84ebac52fe6df47405a645a7",
"size"... |
import os, os.path
import random
import sqlite3
import string
import time
import cherrypy
DB_STRING = "my.db"
class StringGenerator(object):
@cherrypy.expose
def index(self):
return file('index.html')
class StringGeneratorWebService(object):
exposed = True
@cherrypy.tools.accept(media='text/p... | {
"content_hash": "f065458e597f8d307ee73fb4df3dca05",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 79,
"avg_line_length": 30.61627906976744,
"alnum_prop": 0.5921002658564375,
"repo_name": "NeuroDataDesign/seelviz",
"id": "02c50d585788207d68f516d5fd23137a1a34c909",
"size"... |
import json
import requests
#import os
from collections import OrderedDict
from posixpath import join as path_urljoin
API_URL = 'https://api.airtable.com/v%s/'
API_VERSION = '0'
class IsNotInteger(Exception):
pass
class IsNotString(Exception):
pass
def check_integer(_num):
if not _num:
return... | {
"content_hash": "391c7e45ce35cc0f8131039013c3585e",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 84,
"avg_line_length": 37.891891891891895,
"alnum_prop": 0.5556348074179743,
"repo_name": "OpenHCOS/HCOS",
"id": "01c58e66a7413d74f45bb2180f2ba9ea91a2b8f0",
"size": "6535"... |
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": "b7270335dbdd6209779abedb8966f5ef",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 589,
"avg_line_length": 41.262773722627735,
"alnum_prop": 0.743499027065275,
"repo_name": "infinitewarp/poketrainer",
"id": "b83dea1e50b4c45366665f5a0a4cf2692a873928",
"si... |
from django.utils.termcolors import colorize
from django.core.management.base import BaseCommand
class FecCommand(BaseCommand):
def header(self, string):
self.stdout.write(
colorize(string, fg="cyan", opts=("bold",))
)
def log(self, string):
self.stdout.write(
... | {
"content_hash": "0c6276faed4d701d0049a6d17d528380",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 55,
"avg_line_length": 23.4,
"alnum_prop": 0.5726495726495726,
"repo_name": "datadesk/django-fec-raw-data",
"id": "3b7f736e7b0fd52ad65207602e81666ab7a03462",
"size": "585",... |
import json
import os
import shutil
import StringIO
import tempfile
import unittest
from telemetry import story
from telemetry import benchmark
from telemetry.internal.results import json_output_formatter
from telemetry.internal.results import page_test_results
from telemetry import page as page_module
from telemetry.... | {
"content_hash": "0b7f5a46af69131756c0f12db18960b0",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 77,
"avg_line_length": 37.37777777777778,
"alnum_prop": 0.6845025762980579,
"repo_name": "catapult-project/catapult-csm",
"id": "6a1c88507bb50083726df9fdedab8b669dd8ce27",
... |
import sys
from re import sub
from re import I as reicase
from re import compile as recompile
class MiniOptimizer:
statements = []
alters = []
merge_alters = []
creates = []
drop_index = []
modify_rows = []
drops = []
views = []
comments = []
alter_per_table = {}
inter_mod... | {
"content_hash": "de78bb129d078dbca48e80de806d2146",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 119,
"avg_line_length": 37.74375,
"alnum_prop": 0.5244245736049015,
"repo_name": "mparienti/compact-migration",
"id": "03ff68e437e2468ac151b4d69337566dd77bdd4f",
"size": "... |
import json
import os
import csv
class EvalConfig:
def __init__(self, sw, param_path, pop_path, o2mmap, renamemap, filt_path, testcase, base_dir):
if not os.path.exists(base_dir):
os.mkdir(base_dir)
self.sw_name = sw
self.parameter_dir = param_path
... | {
"content_hash": "3442a5a110afad2747b96f510d79a69c",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 106,
"avg_line_length": 36.24475524475525,
"alnum_prop": 0.5224773297318156,
"repo_name": "tianyin/cox",
"id": "9d0c085144a25d995ecf42d1901e8b88afa06f59",
"size": "5183",
... |
"""
Enable HipChat notifications of build execution.
:Parameters:
* **enabled** *(bool)*: general cut off switch. If not explicitly set to
``true``, no hipchat parameters are written to XML. For Jenkins HipChat
plugin of version prior to 0.1.5, also enables all build results to be
reported in HipChat roo... | {
"content_hash": "a2830d8c50f2a9256ea488fbf48d7914",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 44.682432432432435,
"alnum_prop": 0.6329956146983214,
"repo_name": "waynr/jenkins-job-builder",
"id": "f349075720586a5b2449dce6f2d15ed86f3100b9",
"s... |
from snap import *
import snap
import sys
# create a graph PUNGraph (undirected graph)
G1 = TUNGraph.New()
# read in vertices
numVertices = 0
textFile = open('vertices_' + str(sys.argv[1]) + '.txt')
lines = textFile.readlines()
for line in lines:
stripped_line = line.rstrip('\n')
G1.AddNode(int(stripped_line... | {
"content_hash": "906fe5691145b557ced6d22326623988",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 56,
"avg_line_length": 24.35483870967742,
"alnum_prop": 0.6423841059602649,
"repo_name": "weberle/plads",
"id": "9acb7ce52d34c48cf7a62e2a61d411332b89436f",
"size": "856",
... |
'''
@author: Frank
'''
import weakref
import threading
import functools
import os
import fcntl
#import typing
_internal_lock = threading.RLock()
_locks = weakref.WeakValueDictionary()
def _get_lock(name):
with _internal_lock:
lock = _locks.get(name, threading.RLock())
if not name in _locks:
... | {
"content_hash": "dce26783f8d0c5353820f0fc0ebb06b7",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 91,
"avg_line_length": 24.87719298245614,
"alnum_prop": 0.5846262341325811,
"repo_name": "zstackorg/zstack-utility",
"id": "94adfc86f1ce1b75a0149b71999b309e3fb68285",
"siz... |
"""
kombu.transport.memory
======================
In-memory transport.
"""
from __future__ import absolute_import
from Queue import Queue
from . import virtual
class Channel(virtual.Channel):
queues = {}
do_restore = False
def _has_queue(self, queue, **kwargs):
return queue in self.queues
... | {
"content_hash": "747b95e978e0f2515bd590dd78868bae",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 54,
"avg_line_length": 21.634920634920636,
"alnum_prop": 0.5979457079970653,
"repo_name": "neumerance/deploy",
"id": "e6ae7895222ddeabbcf253e5cf936d5e8330ef60",
"size": "13... |
import json
from flask import (
current_app,
flash,
redirect,
render_template,
request,
session,
url_for,
)
from itsdangerous import SignatureExpired
from notifications_utils.url_safe_token import check_token
from app.main import main
from app.main.forms import NewPasswordForm
from app.mod... | {
"content_hash": "e34bd97e3a843d1978575bb2ed4fbe18",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 114,
"avg_line_length": 35.706896551724135,
"alnum_prop": 0.650410429744085,
"repo_name": "alphagov/notifications-admin",
"id": "60a043a9b6ea5925896a44a68e41b7f179c5c42b",
... |
"""
WSGI config for angulardjango project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "angulardjango.settings")
from d... | {
"content_hash": "fa1a4ee2da5db1b7702c624422cfe11a",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 28.642857142857142,
"alnum_prop": 0.7805486284289277,
"repo_name": "elberthcabrales/tweeter",
"id": "83f9e04358c33f0c25b56606323259b9aae9c69b",
"size... |
'''
realize with matrix
'''
import theano
import theano.tensor as T
from theano import function, grad
from numpy import *
from ga import GA
class neuron_map(object):
def __init__(self, num = 20, density=0.5, input, output):
w_value = asarray(random.uniform(-1, 1, size = (num, num)), dtyp... | {
"content_hash": "9fed518b2108db6d488218a88b4de24f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 110,
"avg_line_length": 29.233333333333334,
"alnum_prop": 0.5940706955530216,
"repo_name": "PiscesDream/Ideas",
"id": "5cac2838cb7d80ae287f06501ffc6ee22086defd",
"size": "8... |
from django.dispatch import Signal
template_rendered = Signal(providing_args=["template", "context"])
setting_changed = Signal(providing_args=["setting", "value"])
| {
"content_hash": "544dfb6d96443e77179cca5b1fd82a43",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 66,
"avg_line_length": 33.2,
"alnum_prop": 0.7530120481927711,
"repo_name": "disqus/django-old",
"id": "e29f4704bb358707172384d31976d0ceb637da68",
"size": "166",
"binary":... |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.exceptions import DeserializationError
from msrestazure.azure_operation import AzureOperationPoller
from .. import models
class ApplicationGatewaysOperations(object):
"""ApplicationGatewaysOp... | {
"content_hash": "b8a085a8096f66b933f90be568e6d1f7",
"timestamp": "",
"source": "github",
"line_count": 992,
"max_line_length": 169,
"avg_line_length": 45.801411290322584,
"alnum_prop": 0.6457136568724552,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "3e5da444d859febebcb152f2a706eb6a59b32915... |
import numpy as np
import tensorflow as tf
import os
import time
def get_vars_main_target(t_vars, main_name='main_q', target_name='target_q'):
main_vars = [var for var in t_vars if var.name.startswith(main_name)]
target_vars = [var for var in t_vars if var.name.startswith(target_name)]
for x in main_vars:... | {
"content_hash": "33167e2e54f9bd385b0d436fb5880a55",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 88,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.6110703812316716,
"repo_name": "n3011/deeprl",
"id": "aacf4dc80082493a0c1a393bf02752776a1b3165",
"size": "3021",
... |
"""Query unit tests."""
# Copyright (c) 2001-2009 ElevenCraft Inc.
# See LICENSE for details.
from schevo.constant import UNASSIGNED
from schevo import error
from schevo import field
from schevo.label import label
from schevo.test import CreatesSchema, raises
class BaseQuery(CreatesSchema):
# XXX: tests for sc... | {
"content_hash": "2e576ba688568e2e7d713c1a81331df9",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 73,
"avg_line_length": 33.11489361702127,
"alnum_prop": 0.5630943202261629,
"repo_name": "Schevo/schevo",
"id": "cf8b0acd2b08b885591e110242ce96e64aebf4da",
"size": "7782",... |
"""
The patch module allows for a grid to be created and for data to be
defined on that grid.
Typical usage:
-- create the grid
grid = Grid1d(nx)
-- create the data that lives on that grid
data = CellCenterData1d(grid)
bcObj = bcObject(xlb="reflect", xrb="reflect"_
data.registerVar("densi... | {
"content_hash": "e7bcc89f1bb1dc46c4a5779a4f526fe4",
"timestamp": "",
"source": "github",
"line_count": 471,
"max_line_length": 78,
"avg_line_length": 27.6135881104034,
"alnum_prop": 0.5131477779486391,
"repo_name": "JeffDestroyerOfWorlds/hydro_examples",
"id": "ae89b6ffc72953650fdfbdb8758bb22cb83318... |
"""Tests for the document fields."""
import copy
import unittest
from grow.documents import document_fields
class DocumentFieldsTestCase(unittest.TestCase):
def testContains(self):
doc_fields = document_fields.DocumentFields({
'foo': 'bar',
}, None)
self.assertEqual(True, 'f... | {
"content_hash": "d01590746cdb2272ff64236bb2ecc892",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 68,
"avg_line_length": 25.894736842105264,
"alnum_prop": 0.5609756097560976,
"repo_name": "grow/grow",
"id": "01eefefcf8bb0c1b1c5218f666aa6af5590abb31",
"size": "1476",
"... |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import unittest
from pants.base.build_root import BuildRoot
from pants.util.contextutil import environment_as, pushd, temporary_dir
from pants.util.dirutil import safe_mkdir, safe_mkdtemp, safe_rmtree, touch
class BuildRoot... | {
"content_hash": "1e534b38c1d86b80607cfb5f417a2314",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 82,
"avg_line_length": 31.22222222222222,
"alnum_prop": 0.6893746822572445,
"repo_name": "twitter/pants",
"id": "dadf6efe24f9bb285033a7aa51eff00e1caf77dc",
"size": "2114",
... |
WEBSOCKET_URL = "wss://api2.bitfinex.com:3000/ws"
REST_API_URL = "https://api.bitfinex.com/v1"
BITFINEX_API_KEY="abcdmymoneyhere"
BITFINEX_API_SECRET"BDEWEdfwefqaewmymoneythere" | {
"content_hash": "ea77b36bbf930a0e85a50e4deacd8e22",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 49,
"avg_line_length": 44.25,
"alnum_prop": 0.7853107344632768,
"repo_name": "currentsea/bitcoinelasticsearch",
"id": "f838197b3ad30c057c5b797e7d83d8c9f84fda7d",
"size": "30... |
import numpy as np
from theano import config
import theano.tensor as T
from sklearn.decomposition import PCA
"""
External function to deal with evaluation of model
"""
def getPrior(vae, nsamples=100):
""" Sample from Prior """
z = np.random.randn(nsamples,vae.params['dim_stochastic'])
return z
def sample(... | {
"content_hash": "f9d3be828b95840598f3bbf28dd336f6",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 92,
"avg_line_length": 35.04705882352941,
"alnum_prop": 0.5817388385364216,
"repo_name": "rahulk90/inference_introspection",
"id": "2f7f177bf740c85c22d0a76f7b116eff312e2a7c",... |
try:
from django.contrib.postgres import forms
from django.contrib.postgres.fields import JSONField
from django.contrib.postgres.fields.jsonb import (
KeyTextTransform, KeyTransform,
)
except ImportError:
pass
from django.core.checks import Warning as DjangoWarning
from django.utils.depreca... | {
"content_hash": "37ee9c99635a1ddcee4411e286b8c955",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 78,
"avg_line_length": 37.357142857142854,
"alnum_prop": 0.6524856596558317,
"repo_name": "googleinterns/django",
"id": "69dcce3781a0a4bfea75ebea146a64eefb62b267",
"size": ... |
import pytest
from mock import Mock
from requests import HTTPError
from f5_openstack_agent.lbaasv2.drivers.bigip import exceptions as f5_ex
from f5_openstack_agent.lbaasv2.drivers.bigip import l7policy_service
class MockError(Exception):
pass
class MockHTTPError(HTTPError):
def __init__(self, response_ob... | {
"content_hash": "584e2efd80b951983e8289e9c2f6a5d7",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 72,
"avg_line_length": 26.545454545454547,
"alnum_prop": 0.7134703196347032,
"repo_name": "F5Networks/f5-openstack-agent",
"id": "c462ee1365ac9d92f222603bc38e58e4c9d8d8b4",
... |
import datetime
import mock
from oslo_utils import timeutils
import six
from heat.common import exception
from heat.common import template_format
from heat.engine import resource
from heat.engine import scheduler
from heat.tests.autoscaling import inline_templates
from heat.tests import common
from heat.tests import ... | {
"content_hash": "75c8ca859cbc9ec1885b66e3f0165670",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 77,
"avg_line_length": 43.018181818181816,
"alnum_prop": 0.6367286559594252,
"repo_name": "cryptickp/heat",
"id": "8418a6a7e471935822856c687ff02c1547c297f4",
"size": "1003... |
from tornado.testing import AsyncHTTPTestCase
from cookiecutter_search.application import MainApplication
from cookiecutter_search.urls import urlpatterns
class GoogleSiteVerificationTest(AsyncHTTPTestCase):
def get_app(self):
return MainApplication(urlpatterns)
def test_responds_to_google_site_veri... | {
"content_hash": "57e24d6d87bcac929e0232d1ce79e685",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 77,
"avg_line_length": 38.55555555555556,
"alnum_prop": 0.7622478386167147,
"repo_name": "rcmachado/cookiecutter-search",
"id": "92a603a7ed03a8757e86bb13da2e652d7d28496f",
... |
import os,sched,time
from mutagen.mp3 import MP3
from mutagen.easyid3 import EasyID3
import sqlite3
temp='puriyavillai-hq.mp3'
#temp='3rds.mp3'
timeset = 0
currtime = 0.0
starttime = 0.0
audtime = 0.0
conn = sqlite3.connect('PyPlayer.db')
def settime():
global temp,timeset,currtime,starttime,audtime
currtime = ti... | {
"content_hash": "1daf0a7cc4579495bfcb5e4fc9f95f30",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 104,
"avg_line_length": 20.674242424242426,
"alnum_prop": 0.6511542689629901,
"repo_name": "vik1124/BottlePlayer",
"id": "ebfbf15d0e821acd9e6198f1677647f8e06a0186",
"size"... |
from zope.interface import implements
from twisted.internet import defer
from twisted.python import log
from twisted import plugin
from nevow import url
from webut.navi import inavi
class PluggableNavigation(object):
"""
A pluggable navigation element.
Please subclass and set these attributes:
- inte... | {
"content_hash": "7428c7166268302adf04ce269b05d2dd",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 71,
"avg_line_length": 30.714285714285715,
"alnum_prop": 0.5898255813953488,
"repo_name": "tv42/webut",
"id": "af445d722f950d7e329aba1525f56bf032cabb4b",
"size": "3440",
... |
"""Football action set tests."""
from absl.testing import absltest
from gfootball.env import football_action_set
import numpy as np
named_action_from_action_set = football_action_set.named_action_from_action_set
class FootballActionSetTest(absltest.TestCase):
def test_action_from_basic_action_set(self):
acti... | {
"content_hash": "54a1d4ea26973f0d0ac1f3bb5637c92a",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 79,
"avg_line_length": 36.559322033898304,
"alnum_prop": 0.6569309225776542,
"repo_name": "google-research/football",
"id": "b73393eb6cc1f2ce61cbb524f316177023990d63",
"siz... |
"""
This script is used to automate generation of requirements.txt for st2 components.
The idea behind this script is that that each component has it's own requirements
"in-requirements.txt" file. in-requirements.txt is an input requirements file -
a requirements file with dependencies but WITHOUT any version restrict... | {
"content_hash": "a13fee077c6a9a91e13bafca3775da73",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 96,
"avg_line_length": 34.24683544303797,
"alnum_prop": 0.6196636481241915,
"repo_name": "punalpatel/st2",
"id": "a3d0e6c15bb36121ec53740713c432a99b170de3",
"size": "6213"... |
import errno
import os
import stat
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_utils import units
from cinder.brick.remotefs import remotefs as remotefs_brick
from cinder import exception
from cinder.i18n import _, _LE, _LI, _LW
from cinder.image import image_utils
from cinder.open... | {
"content_hash": "10f9b65861d86359452da598c622d26f",
"timestamp": "",
"source": "github",
"line_count": 525,
"max_line_length": 79,
"avg_line_length": 37.62095238095238,
"alnum_prop": 0.5908561591818136,
"repo_name": "abusse/cinder",
"id": "011c526586028aa8d55c18a2512151ee3f05bfe0",
"size": "20384"... |
import time
import datetime
from helpers import unittest
from nose.plugins.attrib import attr
import luigi.notifications
from luigi.scheduler import DISABLED, DONE, FAILED, CentralPlannerScheduler
luigi.notifications.DEBUG = True
WORKER = 'myworker'
@attr('scheduler')
class CentralPlannerTest(unittest.TestCase):
... | {
"content_hash": "251c921a63d97bb7f636945f334fd0ad",
"timestamp": "",
"source": "github",
"line_count": 769,
"max_line_length": 127,
"avg_line_length": 45.75292587776333,
"alnum_prop": 0.6115848112778536,
"repo_name": "laserson/luigi",
"id": "576c105523db33170133017b4ffabfd5eaa420bd",
"size": "3578... |
from Kamaelia.Util.PipelineComponent import pipeline
from Record import AlsaRecorder
from Play import AlsaPlayer
from Kamaelia.SingleServer import SingleServer
from Kamaelia.Internet.TCPClient import TCPClient
pipeline(
AlsaRecorder(),
SingleServer(port=1601),
).activate()
pipeline(
TCPClient("127.0.0.1",... | {
"content_hash": "0fd35f4085a27bd16291d7736999eac0",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 52,
"avg_line_length": 23.6,
"alnum_prop": 0.7711864406779662,
"repo_name": "sparkslabs/kamaelia_",
"id": "a65a27b0300203f315f5beedbb63ae33ef095ec0",
"size": "374",
"bina... |
"""Helpers to help with encoding Home Assistant objects in JSON."""
import datetime
import json
from pathlib import Path
from typing import Any, Final
import orjson
JSON_ENCODE_EXCEPTIONS = (TypeError, ValueError)
JSON_DECODE_EXCEPTIONS = (orjson.JSONDecodeError,)
class JSONEncoder(json.JSONEncoder):
"""JSONEnc... | {
"content_hash": "b308af7db81b5816ce9469727a05f452",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 85,
"avg_line_length": 28.39423076923077,
"alnum_prop": 0.634270233660684,
"repo_name": "nkgilley/home-assistant",
"id": "74a2f542910f4480a03a061128d5f7890cef1f5e",
"size"... |
"""Media player support for Panasonic Viera TV."""
import logging
from panasonic_viera import Keys
from homeassistant.components.media_player import DEVICE_CLASS_TV, MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_URL,
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
SUPPORT_P... | {
"content_hash": "1786f4c14669d3558f80ee3bd2df693a",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 84,
"avg_line_length": 28.969072164948454,
"alnum_prop": 0.6224199288256228,
"repo_name": "partofthething/home-assistant",
"id": "c59c77b569c7a8cea90aec3e534a9a8d51649efe",
... |
import argparse
import copy
import logging
import os
import sys
from datetime import datetime
from fn import _
from opentuner.driverbase import DriverBase
from opentuner.resultsdb.models import Configuration
from opentuner.resultsdb.models import DesiredResult
from opentuner.resultsdb.models import Result
from opentun... | {
"content_hash": "a1f75dc168bc338cd0d411317fab04bb",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 93,
"avg_line_length": 35.84137931034483,
"alnum_prop": 0.6390225129882625,
"repo_name": "Sierangho/opentuner",
"id": "fc33aa9a22d6b7769602373aedc45013d79a3216",
"size": "... |
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from hubEnricher import Enricher
data = "Data/Allergy_and_Asthma.txt"
enricher = Enricher(data)
enricher.readPPIsFromFile()
ppis = enricher.ppisdict
# data
x = np.array(ppis.values())
from sklearn import preprocessing
x = preproces... | {
"content_hash": "2933b2989533032bb27bcf1c10792d76",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 95,
"avg_line_length": 22.829787234042552,
"alnum_prop": 0.7260018639328985,
"repo_name": "ammondal/Dominic",
"id": "c36cfc33a4ffa90daa9ffe6a139458f066de811e",
"size": "107... |
from datetime import datetime
import numpy as np
import pytest
import pytz
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Index,
Series,
bdate_range,
date_range,
)
import pandas._testing as tm
from pandas.core.api import Int64Index... | {
"content_hash": "7c8fdba75c54b190d89684b59b22fdfa",
"timestamp": "",
"source": "github",
"line_count": 599,
"max_line_length": 87,
"avg_line_length": 34.70283806343907,
"alnum_prop": 0.5734834271419638,
"repo_name": "pandas-dev/pandas",
"id": "07e1fd27b2f9693fd0aac31450b40d99b6d29f60",
"size": "20... |
"""Extracts features from formula."""
import HTMLParser
import cgi
import xml.etree.ElementTree as ET
from tempfile import TemporaryFile
import latex2mathml.converter as l2m
import locale
import re
OPEN_TAG = re.compile(r'>\s*(<)\s*<')
htmlparser = HTMLParser.HTMLParser()
class LatexSyntaxError(Exception):
"""... | {
"content_hash": "cb7a7017a4ce59243e9d91d359e855b8",
"timestamp": "",
"source": "github",
"line_count": 370,
"max_line_length": 84,
"avg_line_length": 32.69189189189189,
"alnum_prop": 0.5369543650793651,
"repo_name": "deka108/mathqa-server",
"id": "4e1498efd18ada823577cb2915985461c13d8d4d",
"size":... |
from __future__ import absolute_import, unicode_literals, division
from moarcofy import app
from flask import request, session, url_for, redirect
import importlib
import pkgutil
# configure versioned static path
@app.route("/static/<int:version>/<path:static_file>")
def versioned_static(version, static_file):
#... | {
"content_hash": "4ef9b815c1eadaa76b846024541b4223",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 66,
"avg_line_length": 29.11904761904762,
"alnum_prop": 0.6475878986099755,
"repo_name": "za-creature/moarcofy",
"id": "abc64a8b7d3c08b426bcdf6a334f2d98523c38ec",
"size": "... |
import xml.etree.ElementTree as ET
tree=ET.parse("student.xml")
pupil = tree.getroot()
for subject in pupil:
print(subject[0].text, subject[1].text)
| {
"content_hash": "ddefe039fa2fbf6a4b56755374c1d0d0",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 43,
"avg_line_length": 22.142857142857142,
"alnum_prop": 0.7225806451612903,
"repo_name": "vyzyv/university",
"id": "8eddb20c8ac1a6d9989e0623c2538b92fa610586",
"size": "155"... |
import os
import unused_reads as ur
#print the python path being used.
try:
user_paths = os.environ['PYTHONPATH'].split(os.pathsep)
except KeyError:
user_paths = []
# run the command
# word size = 11 is default for blastn
# see: http://www.ncbi.nlm.nih.gov/books/NBK279675/
# Note it is for the initial matc... | {
"content_hash": "bd23dcf76a1b6899e15a2a07f8d25b89",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 59,
"avg_line_length": 28.608695652173914,
"alnum_prop": 0.6443768996960486,
"repo_name": "JanetMatsen/meta4_bins_janalysis",
"id": "e4a32f9761041d6350488e4cceda657f7211f915"... |
import testClasses
import bayesNet
import random
import layout
import hunters
from copy import deepcopy
from hashlib import sha1
from tempfile import mkstemp
import time
from shutil import move
from os import remove, close
import util
class GraphEqualityTest(testClasses.TestCase):
def __init__(self, question, tes... | {
"content_hash": "695b793e03175f3f187075b55c811c5b",
"timestamp": "",
"source": "github",
"line_count": 538,
"max_line_length": 190,
"avg_line_length": 45.97583643122677,
"alnum_prop": 0.660076814230847,
"repo_name": "omardroubi/Artificial-Intelligence",
"id": "ad688c91066c7edc3f70392b2a8871b67c8a46a... |
"""
Tests for ``flocker.control.httpapi``.
"""
from uuid import uuid4
from copy import deepcopy
from datetime import datetime
from pyrsistent import pmap, thaw
from pytz import UTC
from zope.interface.verify import verifyObject
from twisted.internet import reactor
from twisted.internet.defer import gatherResults
f... | {
"content_hash": "31b10dbc7a7d42763f51d8ffe90a6d8e",
"timestamp": "",
"source": "github",
"line_count": 3549,
"max_line_length": 79,
"avg_line_length": 35.67061143984221,
"alnum_prop": 0.5407085587898416,
"repo_name": "mbrukman/flocker",
"id": "f9f975684aadc08d8d0cfbaed486e5d6b39aab9f",
"size": "12... |
"""Test various fingerprinting protections.
If an stale block more than a month old or its header are requested by a peer,
the node should pretend that it does not have it to avoid fingerprinting.
"""
import time
from test_framework.blocktools import (create_block, create_coinbase)
from test_framework.mininode impor... | {
"content_hash": "12262bbc6acf36fe98051099e78a9752",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 79,
"avg_line_length": 38.006711409395976,
"alnum_prop": 0.6515980928836306,
"repo_name": "doriancoins/doriancoin",
"id": "866ee54610c4d18c4f7e269c3326d9943634830e",
"size... |
import time
import logging
from .users import Users
from .groups import Groups
from .config import Config
from .ldapconnection import LdapConnection
logger = logging.getLogger(__name__)
class Ldappy(object):
"""
Wrapper to the ldap lib, one that will make you happy.
ldap docs: https://www.python-ldap.or... | {
"content_hash": "9b6ecaafceea5511862af36e61538c98",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 81,
"avg_line_length": 30.510204081632654,
"alnum_prop": 0.6287625418060201,
"repo_name": "dusking/ldappy",
"id": "034af41a1b7f992fe69a85b399671781f343d7d7",
"size": "1495"... |
from src.bamboo import EqualityMixin
class Project(EqualityMixin):
def __init__(self, key, name, link):
self.key = key
self.name = name
self.link = link
@classmethod
def from_json(cls, json):
project = cls(json['key'],
json['name'],
... | {
"content_hash": "50c5e768c364d1a5e47caae74cc95e6e",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 74,
"avg_line_length": 30.85,
"alnum_prop": 0.413290113452188,
"repo_name": "mibexsoftware/alfred-bamboo-workflow",
"id": "1f6dee7a2666033fe0d2c8da481efc046a58971d",
"size"... |
"""Score distribution Plot."""
import copy
from typing import Any, Dict, Iterator, Optional, Tuple
import numpy as np
from tensorflow_model_analysis import constants
from tensorflow_model_analysis.metrics import binary_confusion_matrices
from tensorflow_model_analysis.metrics import metric_types
from tensorflow_mode... | {
"content_hash": "968d213e66a4598311542b7fc906a06a",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 80,
"avg_line_length": 36.83846153846154,
"alnum_prop": 0.7039047817916058,
"repo_name": "tensorflow/model-analysis",
"id": "1c981b674dea64c67cd8b91c711b6cef27116ec8",
"si... |
import pytest
from os import path
from io import BytesIO
from circuits.web import Controller
from .multipartform import MultiPartForm
from .helpers import urlopen, Request
@pytest.fixture()
def sample_file(request):
return open(
path.join(
path.dirname(__file__),
"static", "unic... | {
"content_hash": "3f484304a3a4d85ba3fe89adb76ffedb",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 76,
"avg_line_length": 23.428571428571427,
"alnum_prop": 0.6046747967479674,
"repo_name": "eriol/circuits",
"id": "726c6f2ac5436578482de7b0c0c14c27d3e84f7b",
"size": "1991"... |
java_sql_types = [
('ARRAY', 2003),
('BIGINT', -5),
('BINARY', -2),
('BIT', -7),
('BLOB', 2004),
('BOOLEAN', 16),
('CHAR', 1),
('CLOB', 2005),
('DATALINK', 70),
('DATE', 91),
('DECIMAL', 3),
('DISTINCT', 2001),
('DOUBLE', 8),
('FLOAT', 6),
('INTEGER', 4),
... | {
"content_hash": "aa782ff6324f377261d89f3f2d355260",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 108,
"avg_line_length": 37.95982142857143,
"alnum_prop": 0.7242149829471951,
"repo_name": "massmutual/py4jdbc",
"id": "1d51fd872e94f51ba69c91d435e385b80f8a0d1c",
"size": "... |
from django.apps import AppConfig
class WFSConfig(AppConfig):
name = "wfs"
verbose_name = "WFS"
| {
"content_hash": "89474c8d0b98306a6be73c14870bd6af",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 33,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.6886792452830188,
"repo_name": "vascop/django-wfs",
"id": "fcc0a8b920a274eeeb7a3b2036b2e755817b895e",
"size": "106... |
from flask import flash
from wtforms import SelectMultipleField
from slugify import Slugify
from .app_setup import app
from jinja2 import Markup
# Misc utils methods
def flash_errors(form):
# Create a flash message for all the WTForms errors
# Taken from http://flask.pocoo.org/snippets/12/
form... | {
"content_hash": "93e6ec45a18dd3671bd89148566d06a0",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 103,
"avg_line_length": 33.79710144927536,
"alnum_prop": 0.611492281303602,
"repo_name": "davcs86/fullstack-nanodegree-flask-item-catalog",
"id": "fcb3763d3370f28e1c4e8e77f6e... |
from django.apps import AppConfig
class AppConfig(AppConfig):
name = '.'.join(__name__.split('.')[:-1])
label = "ik_event_listing"
verbose_name = "Event Content Listing"
| {
"content_hash": "d49ea44ade7fcb1d9b7d6756ebd3c045",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 45,
"avg_line_length": 26.285714285714285,
"alnum_prop": 0.6467391304347826,
"repo_name": "ic-labs/django-icekit",
"id": "4853fda830c57aed093e0d7047de988d16b15fec",
"size": ... |
"""
Tests for django.core.servers.
"""
from __future__ import unicode_literals
import contextlib
import errno
import os
import socket
from django.test import LiveServerTestCase, override_settings
from django.utils._os import upath
from django.utils.http import urlencode
from django.utils.six import text_type
from dja... | {
"content_hash": "64506152a154d891b63ca30b36ed1cd0",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 99,
"avg_line_length": 34.483870967741936,
"alnum_prop": 0.6230121608980356,
"repo_name": "cloudera/hue",
"id": "1224dddc22b2c83432e8f0c938a911ed845ee2cf",
"size": "5375",... |
import sys
import argparse
import re
def convert(dictionaryStreams, inputs, output, unk, annotated):
# create in memory dictionaries
dictionaries = [{line.rstrip('\r\n').strip(): index
for index, line in enumerate(dic)}
for dic in dictionaryStreams]
# convert inpu... | {
"content_hash": "b87ca03bda7a2ea3881672c54620f981",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 79,
"avg_line_length": 36.523809523809526,
"alnum_prop": 0.5205345501955672,
"repo_name": "fiskio/sequoias",
"id": "c08e9ba41d76074a72118cd3094d8b597ec1e20d",
"size": "721... |
MODULE_NAME = 'set-position'
MODULE_DESC = 'Move a character to its homepoint, or to another set location'
MODULE_VER = '1.0'
def START(db, *args):
"""Remove Darkstar account sessions"""
class Position(object):
def __init__(self, rot, x, y, z, zone):
self.rot = rot
... | {
"content_hash": "5eaa95de06d4871078c3eded248dcaf9",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 96,
"avg_line_length": 36.943820224719104,
"alnum_prop": 0.537712895377129,
"repo_name": "bhamlin/tripping-octo-nemesis",
"id": "854a9deb370d6187b384f368506f43d7346255df",
... |
"""Calendar class to wrap list of Appointments for Paxos Log Entries."""
from Appointment import Appointment
import datetime
class Calendar(object):
"""
Calendar object to function as container of Appointment objects, which
enforces logical rules of a calendar.
appointments: unordered ... | {
"content_hash": "9bdbc1b4153d00367c476ac8202a7045",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 112,
"avg_line_length": 34.80769230769231,
"alnum_prop": 0.5720073664825046,
"repo_name": "nickmarton/Paxos-Distributed-Calendar",
"id": "e0740e62a5dd4c5c4a5933bd977e6402129... |
from zerver.lib.test_classes import WebhookTestCase
class PagerDutyHookTests(WebhookTestCase):
STREAM_NAME = 'pagerduty'
URL_TEMPLATE = "/api/v1/external/pagerduty?api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = 'pagerduty'
def test_trigger(self) -> None:
expected_message = 'Incident [3... | {
"content_hash": "8174c7469ca1e33652cb9dff48d71d9e",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 286,
"avg_line_length": 80.16071428571429,
"alnum_prop": 0.7034974381822232,
"repo_name": "shubhamdhama/zulip",
"id": "a1c0a3c19b769a9fff8aa4bb842ff49a629b865e",
"size": "4... |
import subprocess
from i3pystatus import IntervalModule
class Ping(IntervalModule):
"""
This module display the ping value between your computer and a host.
``switch_state`` callback can disable the Ping when desired.
``host`` propertie can be changed for set a specific host.
.. rubric:: Availa... | {
"content_hash": "fb66e1becd952948eab21f9d6012c3b8",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 72,
"avg_line_length": 27.614583333333332,
"alnum_prop": 0.5386646548472275,
"repo_name": "Arvedui/i3pystatus",
"id": "090d4d333ec336c5958fa9ff12dd1dcd9ddb1b2d",
"size": "2... |
import unittest
import operate_list
class Test_listoperateTestCase(unittest.TestCase):
"""Tests operate_list"""
def test_num_input(self):
"""Test returns result"""
self.assertEqual(operate_list.sum([2, 4, 6]), 12)
self.assertEqual(operate_list.multiply([2, 4, 6]), 48)
... | {
"content_hash": "e3d017fb98d19bf2d3b8ca458c3094c3",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 70,
"avg_line_length": 32.51428571428571,
"alnum_prop": 0.6010544815465729,
"repo_name": "giantas/minor-python-tests",
"id": "25b57a11a4c6df4eedb8a3f668fd3d6e84200317",
"si... |
import struct
import sys
import tempfile
import unittest
from mock import Mock, patch
from nose.tools import eq_
from beehive.formatter import formatters
from beehive.formatter import pretty
# from beehive.formatter import tags
from beehive.formatter.base import StreamOpener
from beehive.model import Tag, Feature, Mat... | {
"content_hash": "ce1439410d1b1a5005b3e017486d150c",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 83,
"avg_line_length": 28.764705882352942,
"alnum_prop": 0.5847307430129516,
"repo_name": "vrutkovs/beehive",
"id": "0a154d81723e5c89ac1799e5be82882c28560d0d",
"size": "73... |
from __future__ import print_function
from PIL import Image
import os
import sys
class Interval(object):
def __init__(self, interval="0"):
self.setinterval(interval)
def setinterval(self, interval):
self.hilo = []
for s in interval.split(","):
if not s.strip():
... | {
"content_hash": "ee65d265854b8d97c08e4e833e3fdf24",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 75,
"avg_line_length": 22.365384615384617,
"alnum_prop": 0.5223559759243336,
"repo_name": "Sarah-Alsinan/muypicky",
"id": "67bc48e102ce31cddf934fdfb5dc3c0891b1db4d",
"size... |
from unittest import TestCase
from wallace.optimization_algorithms.differential_evolution import DESelection
from wallace.settings import AbstractSettings
class DESelectionTest(TestCase):
def setUp(self):
settings = AbstractSettings({
"differential_evolution.crossover_probability": 1.0,
... | {
"content_hash": "878118207cc790ee7e76170b33d4baa0",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 82,
"avg_line_length": 36.77777777777778,
"alnum_prop": 0.6531722054380664,
"repo_name": "wangjohn/wallace",
"id": "0dfff09b5f815fd451f689ece559f72155b7c6aa",
"size": "1655... |
import json
import datetime
import requests
from nameko.rpc import rpc
from nameko.events import EventDispatcher, event_handler
from statsd import StatsClient
from circuitbreaker import circuit
class MarketService:
name = "market_service"
statsd = StatsClient('statsd-agent', 8125,
pre... | {
"content_hash": "44571138f510a32da04893cbbb7ba475",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 80,
"avg_line_length": 35.72093023255814,
"alnum_prop": 0.6608072916666666,
"repo_name": "morganjbruce/microservices-in-action",
"id": "5a8947a71f22692c9c8003c6ab64d20c69883e... |
from __future__ import annotations
import os
import shutil
import typing as T
import xml.etree.ElementTree as ET
from . import ModuleReturnValue, ExtensionModule
from .. import build
from .. import coredata
from .. import mlog
from ..dependencies import find_external_dependency, Dependency, ExternalLibrary
from ..mes... | {
"content_hash": "e5f5786e11b90d94cff110b309d1d06d",
"timestamp": "",
"source": "github",
"line_count": 591,
"max_line_length": 160,
"avg_line_length": 49.50930626057529,
"alnum_prop": 0.5939166097060834,
"repo_name": "pexip/meson",
"id": "3157c2825eadbcff74e9ec35451cfd30d61bbbaf",
"size": "29885",... |
'''
Recursively iterate over directories and add all files as Pillar data
.. versionadded:: 2015.5.0
Example Configuration
---------------------
.. code-block:: yaml
ext_pillar:
- file_tree:
root_dir: /path/to/root/directory
follow_dir_links: False
keep_newline: True
The ``r... | {
"content_hash": "4356decfab924044e8db056cbebec4ce",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 79,
"avg_line_length": 33.32132132132132,
"alnum_prop": 0.5685832732516222,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "a03b8c91f3a18ae4f9a8d39f86877ef4b5b4... |
from __future__ import unicode_literals
import contextlib
import sys
from mock import Mock, patch
from diff_cover.tool import parse_coverage_args, parse_quality_args, main
from diff_cover.tests.helpers import unittest
@contextlib.contextmanager
def nostderr():
"""
Context manager to suppress standard error
... | {
"content_hash": "02a8c0cd0321bddbc70af1b51656b69e",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 79,
"avg_line_length": 32.430851063829785,
"alnum_prop": 0.5773331146465475,
"repo_name": "mblayman/diff-cover",
"id": "fc22e51a8bdb431a6359255d1d04d38c41465bbb",
"size": ... |
import arrow
import datetime
from .exceptions import DateParseException, DateTimeParseException, NumberParseException
class Parameter():
def __init__(self):
pass
def to_internal(self, value):
return value
class String(Parameter):
def __init__(self, name, description=None, default_value... | {
"content_hash": "fba8dc41a4c399dd60fda2cca74b1ec5",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 120,
"avg_line_length": 32.604651162790695,
"alnum_prop": 0.5848787446504993,
"repo_name": "hemny-singh/squealy",
"id": "678204bd1b5091a258069903fea7a39c9e56608c",
"size":... |
from setuptools import setup, find_packages
LONGSDESC = """
Twisted-based WebSocket/WAMP protocol implementation test suite.
AutobahnTestSuite provides a fully automated test suite to verify client and
server implementations of the WebSocket protocol.
The test suite will check an implementation by doing ba... | {
"content_hash": "e6955f74b1076fbe08a2c8e8ac1c8e2a",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 97,
"avg_line_length": 34.9041095890411,
"alnum_prop": 0.6569858712715856,
"repo_name": "mikelikespie/AutobahnTestSuite",
"id": "7dbb8c3b1732086587de1076b119ae133f943cfe",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.