text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Copyright (c) 2015 SONATA-NFV and Paderborn University
ALL RIGHTS RESERVED.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by ap... | {
"content_hash": "1cb48f4197023add0d7a3f594e03cbfd",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 99,
"avg_line_length": 35.66013071895425,
"alnum_prop": 0.592008797653959,
"repo_name": "stevenvanrossem/son-emu",
"id": "fdfc11bb6fc62b670c8721f488c669a177b61454",
"size"... |
try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
from mock import Mock
from cassandra import ProtocolVersion
from cassandra.protocol import PrepareMessage, QueryMessage, ExecuteMessage
class MessageTest(unittest.TestCase):
def test_prepare_message(self):
"""
Te... | {
"content_hash": "ebe27af5731fa48713b5f965cab99e62",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 114,
"avg_line_length": 32.455555555555556,
"alnum_prop": 0.5737761040739473,
"repo_name": "coldeasy/python-driver",
"id": "7e6a5b3702a2080dcb8f11f87a82a64d967ae80f",
"size... |
import wpilib
class ButtonDebouncer:
"""Useful utility class for debouncing buttons"""
def __init__(self, joystick, buttonnum, period=0.5):
"""
:param joystick: Joystick object
:type joystick: :class:`wpilib.Joystick`
:param buttonnum: Number of button to retrieve
:... | {
"content_hash": "67e2a23ab465e8b69748b556c09457a1",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 88,
"avg_line_length": 34.205128205128204,
"alnum_prop": 0.6019490254872564,
"repo_name": "robotpy/robotpy-wpilib-utilities",
"id": "2af487510bf4db2399717497b0e98aa106cb767f"... |
from itertools import repeat, product
from .features import render_features
from .inputs import render_slotlist, render_slot, render_head
from .paradigms import is_transitive, para_logs
from .tools import pairwise
from .vis import render_exponent, render_vi
def render_log(paradigms, worklog, rules, readjustments):
... | {
"content_hash": "8fddac75529fad40668e67e9e4e9d722",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 94,
"avg_line_length": 40.3448275862069,
"alnum_prop": 0.5028490028490028,
"repo_name": "xflr6/dmengine",
"id": "314215b2f5da862ddcfdc7093454222ba7c4e00d",
"size": "3510",
... |
"""Artman smoke tests.
It generates both grpc and gapic client libraries for Google APIs in googleapis
repo (except those being blacklisted), and fails if any generation fails.
The test currently assumes that artman and googleapis folders are under the
same parent folder.
"""
import argparse
import fnmatch
import os
... | {
"content_hash": "d8683cfcb3ac9d3330a76979e5a5aeca",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 79,
"avg_line_length": 34.680851063829785,
"alnum_prop": 0.5932515337423313,
"repo_name": "shinfan/artman",
"id": "7cda2d83debba7a5aae5a57ff9d3258c5d69e68f",
"size": "3876"... |
import decimal
from wsme import types as wtypes
from cloudkitty.api.v1 import types as ck_types
from cloudkitty.rating.hash.datamodels import mapping as mapping_models
class Threshold(wtypes.Base):
"""Type describing a Threshold.
A threshold is used to apply rating rules based on a level, if the parent
... | {
"content_hash": "c0afcb7823480950bf5c65a4f4ab7c4d",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 78,
"avg_line_length": 31.442857142857143,
"alnum_prop": 0.591094956837801,
"repo_name": "openstack/cloudkitty",
"id": "0e86948a4fc8f109b32495a5c7e1631eaf33773e",
"size": "... |
"""
Example Airflow DAG that shows how to use Google Analytics 360.
"""
import os
from airflow import models
from airflow.providers.google.marketing_platform.operators.analytics import (
GoogleAnalyticsDataImportUploadOperator,
GoogleAnalyticsDeletePreviousDataUploadsOperator,
GoogleAnalyticsGetAdsLinkOper... | {
"content_hash": "1b2921743c10b919dee13b2c1c769acb",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 108,
"avg_line_length": 36.774647887323944,
"alnum_prop": 0.7261585599387208,
"repo_name": "DinoCow/airflow",
"id": "851132d429590a69e6df11badeba092dc4b3371a",
"size": "339... |
from esengine.bases.py3 import * # noqa
from esengine.fields import StringField
from esengine.exceptions import ValidationError
import warnings
from six import iteritems
class BaseDocument(object):
_strict = False
_validators = None
_query_fields = None
def _initialize_defaults_fields(self, ignore=... | {
"content_hash": "c889979bebed313b24e502c35c1e661b",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 75,
"avg_line_length": 35.395161290322584,
"alnum_prop": 0.5618591934381408,
"repo_name": "catholabs/esengine",
"id": "66010bb96c3ab779f06ab0ef04e5b70072dc1865",
"size": "... |
from cupy import elementwise
from cupy.math import ufunc
sin = ufunc.create_math_ufunc(
'sin', 1, 'cupy_sin',
'''Elementwise sine function.
.. seealso:: :data:`numpy.sin`
''')
cos = ufunc.create_math_ufunc(
'cos', 1, 'cupy_cos',
'''Elementwise cosine function.
.. seealso:: :data:`nump... | {
"content_hash": "67ccfe8c8473643cca651abf21718fa2",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 76,
"avg_line_length": 19.92452830188679,
"alnum_prop": 0.6022727272727273,
"repo_name": "ytoyama/yans_chainer_hackathon",
"id": "cb068feee6430ecd82580a48b749ce6c4a4f0855",
... |
import sys, argparse, os
def show_notification(args):
command = "osascript -e 'display notification \"{0}\"".format(args.text)
if (args.title):
command += " with title \"{0}\"".format(args.title)
if (args.sound):
command += " sound name \"{0}\"".format(args.sound)
command += "\'"
os.system(command)
if __... | {
"content_hash": "b9a99a07d766b59bb5b9a0e01c7f9276",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 159,
"avg_line_length": 33,
"alnum_prop": 0.6679841897233202,
"repo_name": "blakek/my-files",
"id": "385ddc116c1f793560de2b4e6b5b37416b6e60b7",
"size": "783",
"binary": f... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# Get the proje... | {
"content_hash": "50936f467325bad90168f8c025c727d3",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 76,
"avg_line_length": 30.846743295019156,
"alnum_prop": 0.7038877158117004,
"repo_name": "adelosa/mciutil",
"id": "b6e7f0559af53a373b2073bab5a8be4db34e654c",
"size": "849... |
import json
import os
import urllib2
import urllib
import html2text
from unidecode import unidecode
import time
import urllib
import logging
import os
import os.path
import sys
import threading
if os.path.isfile('recipeitems-latest.json'):
pass
else:
os.system('wget http://openrecipes.s3.amazo... | {
"content_hash": "e0286a9b1017901748ec6b80e655a3d2",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 107,
"avg_line_length": 32.79207920792079,
"alnum_prop": 0.5694444444444444,
"repo_name": "schollz/extract_recipe",
"id": "48bf96798a4540c19d0551a619884a348035a113",
"size... |
"""
This function receives events from the word list DynamoDB table
stream.
"""
from __future__ import print_function
import json
import boto3, botocore
def lambda_handler(event, context):
print("Event: {}".format(json.dumps(event)))
for each_record in event["Records"]:
handle_dynamodb_st... | {
"content_hash": "c48d833942714adb8f9eba7237830be8",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 68,
"avg_line_length": 27.4375,
"alnum_prop": 0.6970387243735763,
"repo_name": "moduspwnens/unique-word-generator-api",
"id": "9325b0d5b28b3798889e17a7d69b099dd174f369",
"s... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
import pytest
from flexget.plugins.parsers.parser_internal import ParserInternal
from flexget.plugins.parsers.parser_guessit import Pa... | {
"content_hash": "f2b820aac81b7f6f856d7bc319ae5758",
"timestamp": "",
"source": "github",
"line_count": 605,
"max_line_length": 114,
"avg_line_length": 49.06942148760331,
"alnum_prop": 0.6067639033920571,
"repo_name": "jacobmetrick/Flexget",
"id": "0df3eb748f679e24c4bc92de776a87ab1d1e8f0b",
"size":... |
"""
This script contains unit test of the :mod: 'rmgpy.transport' module and :mod: 'rmgpy.data.transport' module
"""
import unittest
import os
import rmgpy.constants as constants
from rmgpy import settings
from rmgpy.species import Species
from rmgpy.molecule.molecule import Molecule
from rmgpy.quantity import DipoleM... | {
"content_hash": "2267b05cb7d2a73c371a7db5803c4079",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 173,
"avg_line_length": 43.13513513513514,
"alnum_prop": 0.6504654493376298,
"repo_name": "enochd/RMG-Py",
"id": "e979a9659ed43c399581dadd41a4f9d32488f6d6",
"size": "12616... |
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| {
"content_hash": "5308efd3db8318418541a5d73c5350a2",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 42,
"avg_line_length": 37.5,
"alnum_prop": 0.6533333333333333,
"repo_name": "aroth-arsoft/arsoft-trac-commitupdater",
"id": "ce0807f222efad092116666464644efc289d883f",
"size... |
"""Add missing constraints for threats
Revision ID: 62f26762d0a
Revises: 2837682ad516
Create Date: 2015-11-12 16:10:29.579969
"""
from alembic import op
# from ggrc.migrations.utils.resolve_duplicates import resolve_duplicates
# from ggrc_risks.models import Threat
# revision identifiers, used by Alembic.
revision ... | {
"content_hash": "ead4f76e38751496eb6b40ecb3e2bdf8",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 73,
"avg_line_length": 23.458333333333332,
"alnum_prop": 0.7460035523978685,
"repo_name": "AleksNeStu/ggrc-core",
"id": "f3e633817d8e9166c4d875c999bd731f1d7d5da1",
"size": ... |
'''
Code for handling files that are band interleaved by pixel (BIP).
'''
from __future__ import absolute_import, division, print_function, unicode_literals
import array
import logging
import numpy as np
import os
import sys
import spectral as spy
from .spyfile import SpyFile, MemmapFile
from spectral.utilities.pyth... | {
"content_hash": "5204377de3ae459a1a0da8bb23900849",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 82,
"avg_line_length": 33.87341772151899,
"alnum_prop": 0.523542600896861,
"repo_name": "spectralpython/spectral",
"id": "9ee92e1f91080fbec20b391ed7a09a70448556da",
"size"... |
"""Tests for the ironic driver."""
from ironicclient import exc as ironic_exception
import mock
from oslo_config import cfg
from oslo_serialization import jsonutils
from oslo_service import loopingcall
from oslo_utils import uuidutils
import six
from testtools.matchers import HasLength
from nova.api.metadata import b... | {
"content_hash": "21ec7b88726c50144ce3bdb3351f8394",
"timestamp": "",
"source": "github",
"line_count": 1579,
"max_line_length": 79,
"avg_line_length": 47.86763774540849,
"alnum_prop": 0.6103356574891179,
"repo_name": "shail2810/nova",
"id": "69c87de3fe09239f36555e5b31a6ec16eafd30cc",
"size": "7624... |
"""
From TinyDB
https://github.com/msiemens/tinydb/tree/master/tests
"""
from tinydb import where
from tinydb.operations import delete, increment, decrement
from conftest import db_middleware_populated_withkeylist, db_middleware_populated
import pytest
@pytest.mark.parametrize('db', [db_middleware_populated_withkeyli... | {
"content_hash": "9b14ce04753ac1516b9a94f3148c4530",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 98,
"avg_line_length": 36.19230769230769,
"alnum_prop": 0.6928799149840595,
"repo_name": "veedo/tinydb-keystore",
"id": "23f3abde7ab9722d39bd315a9714b86d9026197a",
"size": ... |
from msrest.service_client import ServiceClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from .operations.paths import Paths
from .operations.queries import Queries
from .operations.path_items import PathItems
from . import models
class AutoRestUrlTestServiceConfiguratio... | {
"content_hash": "8d7607ff3e113feb4b4f471cf41277be",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 94,
"avg_line_length": 37.80555555555556,
"alnum_prop": 0.692505510653931,
"repo_name": "BurtBiel/autorest",
"id": "34efde192fd6b78364837458e9a5c4c66c3a8920",
"size": "3196... |
DESCRIPTION="This script applies clustering"
import numpy as np
import argparse
import glob2
import logging
import re
from os.path import basename
from os.path import dirname
import sys
sys.path.append(dirname(__file__))
from my_target_counter import TargetCounter
logger = logging.getLogger(__file__)
# HOW TO ADD... | {
"content_hash": "a2ce33f882023caf274f1f58350d90b0",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 107,
"avg_line_length": 28.738916256157637,
"alnum_prop": 0.5541652382584847,
"repo_name": "AtsushiHashimoto/exp_idc",
"id": "1f8e439c402baf9ccd7211f607870939eccbc746",
"s... |
import click
from fabric.api import (
run,
env,
cd
)
from fabric.contrib.project import rsync_project
from .. import app, config, logger, cache
from .bootstrap import init_project
from ..init import run_app
@click.group(chain=True)
def cli():
pass
@click.command('init')
@click.argument('name')
def ... | {
"content_hash": "547827f68742a474c27da3801793e34a",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 107,
"avg_line_length": 23.53932584269663,
"alnum_prop": 0.6348448687350835,
"repo_name": "docloud/luna",
"id": "71b1d1a20616f979fe9804e26b2555bd49c3ac20",
"size": "2110",
... |
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:9755")
pwd = raw_input("Enter old wallet passphrase: ")
pwd2 = raw_input("Enter new wallet passphrase: ")
access.walletpassphrasechange(pwd, pwd2)
| {
"content_hash": "e45f3788de3b65e63da5581b2e5ba59e",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 49,
"avg_line_length": 44,
"alnum_prop": 0.759090909090909,
"repo_name": "hobbitcoin-team/hobbitcoin",
"id": "100b79d073af62b0bc9e4f8893dfcf1e8ec12a35",
"size": "220",
"bi... |
from rpython.jit.codewriter.flatten import Register, ListOfKind, Label, TLabel
from rpython.jit.codewriter.jitcode import SwitchDictDescr
# Some instructions require liveness information (the ones that can end up
# in generate_guard() in pyjitpl.py). This is done by putting special
# space operations called '-live-'... | {
"content_hash": "370387bc46932e7a3011d8701476ef58",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 78,
"avg_line_length": 35.25316455696203,
"alnum_prop": 0.5558348294434471,
"repo_name": "oblique-labs/pyVM",
"id": "6110df609879b4572cf9c05d7e5cfa7e72b5ef55",
"size": "278... |
secure_scheme_headers = {'X-FORWARDED-PROTO': 'https'}
| {
"content_hash": "039bd4e84e1a55e81ee77dca18c633ef",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 54,
"avg_line_length": 55,
"alnum_prop": 0.7090909090909091,
"repo_name": "isb-cgc/ISB-CGC-API",
"id": "08757196e3361c5ff848483afc6a4d196a3f435d",
"size": "72",
"binary": ... |
"""Tests for keypair API."""
from oslo_config import cfg
import six
from nova.compute import api as compute_api
from nova import context
from nova import db
from nova import exception
from nova.objects import keypair as keypair_obj
from nova import quota
from nova.tests.unit.compute import test_compute
from nova.test... | {
"content_hash": "f3609813b2865bb08d40f89a8152c4da",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 79,
"avg_line_length": 41.108225108225106,
"alnum_prop": 0.6084667228306655,
"repo_name": "yanheven/nova",
"id": "6167d4fde521799644da1905ce021489060fc386",
"size": "10131... |
from __future__ import unicode_literals
import logging
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseForbidden
from ..oauth2_backends import OAuthLibCore
from ..exceptions import FatalClientError
from ..settings import oauth2_settings
log = logging.getLogger("oauth2_pr... | {
"content_hash": "c9fd7f019fb0c44449e81566886005e0",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 115,
"avg_line_length": 35.18666666666667,
"alnum_prop": 0.6422887457370215,
"repo_name": "svetlyak40wt/django-oauth-toolkit",
"id": "e91f6a0da1f83815bb033877fb2c21b0e0ff872... |
from lxml import etree
import os
import sys
import conf
import g
from gwis import command
from gwis.exception.gwis_error import GWIS_Error
from util_ import misc
log = g.log.getLogger('cmd.user_hello')
class Op_Handler(command.Op_Handler):
# *** Constructor
def __init__(self, req):
command.Op_Handler.... | {
"content_hash": "7430ff2b3c7fe6e6281bdf8de4e79389",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 79,
"avg_line_length": 31.37837837837838,
"alnum_prop": 0.6155612977318403,
"repo_name": "lbouma/Cyclopath",
"id": "519ccc178345cb3e9ecfb3c54795c6e10611747c",
"size": "373... |
OUTPUT = '{}. {}\n'.format
def list_animals(animals):
return ''.join(OUTPUT(i, a) for i, a in enumerate(animals, start=1))
| {
"content_hash": "cdaba4239d3f6d277fb83df37f927953",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 72,
"avg_line_length": 25.8,
"alnum_prop": 0.627906976744186,
"repo_name": "the-zebulan/CodeWars",
"id": "3fbee348613c4b15e9bfc72d975e2cb0dd9cb87c",
"size": "129",
"binary... |
"""Read the balance of your bank accounts via FinTS."""
from collections import namedtuple
from datetime import timedelta
import logging
from fints.client import FinTS3PinTanClient
from fints.dialog import FinTSDialogError
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEn... | {
"content_hash": "4f349822c8c8554658961a18483b3f69",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 85,
"avg_line_length": 31.868613138686133,
"alnum_prop": 0.624942739349519,
"repo_name": "adrienbrault/home-assistant",
"id": "e7faff46155c2e82e11fa383ca5611d88caf12db",
"... |
from __future__ import unicode_literals
from collections import defaultdict
import json
import logging
from django.conf import settings
from django.contrib import auth
from django.core import exceptions as django_exceptions
from django.core.validators import RegexValidator, MaxLengthValidator
from django.db import mo... | {
"content_hash": "812dd578bc5ea65eb60a8bacbabb393f",
"timestamp": "",
"source": "github",
"line_count": 1694,
"max_line_length": 120,
"avg_line_length": 40.61570247933884,
"alnum_prop": 0.6199148292952342,
"repo_name": "opennode/nodeconductor",
"id": "f5bc9c5b4c454011741a1319947edf7dad0b3285",
"siz... |
import acos_client.v21.base as base
from port import Port
class Server(base.BaseV21):
def get(self, name, **kwargs):
return self._post("slb.server.search", {'name': name}, **kwargs)
def create(self, name, ip_address, **kwargs):
params = {
"server": {
"name": name... | {
"content_hash": "ab3e7a0c941162d9a6f9112c5cdbea49",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 77,
"avg_line_length": 29.22641509433962,
"alnum_prop": 0.5203357004519045,
"repo_name": "dougwig/acos-client",
"id": "52c5507417952843e22d6b71e2ab68c68190e476",
"size": "2... |
from tacker.common import exceptions
from tacker import context
from tacker.db.db_sqlalchemy.models import VnfResource
from tacker import objects
from tacker.objects import vnf_package_vnfd
from tacker.objects import vnf_resources
from tacker.tests.unit.db.base import SqlTestCase
from tacker.tests.unit.objects import f... | {
"content_hash": "1b30250dd63093a93c4ddbe20e7c82da",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 75,
"avg_line_length": 38.51648351648352,
"alnum_prop": 0.642796005706134,
"repo_name": "openstack/tacker",
"id": "3290f6d1cb1643aaf75158686b9084d909fd89db",
"size": "4134"... |
from string import Template
from datetime import date
bitcoinDir = "./";
inFile = bitcoinDir+"/share/qt/Info.plist"
outFile = "Universecoin-Qt.app/Contents/Info.plist"
version = "unknown";
fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro"
for line in open(fileForGrabbingVersion):
lineArr = line.replace... | {
"content_hash": "c44356d1557429a0c1029005848e068d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 69,
"avg_line_length": 27.416666666666668,
"alnum_prop": 0.7112462006079028,
"repo_name": "univesalcoin/universecoin-update",
"id": "439159699b7cc3ef0d374e4bea4029b09f73dac1"... |
import random
def intro():
print("""I am thinking of a 3-digit number. Try to guess what it is.
Here are some clues:
When I say: That means:
Cold No digit is correct.
Warm One digit is correct but in the wrong position.
Hot One digit is correct and in the right positi... | {
"content_hash": "d9ff078793dd76ad68697e200934dfdf",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 72,
"avg_line_length": 30.1875,
"alnum_prop": 0.537888198757764,
"repo_name": "Mdlkxzmcp/various_python",
"id": "d3562f763d85c9830518323347f0d90ee79ec22d",
"size": "2415",
... |
"""Benchmark script for TensorFlow.
See the README for more information.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags as absl_flags
import tensorflow as tf
import benchmark_cnn
import cnn_util
import flag... | {
"content_hash": "9bb6ae16994a41540f645b91bdaa4d59",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 80,
"avg_line_length": 30.68421052631579,
"alnum_prop": 0.707833047455689,
"repo_name": "annarev/benchmarks",
"id": "707dd60d058c970a4fd1761c9bdf28abc85ff36a",
"size": "243... |
def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
# What we know!获取评论数据
g = open('reviews.txt', 'r')
reviews = list(map(lambda x: x[:-1], g.readlines()))
g.close()
# What we WANT to know!获取评价数据
g = open('labels.txt', 'r')
labels = list(map(lambda x: x[:-1].upper(), g.readl... | {
"content_hash": "f07e5634b1abaa5db0ef83d5a26fbe5a",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 131,
"avg_line_length": 33.08524590163935,
"alnum_prop": 0.5539589733425825,
"repo_name": "zchq88/DLminiProject",
"id": "2882a889017be56fee71e544dbae595298708013",
"size":... |
import io
import logging
import os
import re
import sys
from datetime import datetime
from datetime import timedelta
from django import db
from django.apps import apps
from django.conf import settings
import kolibri
from kolibri.core.deviceadmin.exceptions import IncompatibleDatabase
from kolibri.core.tasks.decorator... | {
"content_hash": "8b956f2a830796b699a7745b59475203",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 88,
"avg_line_length": 33.668067226890756,
"alnum_prop": 0.6420816173717708,
"repo_name": "indirectlylit/kolibri",
"id": "39ba918b1b17581b6600cb708e38409b747cdbe1",
"size"... |
from iota import Iota, TryteString, TransactionHash, TransactionTrytes, \
HttpAdapter, MockAdapter
from iota.adapter.wrappers import RoutingWrapper
from unittest import TestCase
import sys
from unittest.mock import MagicMock, patch
# Load mocked package on import from pow pkg.
# Therefore we can test without havin... | {
"content_hash": "30cfad54d85fb15d47b68fde15a952bd",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 88,
"avg_line_length": 41.84756097560975,
"alnum_prop": 0.5912866093545097,
"repo_name": "iotaledger/iota.lib.py",
"id": "a3ee70d2a14d6749302d704242b4783ffec65881",
"size"... |
import os,sys
import utils as cu
import libDetection as det
import cPickle as pickle
import scipy.io
import numpy as np
params = cu.loadParams('dbDir relationsFile outputDir')
archive = {}
T = pickle.load( open(params['dbDir']+'/db.idx','rb') )
M = scipy.io.loadmat(params['dbDir']+'/db.cache')
archive['images'] = ... | {
"content_hash": "c0f876e9add327de5a7ec55da450801d",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 110,
"avg_line_length": 26.517241379310345,
"alnum_prop": 0.61703511053316,
"repo_name": "jccaicedo/localization-agent",
"id": "16a7e54651a80d7562dd0c32d800ec7e3eab725f",
"... |
from __future__ import unicode_literals
import errno
import hashlib
import os
import time
from datetime import datetime
from werkzeug.utils import secure_filename as _secure_filename
from indico.util.string import to_unicode, unicode_to_ascii
def silentremove(filename):
try:
os.remove(filename)
... | {
"content_hash": "e1bca70af9391eb2a85b6f307e6ef9ce",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 83,
"avg_line_length": 33.93382352941177,
"alnum_prop": 0.6446370530877573,
"repo_name": "OmeGak/indico",
"id": "e9455e7e10d6fb959a1ddbe39991dfc02eae2d24",
"size": "4829",... |
from django.conf.urls.defaults import *
from .views import GlobalOverview
urlpatterns = patterns('',
url(r'^$', GlobalOverview.as_view(), name='index'),
)
| {
"content_hash": "4bf713376637756b9afe01a0494d353e",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 55,
"avg_line_length": 23,
"alnum_prop": 0.7018633540372671,
"repo_name": "andrewsmedina/horizon",
"id": "382cd69abe9cc6edbbb6810f2002c0fdf901f061",
"size": "971",
"binary... |
from sqlalchemy import testing
from sqlalchemy.testing import fixtures
from sqlalchemy.util.compat import import_
class DatabaseRemovedTest(fixtures.TestBase):
def test_deprecate_databases(self):
with testing.expect_deprecated_20(
"The `database` package is deprecated and will be removed in v2... | {
"content_hash": "b7dde74e2bc42f451b19dc4b5b6358b0",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 79,
"avg_line_length": 34.54545454545455,
"alnum_prop": 0.7157894736842105,
"repo_name": "j5int/sqlalchemy",
"id": "b2ee708e2640b41b1a7e6476a76713b6a4f21717",
"size": "380"... |
"""
Print stellar data (gaia ids, memberships etc.) for the paper.
Prepare two versions: One is the first few lines for the paper (stellar_memberships_example.tex),
and the other one is an online supplementary material.
Print only members of ScoCen. Background stars are not important!
"""
import numpy as np
from a... | {
"content_hash": "31ba8c9326613441cd861f783b126102",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 224,
"avg_line_length": 28.530864197530864,
"alnum_prop": 0.6343574210298571,
"repo_name": "mikeireland/chronostar",
"id": "ecedf00787d501a0b972ee9a74c781126ebf6509",
"size... |
'''
Hello student. Thank you for downloading a CORGIS library. However, you do not need to open this library. Instead you should use the following:
import music
If you opened the file because you are curious how this library works, then well done! We hope that you find it a useful learning experience. However... | {
"content_hash": "d9bd219363583171691ca457d81520e9",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 275,
"avg_line_length": 38.434615384615384,
"alnum_prop": 0.5962173521465025,
"repo_name": "chandlercr/aima-python",
"id": "4d8ba7af27de078660ccf2f0bfac71a1f32369c1",
"siz... |
import warnings
warnings.warn(
"mezzanine.mobile has been deprecated. Please remove it from your "
"INSTALLED_APPS.", FutureWarning, stacklevel=2
)
| {
"content_hash": "cfa4e9c8a5509bf988d0ab78dfa6d7f1",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 71,
"avg_line_length": 26.166666666666668,
"alnum_prop": 0.7452229299363057,
"repo_name": "christianwgd/mezzanine",
"id": "99341d15c78484192a1d1b6a48c40ed543c0a7f9",
"size":... |
__author__ = 'albertlwohletz'
from API import models
from django.http import HttpResponse
import json
def add_char(request):
# Get Request Information
name = request.GET['name']
image = request.GET['image']
hp = request.GET['hp']
ac = request.GET['ac']
count = int(request.GET['count'])
# C... | {
"content_hash": "179445eafc210adeee513682b12a636c",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 88,
"avg_line_length": 27.78846153846154,
"alnum_prop": 0.6359861591695501,
"repo_name": "albertwohletz/combatmanager",
"id": "3837d5dedfc1461305232f238974eaaf30712844",
"s... |
import unittest
from redis import Redis
from webhooks import webhook
from webhooks.senders import async_redis
class SendersAsyncRedisCase(unittest.TestCase):
def test_redis_sender(self):
redis_connection = Redis()
# Second, test the sender, which handles the async components
@webhook(sen... | {
"content_hash": "efc7d1688ba5968a5cfc215bc3439bae",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 133,
"avg_line_length": 33,
"alnum_prop": 0.6868686868686869,
"repo_name": "pydanny/webhooks",
"id": "36641b8cb33846f7975d53c9ba56d27f8c470ed0",
"size": "740",
"binary": ... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... | {
"content_hash": "761e2919754dd6137984473da52d7d17",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 99,
"avg_line_length": 34.94915254237288,
"alnum_prop": 0.6357904946653734,
"repo_name": "margguo/python-ivi",
"id": "e94118fc4be69036eb900fd4355f16779a806d17",
"size": "4... |
'''Algorithms for converting grammars to Chomsky Normal Form.'''
from cfg.core import ContextFreeGrammar, Terminal, Nonterminal, \
ProductionRule, SubscriptedNonterminal
from util.moreitertools import powerset
def is_cnf_rule(r, start):
'''Return whether a production rule is in CNF. Must indi... | {
"content_hash": "f91c54cbd1f08e261dfc779500eaec11",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 79,
"avg_line_length": 36.51923076923077,
"alnum_prop": 0.5961032122169563,
"repo_name": "bdusell/pycfg",
"id": "3e905f8e554a0c8dbf4c7580b3d746ab70676031",
"size": "5697",... |
'''
This module contains dependence structures for fitting models using
generalized estimating equations (GEE).
'''
from .covstruct import Independence, Exchangeable, GlobalOddsRatio,\
Autoregressive, Nested, CovStruct
| {
"content_hash": "b675ba6f4a7abb8d560c6024c41d447c",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 68,
"avg_line_length": 32,
"alnum_prop": 0.7991071428571429,
"repo_name": "rgommers/statsmodels",
"id": "618b176741512c68959603c80751138d10f49bba",
"size": "224",
"binary"... |
from pyramid.traversal import find_root
from snovault import (
calculated_property,
collection,
load_schema,
)
from snovault.util import Path
from .base import (
paths_filtered_by_status
)
from .dataset import Dataset
from .shared_calculated_properties import (
CalculatedAssaySynonyms,
Calculate... | {
"content_hash": "8aaa4df6beba07fee32b03c107fb241a",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 144,
"avg_line_length": 33.8343949044586,
"alnum_prop": 0.6065512048192772,
"repo_name": "ENCODE-DCC/encoded",
"id": "31fd7c267bce81bf6ec225ca74c5cf8557f4c8ca",
"size": "5... |
import os
import unittest
import hashlib
import shutil
from config import basedir
from app import app, db
from StringIO import StringIO
from time import sleep
from PIL import Image
testDbPath = os.path.join(basedir, 'test.db')
class TestCase(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = Tr... | {
"content_hash": "c1c154e4f49200714f6be39847b97b51",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 164,
"avg_line_length": 44.977777777777774,
"alnum_prop": 0.6282114624505929,
"repo_name": "jsaxton/riGallery",
"id": "4b889b903a6490fcf3de04ad2a7efc6e3f0c7b7f",
"size": "4... |
"""Tests for call_trees module."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import imp
from tensorflow.python.autograph.converters import call_trees
from tensorflow.python.autograph.converters import functions
from tensorflow.python.autograph.core i... | {
"content_hash": "4560c43b78af42da3b4bdd476f693597",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 79,
"avg_line_length": 29.43859649122807,
"alnum_prop": 0.5709177592371871,
"repo_name": "gunan/tensorflow",
"id": "86ca2dc9c244f309176edab41b7e59895f2453a8",
"size": "741... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('logger', '0002_auto_20161231_1740'),
]
operations = [
migrations.AddField(
model_name='requestlogger',
name='sha1',
... | {
"content_hash": "a17efe4519ddf49383612113d67db8f7",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 108,
"avg_line_length": 24.333333333333332,
"alnum_prop": 0.6118721461187214,
"repo_name": "AstroMatt/esa-subjective-time-perception",
"id": "93e1e5ecf499f7af4a775e513731850c... |
from django.conf.urls.defaults import url, patterns
from projects.constants import LANGUAGES_REGEX
from urls import urlpatterns as main_patterns
urlpatterns = patterns(
'', # base view, flake8 complains if it is on the previous line.
url((r'^projects/(?P<project_slug>[\w.-]+)/(?P<lang_slug>\w{2})/'
... | {
"content_hash": "f402e67fc791d21c07d251a5b311c74f",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 77,
"avg_line_length": 31.369565217391305,
"alnum_prop": 0.5855855855855856,
"repo_name": "nyergler/pythonslides",
"id": "787ec419f6a8844259e81139a2a3fd02f307facc",
"size":... |
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from collections import namedtuple
import pytest
import pytz
from pingparsing import PingParsing
@pytest.fixture
def ping_parser():
return PingParsing(timezone=pytz.UTC)
PingTestData = namedtuple("PingTestData", "value expected replies")... | {
"content_hash": "cd45efa340c63d09b4dc1f5c2923f725",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 67,
"avg_line_length": 17.833333333333332,
"alnum_prop": 0.7694704049844237,
"repo_name": "thombashi/pingparsing",
"id": "52b9a293db74048e8011aa7581ea9a7977d1b4fd",
"size":... |
VERSION = (1, 4, 4)
default_app_config = 'image.apps.ImageConfig' | {
"content_hash": "475db206f9f556bbe574c12ea33eaaf5",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 45,
"avg_line_length": 22,
"alnum_prop": 0.696969696969697,
"repo_name": "akhilari7/pa-dude",
"id": "9e7527f415dc6c4a111d4c2e296c0e128c8ca5bf",
"size": "66",
"binary": fal... |
extensions = [
'ipypublish.sphinx.gls',
]
exclude_patterns = ['_build']
master_doc = 'contents'
| {
"content_hash": "29c31700f881d3ebe353bd988527b24f",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 29,
"avg_line_length": 20.8,
"alnum_prop": 0.6346153846153846,
"repo_name": "chrisjsewell/ipypublish",
"id": "2ad12e0f1a9d409c96e53c13f20c2fcbd1d23cdc",
"size": "104",
"bi... |
from django.test import TestCase, Client
from django.conf import settings
from django.contrib import admin
import random
from django.contrib.auth.models import User
from models import AccessAttempt
from decorators import FAILURE_LIMIT
# Only run tests if they have axes in middleware
# Basically a functional test
cla... | {
"content_hash": "b80d4f5f995827a881981de9a2ebbcd3",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 77,
"avg_line_length": 39.36363636363637,
"alnum_prop": 0.6481909160892995,
"repo_name": "pombredanne/django-axes-1",
"id": "0eb892347ba8db92e06076d0c4b4221002def0a2",
"siz... |
import io
import os
import sys
import tempfile
import pytest
import hypothesis as h
import hypothesis.strategies as st
import numpy as np
import pyarrow as pa
import pyarrow.tests.strategies as past
from pyarrow.feather import (read_feather, write_feather, read_table,
FeatherDataset)
tr... | {
"content_hash": "da39acc5a41c2580f0f69446bfe19dfa",
"timestamp": "",
"source": "github",
"line_count": 805,
"max_line_length": 79,
"avg_line_length": 28.504347826086956,
"alnum_prop": 0.6200644992591301,
"repo_name": "laurentgo/arrow",
"id": "498440c5f586188e185766ea50b3ea20a4bf3879",
"size": "237... |
import numbers
from . import Image, ImageColor
from ._util import isStringType
"""
A simple 2D drawing interface for PIL images.
<p>
Application code should use the <b>Draw</b> factory, instead of
directly.
"""
class ImageDraw(object):
def __init__(self, im, mode=None):
"""
Create a drawing ins... | {
"content_hash": "6fa1f01191bbe00474d0accdb6044ad6",
"timestamp": "",
"source": "github",
"line_count": 335,
"max_line_length": 75,
"avg_line_length": 34.31044776119403,
"alnum_prop": 0.5308856794849487,
"repo_name": "okwow123/djangol2",
"id": "ddf669f78a27814bcb1b265615171af6952b0e4a",
"size": "12... |
"""
Michaelis-Menten Kinetics
=========================
Implements support for *Michaelis-Menten* kinetics, a model of enzyme kinetics:
- :func:`colour.biochemistry.reaction_rate_MichaelisMenten_Michaelis1913`
- :func:`colour.biochemistry.reaction_rate_MichaelisMenten_Abebe2017`
- :func:`colour.biochemistry.REA... | {
"content_hash": "b4718c76379da441521767f1bbb94753",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 80,
"avg_line_length": 27.839024390243903,
"alnum_prop": 0.6370247065007885,
"repo_name": "colour-science/colour",
"id": "9e318fca74ce3677cbbc0e87879033200af55ec1",
"size"... |
import glob
import unittest
test_file_strings = glob.glob('test_*.py')
module_strings = [str[0:len(str)-3] for str in test_file_strings]
suites = [unittest.defaultTestLoader.loadTestsFromName(str) for str
in module_strings]
testSuite = unittest.TestSuite(suites)
text_runner = unittest.TextTestRunner().run(te... | {
"content_hash": "15b2d9abad928e0ec1580975ef7a461b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 67,
"avg_line_length": 36.44444444444444,
"alnum_prop": 0.7560975609756098,
"repo_name": "xlvector/dingpa",
"id": "80373921c61390fbc2860251a04ef4043be55916",
"size": "328",
... |
"""
decorators.py
Decorators for URL handlers
"""
from functools import wraps
import logging
from google.appengine.api import users
from birthday.models import Client
from flask import redirect, request, abort
def login_required(func):
"""Requires standard login credentials"""
@wraps(func)
def decorate... | {
"content_hash": "0f596a6b65b73f9175d1e0b1ab2ac7ad",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 65,
"avg_line_length": 29.4,
"alnum_prop": 0.638095238095238,
"repo_name": "dcifuen/cloudbday",
"id": "9a5f060204eedd9412923c65b25481448d5b50f1",
"size": "1470",
"binary"... |
from google.cloud.billing import budgets_v1beta1
async def sample_delete_budget():
# Create a client
client = budgets_v1beta1.BudgetServiceAsyncClient()
# Initialize request argument(s)
request = budgets_v1beta1.DeleteBudgetRequest(
name="name_value",
)
# Make the request
await c... | {
"content_hash": "e4c4d89bc9076139bf41263046a2716b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 73,
"avg_line_length": 25.470588235294116,
"alnum_prop": 0.7344110854503464,
"repo_name": "googleapis/python-billingbudgets",
"id": "281c204708bc3e9d847ffc83e4b1f91389963cfa"... |
import requests
from pyquery import PyQuery as pq
import time
import json
import sys
import re
url = 'http://app1.sfda.gov.cn/datasearch/face3/content.jsp?tableId=26&tableName=TABLE26&tableView=%B9%FA%B2%FA%C6%F7%D0%B5&Id=116849'
def get_detail(item_id = 116849,**kwargs):
url = 'http://app1.sfda.gov.cn/datasear... | {
"content_hash": "311e56853ffcad196cc0b0ae7ff6c225",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 134,
"avg_line_length": 24,
"alnum_prop": 0.5308823529411765,
"repo_name": "alingse/crawler-common",
"id": "26c1768f0ea0d712608f1aee7be32b5fabeddb34",
"size": "2083",
"bi... |
import requests
def _rev_auth_str(client_api_key, user_api_key):
"""Returns a Rev Auth string."""
return 'Rev %s:%s' % (client_api_key, user_api_key)
class RevAuth(requests.auth.AuthBase):
"""
Custom authorization for Rev API
See http://www.rev.com/api/security
Format:
Authorization:... | {
"content_hash": "a0438b113da82af020495da91a3c9eb6",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 92,
"avg_line_length": 27.869565217391305,
"alnum_prop": 0.6224648985959438,
"repo_name": "koemei/rev-api",
"id": "09b38d50c86735aa42999038f4e12d8ae5ef15ea",
"size": "641",... |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('projects', '0016_auto_20160516_0951'),
]
operations = [
migrations.RenameField(
mo... | {
"content_hash": "88180af27fde095c9e521340236e4048",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 129,
"avg_line_length": 27.076923076923077,
"alnum_prop": 0.6051136363636364,
"repo_name": "zurfyx/simple",
"id": "39fda84bba3e6780cd2d9f97acb1e81456feae43",
"size": "776",... |
from __future__ import unicode_literals
import swapper
from accelerator_abstract.models.base_startup_attribute import (
BaseStartupAttribute
)
class StartupAttribute(BaseStartupAttribute):
class Meta(BaseStartupAttribute.Meta):
swappable = swapper.swappable_setting(
BaseStartupAttribute.... | {
"content_hash": "0b895366625e2b33d38cc63e9eeac733",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 68,
"avg_line_length": 27.384615384615383,
"alnum_prop": 0.7668539325842697,
"repo_name": "masschallenge/django-accelerator",
"id": "48abbc127eb4afb2bd15a1bbfaaee027dc096b08"... |
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.cache import cache
from django.urls import reverse
from django.utils import timezone
from freezegun import freeze_time
from rest_framework import status, test
from rest_framework.authtoken.models import Token
from . import... | {
"content_hash": "1c9cb0968c2a371d20a3f46b44396079",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 88,
"avg_line_length": 43.032967032967036,
"alnum_prop": 0.6407048008171604,
"repo_name": "opennode/waldur-mastermind",
"id": "041c35dabaa970553d0b8cd77750f179b2b60c8f",
"... |
from django import template
register = template.Library()
@register.filter
def float_add(field, value):
return str(float(field) + float(value))
@register.filter
def float_substract(field, value):
return str(float(field) - float(value)) | {
"content_hash": "05fd466269a749d3b37e4ced2f3bb0f5",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 43,
"avg_line_length": 19.076923076923077,
"alnum_prop": 0.7298387096774194,
"repo_name": "bartscheers/banana",
"id": "f0088bb54cc94bee47a8795242db2bab83ad93ea",
"size": "2... |
"""
crackfortran --- read fortran (77,90) code and extract declaration information.
Copyright 1999-2004 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT ... | {
"content_hash": "9fb48ca772dc0ee17953bc999f0103e4",
"timestamp": "",
"source": "github",
"line_count": 3344,
"max_line_length": 207,
"avg_line_length": 38.553528708133975,
"alnum_prop": 0.4706530254492992,
"repo_name": "jorisvandenbossche/numpy",
"id": "2aaf5d7c6c12e962c7e89e99692724f4d4bba178",
"... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/mission/quest_item/shared_daclif_gallamby_q2_needed.iff"
result.attribute_template_id = -1
result.stfName("loot_corl_n","daclif_gallamby_q2_needed")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS #... | {
"content_hash": "54e859f127ee6d9ad4242e340105f23e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 92,
"avg_line_length": 26.153846153846153,
"alnum_prop": 0.7088235294117647,
"repo_name": "anhstudios/swganh",
"id": "b34a23c453f67a21ae176c1c81c5d29f5f46175b",
"size": "48... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = "this-really-needs-to-be-changed"
OUTPUT_IMAGES_FOLDER = "images"
BASE_DIR = basedir
class Production(Config):
DEBUG = False
class Stagin... | {
"content_hash": "41e491e5b58ddeef7d14876e9d71ac8d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 52,
"avg_line_length": 16.133333333333333,
"alnum_prop": 0.6611570247933884,
"repo_name": "KodeKracker/Image-Merging-API",
"id": "00c425de36600f7e294adcdd272057ef429ca24a",
... |
from vkapp.bot.logic.core.vk_trigger import VKTrigger
from .logic.core.StateMachine import StateMachine
from multiprocessing import Process, Array
def handle_update(update):
uid = update[3]
state_machine = StateMachine()
# p = Process(target=state_machine.fire, args=(VKTrigger, uid, update))
# p.start... | {
"content_hash": "dd38e4eeaa707ed652c95c96d7522418",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 75,
"avg_line_length": 30.916666666666668,
"alnum_prop": 0.7331536388140162,
"repo_name": "ParuninPavel/lenta4_hack",
"id": "601ea10476eb4aeaf84a47e25656190af94ad04c",
"siz... |
from django import forms
from threads.models import Answer
class reply_form(forms.ModelForm):
class Meta:
model = Answer
fields = ('description',)
| {
"content_hash": "5ae11f71436982744ea9053472cd49b9",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 34,
"avg_line_length": 17.1,
"alnum_prop": 0.672514619883041,
"repo_name": "uniqna/uniqna",
"id": "c967b52d3ac7377883644fce5d1bd43d037fd4a1",
"size": "171",
"binary": fal... |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
# TOOD(Eric Ayers): There is no task or goal named 'jvm' as used in the config section where these parameters are located.
# We might need to rename these whem merging... | {
"content_hash": "ae331af17d9fe5d4663d689a419b1ca4",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 122,
"avg_line_length": 45.68421052631579,
"alnum_prop": 0.7131336405529954,
"repo_name": "square/pants",
"id": "d0ed0020f875e399ca98486722f2c175ce3398f2",
"size": "1015",
... |
"""Utilities to evaluate the clustering performance of models.
Functions named as *_score return a scalar value to maximize: the higher the
better.
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Wei LI <kuantkid@gmail.com>
# Diego Molla <dmolla-aliod@gmail.com>
# Arnaud Fouchet ... | {
"content_hash": "bd9905143052194e8e4b62f041010a38",
"timestamp": "",
"source": "github",
"line_count": 1171,
"max_line_length": 87,
"avg_line_length": 35.12211784799317,
"alnum_prop": 0.6445973546002723,
"repo_name": "ivannz/scikit-learn",
"id": "2d99f848369cec0173c9743ecba95a6d551ba4a2",
"size": ... |
"""Builds the documentation from the source code.
This deletes the old documentation first.
"""
import logging
import os
import shutil
import sys
import shakaBuildHelpers
def build_docs(_):
"""Builds the source code documentation."""
logging.info('Building the docs...')
base = shakaBuildHelpers.get_source_b... | {
"content_hash": "89c1a1fc91c10819ee51d4dff2f536a7",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 80,
"avg_line_length": 27.823529411764707,
"alnum_prop": 0.6976744186046512,
"repo_name": "brightcove/shaka-player",
"id": "7bbffd4aca9a06a94a3c6caa3a9447361cb7c556",
"size... |
from nose.tools import assert_equal, assert_true, assert_almost_equal
import json
import requests
import re
import os
import yaml
file_dir_path = os.path.dirname(__file__)
TEST_ITEMS = os.path.join(file_dir_path,"test_items.yaml")
class TestGet(object):
def setUp(self):
"""Server Settings"""
self... | {
"content_hash": "eef99ef84b4a39a9227947a1594b579d",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 99,
"avg_line_length": 39.17763157894737,
"alnum_prop": 0.5286314021830395,
"repo_name": "kate-v-stepanova/genomics-status",
"id": "3fb38698709b917107ddbf7b98610256e6e35772"... |
from typing import Any, Optional, Union
import pandas as pd
import ibis.expr.analysis as an
import ibis.expr.operations as ops
import ibis.util
from ibis.backends.pandas.core import execute
from ibis.backends.pandas.execution import constants
from ibis.expr.scope import Scope
def get_grouping(grouper):
# this i... | {
"content_hash": "693ee85fd1e607fdce642c3c7860712d",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 87,
"avg_line_length": 28.94074074074074,
"alnum_prop": 0.6316867161504991,
"repo_name": "cpcloud/ibis",
"id": "0c8c0fb63c1bae7855f61f53677cf41a2a367730",
"size": "3907",
... |
"""
Time period and interval parameter parsers for Graphite backend.
"""
from datetime import datetime, timedelta
import re
class TimeParserValueError(ValueError):
"""
A value could not be parsed.
"""
INTERVAL_RE = re.compile(r'(?P<count>\d+)(?P<unit>.+)')
UNIT_VALUES = {}
def _set_unit_value(value,... | {
"content_hash": "cfb287449b15dae294cf5818abc314b1",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 79,
"avg_line_length": 32.321739130434786,
"alnum_prop": 0.6203927898843153,
"repo_name": "praekelt/go-metrics-api",
"id": "74370a9cbe57484465828489be45be13ff2919a4",
"siz... |
from __future__ import unicode_literals
import pytest
from stack import Stack
def test_initialization():
stack = Stack()
assert isinstance(stack, Stack)
assert stack.list.head is None
def test_push():
stack = Stack()
stack.push(5)
assert stack.list.head.value == 5
def test_pop():
stac... | {
"content_hash": "994640418c8236018ba0bf95c235713c",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 39,
"avg_line_length": 18.314285714285713,
"alnum_prop": 0.62402496099844,
"repo_name": "ndraper2/data-structures",
"id": "fb4955ae2ab2dc12433a7d32a98d94052644dfce",
"size"... |
from genestack import utils
from genestack.genestack_exceptions import GenestackException
from genestack.java import java_object
class QueryRange(object):
"""
Class that represents the offset-limit pair used in queries as query bounds.
"""
CLASS_NAME = 'com.genestack.api.queries.QueryRange'
def _... | {
"content_hash": "7dd3bc2e9d7ddb2500237e5be2219751",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 89,
"avg_line_length": 34.53846153846154,
"alnum_prop": 0.6648106904231625,
"repo_name": "genestack/task-library",
"id": "23406cf0243ee47099a2ec97fbf3c054c0795f89",
"size":... |
"""This module contains an object that represents a change in the Telegram message auto
deletion.
"""
from telegram._telegramobject import TelegramObject
from telegram._utils.types import JSONDict
class MessageAutoDeleteTimerChanged(TelegramObject):
"""This object represents a service message about a change in a... | {
"content_hash": "f7a248359ce8a513a14988cc6cf4761a",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 93,
"avg_line_length": 29.94736842105263,
"alnum_prop": 0.663444639718805,
"repo_name": "tzpBingo/github-trending",
"id": "a6e6e67e6cfedcbab97549cd42dfb5ee99d2a57a",
"size"... |
@app.task(bind=True)
def random_site(self):
try:
res = requests.get('https://voat.co/random')
except requests.RequestException as e:
raise self.retry(exc=e, countdown=5)
return res.content.decode('utf-8')
| {
"content_hash": "0d3f125b83a5a16d1d4668c25ba6dfee",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 46,
"avg_line_length": 30.285714285714285,
"alnum_prop": 0.7216981132075472,
"repo_name": "blakev/hackustate-distributed-python",
"id": "604e12536702cd1d8aa9f70b37c885294b05ec... |
import sys
if sys.version_info < (3, 7):
# This is needed because the Python Kubernetes client >= 12.0 contains a logging object, meaning that
# v1.Pod et al. are not pickleable on Python 3.6.
# Python 3.7 added this via https://bugs.python.org/issue30520 in 2017 -- but Python 3.6 doesn't have this
# ... | {
"content_hash": "05386e95a2fc618c165df67276654b5b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 110,
"avg_line_length": 38.96296296296296,
"alnum_prop": 0.6929657794676806,
"repo_name": "mistercrunch/airflow",
"id": "0998e31143fc8efe33568df27509dadd7f100f61",
"size": ... |
"""
Tests for L{twisted.web.twcgi}.
"""
import sys
import os
import json
from io import BytesIO
from twisted.trial import unittest
from twisted.internet import reactor, interfaces, error
from twisted.python import util, failure, log
from twisted.web.http import NOT_FOUND, INTERNAL_SERVER_ERROR
from twisted.web import... | {
"content_hash": "619aa753a3eb313c8641660ccca21304",
"timestamp": "",
"source": "github",
"line_count": 428,
"max_line_length": 80,
"avg_line_length": 29.950934579439252,
"alnum_prop": 0.6101099929791716,
"repo_name": "EricMuller/mynotes-backend",
"id": "b294ec143df7f4205ac4339749d0f1690c904da1",
"... |
"""
Unit Tests for nova.manager
"""
from nova import manager
from nova import test
class ManagerTestCase(test.TestCase):
def test_additional_apis_for_dispatcher(self):
class MyAPI(object):
pass
m = manager.Manager()
api = MyAPI()
dispatch = m.create_rpc_dispatcher(add... | {
"content_hash": "1158d0b19716cbb025c695e04442ade3",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 65,
"avg_line_length": 23.42105263157895,
"alnum_prop": 0.6561797752808989,
"repo_name": "qwefi/nova",
"id": "7faac8608da60bedd9250defd1f3f84202c42afe",
"size": "1101",
"... |
import sqlalchemy
from pypi_org.data.modelbase import SqlAlchemyBase
class Maintainer(SqlAlchemyBase):
__tablename__ = 'maintainers'
user_id: int = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True)
package_id: str = sqlalchemy.Column(sqlalchemy.String, primary_key=True)
| {
"content_hash": "e4446af30fc7ebce0d483afde9ca86d4",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 76,
"avg_line_length": 32.44444444444444,
"alnum_prop": 0.7636986301369864,
"repo_name": "Wintellect/WintellectWebinars",
"id": "6b17acd3c634386bd8578e445615c213d23bdf93",
"... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.location_and_climate import SiteGroundTemperatureDeep
log = logging.getLogger(__name__)
class TestSiteGroundTemperatureDeep(unittest.TestCase):
def setUp(self):
sel... | {
"content_hash": "e7c138255813e2001546a2579f25dd50",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 139,
"avg_line_length": 50.5,
"alnum_prop": 0.7256701279884086,
"repo_name": "rbuffat/pyidf",
"id": "ece1c6e4e85b37cbb33821ac00c591747d2c3d6e",
"size": "4141",
"binary": ... |
import os
from twisted.trial import unittest
from zope.interface.verify import verifyObject
from scrapyd.config import Config
from scrapyd.interfaces import ISpiderScheduler
from scrapyd.scheduler import SpiderScheduler
from scrapyd.utils import get_spider_queues
class SpiderSchedulerTest(unittest.TestCase):
d... | {
"content_hash": "19d99f92becadbb73d6fc018afde8dab",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 100,
"avg_line_length": 39.68181818181818,
"alnum_prop": 0.6397479954180985,
"repo_name": "scrapy/scrapyd",
"id": "82ccfc21a692489c393e7d79e48e53d9b2ba867a",
"size": "1746"... |
"""
A generalized application configuration utility.
Features include:
- lazy eval
- merges configuration files
- parameter type validation, with custom validation
- parameter aliases
Easily extensible to other source formats, e.g. json and ini
Limitations:
- at the moment only supports a "flat" config str... | {
"content_hash": "f1669d9344c298c6ab2823b4fd3b388b",
"timestamp": "",
"source": "github",
"line_count": 886,
"max_line_length": 99,
"avg_line_length": 41.12528216704289,
"alnum_prop": 0.6057304388396411,
"repo_name": "Microsoft/PTVS",
"id": "297592c37ccf53c8abadb406c7f72dc726975379",
"size": "36461... |
from .service_principal_base_py3 import ServicePrincipalBase
class ServicePrincipalCreateParameters(ServicePrincipalBase):
"""Request parameters for creating a new service principal.
All required parameters must be populated in order to send to Azure.
:param account_enabled: whether or not the service p... | {
"content_hash": "ff73ca9be1e3368059ab57e9fff97fe1",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 298,
"avg_line_length": 51.791666666666664,
"alnum_prop": 0.7015285599356396,
"repo_name": "Azure/azure-sdk-for-python",
"id": "b9b2a3541f0c329d1615ea80d4bd5ca6047b42b5",
"... |
import os
import logging
import tempfile
import thread, threading
import Queue
import requests
from contextlib import contextmanager
logger = logging.getLogger(__name__)
def download_file(url, fpath):
logger.debug('starting to fetch %s', url)
r = requests.get(url, stream=True)
with open(fpath, 'wb') as f... | {
"content_hash": "698c6827b4561808aa6ff67a53979185",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 73,
"avg_line_length": 24.025,
"alnum_prop": 0.5660770031217481,
"repo_name": "zatonovo/slackbot",
"id": "f89ebe1183f79db05cacdcab0e9569246aab7ecf",
"size": "1946",
"bina... |
from __future__ import absolute_import
from django.contrib.auth.models import AnonymousUser
registry = {}
def serialize(objects, user=None, serializer=None):
if user is None:
user = AnonymousUser()
if not objects:
return objects
# sets aren't predictable, so generally you should use a ... | {
"content_hash": "8ea60047d552d1f3099bc84a82594670",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 85,
"avg_line_length": 26.62295081967213,
"alnum_prop": 0.603448275862069,
"repo_name": "mitsuhiko/sentry",
"id": "e71cbbd646110d6a3889e15dc34dcb8c20bd3506",
"size": "1624"... |
from urllib.parse import parse_qs, urlparse
import requests
from ._abstract import AbstractScraper
HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0"
}
# These languages use measurements like cups and spoons rather than grams and liters
IMPERIAL_LANGUAGES =... | {
"content_hash": "ca33613d45f7c829c464262301b913b7",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 116,
"avg_line_length": 31.548672566371682,
"alnum_prop": 0.5669004207573632,
"repo_name": "hhursev/recipe-scraper",
"id": "7d2b26c161352773c6d4cd921934d5c40bffdb84",
"siz... |
import calendar
import datetime
import re
import sys
import urllib
import urlparse
from email.Utils import formatdate
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\\.|[^"])*)"')
MONTHS = 'jan feb mar apr may jun jul au... | {
"content_hash": "0fd55641081233e618bb5ad759b2082a",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 85,
"avg_line_length": 34.16504854368932,
"alnum_prop": 0.6234725774367718,
"repo_name": "mcr/ietfdb",
"id": "50ad00e11b755850ba2775d726d51a79830ad3a5",
"size": "7038",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.