text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Spatial lag operations.
"""
__author__ = "Sergio J. Rey <[email protected]>, David C. Folch <[email protected]>, Levi John Wolf <[email protected]"
__all__ = ['lag_spatial', 'lag_categorical']
import numpy as np
def lag_spatial(w, y):
"""
Spatial lag operator.
If w is row standardized, returns the average of... | {
"content_hash": "04933665e050dc7f43aff90b7223153f",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 134,
"avg_line_length": 33.142131979695435,
"alnum_prop": 0.5107979782508807,
"repo_name": "sjsrey/pysal_core",
"id": "98c7e3ba9455f3bf683feadccf8406f9576d8761",
"size": "... |
import sys
import time
import unittest
import nose
from lib.noseplugin import OptionParser, parser_option
from lib import base
from lib.base import (
BGP_FSM_IDLE,
BGP_FSM_ESTABLISHED,
BGP_ATTR_TYPE_COMMUNITIES,
local,
)
from lib.gobgp import GoBGPContainer
from lib.exabgp import ExaBGPContainer
de... | {
"content_hash": "af05c0a95ad6e41076e84780502b2cf1",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 134,
"avg_line_length": 37.329787234042556,
"alnum_prop": 0.5976061555998861,
"repo_name": "a16/gobgp",
"id": "a67cb327ab7bf11b6da21fe624a0b26db9c65107",
"size": "11141",
... |
"""Test the Partially Signed Transaction RPCs.
"""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error, find_output
import json
import os
MAX_BIP125_RBF_SEQUENCE = 0xfffffffd
# Create one-input, one-output, no-fee transaction:
class PS... | {
"content_hash": "70359e353380aaaa60d4fe719fa34dc5",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 209,
"avg_line_length": 49.51111111111111,
"alnum_prop": 0.6262118491921005,
"repo_name": "ericshawlinux/bitcoin",
"id": "54dc87144881a94128cb76041b5b31a4cc97074d",
"size"... |
import sys, 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('..'))
os.environ['DJANGO_SETTI... | {
"content_hash": "21590b6b7afe7f62126af4ae5f8a6f35",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 82,
"avg_line_length": 33,
"alnum_prop": 0.7075163398692811,
"repo_name": "gabrielhurley/django-block-comment",
"id": "962e97477f617bd6cec3744d3d26c6a75b39e502",
"size": "... |
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server import util
class TapiCommonBandwidthProfileType(Model):
"""NOTE: This class is auto generated by OpenAPI Generat... | {
"content_hash": "6fa5d3d64dd9855fe201e7344a837cab",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 107,
"avg_line_length": 26.558139534883722,
"alnum_prop": 0.637478108581436,
"repo_name": "OpenNetworkingFoundation/ONFOpenTransport",
"id": "5ee35ddb805a3318e752c862cd7992c7... |
import os
from django.apps import AppConfig
from django.conf import settings
class ContentConfig(AppConfig):
name = 'contentcuration'
def ready(self):
try:
os.makedirs(settings.STORAGE_ROOT)
except os.error:
pass | {
"content_hash": "da821fe34181f540c734f6f55cba9603",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 40,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.7049180327868853,
"repo_name": "aronasorman/content-curation",
"id": "e19fecc894e1051cb96f4ae08a6c5471ba2291a6",
... |
import pysal
import os.path
import pysal.core.FileIO as FileIO
from pysal.weights import W
from warnings import warn
__author__ = "Myunghwa Hwang <[email protected]>"
__all__ = ["GeoBUGSTextIO"]
class GeoBUGSTextIO(FileIO.FileIO):
"""
Opens, reads, and writes weights file objects in the text format
used ... | {
"content_hash": "32b35ec9c9c1e6d2611b938be90d2287",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 93,
"avg_line_length": 30.876068376068375,
"alnum_prop": 0.5532179930795847,
"repo_name": "tectronics/pysal",
"id": "d1bfeb922893182d4fb3ab74c23329c1922223fc",
"size": "72... |
from sklearn.feature_extraction.text import TfidfVectorizer
import operator
import io
import random
import numpy as np
from numpy import arange
import nltk
from nltk import word_tokenize
def tweets2tags(text,hasht):
tx=[]
for line in text:
tokens=word_tokenize(line)
tags=nltk... | {
"content_hash": "cc56884030831904dd4b80c9978b2fd4",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 67,
"avg_line_length": 29.2,
"alnum_prop": 0.5856164383561644,
"repo_name": "PawelPamula/who-are-you",
"id": "142cd0f0b0c1948708e5819975d45eb3bc6f7557",
"size": "876",
"b... |
import unittest
from conans.client.store.localdb import LocalDB
import os
from conans.test.utils.test_files import temp_folder
class LocalStoreTest(unittest.TestCase):
def localdb_test(self):
tmp_dir = temp_folder()
db_file = os.path.join(tmp_dir, "dbfile")
localdb = LocalDB(db_file)
... | {
"content_hash": "3ecff250b8d2da074e09a603ee8a0ed5",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 65,
"avg_line_length": 31.041666666666668,
"alnum_prop": 0.6456375838926175,
"repo_name": "AversivePlusPlus/AversivePlusPlus",
"id": "84713c265f3aa38dfd7f11fd5a69af2d786057e4... |
"""Tests for the experimental input pipeline ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.data.python.ops import batching
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.... | {
"content_hash": "36fb55cdb8f314e077141347be714822",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 77,
"avg_line_length": 37.693396226415096,
"alnum_prop": 0.6597422099862346,
"repo_name": "dongjoon-hyun/tensorflow",
"id": "0456463a1928cf226010670b90a5d574579e0411",
"si... |
from inspect import isclass
from datetime import datetime
__all__ = ['ConvertError', 'default_converters', 'Converter', 'String',
'Integer', 'Any', 'Date']
class ConvertError(Exception):
'''
Converter should raise ConvertError if the given value does not match
'''
@property
def conve... | {
"content_hash": "718979f6ff7ccacccb3e1ca88eaa6e48",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 82,
"avg_line_length": 25.951219512195124,
"alnum_prop": 0.574483082706767,
"repo_name": "oas89/iktomi",
"id": "869f8f6747e7a55dee7efa2a7a88f7ba69dbad51",
"size": "4281",
... |
import os, sys, traceback
import github3
import gspread
import io
import json
import logging
from logging.config import dictConfig
from oauth2client.client import SignedJwtAssertionCredentials
GITHUB_CONFIG = {
'TOKEN': os.environ['GITHUB_TOKEN'],
'REPO_OWNER': 'opennews',
'REPO_NAME': 'srccon-product',
... | {
"content_hash": "4f81388fffc52edad8051d218803e249",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 103,
"avg_line_length": 32.28252788104089,
"alnum_prop": 0.6108935974205435,
"repo_name": "ryanpitts/membot",
"id": "c752b197bda6609e9c2b487447453a8d2938532b",
"size": "86... |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/x509.h>
/*
* See the comment above Cry... | {
"content_hash": "1b53f81596713fd262291cfd9bc9d897",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 40.12676056338028,
"alnum_prop": 0.6647946647946648,
"repo_name": "Ayrx/cryptography",
"id": "86d50bbd01c887e14302287161f1a77a0821b348",
"size": "284... |
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes_bi, disconnect_nodes, find_output, sync_blocks
import json
import os
MAX_BIP125_RBF_SEQUEN... | {
"content_hash": "624abcb6957d70ea777fb160c83427f8",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 266,
"avg_line_length": 54.6243093922652,
"alnum_prop": 0.6389197936684535,
"repo_name": "ElementsProject/elements",
"id": "e9098e4f5aef1869118ea00d2d7a4eb3fe191ba0",
"siz... |
from __future__ import absolute_import
import errno
import io
import os
import socket
import struct
import weakref
from .i18n import _
from .pycompat import getattr
from . import (
bundle2,
error,
httpconnection,
pycompat,
statichttprepo,
url as urlmod,
util,
wireprotoframing,
wire... | {
"content_hash": "0b27991ac360fc5cb65b8940fc670ef2",
"timestamp": "",
"source": "github",
"line_count": 1114,
"max_line_length": 80,
"avg_line_length": 31.096947935368043,
"alnum_prop": 0.5777380058888055,
"repo_name": "mdaniel/intellij-community",
"id": "9a176146a4d68d4b5b5e794e6642fe96abb94722",
... |
db_url_dst = 'postgresql://aagusti:a@localhost/gaji_pns'
| {
"content_hash": "af942736a918c14e50ce74411a66d9d0",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 56,
"avg_line_length": 57,
"alnum_prop": 0.7368421052631579,
"repo_name": "aagusti/o-sipkd",
"id": "c65e95dd5b14fe32583291b0648ed001ca7e5464",
"size": "57",
"binary": fals... |
import sys
import os
# mask BFD warnings: https://bugs.launchpad.net/tarantool/+bug/1018356
sys.stdout.push_filter("unable to read unknown load command 0x2\d+", "")
server.test_option("--help")
server.test_option("-h")
sys.stdout.push_filter("(/\S+)+/tarantool", "tarantool")
server.test_option("-Z")
server.test_option... | {
"content_hash": "bbd16f203a2cc0c31b85812a37069de9",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 83,
"avg_line_length": 39.28,
"alnum_prop": 0.6802443991853361,
"repo_name": "mejedi/tarantool",
"id": "e5fd0d641e5ccc861c9319dc9020e073a9f271a1",
"size": "982",
"binary"... |
""" Class definition for the VIC model interface
.. module:: vic
:synopsis: Definition of the VIC model class
.. moduleauthor:: Kostas Andreadis <[email protected]>
"""
from __future__ import division
import output as vicoutput
from osgeo import ogr, gdal, osr
import decimal
import sys
import subprocess
impo... | {
"content_hash": "33379cce1bb45d045b7e06e99272d5f6",
"timestamp": "",
"source": "github",
"line_count": 601,
"max_line_length": 329,
"avg_line_length": 48.287853577371045,
"alnum_prop": 0.5568381516832639,
"repo_name": "nasa/RHEAS",
"id": "9ce40ebf9c7c69561d0658df2ccb2b777bf91524",
"size": "29021",... |
"""
Load datasets from the internet.
**CRUST2.0**
Load and convert the `CRUST2.0 global crustal model
<http://igppweb.ucsd.edu/~gabi/rem.html>`_ (Bassin et al., 2000).
* :func:`~fatiando.datasets.fetch_crust2`: Download the .tar.gz archive with
the model from the website
* :func:`~fatiando.datasets.crust2_to_tesse... | {
"content_hash": "7093db04e95a4ea257c8852789cf098b",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 78,
"avg_line_length": 31.421965317919074,
"alnum_prop": 0.6219646799116998,
"repo_name": "eusoubrasileiro/fatiando",
"id": "a1341c16fbdb69af1052b616ee92aec634debdb3",
"si... |
import mock
from heat.common import exception
from heat.common import template_format
from heat.engine import resource
from heat.engine import resources
from heat.engine.resources.openstack.heat import cloud_watch
from heat.engine import scheduler
from heat.engine import watchrule
from heat.tests import common
from he... | {
"content_hash": "96b56ceb2894f60d03f31651fb0abe09",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 78,
"avg_line_length": 35.80582524271845,
"alnum_prop": 0.6502169197396963,
"repo_name": "takeshineshiro/heat",
"id": "875c0aaff7af35e66b48848c3a6aaf4ca0ae1c10",
"size": "... |
from pymongo import MongoClient
import pandas as pd
path = '.'
consensus_level = 0.50
if consensus_level == 0.:
suffix = '_full'
else:
suffix = ''
def load_data():
client = MongoClient('localhost', 27017)
db = client['radio']
catalog = db['catalog']
return catalog
def run_static(cat... | {
"content_hash": "8eca76835b98f1ecf717d23cf3b5ecfd",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 263,
"avg_line_length": 37.156716417910445,
"alnum_prop": 0.5792327776661981,
"repo_name": "willettk/rgz-analysis",
"id": "96f08004e5d6598c082b85c18fc81021bab1c72c",
"size... |
"""
Command line tool to export
DEPRECATED
"""
import re, StringIO
from optparse import OptionValueError, make_option
from django.conf import settings
from django.core.cache import cache
from django.core.management.base import CommandError, BaseCommand
from sveedocuments.models import Page, Insert
class Command(Ba... | {
"content_hash": "4812bcc27e5575f57290ca6beef3e323",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 236,
"avg_line_length": 46.61931818181818,
"alnum_prop": 0.5674588665447897,
"repo_name": "sveetch/sveedocuments",
"id": "4a68886a47b580cd481ce54b12611f18fcf3fe9c",
"size"... |
import radio
from microbit import *
radio.config(group=0)
radio.on()
while True:
message = radio.receive()
if message:
display.show(Image.HAPPY)
sleep(100)
display.scroll(message)
| {
"content_hash": "5b903a094edb5a315b89dadb46dc3e5a",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 33,
"avg_line_length": 15.428571428571429,
"alnum_prop": 0.6435185185185185,
"repo_name": "romilly/pi-towers-workshop",
"id": "7f27e1bc0440975779dd3a4cc27d0277f0ebf002",
"s... |
""" Tools for feature selection.
"""
from collections import OrderedDict
from numpy import sort
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.feature_selection import RFE
from sklearn.svm import LinearSVC
from sklearn.cluster import KMeans
from unstyle.features.featregister import featregistry
# TODO... | {
"content_hash": "d1a7001b69ff5fb06f477bd878505d5f",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 80,
"avg_line_length": 37.980582524271846,
"alnum_prop": 0.6988752556237219,
"repo_name": "pagea/unstyle",
"id": "d54adbda3a8b56d0014e0034679580260c1a0fbe",
"size": "3929"... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_bolle_bol_calf.iff"
result.attribute_template_id = 9
result.stfName("monster_name","bolle_bol")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "8120fedc5383bf85a9f5ba7d105252d6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 60,
"avg_line_length": 22.46153846153846,
"alnum_prop": 0.6883561643835616,
"repo_name": "anhstudios/swganh",
"id": "36e5cf2b6078db5b67429b02b592636fab832fb5",
"size": "437... |
from __future__ import absolute_import, division, print_function
import six
import logging
logger = logging.getLogger(__name__)
try:
from .net_cdf_io import load_netCDF
except ImportError:
def load_netCDF(*args, **kwargs):
# Die at call time so as not to ruin entire io package.
raise ImportErr... | {
"content_hash": "d230de0114be82bb3ac139b50dd6f8d7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 73,
"avg_line_length": 27.12,
"alnum_prop": 0.7109144542772862,
"repo_name": "licode/scikit-beam",
"id": "ea980d79eca0d1d85a321621b5844b2be4a3df56",
"size": "3160",
"bina... |
from app import db
tag_table = db.Table('post_tags',
db.Column('post_id', db.Integer, db.ForeignKey('post.id')),
db.Column('tag_id', db.Integer, db.ForeignKey('tag.id'))
)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
full_name = db.Column(db.String(50))
username = db.Column(d... | {
"content_hash": "cc3c19e7b788ef140a4998b011b7f67f",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 101,
"avg_line_length": 34.66265060240964,
"alnum_prop": 0.6124435175530066,
"repo_name": "femmerling/nembok",
"id": "1526775c0eba7c6d4a66656f2eb1a63617ca0671",
"size": "28... |
"""
The most suitable default reactor for the current platform.
Depending on a specific application's needs, some other reactor may in
fact be better.
"""
from __future__ import division, absolute_import
__all__ = ["install"]
from twisted.python.runtime import platform
def _getInstallFunction(plat... | {
"content_hash": "d1ec46eff4fde496c6b374d3fb5686e5",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 80,
"avg_line_length": 35.094339622641506,
"alnum_prop": 0.6634408602150538,
"repo_name": "hlzz/dotfiles",
"id": "f1743b9ca10d62963ffbbca99a9dc341d644e688",
"size": "1996",... |
from sqlalchemy.testing import assert_raises
import sqlalchemy as sa
from sqlalchemy import testing
from sqlalchemy import Integer, Text
from sqlalchemy.sql.sqltypes import ARRAY, JSON
from sqlalchemy.testing.schema import Column
from sqlalchemy.orm import Session
from sqlalchemy.testing import fixtures
from sqlalchemy... | {
"content_hash": "70f3dd27c123b5d41ff049791a043953",
"timestamp": "",
"source": "github",
"line_count": 374,
"max_line_length": 81,
"avg_line_length": 28.302139037433154,
"alnum_prop": 0.5250826641473784,
"repo_name": "robin900/sqlalchemy",
"id": "3df49cf86a9b6d391723ddb2223f38f56c31d8d8",
"size": ... |
from django.conf import settings
from openstack_dashboard import api
from django.contrib import messages
from openstackx.api import exceptions as api_exceptions
def tenants(request):
if not request.user or not request.user.is_authenticated():
return {}
try:
return {'tenants': api.token_list_t... | {
"content_hash": "499e38e5605ff5fcd4a5b313f295e073",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 31.347826086956523,
"alnum_prop": 0.6851595006934813,
"repo_name": "griddynamics/osc-robot-openstack-dashboard",
"id": "a21addf3eef053a5cb188bad77078ad... |
"""Creates a zip file that can be used by manual testers.
python chrome/test/mini_installer/create_zip.py
This will drop <OUTPUT_DIR>\mini_installer_tests.zip onto the disk.
To generate an easy-to-distribute package for manual testers add the current
and previous installers as mini_installer.exe and
previous_version_... | {
"content_hash": "104548bf85bc0df3ca2cb860ce58f0d1",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 80,
"avg_line_length": 40.478873239436616,
"alnum_prop": 0.674669450243563,
"repo_name": "endlessm/chromium-browser",
"id": "e6c7fae418320cd1d904472365881c3e3c2327ae",
"si... |
"""
streams module contains just a Stream class. Basically you want to use only
this class and nothing else from the module.
"""
###############################################################################
from .stream import Stream
| {
"content_hash": "e86f4c9637baa6376ef0cad2a7aaf6e7",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 79,
"avg_line_length": 24,
"alnum_prop": 0.5,
"repo_name": "9seconds/streams",
"id": "350422c156b59de8323c468448a3008b29d169f5",
"size": "264",
"binary": false,
"copies... |
"""
Actions with musical files
"""
import click
import lyricstagger.log as log
import lyricstagger.misc as misc
def tag(logger: log.CliLogger, filepath: str, overwrite: bool = False) -> None:
"""Try to tag lyrics for given file"""
audio = misc.get_audio(filepath)
data = misc.get_tags(audio)
# we cann... | {
"content_hash": "f93ee243bcd4ea0606e562b05c52e691",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 32.46835443037975,
"alnum_prop": 0.5883040935672514,
"repo_name": "abulimov/lyricstagger",
"id": "17d7124935daec339a6e9572a08fbc6be6c19731",
"size": ... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.ads.googleads.v12.enums",
marshal="google.ads.googleads.v12",
manifest={"NegativeGeoTargetTypeEnum",},
)
class NegativeGeoTargetTypeEnum(proto.Message):
r"""Container for enum describing possible negative geo target
types.... | {
"content_hash": "d8ac7fa0ff9539aed16c91e632114ba3",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 66,
"avg_line_length": 23.12,
"alnum_prop": 0.657439446366782,
"repo_name": "googleads/google-ads-python",
"id": "e3aa0d55722902e248ad3f9f9d43341c172f857c",
"size": "1178",... |
from . import web
from flask import (render_template,
abort, request, redirect,
url_for, flash, session)
from aslo.persistence.activity import Activity
from aslo.service import activity as activity_service
from flask_babel import gettext
@web.route('/', defaults={'page': 1})
@web... | {
"content_hash": "fa3095a538cca6c5d14e2960e3203a91",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 79,
"avg_line_length": 36.758620689655174,
"alnum_prop": 0.650093808630394,
"repo_name": "jatindhankhar/aslo-v3",
"id": "6ce29253b102e80c796b0f310e8230e83d5f675c",
"size": ... |
import datetime
import time
import zlib
from nova import context
from nova.openstack.common import log as logging
from nova.openstack.common import timeutils
from nova.tests import fake_network
from nova.tests.integrated.api import client
from nova.tests.integrated import integrated_helpers
import nova.virt.fake
LOG... | {
"content_hash": "0af78aaaf82ea1698ae2c4a7cb21f977",
"timestamp": "",
"source": "github",
"line_count": 472,
"max_line_length": 79,
"avg_line_length": 37.82203389830509,
"alnum_prop": 0.6185861528120099,
"repo_name": "plumgrid/plumgrid-nova",
"id": "ff20eccc1c72820c40e06d77bfa00fd51b374de9",
"size"... |
from __future__ import absolute_import, unicode_literals
from wechatpy.client.api.base import BaseWeChatAPI
class MerchantStock(BaseWeChatAPI):
def add(self, product_id, quantity, sku_info=''):
return self._post(
'merchant/stock/add',
data={
'product_id': product_i... | {
"content_hash": "a429d88e7cb8ec01c826736b5ab7d38e",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 56,
"avg_line_length": 28.16,
"alnum_prop": 0.5085227272727273,
"repo_name": "mruse/wechatpy",
"id": "bfe09de6cb48201c65422eb10319d9faf0d8ed95",
"size": "728",
"binary": ... |
from __future__ import annotations
import contextlib
import copy
import weakref
from collections.abc import Callable, Iterable, Sequence
from dataclasses import dataclass
import os
import pprint
import textwrap
from typing import Any, Optional, TextIO, Union
import ruamel.yaml
from mitmproxy import exceptions
from mi... | {
"content_hash": "abaa9be1f563fe15c85089bfb3ab6a7e",
"timestamp": "",
"source": "github",
"line_count": 610,
"max_line_length": 105,
"avg_line_length": 32.19016393442623,
"alnum_prop": 0.5495518435526584,
"repo_name": "mhils/mitmproxy",
"id": "033819be7c4608eb8017d37862060401cbe5dfff",
"size": "196... |
from pprint import pprint
from datetime import datetime, date
from itertools import product
from django import forms
from django.db.models import Exists, OuterRef
from django.contrib.auth.mixins import LoginRequiredMixin
from fo2.connections import db_cursor_so
from base.views import O2BaseGetPostView
from geral.fun... | {
"content_hash": "eb4d29f1437f9ff08fc8a94f88d05c67",
"timestamp": "",
"source": "github",
"line_count": 576,
"max_line_length": 79,
"avg_line_length": 38.43402777777778,
"alnum_prop": 0.4607462282048966,
"repo_name": "anselmobd/fo2",
"id": "b89070a57c9fac3c8e3ad8bb64e7e883e5cec3c4",
"size": "22148"... |
from django.conf.urls import patterns, url
from django.views.generic.base import RedirectView
from pages import views
urlpatterns = patterns('',
url(r'^favicon\.ico/$', RedirectView.as_view(url='/static/favicon.ico')),
url(r'^robots.txt$', views.robots, name='robots'),
url(r'^(?P<url>.*)/$', views.handl... | {
"content_hash": "7e88cfb4a5363be6bfa22344912f9275",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 77,
"avg_line_length": 25.733333333333334,
"alnum_prop": 0.6606217616580311,
"repo_name": "rsomji/crawlbin",
"id": "5ddd401ff28a19ed650a0f022982ee8e198b7a64",
"size": "386"... |
import unittest
from gcc_facade import\
GCCFacade
#
# TestGCCFacade
#
class TestGCCFacade( unittest.TestCase ):
def test_negative( self ):
gccFacade = GCCFacade()
self.assertRaises( Exception, gccFacade.parseLine, "line" )
self.assertRaises( Exception, gccFacade.parseLine, ". " )
... | {
"content_hash": "074e487b82e9e66c2aa0f9442a2fd49e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 85,
"avg_line_length": 28.03448275862069,
"alnum_prop": 0.6137761377613776,
"repo_name": "wo3kie/pchGenerator",
"id": "36336d32fe91ae22925e136f06c11b587de19535",
"size": "8... |
"""Tests for the ChooseFastestBranchDataset serialization."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.data.experimental.kernel_tests.serialization import dataset_serialization_test_base
from tensorflow.python.data.experimental.... | {
"content_hash": "90063de47c2d1d9af5e07cccaf094a82",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 106,
"avg_line_length": 32.46666666666667,
"alnum_prop": 0.6978097193702943,
"repo_name": "ghchinoy/tensorflow",
"id": "eaedcae421014ab52a2c56740e91c669594c579a",
"size": "... |
'''
Harvester for the New Prairie Press for the SHARE project
Example API call: http://newprairiepress.org/do/oai/?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class Npp_ksuHarvester(OAIHarvester):
short_name = 'npp_ksu'
long_name = ... | {
"content_hash": "848f6aef9f4b20ebd10ec2407d36ecf2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 91,
"avg_line_length": 31.833333333333332,
"alnum_prop": 0.7155322862129145,
"repo_name": "CenterForOpenScience/scrapi",
"id": "b7b5ea83a47ff296bdafcc0abdd3022f1a53829d",
"... |
import hashlib
import binascii
import evernote.edam.userstore.constants as UserStoreConstants
from evernote.edam.notestore.ttypes import NoteFilter
import evernote.edam.type.ttypes as Types
from evernote.api.client import EvernoteClient
# Sandbox: https://sandbox.evernote.com/api/DeveloperToken.action
# Production: h... | {
"content_hash": "e430572ed87aa2c765e31c36b8d573dd",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 156,
"avg_line_length": 28.821052631578947,
"alnum_prop": 0.7176771365960555,
"repo_name": "Doingcast/bizmem",
"id": "8d313f229dbdb048f59337c3e905e8450a5140fc",
"size": "27... |
import os
import distutils.core
import sqlite3
import jam
from base64 import b64encode
project_dir = os.getcwd()
jam_project_dir = os.path.join(os.path.dirname(jam.__file__), 'project')
distutils.dir_util.copy_tree(jam_project_dir, project_dir, preserve_mode=0)
os.chmod(os.path.join(project_dir, 'server.py'), 0o777)
... | {
"content_hash": "a1142ef217bc91fa1d418c4222a0e80c",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 80,
"avg_line_length": 35.074074074074076,
"alnum_prop": 0.7032734952481521,
"repo_name": "jam-py/jam-py",
"id": "d5fc6b431374ebfcccdd5911de9f004345ee8d96",
"size": "994",
... |
from __future__ import print_function
from optparse import OptionParser
import os.path
import re
import sys
parser = OptionParser()
opts, args = parser.parse_args()
if not len(args):
parser.error('not enough arguments')
elif len(args) > 1:
parser.error('too many arguments')
DEST_PATTERN = r'\g<1>%s\g<3>' % args[... | {
"content_hash": "810399a994ef2ad8c3a49a04526af8fa",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 31.022222222222222,
"alnum_prop": 0.6160458452722063,
"repo_name": "joshuawilson/merrit",
"id": "9f03a5972a9175e1633fa180ad3fa263621963f9",
"size": "... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 30, transform = "Logit", sigma = 0.0, exog_count = 20, ar_order = 0); | {
"content_hash": "aeac5c24065a74b46c8a1c90e8531f6c",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 166,
"avg_line_length": 38,
"alnum_prop": 0.706766917293233,
"repo_name": "antoinecarme/pyaf",
"id": "6f7989d37ca40fa202fa18cb114ffc3cab0f7586",
"size": "266",
"binary": f... |
"""
This modules defines de principal constants used during OMiSCID runtime
"""
import os
import xsd
import logging
logger = logging.getLogger(__name__)
OMISCID_DOMAIN = os.environ.get("OMISCID_WORKING_DOMAIN", "_bip._tcp")
if not OMISCID_DOMAIN.startswith("_bip"):
if logger.isEnabledFor(logging.WARNING):
... | {
"content_hash": "a8ae91a010704f5c5919c6840756adc6",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 101,
"avg_line_length": 23.65714285714286,
"alnum_prop": 0.712157809983897,
"repo_name": "AmibisLabs/amibis-py",
"id": "b6ea7ba6f10046851048a2a63e6b4d4a64598322",
"size": ... |
"""ORCHSET Dataset Loader
.. admonition:: Dataset Info
:class: dropdown
Orchset is intended to be used as a dataset for the development and
evaluation of melody extraction algorithms. This collection contains
64 audio excerpts focused on symphonic music with their corresponding
annotation of the m... | {
"content_hash": "e67314f46004164b492785ad91183eb2",
"timestamp": "",
"source": "github",
"line_count": 343,
"max_line_length": 118,
"avg_line_length": 29.93586005830904,
"alnum_prop": 0.5974873393065836,
"repo_name": "mir-dataset-loaders/mirdata",
"id": "8bfeab17867c3a8f0796a0288db581d474174287",
... |
from argparse import ArgumentParser
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import warnings
import django
from django import contrib
from django.apps import apps
from django.conf import settings
from django.db import connection
from django.test import TransactionTestCase, Te... | {
"content_hash": "2c49bae284a176200291c52c36391906",
"timestamp": "",
"source": "github",
"line_count": 427,
"max_line_length": 100,
"avg_line_length": 37.8056206088993,
"alnum_prop": 0.6331536889054079,
"repo_name": "runekaagaard/django-contrib-locking",
"id": "f3ec6407c9f60f7ed9c2e0b1448190ae6e1730... |
from niprov.dependencies import Dependencies
def inspect(location, dependencies=Dependencies()):
fileFactory = dependencies.getFileFactory()
return fileFactory.locatedAt(location).inspect()
| {
"content_hash": "d593dd8c5291996ddbcc8a6d318a0f9e",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 52,
"avg_line_length": 25.25,
"alnum_prop": 0.7920792079207921,
"repo_name": "ilogue/niprov",
"id": "42874b5401f608a2439954c54b5cc4b2d895297e",
"size": "244",
"binary": fa... |
import re
from sfa.util.xrn import Xrn, get_authority
# temporary helper functions to use this module instead of namespace
def hostname_to_hrn (auth, login_base, hostname):
return PlXrn(auth=auth+'.'+login_base,hostname=hostname).get_hrn()
def hostname_to_urn(auth, login_base, hostname):
return PlXrn(auth=auth... | {
"content_hash": "aee023f7c60cf82ff114061bbdd54da8",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 104,
"avg_line_length": 35.37864077669903,
"alnum_prop": 0.5826015367727772,
"repo_name": "onelab-eu/sfa",
"id": "1b0e47455ced61f983b1992647be2ac79aea3a03",
"size": "3682"... |
from objects.resources.ConfigReader import ConfigReader
class GameScreenLocalization(ConfigReader):
def __init__(self, config, section_name):
ConfigReader.__init__(self, config, section_name)
@property
def fuel_label(self):
return self.get_config_property('play_screen_fuel')
@propert... | {
"content_hash": "200626f9ce97691903f8a3665c5bc837",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 61,
"avg_line_length": 29.428571428571427,
"alnum_prop": 0.6990291262135923,
"repo_name": "Superzer0/pyRiverRaid",
"id": "d0af21de9a5cc8c09eef47250ea77a3a59830e95",
"size":... |
from protocols.forms import forms
from core.utils import VESSELS
class GrowForm(forms.VerbForm):
name = "Grow"
slug = "grow"
edit_to_what = forms.CharField(required = False, help_text = 'sample, mastermix, tube, etc')
duration = forms.IntegerField(help_text='this is the minimal time this should tak... | {
"content_hash": "76260adfa91114fe525291952a6e1373",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 105,
"avg_line_length": 43.785714285714285,
"alnum_prop": 0.7096247960848288,
"repo_name": "Bionetbook/bionetbook",
"id": "7431b4e4bc942227e1d29afcb6847599917a84fb",
"size"... |
"""
Pythonifier for IntOpticDiag Table/View
"""
from jnpr.junos.factory import loadyaml
from os.path import splitext
_YAML_ = splitext(__file__)[0] + '.yml'
globals().update(loadyaml(_YAML_))
| {
"content_hash": "a9fa0da85a7de018c5b77021c17af652",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 39,
"avg_line_length": 27.428571428571427,
"alnum_prop": 0.71875,
"repo_name": "mith1979/ansible_automation",
"id": "a61c9bcc60308596a156a14d1802b97b5f5f3b5d",
"size": "192"... |
"""Application configuration."""
import os
class Config(object):
"""Base configuration."""
SECRET_KEY = os.environ.get('PP_CALCULATOR_SECRET', 'secret-key') # TODO: Change me
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, o... | {
"content_hash": "36ba5ede0375deba6508464b4250b3ea",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 101,
"avg_line_length": 28.651162790697676,
"alnum_prop": 0.6566558441558441,
"repo_name": "oanise93/purchasing-power-calculator",
"id": "ee17b7100a33f0deee43f2495b8d90cda6ca... |
"""
Example showing use of unicode and UTF-8 encoding.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
import pygraphviz as pgv
# specify UTF-8 encoding (it is the default)
A=pgv.AGraph(encoding='UTF-8')
# nodes,... | {
"content_hash": "bd64b82ac212cae89dc0908635559b96",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 81,
"avg_line_length": 25.705882352941178,
"alnum_prop": 0.7311212814645309,
"repo_name": "vagdevik/SE2017",
"id": "604bd80008dcaba92655769e982de9e6dd592355",
"size": "954"... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('skaba', '0011_auto_20160831_1516'),
]
operations = [
migrations.CreateModel(
name='Guildpoints',
... | {
"content_hash": "b18a2f7982c9ee68119f3a7def7dd64a",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 131,
"avg_line_length": 30.636363636363637,
"alnum_prop": 0.6038575667655787,
"repo_name": "Jonneitapuro/isoskaba2",
"id": "efaf3e10b66773f330625e5f7f0b41f0f031148f",
"size... |
import re
import os
import sys
import types
from copy import copy
from distutils.ccompiler import *
from distutils import ccompiler
from distutils.errors import DistutilsExecError, DistutilsModuleError, \
DistutilsPlatformError
from distutils.sysconfig import customize_compiler
from distut... | {
"content_hash": "a5b59f7b878a976a761595f759960e18",
"timestamp": "",
"source": "github",
"line_count": 658,
"max_line_length": 97,
"avg_line_length": 34.610942249240125,
"alnum_prop": 0.5891367348731009,
"repo_name": "Ademan/NumPy-GSoC",
"id": "0889d11a035a81a899a358abfb83d88b73219e65",
"size": "2... |
import re
from setuptools import setup, Command
import subprocess
def read_module_contents():
with open('src/skynetd/__init__.py') as skynet_init:
return skynet_init.read()
module_file = read_module_contents()
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", module_file))
class BumpCommand(Co... | {
"content_hash": "d3c59ea1911b7db46a35b200dd4ad376",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 76,
"avg_line_length": 29.134328358208954,
"alnum_prop": 0.5717213114754098,
"repo_name": "skyrings/skynet",
"id": "ed25561f7e309b595d4fb18752c2f9d7180c8ca2",
"size": "448... |
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kubevirt
fr... | {
"content_hash": "487deb6b3909be645277916c4f82c721",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 102,
"avg_line_length": 24.19047619047619,
"alnum_prop": 0.7165354330708661,
"repo_name": "kubevirt/client-python",
"id": "040c7bc209c8d8ba946f7b46751b7d32cb5b1410",
"size"... |
import os
from robot import utils
from robot.errors import DataError, FrameworkError
from robot.output import LOGGER, loggerhelper
class _BaseSettings(object):
_cli_opts = {'Name' : ('name', None),
'Doc' : ('doc', None),
'Metadata' : ('metadata',... | {
"content_hash": "ad21056d9abb8cce15819a608ee4faea",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 84,
"avg_line_length": 39.57065217391305,
"alnum_prop": 0.5190907842329351,
"repo_name": "Senseg/robotframework",
"id": "3c79ffe393431bc4f73841e6e5c192c3456a34ce",
"size":... |
import re
import os
from PyQt5.QtWidgets import QLabel, QDoubleSpinBox, QHBoxLayout, QVBoxLayout, QDialog, QTabWidget, QWidget, \
QCheckBox, QStatusBar, QHeaderView, QTableWidgetItem, QSpinBox, QLineEdit, QComboBox, QCompleter, QPlainTextEdit
from PyQt5.QtCore import QTimer, Qt
from logging import getLogger
import ... | {
"content_hash": "25771ac1c9c67af33a1f998d81f58bd6",
"timestamp": "",
"source": "github",
"line_count": 568,
"max_line_length": 120,
"avg_line_length": 38.434859154929576,
"alnum_prop": 0.5848563968668408,
"repo_name": "UAVCAN/gui_tool",
"id": "b0de2250303d71391ca04002958b016551b102fd",
"size": "22... |
"""
Copyright 2012 GroupDocs.
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 in w... | {
"content_hash": "936f0164240aaa394930db09643b4279",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 77,
"avg_line_length": 29.903225806451612,
"alnum_prop": 0.686084142394822,
"repo_name": "liosha2007/temporary-groupdocs-python3-sdk",
"id": "eadb833bd421b949829ac043ae88b5f7... |
import imp
import re
from glob import glob
test_types = {}
test_type_folders = glob("/FrameworkBenchmarks/toolset/test_types/*/")
# Loads all the test_types from the folders in this directory
for folder in test_type_folders:
# regex that grabs the characters between "toolset/test_types/"
# and the final "/" ... | {
"content_hash": "efa2069207704387a50bb5c75da7ba79",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 81,
"avg_line_length": 37.06666666666667,
"alnum_prop": 0.6888489208633094,
"repo_name": "martin-g/FrameworkBenchmarks",
"id": "2670a3d309d2909acaf0e004bc41e78fd864db32",
"... |
import argparse
import glob
import json
import logging
import os
import re
import time
import tweepy
from . import FMK, classify_user, user_url
log = logging.getLogger(__name__)
DEFAULT_BLOCK_TIMEOUT = 120
def add_user_args(parser):
g = parser.add_mutually_exclusive_group(required=True)
g.add_argument('-... | {
"content_hash": "649dde3be94566ce23a1c11d766227e7",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 91,
"avg_line_length": 35.66538461538462,
"alnum_prop": 0.5781300549983824,
"repo_name": "wjt/fewerror",
"id": "7392fccff7f00f6ac204e3a2d76da03190fedc12",
"size": "9291",
... |
from django.test import TestCase
from django.contrib.auth.models import User
from models import *
import random
import datetime
from decimal import *
alphabet = [chr(i) for i in range(97,123)]
def random_name():
return ''.join([random.choice(alphabet) for i in range (10)])
def random_date():
random_second = rando... | {
"content_hash": "586a5cc376bfccf38a40626a2e3fbf97",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 89,
"avg_line_length": 32.15909090909091,
"alnum_prop": 0.6975265017667844,
"repo_name": "RedwoodAdmin/RedwoodFramework",
"id": "894dece864be8f97d7ab4e4f2127a2dbe420b732",
... |
import yaml
import sys
from .dom_case import DomCase
class DomCaseHandler(object):
def __init__(self, case_file, config):
self._api_cases = []
self._case_file = case_file
self._config = config
def load_cases(self):
# todo 代码重复,优化
try:
with open(self._case_... | {
"content_hash": "2af8ecb2dbb66d5bfe2cbff433a25a32",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 71,
"avg_line_length": 27.434782608695652,
"alnum_prop": 0.5625990491283677,
"repo_name": "LoveOrange/paradise",
"id": "14389f7e791619b5000067354b567d7d7da3267a",
"size": "... |
import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="token", parent_name="funnel.stream", **kwargs):
super(TokenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "43220bf97f1fc49f06b41dc1716e1720",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 83,
"avg_line_length": 38.5,
"alnum_prop": 0.5918367346938775,
"repo_name": "plotly/python-api",
"id": "bbe051cf089f517d6b91c75bd5699855d7dd5ec6",
"size": "539",
"binary"... |
import mock
from st2common.constants.action import LIVEACTION_STATUS_SUCCEEDED
from st2common.services import action as action_service
from st2tests.fixturesloader import FixturesLoader
from tests import FunctionalTest
FIXTURES_PACK = 'aliases'
TEST_MODELS = {
'aliases': ['alias1.yaml', 'alias2.yaml'],
'acti... | {
"content_hash": "bd81886c6792b040ca6e580853e10ef9",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 86,
"avg_line_length": 41.90909090909091,
"alnum_prop": 0.6349550666253486,
"repo_name": "alfasin/st2",
"id": "94fa8d44a64194c360c2984d66750f8ce48643d4",
"size": "4007",
... |
from __future__ import unicode_literals
import json
from django.test import SimpleTestCase
from django.utils import six, text
from django.utils.functional import lazystr
from django.utils.text import format_lazy
from django.utils.translation import override, ugettext_lazy
IS_WIDE_BUILD = (len('\U0001F4A9') == 1)
c... | {
"content_hash": "2355e605f1408edfd6627e15c3c9fb97",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 116,
"avg_line_length": 46.471774193548384,
"alnum_prop": 0.5642516268980478,
"repo_name": "Leila20/django",
"id": "1ce993bdb2b45d3b0f397e0f7795091e8557b517",
"size": "115... |
"""Unittest for the base checker."""
import re
import sys
import unittest
import astroid
from pylint.checkers import base
from pylint.testutils import CheckerTestCase, Message, set_config
class TestDocstring(CheckerTestCase):
CHECKER_CLASS = base.DocStringChecker
def test_missing_docstring_module(self):
... | {
"content_hash": "5733d1fb3de52f252e8bfe7c4baecf65",
"timestamp": "",
"source": "github",
"line_count": 454,
"max_line_length": 98,
"avg_line_length": 37.8215859030837,
"alnum_prop": 0.5531419253392348,
"repo_name": "lucidmotifs/auto-aoc",
"id": "cd3d5cf7af7ff4e9e821ed24c3974bd588bf6b8f",
"size": "... |
"""distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: ccompiler.py,v 1.61 2004/11/10 22:23:13 loewis Exp $"
import sys, os, re
from types import *
fro... | {
"content_hash": "afec5795158fb22a671a4d33f5f62354",
"timestamp": "",
"source": "github",
"line_count": 1270,
"max_line_length": 86,
"avg_line_length": 41.04015748031496,
"alnum_prop": 0.5898006561654612,
"repo_name": "MalloyPower/parsing-python",
"id": "2194501901f60c9b4f2d059a9bc31ad8bd55df9a",
"... |
"""Google Cloud Pipeline Dataproc Batch components."""
import os
try:
from kfp.v2.components import load_component_from_file
except ImportError:
from kfp.components import load_component_from_file
__all__ = [
'DataprocPySparkBatchOp',
'DataprocSparkBatchOp',
'DataprocSparkRBatchOp',
'DataprocSpar... | {
"content_hash": "8c8c70de192bf0fb5aa72f593d63ee1d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 89,
"avg_line_length": 33.074074074074076,
"alnum_prop": 0.7267637178051511,
"repo_name": "kubeflow/pipelines",
"id": "26d2436887a5fd0f160f29f7119d8e9ce9c24494",
"size": "1... |
import os
from contextlib import contextmanager
from storlets.gateway.common.exceptions import StorletLoggerError
class StorletLogger(object):
def __init__(self, path):
self.log_path = path
self._file = None
def open(self):
if self._file is not None:
raise StorletLoggerErr... | {
"content_hash": "aa0248976afdb7a87e4217cb8d2da299",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 69,
"avg_line_length": 24.862745098039216,
"alnum_prop": 0.555993690851735,
"repo_name": "openstack/storlets",
"id": "3450ec80db89395b9988dbdf4004a6b0721935ed",
"size": "19... |
"""wsgi implement behaviour that provides service control as wsgi
middleware.
It provides the :class:`Middleware`, which is a WSGI middleware implementation
that wraps another WSGI application to uses a provided
:class:`endpoints_management.control.client.Client` to provide service control.
"""
# pylint: disable=too-... | {
"content_hash": "7ede4e3ac79feb02852a91009c3352f6",
"timestamp": "",
"source": "github",
"line_count": 686,
"max_line_length": 98,
"avg_line_length": 38.74052478134111,
"alnum_prop": 0.6231562311860325,
"repo_name": "nparley/mylatitude",
"id": "479ca68f237f13a39ffc35f6515f24bcd6b6dc58",
"size": "2... |
"""
Collect icmp round trip times
Only valid for ipv4 hosts currently
#### Dependencies
* ping
#### Configuration
Configuration is done by:
Create a file named: PingCollector.conf in the collectors_config_path
* enabled = true
* interval = 60
* target_1 = example.org
* target_fw = 192.168.0.1
* target_local... | {
"content_hash": "f5810201dd8cd316c1b67f0e17981598",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 80,
"avg_line_length": 27.72151898734177,
"alnum_prop": 0.5616438356164384,
"repo_name": "MichaelDoyle/Diamond",
"id": "8d28816db7b20937f37f33a546fb79473a6d5c80",
"size": "... |
"""Test asyncio support"""
# Copyright (c) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import os
import sys
import pytest
from pytest import mark
import zmq
from zmq.utils.strtypes import u
try:
import asyncio
import zmq.asyncio as zaio
from zmq.auth.asyncio import Asynci... | {
"content_hash": "f4f08ff53d52caa6dffc6bef74e30ab3",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 77,
"avg_line_length": 32.582352941176474,
"alnum_prop": 0.5350243726304387,
"repo_name": "nitin-cherian/LifeLongLearning",
"id": "195d534fc60020011803594ad0a781f53b3a5aec",... |
from oslo_policy import policy
from nova.policies import base
BASE_POLICY_NAME = 'os_compute_api:os-create-backup'
POLICY_ROOT = 'os_compute_api:os-create-backup:%s'
create_backup_policies = [
policy.RuleDefault(
name=POLICY_ROOT % 'discoverable',
check_str=base.RULE_ANY),
policy.RuleDefaul... | {
"content_hash": "5028b524c53cfb958b8e60b5a60e92fc",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 52,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.6857142857142857,
"repo_name": "alaski/nova",
"id": "539e0220e546a60ea3fd39ce441ee9e45a27b8d7",
"size": "1094",
... |
import simplejson as json
with open('packages.txt','r') as f:
lines = f.readlines()
items = []
current_item = {}
def parse_line(s):
return s.lstrip().rstrip("\n ").split("|")[::-1]
for i in range(len(lines)):
if lines[i].startswith(r"\item"):
current_item = {}
current_item['title'] = pa... | {
"content_hash": "0d04b20ee21794eb08e6bea3db07b33f",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 75,
"avg_line_length": 31.346153846153847,
"alnum_prop": 0.5852760736196319,
"repo_name": "benmaier/benmaier.github.io",
"id": "dbeef6f21b3893a9601b88df64c4c1756ff42950",
"... |
import datetime
import os
import requests
import sys
import time
import ConfigParser
OPTIONS = ['username', 'password', 'wowpath', 'interval']
UPLOAD_URI = 'https://www.wowthing.org/api/upload/'
def main():
# Make sure the config file exists
config_file = os.path.join(os.path.dirname(__file__), 'sync.conf')... | {
"content_hash": "4b60878c8084faa0363b507ee8040f37",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 97,
"avg_line_length": 28.597826086956523,
"alnum_prop": 0.6164956290383884,
"repo_name": "madcowfred/wowthing_pysync",
"id": "9ec99f259c0b22452edc1a54dca0c591610d2cd7",
"s... |
BOT_NAME = 'psicrawler'
SPIDER_MODULES = ['psicrawler.spiders']
# NEWSPIDER_MODULE = 'jobs.wikinews_en.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-agent
USER_AGENT = ' Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0'
# Obey robots.txt rules
ROBOTSTXT_OB... | {
"content_hash": "fb18ae84130a92892b7640928e15986c",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 109,
"avg_line_length": 35.063291139240505,
"alnum_prop": 0.7678700361010831,
"repo_name": "psiopic2/psicrawler",
"id": "0efe21867a739f1a02b6453af49e6a7a7804a492",
"size": ... |
from pypnm.dummy_numpy import DummyNumpy
try:
import numpy
except ImportError:
numpy = DummyNumpy
class InvalidFormat(BaseException): pass
class TemplateMode(object):
is_binary_input = False
pixcel_function = lambda self, i: 255 * i / self.max_pixel_value
data_bit_size = 8 # if binary mode
... | {
"content_hash": "7170ad2040787ec1bd0a48d14194c6f0",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 91,
"avg_line_length": 26.626436781609197,
"alnum_prop": 0.5240664796028491,
"repo_name": "cocuh/pypnm",
"id": "d410e130cb122e230b22aefd7b3c54632bcc9762",
"size": "4633",
... |
from twisted.python import log
from buildbot.process.buildstep import LoggingBuildStep
from buildbot.status.builder import SKIPPED, FAILURE
from buildbot.steps.slave import CompositeStepMixin
class Source(LoggingBuildStep, CompositeStepMixin):
"""This is a base class to generate a source tree in the buildslave.
... | {
"content_hash": "1ee0a98f18982dbe81e7a23f7d05bbd0",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 99,
"avg_line_length": 43.154205607476634,
"alnum_prop": 0.6120194910665945,
"repo_name": "denny820909/builder",
"id": "13da81c30d383dce7ad6fa675a87bc0d85ffffd7",
"size": ... |
"""Class implementing a multi-worker parameter server tf.distribute strategy."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
from tensorflow.python.distribute import cross_device_ops as cross_device_ops_lib
from tensorflow.python.distribut... | {
"content_hash": "201fc33d5580c7b53d9b64e34b8cf32a",
"timestamp": "",
"source": "github",
"line_count": 637,
"max_line_length": 103,
"avg_line_length": 40.50392464678179,
"alnum_prop": 0.6833843649470951,
"repo_name": "DavidNorman/tensorflow",
"id": "2d3800e4d8f2e33ccf6e18c9b4e2da8021f36bd5",
"size... |
import math
from builtins import range
from ase.data import vdw_radii
import numpy as np
__doc__ = """
Calculate the accessible-surface area of atoms.
Uses the simple Shrake-Rupley algorithm, that generates a
relatively uniform density of dots over every atoms and
eliminates those within the sphere of another atom. ... | {
"content_hash": "4bb15d9fa94132938345ee73d649d7c7",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 77,
"avg_line_length": 29.891666666666666,
"alnum_prop": 0.5818232506272651,
"repo_name": "CJ-Wright/pyIID",
"id": "7c0e09a29b271dadb5477e1ef5aacd1ddd7256a5",
"size": "358... |
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
distribution = Normal(4)
size = 10
myPlane = LHSExperiment(distribution, size)
print "myPlane = ", myPlane
sample, weights = myPlane.generateWithWeights()
print "sample = ", repr(sample)
print "weights = ", repr(weights... | {
"content_hash": "3dbdbbe37a8d9869d986d60ab8197a14",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 63,
"avg_line_length": 25.5625,
"alnum_prop": 0.684596577017115,
"repo_name": "sofianehaddad/ot-svn",
"id": "138a3eb2a79a7367138455744777c2435d523171",
"size": "433",
"bi... |
"""Top level component of a sandbox.
A sandlet is an abstraction to be used by applications to organize a sandbox
into discrete groupings. A user can start an entire sandbox, which will start
all sandlets, or selectively choose which ones to start.
Sandlets are made up of components, which are the actual subprocesses... | {
"content_hash": "d3e0410bb783558d6c5938b5d4e3cbe9",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 77,
"avg_line_length": 27.033557046979865,
"alnum_prop": 0.6884309831181727,
"repo_name": "theskyinflames/bpulse-go-client",
"id": "02f932e8a5aa4c2b9ba4fbbb596146be53815140"... |
"""
Tests for pbcopy/pbpaste commands.
"""
import os
import tempfile
from io import open
from stash.tests.stashtest import StashTestCase
class CopyPasteTests(StashTestCase):
"""
Test class for the 'pbcopy' and 'pbpaste' commands.
"""
def test_pbcopy_help(self):
"""
test 'pbcopy --hel... | {
"content_hash": "ac6d705bc864db72a41e49a43330e145",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 78,
"avg_line_length": 33.567567567567565,
"alnum_prop": 0.5744766505636071,
"repo_name": "ywangd/stash",
"id": "21416eaa9515a70f3977ae9c70e2b7b546f78fa9",
"size": "2484",
... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/base/shared_poi_all_lair_insecthill_large_evil_fire_red.iff"
result.attribute_template_id = -1
result.stfName("lair_n","insecthill")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
retu... | {
"content_hash": "1145800158f57658b749699394b30802",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 101,
"avg_line_length": 25.307692307692307,
"alnum_prop": 0.7021276595744681,
"repo_name": "obi-two/Rebelion",
"id": "6aa8440f29e3f8f190102a7491f89a49a28e31ee",
"size": "47... |
__author__ = 'RongShun'
from django import forms
from django.db import models
from django.forms import ModelForm
from lib.common.commands.adb import Adb
from lib.common.constant import SCRIPTED_PROFILE_INTERACTION, RANDOM_INTERACTION
from lib.core.managers.session import get_current_device_serial
adb= Adb()
class Con... | {
"content_hash": "8b6eecbab591e69bff7070a44a228e9f",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 121,
"avg_line_length": 46.333333333333336,
"alnum_prop": 0.6027178257394085,
"repo_name": "WhySoGeeky/DroidPot",
"id": "125037af63b0119f5e1066cc3672042bddb0252f",
"size": ... |
import sys, os
sys.path.insert(0, os.path.abspath('..'))
settings_dir = os.path.dirname(__file__)
PROJECT_ROOT = os.path.abspath(os.path.dirname(settings_dir))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'E... | {
"content_hash": "939082bed21231727b83f389d85b32cf",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 127,
"avg_line_length": 34.04347826086956,
"alnum_prop": 0.6856413063309615,
"repo_name": "scdoshi/django-bits",
"id": "81d2c9177b6791611a4ac1108780c743a897b7fc",
"size": ... |
"""
Package: AutoItLibrary
Module: Loggger
Purpose: Defines a Logger class from which other classes can inherit the ability to log messages to
stdout. The Logger class' _log method does this in the style required by Robot Framework, but
this method could be overridden in the class that uses it ... | {
"content_hash": "62623e1f881d7533aecad414d8039406",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 110,
"avg_line_length": 38.24342105263158,
"alnum_prop": 0.531223120591777,
"repo_name": "zheli/robotframework-autoitlibrary-forked",
"id": "22d8c2ce4ec30357279eed73c90861d3... |
from distutils.core import setup
setup(name='gapmaps',
version='0.1',
description='ScienceDirect gapmap generator',
author='Fabian Latorre',
author_email='[email protected]',
url='',
packages=['gapmaps'],
)
| {
"content_hash": "5d2d869f670e2ade64a42b7fd4aee3e9",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 51,
"avg_line_length": 25.5,
"alnum_prop": 0.6313725490196078,
"repo_name": "latorrefabian/gapmaps",
"id": "61aa448a1518a78e728dde98a1fb8dbd2cd5fa07",
"size": "278",
"bin... |
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
impo... | {
"content_hash": "5abfd980e7a2ea13678754fd6f66b5e1",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 119,
"avg_line_length": 24.92105263157895,
"alnum_prop": 0.6990496304118268,
"repo_name": "mindbody/API-Examples",
"id": "2231436f3529e2479b1148cc5847553a3718e6d7",
"size":... |
from ._monitor_query_client import MonitorQueryClient
__all__ = ['MonitorQueryClient']
| {
"content_hash": "eceebd05ede45856493d5a5a92fcc402",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 53,
"avg_line_length": 43.5,
"alnum_prop": 0.7701149425287356,
"repo_name": "Azure/azure-sdk-for-python",
"id": "9682cfa946552b35eba88ea2c0e68a54b492b018",
"size": "555",
... |
import torch
import torchvision.datasets as datasets
import torchvision.transforms as transforms
import torch.utils.data as data_utils
import os, glob, platform, datetime, random
from PIL import Image
def default_loader(path):
return Image.open(path).convert('RGB')
def make_dataset(dir, phase, test_scene=None):
... | {
"content_hash": "4d633a351e2dced0ac7fa1f8deb34dd9",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 190,
"avg_line_length": 36.72631578947368,
"alnum_prop": 0.5614789337919175,
"repo_name": "albertxavier001/graduation-project",
"id": "4b00e7ea95054afb282d153cb849591f5c0dac0... |
from celery import Celery
from lib.settings import Settings
celery_client = Celery(broker=Settings.mongo_connection_string)
celery_client.conf.CELERY_TASK_SERIALIZER = "json"
#@celery_client.task(name='tasks.process_import')
def queue_vcf_import(file_id):
celery_client.send_task('tasks.process_import', [file_id]... | {
"content_hash": "5aa43202db37cc95004e5628b6e5ea94",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 81,
"avg_line_length": 34.1,
"alnum_prop": 0.7712609970674487,
"repo_name": "ClinGen/ildb",
"id": "aee09c9fb46ec11810d29bca3dcf321a4f463c1f",
"size": "341",
"binary": fal... |
"""
Textbox text highlighter.
Takes a string or regex expression as input.
All matches that are found, get highlighted.
Created by Jack Ackermann
"""
import re
import tkinter as tkinter
from tkinter import Tk, Frame, END, INSERT
class Highlighter(Frame):
"""
Class takes in3 arguments: regex... | {
"content_hash": "e6189e082b0802edf969a132adc29139",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 82,
"avg_line_length": 36.63636363636363,
"alnum_prop": 0.5194375516956162,
"repo_name": "HawkeyeZAR/PyRegexEvaluator",
"id": "be950cad6c0c98350c8e0c1b62efc8ea8066fd52",
"s... |
from msrest.serialization import Model
class WinRMListener(Model):
"""Describes Protocol and thumbprint of Windows Remote Management listener.
:param protocol: The Protocol used by the WinRM listener. Http and Https
are supported. Possible values include: 'Http', 'Https'
:type protocol: str or :clas... | {
"content_hash": "6801b32a897473969d7f74f08255c5cc",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 37.69565217391305,
"alnum_prop": 0.6828143021914648,
"repo_name": "v-iam/azure-sdk-for-python",
"id": "24294170c5930ffa52c27f49de15306ee3167cc8",
"si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.