text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import unicode_literals
import pytest
from django.core.exceptions import ImproperlyConfigured
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.files.uploadedfile import TemporaryUploadedFile
from django.utils.... | {
"content_hash": "bd0d4a7558954bd9f8b920bf9f18dd53",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 98,
"avg_line_length": 45.184615384615384,
"alnum_prop": 0.648280558392918,
"repo_name": "franga2000/django-machina",
"id": "2a4f7367f94953de35fe5e3d42c522bd77c27dd3",
"siz... |
"""Test code for the Face layer of RPC Framework."""
import abc
import contextlib
import itertools
import threading
import unittest
from concurrent import futures
# test_interfaces is referenced from specification in this module.
from grpc.framework.foundation import logging_pool
from grpc.framework.interfaces.face i... | {
"content_hash": "7d165e07d079307b9fb8bb19c5f652de",
"timestamp": "",
"source": "github",
"line_count": 445,
"max_line_length": 97,
"avg_line_length": 41.90112359550562,
"alnum_prop": 0.6819693231792342,
"repo_name": "msiedlarek/grpc",
"id": "1d36a931e8c1f1384c63a8a1c200a2c6efc990ee",
"size": "2018... |
import json
import os
from dotenv import load_dotenv, find_dotenv
import asyncio
from watson_developer_cloud import ConversationV1
from watson_developer_cloud import ToneAnalyzerV3
# import tone detection
import tone_detection
# load the .env file containing your environment variables for the required services (conv... | {
"content_hash": "7a7e49e5973972c190fa5a90796e8101",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 176,
"avg_line_length": 45.306666666666665,
"alnum_prop": 0.7775161859917599,
"repo_name": "jpmunic/udest",
"id": "2413e32f0995f3417b582447e0229ac8e4552dea",
"size": "3398"... |
from argparse import ArgumentParser
from typing import Any
from zerver.actions.realm_settings import do_scrub_realm
from zerver.lib.management import ZulipBaseCommand
class Command(ZulipBaseCommand):
help = """Script to scrub a deactivated realm."""
def add_arguments(self, parser: ArgumentParser) -> None:
... | {
"content_hash": "357568d463a4db94502e9237956fdb50",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 100,
"avg_line_length": 36.68181818181818,
"alnum_prop": 0.6716232961586122,
"repo_name": "rht/zulip",
"id": "5e7b130f709e2f92abb093544edf3eabd3f28626",
"size": "807",
"b... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.pr... | {
"content_hash": "d437d57d1e113c01941f484e6e667778",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 453,
"avg_line_length": 36.21008403361345,
"alnum_prop": 0.7375261081457415,
"repo_name": "shishaochen/TensorFlow-0.8-Win",
"id": "b1cda108700af5e5fda001a4af3a9ad313973d70",... |
from wagtail import __version__
from wagtail.utils.setup import assets, check_bdist_egg, sdist
try:
from setuptools import find_packages, setup
except ImportError:
from distutils.core import setup
# Hack to prevent "TypeError: 'NoneType' object is not callable" error
# in multiprocessing/util.py _exit_functi... | {
"content_hash": "313b6cf083a0d47e0efb093dc703e441",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 120,
"avg_line_length": 31.87878787878788,
"alnum_prop": 0.6138307984790875,
"repo_name": "zerolab/wagtail",
"id": "f583c74bcbc4bf59a35a8a35c2b54eba7c1f57ea",
"size": "423... |
AUTHFAILURE = 'AuthFailure'
# DryRun 操作,代表请求将会是成功的,只是多传了 DryRun 参数。
DRYRUNOPERATION = 'DryRunOperation'
# 操作失败。
FAILEDOPERATION = 'FailedOperation'
# CLS内部错误。
FAILEDOPERATION_CLSINTERNALERROR = 'FailedOperation.CLSInternalError'
# 内部错误。
INTERNALERROR = 'InternalError'
# 参数错误。
INVALIDPARAMETER = 'InvalidParameter'
... | {
"content_hash": "0f6bc5eb29f6889b0b6686d0319b63c6",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 83,
"avg_line_length": 19.262295081967213,
"alnum_prop": 0.7982978723404255,
"repo_name": "tzpBingo/github-trending",
"id": "1d8c4e107df8e108ad37e2bafaa995282b442d16",
"siz... |
AUTHOR = u'Adrian Sampson'
# -- General configuration -----------------------------------------------------
extensions = []
#templates_path = ['_templates']
exclude_patterns = ['_build']
source_suffix = '.rst'
master_doc = 'index'
project = u'beets'
copyright = u'2012, Adrian Sampson'
version = '1.2'
release = '1.... | {
"content_hash": "668b0a073b1289cb94127753b0da379c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 80,
"avg_line_length": 24.3,
"alnum_prop": 0.5164609053497943,
"repo_name": "jayme-github/beets",
"id": "81ae4e9e62801ba0894604730b1fe7d312292ea5",
"size": "972",
"binary... |
import httplib, urllib
class SensorActUploader(object):
def __init__(self, IP, PORT):
self.IP = IP
self.PORT = PORT
self.headers = { "Content-type": "application/json",
"Accept": "text/plain" }
def connect(self):
self.connection = httplib.HTTPConnection(s... | {
"content_hash": "f8a522c91b92cd834c7a3581fb84c231",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 95,
"avg_line_length": 30.82608695652174,
"alnum_prop": 0.5352609308885754,
"repo_name": "nesl/LabSense",
"id": "abd9db38cc1d9bb987c5eb1dd886fd4fef68c92e",
"size": "1418",
... |
import imp
import os
import os.path
#
# The following code will search and load waagent code and expose
# it as a submodule of current module
#
def searchWAAgent():
agentPath = '/usr/sbin/waagent'
if(os.path.isfile(agentPath)):
return agentPath
user_paths = os.environ['PYTHONPATH'].split(os.pathsep... | {
"content_hash": "1e542a4a011bc6f1f5ff3bd36e945310",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 65,
"avg_line_length": 27.782608695652176,
"alnum_prop": 0.6525821596244131,
"repo_name": "thomas1206/azure-linux-extensions",
"id": "7ae916d843d79adf942fef45dd8c098b662fd632... |
import json
import os.path
import pytest
import demistomock as demisto
@pytest.fixture()
def advisories_list():
from CheckPanosVersionAffected import Advisory
return [
Advisory(
data_type='CVE',
data_format='MITRE',
cve_id='CVE-2019-17440',
cve_date_pub... | {
"content_hash": "5df6cfa7c38bcb35da3ae0ec13ce196a",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 128,
"avg_line_length": 34.56842105263158,
"alnum_prop": 0.5636419001218027,
"repo_name": "demisto/content",
"id": "2048f5e8e2cf14314795478035f2d717eebffe8c",
"size": "3284... |
import os.path
import tempfile
from test_common import cache_root, cores_root, library_root
from fusesoc.config import Config
build_root = "test_build_root"
EXAMPLE_CONFIG = """
[main]
build_root = {build_root}
cache_root = {cache_root}
cores_root = {cores_root}
library_root = {library_root}
[library.test_lib]
loc... | {
"content_hash": "da9f93f1f963da0b3f81520eba98fab9",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 69,
"avg_line_length": 22.4875,
"alnum_prop": 0.6125625347415231,
"repo_name": "lowRISC/fusesoc",
"id": "ec5b1100f1b2bf4520bd2e669e379da72a206929",
"size": "1941",
"binar... |
from unittest import TestCase
from package_tracking.component.package_tracking import PackageTrackingComponentImpl
class TestPkgTrkComponentImpl(TestCase):
def test_sub_pkg_trk_msg(self):
pkg_trk = PackageTrackingComponentImpl(mojoqq_host='192.168.30.130', create_table=False)
# pkg_trk.sub_pkg_trk... | {
"content_hash": "4d1ba5042d04f7315767de967bd896dd",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 104,
"avg_line_length": 55.55555555555556,
"alnum_prop": 0.728,
"repo_name": "lyrl/package_tracking",
"id": "888d31f7725808d9f63f97c9676483008db0bed7",
"size": "500",
"bin... |
__author__ = 'ar'
import os
import time
import lmdb
import tensorflow as tf
import numpy as np
import shutil
from run00_common import ImageDirParser, DataType
#################################
def buidImageDataset(imageDirParser=None, datasetType='lmdb', numberOfSamples=1000, isRawBlob=False):
if imgDirParser is... | {
"content_hash": "b2b658d47c6f547d55f1fa569c38e780",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 117,
"avg_line_length": 37.5959595959596,
"alnum_prop": 0.5502418054809243,
"repo_name": "SummaLabs/DLS",
"id": "a2dfb3c1831e755a8264d087ba704727b07f181b",
"size": "3765",
... |
import os
import sys
import pytest
from os.path import join
from sqlalchemy.exc import InvalidRequestError
from textwrap import dedent
from ...api import Gradebook
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderAssign(BaseTestApp):
def test_help(self):
"""Does the help disp... | {
"content_hash": "6feb7a73a713c8ab83038a614cdfda50",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 112,
"avg_line_length": 47.1764705882353,
"alnum_prop": 0.5908757517969782,
"repo_name": "EdwardJKim/nbgrader",
"id": "3e42d4f6feeb14e8b290bfbaa237287afac0866c",
"size": "... |
"""
PEP302 give a lot of inforation about the working of this module
https://www.python.org/dev/peps/pep-0302/
"""
import imp
import logging
import sys
import requests
# Define the order to search for an import.
# First we look for a package __init__ then for non-package .py files.
# We do not look for non-pure Pytho... | {
"content_hash": "212fee261265831ae59b1fb242a946a0",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 78,
"avg_line_length": 33.7906976744186,
"alnum_prop": 0.570314292268869,
"repo_name": "ant1441/network-import",
"id": "32f9afbaaf29148ccbce71c8ed9b378bef594b35",
"size": ... |
import numpy
import pytest
from qualipy.filters.exposure import *
OVER_EXPOSED_IMAGE = 'tests/images/over_exposure_sample.jpg'
UNDER_EXPOSED_IMAGE = 'tests/images/under_exposure_sample.jpg'
GOOD_IMAGE = 'tests/images/exposure_sample_good.jpg'
def test_normalized_clipping_percentage_for_black_image():
img = num... | {
"content_hash": "8e1484a41a87a1061b11b8ae914806dc",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 76,
"avg_line_length": 27.1,
"alnum_prop": 0.7136531365313653,
"repo_name": "vismantic-ohtuprojekti/image-filtering-suite",
"id": "d2364a89581a538d24afbdf6f89d2bf9d5ae257c",
... |
import sys
import os
import re
#Adding directory to the path where Python searches for modules
cmd_folder = os.path.dirname('/home/arvind/Documents/Me/My_Projects/Git/Crypto/modules/')
sys.path.insert(0, cmd_folder)
#Importing common crypto module
import utility
import common
def main():
string='Burning \'em, if y... | {
"content_hash": "119cec9dfb6265a8895836e8740cc94a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 89,
"avg_line_length": 25.55,
"alnum_prop": 0.7671232876712328,
"repo_name": "arvinddoraiswamy/blahblah",
"id": "72f03edfe51509ed59ca6f05a311a737b003a8c2",
"size": "511",
... |
"""
Utility objects and functions for debugging.
"""
class FakeException(Exception):
"""Placeholder exception for swapping into the except clause of a
try-except clause so that errors are thrown.
For example, this is useful in xhr_handlers.get_variant_list() where I have
a try-except that returns a 4... | {
"content_hash": "4189a458f5ff5639677d51296f00a341",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 31.571428571428573,
"alnum_prop": 0.7171945701357466,
"repo_name": "woodymit/millstone_accidental_source",
"id": "ceed6e4c621f729350936e208f82721e412e7... |
import random
import torch
from torch.utils.data import Dataset
from torch.utils.data import sampler
import torchvision.transforms as transforms
import lmdb
import six
import sys
from PIL import Image
import numpy as np
class lmdbDataset(Dataset):
def __init__(self, root=None, transform=None, target_transform=No... | {
"content_hash": "bace28657f18c19b0e9a516f0604c5ca",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 78,
"avg_line_length": 29.533834586466167,
"alnum_prop": 0.5595723014256619,
"repo_name": "ahmedmazariML/Re-Implementation-of-Convolutional-Recurrent-Neural-Network-for-Sequen... |
import math, random
class Task( object ):
"""A task"""
def __init__(self,
Id ,
Name ,
WCET ,
BCET ,
Period ,
Deadline ... | {
"content_hash": "6547831c0fa1cfd96e3aab13e7c31efa",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 167,
"avg_line_length": 30.482993197278912,
"alnum_prop": 0.4318232537380049,
"repo_name": "neonsoftware/network-on-chip-mapping-benchmark",
"id": "aa95ffbc8a538281f2f9b6e34... |
from copy import deepcopy
from grab.util.default_config import DEFAULT_SPIDER_GLOBAL_CONFIG
import importlib
def update_dict(target, source, overwrite=False):
for key, val in source.items():
if key not in target or overwrite:
target[key] = deepcopy(source[key])
return target
def build_ro... | {
"content_hash": "da28a3fe1824428ceacee5e277d70075",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 70,
"avg_line_length": 33.392857142857146,
"alnum_prop": 0.6994652406417112,
"repo_name": "mawentao007/reading_grab",
"id": "850549fed141c223e4a13cec1b2090d2e2128599",
"siz... |
from django.core.management.base import BaseCommand
from django.core.urlresolvers import reverse
from getpaid.utils import get_domain
class Command(BaseCommand):
help = 'Display URL path for Epay.dk Online URL configuration'
def handle(self, *args, **options):
current_site = get_domain()
self... | {
"content_hash": "e37e4696616670987f1db6dd4aadd755",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 84,
"avg_line_length": 31.977777777777778,
"alnum_prop": 0.5524669909659485,
"repo_name": "nielsonsantana/django-getpaid",
"id": "fa42a39dfbcdd6d6dc3f0d1b48be5c1cbd43d4eb",
... |
from __future__ import absolute_import, print_function, unicode_literals
import os
"""
Deployment based configuration
When deploying topology specify a deployment to match with a settings key.
-o "'topology.deployment=\"local\"'"
Spouts / Bolts in the topolgoy will then pull the settings then need from this modu... | {
"content_hash": "676a5dc7b855f4ff64a1ac68cb2ad048",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 85,
"avg_line_length": 23.907692307692308,
"alnum_prop": 0.6306306306306306,
"repo_name": "diffeo/Datawake",
"id": "dbb1a52b7a5cbd5f470ab9e0aa5b69ba0da734f2",
"size": "1554... |
from __future__ import absolute_import
import sys
from .cmdline import main
sys.exit(main())
| {
"content_hash": "719ee6ccc0c33e733a6c3a20846c2ec5",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 38,
"avg_line_length": 13.714285714285714,
"alnum_prop": 0.7395833333333334,
"repo_name": "krisztianfekete/green",
"id": "9e7321cbf581310c63fd4b6b4a574a114b1ea86a",
"size": ... |
import logging, urllib2, time, json, os, math
import pymongo, bson
import numpy as np
import StringIO, gzip
import csv
import pandas as pd
from astropy.io import fits
from astropy import wcs, coordinates as coord, units as u
from astropy.cosmology import Planck13 as cosmo
from scipy.optimize import brentq, curve_fit, l... | {
"content_hash": "40f1e0e1b0658bc100ad4020868446e8",
"timestamp": "",
"source": "github",
"line_count": 3120,
"max_line_length": 723,
"avg_line_length": 40.38621794871795,
"alnum_prop": 0.6446728304432364,
"repo_name": "afgaron/rgz-analysis",
"id": "25088cc76d03bd607e6d63a5b1b6f8bdfe8710b3",
"size"... |
"""Deals with loading & saving .size and .sizediff files.
The .size file is written in the following format. There are no section
delimiters, instead the end of a section is usually determined by a row count
on the first line of a section, followed by that number of rows. In other
cases, the sections have a known size... | {
"content_hash": "ddbcc1a0d1b8e24770e51f6061d582b5",
"timestamp": "",
"source": "github",
"line_count": 604,
"max_line_length": 80,
"avg_line_length": 33.05298013245033,
"alnum_prop": 0.6775195351632939,
"repo_name": "endlessm/chromium-browser",
"id": "20b5ec11383ab677b3da8e1a5de5ca2dd45359ce",
"si... |
"""Tests for AddSign."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.compiler.tests import xla_test
from tensorflow.contrib.opt.python.training import addsign
from tensorflow.contrib.opt.python.training import sign_de... | {
"content_hash": "c6728bf70d19dac1e95047d014af8a4c",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 80,
"avg_line_length": 33.796875,
"alnum_prop": 0.5654184003698567,
"repo_name": "apark263/tensorflow",
"id": "a37c97e6d374440aeb860b9d02f2d5dd95c91f62",
"size": "5015",
... |
from django.core.urlresolvers import reverse
from django import http
from mox import IgnoreArg
from mox import IsA
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
from openstack_dashboard.dashboards.admin.groups.constants \
import GROUPS_ADD_MEMBER_URL as add_member_url
f... | {
"content_hash": "c211e168396a6b5b44b2c1fc6c28591b",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 79,
"avg_line_length": 37.04524886877828,
"alnum_prop": 0.5891046781482838,
"repo_name": "rackerlabs/horizon",
"id": "2bb59105bd8fe0046edc7b514586cd560e04a01c",
"size": "8... |
from logscan.match import Matcher
from logscan.watch import Watcher
from logscan.schedule import Schedule
if __name__ == '__main__':
import sys
sched = Schedule()
try:
sched.add_watcher(Watcher(sys.argv[1], Matcher('#123#')))
sched.add_watcher(Watcher(sys.argv[2], Matcher('#123#')))
... | {
"content_hash": "7f786003c0f14b57b0ceca6723378a36",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 65,
"avg_line_length": 31,
"alnum_prop": 0.6430107526881721,
"repo_name": "magedu/logscan",
"id": "8c3433a21009993b9c4e9523567382e9d8ecdb18",
"size": "465",
"binary": fal... |
from base import Cron
__all__ = ['Cron'] | {
"content_hash": "5082721800aae28bf4eaa59921491805",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 21,
"avg_line_length": 20,
"alnum_prop": 0.625,
"repo_name": "divio/django-cronjobs",
"id": "15c903dd48321cbae2645a83dec89f059a013085",
"size": "40",
"binary": false,
"c... |
"""Cluster creation related checks"""
from sahara import conductor as c
from sahara import context
from sahara import exceptions as ex
from sahara.i18n import _
conductor = c.API
data_source_type = {
"type": "string",
"enum": ["swift", "hdfs", "maprfs", "manila"]
}
job_configs = {
"type": "object",
... | {
"content_hash": "068536b672c8a760cd4d6d0d9c8ed142",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 75,
"avg_line_length": 31.567164179104477,
"alnum_prop": 0.566903073286052,
"repo_name": "crobby/sahara",
"id": "f664f2995020e0f86d9e5d7232e8d0360282d9a5",
"size": "2698",
... |
""" Provide the Either property.
The Either property is used to construct properties that an accept any of
multiple possible types.
"""
#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
from __fu... | {
"content_hash": "82d348924aafa734db2db27b5c2b6e89",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 141,
"avg_line_length": 31.233870967741936,
"alnum_prop": 0.4265427317325071,
"repo_name": "bokeh/bokeh",
"id": "ebea711dc4faf1e55f374b98ca481e0aa8243d98",
"size": "4204",... |
"""Settings for the Au-to-do app."""
TEMPLATE_BASE_PATH = 'templates/'
# Prediction API credentials keyname.
CREDENTIALS_KEYNAME = 'prediction_credentials'
# OAuth 2.0 related constant.
CLIENT_ID = (
'your_client_id'
)
CLIENT_SECRET = 'your_client_secret'
# TODO(user): Make sure that all the scopes are includ... | {
"content_hash": "74d0f7cdb9bd7cf21f0e6def60f50207",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 60,
"avg_line_length": 25.535714285714285,
"alnum_prop": 0.7314685314685314,
"repo_name": "stigsfoot/support-autodo",
"id": "27cc437e9dc7919db517e81b3135c4cd9d2b2fb6",
"siz... |
import collections
import json
from typing import Dict, Union
from TM1py.Objects.Subset import Subset, AnonymousSubset
from TM1py.Objects.TM1Object import TM1Object
from TM1py.Utils import format_url
class ViewAxisSelection(TM1Object):
""" Describes what is selected in a dimension on an axis. Can be a Registered... | {
"content_hash": "6c615455c961d41169b74396dfcde287",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 111,
"avg_line_length": 33.127272727272725,
"alnum_prop": 0.6215697036223929,
"repo_name": "OLAPLINE/TM1py",
"id": "f6d50c9272f47fd2bd2ceb426794ee42f03699f7",
"size": "366... |
from bambou import NURESTFetcher
class NUOverlayAddressPoolsFetcher(NURESTFetcher):
""" Represents a NUOverlayAddressPools fetcher
Notes:
This fetcher enables to fetch NUOverlayAddressPool objects.
See:
bambou.NURESTFetcher
"""
@classmethod
def managed_class(... | {
"content_hash": "59cc92241cdcaab3f8d831956ab9ac36",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 71,
"avg_line_length": 22.64,
"alnum_prop": 0.6431095406360424,
"repo_name": "nuagenetworks/vspk-python",
"id": "d4ab37c67047d8752150cdeb4f7237d67b538031",
"size": "2177",
... |
from setuptools import find_packages, setup
package_name = 'grift'
setup(name=package_name,
version='0.7.1',
description='A clean approach to app configuration',
keywords='app config configuration schema python',
maintainer_email='grift-maintainer@kensho.com',
url='https://github.com/ken... | {
"content_hash": "1b7ab8db4774ca658c07c10c17f5412d",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 58,
"avg_line_length": 31.444444444444443,
"alnum_prop": 0.6113074204946997,
"repo_name": "kensho-technologies/grift",
"id": "2745f720d7c3c7013bcbe92e190d1ba09ec306c2",
"si... |
import sys
import os
import inspect
import jsonpickle
from raygun4py import __version__
try:
import multiprocessing
USE_MULTIPROCESSING = True
except ImportError:
USE_MULTIPROCESSING = False
import platform
from datetime import datetime
from raygun4py import http_utilities
class RaygunMessageBuilder(obj... | {
"content_hash": "56121f6c27b475f313efa9eb6730408c",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 123,
"avg_line_length": 33.30612244897959,
"alnum_prop": 0.5681678921568627,
"repo_name": "MindscapeHQ/raygun4py",
"id": "a36dca408968906da2498bb6e432ff5397ef4daa",
"size"... |
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | {
"content_hash": "86a11c05549c7ed24a210030d5fa664a",
"timestamp": "",
"source": "github",
"line_count": 545,
"max_line_length": 134,
"avg_line_length": 36.1651376146789,
"alnum_prop": 0.5331811263318113,
"repo_name": "Multiscale-Genomics/mg-process-fastq",
"id": "e43cb310160f3ea3614f9fd337af148239253... |
import os
import glob
import sys
import platform
import subprocess
import difflib
import filecmp
import shutil
from optparse import OptionParser
#
# Get standard testsuite test arguments: srcdir exepath
#
srcdir = "."
tmpdir = "."
path = "../.."
# Options for the command line
parser = OptionParser()
parser.add_opt... | {
"content_hash": "557aa9a6cbde75a14356ba5307ddeefd",
"timestamp": "",
"source": "github",
"line_count": 348,
"max_line_length": 97,
"avg_line_length": 37.60344827586207,
"alnum_prop": 0.5732080085587651,
"repo_name": "bdeluca/oiio",
"id": "68889a9beb6631b80bb90c8bbee81fadc94e834f",
"size": "13109",... |
from contextlib import contextmanager
import numpy as np
from matplotlib.colors import ColorConverter
from vispy import scene
from vispy.scene.visuals import Arrow
class MultiColorScatter(scene.visuals.Markers):
"""
This is a helper class to make it easier to show multiple markers at
specific positions... | {
"content_hash": "d4dd0f1f93d8dcbd0e17527710430d32",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 85,
"avg_line_length": 32.46153846153846,
"alnum_prop": 0.5054502369668247,
"repo_name": "glue-viz/glue-3d-viewer",
"id": "66dc7a0199aa8727637acc4fd2535a57b9cc1e22",
"size... |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
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 rights
to use... | {
"content_hash": "88e91f9f08b9b2a3c08678dcaabd0666",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 93,
"avg_line_length": 41.13157894736842,
"alnum_prop": 0.6811686926850075,
"repo_name": "eswartz/RenderPipeline",
"id": "bd116c91a51c95a321c540a876c330ccffce2c89",
"size"... |
KUBERNETES_DATASOURCE = 'kubernetes'
class KubernetesProperties(object):
NAME = 'name'
METADATA = 'metadata'
NETWORK = 'network'
ADDRESS = 'address'
STATUS = 'status'
ADDRESSES = 'addresses'
TYPE = 'type'
INTERNALIP = 'internal_ip'
EXTERNALIP = 'external_ip'
UID = 'uid'
EXT... | {
"content_hash": "cd0acefbe61e20be4c43d49a03d41a8a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 45,
"avg_line_length": 25.15,
"alnum_prop": 0.6381709741550696,
"repo_name": "openstack/vitrage",
"id": "9062669f40fac4c59d4beac8527c38e62042ef06",
"size": "1077",
"binar... |
import logging
from unittest.mock import MagicMock
import numpy as np
from tf_bodypix.model import BodyPixModelWrapper
LOGGER = logging.getLogger(__name__)
ANY_INT_FACTOR_1 = 5
class TestBodyPixModelWrapper:
def test_should_be_able_to_padded_and_resized_image_matching_output_stride_plus_one(self):
p... | {
"content_hash": "fe15f46a3d479e07e95b4040176705f8",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 94,
"avg_line_length": 29.132075471698112,
"alnum_prop": 0.5699481865284974,
"repo_name": "de-code/python-tf-bodypix",
"id": "a7f35745922c2f784563056d48c98f0b2f186a26",
"si... |
"""add password
Revision ID: 578150ae72c8
Revises: a4ddb77c0941
Create Date: 2017-02-07 19:02:35.725606
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '578150ae72c8'
down_revision = 'a4ddb77c0941'
branch_labels = None
depends_on = None
def upgrade():
# #... | {
"content_hash": "730fe447fee66b26608c2371018c5289",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 92,
"avg_line_length": 24,
"alnum_prop": 0.6875,
"repo_name": "hedm0423/flaskdemo",
"id": "ac31178715bfd78014f281265ab4e090fc0a4fb6",
"size": "672",
"binary": false,
"c... |
import graphene
from .mutations import TaxExemptionManage
class TaxMutations(graphene.ObjectType):
tax_exemption_manage = TaxExemptionManage.Field()
| {
"content_hash": "ba062147e6892dd8826f032704f4a5be",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 53,
"avg_line_length": 22.285714285714285,
"alnum_prop": 0.8141025641025641,
"repo_name": "mociepka/saleor",
"id": "4f56cf5f7cc7b6e8f888de2d2e9f9206cb1973fc",
"size": "156",... |
import os
import warnings
qt_api = os.environ.get('QT_API')
if qt_api is None:
try:
import PySide
qt_api = 'pyside'
except ImportError:
try:
import PyQt4
qt_api = 'pyqt'
except ImportError:
qt_api = None
# Note that we don't want ... | {
"content_hash": "0e12dbf81ba6ecc472d000b57e0d3363",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 79,
"avg_line_length": 24.727272727272727,
"alnum_prop": 0.5753676470588235,
"repo_name": "almarklein/scikit-image",
"id": "8e7ab93952eccd09c61a59e2eb406ce6a175d1e1",
"size... |
__author__ = 'cenk'
def check_vertical(cells):
for (i, j) in cells:
if (i, j + 1) in cells and (i, j + 2) in cells:
return True
return False
def check_horizontal(cells):
for (i, j) in cells:
if (i + 1, j) in cells and (i + 2, j) in cells:
return True
return Fa... | {
"content_hash": "c4c5c557df4136013af39f5040b01eee",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 78,
"avg_line_length": 22.870967741935484,
"alnum_prop": 0.53737658674189,
"repo_name": "cenkbircanoglu/tic-tac-toe",
"id": "5f87a1745d8d11ac9c2894cd821dd60fd92a5e1b",
"siz... |
"""
Text Sentiment Calculator w/ GUI
Authors: Chris Cintron, Matt Novak
Created April 2016
"""
from os import popen
import xlwt
import openpyxl
from tkinter import Button, Label, Grid, Tk
from tkinter.filedialog import askopenfilename, asksaveasfile, askdirectory
import re
def openmyfolder():
global rawInput
... | {
"content_hash": "d14e70cef2eef146127386445671130f",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 103,
"avg_line_length": 29.75328947368421,
"alnum_prop": 0.6332780541735765,
"repo_name": "ChrisCintron/Text_Sentiment_Analyzer",
"id": "43b8852e4b68eeabd119ce814e33dd3bc889... |
import ast, sys, time
import argparse
import numpy as np
from StrongCNN.IO.config_parser import parse_configfile
from StrongCNN.IO.load_images import load_data
from StrongCNN.IO.augment_data import augment_data
from StrongCNN.utils.model_info import roc_auc, roc_curve_plot, get_scores
from StrongCNN.utils.model_info im... | {
"content_hash": "dea9c0396d60da7dc19dd50cee7b10c7",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 124,
"avg_line_length": 41.23300970873787,
"alnum_prop": 0.5959500824111137,
"repo_name": "cavestruz/StrongCNN",
"id": "491c52cb80382cc59a72240a232ccb70796673c7",
"size": ... |
from __future__ import unicode_literals
import unittest
from decimal import Decimal
from djmoney_rates.backends import BaseRateBackend
from djmoney_rates.exceptions import CurrencyConversionException
from djmoney_rates.models import RateSource, Rate
from djmoney_rates.settings import money_rates_settings
from djmone... | {
"content_hash": "95fda597ac4f7e3149b4c3366764a687",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 86,
"avg_line_length": 41.52336448598131,
"alnum_prop": 0.6851226648660814,
"repo_name": "iXioN/django-money-rates",
"id": "e67ef34c69520eea1602f58361ccc3851c0386f1",
"siz... |
import os.path as op
from nose.tools import assert_true
import numpy as np
from numpy.testing import assert_allclose
from mne import Epochs, read_evokeds, pick_types
from mne.io.compensator import make_compensator, get_current_comp
from mne.io import Raw
from mne.utils import _TempDir, requires_mne, run_subprocess
ba... | {
"content_hash": "ae79a8c4495a106f2a3be39807c7686c",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 73,
"avg_line_length": 37.492537313432834,
"alnum_prop": 0.6385350318471338,
"repo_name": "jaeilepp/eggie",
"id": "3620c86f65021ba012719849d04e48789ffc29ac",
"size": "2612"... |
import unittest
import uuid
import mock
from changes.utils.http import build_patch_uri
class TestBuildPatchUri(unittest.TestCase):
def test_internal(self):
patch_id = uuid.UUID('ee62b37b-bc3f-4efe-83bc-f75152d60405')
app = mock.Mock(config={'INTERNAL_BASE_URI': 'https://base_uri/'})
uri =... | {
"content_hash": "c402a35bac6118d5755e68627ddf0dc6",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 74,
"avg_line_length": 35.291666666666664,
"alnum_prop": 0.6080283353010626,
"repo_name": "dropbox/changes",
"id": "827f3de96bb9ef985dd6bfbda90e32d6d55628a9",
"size": "847"... |
"""The module provides connection and connections pool interfaces.
These are intended to be used for implementing custom connection managers.
"""
import abc
import asyncio
from abc import ABC
__all__ = [
'AbcConnection',
'AbcPool',
'AbcChannel',
]
class AbcConnection(ABC):
"""Abstract connection i... | {
"content_hash": "9c9b4f6b114d29ef1aaf23a8b77430af",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 77,
"avg_line_length": 24.150943396226417,
"alnum_prop": 0.634375,
"repo_name": "ymap/aioredis",
"id": "0af13c65c9272f189615f3120b8c27604e8abdb2",
"size": "3842",
"binar... |
import time
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.core.urlresolvers import reverse
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_condit... | {
"content_hash": "2c1e36801c3afa9e1404b32573234691",
"timestamp": "",
"source": "github",
"line_count": 598,
"max_line_length": 137,
"avg_line_length": 45.979933110367895,
"alnum_prop": 0.6594413732906604,
"repo_name": "lpakula/django-ftp-deploy",
"id": "ceed142ea0136f7ce86959026148d0bd2506e7c8",
"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0011_remove_user_inlove'),
]
operations = [
migrations.AddField(
model_name='user',
name='last_starting_date',
... | {
"content_hash": "d54d94d6a744c1e1e6a7349a7553a6e2",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 65,
"avg_line_length": 24.130434782608695,
"alnum_prop": 0.572972972972973,
"repo_name": "jeffminsungkim/datelikeus",
"id": "4b4b94c1fee7282a884d26e87aa2b5444c7b5879",
"siz... |
import datetime
import logging
from itertools import chain, product
from actstream.actions import follow, unfollow
from actstream.models import Follow
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.contenttypes.models import ContentType
from django.contrib.postgres.fi... | {
"content_hash": "8665fd4df825b8feb2dfeba3a47ec878",
"timestamp": "",
"source": "github",
"line_count": 613,
"max_line_length": 178,
"avg_line_length": 31.843393148450243,
"alnum_prop": 0.602766393442623,
"repo_name": "comic/comic-django",
"id": "8f461aee85cbec5d2ff57ce0fab617a3a8a6cfb4",
"size": "... |
from celery.task import task, periodic_task
from celery.schedules import crontab
from django.contrib.auth.models import User
from django.utils import simplejson
from models import RawTrackingEvent
import logging
logger = logging.getLogger(__name__)
@task(name='user_analytics.set_warning')
def async_set_warning(**kwar... | {
"content_hash": "8030cad94de41c493151e8bfbb7747f7",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 117,
"avg_line_length": 32.607594936708864,
"alnum_prop": 0.6242236024844721,
"repo_name": "rburhum/django-user-analytics",
"id": "c9aa1b4ec52def9061681fd5115a7dd490f13b91",
... |
"""Module with specification of all supported command line arguments."""
import argparse
cli_parser = argparse.ArgumentParser()
cli_parser.add_argument('-dl', '--disable-liveness',
help='disable the service liveness checks',
action='store_true')
cli_parser.add_argumen... | {
"content_hash": "d6128d5c36324603bdbef365135f0d85",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 76,
"avg_line_length": 38.6551724137931,
"alnum_prop": 0.5432649420160571,
"repo_name": "jpopelka/fabric8-analytics-common",
"id": "e76fd1534e9eb863cc9283820505fab8b61f327b",... |
from __future__ import unicode_literals
import json
from django.conf import settings
from django.contrib import admin
from django.test.utils import override_settings
from cms.models import Page
from cms.utils.compat.dj import is_installed
from cms.test_utils.testcases import CMSTestCase, URL_CMS_PAGE_ADD, URL_CMS_PLUGI... | {
"content_hash": "6a71523271ec123255c596fb15f79753",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 87,
"avg_line_length": 35.79220779220779,
"alnum_prop": 0.5870827285921626,
"repo_name": "schacki/djangocms-cascade",
"id": "727fe77723794f78e007ce6892a6dbf8d10f3794",
"siz... |
import cStringIO
import csv
import logging
import os.path
import pickle
import re
import sys
# for eval context:
import time
import openerp
import openerp.release
import openerp.workflow
from yaml_import import convert_yaml_import
import assertion_report
_logger = logging.getLogger(__name__)
try:
import pytz
e... | {
"content_hash": "a30d1c8259a35513842318c3ff9fda73",
"timestamp": "",
"source": "github",
"line_count": 968,
"max_line_length": 219,
"avg_line_length": 41.52789256198347,
"alnum_prop": 0.5278738277071569,
"repo_name": "diogocs1/comps",
"id": "7f56322dc94059b4a924150595ea4bbbaa492cb1",
"size": "4117... |
from itertools import chain
from django import forms
from django.template.loader import render_to_string
from django.utils.encoding import force_str
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
class SortedCheckboxSelectMultiple(forms.CheckboxSelectMultiple):
cla... | {
"content_hash": "3030f7c710615435db39f8f764095a76",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 109,
"avg_line_length": 37.056603773584904,
"alnum_prop": 0.5789205702647657,
"repo_name": "gregmuellegger/django-sortedm2m",
"id": "04e65b8eb6402fba32ec20a142c51fd86b125563... |
"""
sentry.interfaces.user
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
__all__ = ('User',)
from sentry.interfaces.base import Interface
from sentry.utils.safe import trim, tr... | {
"content_hash": "a7fb6635a89da0afc4b9db710772f047",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 85,
"avg_line_length": 26.98876404494382,
"alnum_prop": 0.5732722731057452,
"repo_name": "jokey2k/sentry",
"id": "f11e72e61f791e2c7fd19cf657177228ac8ba7f5",
"size": "2402",... |
"""Collects and renders Python and Flask application evironment and configuration."""
try:
from cgi import escape
except ImportError:
from html import escape
import os
import platform
import socket
import sys
from . import app
optional_modules_list = [
"Cookie",
"mod_wsgi",
"psycopg2",
"zlib... | {
"content_hash": "ecf9698eae7773a9995337bb34c53e8c",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 97,
"avg_line_length": 32.28225806451613,
"alnum_prop": 0.6324006994753935,
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"id": "358ab0389cfaebbd1172e439486f6d0a... |
from stellar_sdk import Asset
from stellar_sdk.call_builder.call_builder_async import ClaimableBalancesCallBuilder
from tests.call_builder.call_builder_async import client, horizon_url
class TestClaimableBalancesCallBuilder:
def test_init(self):
builder = ClaimableBalancesCallBuilder(horizon_url, client)
... | {
"content_hash": "eeaae27a3be92412be9bd4e3eaa32383",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 88,
"avg_line_length": 43.348837209302324,
"alnum_prop": 0.7086909871244635,
"repo_name": "StellarCN/py-stellar-base",
"id": "514272df68f05010b0a7c98d7ab41a267230da87",
"si... |
import daemon
import signal
# Moved gevent imports into functions.
# See http://stackoverflow.com/q/11587164/298479
# TLDR: Importing gevent before forking is a bad idea
class GeventDaemonContext(daemon.DaemonContext):
""" DaemonContext for gevent.
Receive same options as a DaemonContext (python-daemon), E... | {
"content_hash": "3457f2597f28a7028332b7aad2c53916",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 117,
"avg_line_length": 37.195402298850574,
"alnum_prop": 0.6165018541409147,
"repo_name": "luzfcb/maildump",
"id": "8447b77305ab24fb41874f406b55f486ed67bb2c",
"size": "323... |
import mock
from .common import BaseTest
class ShieldTest(BaseTest):
# most of the shield tests are embedded in other resources
def test_shield_sync(self):
# shield resources
p = self.load_policy(
{
"name": "elb-sync",
"resource": "elb",
... | {
"content_hash": "c6ffa6579ad0b0535cc1b89d8c33a453",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 96,
"avg_line_length": 36.71666666666667,
"alnum_prop": 0.4684521107580572,
"repo_name": "Sutto/cloud-custodian",
"id": "4e32d86af3a219a06f59b759c450be7e3cd19cb2",
"size": ... |
"""
[8/29/2014] Challenge #177 [Hard] SCRIPT it Language
https://www.reddit.com/r/dailyprogrammer/comments/2exnal/8292014_challenge_177_hard_script_it_language/
#Description:
We all enjoy strings. We all enjoy breaking up texts. Time to go bigger than just a few sentences.
Out of curiosity we will be breaking down a ... | {
"content_hash": "57fc87783aa1f9c90bd61cc8d35953dd",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 119,
"avg_line_length": 54.97959183673469,
"alnum_prop": 0.7487008166295471,
"repo_name": "DayGitH/Python-Challenges",
"id": "a7ddf515b8d2ed96bf8b2fd30914ee323db6d1ae",
"si... |
import os
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
# To set up environmental variables, see http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)
did_delete = clien... | {
"content_hash": "3acf8bcae1d132efd9797d65dfd6b2fa",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 62,
"avg_line_length": 29.6,
"alnum_prop": 0.7364864864864865,
"repo_name": "TwilioDevEd/api-snippets",
"id": "2eae2925a5bfadc70c5e385624ee483401355be6",
"size": "517",
"... |
from __future__ import print_function
import new
import dis
import struct
__version__ = "0.0.1"
# TODO add docstring explanations
# TODO add support for python 3 and pypy
# TODO how to handle flags such as CO_FUTURE_UNICODE_LITERALS (check code.h)
# TODO reloading this clears all the vars... maybe make this... | {
"content_hash": "bb48b898fa0b4dda8a432af5b7306675",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 310,
"avg_line_length": 33.55154639175258,
"alnum_prop": 0.608081118451375,
"repo_name": "tzickel/bytehook",
"id": "facae8b92fd5446e159457caf92cb66e3597395d",
"size": "650... |
from __future__ import absolute_import, unicode_literals
from datetime import datetime
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.util import (display_for_field, flatten_fieldsets,
label_for_field, lookup_field, NestedObject... | {
"content_hash": "25c3bf117d580c32d77b0802ed4a58d3",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 108,
"avg_line_length": 33.88288288288288,
"alnum_prop": 0.577683240272977,
"repo_name": "makinacorpus/django",
"id": "637f6432619bcf79a49ebfe0b6903e0ab25c08fe",
"size": "... |
from django import template
register = template.Library()
@register.simple_tag
def current(request, pattern):
import re
try:
if re.search(pattern, request.path):
return 'nav-current'
except:
return ''
@register.filter
def disqus_hash(value):
return value.replace("/","_")... | {
"content_hash": "8f48338bf96fe3bd18ba2fc8062968e3",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 44,
"avg_line_length": 17.833333333333332,
"alnum_prop": 0.6386292834890965,
"repo_name": "jstoledano/nspaces",
"id": "2029b70f14e178cb9b93926faf00dddf081bf9b6",
"size": "5... |
from .shop import Shop
from .product import Product
from .cart import Cart
from .custom_collection import CustomCollection
from .collect import Collect
from .shipping_address import ShippingAddress
from .billing_address import BillingAddress
from .line_item import LineItem
from .shipping_line import ShippingLine
from .... | {
"content_hash": "85986baa22cb5cc9a725ea761503e676",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 68,
"avg_line_length": 34.15217391304348,
"alnum_prop": 0.8421387651177594,
"repo_name": "varesa/shopify_python_api",
"id": "619bdf64e87c5b218dd730be64f29ead6bdc4a95",
"siz... |
__version__=''' $Id: PyFontify.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__="""
Module to analyze Python source code; for syntax coloring tools.
Interface::
tags = fontify(pytext, searchfrom, searchto)
- The 'pytext' argument is a string containing Python source code.
- The (optional) arguments 's... | {
"content_hash": "3d83e729f2a2de086afab9db6534fd26",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 90,
"avg_line_length": 32.20886075949367,
"alnum_prop": 0.5405777166437414,
"repo_name": "nickpack/reportlab",
"id": "cf584272fe4f44b470c4b40231d6fc75c10f690c",
"size": "5... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Entry',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=F... | {
"content_hash": "d99cf48c585c81b774cca10bb4c12abd",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 114,
"avg_line_length": 33.03448275862069,
"alnum_prop": 0.5271398747390397,
"repo_name": "jgsjv/treinamento_django",
"id": "ccea001aa9bfc3a1f3c481a8179f3a5442db2662",
"siz... |
import urllib2
import bs4
from random import shuffle
import os
#from unicodedata import normalize
url_base = 'http://www.weeklysh.com/eNews/Wap.aspx?ID='
ids = range(150340, 151531)
shuffle(ids)
i = ids.index(151414)
ids = [ids[i]] + ids[:i] + ids[i+1:]
os.chdir('/Users/jialing/Shanghai')
for id in ids:
page = u... | {
"content_hash": "e72fbd39670a5f01b018dcf94823880a",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 80,
"avg_line_length": 27.181818181818183,
"alnum_prop": 0.5752508361204013,
"repo_name": "jialing3/corner_cases",
"id": "9a31cf79eefa0c71c67d72afa3b1852ed49618e2",
"size":... |
"""
This module gathers tree-based methods, including decision, regression and
randomized trees. Single and multi-output problems are both handled.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Da... | {
"content_hash": "de43d067fea4158440a6627bf3d5b05d",
"timestamp": "",
"source": "github",
"line_count": 778,
"max_line_length": 80,
"avg_line_length": 38.412596401028274,
"alnum_prop": 0.564664547431822,
"repo_name": "soulmachine/scikit-learn",
"id": "a60f1a6ccca25e86e8e624cdfda9273ac40ea8cc",
"siz... |
import unittest
import platform
import os.path
import tempfile
import lit
from lit.TestRunner import ParserKind, IntegratedTestKeywordParser, \
parseIntegratedTestScript
class TestIntegratedTestKeywordParser(unittest.TestCase):
inputTestCase = None
@staticmethod
def load_keywo... | {
"content_hash": "26835af3faa8695dc11caf2c6b6b45ed",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 82,
"avg_line_length": 40.8562874251497,
"alnum_prop": 0.5559138208998974,
"repo_name": "youtube/cobalt_sandbox",
"id": "89209d80f5557ec267fcbbd73f45eaadcd3bda55",
"size":... |
"""
This module houses the ctypes initialization procedures, as well
as the notice and error handler function callbacks (get called
when an error occurs in GEOS).
This module also houses GEOS Pointer utilities, including
get_pointer_arr(), and GEOM_PTR.
"""
import logging
import os
import re
from ctypes import c_... | {
"content_hash": "0a00528ba89583d787c726436c7b82fe",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 94,
"avg_line_length": 32.201219512195124,
"alnum_prop": 0.6983525847377391,
"repo_name": "gdi2290/django",
"id": "207fa780a4df9251a54e271733779c688a9b394f",
"size": "5281... |
from django import forms
# modules from django
from django.forms.extras.widgets import SelectDateWidget
from . import choices
from .models import *
import datetime
class GoodInquiryForm(forms.Form):
kind = forms.MultipleChoiceField(required = False, label = '種類(可複選)', widget=forms.CheckboxSelectMultip... | {
"content_hash": "ba52ce91df46f9f2ca716e58d938c189",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 304,
"avg_line_length": 50.79020979020979,
"alnum_prop": 0.6232961586121437,
"repo_name": "z-Wind/warehouse",
"id": "0284f068140fc98b12853e1a7be86b33ab89ca72",
"size": "15... |
from google.appengine.ext import db
class DoRun(db.Model):
runTrue = db.BooleanProperty() | {
"content_hash": "dc061fdb69c95468129fd47dcacd3776",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 35,
"avg_line_length": 24.5,
"alnum_prop": 0.7244897959183674,
"repo_name": "shickey/BearStatus",
"id": "56fc950da89e84db0eb03b874ea1fa0aff9a7a74",
"size": "98",
"binary":... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/base/shared_poi_all_lair_rocks_small_fog_green.iff"
result.attribute_template_id = -1
result.stfName("lair_n","rocks")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "4341416580cb7b014c21304263b08d00",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 92,
"avg_line_length": 24.23076923076923,
"alnum_prop": 0.692063492063492,
"repo_name": "anhstudios/swganh",
"id": "4083c8a30eabce5cd7d8fe546be67f373638ab57",
"size": "460"... |
"""Set up some common test helper things."""
import asyncio
import functools
import logging
import os
from unittest.mock import patch
import pytest
import requests_mock as _requests_mock
from homeassistant import util
from homeassistant.util import location
from homeassistant.auth.const import GROUP_ID_ADMIN, GROUP_I... | {
"content_hash": "f6fffbcd040b4e1a5b5fb31383dc2520",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 85,
"avg_line_length": 27.214285714285715,
"alnum_prop": 0.6730408698912635,
"repo_name": "Cinntax/home-assistant",
"id": "36c0f52f41a6b874174cc52cafb061bcaae20b0b",
"size... |
"""
Talon.One API
Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage ap... | {
"content_hash": "9979a3abf45532210706957851e2f4c6",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 732,
"avg_line_length": 39.229885057471265,
"alnum_prop": 0.5786697919718723,
"repo_name": "talon-one/talon_one.py",
"id": "312acbd4f8d1a79c3dcb4af118a9098e52645a2e",
"size... |
from starlord.ocr.api import *
import requests
import selenium
from selenium import webdriver
import json, urllib,urllib2
import hashlib
from urllib import urlencode
from selenium.webdriver.common import keys as KEYS
import bs4
import sys
import time
from selenium.webdriver.common.action_chains import ActionChains
from... | {
"content_hash": "4b649a5b6d4bcc93a2242bdad711cf4c",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 93,
"avg_line_length": 21.796610169491526,
"alnum_prop": 0.6189735614307932,
"repo_name": "snakedragon/scrapy-hive",
"id": "d1c8d5605ab009f779b4bbf9ae49a3413c543eb9",
"siz... |
import os
import shutil
import tempfile
import unittest
from sqlalchemy.exc import IntegrityError
from oyProjectManager import conf, db, Asset, Project, VersionType, User, Version
class AssetTester(unittest.TestCase):
"""tests the Asset class
"""
def setUp(self):
"""setup the test settings wit... | {
"content_hash": "a137f291d3af15761741a9406f5b7e6b",
"timestamp": "",
"source": "github",
"line_count": 656,
"max_line_length": 94,
"avg_line_length": 35.34146341463415,
"alnum_prop": 0.5719030365769496,
"repo_name": "code-google-com/oyprojectmanager",
"id": "eb5e42a68b0fef84d9618c91bee4f49e63e1f7a6"... |
from .RamlWrap import ramlwrap | {
"content_hash": "b21ca4e485ce49aa2cf0acac8623c721",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 30,
"avg_line_length": 30,
"alnum_prop": 0.8666666666666667,
"repo_name": "jmons/ramlwrap",
"id": "1ff38289ade651eb61b13402396152c4eb1bb108",
"size": "30",
"binary": false... |
debug = 0
netConfig = {
}
networkParams = {
"packetSize" : "2048B",
"link_bw" : "4GB/s",
"link_lat" : "40ns",
"input_latency" : "50ns",
"output_latency" : "50ns",
"flitSize" : "8B",
"buffer_size" : "14KB",
}
nicParams = {
"detailedCompute.name" : "thornhill.SingleThread",
"module" : ... | {
"content_hash": "fead87f3c0703b791baa41fb7d62b435",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 66,
"avg_line_length": 31.923076923076923,
"alnum_prop": 0.6751807228915663,
"repo_name": "minyee/sst-macro",
"id": "04759e9900bee2ab6d612a27d45a39be6a1f6ae2",
"size": "207... |
import datetime as system_datetime
def now():
return system_datetime.datetime.now()
def strnow(nowtime=None):
if nowtime is None:
nowtime = now()
return nowtime.strftime("%Y-%m-%d %H:%M:%S")
def now14(nowtime=None):
if nowtime is None:
nowtime = now()
return nowtime.strftime("%... | {
"content_hash": "a0873f9fe0e96f85d10df9b54272dbf0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 48,
"avg_line_length": 19.647058823529413,
"alnum_prop": 0.6287425149700598,
"repo_name": "zencore-dobetter/zencore-utils",
"id": "eb4871f86c37b5f1d74108f2f13407a631f30ef8",
... |
"""
Initialize, start, stop, or destroy WAL replication mirror segments.
============================= DISCLAIMER =============================
This is a developer tool to assist with development of WAL replication
for mirror segments. This tool is not meant to be used in production.
It is suggested to only run this ... | {
"content_hash": "1ec19406603578e98097e5735c971415",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 197,
"avg_line_length": 38.44444444444444,
"alnum_prop": 0.620386838594931,
"repo_name": "Quikling/gpdb",
"id": "a70f2f7da6fe5d5f1eeb9d5672e33524c0295c34",
"size": "9020",... |
import binascii
import os, sys, re, json
from collections import defaultdict, OrderedDict
from typing import (NamedTuple, Union, TYPE_CHECKING, Tuple, Optional, Callable, Any,
Sequence, Dict, Generic, TypeVar)
from datetime import datetime
import decimal
from decimal import Decimal
import traceback
... | {
"content_hash": "29ee7e045335a30cb83ec74c38ea1891",
"timestamp": "",
"source": "github",
"line_count": 1378,
"max_line_length": 119,
"avg_line_length": 31.400580551523948,
"alnum_prop": 0.6024035128264387,
"repo_name": "vialectrum/vialectrum",
"id": "a954589398b0234dc4b29324a0285e09f392be6e",
"siz... |
import mock
from cinder import context
from cinder import exception
from cinder.openstack.common import log as logging
from cinder import test
from cinder.volume.drivers import xio
from cinder.volume import qos_specs
from cinder.volume import volume_types
LOG = logging.getLogger("cinder.volume.driver")
ISE_IP1 = '10... | {
"content_hash": "94969499cbc4030817591139b9a32add",
"timestamp": "",
"source": "github",
"line_count": 1253,
"max_line_length": 79,
"avg_line_length": 39.38707102952913,
"alnum_prop": 0.5005268276868212,
"repo_name": "blueboxgroup/cinder",
"id": "37c1ee24131cf12b8c4fe2cc770c0795120aeb2d",
"size": ... |
import unittest
from nose.tools import eq_
from redis_shard.hashring import HashRing
class TestHashRing(unittest.TestCase):
def test_remove_node(self):
replicas = 128
hash_ring_object = HashRing(
nodes=["redis01", "redis02"],
replicas=replicas,
)
hash_rin... | {
"content_hash": "cc174cda6343184e5d1d32de61ca847f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 73,
"avg_line_length": 26.38888888888889,
"alnum_prop": 0.6252631578947369,
"repo_name": "keakon/redis-shard",
"id": "575acf2bd2d75391fcd02616b512e42f27eab5b9",
"size": "52... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.ads.googleads.v11.errors",
marshal="google.ads.googleads.v11",
manifest={"AssetSetErrorEnum",},
)
class AssetSetErrorEnum(proto.Message):
r"""Container for enum describing possible asset set errors.
"""
class AssetSet... | {
"content_hash": "08523932d33e3a8a8cfcf7cf915468a4",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 64,
"avg_line_length": 23.954545454545453,
"alnum_prop": 0.6565464895635673,
"repo_name": "googleads/google-ads-python",
"id": "ad7f8c4d4686335402aa6dc6f3de2353f2c95261",
"... |
import glance.api.v2.schemas
import glance.tests.unit.utils as unit_test_utils
import glance.tests.utils as test_utils
class TestSchemasController(test_utils.BaseTestCase):
def setUp(self):
super(TestSchemasController, self).setUp()
self.controller = glance.api.v2.schemas.Controller()
def te... | {
"content_hash": "9e1771c1f90e9c43ef9f88de779791f1",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 75,
"avg_line_length": 43.774193548387096,
"alnum_prop": 0.5946941783345615,
"repo_name": "cloudbau/glance",
"id": "dfa2d0e7cc0264cec86844e7c3a73c56a7602c5c",
"size": "1994... |
r'''This module contains a base class for modeling computation graphs.
Neural networks are really just a concise, computational way of describing a
mathematical model of a computation graph that operates on a particular set of
data.
At a high level, a neural network is a computation graph that describes a
parametric ... | {
"content_hash": "76d3809da82ddf6ea84e1702aaf624c8",
"timestamp": "",
"source": "github",
"line_count": 684,
"max_line_length": 89,
"avg_line_length": 42.228070175438596,
"alnum_prop": 0.5902922032959423,
"repo_name": "devdoer/theanets",
"id": "e8ad6d5a927f23ee025e6e807f4e03ff9d0aadb5",
"size": "28... |
import time
from random import randint
import pytest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from selenium.we... | {
"content_hash": "65bcf42b443317cc4004b84ea280f162",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 119,
"avg_line_length": 42.0625,
"alnum_prop": 0.7105497771173849,
"repo_name": "gennadykr/selenium-training",
"id": "85d17e0ec26cba85440493a98670828cbf36bfd4",
"size": "33... |
enough = lambda cap, on, wait: max(on + wait - cap, 0)
| {
"content_hash": "a4dbee1918dffa8f55eaaf126b42fcf3",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 54,
"avg_line_length": 55,
"alnum_prop": 0.6181818181818182,
"repo_name": "RevansChen/online-judge",
"id": "724664884c578e389d7ef9cd6989bea3931619c7",
"size": "73",
"binar... |
from flask import Flask
from flask import render_template
import json
import os
import logdata.incoming
import logdata.predict
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
# Depricated
@app.route('/logdata/<userid>/<float:latitude>/<float:longitude>/<int:weekday>... | {
"content_hash": "b8914cb18e690e8abb55031fcebab81a",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 138,
"avg_line_length": 34.854166666666664,
"alnum_prop": 0.7381948595337716,
"repo_name": "adeekshith/location-predict-server",
"id": "fbb4f3297ad41aab4f0d7f59727e08ed30f7f0... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('symposion_schedule', '0006_slot_title_override'),
]
operations = [
migrations.AddField(
model_name='presentation',
name='fee... | {
"content_hash": "402327f60d0d4d26a2250f754b5bd39a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 59,
"avg_line_length": 21.944444444444443,
"alnum_prop": 0.6050632911392405,
"repo_name": "pyohio/symposion",
"id": "67accb0de4406e51eda486af392cd523fe94635b",
"size": "469... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.