text stringlengths 4 1.02M | meta dict |
|---|---|
r"""Command-line tool to generate boilerplate DV testbench.
The generated objects are extended from dv_lib / cip_lib.
"""
import argparse
import logging as log
import re
import sys
import gen_agent
import gen_env
VENDOR_DEFAULT = "lowrisc"
def main():
parser = argparse.ArgumentParser(
description=__doc... | {
"content_hash": "da2cbd8f526f44ba5875c84c0c57b810",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 80,
"avg_line_length": 32.903225806451616,
"alnum_prop": 0.5774509803921568,
"repo_name": "lowRISC/opentitan",
"id": "5cca559ddf9f819b1dd1bc784571ea428d47fb6a",
"size": "5... |
from .harvester import Harvester
| {
"content_hash": "fc200f360001eaf84f8197158deda56e",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 32,
"avg_line_length": 33,
"alnum_prop": 0.8484848484848485,
"repo_name": "mechaphish/colorguard",
"id": "80c4aa2a19fc841365373b217ca4ee524f153853",
"size": "33",
"binary"... |
import unittest
from datetime import date
import holidays
class TestBelgium(unittest.TestCase):
def setUp(self):
self.holidays = holidays.BE()
def test_2017(self):
# https://www.belgium.be/nl/over_belgie/land/belgie_in_een_notendop/feestdagen
self.assertIn(date(2017, 1, 1), self.holi... | {
"content_hash": "7f930e0e5c3de174df3aef002d714a11",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 86,
"avg_line_length": 39.208333333333336,
"alnum_prop": 0.6493092454835282,
"repo_name": "dr-prodigy/python-holidays",
"id": "990bb9965a728e07ba1a277e4399f408365ef8a7",
"s... |
#!/usr/bin/python
# Copyright (c) 2014 Wladmir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory that... | {
"content_hash": "5a20f70fb79e72aa91d283a954432d58",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 98,
"avg_line_length": 31.833333333333332,
"alnum_prop": 0.5743227862508536,
"repo_name": "ravenbyron/phtevencoin",
"id": "f3c6d3f1805efb6e3b635913c3d5002780f6ead9",
"size... |
import sys
import pytest
import logging
import datetime
import hathitables
from six import StringIO
from dateutil.parser import parse as parse_date
if sys.version_info[0] < 3:
import unicodecsv as csv
else:
import csv
logging.basicConfig(filename='test.log', level=logging.DEBUG)
def test_collection_ids():
... | {
"content_hash": "a122b5f42dbfcdf5b823eda21d203ac3",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 155,
"avg_line_length": 33.56140350877193,
"alnum_prop": 0.6275483533716676,
"repo_name": "umd-mith/hathitables",
"id": "cf658976e774e0737317c899d1e33d06022e58a9",
"size":... |
import synapse.lib.module as s_module
class PsModule(s_module.CoreModule):
def getModelDefs(self):
modl = {
'types': (
('edu:course', ('guid', {}), {
'doc': 'A course of study taught by an org.',
}),
('edu:class', ('guid', {}),... | {
"content_hash": "6c878e95668e0b8113fc4c6e523b8702",
"timestamp": "",
"source": "github",
"line_count": 458,
"max_line_length": 113,
"avg_line_length": 50.89737991266376,
"alnum_prop": 0.34700356055081294,
"repo_name": "vertexproject/synapse",
"id": "be6f07867824fcbb688b815035f40e25b518ae6d",
"size... |
from enum import Enum
class CheckoutErrorCode(Enum):
BILLING_ADDRESS_NOT_SET = "billing_address_not_set"
CHECKOUT_NOT_FULLY_PAID = "checkout_not_fully_paid"
GRAPHQL_ERROR = "graphql_error"
INSUFFICIENT_STOCK = "insufficient_stock"
INVALID = "invalid"
INVALID_SHIPPING_METHOD = "invalid_shipping... | {
"content_hash": "45fd9fe0b687bf5da0b42f079174bc84",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 69,
"avg_line_length": 39.04545454545455,
"alnum_prop": 0.7077997671711292,
"repo_name": "maferelo/saleor",
"id": "3fbdefef44c8fad553b6d4638fd153d9e963b116",
"size": "859",... |
from datetime import datetime
from itertools import chain
from _sha256 import sha224
from uuid import uuid4
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.core.exceptions import ObjectDoesNotExist
from django.db import models, transaction
from ngnotifier.utils import hash_over, p... | {
"content_hash": "32f4e0de3bd6c6ee5a90e37292676004",
"timestamp": "",
"source": "github",
"line_count": 437,
"max_line_length": 101,
"avg_line_length": 35.62242562929062,
"alnum_prop": 0.5622791803173379,
"repo_name": "Dubrzr/NG-Notifier",
"id": "bcfd158393199718459b3608a8cd52c1f54d9ce0",
"size": "... |
import github
class GitHubRepo():
def __init__(self, oauth_token, repo_owner, repo_name):
self.git = github.Github(oauth_token)
self.repo_owner = repo_owner
self.repo_name = repo_name
self.user = self.git.get_user()
self.repo = None
try:
self.repo = s... | {
"content_hash": "67a9aa65a58e159ded0072ab0beda6bf",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 79,
"avg_line_length": 26.355555555555554,
"alnum_prop": 0.5261382799325464,
"repo_name": "ndahlquist/whaler",
"id": "bb3549f2862abd19afad42262621922597dc06e1",
"size": "11... |
from models import *
import pytest
@pytest.mark.parametrize("api_key", ["123456789", "abcdefg", "abc123"])
def test_correct_api_key(api_key):
assert APIKey(api_key=api_key).api_key == api_key
@pytest.mark.parametrize("api_key", ["\x00", "abc/abc", "abc'abc", "abc--abc"])
def test_bad_api_key(api_key):
try:... | {
"content_hash": "f474a4590ebd4bd21e8f87405c6ac0d9",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 100,
"avg_line_length": 29.4,
"alnum_prop": 0.6239067055393586,
"repo_name": "googleinterns/vt-usage",
"id": "6f6eb0697c5e0a7b5ead18db273e930e760e342c",
"size": "1605",
"... |
import unittest
from sklearn.linear_model import Ridge
from autosklearn.pipeline.components.feature_preprocessing.fast_ica import \
FastICA
from autosklearn.pipeline.util import _test_preprocessing, PreprocessingTestCase, \
get_dataset
import sklearn.metrics
class FastICAComponentTest(PreprocessingTestCase):... | {
"content_hash": "bbda86cc023d9181f1642d14ae24a2e1",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 83,
"avg_line_length": 43.90243902439025,
"alnum_prop": 0.6372222222222222,
"repo_name": "hmendozap/auto-sklearn",
"id": "c330ba5a9b663bbd565ad7400f41dbac34566e6a",
"size":... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import boto3
import logging
from .ui import ui
logger = logging.getLogger(__name__)
# A global credential cache that can be shared among boto3 sessions. This is
# inherently threadsafe thanks to the GIL:
# h... | {
"content_hash": "9c4bc5bca23ae6bbd309e4f2cbf53cd8",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 76,
"avg_line_length": 29.431818181818183,
"alnum_prop": 0.6764478764478764,
"repo_name": "remind101/stacker",
"id": "9442d472659be7d5cbb4a510e0bea0ae93312f4d",
"size": "12... |
'''
This script mines data from Fedora package databases (available on any Fedora
mirror under os/repodata) and puts it in another database.
The names of the files that are needed end in "filelists.sqlite.bz2"
(file list database) and "primary.sqlite.bz2" (package database)
Example: linux/releases/24/Everything/x86_6... | {
"content_hash": "f09dd1c8d5d1ccfafed7d202e6ca361e",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 190,
"avg_line_length": 38.190140845070424,
"alnum_prop": 0.6125760649087221,
"repo_name": "armijnhemel/binaryanalysis",
"id": "fc492c43df2acd912ded24b612a43b2ae779f896",
... |
""" TensorFlow Speech2Text model."""
import random
from typing import Dict, Optional, Tuple, Union
import numpy as np
import tensorflow as tf
from ...activations_tf import get_tf_activation, glu
from ...modeling_tf_outputs import (
TFBaseModelOutput,
TFBaseModelOutputWithPastAndCrossAttentions,
TFSeq2Se... | {
"content_hash": "15939a3316e7f3fc5b86f0b6fd8cc5bf",
"timestamp": "",
"source": "github",
"line_count": 1487,
"max_line_length": 221,
"avg_line_length": 46.11903160726295,
"alnum_prop": 0.6266787208912349,
"repo_name": "huggingface/transformers",
"id": "364b515024bdc9f76693ad6cda3ccf7212bbf1b8",
"s... |
'''
author: Fabio Zanini
date: 16/03/15
content: Test script for the elastic net clustering.
'''
# Modules
import os
import sys
import numpy as np
from Bio import AlignIO
from matplotlib import cm
import matplotlib.pyplot as plt
from clusterforce.clustering import cluster_force
from clusterforce.utils.seq... | {
"content_hash": "f92e5bf10093508df8ddfb45d22593a8",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 59,
"avg_line_length": 20.37037037037037,
"alnum_prop": 0.6154545454545455,
"repo_name": "iosonofabio/clusterforce",
"id": "2c2a50a7a303ae3374f5faa1e2f386ae503ded72",
"size... |
import json
import mock
import os
import glance_store
from oslo_concurrency import processutils as putils
from oslo_config import cfg
import six
from six.moves import urllib
from taskflow import task
from taskflow.types import failure
import glance.async.flows.base_import as import_flow
from glance.async import taskf... | {
"content_hash": "3013aa6767a355eda795bcdc5b144393",
"timestamp": "",
"source": "github",
"line_count": 424,
"max_line_length": 79,
"avg_line_length": 40.632075471698116,
"alnum_prop": 0.5345948456001858,
"repo_name": "stevelle/glance",
"id": "bbc708d22afc071f8a66e5ba816015838a31c20c",
"size": "178... |
from os.path import isdir
from os.path import join as opj
import copy
import itertools
import numpy as np
import pandas as pd
from pandas import read_csv
import nibabel as nib
from nistats.design_matrix import make_first_level_design_matrix
from nistats.first_level_model import FirstLevelModel
from nilearn.decoding imp... | {
"content_hash": "51ed2c93d0d52280cae72274fa7cc681",
"timestamp": "",
"source": "github",
"line_count": 376,
"max_line_length": 166,
"avg_line_length": 43.6063829787234,
"alnum_prop": 0.6085630641619907,
"repo_name": "nilearn/nilearn_sandbox",
"id": "1cf45a415dbb65f69569ab172490cfe42b490a92",
"size... |
""""""
__title__ = "Joy"
__author__ = "DeflatedPickle"
__version__ = "1.0.0"
class Joy(object):
"""Gives an entity joy."""
def __init__(self, joy: int=80, lowest_joy: int=0, highest_joy: int=100):
self._joy = joy
self._lowest_joy = lowest_joy
self._highest_joy = highest_joy
def ... | {
"content_hash": "7b6dd8153bb0e9d9d977dd169c59236e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 77,
"avg_line_length": 21.310344827586206,
"alnum_prop": 0.5663430420711975,
"repo_name": "DeflatedPickle/Colony",
"id": "ec1980153aaca4004447f2194308aff16daef552",
"size":... |
"""
Verifies system apps are running.
"""
import unittest
from treadmill import admin
from treadmill import context
from treadmill import checkout as chk
from treadmill import zknamespace as z
def test():
"""Create sysapps test class."""
admin_srv = admin.Server(context.GLOBAL.ldap.conn)
cell = context.... | {
"content_hash": "6630cb4f482086e3ee6e24d48f94e80d",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 76,
"avg_line_length": 32.31666666666667,
"alnum_prop": 0.6585869004641568,
"repo_name": "ThoughtWorksInc/treadmill",
"id": "7b00df3575be3f20dd2d33ad0b2ad80dbd2a408c",
"siz... |
"""Module for handling authentication"""
import getpass
from os import path
import paramiko
_AUTH_FILE = '.egta_auth_token'
_SEARCH_PATH = [_AUTH_FILE, path.expanduser(path.join('~', _AUTH_FILE))]
USER = 'deployment'
DOMAIN = 'egtaonline.eecs.umich.edu'
def load():
"""Load an authorization token"""
for fil... | {
"content_hash": "a879e96cbf21466b85a410376d2fa9ee",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 76,
"avg_line_length": 31.77777777777778,
"alnum_prop": 0.5979020979020979,
"repo_name": "egtaonline/egtaonline-api",
"id": "5718fc4ba8c0e97099e123cc56fd5ad089ac4fcc",
"siz... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "b30f864b80e3661052a7a57fae1e4d2d",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 120,
"avg_line_length": 37.64102564102564,
"alnum_prop": 0.7418256130790191,
"repo_name": "maocorte/ambari-tachyon-service",
"id": "ec3a5229e60445de88fef6bdf7416911401330c2",... |
import eventlet
eventlet.monkey_patch()
import functools
import json
import logging
import sys
import flask
from oslo_config import cfg
from oslo_utils import uuidutils
from ironic_discoverd.common.i18n import _, _LC, _LE, _LI, _LW
# Import configuration options
from ironic_discoverd import conf # noqa
from ironic_... | {
"content_hash": "75f649a409d961afbbbd067d22bac599",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 79,
"avg_line_length": 31.512953367875646,
"alnum_prop": 0.6177244327523841,
"repo_name": "rdo-management/ironic-discoverd",
"id": "d03c3022bc16364b55e7c86d6f2968ef28d52eb0"... |
__author__ = 'ddeconti'
import numpy
import pickle
from rdkit.Chem import AllChem, MolFromSmiles
from rdkit import DataStructs
import sys
def parse_smiles(rf, fda_filename):
try:
handle = open(fda_filename, 'rU')
except IOError:
sys.stderr.write("IOError\n")
sys.exit()
fpm_list = ... | {
"content_hash": "0bae7a99565989b6e30af2c792eaa9f6",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 68,
"avg_line_length": 25.8125,
"alnum_prop": 0.552865213882163,
"repo_name": "dkdeconti/PAINS-train",
"id": "127633496aec3a2cfc330e70cd7e7c14ef1ce1b2",
"size": "1239",
"... |
from .. import abc
from . import util as source_util
from importlib import machinery
import errno
import imp
import os
import py_compile
from test.support import make_legacy_pyc
import unittest
import warnings
class FinderTests(abc.FinderTests):
"""For a top-level module, it should just be found directly in the... | {
"content_hash": "3f8525c5aa2a9e72d06a3166f03e4ba9",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 80,
"avg_line_length": 38.48717948717949,
"alnum_prop": 0.5962691538974018,
"repo_name": "maxdeliso/elevatorSim",
"id": "8bc16a542eebf056074924ce9a2bcc577bb6c303",
"size":... |
from optparse import OptionParser, OptionGroup
from uuparser.options_manager import OptionsManager
import pickle, os, time, sys, copy, itertools, re, random
import dynet_config
from loguru import logger
from shutil import copyfile
from uuparser import utils
def run(experiment,options):
if options.graph_based:
... | {
"content_hash": "7884795da6e18850e636764c595bcac7",
"timestamp": "",
"source": "github",
"line_count": 328,
"max_line_length": 171,
"avg_line_length": 52.94207317073171,
"alnum_prop": 0.6287935502447451,
"repo_name": "UppsalaNLP/uuparser",
"id": "a4d50e5564575104172648e7d31cefef898956cf",
"size": ... |
import os
import subprocess
def name():
return "Unix"
def generator(self, filename, code):
print code
#code = "bash -c '%s'" % code
#os.system(code)
#pipe = subprocess.Popen(code, shell=True, stdout=subprocess.PIPE).stdout
#buffer = str("".join(pipe.readlines()))
#print buffer
#print `pwd`
p = subprocess.P... | {
"content_hash": "0be143818bc6458cc488b52111b8a475",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 89,
"avg_line_length": 27.77777777777778,
"alnum_prop": 0.698,
"repo_name": "gdubost1/shaderman",
"id": "7a63841065dd8048093bfcb0255e963dfe63cd21",
"size": "500",
"binary... |
import argparse
import os
import logging
import platform
import re
import subprocess
import urllib2
import json
from core import path_util
from telemetry import benchmark
from telemetry.core import discover
from telemetry.util import command_line
from telemetry.util import matching
CHROMIUM_CONFIG_FILENAME = 'tools... | {
"content_hash": "fe97cd54b43df251d24b1a34ece4c87c",
"timestamp": "",
"source": "github",
"line_count": 507,
"max_line_length": 80,
"avg_line_length": 38.285996055226825,
"alnum_prop": 0.6479315851836588,
"repo_name": "heke123/chromium-crosswalk",
"id": "866c2d5189212c5ff2d1346bf363e7302d15566b",
"... |
from astroplan import FixedTarget
from astropy.coordinates import SkyCoord
from pocs import PanBase
class Field(FixedTarget, PanBase):
def __init__(self, name, position, equinox='J2000', **kwargs):
""" An object representing an area to be observed
A `Field` corresponds to an `~astroplan.Observi... | {
"content_hash": "c490bc2762b41e815330232ecc3b821d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 106,
"avg_line_length": 37.4375,
"alnum_prop": 0.4323873121869783,
"repo_name": "AstroHuntsman/POCS",
"id": "901eafd3970683fc02495cb331ca637f7b59c881",
"size": "1797",
"b... |
"""
Created on Thu Aug 25 20:46:08 2016
@author: abhibhat
"""
import logging
LOGGER = None
class BinaryTreeExp(Exception):
pass
class BinaryTree(object):
def __init__(self, arr, depth, no_of_queries):
self.arr = arr
self.depth = depth
self.no_of_queries = no_of_queries
self.... | {
"content_hash": "24024b9bb15d81152383795351af7382",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 84,
"avg_line_length": 36.77450980392157,
"alnum_prop": 0.5146627565982405,
"repo_name": "itabhijitb/AHC_BinaryTree",
"id": "33ac1498aa1da82a57e0f626b068186f18ee3998",
"si... |
__author__ = "$Author: bolme $"
__version__ = "$Rev: 625 $"
__info__ = "$Id: PhaseCorrelation.py 625 2008-03-24 20:24:37Z bolme $"
__copyright__ = "Copyright 2006 David S Bolme"
import numpy as np
import pyvision as pv
def PhaseCorrelation(tile1, tile2, phase_only=True, ilog=None):
'''
Uses phase correlation... | {
"content_hash": "c84daca25e41cf7855b39c067ba1eb60",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 116,
"avg_line_length": 29.29787234042553,
"alnum_prop": 0.6085693536673928,
"repo_name": "svohara/pyvision",
"id": "875b85fc4de1c7918e36ec4509dd864a4134c596",
"size": "70... |
import datetime
import ddt
import mock
from oslo_serialization import jsonutils
import six
import webob
from manila.api.v1 import share_snapshots
from manila.common import constants
from manila import context
from manila import db
from manila import exception
from manila.share import api as share_api
from manila impo... | {
"content_hash": "112e838112a211802d362ca5e33cb46b",
"timestamp": "",
"source": "github",
"line_count": 523,
"max_line_length": 79,
"avg_line_length": 37.734225621414915,
"alnum_prop": 0.5089941727894604,
"repo_name": "scality/manila",
"id": "4fac14416dc717ada6109deac31d8d2f1de87c95",
"size": "2035... |
"""
Object definition for processing C WS Core (version 2) usage packets.
"""
from globus.usage.cusagepacket import CUsagePacket
class CWSCoreV1Packet(CUsagePacket):
"""
C WS Core Usage Packet v1.
"""
insert_statement = """
INSERT INTO c_ws_core_packets (
component_code,
... | {
"content_hash": "e0aa91bbc5f7d79720919e840c6afff1",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 69,
"avg_line_length": 25.11111111111111,
"alnum_prop": 0.5652654867256637,
"repo_name": "globus/globus-toolkit",
"id": "33849b01ebbad83bac942fc232bd43f08b908931",
"size": ... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("ddcz", "0064_prefill_ids"),
]
operations = [
migrations.RunSQL("ALTER TABLE `mentat_newbie` DROP PRIMARY KEY;"),
# This migration is skipped given the command above reconciles diffe... | {
"content_hash": "2a3f4cddf5560d345d2ed5baf038d932",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 92,
"avg_line_length": 29.473684210526315,
"alnum_prop": 0.6125,
"repo_name": "dracidoupe/graveyard",
"id": "12bc922bea076a8b7570fd3d2cc10a03afb006d4",
"size": "610",
"bi... |
"""
Copyright (c) 2011-2015 Eric R. Jeschke
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 source code must retain the above copyright
notice, this list of conditions and th... | {
"content_hash": "834767340fcf2c9d1597bfd2402c72fa",
"timestamp": "",
"source": "github",
"line_count": 485,
"max_line_length": 86,
"avg_line_length": 39.068041237113405,
"alnum_prop": 0.5641228625712477,
"repo_name": "sosey/ginga",
"id": "2a3126da9ad57b89e5d5d5d818cc11cc48af1753",
"size": "19064",... |
import random
import sacred.optional as opt
from sacred.settings import SETTINGS
from sacred.utils import module_is_in_cache
SEEDRANGE = (1, int(1e9))
def get_seed(rnd=None):
if rnd is None:
return random.randint(*SEEDRANGE)
else:
try:
return rnd.integers(*SEEDRANGE, dtype=int)
... | {
"content_hash": "d01580252649f3d2e94344ce42842806",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 80,
"avg_line_length": 25.6,
"alnum_prop": 0.6206597222222222,
"repo_name": "IDSIA/sacred",
"id": "f028349e044ea4ac17768ba6f0773c5225c65fd7",
"size": "1190",
"binary": fa... |
from app import app
from app.authentication import with_login
from flask import Blueprint, jsonify, request, redirect
from marshmallow import Schema, fields
from app.request_schema import with_request_schema
from app.models import db, User, UserSessionToken, AWSKey
import app.models as models
from app.intercom import a... | {
"content_hash": "0d24a24d4966009cb482159f16231f04",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 148,
"avg_line_length": 33.386160714285715,
"alnum_prop": 0.5861469546031959,
"repo_name": "giubil/trackit",
"id": "497209547ff09c4ed74273afb4fee61bb75780db",
"size": "149... |
import html2text
import sys, os
# set up the HTML to markdown converter
converter = html2text.HTML2Text()
converter.ignore_links = False
# make a directory to put the converted markdown into
generated_directory = 'generated'
if not os.path.exists(generated_directory):
os.makedirs(generated_directory)
# loop over... | {
"content_hash": "1b574054f5703cad02541eadddd62480",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 66,
"avg_line_length": 29.48148148148148,
"alnum_prop": 0.678391959798995,
"repo_name": "ashlibaldwin/coding-for-managers",
"id": "418d237c8b1a60bc11e5ecc31ee255d5220bd6aa",
... |
"""Tests for RNN cells."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
from tensorflow.contrib import rnn as contrib_rnn
from tensorflow.contrib.rnn.python.ops import core_rnn_cell
from tensorflow.contrib.rnn.python.ops im... | {
"content_hash": "ccaac7f0ec80e70cc94618cee648cd23",
"timestamp": "",
"source": "github",
"line_count": 1061,
"max_line_length": 82,
"avg_line_length": 42.736098020735156,
"alnum_prop": 0.5927706591976711,
"repo_name": "manipopopo/tensorflow",
"id": "85f0f8ced91e15cd0f9b3bc51f3a9e3aee12c978",
"size... |
"""
Check for IOOS-approved attributes
"""
import re
from numbers import Number
import validators
from cf_units import Unit
from lxml.etree import XPath
from owslib.namespaces import Namespaces
from compliance_checker import base
from compliance_checker.acdd import ACDD1_3Check
from compliance_checker.base import (
... | {
"content_hash": "049fda2f66b36a27e0f6336bf472f7b8",
"timestamp": "",
"source": "github",
"line_count": 2027,
"max_line_length": 230,
"avg_line_length": 34.91317217562901,
"alnum_prop": 0.5177549492009214,
"repo_name": "aodn/compliance-checker",
"id": "0d1fe292140cbdea483f1c2457125649848a2274",
"si... |
from amqpstorm.compatibility import json
from amqpstorm.compatibility import quote
from amqpstorm.management.base import ManagementHandler
from amqpstorm.message import Message
API_BASIC_PUBLISH = 'exchanges/%s/%s/publish'
API_BASIC_GET_MESSAGE = 'queues/%s/%s/get'
class Basic(ManagementHandler):
def publish(sel... | {
"content_hash": "aad144fc9fa4c418ca63790904647240",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 79,
"avg_line_length": 38.84782608695652,
"alnum_prop": 0.534135422495803,
"repo_name": "fake-name/ReadableWebProxy",
"id": "24cd73f5942d49c0550b0723caf39e23dc57972a",
"siz... |
from soppa.contrib import *
class ModParent(Soppa):
voodoo = True
class ModC(ModParent):
modc_left = 'left'
var = 'modc'
def voodoo(self):
return False
| {
"content_hash": "7a9ae9e353b4f9b0445cdf4bcf5860b8",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 27,
"avg_line_length": 17.8,
"alnum_prop": 0.6292134831460674,
"repo_name": "futurice/fabric-deployment-helper",
"id": "80707b1b50d62b31835923f907e970102361ae7d",
"size": "... |
"""Core control stuff for coverage.py."""
import atexit
import collections
import contextlib
import os
import os.path
import platform
import sys
import time
import warnings
from coverage import env
from coverage.annotate import AnnotateReporter
from coverage.collector import Collector, CTracer
from coverage.config im... | {
"content_hash": "927ea6168a1a1cc88dc426672746566b",
"timestamp": "",
"source": "github",
"line_count": 1168,
"max_line_length": 100,
"avg_line_length": 37.00856164383562,
"alnum_prop": 0.6117151714246055,
"repo_name": "hugovk/coveragepy",
"id": "ae4b14b39039e47814d325204ce402b123015caa",
"size": "... |
import sys
import os
sys.path.insert(0, '.')
MODULE_PATH = os.path.split(os.path.realpath(__file__))[0]
from instagram.client import InstagramAPI
import requests
from io import BytesIO
from instacommander.images import ANSIImage
from tempfile import NamedTemporaryFile
view = """\
--------
{img}
{media.user}
{media.c... | {
"content_hash": "d01d11b3e237f983dece7c8f00600863",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 117,
"avg_line_length": 27.783333333333335,
"alnum_prop": 0.6634673065386922,
"repo_name": "msarfati/InstaCommander",
"id": "93ef3e84527177a864c8e9b926eebefc236a3fa5",
"siz... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/goggles/shared_goggles_s04.iff"
result.attribute_template_id = 11
result.stfName("wearables_name","goggles_s01")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "db853c6f24183847f5bda5ec3b6cbd05",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 77,
"avg_line_length": 24.153846153846153,
"alnum_prop": 0.7070063694267515,
"repo_name": "anhstudios/swganh",
"id": "a99ef6ca7d32c41da6acfaf9fc97d9846ce78a26",
"size": "45... |
import doctest
import zc.customdoctests
from cr8.run_crate import CrateNode
import os
import time
import shutil
import json
import re
import random
import tempfile
import subprocess
import unittest
from functools import partial
from testutils.paths import crate_path, project_path
from crate.crash.command import CrateSh... | {
"content_hash": "948a433d50b4ac586918db7846aa0506",
"timestamp": "",
"source": "github",
"line_count": 496,
"max_line_length": 101,
"avg_line_length": 32.368951612903224,
"alnum_prop": 0.5800685144814699,
"repo_name": "EvilMcJerkface/crate",
"id": "01404e21a013e749b369fa9cbbf7587792c6926c",
"size"... |
from django.contrib.gis.db import models
from django.utils.translation import ugettext_lazy as _
class BaseDistrict(models.Model):
"""A base area that is all one zoning type."""
objects = models.GeoManager()
geometry = models.MultiPolygonField(_('geometry'))
zoning_type = models.ForeignKey(
... | {
"content_hash": "52e98d8359d433ac69e5b3c11b9298cd",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 75,
"avg_line_length": 28.264705882352942,
"alnum_prop": 0.6462018730489074,
"repo_name": "ebrelsford/django-phillydata",
"id": "39cac38c9cc8060da7c641b24c7bee96e24ef2b1",
... |
import mimetypes
import re
from optparse import make_option
from urllib.parse import urlparse
from . import InventoryCommand
from inventory.models import Dataset, Distribution
mimetypes.init()
class Command(InventoryCommand):
help = 'Normalizes property values'
option_list = InventoryCommand.option_list + ... | {
"content_hash": "0cdbc2b8e5cc3e96e3c2b4de6edc9fb6",
"timestamp": "",
"source": "github",
"line_count": 980,
"max_line_length": 192,
"avg_line_length": 43.795918367346935,
"alnum_prop": 0.6347390493942218,
"repo_name": "opennorth/inventory",
"id": "957977cedda8e3de3e92665bf4d18973b75e9791",
"size":... |
"""
utils
"""
from ..settings import STATIC_URL, ENV
try:
from ..settings import URL_PATH_PREFIX
except ImportError:
URL_PATH_PREFIX = None
def getPrefix(request):
"""
getPrefix of multi-user URL
/bigpandamon/ --> '/bigpandamon'
"""
if URL_PATH_PREFIX is not None:
return URL... | {
"content_hash": "247f3c8199c4493e4f6c9a189a228701",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 68,
"avg_line_length": 18.48780487804878,
"alnum_prop": 0.558047493403694,
"repo_name": "PanDAWMS/panda-bigmon-core-old",
"id": "8a18e7a07644d998ad4fd0775b13e3f2d7eff46e",
... |
"""
The engine for the metrics API which stores definitions an backend API
operations. This module defines the communication between API requests
and UserMetric objects, how and where request responses are stored, and
how cohorts are parsed from API request URLs.
Cohort request parsing
~~~~~... | {
"content_hash": "76d2240b77baa6fe0c7599c2da1698e5",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 78,
"avg_line_length": 30.70718232044199,
"alnum_prop": 0.6399784094998201,
"repo_name": "wikimedia/analytics-user-metrics",
"id": "1d4d2dfb95326fde4cd10b3a06de3f3bef4e5246"... |
from anthill.common import access
from anthill.common.database import DatabaseError
from anthill.common.model import Model
class GamespaceAdapter(object):
def __init__(self, data):
self.gamespace_id = data.get("gamespace_id")
self.scopes = data.get("gamespace_scopes")
self.title = data.get... | {
"content_hash": "269c9d4b6514170080d0909b8c7b1a8f",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 112,
"avg_line_length": 33.99375,
"alnum_prop": 0.5316234601948888,
"repo_name": "anthill-services/anthill-login",
"id": "b6e69ec91e47be038fdaf74248b70fc1b1fa7782",
"size"... |
import logging
import time
import dockercloud
from config import API_RETRY
logger = logging.getLogger("workerlistgen")
def fetch_remote_obj(uri):
if not uri:
return None
while True:
try:
obj = dockercloud.Utils.fetch_by_resource_uri(uri)
return obj
except Ex... | {
"content_hash": "75235551cf3c10993f5165d2dc987c37",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 64,
"avg_line_length": 20.526315789473685,
"alnum_prop": 0.5769230769230769,
"repo_name": "citusdata/dockercloud-workerlist-gen",
"id": "323f65855328241f8328346b2b159bf108247... |
from nose.tools import assert_equal, assert_raises
from pyflu.jsonalize import JSONAlizable, dumps, loads, NameConflictError, \
UnregisteredClassError, SchemaValidationError, get_class, copy
import uuid
import numpy as np
class Base(JSONAlizable):
schema = {
"foo": None,
"bar": 12... | {
"content_hash": "1e4989530d02ab8c7dbb020c5fb0e303",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 76,
"avg_line_length": 24.26277372262774,
"alnum_prop": 0.5144404332129964,
"repo_name": "flupke/pyflu",
"id": "cfc3bfc011a9224c21213954d1d17d9b9ec2161f",
"size": "3324",
... |
from django.urls import re_path
from openstack_dashboard.dashboards.project.routers.ports import views
PORTS = r'^(?P<port_id>[^/]+)/%s$'
urlpatterns = [
re_path(PORTS % 'detail', views.DetailView.as_view(), name='detail'),
]
| {
"content_hash": "6c4c61481902c72e46801d113f355808",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 73,
"avg_line_length": 25.88888888888889,
"alnum_prop": 0.6909871244635193,
"repo_name": "openstack/horizon",
"id": "62d7215e9440a5a7615fba766c9c92fe15f27648",
"size": "855"... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/base/shared_base_bracer_upper_both.iff"
result.attribute_template_id = 11
result.stfName("wearables_name","bracer_s01")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return resul... | {
"content_hash": "3928c1474abba00cd19e026553ff4197",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 85,
"avg_line_length": 24.692307692307693,
"alnum_prop": 0.7071651090342679,
"repo_name": "obi-two/Rebelion",
"id": "b3588c1e1cb0d050511876aaa849ee9127f47fce",
"size": "466... |
"""
Colander schemata describing the public v1/geosubmit HTTP API.
"""
import colander
from ichnaea.api.schema import (
OptionalIntNode,
OptionalMappingSchema,
OptionalSequenceSchema,
)
from ichnaea.api.submit.schema import CellTowerSchema, PositionSchema, ReportSchema
class ReportV1Schema(PositionSchem... | {
"content_hash": "cd0f5bcfaec25b350845585eff7a3d3a",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 83,
"avg_line_length": 25.24561403508772,
"alnum_prop": 0.6337734537873523,
"repo_name": "mozilla/ichnaea",
"id": "309905bd7e781715c5630d98d291eb3a0bdf1d80",
"size": "1439"... |
if __name__ == '__main__':
velocidades = [int(x) for x in input().split(' ')]
velocidades = velocidades[1:]
print(max(velocidades))
| {
"content_hash": "ea2ace11d71cf87b215e2d8ccaa4d8e3",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 54,
"avg_line_length": 36,
"alnum_prop": 0.5763888888888888,
"repo_name": "israelem/aceptaelreto",
"id": "10f1784429501a1c2046ba8ba829ae457e17749e",
"size": "144",
"binary... |
from circuits import Event
class line_read(Event):
"""line_read Event"""
class IOStream:
def on_connected(self, *args, **kwargs):
raise NotImplemented()
def on_disconnected(self, *args, **kwargs):
raise NotImplemented()
def on_read(self, *args, **kwargs):
raise NotImplement... | {
"content_hash": "3e6d4940dd2fc634be5a1d617be39671",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 48,
"avg_line_length": 22.24,
"alnum_prop": 0.6187050359712231,
"repo_name": "rCorvidae/OrionPI",
"id": "d5d4211a25e500ac34a384900460b85218680261",
"size": "556",
"binary... |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from binascii import a2b_hex, b2a_hex
from hashlib import sha256
from struct import pack
def check_array_result(object_array, to_match, expected):
"""
Pass in array of JSON objects, a dictionary with key/value pa... | {
"content_hash": "030bfe008bee4a62ec2c373ff8b351fb",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 237,
"avg_line_length": 35.22222222222222,
"alnum_prop": 0.5907355138635232,
"repo_name": "jimmykiselak/lbrycrd",
"id": "07bfe69c6d869a0e0760b930419c602cd72b0323",
"size":... |
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/particle/shared_pt_light_streetlamp_blue.iff"
result.attribute_template_id = -1
result.stfName("obj_n","unknown_object")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "1f852d320adc2d331ff59277fb65c90c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 79,
"avg_line_length": 23.692307692307693,
"alnum_prop": 0.6948051948051948,
"repo_name": "obi-two/Rebelion",
"id": "a1925356a954c5f3035f04b783655b9fc1a739da",
"size": "453... |
"""
Created on Fri Oct 13 07:55:15 2017
@author: Rachael Mansbach
Script to do a full (MPI) data analysis run using the cluster module
Description of necessary events:
1) Find all cluster IDs
2) Write out cluster sizes and cluster IDs at each time step
3) Plot Mass-averaged cluster size of contact, aligned, and opt... | {
"content_hash": "d9a77f3f24662b579f835e2676cb8388",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 92,
"avg_line_length": 27.06896551724138,
"alnum_prop": 0.7394904458598726,
"repo_name": "ramansbach/cluster_analysis",
"id": "12429e58cec8d6fcd0ccfbbed3fd16ec3259fa81",
"s... |
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.utils.typechecks import assert_is_type
def h2o_H2OFrame_names():
"""
Python API test: h2o.frame.H2OFrame.names
Copied from runit_lstrip.R
"""
iris = h2o.import_file(pa... | {
"content_hash": "1c2b9a76ccecbb5f4f9c3b6ff48ecd74",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 105,
"avg_line_length": 30.136363636363637,
"alnum_prop": 0.6923076923076923,
"repo_name": "spennihana/h2o-3",
"id": "b11171bd6dd5de291f42a2867d2a564f5692b845",
"size": "66... |
from create_sentiment_featuresets import create_feature_sets_and_labels
import tensorflow as tf
# from tensorflow.examples.tutorials.mnist import input_data
import pickle
import numpy as np
train_x, train_y, test_x, test_y = create_feature_sets_and_labels('../datasets/pos.txt', '../datasets/neg.txt')
n_nodes_hl1 = 15... | {
"content_hash": "87e473851f33f47341693211ae317e37",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 111,
"avg_line_length": 34.75609756097561,
"alnum_prop": 0.5821052631578948,
"repo_name": "mtdx/ml-algorithms",
"id": "4fb677cce557fb60f8f90f7c2f2730b71a8a86db",
"size": "2... |
import sys
import logging
from collections import OrderedDict
from substance import (SubProgram, Core)
class Box(SubProgram):
def __init__(self):
super(Box, self).__init__()
def setupCommands(self):
self.addCommand('ls', 'substance.command.box.ls')
self.addCommand('pull', 'substance.... | {
"content_hash": "a13cf38ebe3cfe29f3bae73edde313c1",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 66,
"avg_line_length": 25.82758620689655,
"alnum_prop": 0.6622162883845126,
"repo_name": "turbulent/substance",
"id": "10a01afc791f04f5a355715ee29eac1e5d561f24",
"size": "7... |
"""
Collect concerns itself with the screen scraping functionality.
"""
# TODO(jkelly) Ensure team names are consistent
import os
import re
import pytz
import json
import logging
import urllib2
import datetime
from io import StringIO
from hashlib import sha1
from lxml.html import parse as lxml_parser
from .version i... | {
"content_hash": "be8ff3d4c23603c86fc748841f73b90f",
"timestamp": "",
"source": "github",
"line_count": 625,
"max_line_length": 134,
"avg_line_length": 31.248,
"alnum_prop": 0.525652841781874,
"repo_name": "fancystats/nhlstats",
"id": "7b7e72de214ec17ffd7a34f9d9150a8713a70854",
"size": "19563",
"... |
"""Database utility functions and classes
These are primarily to assist in testing Pyrseas, i.e., without having
to depend on the application-level DbConnection.
"""
import os
from psycopg2 import connect
from psycopg2.extras import DictConnection
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
def pgcon... | {
"content_hash": "395178d95af5f0d215d07972a11ff773",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 79,
"avg_line_length": 31.913385826771652,
"alnum_prop": 0.609178386380459,
"repo_name": "reedstrm/Pyrseas",
"id": "c4c681f8427c7c8ddb4d91d8b4660b6ebf7e6f2a",
"size": "407... |
from _operator import add, sub, mul, truediv
from enum import Enum
from types import BuiltinFunctionType, FunctionType
from typing import List, TypeVar
from django_mysql.models import Model as MySqlModel
from FRS.settings import LEADERBOARD_COUNT
from leaderboard.models import LeaderboardEntry, Leaderboard
Function ... | {
"content_hash": "787143193c90d1a2c3d48b2ad0450d2a",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 117,
"avg_line_length": 33.442477876106196,
"alnum_prop": 0.6319132045514686,
"repo_name": "FRC-RS/FRS",
"id": "72ba23e7e44ff802f9e37d0ef3e1fd15b779475d",
"size": "3779",
... |
'''
Created on 13.06.2016
@author: Fabian Reiber
@version: 1.0
'''
class NoMXRecordException(Exception):
def __str__(self, *args, **kwargs):
return Exception.__str__(self, *args, **kwargs) | {
"content_hash": "b0a4f47d414cb3240a8ec0450a378133",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 55,
"avg_line_length": 20.2,
"alnum_prop": 0.6386138613861386,
"repo_name": "fabianHAW/GnuPG-Distributer-Mailing-System",
"id": "7134f2237a1dcbc0d4ed155ed23803eb61c94290",
... |
from __future__ import absolute_import
from torchvision.transforms import *
from PIL import Image, ImageDraw
import numpy as np
import torch
import torchvision
import random
from PIL import Image, ImageOps
import numpy as np
import numbers
import math
import torch
import torch
import random
import PIL.ImageEnhance a... | {
"content_hash": "1da6087cfae4a37b3e8f51a9180f433f",
"timestamp": "",
"source": "github",
"line_count": 630,
"max_line_length": 116,
"avg_line_length": 32.3984126984127,
"alnum_prop": 0.5474988976532262,
"repo_name": "QuantScientist/Deep-Learning-Boot-Camp",
"id": "e2b7bdf6145bfdb1bf387cb63660778aadc... |
from api.requests.public_posts_factory import PublicPostsRequestFactory
from api.requests.visible_posts_factory import VisiblePostsRequestFactory
from api.requests.authored_posts_factory import AuthoredPostsRequestFactory
from api.requests.post_factory import PostRequestFactory
from api.requests.friend_request_factory ... | {
"content_hash": "ff07ccf1b8b67fc665fad5a29007697b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 75,
"avg_line_length": 68.25,
"alnum_prop": 0.8882783882783882,
"repo_name": "Roshack/cmput410-project",
"id": "fdf6849ae47c6c8ede01b6aabaebf474bbc15982",
"size": "546",
"... |
import time
import mock
from oslo_concurrency import processutils as putils
from oslo_config import cfg
import paramiko
from manila import exception
from manila.share.drivers.hitachi import ssh
from manila import test
from manila import utils
CONF = cfg.CONF
HNAS_RESULT_empty = ""
HNAS_RESULT_limits = """
Filesyst... | {
"content_hash": "398480567af5da1a3fdd89b2b5e4258a",
"timestamp": "",
"source": "github",
"line_count": 1262,
"max_line_length": 83,
"avg_line_length": 45.466719492868464,
"alnum_prop": 0.47916485125220026,
"repo_name": "redhat-openstack/manila",
"id": "f9b5a40f03df449f078ddfb9deb4ff32afb7f6dc",
"s... |
import asyncio
import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt.async_support as ccxt # noqa: E402
async def test():
exchange = ccxt.okex({
# 'proxy': 'https://cors-anywhere.herokuapp.com/',
#... | {
"content_hash": "57cd677c3d71d9442634472d176bddbd",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 88,
"avg_line_length": 24.444444444444443,
"alnum_prop": 0.6287878787878788,
"repo_name": "ccxt/ccxt",
"id": "5899cb9ccbe91b910576da9d266a34f16bdbdc99",
"size": "685",
"b... |
from bisect import bisect
from ring_ketama import KetamaRing
from ring_meta import MetaRing
class HashRing(object):
def __init__(self, nodes=[], **kwds):
hash_fn = kwds.get('hash_fn')
vnodes = kwds.get('vnodes')
weight_fn = kwds.get('weight_fn')
if hash_fn == 'ketama':
... | {
"content_hash": "3e6a91e562075be38f4bfefa3715af3e",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 95,
"avg_line_length": 31.04830917874396,
"alnum_prop": 0.5033452621751984,
"repo_name": "ASMlover/study",
"id": "8f5b7972ee1f96884c0ac9152ff3a6871711293d",
"size": "7821"... |
from direct.distributed.DistributedObjectAI import DistributedObjectAI
class DistributedLibraryInteriorAI(DistributedObjectAI):
def __init__(self, block, air, zoneId):
DistributedObjectAI.__init__(self, air)
self.block = block
self.zoneId = zoneId
def getZoneIdAndBlock(self):
... | {
"content_hash": "7bdca5ffd4f7cf8060ddc4ab19aca10c",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 70,
"avg_line_length": 29.5,
"alnum_prop": 0.7090395480225988,
"repo_name": "ToontownUprising/src",
"id": "124a61b3acf22781b3c81d146a917cb512a08d04",
"size": "354",
"bina... |
"""
Tests for Site object
"""
import os
import unittest
# Setup global test data location
from werkzeug.exceptions import NotFound
TEST_DATA_ROOT = os.path.join('tests', 'testdata', 'site')
# pass the root of the test data to the app via environment variable
os.environ['TEST_DATA_ROOT'] = TEST_DATA_ROOT
from website... | {
"content_hash": "52a30706fb7b9caa089d951491c4fcc5",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 90,
"avg_line_length": 40.309859154929576,
"alnum_prop": 0.5959119496855346,
"repo_name": "nfletton/froid",
"id": "6a19c011cc64fd6a4d87dc2a43dfe30e46e04969",
"size": "5724... |
import base64
import json
import mock
import six
from os import path
from six.moves.urllib_parse import parse_qs, urlparse
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages import get_messages
from django.urls import reverse
from django.test import Requ... | {
"content_hash": "770a9fbebea6b8c85ee4295faa71c16d",
"timestamp": "",
"source": "github",
"line_count": 1794,
"max_line_length": 79,
"avg_line_length": 40.86008918617614,
"alnum_prop": 0.610343369302757,
"repo_name": "wagnerand/olympia",
"id": "4298bb62e158b52845ce3c6d1c6d2f4b705872d9",
"size": "73... |
'''Client examples of playing a lesson of Go problems.
'''
__author__ = 'Ethan Kennerly'
from lesson import *
from client import *
def play_lesson(index, white, black, mouse_down_and_sleep, wait):
# XXX Complaint of circular import if import in global namespace.
from master import play_sgf
lesson = pathed... | {
"content_hash": "4bc97db033043856fc8b95dd765cb462",
"timestamp": "",
"source": "github",
"line_count": 2502,
"max_line_length": 119,
"avg_line_length": 34.02358113509192,
"alnum_prop": 0.5812609395373971,
"repo_name": "ethankennerly/hotel-vs-gozilla",
"id": "699cc92abeb5d71e4b16595a9d0334331c21647c"... |
from __future__ import print_function
import struct
import operator
from itertools import chain, repeat
import sys
from pox.lib.packet.packet_base import packet_base
from pox.lib.packet.ethernet import ethernet
from pox.lib.packet.vlan import vlan
from pox.lib.packet.llc import llc
from pox.lib.packet.ipv4 import ipv4... | {
"content_hash": "9f63c05ab67d63597cd597bd029289d4",
"timestamp": "",
"source": "github",
"line_count": 4436,
"max_line_length": 79,
"avg_line_length": 29.238503155996394,
"alnum_prop": 0.5938998627623321,
"repo_name": "andiwundsam/_of_normalize",
"id": "17a84c8b45ac3de4fb92c11bdfcff48a6b6ac6f5",
"... |
"""Driver of srpcgen for ppapi_proxy sources.
This must be run after modifying, adding, or removing .srpc files.
The lists of .srpc files are in this source file.
"""
import filecmp
import optparse
import os
import shutil
import subprocess
import sys
import tempfile
# This lists all the units (one header file, one s... | {
"content_hash": "b8e2977660cc9421e7468403e2215bd2",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 80,
"avg_line_length": 34.69607843137255,
"alnum_prop": 0.5768578694546482,
"repo_name": "junmin-zhu/chromium-rivertrail",
"id": "b6ae923c8dcb632e5308685b34fe61560df97d69",
... |
from selenium.webdriver.common import by
from openstack_horizon.test.integration_tests.pages import basepage
from openstack_horizon.test.integration_tests.pages import pageobject
class ChangePasswordPage(basepage.BasePage):
@property
def modal(self):
return ChangePasswordPage.ChangePassw... | {
"content_hash": "0c31a10f8a05f5a87d0ab468c7c9e278",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 78,
"avg_line_length": 41.44827586206897,
"alnum_prop": 0.5449251247920133,
"repo_name": "mrunge/openstack_horizon",
"id": "2ecfd44feb2f8e8ee13234c445629b7b3b86ae04",
"size... |
from operator import itemgetter
from .helpers import tryInt
def pprint(PiGroupList):
"""Takes a PiGroupList and prints all the Pi Groups nicely to the
screen."""
i = 1
for PiGroup in PiGroupList:
print("Pi-Group " + str(i) + ": ", end="")
i+=1
pprintPiGroup(PiGroup)
p... | {
"content_hash": "19693a10cecf8cd2f4713d78be33b7e3",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 72,
"avg_line_length": 28.64,
"alnum_prop": 0.5740223463687151,
"repo_name": "awhow/BuckinghamPy",
"id": "267fdeef91c9f8dc2c51a8ad36b33651d3ffb77e",
"size": "716",
"binar... |
from django.http import Http404
from django.core.exceptions import PermissionDenied
from rest_framework import exceptions, status
from rest_framework.compat import set_rollback
from rest_framework.response import Response
from lepus.serializers import ValidationErrorDetail
def exception_handler(exc, context):
if ... | {
"content_hash": "dca10fcaab3e611d9772c68a64b9d9a4",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 75,
"avg_line_length": 31.90277777777778,
"alnum_prop": 0.5550718328254245,
"repo_name": "lepus-ctf/lepus-api",
"id": "a5dadf3c3cbd6366489454a229eb177b9eceb3fb",
"size": "2... |
import telepot
class TGBot(telepot.Bot):
def __init__(self, config):
"""Set TG bot attributes from config file."""
self.singleMode = config['general']['single_mode'] == 'True'
config = config['telegram']
self.chatID = int(config['chatid'])
telepot.Bot.__init__(self, config[... | {
"content_hash": "7db3af1a488e793e662f2b3b5e8a7730",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 79,
"avg_line_length": 35.78688524590164,
"alnum_prop": 0.5748969308291342,
"repo_name": "sharkitten/telegric",
"id": "a1c7924d569de3e3969e125807709ced27756a4e",
"size": "2... |
import optparse
import re
def parse_options():
"""
Parse the options guiven to the script
"""
parser = optparse.OptionParser(description='Get unmatched blast queries')
parser.add_option('-f', '--fasta', dest='fasta_file',
help='Query fasta file used during blast')
parser.... | {
"content_hash": "d36d2980d8c11ee76de394971cb19421",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 77,
"avg_line_length": 30.907692307692308,
"alnum_prop": 0.5619711299153808,
"repo_name": "drosofff/tools-artbio",
"id": "64d3aa30831754efbaa1ad4f896e1b1034c768e4",
"size":... |
from __future__ import absolute_import
import os
import signal
import subprocess
import sys
from six import print_
from ccmlib import common
from ccmlib.cmds.command import Cmd
from ccmlib.node import NodeError
NODE_CMDS = [
"show",
"remove",
"showlog",
"setlog",
"start",
"stop",
"ring",... | {
"content_hash": "4e4f9503e1eadad1fd74c9f7e1b82727",
"timestamp": "",
"source": "github",
"line_count": 834,
"max_line_length": 311,
"avg_line_length": 38.77218225419664,
"alnum_prop": 0.6109289955467591,
"repo_name": "mike-tr-adamson/ccm",
"id": "5b99812d6cba91af6091eda87a2f4324a8c94637",
"size": ... |
from django.contrib import admin
from .models import (
Ministry,
MinistryMember,
)
@admin.register(Ministry)
class MinistryAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('name',)}
filter_horizontal = ('members',)
readonly_fields = ('date_created', 'last_update',)
@admin.register(Minist... | {
"content_hash": "10d7c13c6abece6a3ee5c2e7d0844372",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 54,
"avg_line_length": 22.529411764705884,
"alnum_prop": 0.7154046997389034,
"repo_name": "patrickporto/soldajustica",
"id": "8db429a4153afe0a463a674f9f0366e5a4d0ed6e",
"si... |
from django.contrib import admin
from unicoresso.models import AuthorizedSite
# Register your models here.
admin.site.register(AuthorizedSite)
| {
"content_hash": "f2453010fa90ebaeca835b35d7583237",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 44,
"avg_line_length": 35.75,
"alnum_prop": 0.8461538461538461,
"repo_name": "universalcore/unicore-hub",
"id": "90e583ca3734a71895d9bcd10edfe3835b9c3001",
"size": "143",
... |
"""Concise implementation of MIPNeRF primitives.
Based on mip-NeRF: https://github.com/google/mipnerf
"""
from typing import Sequence
from . import helpers
from . import scene
import flax.linen as nn
import jax
import jax.numpy as np
import jax.random as random
def intersect_box(rays, box_width):
# r_o + t * r_... | {
"content_hash": "52cb69e95bcf31b838aca7b549755f78",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 89,
"avg_line_length": 35.618090452261306,
"alnum_prop": 0.6193566591422122,
"repo_name": "google-research/google-research",
"id": "cbc0e19f03a86ef68ed7c924acf95fb78425e64b"... |
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.backend.codegen.thrift.lib.thrift import Thrift
from pants.base.exceptions import TaskError
from pants_test.task_test_base import TaskTestBase
from pants.contrib.go.tasks.go_thrift_gen import GoThriftGen
class GoThriftGenT... | {
"content_hash": "5efbb16264834f39af5b24f78fa0fe84",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 93,
"avg_line_length": 35.25714285714286,
"alnum_prop": 0.7512155591572123,
"repo_name": "twitter/pants",
"id": "b111803c603662902360bf0d4ba16a27096991ea",
"size": "1381",
... |
"""Dictionary of schema names and functions to test schema."""
# Copyright (c) 2014, HashFast Technologies LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source c... | {
"content_hash": "7b24ab2e5378ad7bad08cb54e707f564",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 125,
"avg_line_length": 49.01709401709402,
"alnum_prop": 0.6903225806451613,
"repo_name": "HashFast/hashfast-tools",
"id": "55da6b42665be349194894ad8bd707549d550da5",
"siz... |
__author__ = 'zjbao123'
from weibo import APIClient
import weather
def get_access_token(app_key, app_secret, callback_url):
client = APIClient(app_key=app_key, app_secret=app_secret, redirect_uri=callback_url)
# 获取授权页面网址
auth_url = client.get_authorize_url()
print auth_url
# 在浏览器中访问这个URL,会跳转到回调地... | {
"content_hash": "69db9df19c9f82c6f0067521bbade92e",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 89,
"avg_line_length": 31.416666666666668,
"alnum_prop": 0.6790450928381963,
"repo_name": "zharuosi/2017",
"id": "b746876b4059c4132e97330a6ecf7c00a9dfe58c",
"size": "2117",... |
import os
import shutil
import subprocess
import bcbio.utils
import pytest
from tests.conftest import install_cwl_test_files
def test_cwl_docker_somatic_workflow():
with install_cwl_test_files() as workdir:
with bcbio.utils.chdir(os.path.join(workdir, "somatic")):
subprocess.check_call(["bas... | {
"content_hash": "6eb4fb50bcba352409fda23cbdd6199a",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 92,
"avg_line_length": 42.2037037037037,
"alnum_prop": 0.6375603334795963,
"repo_name": "chapmanb/bcbio-nextgen-vm",
"id": "fd67e547cdfa7ca9fb3880de5d5c2d6802080674",
"size... |
from grafeas import grafeas_v1
async def sample_list_note_occurrences():
# Create a client
client = grafeas_v1.GrafeasAsyncClient()
# Initialize request argument(s)
request = grafeas_v1.ListNoteOccurrencesRequest(
name="name_value",
)
# Make the request
page_result = client.list_... | {
"content_hash": "3716990ce962e37c9ca20243d736a58e",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 80,
"avg_line_length": 26.3,
"alnum_prop": 0.714828897338403,
"repo_name": "googleapis/python-grafeas",
"id": "319c3ef2102e8ad069a06bb31b8e28efa91649a2",
"size": "1545",
... |
from twisted.internet.defer import inlineCallbacks, returnValue
from txdav.common.datastore.podding.test.util import MultiStoreConduitTest
from pycalendar.datetime import DateTime
from twistedcaldav.ical import Component, normalize_iCalStr
from txdav.common.icommondatastore import ObjectResourceNameAlreadyExistsError, ... | {
"content_hash": "8f82d865bf163731744a80a9bf64815b",
"timestamp": "",
"source": "github",
"line_count": 489,
"max_line_length": 129,
"avg_line_length": 40.23517382413088,
"alnum_prop": 0.6895552731893265,
"repo_name": "macosforge/ccs-calendarserver",
"id": "6a6dee3dc32b690f982aef4053e8153e50469c7a",
... |
"""
C.5 Classes, Packages, and Page Styles (p176)
"""
import codecs, sys, os
from plasTeX import Command, Environment, DimenCommand, Token
from plasTeX.Logging import getLogger
# Put the plasTeX packages into the path
from plasTeX import Packages
sys.path.append(os.path.dirname(Packages.__file__))
del Packages
log ... | {
"content_hash": "7766c9a6a85bd08f816bc02faec2cdfc",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 85,
"avg_line_length": 22.51502145922747,
"alnum_prop": 0.6519252764010675,
"repo_name": "hao-han/LaTex2Docx",
"id": "74b64166ba923e52a1bc4a8ddb4f47b11e556b23",
"size": "5... |
import glob
import os.path
import signal
import sys
import azurelinuxagent.common.conf as conf
import azurelinuxagent.common.utils.fileutil as fileutil
import azurelinuxagent.common.utils.shellutil as shellutil
from azurelinuxagent.common.exception import ProtocolError
from azurelinuxagent.common.osutil import get_os... | {
"content_hash": "dee2daf543b5ad2536da0c72221bd226",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 87,
"avg_line_length": 35.3794466403162,
"alnum_prop": 0.5774773768294046,
"repo_name": "andyliuliming/WALinuxAgent",
"id": "3ed18a5a0b9054501755052d2db1e168fac8ff48",
"si... |
import zope.interface
import zope.schema
class ILastView(zope.interface.Interface):
last_view = zope.schema.ASCIILine(
title=u"The last calendar view the user has visited.")
hidden_ressorts = zope.schema.FrozenSet(
title=u"Ressors that are hidden.")
| {
"content_hash": "34bbc29aa2af9967b44e7b5349209970",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 62,
"avg_line_length": 25.272727272727273,
"alnum_prop": 0.7158273381294964,
"repo_name": "ZeitOnline/zeit.calendar",
"id": "116c687e058a5608957f8f9a759502c0204113e5",
"siz... |
from . import xmlwriter
class App(xmlwriter.XMLwriter):
"""
A class for writing the Excel XLSX App file.
"""
###########################################################################
#
# Public API.
#
###########################################################################
... | {
"content_hash": "b979748079b84cebc1ae0bdd99d293ad",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 79,
"avg_line_length": 29.377659574468087,
"alnum_prop": 0.5261633170378418,
"repo_name": "emptyewer/DEEPN",
"id": "bc8d5947e42061291d97743cf72fda65cfc161d9",
"size": "573... |
'''
Created on 10 Sep 2015
@author: si
'''
import hashlib
import logging
import threading
import time
from flask import Flask, current_app
from werkzeug.serving import run_simple
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
logger.addHan... | {
"content_hash": "e3a934c559c756bb1b3d70c4c4a1293f",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 85,
"avg_line_length": 30.22222222222222,
"alnum_prop": 0.5680147058823529,
"repo_name": "caffeinate/test-pylot",
"id": "26d054d74dd1e98c8da8d3b55aa6f304b773d6f8",
"size":... |
import argparse
import json
import os
from math import floor
import pandas as pd
from google.cloud import bigquery as bq
"""
This script is meant to orchestrate BigQuery load jobs of many
json files on Google Cloud Storage. It ensures that each load
stays under the 15 TB per load job limit. It operates on the
output of... | {
"content_hash": "4d0b7293e27ca19bfbf68739304329ed",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 79,
"avg_line_length": 34.68867924528302,
"alnum_prop": 0.5764209953766658,
"repo_name": "CloudVLab/professional-services",
"id": "7f03be4b392e7d2715da71459345e23b1b9d28cc",... |
"""
sentry.utils.imports
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import inspect
import sys
from sentry.utils.imports import import_string
PACKAGES = {
'django.db.backends.postgresql_psycopg2': 'psycopg2.ext... | {
"content_hash": "e02cd0e92bebd60ecbdcec4203983338",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 201,
"avg_line_length": 32.025,
"alnum_prop": 0.6498829039812647,
"repo_name": "beni55/sentry",
"id": "c54cb6260ada44549608fdc8a96712796c75bd6e",
"size": "2562",
"binary"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.