text stringlengths 4 1.02M | meta dict |
|---|---|
from coffin.template import Library
from django.template.loader import render_to_string
from jinja2 import nodes
from jinja2.ext import Extension
register = Library()
class MerchantExtension(Extension):
tags = set(['render_integration'])
def parse(self, parser):
stream = parser.stream
line... | {
"content_hash": "f6d7d1296207b731d2aa8526f8891f56",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 71,
"avg_line_length": 25.178571428571427,
"alnum_prop": 0.6907801418439716,
"repo_name": "ericholscher/merchant",
"id": "1bf9bd1fa9d55695c3055ee597f20bed8a391c3c",
"size":... |
from oslo_log import log
from stevedore import extension
from ceilometer import agent
from ceilometer.pipeline import base
LOG = log.getLogger(__name__)
class SampleEndpoint(base.NotificationEndpoint):
def info(self, notifications):
"""Convert message at info level to Ceilometer sample.
:param... | {
"content_hash": "9be15e0b71df594011fc76470ba4628d",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 79,
"avg_line_length": 32.84027777777778,
"alnum_prop": 0.5730598435187143,
"repo_name": "openstack/ceilometer",
"id": "79999d0bbf2681f441f82297a9100a4f4ceb73fd",
"size": ... |
'''
MAVLink protocol implementation (auto-generated by mavgen.py)
Generated from: common.xml
Note: this file has been auto-generated. DO NOT EDIT
'''
import struct, array, mavutil, time, json
WIRE_PROTOCOL_VERSION = "1.0"
# some base types from mavlink_types.h
MAVLINK_TYPE_CHAR = 0
MAVLINK_TYPE_UINT8_T = 1
M... | {
"content_hash": "93b6f2842bfbb04c3fb6d3d8531b929b",
"timestamp": "",
"source": "github",
"line_count": 5268,
"max_line_length": 579,
"avg_line_length": 59.31435079726651,
"alnum_prop": 0.5540503347542788,
"repo_name": "Yndal/ArduPilot-SensorPlatform",
"id": "bbad57b7d44ba31e051097ea3b7b4fb665a2a046"... |
"""
Constraint module
Functions:
None
Classes:
Constraint: dict-like object to hold requirements as key:value pairs
Exceptions:
None
"""
from __future__ import print_function
import collections
import copy
from ec2rlcore.logutil import LogUtil
class Constraint(dict):
"""
Holds parsed module m... | {
"content_hash": "d345da90b6304a71504e259eb3ed7f19",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 117,
"avg_line_length": 38.6551724137931,
"alnum_prop": 0.5664585191793042,
"repo_name": "gregbdunn/aws-ec2rescue-linux",
"id": "2c0c5f7b826aef8ec9512957a38ab3977a12d05e",
... |
from flask import Blueprint
api = Blueprint('api', __name__)
from . import authentication, comment, decorators, errors, post, user | {
"content_hash": "e2770ef928cce59959d7280f3b057026",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 69,
"avg_line_length": 26.4,
"alnum_prop": 0.7424242424242424,
"repo_name": "Ivicel/flasky",
"id": "34c00c09954b13260611f514c18bd3636922fb49",
"size": "132",
"binary": fal... |
"""RevKit support for control function oracles."""
from projectq.ops import BasicGate
from ._utils import _exec
class ControlFunctionOracle: # pylint: disable=too-few-public-methods
"""
Synthesize a negation controlled by an arbitrary control function.
This creates a circuit for a NOT gate which is c... | {
"content_hash": "894767056d97fe2eada6ae5f6c6907e8",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 89,
"avg_line_length": 39.083333333333336,
"alnum_prop": 0.5929874437337124,
"repo_name": "ProjectQ-Framework/ProjectQ",
"id": "40a07fe9f87fe1a92f0361f51bd9287cc2944c5f",
... |
"""
Train script
"""
import csv
import classifier
def main():
print('Reading CSV...')
csvfile = open('../data/train.csv', newline='')
datareader = csv.DictReader(csvfile)
data = list(datareader)
print('Training...')
classifier.train(data)
if __name__ == "__main__":
main()
| {
"content_hash": "aaf86c8e78c5891ec6e128261e4e6851",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 51,
"avg_line_length": 16.105263157894736,
"alnum_prop": 0.5947712418300654,
"repo_name": "jramcast/ml_weather",
"id": "11921a464837dc1077b5c6dd2b906ab4dfb83f09",
"size": "... |
import os
from filecmp import cmp
import numpy as np
from pandas.util.testing import assert_frame_equal
from moldynplot.dataset.HSQCDataset import HSQCDataset
from moldynplot.dataset.SequenceDataset import SequenceDataset
from moldynplot.dataset.TimeSeriesDataset import TimeSeriesDataset
###########################... | {
"content_hash": "95c0d3965aecce89019180debe7de444",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 79,
"avg_line_length": 31.76,
"alnum_prop": 0.6511335012594458,
"repo_name": "KarlTDebiec/Moldynplot",
"id": "4763f20bfe1a59753da167ca38e3387d3fba24e9",
"size": "6689",
... |
import pytest
from _pytest.config import ExitCode
def test_version_verbose(testdir, pytestconfig):
testdir.monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
result = testdir.runpytest("--version", "--version")
assert result.ret == 0
result.stderr.fnmatch_lines(
["*pytest*{}*imported from*".... | {
"content_hash": "5c68c905876e92f7e3e93cfb605f522e",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 82,
"avg_line_length": 29.705882352941178,
"alnum_prop": 0.6212164073550213,
"repo_name": "JoelMarcey/buck",
"id": "a33273a2c1daf4c5e6fa6e99f652eda69a388fe5",
"size": "353... |
from kmip.core.enums import KeyFormatType as KeyFormatTypeEnum
from kmip.core.enums import Tags
from kmip.core.enums import QueryFunction as QueryFunctionEnum
from kmip.core.primitives import ByteString
from kmip.core.primitives import Enumeration
from kmip.core.primitives import Interval
from kmip.core.primitives imp... | {
"content_hash": "a86a80b25820ad7f4a879431bbf977af",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 78,
"avg_line_length": 32.093023255813954,
"alnum_prop": 0.6440579710144928,
"repo_name": "callidus/PyKMIP",
"id": "05b43554a188d45424a62a08b786d0671ad4e268",
"size": "754... |
from hazelcast.serialization.bits import *
from hazelcast.protocol.builtin import FixSizedTypesCodec
from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer
from hazelcast.protocol.builtin import StringCodec
from hazelcast.protocol.builtin import DataCodec
from hazelcas... | {
"content_hash": "841f73730dc0c8d2fca0a27a7691d255",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 105,
"avg_line_length": 41.6875,
"alnum_prop": 0.7758620689655172,
"repo_name": "hazelcast/hazelcast-python-client",
"id": "871e1885258edac2ff7a5a59c28959f686f08887",
"size... |
"""
Run grep, ignoring irrelevant dirs.
Note on parameters:
* it is easier to control colors using command's option
* if switches need to be passed to grep, one can use `--`
"""
import argparse
import subprocess
import sys
import cmdutil
EXCLUDED_DIRS = [".git", ".idea"]
class Grep(cmdutil.Subcommand):
def co... | {
"content_hash": "5136489bdbe4e561c2ac7c040b0223c3",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 81,
"avg_line_length": 28.49230769230769,
"alnum_prop": 0.5340172786177105,
"repo_name": "vadim-ex/subcommand",
"id": "97e62a2befc3d8178e7c1973c385e44e218281c5",
"size": "1... |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.rename_doc import get_link_fields, dynamic_link_queries
from frappe.permissions import reset_perms
def execute():
frappe.reload_doctype("DocType")
frappe.reload_doctype("Communication")
reset_perms("Communication")
migrat... | {
"content_hash": "17b9b84a1cf3ec3128c8e2a0264e49c0",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 130,
"avg_line_length": 24.695652173913043,
"alnum_prop": 0.6920368364030336,
"repo_name": "vCentre/vFRP-6233",
"id": "09eeaa63fc8a87f40a4f7b60139cab9a73970201",
"size": "... |
import numpy as np
from numpy.testing import assert_allclose
from .... import units
from ....tests.helper import pytest, assert_quantity_allclose
from .. import LombScargle
ALL_METHODS = LombScargle.available_methods
ALL_METHODS_NO_AUTO = [method for method in ALL_METHODS if method != 'auto']
FAST_METHODS = [method ... | {
"content_hash": "c9b07e3cbfcb37fb1cf1224d37d8d9a0",
"timestamp": "",
"source": "github",
"line_count": 496,
"max_line_length": 79,
"avg_line_length": 34.131048387096776,
"alnum_prop": 0.6218914289089728,
"repo_name": "joergdietrich/astropy",
"id": "509247c12001955872c2f18cb0d873c6916fbcf5",
"size"... |
from __future__ import absolute_import, unicode_literals
import sys
from datetime import timedelta
from billiard.einfo import ExceptionInfo
from celery import result
from celery import states
from celery.utils import gen_unique_id
from djcelery.app import app
from djcelery.backends.cache import CacheBackend
from d... | {
"content_hash": "4298a4ab2cbf77c57a43d4d4c5d0ffc8",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 74,
"avg_line_length": 33.93043478260869,
"alnum_prop": 0.6335212711430036,
"repo_name": "kanemra/django-celery",
"id": "7bda97d2ad78ddd2eb9209a5f18631a9c5bdf7b2",
"size":... |
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A Simple Random Fractal Tree
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import numpy as np
try:
import cairocffi as cairo
except ImportError:
import cairo
ITERATIONS = 16 # total number of iterations
ROOT_COLOR = np.array([0.0, 0.0, 0.0]) # root branch color
LEAF_COLOR = np.array([1.... | {
"content_hash": "5294d208a68415bb7dba00e90a787e53",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 80,
"avg_line_length": 30.941176470588236,
"alnum_prop": 0.6315589353612168,
"repo_name": "neozhaoliang/pywonderland",
"id": "8f190fa66dc9dc758ea4e4af32c1fc0ac8f752ed",
"si... |
"""
NSQ base reader class.
This receives messages from nsqd and calls task methods to process that message
It handles the logic for backing off on retries and giving up on a message
ex.
import nsq
def task1(message):
print message
return True
def task2(message):
print me... | {
"content_hash": "b28b15e43ff7f45e2868ed0c7c36aca4",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 113,
"avg_line_length": 40.570570570570574,
"alnum_prop": 0.6015544041450778,
"repo_name": "davegardnerisme/nsq",
"id": "273205be6ed86e3fb0eebd75dd71d735e99c42b9",
"size":... |
"""
support for presenting detailed information in failing assertions.
"""
import sys
from typing import Any
from typing import Generator
from typing import List
from typing import Optional
from _pytest.assertion import rewrite
from _pytest.assertion import truncate
from _pytest.assertion import util
from _pytest.asse... | {
"content_hash": "92ff3671b1be6ea0c01ee28b2ff918de",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 87,
"avg_line_length": 35.23626373626374,
"alnum_prop": 0.6650553563075003,
"repo_name": "JoelMarcey/buck",
"id": "64d2267e70af4b89015a02d186f653e0a9f37a9e",
"size": "6413... |
"""pylint packaging information"""
from __future__ import absolute_import
import sys
from os.path import join
modname = distname = 'pylint'
numversion = (1, 5, 5)
version = '.'.join([str(num) for num in numversion])
install_requires = [
'astroid>=1.4.5,<1.5.0',
'six',
]
if sys.platform == 'win32':
ins... | {
"content_hash": "871b40f8f31a44d42741ca7c13b7c912",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 77,
"avg_line_length": 33.890625,
"alnum_prop": 0.6542185338865837,
"repo_name": "mith1979/ansible_automation",
"id": "f5eea15ed2d1a44e8ed63a3d9ead38a5c57e26fd",
"size": "3... |
"""Volume V2 Volume action implementations"""
import copy
import six
from openstackclient.common import command
from openstackclient.common import parseractions
from openstackclient.common import utils
from openstackclient.i18n import _
from openstackclient.identity import common as identity_common
class CreateVol... | {
"content_hash": "0c25150b1c3d12032e1d16d2efcfd210",
"timestamp": "",
"source": "github",
"line_count": 445,
"max_line_length": 79,
"avg_line_length": 32.95056179775281,
"alnum_prop": 0.52090295301098,
"repo_name": "redhat-openstack/python-openstackclient",
"id": "18473da3c26fb041e0eb7e51bfc6595571d2... |
from msrest.serialization import Model
class ApplicationGatewayBackendHealthPool(Model):
"""Application gateway BackendHealth pool.
:param backend_address_pool: Reference of an
ApplicationGatewayBackendAddressPool resource.
:type backend_address_pool:
~azure.mgmt.network.v2017_06_01.models.Appl... | {
"content_hash": "1ec290f00c4952b728423ea905c6de07",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 142,
"avg_line_length": 47.4,
"alnum_prop": 0.7459915611814346,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "e40a1bab64c37291d72ba7426b400d1649750588",
"size": "1659... |
from heat.common import exception
from heat.common.i18n import _
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import support
from heat.engine import translation
class NovaQuota(resource.Resource):
"""A resource for creating nova quotas.
... | {
"content_hash": "272f79c7f19a036659bea59fd3385efd",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 78,
"avg_line_length": 34.675213675213676,
"alnum_prop": 0.5522553611042642,
"repo_name": "noironetworks/heat",
"id": "269fcdaa72a73863ac25d426080b32162475109d",
"size": "... |
from token import Token # pylint: ignore=unused-import
from simple import Simple # pylint: ignore=unused-import
from jwt import JWT # pylint: ignore=unused-import
| {
"content_hash": "136cfd00efc58cef0b6b8decbc377c42",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 57,
"avg_line_length": 55.333333333333336,
"alnum_prop": 0.7831325301204819,
"repo_name": "KujiraProject/Flask-PAM",
"id": "981420a6614321445a0a34dcdadab7db51b6c0b1",
"size"... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
---
module: aci_tenant_ep_retention_policy
short_description: Manage End... | {
"content_hash": "6d08e7e6a5745cafecec03eead93686c",
"timestamp": "",
"source": "github",
"line_count": 348,
"max_line_length": 141,
"avg_line_length": 30.775862068965516,
"alnum_prop": 0.6241830065359477,
"repo_name": "thaim/ansible",
"id": "afcce7250aa375d1b5b0aba3725989ab3ef6de79",
"size": "1084... |
from django.conf.urls import url, include
from . import views
app_name = 'accounts'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^update/$', views.update, name='update'),
url(r'^register/$', views.register, name='register'),
]
| {
"content_hash": "3273647d34f76369bc64b488eeb486a4",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 57,
"avg_line_length": 25.7,
"alnum_prop": 0.6459143968871596,
"repo_name": "yayoiukai/signalserver",
"id": "2a21cf98729c4e1b944140003e43e2f02ec066ed",
"size": "257",
"bi... |
from pycoin.key.BIP32Node import *
from . import config
from .interfaces.counterwalletseed import mnemonicToEntropy
import time
import json
import os
from .errors import PyPayWalletError
NETCODES = {"mainnet": "BTC", "testnet": "XTN"}
#To Do: enable autosweep, privkey_mode only
#sweep address function
#sweep branch fu... | {
"content_hash": "e247cfaa336fe956690da4ffb62cf17f",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 274,
"avg_line_length": 38.06172839506173,
"alnum_prop": 0.6312033733376581,
"repo_name": "pik/pypayd",
"id": "7669ce16e2dbe0da142bf48823a38afed8b8873d",
"size": "6166",
... |
"""Gradients for operators defined in nn_ops.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python... | {
"content_hash": "779a91e670951daa479f2d5726102d55",
"timestamp": "",
"source": "github",
"line_count": 1009,
"max_line_length": 80,
"avg_line_length": 33.52824578790882,
"alnum_prop": 0.6314809340821755,
"repo_name": "ryfeus/lambda-packs",
"id": "4af5bd26dd80b984b1c898411c2a23827bed1b4b",
"size": ... |
from django import forms
from us_ignite.testbeds.models import Testbed, NetworkSpeed
EMPTY_LABEL = u'- Select one -'
def get_experimentation_choices():
return [('', EMPTY_LABEL)] + list(Testbed.EXPERIMENTATION_CHOICES)
class TestbedFilterForm(forms.Form):
network_speed = forms.ModelChoiceField(
qu... | {
"content_hash": "4c585d7b09c8f309dd77927820f3c521",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 36.88461538461539,
"alnum_prop": 0.7090719499478624,
"repo_name": "us-ignite/us_ignite",
"id": "b3ffe191428640414aed3d43fe0d7cb6b461a5f6",
"size": "9... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/loot/dungeon/geonosian_mad_bunker/shared_relic_gbb_honey_carafe.iff"
result.attribute_template_id = -1
result.stfName("item_n","relic_gbb_honey_carafe")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATION... | {
"content_hash": "ba9eaf88ace14c3bbaea4ef39d34e686",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 104,
"avg_line_length": 26.46153846153846,
"alnum_prop": 0.7093023255813954,
"repo_name": "obi-two/Rebelion",
"id": "e76f389561c6ab41bd92cec5a81e5b230539ec0b",
"size": "489... |
from custom_exception import NoResultFound
def get_result_list(target_jsonld):
return target_jsonld['itemListElement'];
def get_first_result_item(target_jsonld):
result_list = get_result_list(target_jsonld)
try:
return result_list[0]
except IndexError:
return {}
def get_first_result(target_jsonld):
... | {
"content_hash": "3719b1265cc8cccbe2620c61a8d4cd37",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 58,
"avg_line_length": 27.818181818181817,
"alnum_prop": 0.7450980392156863,
"repo_name": "lahsivjar/jarvis-kube",
"id": "d833e4c8c57976cfd7eb756a96ba223f0faab3cd",
"size":... |
import ezdxf
from ezdxf.math import Vec3
from ezdxf.enums import MTextEntityAlignment
# This is the only way to create MTEXT entities where the "width" attribute
# is missing or equals 0.
# MTEXT entities created by AutoCAD or BricsCAD ALWAYS have a
# "width" attribute > 0.
CONTENT = "This is a long MTEXT line withou... | {
"content_hash": "1dd44a162b12e4b8d5a7afcd4a492ce2",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 79,
"avg_line_length": 32.723404255319146,
"alnum_prop": 0.6996098829648895,
"repo_name": "mozman/ezdxf",
"id": "ebba6d82d79844163ede28bc47159f7dbcec2331",
"size": "1600",
... |
import _plotly_utils.basevalidators
class HoverdistanceValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(self, plotly_name="hoverdistance", parent_name="layout", **kwargs):
super(HoverdistanceValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | {
"content_hash": "d619c734ae20a6e4b2e117871298edbe",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 84,
"avg_line_length": 38.30769230769231,
"alnum_prop": 0.606425702811245,
"repo_name": "plotly/python-api",
"id": "b2a13ceb442085955675703a43f5f38c63d48438",
"size": "498"... |
from django.contrib import admin
from .models import Team, TeamMembership
class TeamMembershipInline(admin.StackedInline):
model = TeamMembership
raw_id_fields = ('user', 'team',)
class TeamAdmin(admin.ModelAdmin):
list_display = ('name', 'created', 'member_count')
inlines = [TeamMembershipInline]
... | {
"content_hash": "2ab8f784c3379f2daa535706351cd5f9",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 54,
"avg_line_length": 22.4375,
"alnum_prop": 0.7298050139275766,
"repo_name": "stefanw/froide",
"id": "bd9346dc479e03302643ee0b3e01d265517a39e5",
"size": "359",
"binary"... |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '' ... | {
"content_hash": "32479f27bcb9f0bb63a88755338092b6",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 101,
"avg_line_length": 35.53164556962025,
"alnum_prop": 0.7060919130744567,
"repo_name": "lluxury/P_U_S_A",
"id": "c1851f00b9090f20cc173fa7a929b783bee24b4c",
"size": "2849... |
import feedparser
import sqlite3, psycopg2
import datetime, time
import os
import string
from random import choice, randint
import lxml.html
import uuid
import random
def fill_start_data_news():
#db = sqlite3.connect(BASE_DIR+"\\db.sqlite3")
db = psycopg2.connect("dbname='test' user='testuser' host='' password... | {
"content_hash": "87e65bee93d334f40ce62820366cfc54",
"timestamp": "",
"source": "github",
"line_count": 586,
"max_line_length": 366,
"avg_line_length": 40.2901023890785,
"alnum_prop": 0.5232952138924185,
"repo_name": "eprivalov/sendec",
"id": "c17f19e6e69500cb817e38e75274361fd1b2b376",
"size": "236... |
"""tests for the astng builder and rebuilder module"""
import unittest
import sys
from os.path import join, abspath, dirname
from logilab.common.testlib import TestCase, unittest_main
from pprint import pprint
from logilab.astng import builder, nodes, InferenceError, NotFoundError
from logilab.astng.nodes import Mod... | {
"content_hash": "87a819cd533b83a1bd6a9a6d148815cc",
"timestamp": "",
"source": "github",
"line_count": 712,
"max_line_length": 115,
"avg_line_length": 35.57303370786517,
"alnum_prop": 0.6027321541377132,
"repo_name": "tlksio/tlksio",
"id": "d2b17a654c2aed7d5cf77dd854f449b766475091",
"size": "26164... |
import numpy as np
import nibabel as nib
def save2nifti(fpath, data, header=None):
"""
Save to a nifti file.
Parameters
----------
fpath : string
The file path to output
data : numpy array
header : Nifti2Header
"""
img = nib.Nifti2Image(data, None, header=header)
nib.n... | {
"content_hash": "7213ba507fc68752cdfa3041ec544c50",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 119,
"avg_line_length": 32.324175824175825,
"alnum_prop": 0.554479007309196,
"repo_name": "BNUCNL/FreeROI",
"id": "963e131935192ee49efb4f003b92a2bb29bdd517",
"size": "5883... |
"""
Base utilities to build API operation managers and objects on top of.
"""
# E1102: %s is not callable
# pylint: disable=E1102
import abc
import copy
from http import client as http_client
from urllib import parse as urlparse
from oslo_utils import strutils
from ironicclient.common.apiclient import exceptions
f... | {
"content_hash": "3d58a262d29bb2765d57b2168b75d064",
"timestamp": "",
"source": "github",
"line_count": 497,
"max_line_length": 79,
"avg_line_length": 32.57142857142857,
"alnum_prop": 0.5673338275265629,
"repo_name": "openstack/python-ironicclient",
"id": "a1a13999ae8610ac8be030c8665ee2252e581284",
... |
"""A QR and BWM Find SCU application.
For sending Query/Retrieve (QR) and Basic Worklist Modality (BWM) C-FIND
requests to a QR/BWM - Find SCP.
"""
import argparse
import sys
from pydicom.dataset import Dataset
from pydicom.uid import generate_uid
from pynetdicom import (
AE,
BasicWorklistManagementPresenta... | {
"content_hash": "2384b409922aa96a45f9106ebdb2e22e",
"timestamp": "",
"source": "github",
"line_count": 374,
"max_line_length": 87,
"avg_line_length": 30.668449197860962,
"alnum_prop": 0.6056669572798605,
"repo_name": "scaramallion/pynetdicom",
"id": "6fd033d324f5d3ca45ccafd8070cbec05c1cf378",
"siz... |
import sys
import argparse
import os
import shutil
GPM_HOME = os.path.dirname(os.path.realpath(__file__))
PACKAGES = ["ide", "pyGP", "pyGP-computervision", "pyGP-slam", "pyGP-ros", "luaGP", "juliaGP", "jGP"]
def get_path(file, context=None):
if context is None:
path = os.path.join(GPM_HOME, file)
el... | {
"content_hash": "b032e163aa2395f23a9216f3e02aee7f",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 102,
"avg_line_length": 29.347826086956523,
"alnum_prop": 0.6303703703703704,
"repo_name": "GraphProgramming/GraphProgramming",
"id": "901e24be174226ebcc7411770d98a05f5faf20f... |
from unittest import TestCase
from mock import patch, MagicMock
import frontend.helpers.sessions as module
from lib.irma.common.exceptions import IrmaDatabaseError
class TestSessions(TestCase):
@patch("frontend.helpers.sessions.db_session")
def test001_transaction(self, m_db_session):
with module.se... | {
"content_hash": "7f85638c4ebbae31cdf709cb0adac192",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 56,
"avg_line_length": 36.20454545454545,
"alnum_prop": 0.6666666666666666,
"repo_name": "deloittem/irma-frontend",
"id": "2055646624731789f385c708d95439eace52b1a7",
"size"... |
import itertools
from collections import defaultdict
from networkx.utils.union_find import UnionFind
def calculate_hamming_clusters(numbers):
numbers_map = defaultdict(list)
for index, node in enumerate(numbers):
numbers_map[node].append(index)
# no duplicates in the union find
union_find = U... | {
"content_hash": "0e10c9b2cdc6a45307350a20cecdcf31",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 70,
"avg_line_length": 31.555555555555557,
"alnum_prop": 0.6408450704225352,
"repo_name": "manoldonev/algo1-assignments",
"id": "3c87e458cac1abf8d995ce3142a6ad0da8368222",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import upload.models
class Migration(migrations.Migration):
dependencies = [
('upload', '0002_auto_20150804_2100'),
]
operations = [
migrations.AlterField(
model_name='upload',
name=... | {
"content_hash": "f7001233523cee2a24fac2db780696db",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 73,
"avg_line_length": 22.105263157894736,
"alnum_prop": 0.6190476190476191,
"repo_name": "dtekcth/DNollK.se",
"id": "9db077ab1a51d63d3f672fcba7f46ddc988735af",
"size": "49... |
import regex as re
from datetime import datetime, timedelta, tzinfo
from .timezones import timezone_info_list
class StaticTzInfo(tzinfo):
def __init__(self, name, offset):
self.__offset = offset
self.__name = name
def tzname(self, dt):
return self.__name
def utcoffset(self, dt)... | {
"content_hash": "a17e5f083b50d37534f0586605f9181c",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 91,
"avg_line_length": 29.18918918918919,
"alnum_prop": 0.5949074074074074,
"repo_name": "Samuel789/MediPi",
"id": "5f5e3da93a46d71f4d613fa5af344742c85d66ba",
"size": "2184... |
"""Regions used in Relay."""
from ...runtime import Object
from . import _ffi_api
class AnnotatedRegionSet(Object):
"""Class to represent a relay expression split into regions."""
def __init__(self, expr, region_begin_op, region_end_op):
"""Construct regions from an expression.
Parameters
... | {
"content_hash": "263d591b7b3c98233f914cad2f210fe6",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 77,
"avg_line_length": 26.227272727272727,
"alnum_prop": 0.5606585788561526,
"repo_name": "Laurawly/tvm-1",
"id": "a18ccb97836bb2b77a5f57853a9f996aaf99fc06",
"size": "2024"... |
"""manifest module for linux runtime
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import shlex
from treadmill import subproc
from treadmill.appcfg import manifest as app_manifest
_LOGGER = logg... | {
"content_hash": "971389fee6094bc1e86cbe752b331d8c",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 79,
"avg_line_length": 30.776,
"alnum_prop": 0.5204055107876268,
"repo_name": "ceache/treadmill",
"id": "669ef0c6d2d522ea977348f31e3a1bfb0cd3700f",
"size": "3847",
"bina... |
import sublime
from . import st_utils
class Session:
def __init__(self, name, window_sessions):
self.name = name
self.windows = window_sessions
@classmethod
def save(cls, name, st_windows):
return cls(
name,
[Window.save(w) for w in st_windows]
)
... | {
"content_hash": "41a24426d7feb16a85f71d4ee82e8030",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 88,
"avg_line_length": 28.772727272727273,
"alnum_prop": 0.6042654028436019,
"repo_name": "Zeeker/sublime-SessionManager",
"id": "16b563276909683170d5c49337694037f76425ac",
... |
from __future__ import division
import os
import time
from imposm.geom import (
PolygonBuilder,
LineStringBuilder,
InvalidGeometryError,
IncompletePolygonError,
)
from imposm.merge import merge
import imposm.base
import imposm.geom
import imposm.config
import shapely.geometry
import shapely.ops
import... | {
"content_hash": "f96ceef2ad3b458a95f569dc89fe2870",
"timestamp": "",
"source": "github",
"line_count": 390,
"max_line_length": 118,
"avg_line_length": 35.44358974358974,
"alnum_prop": 0.5487231425884396,
"repo_name": "omniscale/imposm",
"id": "11b72757716af4ece5c5b8b088ec7761896049f4",
"size": "14... |
import json
import time
from time import gmtime, strftime
import datetime
import sys
from dateutil import parser
import calendar
from TrendAnalyser import TrendAnalyser
start_time = time.time()
TA = TrendAnalyser(load_api=False, load_db=False)
end_time = time.time()
print "Time Taken:", end_time - start_time
| {
"content_hash": "93222fc1ee62f8a512cab0ec32fed689",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 49,
"avg_line_length": 20.866666666666667,
"alnum_prop": 0.7827476038338658,
"repo_name": "chewett/TrendAnalyser",
"id": "99423ac737be9815ce9eeb98e7103a343d440556",
"size":... |
"""Support for monitoring an SABnzbd NZB client."""
from datetime import timedelta
import logging
from pysabnzbd import SabnzbdApi, SabnzbdApiException
import voluptuous as vol
from homeassistant.components.discovery import SERVICE_SABNZBD
from homeassistant.const import (
CONF_API_KEY,
CONF_HOST,
CONF_NA... | {
"content_hash": "d0aa8ad89c683bede3d04c2ca047ec98",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 87,
"avg_line_length": 32.486988847583646,
"alnum_prop": 0.6368005492619293,
"repo_name": "postlund/home-assistant",
"id": "b36abbedb487387fd856e84d55225ebcbdf26008",
"siz... |
"""Tests for Adamax."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op
from tensorflow.python.framewo... | {
"content_hash": "f6dfbb199a8b7dfd0025f5789188c06b",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 113,
"avg_line_length": 43.51086956521739,
"alnum_prop": 0.5992380714464152,
"repo_name": "gunan/tensorflow",
"id": "07c7ee96eeb3ce34b4d24effbbd03c5a930be52e",
"size": "16... |
import operator
import warnings
import weakref
from bson import DBRef, ObjectId, SON
import pymongo
import six
from mongoengine.base.common import UPDATE_OPERATORS
from mongoengine.base.datastructures import (BaseDict, BaseList,
EmbeddedDocumentList)
from mongoengine.commo... | {
"content_hash": "1227bf0a4bd2c77cc724bb81f3c276f7",
"timestamp": "",
"source": "github",
"line_count": 639,
"max_line_length": 99,
"avg_line_length": 38.7527386541471,
"alnum_prop": 0.5640269757299197,
"repo_name": "Davidrjx/mongoengine",
"id": "e2b5d3210c248c667121ccc2f6601cbe8d64b715",
"size": "... |
from know_me import serializers
def test_serialize(api_rf, image, km_user_factory):
"""
Test serializing a Know Me user.
"""
km_user = km_user_factory(image=image)
request = api_rf.get(km_user.get_absolute_url())
serializer = serializers.KMUserInfoSerializer(
km_user, context={"reques... | {
"content_hash": "e5c927ff98d2d61e46c637d2ecdd7ca4",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 75,
"avg_line_length": 27.9,
"alnum_prop": 0.6577060931899642,
"repo_name": "knowmetools/km-api",
"id": "34f9c5d891835995dde8eb7812b8da3150bed184",
"size": "558",
"binary... |
from django.db import models
import uuid, os
from django.conf import settings
from mptt.models import MPTTModel, TreeForeignKey
import logging
logger = logging.getLogger(__name__)
class Category(MPTTModel):
name = models.CharField(max_length=150, unique=True)
weight = models.IntegerField(default=0)
active... | {
"content_hash": "103422b324cc560a7aca4b75df63a8f6",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 98,
"avg_line_length": 35.2734375,
"alnum_prop": 0.6757475083056479,
"repo_name": "vollov/filemanager",
"id": "64b0f061edbb4452b627c99a1df9e2802b3afa32",
"size": "4515",
... |
"""Event Log Utilities - helper for win32evtlog.pyd
"""
import win32api, win32con, winerror, win32evtlog, string
error = win32api.error # The error the evtlog module raises.
langid = win32api.MAKELANGID(win32con.LANG_NEUTRAL, win32con.SUBLANG_NEUTRAL)
def AddSourceToRegistry(appName, msgDLL = None, eventLo... | {
"content_hash": "47251eda80f4177f1f03fec9742814a9",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 225,
"avg_line_length": 43.76315789473684,
"alnum_prop": 0.6518340348767288,
"repo_name": "chvrga/outdoor-explorer",
"id": "48cb820c72dbd555fcaae393f73a537b0a9b1671",
"siz... |
from ajax_select import register, LookupChannel
import directory.models as dir_models
@register('fraction')
class FractionLookup(LookupChannel):
model = dir_models.Fractions
def get_query(self, q, request):
return self.model.objects.filter(title__icontains=q, hide=False, research__hide=False).order_... | {
"content_hash": "3e40386cef9322f02192877c26228138",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 112,
"avg_line_length": 30.181818181818183,
"alnum_prop": 0.7469879518072289,
"repo_name": "moodpulse/l2",
"id": "d8639fc2938cf1459c838949141415c7976a1193",
"size": "332",
... |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=8, path_list=[
[TestAction.create_vm, 'vm1', 'flag=ceph'],
[TestAction.create_volume, 'volume1', 'flag=ceph,scsi'],
[TestAction.attach_volume, 'vm1... | {
"content_hash": "e5c74a9465e7a78bf73d2cad7cea94ff",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 214,
"avg_line_length": 43.36363636363637,
"alnum_prop": 0.7023060796645703,
"repo_name": "zstackio/zstack-woodpecker",
"id": "9d89ad3eb070fe8e5ed6c1731bc2d8d373ba41f3",
"s... |
"""Classes representing Sonos UPnP services.
>>> import soco
>>> device = soco.SoCo('192.168.1.102')
>>> print(RenderingControl(device).GetMute([('InstanceID', 0),
... ('Channel', 'Master')]))
{'CurrentMute': '0'}
>>> r = ContentDirectory(device).Browse([
... ('ObjectID', 'Q:0'),
... ('BrowseFlag', 'BrowseDi... | {
"content_hash": "a33e9344e4f79f6b5aa852f38c7d62db",
"timestamp": "",
"source": "github",
"line_count": 795,
"max_line_length": 79,
"avg_line_length": 40.17987421383648,
"alnum_prop": 0.5941520833985536,
"repo_name": "lawrenceakka/SoCo",
"id": "cf9170cda7882c57acc4f20a351d4a7f43c2e7d6",
"size": "32... |
__all__ = [
'RedisError',
'ProtocolError',
'ReplyError',
'MaxClientsError',
'AuthError',
'PipelineError',
'MultiExecError',
'WatchVariableError',
'ChannelClosedError',
'ConnectionClosedError',
'ConnectionForcedCloseError',
'PoolClosedError',
'MasterNotFoundError',
... | {
"content_hash": "e3f8231dc9662874a17b29a8780a08ed",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 24.78301886792453,
"alnum_prop": 0.6855728968405025,
"repo_name": "ymap/aioredis",
"id": "6aa800eef3c465f12e6667f6ee0915307785aaab",
"size": "2627",... |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.blocktools import (
create_block,
create_coinbase,
)
from test_framework.messages import (
CAuxPow,
uint256_from_compact,
)
from test_framework.p2p import P2PDataStore
from test_framework.util import assert_equal
from test_frame... | {
"content_hash": "3f9b421c34248715b0dd7ae8d2784aa6",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 75,
"avg_line_length": 32.28409090909091,
"alnum_prop": 0.6719464977120733,
"repo_name": "pataquets/namecoin-core",
"id": "498430abf71788cbee43705f65154c1d20d01bd1",
"size"... |
"""
Hubs and authorities analysis of graph structure.
"""
#!/usr/bin/env python
# Copyright (C) 2008-2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
# NetworkX:http://networkx.lanl.gov/
__author__ =... | {
"content_hash": "381e59a560f67fbf86ba51ebd6d5fa7e",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 79,
"avg_line_length": 30.482517482517483,
"alnum_prop": 0.6203257627896307,
"repo_name": "uwescience/myria-web",
"id": "7f6925f7c6c532375b97c841c42af58b0a3957da",
"size":... |
import os
from setuptools import find_packages
from setuptools import setup
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj:
README = file_obj.read()
# NOTE: This is duplicated throughout and we should try to
# consolidate.
SETUP_B... | {
"content_hash": "16f930efa3a8cca6c6a161d0089830f7",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 72,
"avg_line_length": 29.464285714285715,
"alnum_prop": 0.6236363636363637,
"repo_name": "daspecster/google-cloud-python",
"id": "e8086d32427709ed3dde6587c2b7816820ab394b",
... |
"""Custom component for testing the deployed model."""
import logging
import json
import argparse
from google.cloud import aiplatform
from kfp.v2.components import executor
from kfp.v2.dsl import Artifact, Input
# pylint: disable=logging-fstring-interpolation
def test_endpoint(project_id: str,
da... | {
"content_hash": "7029a193dfedb3ee7877ef33baf89a87",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 64,
"avg_line_length": 27.229508196721312,
"alnum_prop": 0.6911499096929561,
"repo_name": "GoogleCloudPlatform/professional-services",
"id": "d05d6f0b8e6191c824ce58fe8d66e02e... |
from __future__ import division
import math
import numpy
from scipy.io import wavfile
def wavread(fn):
"""Emulate the parts of the matlab wavread function that we need.
y, Fs = wavread(fn)
y is the vector of audio samples, Fs is the frame rate.
Matlab's wavread is used by voicesauce to read i... | {
"content_hash": "84303267e81a2ae5d25a4453f6a7ec62",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 111,
"avg_line_length": 30.307692307692307,
"alnum_prop": 0.6221899927483684,
"repo_name": "voicesauce/opensauce-python",
"id": "faab1ce927f9d1e3a532a797bf4eac5e541ed981",
... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class GetLastMessageThatContains(Choreography):
def __init__(self, temboo_session):
"""
... | {
"content_hash": "44679f9321b6a174122bec1aa6b34e79",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 276,
"avg_line_length": 49.708333333333336,
"alnum_prop": 0.6963537300922046,
"repo_name": "egetzel/wecrow",
"id": "d5f6eb23156805bae10ae4bdbb01bdfdb0b2845f",
"size": "5097... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "assembly.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "2f4ddac7e0c847f1d8527a0d3d067b88",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 72,
"avg_line_length": 25.444444444444443,
"alnum_prop": 0.7117903930131004,
"repo_name": "Karolain/cms",
"id": "0e530673cdf56c702f2240af0690b9e18c6b14fb",
"size": "251",
... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('nwbb_members', '0014_auto_20160524_2123'),
]
operations = [
migrations.AlterModelOptions(
name='member',
options={'permissions': (('... | {
"content_hash": "4e8b82286fc895447752d9de0d8f4fe6",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 292,
"avg_line_length": 31.875,
"alnum_prop": 0.5973856209150327,
"repo_name": "nwbb-sc/database",
"id": "4782f54943be316fe3d786ccf0c36b5a6ae8f044",
"size": "837",
"binar... |
from django.contrib import admin
from django.contrib.comments.moderation import CommentModerator, moderator
from django.contrib.contenttypes import generic
from django.db import models
from django.utils.encoding import force_unicode
from django.contrib.comments.models import Comment
from project_utils import CKEditor
... | {
"content_hash": "16dc55f6031693a0d06ecbbae628a494",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 79,
"avg_line_length": 30.373831775700936,
"alnum_prop": 0.588,
"repo_name": "mazelife/django-belleville",
"id": "cce815858d0c838dc3773f00f261d861912bde53",
"size": "3250"... |
import socket
import struct
import sys
import os
import time
# see com.intellij.idea.SocketLock for the server side of this interface
RUN_PATH = u'$RUN_PATH$'
CONFIG_PATH = u'$CONFIG_PATH$'
SYSTEM_PATH = u'$SYSTEM_PATH$'
args = []
skip_next = False
for i, arg in enumerate(sys.argv[1:]):
if arg == '-h' or arg == ... | {
"content_hash": "3bfd3e29a89e9e2863e4da8ed9631be8",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 83,
"avg_line_length": 28.320388349514563,
"alnum_prop": 0.5138841275282825,
"repo_name": "hurricup/intellij-community",
"id": "270cbc04fe8e189df5f55fb5e7b98706ab92811d",
... |
"""
Annotate sequences with partition numbers.
% python scripts/annotate-partitions.py <pmap_file> <file1> [ <file2> ... ]
Partition-annotated sequences will be in <fileN>.part.
Use '-h' for parameter help.
"""
import os
import textwrap
import sys
from khmer import __version__, Nodegraph
from khmer.kfile import che... | {
"content_hash": "1dd92b1158e589ab88bfa303357edebc",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 34.177215189873415,
"alnum_prop": 0.6544444444444445,
"repo_name": "souravsingh/khmer",
"id": "3d4e98faa4ee859fbea06a7e77c8500de29c0a07",
"size": "45... |
""" Unit tests for pyfive's high_level module. """
import os
import numpy as np
from numpy.testing import assert_array_equal, assert_almost_equal
from numpy.testing import assert_raises
import pyfive
DIRNAME = os.path.dirname(__file__)
EARLIEST_HDF5_FILE = os.path.join(DIRNAME, 'earliest.hdf5')
# Polyglot string t... | {
"content_hash": "eb9ec6546056d6ab1ebe8e3dab7b6a53",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 75,
"avg_line_length": 27.146341463414632,
"alnum_prop": 0.5827493261455525,
"repo_name": "jjhelmus/pyfive",
"id": "a23510d71537e3484d68a214630c2148de724d47",
"size": "556... |
"""Contains the parent class for Scriptlets."""
# Scriptlet.py
# Mission Pinball Framework
# Written by Brian Madden & Gabe Knuth
# Released under the MIT License. (See license info at the end of this file.)
# Documentation and more info at http://missionpinball.com/mpf
import logging
class Scriptlet(object):
... | {
"content_hash": "a297f5eae9c02d55b746c4d412b91e82",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 29.535714285714285,
"alnum_prop": 0.6553808948004837,
"repo_name": "qcapen/mpf",
"id": "a357b017c789056ce37a06593618e8a17ed8be5f",
"size": "827",
"... |
# Copyright 2013 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | {
"content_hash": "bc2b0102226d5a4839ae9d4e2180431f",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 74,
"avg_line_length": 34.39252336448598,
"alnum_prop": 0.678804347826087,
"repo_name": "CiscoUcs/UcsPythonSDK",
"id": "ad80f51d75cfb839f4cd857298ca40993234b0be",
"size": ... |
from . import web_reqrep
from . import web_exceptions
from . import web_urldispatcher
from . import web_ws
from .web_reqrep import * # noqa
from .web_exceptions import * # noqa
from .web_urldispatcher import * # noqa
from .web_ws import * # noqa
from .protocol import HttpVersion # noqa
import asyncio
from . imp... | {
"content_hash": "7d89b9ad43bb57de3d351749a1a4e8b1",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 78,
"avg_line_length": 30.70124481327801,
"alnum_prop": 0.5683200432490877,
"repo_name": "flying-sheep/aiohttp",
"id": "706fbb04ed6093828ca6cc4723c5d4c9aca883ab",
"size": ... |
"""Training binary."""
import functools
from typing import Any, Dict, List, Optional, Tuple
from absl import app
from absl import flags
import tensorflow.compat.v1 as tf
from hypertransformer.tf import common_flags # pylint:disable=unused-import
from hypertransformer.tf import eval_model_flags # pylint:disable=unu... | {
"content_hash": "dc858c4f38ad2e44683ecacd9da05075",
"timestamp": "",
"source": "github",
"line_count": 487,
"max_line_length": 83,
"avg_line_length": 40.18069815195072,
"alnum_prop": 0.6565310711365495,
"repo_name": "google-research/google-research",
"id": "80cc818b9ccf4ab93fb66b045db5ce7826b9a261",... |
def memo(f):
memos = {}
def memoized(*args):
try: return memos[args]
except KeyError:
result = memos[args] = f(*args)
return result
return memoized
| {
"content_hash": "88aa8c2838bf0c7bf1a4750d737ed20b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 43,
"avg_line_length": 25,
"alnum_prop": 0.53,
"repo_name": "darius/languagetoys",
"id": "8eeaf6b18164cfe09f2eaa2eb6f18eb1f33b5323",
"size": "200",
"binary": false,
"cop... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('daiquiri_jobs', '0015_job_index'),
]
operations = [
migrations.AlterModelOptions(
name='job',
options={'ordering': ('start_time',), 'verbose_name': 'Job', 'verbose_name_plur... | {
"content_hash": "a5f4d9fc494271f28c4b98502ef00729",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 104,
"avg_line_length": 23.4,
"alnum_prop": 0.5698005698005698,
"repo_name": "aipescience/django-daiquiri",
"id": "d070d40c35975726594efcbfea2e0e05020a43a2",
"size": "400",... |
"""
vcs.nodes
~~~~~~~~~
Module holding everything related to vcs nodes.
:created_on: Apr 8, 2010
:copyright: (c) 2010-2011 by Marcin Kuzminski, Lukasz Balcerzak.
"""
import os
import stat
import posixpath
import mimetypes
from pygments import lexers
from vcs.backends.base import EmptyChangeset
f... | {
"content_hash": "08f6452617b655bed0cf81b075ff45e8",
"timestamp": "",
"source": "github",
"line_count": 616,
"max_line_length": 91,
"avg_line_length": 31.008116883116884,
"alnum_prop": 0.5803884613371028,
"repo_name": "velodee/vcs",
"id": "5ad93a4860077507577e784e7741d14dd32c3b15",
"size": "19125",... |
"""
differential_evolution: The differential evolution global optimization algorithm
Added by Andrew Nelson 2014
"""
import warnings
import numpy as np
from scipy.optimize import OptimizeResult, minimize
from scipy.optimize.optimize import _status_message
from scipy._lib._util import check_random_state, MapWrapper
fr... | {
"content_hash": "49dd8841ad7a5c319dbc75e97469dcdc",
"timestamp": "",
"source": "github",
"line_count": 1430,
"max_line_length": 82,
"avg_line_length": 42.56153846153846,
"alnum_prop": 0.5882884511115127,
"repo_name": "e-q/scipy",
"id": "7934f64e6dddbe095c36cf88128bc064137a454f",
"size": "60863",
... |
from __future__ import unicode_literals
import os
from django.core.files.uploadedfile import SimpleUploadedFile
from django.utils import six
from djblets.testing.decorators import add_fixtures
from djblets.webapi.errors import INVALID_FORM_DATA
from kgb import SpyAgency
from reviewboard import scmtools
from reviewbo... | {
"content_hash": "207c63d240f13a145ee9f70a3f8637de",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 79,
"avg_line_length": 35.447876447876446,
"alnum_prop": 0.542642413680427,
"repo_name": "beol/reviewboard",
"id": "c81a011714c50f3fcb874b93fd74a3bafecdf436",
"size": "918... |
"""Tests for remote eager execution."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import os
import numpy as np
from tensorflow.contrib.eager.python import parameter_server
from tensorflow.core.protobuf import cluster_pb2
from tensor... | {
"content_hash": "fa7e9c1605fd81ac5e6bb1a56e29e31f",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 78,
"avg_line_length": 34.56170212765957,
"alnum_prop": 0.6470081260773208,
"repo_name": "chemelnucfin/tensorflow",
"id": "e3329ca1c79aaff7d0e1ec873354c0be6674ab6e",
"size... |
import inspect
from unittest import TestCase
from mock import patch
import random
import gc
from allura.lib.decorators import task, memoize
from alluratest.controller import setup_basic_test, setup_global_objects
class TestTask(TestCase):
def setup_method(self, method):
setup_basic_test()
def test_... | {
"content_hash": "7379864eb1294fffb743d97c8a07c018",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 137,
"avg_line_length": 28.74015748031496,
"alnum_prop": 0.549041095890411,
"repo_name": "apache/allura",
"id": "80c3bd46ecedd1a7e37c5e2c4c6c69f6f5d5dc25",
"size": "4519",... |
from src.Perro import Perro
import src.Gato
if __name__ == "__main__":
lassie = Perro("Lassie", "Bulldog")
lassie.comer()
lassie.dormir()
print(lassie.nombre + " es una "+ lassie.raza)
misifus = src.Gato.Gato("Misifus")
misifus.dormir()
print("Mi gato se llama " + misifus.getNombre()) | {
"content_hash": "518a9e7ce3de4a0293c30b6bbdc0c0a9",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 52,
"avg_line_length": 26.25,
"alnum_prop": 0.6253968253968254,
"repo_name": "ampotty/uip-pc3",
"id": "bdc5abffcd311645ce659cc965220a9d9daa0389",
"size": "315",
"binary":... |
"""
This file exists for backward compatibility reasons.
"""
from logging import warning
from .nonp import NoNumpyException, DEFAULT_ENCODERS, DEFAULT_HOOKS, dumps, dump, loads, load # keep 'unused' imports
from .utils import hashodict, NoPandasException
from .comment import strip_comment_line_with_symbol, strip_comm... | {
"content_hash": "637f33c106062a936b292e23de98d3b9",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 118,
"avg_line_length": 44.51851851851852,
"alnum_prop": 0.7703826955074875,
"repo_name": "pannal/Subliminal.bundle",
"id": "676041f9f1f6736e05316cca3227a9cf7467e011",
"siz... |
import json, os, sys, threading, time
if sys.version_info >= (3,0):
isPython3 = True
import queue
from queue import Queue
else:
isPython3 = False
import Queue
from Queue import Queue
from time import sleep
from threading import Lock
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#... | {
"content_hash": "ef36cd2b15f1741889426a3de7b7ab5c",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 113,
"avg_line_length": 32.013513513513516,
"alnum_prop": 0.48016040523427606,
"repo_name": "Vivero/KerbalPie",
"id": "a61f49c7f72909a09a6ee0d7b48c309bf305569f",
"size": "... |
"""Tests for layers.feature_column_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
from tensorflow.contrib import layers
from tensorflow.contrib.layers.python.layers import feature_column
from tensorflow.contrib.layers... | {
"content_hash": "6228aaf9d3564d0f65cef06ffd1dad6c",
"timestamp": "",
"source": "github",
"line_count": 2653,
"max_line_length": 80,
"avg_line_length": 43.78137957029777,
"alnum_prop": 0.5924650458020525,
"repo_name": "thesuperzapper/tensorflow",
"id": "632836fee440b53e78b2728abce6e971a9273925",
"s... |
def extractInacloudspacesBlogspotCom(item):
'''
Parser for 'inacloudspaces.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Drunken Exquisiteness', 'Drunken Exquisiteness', ... | {
"content_hash": "5cc354bcf909a5b38359534a302bb357",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 34.76190476190476,
"alnum_prop": 0.563013698630137,
"repo_name": "fake-name/ReadableWebProxy",
"id": "7e2781338237dc2f88e96ea7f509a277a65895f2",
"si... |
"""Tests for lingvo-JAX checkpoint_managers."""
import datetime
import os
from unittest import mock
from absl import flags
from absl.testing import absltest
from absl.testing import parameterized
from lingvo.jax import checkpoint_managers
from lingvo.jax import checkpoint_pb2
import tensorflow.compat.v2 as tf
Checkp... | {
"content_hash": "9f4507d42a9b2c9cd04a87918f39cae1",
"timestamp": "",
"source": "github",
"line_count": 481,
"max_line_length": 80,
"avg_line_length": 42.21413721413722,
"alnum_prop": 0.6663383403102684,
"repo_name": "tensorflow/lingvo",
"id": "663e786826ef4317331473d699e25531c394f098",
"size": "20... |
"""
Classes for tagging sentences sequentially, left to right. The
abstract base class SequentialBackoffTagger serves as the base
class for all the taggers in this module. Tagging of individual words
is performed by the method ``choose_tag()``, which is defined by
subclasses of SequentialBackoffTagger. If a tagger i... | {
"content_hash": "77641a4f8b23152df73c00f34b63edcd",
"timestamp": "",
"source": "github",
"line_count": 727,
"max_line_length": 94,
"avg_line_length": 38.123796423658874,
"alnum_prop": 0.6057872708904604,
"repo_name": "NorfolkDataSci/presentations",
"id": "b98ae52fd046a2acf5b7e33921b15644925cd193",
... |
"""
Overview
========
pymenuconfig is a small and simple frontend to Kconfiglib that's written
entirely in Python using Tkinter as its GUI toolkit.
Motivation
==========
Kconfig is a nice and powerful framework for build-time configuration and lots
of projects already benefit from using it. Kconfiglib allows to util... | {
"content_hash": "89aabb5cda8030e5e70a818a54523e7e",
"timestamp": "",
"source": "github",
"line_count": 1203,
"max_line_length": 116,
"avg_line_length": 37.05985037406484,
"alnum_prop": 0.5644303882645851,
"repo_name": "wolfgangz2013/rt-thread",
"id": "67893d72812b8ce320d2ea97b054f78917655dfd",
"si... |
from django.db import models
class Proveedores(models.Model):
pass | {
"content_hash": "a5eb47cfbd727039efa7a82770872836",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 32,
"avg_line_length": 17.75,
"alnum_prop": 0.7746478873239436,
"repo_name": "urkh/erp",
"id": "9ffe42dfec4eaaa65256e1e2f05e166e7109c873",
"size": "71",
"binary": false,
... |
from .creation import sparse_coo_tensor
from .creation import sparse_csr_tensor
from .unary import sin
from .unary import tan
from .unary import asin
from .unary import atan
from .unary import sinh
from .unary import tanh
from .unary import asinh
from .unary import atanh
from .unary import sqrt
from .unary import squa... | {
"content_hash": "8e1812d07aa729ec169756b6a9ab9924",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 39,
"avg_line_length": 18.76388888888889,
"alnum_prop": 0.6661732050333087,
"repo_name": "luotao1/Paddle",
"id": "9ca932ac46b6ada15d338b2018c2716a7a25efcb",
"size": "1964",... |
from Globals import *
import pygame.freetype as freetype
"""
the class used to encapsulate all needed elements of a tile
"""
class Tile:
"""
class constructor to declare and initialize tile elements
_pieceInfo -> describes the tile
"""
def __init__(self, _pieceInfo):
global G_gameInfo
self.lv = _pieceInfo["lv... | {
"content_hash": "338255f9a5509afc0e714e7fe508244e",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 131,
"avg_line_length": 39.401709401709404,
"alnum_prop": 0.6865509761388287,
"repo_name": "MorcoFreeCode/2014__2048-Game",
"id": "0391d20d4f631d5197e99c72eb62ca956390e27b",... |
import os
import re
import datetime
import logging
from copy import deepcopy
from collections import Mapping, MutableMapping
import json
import yaml
import rethinkdb
import shotgun_api3 as sg
__all__ = [
'ShotgunAPIWrapper',
'convertStrToDatetime',
'addNumberSign',
'getBaseEntity',
'prettyJson',
... | {
"content_hash": "c53b186325442a63f2dac74528cac14a",
"timestamp": "",
"source": "github",
"line_count": 484,
"max_line_length": 85,
"avg_line_length": 26.041322314049587,
"alnum_prop": 0.5478419549349413,
"repo_name": "moonbot/shotgun-cache-server",
"id": "421fe9fd8cdfac20ea060a3a3a6d3ce3886c1fd9",
... |
"""
webtags.py
Created by QingFeng on 2008-03-23.
Copyright (c) 2008 xBayDNS Team. All rights reserved.
"""
from django import template
register = template.Library()
@register.simple_tag
def resultToHtml(results):
print results
html=''
for record,idcs in results.items():
s='%s'%record
fo... | {
"content_hash": "65adbbf555c1d421e7355f85dc7459e8",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 60,
"avg_line_length": 22.96875,
"alnum_prop": 0.6204081632653061,
"repo_name": "changtailiang/xbaydns",
"id": "8187cf83ee77fbf01f03b31dc9e9763def8c8a2f",
"size": "753",
... |
from django.apps import AppConfig
class ShortenerConfig(AppConfig):
name = 'shortener'
| {
"content_hash": "435f8168d4f1768d81dc261d0dd7d800",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 18.6,
"alnum_prop": 0.7634408602150538,
"repo_name": "hemor/tursh",
"id": "84b0a39f2ade5b05b2dbce10d522455a619028a9",
"size": "93",
"binary": false,... |
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_utils import timeutils
import six
import nova.conf
from nova.i18n import _, _LI, _LW, _LE
from nova.servicegroup import api
from nova.servicegroup.drivers import base
CONF = nova.conf.CONF
LOG = logging.getLogger(__name__)
class DbDr... | {
"content_hash": "cdc0f1f705b3c73646e86d04f5e528c7",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 79,
"avg_line_length": 43.10204081632653,
"alnum_prop": 0.5963541666666666,
"repo_name": "jianghuaw/nova",
"id": "02cc2ee0092dc7dc1d9ca681fee01e01caa611ff",
"size": "4799",... |
import re
import os
import json
import logging
import threading
from flask import Flask, request, jsonify
from werkzeug.exceptions import default_exceptions
from werkzeug.exceptions import HTTPException
from datetime import datetime
from rasa_nlu.model import Interpreter
from rasa_core.agent import Agent
from flask i... | {
"content_hash": "c2fac87cf582da6e185dfe5f6e954bf8",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 175,
"avg_line_length": 36.36538461538461,
"alnum_prop": 0.6652564780539397,
"repo_name": "grassrootza/grassroot-learning",
"id": "69f8c392acd0f57ad70226ea035a17d3996762ef",... |
import re
# Bazel to CMake target name conversions used by bazel_to_cmake.py.
EXPLICIT_TARGET_MAPPING = {
# Internal utilities to emulate various binary/library options.
"//build_tools:default_linkopts": [],
"//build_tools:dl": ["${CMAKE_DL_LIBS}"],
"//compiler/src:defs": [],
"//compiler/src/iree/... | {
"content_hash": "31015bdcaf1695c20d02dcd0ae0d2775",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 79,
"avg_line_length": 38.4,
"alnum_prop": 0.6508049242424242,
"repo_name": "iree-org/iree",
"id": "8b7b3ae55fcdc2ed3afd5056bd6d33681b0b124f",
"size": "8666",
"binary": ... |
import os
from setuptools import find_packages
from setuptools import setup
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj:
README = file_obj.read()
# NOTE: This is duplicated throughout and we should try to
# consolidate.
SETUP_B... | {
"content_hash": "0cb72c9a3c2afd37c45fb575abc4c447",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 72,
"avg_line_length": 33.53968253968254,
"alnum_prop": 0.6114529105537151,
"repo_name": "quom/google-cloud-python",
"id": "9937aabb97c69ead08058a489ba16496b3023a2f",
"size... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.