text stringlengths 4 1.02M | meta dict |
|---|---|
import sys
import argparse
# Third-party packages
from toil.job import Job
# Package methods
from ddb import configuration
from ddb_ngsflow import gatk
from ddb_ngsflow import annotation
from ddb_ngsflow import pipeline
from ddb_ngsflow.align import bwa
from ddb_ngsflow.variation import variation
from ddb_ngsflow.var... | {
"content_hash": "260ede2eb3bd29b5ac5de995e006a04d",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 117,
"avg_line_length": 37.72727272727273,
"alnum_prop": 0.6993975903614458,
"repo_name": "dgaston/ddb-scripts",
"id": "b59ab3aa366d3403652f58f0d23071208b7ea7a4",
"size": "... |
"""Sensors for National Weather Service (NWS)."""
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_LATITUDE,
CONF_LONGITUDE,
LENGTH_METERS,
LENGTH_MILES,
PERCENTAGE,
PRESSURE_INHG,
PRESSURE_PA,
SPEED_KILOMETERS_PER_HOUR... | {
"content_hash": "facc507b000959b0b580a687055bcfe0",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 97,
"avg_line_length": 33.1953125,
"alnum_prop": 0.6528594963520828,
"repo_name": "jawilson/home-assistant",
"id": "35bbcef838ddbe5cc09dc2a4368e758e438aa0b6",
"size": "424... |
"""Utilities for sorting jpgs using a Tensorflow image classifier.
This package provides libraries and command line tools for consuming
directories of images and sorting them into directories corresponding
to their classification given a tensorflow image classification model."""
| {
"content_hash": "5352ea30469c7e629975d7f1d0b448c9",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 73,
"avg_line_length": 56.2,
"alnum_prop": 0.8362989323843416,
"repo_name": "lukejduncan/tfimgtools",
"id": "8aad5c4f13a8d7dbdf281428dc50d64f9b5a7a02",
"size": "281",
"bin... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
# Flag to indicate if this migration is too risky
# to run online and needs to be coordinated for offline
is_dangerous = False
... | {
"content_hash": "caa39318211b5fca3f39d13a67a65192",
"timestamp": "",
"source": "github",
"line_count": 949,
"max_line_length": 233,
"avg_line_length": 89.65753424657534,
"alnum_prop": 0.5803843215607921,
"repo_name": "ifduyue/sentry",
"id": "5acb2ac74d7230fcc386818222f77077bc4c1985",
"size": "8510... |
' 数据库操作 '
__author__ = 'Ellery'
from app import db, models
from datetime import datetime
def db_insert(model):
db.session.add(model)
def db_delete(model):
db.session.delete(model)
def db_commit():
db.session.commit() | {
"content_hash": "9838b44e942f3f50b61c5a9383244748",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 29,
"avg_line_length": 15.533333333333333,
"alnum_prop": 0.6824034334763949,
"repo_name": "allotory/basilinna",
"id": "47bf9e76174d3b4ecdfe096f923294f8682ae62b",
"size": "2... |
import numpy as np
from numpy.testing import assert_allclose, assert_raises
from skimage.feature.register_translation import (register_translation,
_upsampled_dft)
from skimage.data import camera
from scipy.ndimage.fourier import fourier_shift
def test_correlation():... | {
"content_hash": "53fb966e2f09d9fbab1072d1a336327c",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 34.716981132075475,
"alnum_prop": 0.5970108695652174,
"repo_name": "bennlich/scikit-image",
"id": "6494630e84eb0bda73a2bde7bfb75e4f22399d38",
"size"... |
"""
Copyright 2013 Load Impact
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 writing, software
di... | {
"content_hash": "1d0980fcfea03c3f18cd4ed8abb808b3",
"timestamp": "",
"source": "github",
"line_count": 461,
"max_line_length": 84,
"avg_line_length": 40.84598698481562,
"alnum_prop": 0.6369622942113649,
"repo_name": "loadimpact/loadimpact-sdk-python",
"id": "d59819838861a138fc5136cb4283fc4d92e8f55c"... |
from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:51020")
... | {
"content_hash": "8c84d0b8650d331cd525e56724f0022f",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 101,
"avg_line_length": 28.679525222551927,
"alnum_prop": 0.5685463010863943,
"repo_name": "CoinProjects/AmsterdamCoin-v4",
"id": "8afc1d4d582a2caab7ec650ff06daaa6bc41a522",... |
import sys
from typing import Any, Dict, List, Optional, Type, TypeVar
import json
from .utils import parse_yaml, dump_json
from .cache import Cacheable
R = TypeVar('R', bound='Resource')
class Resource (Cacheable):
"""
A resource that's part of the overall Ambassador configuration world. This is
the... | {
"content_hash": "8c5ded23c4195f44d1e3ddc79fb6e1b9",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 106,
"avg_line_length": 37.32057416267943,
"alnum_prop": 0.6276923076923077,
"repo_name": "datawire/ambassador",
"id": "01e3b1c4837f1d57b427a1886674238c7153f19f",
"size": ... |
import sys
import os
import logging
import traceback
import ed25519
from nacl.public import PrivateKey, PublicKey
from nacl.encoding import HexEncoder
from .crypt4gh import encrypt, decrypt, reencrypt
from .cli import parse_args
from .keys import generate_ec, generate_signing
LOG = logging.getLogger(__name__)
DEFAU... | {
"content_hash": "e42eb6085f009097ca99f2ffc9fefc64",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 120,
"avg_line_length": 35.934306569343065,
"alnum_prop": 0.5567743245988218,
"repo_name": "AlexanderSenf/Crypt4GH",
"id": "a95cafb1f3ef9dc1dafbef71603439e814422a93",
"siz... |
import phial
@phial.page
def homepage():
return phial.file(name="index.htm", content="Hello World!")
| {
"content_hash": "6b3cb5f10bf83d7993eb45f819928f0e",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 63,
"avg_line_length": 17.833333333333332,
"alnum_prop": 0.7009345794392523,
"repo_name": "brownhead/phial",
"id": "c0153ef69b8bcd18a88969a2769f4f69bb3a0917",
"size": "107",... |
import time
from oslo_log import log
from tempest_lib.common.utils import data_utils
import testtools
from ec2api.tests.functional import base
from ec2api.tests.functional import config
CONF = config.CONF
LOG = log.getLogger(__name__)
class SecurityGroupBaseTest(base.EC2TestCase):
def _test_rules(self, add_f... | {
"content_hash": "f5749cc450cc99d0a5d38690d593dbd2",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 79,
"avg_line_length": 40.95172413793104,
"alnum_prop": 0.5595318288986191,
"repo_name": "vishnu-kumar/ec2-api",
"id": "7525ff72799e992e9ee2e91bf4d3f6203b9ea929",
"size": ... |
"""
This inline script utilizes harparser.HAR from
https://github.com/JustusW/harparser to generate a HAR log object.
"""
import six
import sys
import pytz
from harparser import HAR
from datetime import datetime
class _HARLog(HAR.log):
# The attributes need to be registered here for them to actually be
... | {
"content_hash": "0235dbe8bc2b34b4ca6030c4ebb103cf",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 86,
"avg_line_length": 36.72289156626506,
"alnum_prop": 0.5931758530183727,
"repo_name": "tdickers/mitmproxy",
"id": "d6b50c21311a622a16d42f35cd1a9e725f10c8b0",
"size": "9... |
"""Defines interface for DB access.
The underlying driver is loaded as a :class:`LazyPluggable`.
**Related Flags**
:db_backend: string to lookup in the list of LazyPluggable backends.
`sqlalchemy` is the only supported backend right now.
:sql_connection: string specifying the sqlalchemy connection t... | {
"content_hash": "b114939591320b10ab2fd64f3da11c97",
"timestamp": "",
"source": "github",
"line_count": 1555,
"max_line_length": 79,
"avg_line_length": 30.54469453376206,
"alnum_prop": 0.6787797124028886,
"repo_name": "xushiwei/nova",
"id": "05d81d8b2aa8ff501b36ef90c92ca9894a5ddee3",
"size": "48274... |
import numpy as np
from sklearn import metrics
import pandas
import tensorflow as tf
from tensorflow.models.rnn import rnn, rnn_cell
import skflow
### Training data
# Download dbpedia_csv.tar.gz from
# https://drive.google.com/folderview?id=0Bz8a_Dbh9Qhbfll6bVpmNUtUcFdjYmF2SEpmZUZUcVNiMUw1TWN6RDV3a0JHT3kxLVhVR2M
# ... | {
"content_hash": "c0b0887e68f52838261c983dc2f1265e",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 113,
"avg_line_length": 40.75,
"alnum_prop": 0.7332902809170164,
"repo_name": "rbjarnason/active-citizen",
"id": "95f4bec92dc6491c1c07ef142b937df013b5e974",
"size": "3718",... |
from django.contrib.auth.views import login
from django.views.decorators.debug import sensitive_post_parameters
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_protect
@sensitive_post_parameters()
@csrf_protect
@never_cache
def do_login(request):
trust_root = reques... | {
"content_hash": "183fcbe41e7dea040905a3d265efa36c",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 67,
"avg_line_length": 37.81818181818182,
"alnum_prop": 0.7980769230769231,
"repo_name": "RaduGatej/SensibleData-Platform",
"id": "29e46cf61c0d2d981b29bc3ec53e2d106f16dc4b",
... |
from random import choice
from shapeworld import util
from shapeworld.captions import Predicate, EntityType
class PragmaticalPredication(object):
def __init__(self, agreeing, ambiguous=None, disagreeing=None, sub_predications=None):
self.agreeing = list(agreeing)
self.ambiguous = list() if ambigu... | {
"content_hash": "450f862b3d71dce40df665a78a8d67ca",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 322,
"avg_line_length": 52.35668789808917,
"alnum_prop": 0.6684914841849149,
"repo_name": "AlexKuhnle/ShapeWorld",
"id": "2fb52a87a4913c463ce4a602f755b7ae13c04753",
"size"... |
class FieldError(Exception):
pass
class ResourceNotFoundError(Exception):
pass
class DynamoPreconditionError(Exception):
pass
class ItemAttributeTypeError(Exception):
pass
class NotUniqueError(Exception):
pass
class InvalidQueryError(Exception):
pass
class ValidationError(Exception):... | {
"content_hash": "2b2cdf6d50ae6ce3a46778ceb2b6e233",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 41,
"avg_line_length": 12.382352941176471,
"alnum_prop": 0.7482185273159145,
"repo_name": "jcoc611/DynamoEngine",
"id": "608b5e7d1f3a2af130aa2237129ad124218f2588",
"size": ... |
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
class NetworkInterface(resource.Resource):
PROPERTIES = (
DESCRIPTION, GROUP_SET, PRIVATE_IP_ADDRESS, SOURCE_DEST_CHECK,
SUBNET... | {
"content_hash": "e5c710a6507337e9f962ed8add65e558",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 78,
"avg_line_length": 34.467065868263475,
"alnum_prop": 0.5533356497567755,
"repo_name": "cryptickp/heat",
"id": "a4d7caa5decd23265f9d58dda81f9c6717361f66",
"size": "6331... |
"""Utilities for metrics on Hamiltonian."""
import tensorflow as tf
from qhbmlib.inference import qnn_utils
from qhbmlib.inference import ebm_utils
from qhbmlib.models import hamiltonian
def density_matrix(model: hamiltonian.Hamiltonian):
r"""Returns the thermal state corresponding to a modular Hamiltonian.
Gi... | {
"content_hash": "029a1702b16e96dda102763584e17596",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 80,
"avg_line_length": 39.8235294117647,
"alnum_prop": 0.6361398325947809,
"repo_name": "google/qhbm-library",
"id": "24461b2032b42eff8194f2ed42244a39bbf38639",
"size": "4... |
import os.path
# Django
from django.test import TestCase
# Third-party apps
from lxml import etree # http://lxml.de/
# Internal
from .models import Menu, Meal, Music
from xmlmapping.models import Mapping
XML = open(os.path.join(os.path.dirname(__file__), '../restaurant.xml')).read()
DOC = etree.fr... | {
"content_hash": "442eaa55a9b190a5a7a4e07fdb05471d",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 79,
"avg_line_length": 28.515151515151516,
"alnum_prop": 0.6546227417640808,
"repo_name": "YAmikep/django-xmlmapping",
"id": "aa721dde625d7d12a615b03eb3c3bea19a5fd1d2",
"si... |
import os
from django.conf import settings
from django.test import TestCase
import shutil
from filebrowser.functions import get_version_path, version_generator
__author__ = 'andriy'
class FunctionsTest(TestCase):
def __init__(self, methodName='runTest'):
super(TestCase, self).__init__(methodName)
de... | {
"content_hash": "290da1680f9f60d7bdc7b11ac01c27e9",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 112,
"avg_line_length": 50.32876712328767,
"alnum_prop": 0.5416439847577572,
"repo_name": "agushuley/gu-django-filebrowser-no-grappelli-test",
"id": "35ea636a6176acfead6d9dad... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name = 'ucloudapi',
version = '0.1',
description = "olleh ucloud biz API Client",
long_description = "Python interface ucloud biz API",
author = "ChangBum Hong",... | {
"content_hash": "bb0f496da1445c327b36198e65aee369",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 77,
"avg_line_length": 33.23529411764706,
"alnum_prop": 0.5663716814159292,
"repo_name": "hongiiv/CloudStack_for_ucloudbiz",
"id": "bff1badcfcfc54fb800658ae0a1bee68d436f529",... |
"""Tests for adding tags via CLI"""
import logging
from housekeeper.cli.add import tag_cmd
def test_add_tags_no_args(populated_context, cli_runner, caplog):
"""Test to add a two tags to the database"""
# GIVEN a context with a populated store, and a cli runner
caplog.set_level(logging.DEBUG)
# GIVEN ... | {
"content_hash": "88bfede8c1aa15a39b745661a8285b51",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 89,
"avg_line_length": 38.47959183673469,
"alnum_prop": 0.6817820206841687,
"repo_name": "Clinical-Genomics/housekeeper",
"id": "192bbd69d3fd9d7f6443b504bbdb060adc718c97",
... |
def make_param_entries(model_name, prepend, feat_dict, cfg):
if(model_name in cfg):
for i, param in enumerate(cfg[model_name]):
param_key = param.keys()[0]
feat_dict[prepend + '__' + param_key] = \
cfg[model_name][i][param_key]
return feat_dict
| {
"content_hash": "b4c04c5f734de3b54e6a434b463c8e33",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 60,
"avg_line_length": 37.75,
"alnum_prop": 0.5629139072847682,
"repo_name": "joelmpiper/bill_taxonomy",
"id": "bbacb9f3eece6d73411a4ea1c2e7df61cb769fac",
"size": "303",
"... |
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import division
from __future__ import print_function
import array
import difflib
import distutils.dir_util
import filecmp
import io
import ... | {
"content_hash": "90e9ccf7032ac531a3f246d5579af62a",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 81,
"avg_line_length": 43.63846153846154,
"alnum_prop": 0.6383747576238322,
"repo_name": "endlessm/chromium-browser",
"id": "6d6fab05a50edc738b24801c8ee0651ad254cf7c",
"si... |
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpatterns = [
url(r'^$',... | {
"content_hash": "9df6afcbff830fc6bdd2cf5909bba800",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 110,
"avg_line_length": 42.22857142857143,
"alnum_prop": 0.6928281461434371,
"repo_name": "WarmongeR1/feedly-filter",
"id": "b1a2788c7a9592771a62847692d46a8b23fde71a",
"siz... |
from chalice import Chalice, Response
import boto3
import pickle
from urlparse import urlparse, parse_qs
from botocore.vendored import requests
import json
app = Chalice(app_name='slack-handler')
app.debug=True
def __get_alfred_url():
return "https://4v8uog9pw8.execute-api.us-west-2.amazonaws.com/api/process/mess... | {
"content_hash": "1142d56393fdf882dc6ba7bc997e7e37",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 186,
"avg_line_length": 38.642857142857146,
"alnum_prop": 0.670671595810228,
"repo_name": "nakul225/GtaProgressBar",
"id": "58115255a8d530aa83a558ac56d97371652a5e7c",
"size... |
"""
*t4mon* - T4 monitoring **test functions** for orchestrator.py
"""
from __future__ import absolute_import
import os
from datetime import datetime as dt
import pandas as pd
from t4mon.df_tools import consolidate_data
from t4mon.arguments import ConfigReadError
from t4mon.orchestrator import Orchestrator
from panda... | {
"content_hash": "19b7966bb7731e62a1e801f3f7f9afb6",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 79,
"avg_line_length": 44.651162790697676,
"alnum_prop": 0.6222222222222222,
"repo_name": "fernandezcuesta/pySMSCMon",
"id": "02ab23b94f59eaeb74fb7a1092a5b223039d4944",
"s... |
import unittest
class TestHello(): # [test description]
def testHello(self):
pass
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "cc432cc03fe4f61480deb2ca5f1bbc9f",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 40,
"avg_line_length": 13.727272727272727,
"alnum_prop": 0.5629139072847682,
"repo_name": "talapus/Ophidian",
"id": "93f4444534bc91d91670e8f7325bd06089432c00",
"size": "175... |
import os
from cloudbaseinit.osutils import factory as osutils_factory
from cloudbaseinit.utils import classloader
def get_storage_manager():
class_paths = {
"VDS": "cloudbaseinit.utils.windows.storage.vds_storage_manager."
"VDSStorageManager",
"WSM": "cloudbaseinit.utils.windows.storage.... | {
"content_hash": "b596cc8af7697ac462b773389ec3cca7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 79,
"avg_line_length": 33.8,
"alnum_prop": 0.659171597633136,
"repo_name": "alexpilotti/cloudbase-init",
"id": "0f2488954dbe6f05703ab8461ceef9228a99ab64",
"size": "1461",
... |
import pathlib
import matplotlib.pyplot as plt
import meep as mp
import numpy as np
import pandas as pd
import pydantic
from tqdm.auto import tqdm
from gdsfactory.simulation.modes.find_modes import find_modes_coupler
from gdsfactory.types import Optional, PathType
def coupling_length(
neff1: float,
neff2: f... | {
"content_hash": "a25b9499de9bdc8bba17e40e74715663",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 125,
"avg_line_length": 29.453237410071942,
"alnum_prop": 0.6328773815339521,
"repo_name": "gdsfactory/gdsfactory",
"id": "00a053f4f5e2c201598523a8f5be5a09f97d7605",
"size... |
import logging
from collections import OrderedDict
from egpackager.datasources import GspreadDataSource, RasterDataSource
class DataManager(object):
def __init__(self, debug=False):
# Set up logging
if debug:
logging.basicConfig(level=logging.DEBUG)
else:
logging.... | {
"content_hash": "659faedce0cd75c161d23238b9765348",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 114,
"avg_line_length": 32.927536231884055,
"alnum_prop": 0.6095950704225352,
"repo_name": "VUEG/egpackager",
"id": "5410fcef07609b866ba63e5a91521d3b57fec6f6",
"size": "227... |
from test_support import verbose, verify
from types import TupleType, StringType, IntType
import __future__
GOOD_SERIALS = ("alpha", "beta", "candidate", "final")
features = __future__.all_feature_names
# Verify that all_feature_names appears correct.
given_feature_names = features[:]
for name in dir(__future__):
... | {
"content_hash": "79820ce49eab20bfc47327e82c8ec098",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 74,
"avg_line_length": 43.672413793103445,
"alnum_prop": 0.6667982629293328,
"repo_name": "MalloyPower/parsing-python",
"id": "fa8224f7b02b2e1dd36f74c38f39a8d8b36ede56",
"s... |
"""
WSGI config for rainapp project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import Djang... | {
"content_hash": "c89db7e28a435209b376dcbd3c8ba81c",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 26.833333333333332,
"alnum_prop": 0.7908902691511387,
"repo_name": "pjsier/rainapp",
"id": "4b9482c8a1d657abfda87fdeff77a8e1a96f96b9",
"size": "483",... |
"""
A collection of parsers that should match those listed in the config.yml file.
Each parser must be added ans an entrypoint. This allows MSL plugins that only
define parsers.
"""
import simplejson as json
def parser_example(data):
"""Manipulate incoming data and return the modified data."""
return data
... | {
"content_hash": "d4a507996ef32705e9be4dcf55bd2de9",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 78,
"avg_line_length": 24.875,
"alnum_prop": 0.6221105527638191,
"repo_name": "RichardBronosky/service_layer_config",
"id": "acf504dc21f750a3bf3c2373e15b90f296bc51c7",
"siz... |
"""Makes sure that all files contain proper licensing information."""
import optparse
import os.path
import subprocess
import sys
def PrintUsage():
print """Usage: python checklicenses.py [--root <root>] [tocheck]
--root Specifies the repository root. This defaults to "../.." relative
to the script... | {
"content_hash": "adb9c0aa8206eced784da288895b2e77",
"timestamp": "",
"source": "github",
"line_count": 508,
"max_line_length": 97,
"avg_line_length": 28.033464566929133,
"alnum_prop": 0.550523137420125,
"repo_name": "ropik/chromium",
"id": "68d03bd5c585b1db62333c7eeb27b6a695eabbf3",
"size": "14430... |
"""Invokes all the unit tests for the module."""
import unittest
import dir_archive_test
import path2listtest
import pyfib_test
def suite():
"""Returns the suite of unit tests."""
suites = [dir_archive_test.suite(), path2listtest.suite(),
pyfib_test.suite()]
return unittest.TestSuite(suite... | {
"content_hash": "7a4a648e2bee0c3d66e70dd538d535ed",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 62,
"avg_line_length": 20.842105263157894,
"alnum_prop": 0.6616161616161617,
"repo_name": "mrwizard82d1/pyutils",
"id": "cd71bef88e27b633308b261923be86d4c03017ac",
"size": ... |
import pytest
import os
import shutil
import time
from datetime import datetime
from shapely.geometry import Point
from pygw.base import CloseableIterator
from pygw.store import DataStoreFactory
from pygw.store.rocksdb import RocksDBOptions
from pygw.geotools import SimpleFeatureTypeBuilder
from pygw.geotools import... | {
"content_hash": "e870545abb2a2380c2affdf15090edd2",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 90,
"avg_line_length": 32.85436893203884,
"alnum_prop": 0.7310874704491725,
"repo_name": "locationtech/geowave",
"id": "071a1644d4d2381dd0719a60984289b369858304",
"size": ... |
from os.path import basename, dirname, exists, isdir, isfile, join, realpath, split
import glob
from shutil import rmtree
from six import with_metaclass
import hashlib
from re import match
import sh
import shutil
import fnmatch
from os import listdir, unlink, environ, mkdir, curdir, walk
from sys import stdout
import... | {
"content_hash": "9e03d03b8c90736b665167e3399d2830",
"timestamp": "",
"source": "github",
"line_count": 1195,
"max_line_length": 96,
"avg_line_length": 39.25439330543933,
"alnum_prop": 0.5698480035814023,
"repo_name": "rnixx/python-for-android",
"id": "3933dd7824a0d5e890e563d5fe2b21767b6156f7",
"si... |
import analysis.event
import analysis.hitfinding
import analysis.beamline
import plotting.line
import plotting.image
import plotting.correlation
import simulation.base
# Simulate diffraction data
sim = simulation.base.Simulation()
sim.hitrate = 0.5
sim.sigma = 1
# Specify the facility
state = {}
state['Facility'] =... | {
"content_hash": "c9b27c55ede99a7880064cd65adf063b",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 108,
"avg_line_length": 31.479166666666668,
"alnum_prop": 0.600595632031767,
"repo_name": "SPIhub/hummingbird",
"id": "ed7def0a02ae168c34bd3e7544b07bdf829ff786",
"size": "3... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import Commit, Release, ReleaseCommit, Repository
from sentry.testutils import APITestCase
class ReleaseCommitsListTest(APITestCase):
def test_simple(self):
project = self.create_project(
n... | {
"content_hash": "398307b508b35742db203730e028755b",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 70,
"avg_line_length": 31.724137931034484,
"alnum_prop": 0.5853260869565218,
"repo_name": "JackDanger/sentry",
"id": "71d3204336bddc053a06ac20f0e3f827dc574099",
"size": "18... |
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Get Users',
# list of one or more authors for the module
... | {
"content_hash": "9a5b4dcbaa004ccef1816be896577487",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 144,
"avg_line_length": 36.09090909090909,
"alnum_prop": 0.5335470574765285,
"repo_name": "Hackplayers/Empire-mod-Hpys-tests",
"id": "0188ddd6a65f403b72ccf81a7b8eb8cc787c005... |
import base64
from collections import Counter
import sys
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from azure.cli.core._profile import Profile
from azure.cli.core.commands.client_factory import get_subscription_id
from azure.cli... | {
"content_hash": "490fe37a0569e5a084ec986eee47c4df",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 247,
"avg_line_length": 51.123893805309734,
"alnum_prop": 0.6181409035831746,
"repo_name": "yugangw-msft/azure-cli",
"id": "f89e4cf338e46724974f407ea49b296cc1640c74",
"siz... |
from datetime import date, datetime
from inspect import isclass
import six
import sqlalchemy as sa
__version__ = '0.4.4'
class Column(sa.Column):
def __init__(self, *args, **kwargs):
kwargs.setdefault('info', {})
kwargs['info'].setdefault('choices', kwargs.pop('choices', None))
kwargs['... | {
"content_hash": "448bd26fe2360d3df13ba5c1b86564d6",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 79,
"avg_line_length": 32.42201834862385,
"alnum_prop": 0.5766836445953594,
"repo_name": "kvesteri/sqlalchemy-defaults",
"id": "4d8dc9b731f463c1c2f8b1280d164d3b3216c58e",
... |
import os
import os.path as osp
# waf imports ---
import waflib.Utils
import waflib.Logs as msg
import waflib.Configure
import waflib.Build
import waflib.Task
import waflib.Tools.ccroot
from waflib.Configure import conf
from waflib.TaskGen import feature, before_method, after_method, extension, after
#
_heptooldir = ... | {
"content_hash": "248ab7fe44d88250d67ecd4989dfab3e",
"timestamp": "",
"source": "github",
"line_count": 814,
"max_line_length": 188,
"avg_line_length": 32.25675675675676,
"alnum_prop": 0.5529573066229958,
"repo_name": "hwaf/hwaf",
"id": "f239aa65341195e76ab15fa5d1a585732a8dcc5c",
"size": "26296",
... |
import mysql.connector
from model.group import Group
from model.contact import Contact
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection = mysql.connector.connect(hos... | {
"content_hash": "3d372437c6ddca9f03bd37702bd8b72d",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 120,
"avg_line_length": 39,
"alnum_prop": 0.5856643356643356,
"repo_name": "mycolam/python_training",
"id": "d0369b10d5a65345fe63af4e7baa29239c7142b3",
"size": "1716",
"b... |
"""Command for listing selection of a platform."""
import clif.conf as conf
import clif.logger as logger
from pprint import pformat
def main(args):
conf.init(args)
logger.info('command-line arguments:\n%s' % pformat(vars(args)))
logger.info('columns definition from configuration file (conf/platforms/selec... | {
"content_hash": "1f62537ea4cacb188ce228cdcc0fc0ed",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 102,
"avg_line_length": 35.09090909090909,
"alnum_prop": 0.7046632124352331,
"repo_name": "fmenabe/python-clif",
"id": "213478f1d8703defb0e8bde5915ef5f490b88df8",
"size": "... |
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
orm.Station.objects.filter(type='similar_artists').update(type='similar')
def backwards(self, orm):
"Write your backwards methods h... | {
"content_hash": "9faa24b0901c3e8a40bc4b211b2ef25c",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 182,
"avg_line_length": 67.42696629213484,
"alnum_prop": 0.5449091818030328,
"repo_name": "kirov/tvoeradio",
"id": "ad90d978c61fa7e196582f9d77831034bdc5f596",
"size": "6019... |
"""Setup for tests exercising visualization displays."""
__author__ = 'Mike Gainer (mgainer@google.com)'
from common import schema_fields
from controllers import utils
from models import analytics
from models import custom_modules
from models import data_sources
from modules.dashboard import tabs
class FakeDataSour... | {
"content_hash": "e2642352907c0ef915540f79133934e0",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 80,
"avg_line_length": 31.403508771929825,
"alnum_prop": 0.6417132216014898,
"repo_name": "wavemind/gcb17ml",
"id": "bbeab1c28d720330c7f3487819683fe66b9de133",
"size": "59... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'ClassRoom', fields ['slug']
db.create_unique('classroom_classroom', ['slug'])
def backwards(sel... | {
"content_hash": "a3c4ae90142b4e9c60a234274b31946e",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 182,
"avg_line_length": 67.84210526315789,
"alnum_prop": 0.5591543832428238,
"repo_name": "reinbach/tutorus",
"id": "4daab91ecc512f64f0b717985d0ae5252807ec0a",
"size": "518... |
def find_getch():
try:
import termios
except ImportError:
# Non-POSIX. Return msvcrt's (Windows') getch.
import msvcrt
return msvcrt.getch
# POSIX system. Create and return a getch that manipulates the tty.
import sys, tty
def _getch():
fd = sys.stdin.fileno(... | {
"content_hash": "699b23c4e3c0ba35de1cc1611003f990",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 71,
"avg_line_length": 25.565217391304348,
"alnum_prop": 0.576530612244898,
"repo_name": "UASLab/ImageAnalysis",
"id": "e6f63f3ccdf0ce7579ae2d891fc15741d6331d99",
"size": "... |
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2012 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of sou... | {
"content_hash": "2b2d5a607ce7d8ced04e06ddedcb4d33",
"timestamp": "",
"source": "github",
"line_count": 2127,
"max_line_length": 218,
"avg_line_length": 41.93464974141984,
"alnum_prop": 0.5368462357755479,
"repo_name": "Bysmyyr/chromium-crosswalk",
"id": "446a2ea94ccedb9295e51bbf9a1295c6e52373ee",
... |
"""Implementation of platform-specific functionality.
For each function or class described in `tornado.platform.interface`,
the appropriate platform-specific implementation exists in this module.
Most code that needs access to this functionality should do e.g.::
from tornado.platform.auto import set_close_exec
""... | {
"content_hash": "27abde48429492ff1bf0410c541f0003",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 80,
"avg_line_length": 30.651162790697676,
"alnum_prop": 0.7344461305007587,
"repo_name": "suninsky/ReceiptOCR",
"id": "449b634b9bd53e030da07c97c1407c82dfcb3d91",
"size": "... |
"""The xbox integration."""
import asyncio
from dataclasses import dataclass
from datetime import timedelta
import logging
from typing import Dict, Optional
import voluptuous as vol
from xbox.webapi.api.client import XboxLiveClient
from xbox.webapi.api.provider.catalog.const import SYSTEM_PFN_ID_MAP
from xbox.webapi.a... | {
"content_hash": "201115e9a0d7ec2579e531cd4f406ea8",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 85,
"avg_line_length": 30.21189591078067,
"alnum_prop": 0.6151101267380337,
"repo_name": "partofthething/home-assistant",
"id": "1d921f5fd182183d64c2cfee72bd45c511f2d195",
... |
import fallback, sys
fallback_timeout = 1.0
total_timeout = 3.0
cli = fallback.Client()
content = cli.get(sys.argv[1:], fallback_timeout)
content.await(total_timeout)
if content.isFinished():
print content.body
elif content.getError():
print >> sys.stderr, "Error:", content.getError()
else:
print >> sys... | {
"content_hash": "d56f1eb7e794e1f465e3da0afc1cd496",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 53,
"avg_line_length": 21.3125,
"alnum_prop": 0.7008797653958945,
"repo_name": "bozzzzo/quark",
"id": "ebe9dd3adc9f1ddf94882a344fef162948cd155e",
"size": "341",
"binary":... |
from django.db.models import Q
from django.contrib.auth import get_user_model
from rest_framework.response import Response
from rest_framework.status import HTTP_200_OK, HTTP_400_BAD_REQUEST
from rest_framework.views import APIView
from rest_framework.filters import (
SearchFilter,
OrderingFilter,
... | {
"content_hash": "ca53a0768e3b2b36282ef8181272a697",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 84,
"avg_line_length": 18.32183908045977,
"alnum_prop": 0.7227101631116688,
"repo_name": "kurokochin/blog-ricky",
"id": "2399c81ae927fc04f792dfd20badc55e7a2e9386",
"size": ... |
from core import perf_benchmark
from telemetry import benchmark
from telemetry.timeline import tracing_category_filter
from telemetry.web_perf import timeline_based_measurement
import page_sets
@benchmark.Enabled('android')
class MemoryHealthPlan(perf_benchmark.PerfBenchmark):
"""Timeline based benchmark for the ... | {
"content_hash": "5ffb76b977a54260a2eebb47d499857d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 74,
"avg_line_length": 31.074074074074073,
"alnum_prop": 0.7878426698450537,
"repo_name": "chuan9/chromium-crosswalk",
"id": "590222c53be7a152730af116c2e2ca480988853f",
"si... |
from PyQt5.QtWidgets import (QApplication, QComboBox, QDialog,
QDialogButtonBox, QFormLayout, QGridLayout, QGroupBox, QHBoxLayout,
QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QSpinBox, QTextEdit,
QVBoxLayout)
import sys, serial, glob
class Dialog(QDialog):
# NumGridRows = 3
# NumB... | {
"content_hash": "75cd462d9fbd1b363760479b5a836e73",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 89,
"avg_line_length": 37.166666666666664,
"alnum_prop": 0.6035874439461884,
"repo_name": "MCasari-PMEL/EDD-ICMGUI",
"id": "bdc0ff3447bda51cb51542bfa186528a59d36c90",
"siz... |
"""
Example program to demonstrate Gooey's presentation of subparsers
"""
from gooey import Gooey, GooeyParser
@Gooey(
optional_cols=2,
program_name="Subparser Demo",
dump_build_config=True,
show_success_modal=False)
def main():
dest_vars = [
'textfield',
'textarea',
... | {
"content_hash": "94ab36a2231470262cf04af67a7ebd68",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 102,
"avg_line_length": 38.48979591836735,
"alnum_prop": 0.49169317780134325,
"repo_name": "partrita/Gooey",
"id": "24f4e34106f604568627648969e401159d15bd17",
"size": "565... |
"""
dj-stripe System Checks
"""
import django
from django.conf import settings
from django.core import checks
from django.utils.dateparse import date_re
@checks.register("djstripe")
def check_stripe_api_key(app_configs=None, **kwargs):
"""Check the user has configured API live/test keys correctly."""
from .se... | {
"content_hash": "7fa7d28b8b65a2fce286274026c4e930",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 88,
"avg_line_length": 34.07641196013289,
"alnum_prop": 0.6010529394559813,
"repo_name": "pydanny/dj-stripe",
"id": "bb37ce2d2065a02e4b12817a95dc81652682ba54",
"size": "10... |
from collections import OrderedDict
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
# copy-pasted from https://github.com/City-of-Helsinki/kerrokantasi/blob/2c26bf3ee9ac4fdc88aefabd7d... | {
"content_hash": "d35ee9e4fad434f6f4854b46c97bc93d",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 151,
"avg_line_length": 41.424,
"alnum_prop": 0.6284279644650445,
"repo_name": "mikkokeskinen/tunnistamo",
"id": "e699bb2818cc2a2cd791ef8243e1712f29f5b65a",
"size": "5178"... |
from __future__ import print_function
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_allclose)
from scipy import sparse
from nose.tools import assert_true, assert_raises
import copy
import warnings
from mne.datasets import t... | {
"content_hash": "0027da9f33f2e2207276ae1006df0e83",
"timestamp": "",
"source": "github",
"line_count": 545,
"max_line_length": 79,
"avg_line_length": 41.40183486238532,
"alnum_prop": 0.6068073036695621,
"repo_name": "dgwakeman/mne-python",
"id": "d7d1d6ef576435f7a9e0d29d0c03d5b06ecbfc94",
"size": ... |
from nose.tools import * # flake8: noqa
from tests.base import ApiTestCase
from osf_tests.factories import InstitutionFactory, AuthUserFactory, RegistrationFactory, WithdrawnRegistrationFactory
from framework.auth import Auth
from api.base.settings.defaults import API_BASE
class TestInstitutionRegistrationList(ApiT... | {
"content_hash": "f5f166bc3eaf7e030e094b95f2ab254e",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 118,
"avg_line_length": 42.647887323943664,
"alnum_prop": 0.7014531043593131,
"repo_name": "monikagrabowska/osf.io",
"id": "e76bc1852d8570fdedae7a2e50be6c907eecfe6a",
"size... |
"""Resource definitions for cloud platform apis."""
import enum
BASE_URL = 'https://bio.googleapis.com/v1/'
class Collections(enum.Enum):
"""Collections for all supported apis."""
PROJECTS_OPERATIONS = (
'projects.operations',
'{+name}',
{
'':
'projects/{projectsId}/o... | {
"content_hash": "48d1001c8c34b459eb942787505ec66b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 64,
"avg_line_length": 21.692307692307693,
"alnum_prop": 0.6099290780141844,
"repo_name": "KaranToor/MA450",
"id": "4255a33b0dadde5bc2eeed53e2e5b390d47028e8",
"size": "1159... |
import mock
import six
from mistralclient.api.v2 import workflows
from mistralclient.commands.v2 import base as cmd_base
from mistralclient.commands.v2 import workflows as workflow_cmd
from mistralclient.tests.unit import base
WORKFLOW_DICT = {
'id': '1-2-3-4',
'name': 'a',
'namespace': '',
'project_... | {
"content_hash": "a2f246425226ab10d76bf1f36fc2cd07",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 76,
"avg_line_length": 29.513368983957218,
"alnum_prop": 0.5591592679833303,
"repo_name": "StackStorm/python-mistralclient",
"id": "61bec75263e26fe0d52e0959f2b3433937c0b704"... |
__version__ = '0.1.0'
default_app_config = 'fieldobjectpermissions.apps.FieldObjectPermissionsConfig'
| {
"content_hash": "ae152b3fc591e209bab157b5322d56ba",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 79,
"avg_line_length": 51,
"alnum_prop": 0.7843137254901961,
"repo_name": "aarcro/django-field-object-permissions",
"id": "ee8b51719aa983edbae860e56aad1ae301e94551",
"size":... |
from __future__ import unicode_literals
import django
from django.conf import settings
from django.test.client import Client as DjangoClient
from django.test.client import ClientHandler
from django.test import testcases
from django.utils.http import urlencode
from rest_framework.settings import api_settings
from rest_f... | {
"content_hash": "fed3f5a7eed42db27c21ef2d287d097e",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 99,
"avg_line_length": 37.91017964071856,
"alnum_prop": 0.6430263781393145,
"repo_name": "pratyushmittal/drf-extensions",
"id": "94b8da7ad076412b990049e529caff1f509ff45d",
... |
from __future__ import print_function
from setuptools import setup
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import io
import codecs
import os
import sys
# import opencvgui
here = os.path.abspath(os.path.dirname(__file__))
def read(*filenames, **kwargs):
... | {
"content_hash": "351eb028070f4c3ba04cd11aaeaaea4b",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 76,
"avg_line_length": 25.785714285714285,
"alnum_prop": 0.6592797783933518,
"repo_name": "smackesey/opencvgui",
"id": "e7ae330c0989532635bbc5612a16b99ba71be65f",
"size": "... |
def get_text_if_exists(node):
if 'text' in dir(node):
return node.text.strip()
return node
| {
"content_hash": "d251f18f1c6362d2c0438996e233ba54",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 32,
"avg_line_length": 26.75,
"alnum_prop": 0.616822429906542,
"repo_name": "wkentaro/utaskweb",
"id": "5fe4e544ca8458934a8ad88319207a8df4f3c71f",
"size": "156",
"binary":... |
import random
import itertools
import math
class coor:
def __init__(self, x, y):
self.x = x
self.y = y
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
else:
return False
def __ne__(self, other):
return not self.__eq__(other)
magicSquare = [
[... | {
"content_hash": "76cbe818cee582904fcdbe22c15bfe2f",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 97,
"avg_line_length": 24.233333333333334,
"alnum_prop": 0.6210453920220083,
"repo_name": "RoThePro/TicTacToeAI",
"id": "490bb1e59f5d14d5a252390ef4df69a9207a9dd2",
"size":... |
"""
CLE is an extensible binary loader. Its main goal is to take an executable program and any libraries it depends on and
produce an address space where that program is loaded and ready to run.
The primary interface to CLE is the Loader class.
"""
__version__ = "9.2.27.dev0"
if bytes is str:
raise Exception("Th... | {
"content_hash": "ee355a92eba91c80463517cc25a8fb53",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 118,
"avg_line_length": 29.96,
"alnum_prop": 0.7516688918558078,
"repo_name": "angr/cle",
"id": "bfd18cd7836aecccb8ffd086e28eb3dee1e28eae",
"size": "749",
"binary": false... |
from pysal.esda.getisord import G_Local
from collections import Counter
from .utils import *
from .patch_analysis import *
from .landscape_stats import *
def diversity_map_spatial_weights(world, weights):
return make_diversity_map(world, weights=weights)
def diversity_map(world, neighbor_func=get_moore_neighbor... | {
"content_hash": "cfc3ff225af31c4b3a5132c6c2678817",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 76,
"avg_line_length": 31.340425531914892,
"alnum_prop": 0.5627970128988459,
"repo_name": "emilydolson/avida-spatial-tools",
"id": "1174d813b94f2d5a65825c4c659c4f2f86e218b7",... |
"""Module for Shutdown event."""
from typing import Text
from ..event import Event
class Shutdown(Event):
"""Event that is emitted on shutdown of a launched system."""
name = 'launch.events.Shutdown'
def __init__(self, *, reason: Text = 'reason not given', due_to_sigint: bool = False) -> None:
... | {
"content_hash": "83abfb58279912e0100c3767ace55eb1",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 98,
"avg_line_length": 24.884615384615383,
"alnum_prop": 0.6012364760432767,
"repo_name": "ros2/launch",
"id": "c5fcdcdaee70f321b7c67b56038b807b341d028b",
"size": "1249",
... |
from django.test import TestCase
from zerver.middleware import is_slow_query
class SlowQueryTest(TestCase):
def test_is_slow_query(self):
# type: () -> None
self.assertFalse(is_slow_query(1.1, '/some/random/url'))
self.assertTrue(is_slow_query(2, '/some/random/url'))
self.assertTru... | {
"content_hash": "1359908dcb514118c5885aa0d442ccc5",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 81,
"avg_line_length": 50.588235294117645,
"alnum_prop": 0.6697674418604651,
"repo_name": "brockwhittaker/zulip",
"id": "a052090a6752e40ee1aab645332ab6d1109643bf",
"size": ... |
# Import a whole load of stuff
from System.IO import *
from System.Drawing import *
from System.Runtime.Remoting import *
from System.Threading import *
from System.Windows.Forms import *
from System.Xml.Serialization import *
from System import *
from DAQ.Environment import *
import time
def SMGo():
fileSystem = E... | {
"content_hash": "e21e3e46cf85a40c31d6778ae77e398b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 72,
"avg_line_length": 20.82857142857143,
"alnum_prop": 0.7681755829903978,
"repo_name": "ColdMatter/EDMSuite",
"id": "a4b3ae2cf1e4619b3f9a070ba2bf7e526d137489",
"size": "7... |
from flask.ext.restful import Api
from .health import Health
from publictitles import app, db
from publictitles.resources import TitleResource
api = Api(app)
api.add_resource(TitleResource, '/titles/<string:title_number>')
Health(app, checks=[db.health])
| {
"content_hash": "3dbccf86a526a63f28e09b8b11de9a57",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 64,
"avg_line_length": 25.8,
"alnum_prop": 0.7868217054263565,
"repo_name": "LandRegistry/public-titles",
"id": "885521bc00bc18a6cd83da70d55f8d65a8c1bf8c",
"size": "258",
... |
from django import http
from django.core.urlresolvers import reverse
from mox import IgnoreArg, IsA
from horizon import api
from horizon import test
INDEX_URL = reverse('horizon:syspanel:projects:index')
class TenantsViewTests(test.BaseAdminViewTests):
def test_index(self):
self.mox.StubOutWithMock(api... | {
"content_hash": "0a567cd6a4641c797ca5e06f650b859c",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 77,
"avg_line_length": 41.95384615384615,
"alnum_prop": 0.5925925925925926,
"repo_name": "asomya/test",
"id": "30d45579fdb000b93c814486ba8a3957b0db6de9",
"size": "3377",
... |
import frappe
from frappe.email.utils import get_port
def execute():
"""
1. Set default incoming email port in email domain
2. Set default incoming email port in all email account (for those account where domain is missing)
"""
frappe.reload_doc("email", "doctype", "email_domain", force=True)
frappe.reload_doc(... | {
"content_hash": "c64e14642c66803554a7a68e2c467642",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 100,
"avg_line_length": 33.27906976744186,
"alnum_prop": 0.7092941998602376,
"repo_name": "frappe/frappe",
"id": "766e31fe67a9bef20b8e308cf6f905f5062d97ec",
"size": "1431",... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
find_xpath_attr,
fix_xml_ampersands,
HEADRequest,
unescapeHTML,
url_basename,
RegexNotFound... | {
"content_hash": "cf33e8d59d15a26c39c3c2107c2dbb05",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 170,
"avg_line_length": 39.99256505576208,
"alnum_prop": 0.5526120096672243,
"repo_name": "janusnic/youtube-dl-GUI",
"id": "5ebc78033a4abbb98310096c279fe11459b4a791",
"siz... |
"""Implements usefule CSV utilities."""
from __future__ import absolute_import
from __future__ import unicode_literals
from builtins import next
from builtins import str as newstr
from builtins import range
from builtins import object
import csv
import os
import pandas as pd
import random
import sys
try:
from St... | {
"content_hash": "61f249a395afe3aa63db09dbd532d612",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 99,
"avg_line_length": 37.85964912280702,
"alnum_prop": 0.6524559777571826,
"repo_name": "parthea/pydatalab",
"id": "e0c75990d41e70135134705a8da7c66d7f5322fe",
"size": "70... |
from dataset.freeze.format.fjson import JSONSerializer
class TabsonSerializer(JSONSerializer):
def wrap(self, result):
fields = []
data = []
if len(result):
keys = result[0].keys()
fields = [{'id': k} for k in keys]
for row in result:
d ... | {
"content_hash": "7a75313156f5334f2abda4957ba82e0c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 54,
"avg_line_length": 26.5,
"alnum_prop": 0.47955974842767296,
"repo_name": "aashish24/dataset",
"id": "6b904682a4e35dedb866f1aa48b6e9825d46cfd9",
"size": "636",
"binary... |
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
import re
from mnb_makemnb import *
from mnb_misc import *
from mnb_rpc import *
import simplejson as json
def start_masternode(
mns_to_start,
protocolversion,
blockcount,
access,
client,
... | {
"content_hash": "8c31f96909807b4bcdc60782acec0e49",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 115,
"avg_line_length": 28.06451612903226,
"alnum_prop": 0.4528735632183908,
"repo_name": "chaeplin/dashmnb",
"id": "37bb323d4f81894ba0619e17270a2d3745d6f230",
"size": "34... |
"""Scraper for [Full name of court]
CourtID: [unique abbreviation to be used by software/filesystem]
Court Short Name: [standard abbreviation used in citations]
Author:
Reviewer:
History:
YYYY-MM-DD: Created by XXX
"""
from lxml import html
from juriscraper.OpinionSite import OpinionSite
from juriscraper.lib.string... | {
"content_hash": "5c5a4963788358c57c0584e38afdd622",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 77,
"avg_line_length": 34.272,
"alnum_prop": 0.6188141923436041,
"repo_name": "m4h7/juriscraper",
"id": "6548ce320bb87d0184752f8d21bcedea7685becb",
"size": "8568",
"bina... |
import logging
import sys
if (sys.version_info > (3,)):
from urllib.parse import quote
else:
from urllib import quote
from io import StringIO
import os
import jsonpickle
from cairis.test.CairisDaemonTestCase import CairisDaemonTestCase
from cairis.mio.ModelImport import importModelFile
import os
__author__ = 'Sham... | {
"content_hash": "e2c8d36303e8a756f69ae7ac4a5684d5",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 66,
"avg_line_length": 27.44736842105263,
"alnum_prop": 0.7056567593480345,
"repo_name": "failys/CAIRIS",
"id": "fd3e9d6f257756c6d2034bb8a3c46af81d1a9ecc",
"size": "1841",
... |
import os
import re
import shutil
import tempfile
import time
import jinja2
import jinja2.meta
import jsonschema
from rally.common.i18n import _, _LI
from rally.common import log as logging
from rally.common import objects
from rally import consts
from rally.deployment import engine as deploy_engine
from rally import... | {
"content_hash": "6526866c10ae3262a3e56632b2d75109",
"timestamp": "",
"source": "github",
"line_count": 459,
"max_line_length": 79,
"avg_line_length": 39.148148148148145,
"alnum_prop": 0.6082141465857867,
"repo_name": "group-policy/rally",
"id": "f7ade3ccd945359020b833bc581c6b3559d20def",
"size": "... |
class DJHostExtension:
""" Parse the host name to find the DJ name, and save info that
will be used in various places """
first = True # Parse the host name before anything else is done
needs = {'request'}
provides = {'djhost'}
def __init__(self, **args):
pass
def prepare(self,... | {
"content_hash": "781dd8651c1cfdae453c80e4ffe247f1",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 128,
"avg_line_length": 40.791666666666664,
"alnum_prop": 0.5975485188968335,
"repo_name": "bmillham/djrq2",
"id": "d8dba93a6c4460867311dbac77bacdc875067dbf",
"size": "979"... |
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
urlpatterns = [
url(r'^grappelli/', include('grappelli.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^chaining/', include('smart_selects.urls')),
url(r'^assesment_ma... | {
"content_hash": "ae7622d03ef0be06f687907959ae295c",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 74,
"avg_line_length": 40.18181818181818,
"alnum_prop": 0.7058823529411765,
"repo_name": "PayPal-Opportunity-Hack-Chennai-2015/ANEW",
"id": "eb3d7214be4155dd59feb736a932cbde1... |
from swgpy.object import *
def create(kernel):
result = Weapon()
result.template = "object/weapon/ranged/pistol/shared_pistol_republic_blaster_quest.iff"
result.attribute_template_id = 10
result.stfName("weapon_name","pistol_republic_blaster_quest")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ##... | {
"content_hash": "0bf07a2e22490a2c253e581daf9edf72",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 89,
"avg_line_length": 26.076923076923077,
"alnum_prop": 0.7168141592920354,
"repo_name": "obi-two/Rebelion",
"id": "ea8b69ae9cc59c2799d1e6f3bf58507fd36c61f9",
"size": "484... |
from typing import List
# @lc code=start
class Solution:
def compress(self, chars: List[str]) -> int:
if len(chars) < 2:
return len(chars)
head = 1
compare_idx = 0
store_idx = 0
n = len(chars)
chars.append(None)
while head <= n:
if cha... | {
"content_hash": "35402baaa8773ac062abb8393876976f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 69,
"avg_line_length": 28.942857142857143,
"alnum_prop": 0.4353405725567621,
"repo_name": "heyf/cloaked-octo-adventure",
"id": "96d9c1c5f86259af75e292e07b06b6424116e6bd",
"... |
import sys, re
from .lines_in import lines_in as generic_lines_in
major_version = sys.version_info[0]
minor_version = sys.version_info[1]
def local_func():
"""Return extra string for representation of a test-funtion-local function or class.
This allows for easy renaming of test functions with no impact on ... | {
"content_hash": "6e4e6134e2d60a7cf49e13be51d95258",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 171,
"avg_line_length": 35.608,
"alnum_prop": 0.6459222646596271,
"repo_name": "lhupfeldt/multiconf",
"id": "2906977a9b962f597cb3329943c5a17456396364",
"size": "4582",
"... |
from star import load, save | {
"content_hash": "78e00447fa1153d52020a8a67fe4d112",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 27,
"avg_line_length": 27,
"alnum_prop": 0.8148148148148148,
"repo_name": "craigyk/pystar",
"id": "e68cf191f47244567398e16ca5b1aaaca20afacb",
"size": "28",
"binary": false... |
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', 'main.views.home', name='home'),
url(r'^changeset_added/$', 'main.views.changeset_added',
name='changeset_added'),
url(r'^checkout/$', 'm... | {
"content_hash": "fd6979f3fae145f830583e88e2719937",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 107,
"avg_line_length": 38.568627450980394,
"alnum_prop": 0.6034570411794611,
"repo_name": "boldprogressives/akcode",
"id": "cb3d3a7fccea6be987c4bcf65aa017b84e63d4bb",
"siz... |
from __future__ import division
from future.builtins import str, range, object
from past.utils import old_div
import re
import importlib
import time
import math
import json
import datetime
from collections import deque
from bson import ObjectId
import uuid
import shlex
#
# Utils are functions that should be independen... | {
"content_hash": "286f09d7eaae9b225f485cea9f5f6929",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 96,
"avg_line_length": 27.858131487889274,
"alnum_prop": 0.5435349646006707,
"repo_name": "pricingassistant/mrq",
"id": "72d84a60ee4fbb1ccbecc53fa70886df56dc58c0",
"size":... |
import boto
import os
import re
import urllib.parse
from boto.s3 import connection
from wal_e import log_help
from wal_e.exception import UserException
logger = log_help.WalELogger(__name__)
_S3_REGIONS = {
# See http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
'ap-northeast-1': 's3-ap-north... | {
"content_hash": "3ee56e36a9428874fa9ae7403a3ae53a",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 79,
"avg_line_length": 33.904761904761905,
"alnum_prop": 0.6211106309420916,
"repo_name": "ajmarks/wal-e",
"id": "9f20ff2644927172126e1d2655895b59b22255d6",
"size": "9256"... |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
# url(r'^$', 'blog.views.home', name='home'),
)
| {
"content_hash": "1074bbcacefb8c140fd07029adf2e741",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 51,
"avg_line_length": 26.4,
"alnum_prop": 0.6515151515151515,
"repo_name": "Abildin/apt_hw4",
"id": "d524e26d5535a00dae020cb65c5286bd5f5d826f",
"size": "132",
"binary": f... |
import os
import re
from flask import render_template_string
import requests
from bs4 import BeautifulSoup
from app import models
from app.models import Setting, UploadedFile, Page, db, Entity, MenuItem
from app.utils import get_theme_folder
session = requests.Session()
def scrape_inputs(html):
"""Function to s... | {
"content_hash": "5150b610f2e9e3df36dc41de225e79d2",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 183,
"avg_line_length": 31.90740740740741,
"alnum_prop": 0.648674792029406,
"repo_name": "dkmva/igem-wiki-wizard",
"id": "de414d1e0f829427f7963cdb63099c51d9633239",
"size"... |
"""
Scripts that make up subcommands to the `nlp` command.
Every Python file in this directory should have
a `main()` function decorated with any necessary
`@click.option` decorators for options specific
to that command.
"""
| {
"content_hash": "e6f54007ccbb710871074aa8c821e3d5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 54,
"avg_line_length": 28.25,
"alnum_prop": 0.7654867256637168,
"repo_name": "jamesmishra/nlp-playground",
"id": "52e23416432ea296b3ac1a09eeb13e4f61b9f32c",
"size": "226",
... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name = 'chirp_modbus',
version = '1.0.2',
license = 'Apache License, Version 2.0',
author = 'Albertas Mickenas',
author_email = 'mic@wemakethings.net',
url = 'https://github.com/Miceuz/rs485-moist-sensor',
descrip... | {
"content_hash": "0c9ce535ee95b2e10dab19a4df8e907a",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 97,
"avg_line_length": 38.74285714285714,
"alnum_prop": 0.6438053097345132,
"repo_name": "Miceuz/rs485-moist-sensor",
"id": "ae6ad36b23bf335f81dd8799b14d5ae87ee7f268",
"siz... |
from __future__ import (
absolute_import,
with_statement,
)
import logging
import sys
import unittest
import inspect
from random import getrandbits
from contextlib import contextmanager
from copy import deepcopy
from types import FunctionType
from collections import Mapping
class CascadingFailureError(Assert... | {
"content_hash": "f515b0e3f36efef3cc88c0a12a2d4b83",
"timestamp": "",
"source": "github",
"line_count": 2012,
"max_line_length": 79,
"avg_line_length": 34.87127236580517,
"alnum_prop": 0.5463291572240988,
"repo_name": "SalmonMode/contextional",
"id": "47d61b5416bcd9321298fd80e83ab24bcd296a54",
"siz... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.