text stringlengths 4 1.02M | meta dict |
|---|---|
def test_pass_remaining_cli_args_to_task(result):
lines = result.stdout_.splitlines()
assert lines == ["--arg something!"]
| {
"content_hash": "c6be8f8c3604bb958fb118818b2395b7",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 49,
"avg_line_length": 43.666666666666664,
"alnum_prop": 0.6793893129770993,
"repo_name": "vantage-org/vantage",
"id": "99652fbf4dc58c23c85b1ee5ce13e4e4a26e42ee",
"size": "1... |
import time
import numpy as nm
from sfepy.base.base import output, iter_dict_of_lists, get_default, Struct
import fea
from sfepy.fem.mesh import Mesh, make_point_cells
def parse_approx_order(approx_order):
"""
Parse the uniform approximation order value (str or int).
"""
ao_msg = 'unsupported approxim... | {
"content_hash": "03be283441be95df55bffdd3eb129274",
"timestamp": "",
"source": "github",
"line_count": 558,
"max_line_length": 80,
"avg_line_length": 31.485663082437277,
"alnum_prop": 0.5193807274176105,
"repo_name": "olivierverdier/sfepy",
"id": "9ca9e7d357eb20a88d12620e479d006cf8cf0ff3",
"size":... |
from os import environ
from twisted.internet.defer import inlineCallbacks
from twisted.python.failure import Failure
from autobahn import wamp
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
class MyService1(object):
@wamp.register('com.mathservice.add2')
def add2(self, x, y):
... | {
"content_hash": "3046a602c02ef47c8f6020976f40e7f4",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 77,
"avg_line_length": 28.223880597014926,
"alnum_prop": 0.6250661025912215,
"repo_name": "oberstet/autobahn-python",
"id": "203bdd3731d9191a239960f134f7ade8e51f22e3",
"siz... |
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.utils.domutils
import os.path
from pyxb.exceptions_ import *
import unittest
class TestIncludeDD (unittest.TestCase):
def testDefault (self):
schema_path = os.p... | {
"content_hash": "0f87a9aa79695c28483a98161b1245de",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 120,
"avg_line_length": 28.8,
"alnum_prop": 0.7065972222222222,
"repo_name": "pabigot/pyxb",
"id": "df04c9ca9a02470670066411025c4c7879164773",
"size": "600",
"binary": fa... |
'''
Created on Nov 21, 2016
@author: mjschust
'''
from __future__ import division
import conformal_blocks.cbbundle as cbd
import math, cProfile, time
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
#Computes all non-trivial 4-point conformal blocks divisors of specified Lie rank and... | {
"content_hash": "aae6d54c4eeb0102ff4285c0eddf2547",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 97,
"avg_line_length": 33.17741935483871,
"alnum_prop": 0.5862907146329607,
"repo_name": "mjschust/conformal-blocks",
"id": "8c2fae919ff19904cfaa76b43b960e605f64207e",
"siz... |
from pandajedi.jedicore import Interaction
from pandajedi.jedicore.MsgWrapper import MsgWrapper
from JobThrottlerBase import JobThrottlerBase
# logger
from pandacommon.pandalogger.PandaLogger import PandaLogger
logger = PandaLogger().getLogger(__name__.split('.')[-1])
# class to throttle ATLAS analysis jobs
class At... | {
"content_hash": "6574417d1e1d4852080fc75828cd0d84",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 106,
"avg_line_length": 37.44827586206897,
"alnum_prop": 0.6593001841620626,
"repo_name": "RRCKI/panda-jedi",
"id": "6b06a1087ce31327a4f718fd3af2145b828b7125",
"size": "108... |
from a10sdk.common.A10BaseClass import A10BaseClass
class GeneratesAvcsDebugFile(A10BaseClass):
""" :param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`
URL for this object::
`https://<Hostname|Ip address>//axapi/v3/techsupport/vcs... | {
"content_hash": "6aa23fa75c7108c741d876e9f8bed27f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 123,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.6426829268292683,
"repo_name": "a10networks/a10sdk-python",
"id": "5ab73d62848edc2f0279a82d14c841396240e154",
"s... |
from django.db import models
from django.db.models.query import QuerySet
class QuestionQuerySet(QuerySet):
def active(self):
"""
Return only "active" (i.e. published) questions.
"""
return self.filter(status__exact=self.model.ACTIVE)
class QuestionManager(models.Manager):
def... | {
"content_hash": "06a526cb1ef58e7d504f88b081b5892b",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 59,
"avg_line_length": 25.22222222222222,
"alnum_prop": 0.6674008810572687,
"repo_name": "I-sektionen/i-portalen",
"id": "e19e7928842ae071e2b8381ee1a7951eced2ce7d",
"size":... |
import csv
import numpy
import matplotlib
import matplotlib.pyplot as plt
from scipy import stats
num_iter = 500
num_reps = 100
file = 'lower_tier_only_500_iterations.csv'
all_repetitions_data = []
num_lowtier_rules = 7
num_hightier_rules = 0
chunk_size = 20
num_chunks = num_iter/chunk_size
rule_applications_a =... | {
"content_hash": "861505f60f6895f49eed6c32e13d4604",
"timestamp": "",
"source": "github",
"line_count": 389,
"max_line_length": 181,
"avg_line_length": 38.04370179948586,
"alnum_prop": 0.5553753632002162,
"repo_name": "HSDL/HeuristicBursts",
"id": "ad75e6602b70b5607af5a0cdae5f1d026ffef8de",
"size":... |
"""
Handles all requests relating to volumes + cinder.
"""
import copy
import sys
from cinderclient import client as cinder_client
from cinderclient import exceptions as cinder_exception
from cinderclient.v1 import client as v1_client
from keystoneclient import exceptions as keystone_exception
from keystoneclient imp... | {
"content_hash": "9c0606bae922ea49f542a1532e948389",
"timestamp": "",
"source": "github",
"line_count": 460,
"max_line_length": 79,
"avg_line_length": 40.493478260869566,
"alnum_prop": 0.5742739034734525,
"repo_name": "Francis-Liu/animated-broccoli",
"id": "e8748d1bc79da00cbd36ca479ad973ddbb7d1442",
... |
import csv
import os
import sys
import re
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
import pkgutil
import inspect
import bb
import supportedrecipesreport
class Columns(object):
"""Base class for all classes which extend the SUPPORTED_RECIPES_SOURCES report.
Typically us... | {
"content_hash": "d120a7d4611e9282bb8544023b38196e",
"timestamp": "",
"source": "github",
"line_count": 467,
"max_line_length": 114,
"avg_line_length": 42.57815845824411,
"alnum_prop": 0.6011365922349627,
"repo_name": "klihub/intel-iot-refkit",
"id": "da7cdba7e3c6065386c8ec32c10f23b1157eb840",
"siz... |
from typing import Optional, TYPE_CHECKING
from typing import cast as typecast
from ..config import Config
from ..utils import RichStatus
from ..resource import Resource
from .irfilter import IRFilter
from .ircluster import IRCluster
if TYPE_CHECKING:
from .ir import IR # pragma: no cover
class IRBuffer (IRFilt... | {
"content_hash": "37221f507a3d080a9b08d84cafdf7bd6",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 98,
"avg_line_length": 31.27027027027027,
"alnum_prop": 0.6101987899740708,
"repo_name": "datawire/ambassador",
"id": "044649a0e81608fb9609ab147843d47c8a74d8b4",
"size": "1... |
__author__ = 'tbeltramelli'
from UInteractive import *
class EpipolarGeometry:
_points = []
_img = None
_raw_img = None
_fundamental_matrix = None
_epipole = None
_MAX_POINT_NUMBER = 16
is_ready = False
def __init__(self, img, define_manually=True):
self._img = copy(img)
... | {
"content_hash": "c7ff52656fc281257a0efa8d78d77daf",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 97,
"avg_line_length": 33.29896907216495,
"alnum_prop": 0.5739938080495356,
"repo_name": "tonybeltramelli/Graphics-And-Vision",
"id": "6e164e7743105612cb9bb25e0b18aeccbc83a9a... |
"""Support for Ambiclimate devices."""
import logging
import voluptuous as vol
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
from homeassistant.helpers import config_validation as cv
from . import config_flow
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
CONFIG_SCHEMA = vol.S... | {
"content_hash": "cf803e5293dbca7774436733ea229753",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 71,
"avg_line_length": 22.48936170212766,
"alnum_prop": 0.6471144749290445,
"repo_name": "pschmitt/home-assistant",
"id": "490c41255bfbf9516cac9183b201e958e77349c2",
"size"... |
import os.path
import pathlib
from typing import List
import requirements as rp
def collect_requirements_files() -> List[pathlib.Path]:
project_root = pathlib.Path(__file__).parents[1]
assert project_root.exists()
reqs_dir = project_root.joinpath("reqs")
assert reqs_dir.exists()
pattern = "requi... | {
"content_hash": "3aacb888dba065beeccf3efc18bb30fc",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 83,
"avg_line_length": 37.9537037037037,
"alnum_prop": 0.6150280556233227,
"repo_name": "great-expectations/great_expectations",
"id": "0c3f99602887e1c97a488dc1b4959c395d84b... |
"""Varnish Monitoring check."""
from __future__ import print_function
import sys
import argparse
import subprocess
import json
fields=[]
instance=''
warning=''
critical=''
def check():
global fields,instance,warning,critical
keys=[]
values=[]
output=''
perfdata=''
try:
if instance:
cmd = ['/... | {
"content_hash": "59552b793ddef3f2679e804a9f797a64",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 117,
"avg_line_length": 34.608247422680414,
"alnum_prop": 0.5719392314566577,
"repo_name": "olivierHa/check_varnish",
"id": "3515ea689ac9ed7cbb7cac90fb691136c3e5552b",
"siz... |
import base64
from unittest import TestCase
from otp import OTP
__author__ = 'Terry Chia'
class TestOTP(TestCase):
def setUp(self):
self.secret = base64.b32encode('12345678901234567890')
def test_generate_hotp(self):
# Test vectors taken from RFC 4226, Appendix E
self.assertEqual('7... | {
"content_hash": "e77354732abb4fad13980cca6bed41b5",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 84,
"avg_line_length": 48.71111111111111,
"alnum_prop": 0.6843065693430657,
"repo_name": "Ayrx/py-otp",
"id": "a9e6181177d3004b584e0b3b9f443717698c076b",
"size": "2192",
... |
from . import core
from .core import *
__all__ = ['core'] + core.__all__
| {
"content_hash": "07538546434958f3af040ef8a6534751",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 33,
"avg_line_length": 22.5,
"alnum_prop": 0.4666666666666667,
"repo_name": "jmunar/pymc3-kalman",
"id": "5d4d61620ed8e13cc518bbaecc62da9f3642b7ab",
"size": "90",
"binary"... |
import sys
if 'setuptools' in sys.modules:
import setuptools.command.install as old_install_mod
have_setuptools = True
else:
import distutils.command.install as old_install_mod
have_setuptools = False
old_install = old_install_mod.install
from distutils.file_util import write_file
class install(old_ins... | {
"content_hash": "61077feb830c430a2f8b54ccf77773a2",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 80,
"avg_line_length": 39.445945945945944,
"alnum_prop": 0.5758821514217197,
"repo_name": "illume/numpy3k",
"id": "099ad5c16502ebaa078dab4a5b38be7249c9c5e6",
"size": "2919"... |
from slicc.ast.DeclAST import DeclAST
from slicc.symbols import Var
class ObjDeclAST(DeclAST):
def __init__(self, slicc, type_ast, ident, pairs, rvalue, pointer):
super(ObjDeclAST, self).__init__(slicc, pairs)
self.type_ast = type_ast
self.ident = ident
self.rvalue = rvalue
... | {
"content_hash": "85aba30e5d21cea55cb78454a6c81fae",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 81,
"avg_line_length": 34.736111111111114,
"alnum_prop": 0.5325869652139145,
"repo_name": "kaiyuanl/gem5",
"id": "92ff15d521341b3179ede2458746034c0aa10bc3",
"size": "4104",... |
import mock
from nose.tools import raises
from unittest import TestCase
from minio import Minio
from minio.api import _DEFAULT_USER_AGENT
from minio.error import ResponseError
from .minio_mocks import MockResponse, MockConnection
from .helpers import generate_error
class GetObjectTest(TestCase):
@raises(TypeErro... | {
"content_hash": "43a993ab5c86997455fac3fd3591e34a",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 86,
"avg_line_length": 38.52777777777778,
"alnum_prop": 0.5796683489545782,
"repo_name": "harshavardhana/minio-py",
"id": "fa49c6596a6140976c0cb773a9ad53188f487a94",
"size"... |
__author__ = 'Haleemur Ali'
"""
Tests to validate that the correct delete statement is
issued for the redshift dialect of SQL.
These tests use a simple transaction schema.
For simple delete statments that don't have a ``WHERE`` clause
or whose ``WHERE`` clause only refers to columns from the
target table, the emitted... | {
"content_hash": "168d833ce179d519d41b5aa56ddf57df",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 75,
"avg_line_length": 29.244897959183675,
"alnum_prop": 0.6157245871132822,
"repo_name": "sqlalchemy-redshift/sqlalchemy-redshift",
"id": "62089c04bdb576a253fe2d91edcd02e51... |
import datetime
from decimal import Decimal
import logging as std_logging
import pyelasticsearch
import requests
from django.conf import settings
from django.test import TestCase
from haystack import connections, reset_search_queries
from haystack import indexes
from haystack.inputs import AutoQuery
from haystack.mode... | {
"content_hash": "01a9c079d248a1af9329aaf58f0e2b30",
"timestamp": "",
"source": "github",
"line_count": 1184,
"max_line_length": 475,
"avg_line_length": 41.880067567567565,
"alnum_prop": 0.609466381639979,
"repo_name": "ericholscher/django-haystack",
"id": "4353d3f36c08a4e1bae99eb571ff12da6c8c5ee6",
... |
"""
A skeleton python script which reads from an a flag
and parses command line arguments
"""
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"-f", "--foo",
help="path to the input file (read from stdin if omitted)")
args ... | {
"content_hash": "08c3bb2f1ad251d693540ec74d6c173a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 67,
"avg_line_length": 19.714285714285715,
"alnum_prop": 0.6207729468599034,
"repo_name": "issmirnov/dotfiles",
"id": "4dcd79055b36ccd4b39ecb4a5a44061e17937e54",
"size": "4... |
"""A function to build a DetectionModel from configuration."""
import functools
import sys
from object_detection.builders import anchor_generator_builder
from object_detection.builders import box_coder_builder
from object_detection.builders import box_predictor_builder
from object_detection.builders import hyperparams... | {
"content_hash": "5b2205125b58a327c246be983e09bda3",
"timestamp": "",
"source": "github",
"line_count": 991,
"max_line_length": 121,
"avg_line_length": 44.55196770938446,
"alnum_prop": 0.7320105999864103,
"repo_name": "tombstone/models",
"id": "d69b7bc7c2546a6461a2d75d3576d725d748d409",
"size": "44... |
"""This module contains the GradingProjectSurvey model.
"""
__authors__ = [
'"Daniel Diniz" <ajaksu@gmail.com>',
'"Lennard de Rijk" <ljvderijk@gmail.com>',
]
from soc.modules.gsoc.models.project_survey import ProjectSurvey
class GradingProjectSurvey(ProjectSurvey):
"""Survey for Mentors for each of their Stu... | {
"content_hash": "b59bff1f6fead13001c800c0100932f4",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 64,
"avg_line_length": 25,
"alnum_prop": 0.6947368421052632,
"repo_name": "MatthewWilkes/mw4068-packaging",
"id": "f3af672b8b7d94a35e4cdcd45e575111622e6e3f",
"size": "1085"... |
from .fgir import *
from .optimize import FlowgraphOptimization
from .error import Warn
import asyncio
class PCodeOp(object):
'''A class interface for creating coroutines.
This helps us keep track of valid computational elements. Every coroutine in
a PCode object should be an method of PCodeOp.'''
@staticmet... | {
"content_hash": "10aebf7a3719254d43312f765f551dd1",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 113,
"avg_line_length": 34.88235294117647,
"alnum_prop": 0.6616076447442384,
"repo_name": "cs207-project/TimeSeries",
"id": "4dda97de986be0dd5084786be9feb8dfbb87adfb",
"si... |
"""The Python implementation of the GRPC helloworld.Greeter server."""
from concurrent import futures
import time
import grpc
import helloworld_pb2
import helloworld_pb2_grpc
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
class Greeter(helloworld_pb2_grpc.GreeterServicer):
def SayHello(self, request, context):
re... | {
"content_hash": "9e0456422bc510484e69bc6152af4c5a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 77,
"avg_line_length": 24.1875,
"alnum_prop": 0.6847545219638242,
"repo_name": "SolarisYan/grpc-hello-with-gateway",
"id": "1be5449bd3973f06cd88ce8f395fb8b182ee4bcb",
"size... |
import os
import string
from contextlib import contextmanager
from zope.interface import implementer
from twisted.plugin import IPlugin
from twisted.python import lockfile
from comet.icomet import IHandler, IHasOptions
import comet.log as log
# Used when building filenames to avoid over-writing.
FILENAME_PAD = "_"
... | {
"content_hash": "d25aba045e132669e242db16d63187f1",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 83,
"avg_line_length": 32.166666666666664,
"alnum_prop": 0.653219837157661,
"repo_name": "jdswinbank/Comet",
"id": "dd057bb584f3a0dff2b7ea83bac59a95191504bb",
"size": "2776... |
from civictechprojects.models import Event, EventProject, Project
def get_event_legacy_projects(event):
legacy_slugs = event.event_legacy_organization.slugs()
if legacy_slugs:
return Project.objects.filter(project_organization__name__in=legacy_slugs, is_searchable=True)
def migrate_event_projects(*a... | {
"content_hash": "670a533c4bae8bc2f78010cde81f365c",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 102,
"avg_line_length": 46.13333333333333,
"alnum_prop": 0.6221098265895953,
"repo_name": "DemocracyLab/CivicTechExchange",
"id": "05bd7a960653ccdde23a11426bb8da18102467b7",
... |
"""This file provides tests to benchmark performance sqlite/file queue
on specific hardware. User can easily evaluate the performance by running this
file directly via `python run_benchmark.py`
"""
from persistqueue import SQLiteQueue
from persistqueue import Queue
import tempfile
import time
BENCHMARK_COUNT = 100
d... | {
"content_hash": "e9b9dd39f414e61d7c1d1dc0bc2e67b4",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 78,
"avg_line_length": 28.164473684210527,
"alnum_prop": 0.5631861714552675,
"repo_name": "peter-wangxu/persist-queue",
"id": "9ee228a9799ddbd507f154ae85735058cdfb138f",
"... |
""" Test for EncoderDecoder model architecture.
First of all, we define possible types of encoders, embeddings and decoders.
Later every combination of encoder, embedding, decoder is combined into one model and we initialize it.
"""
# pylint: disable=import-error, no-name-in-module
# pylint: disable=redefined-outer-nam... | {
"content_hash": "a80a97ec5a907a768711ab9f68004ed6",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 103,
"avg_line_length": 32.52238805970149,
"alnum_prop": 0.6273519963285911,
"repo_name": "analysiscenter/dataset",
"id": "ed754db699813b213f4068203ba8ca06524d849e",
"size"... |
from __future__ import absolute_import, division, print_function, unicode_literals
import itertools
from echomesh.pattern.Pattern import Pattern
class Choose(Pattern):
HELP = """Choose one of several patterns to display."""
SETTINGS = {
'choose': {
'default': 0,
'help': 'Selects which ... | {
"content_hash": "9c3ba5b97163bd8c2e1a72e1ae112bd5",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 82,
"avg_line_length": 27.59090909090909,
"alnum_prop": 0.6194398682042833,
"repo_name": "rec/echomesh",
"id": "66cfb63ae7c5bdb9b2c9febb5be03c707e97796a",
"size": "607",
... |
""" Defines an addon mixin for classes """
import projex
from projex import errors
class AddonMixin(object):
@classmethod
def _initAddons(cls, recurse=True):
"""
Initializes the addons for this manager.
"""
for addon_module in cls.addonModules(recurse):
projex.impo... | {
"content_hash": "08208ccb618bffc44d830a779c3e0d4b",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 79,
"avg_line_length": 30.485207100591715,
"alnum_prop": 0.5382375776397516,
"repo_name": "bitesofcode/projex",
"id": "69687a278f5e49f5780ed18bcc97c74e413f521f",
"size": "... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pis_system.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "86dd2a60157983e94961acfed22ef532",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 74,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.70995670995671,
"repo_name": "rumz/pis-system",
"id": "5b55631f7d54717440bd95b3aa55a1a3836f3153",
"size": "253",
... |
"""XNLI: The Cross-Lingual NLI Corpus."""
import collections
import csv
import os
from etils import epath
import six
import tensorflow_datasets.public_api as tfds
_CITATION = """\
@InProceedings{conneau2018xnli,
author = "Conneau, Alexis
and Rinott, Ruty
and Lample, Guillaume
... | {
"content_hash": "e46252ae169d0c10f303638d7dc79b88",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 80,
"avg_line_length": 35.072916666666664,
"alnum_prop": 0.6171666171666171,
"repo_name": "tensorflow/datasets",
"id": "2e345746a1fbd9638f1e29df6add196877ad98d1",
"size": "... |
import unittest
import numpy as np
from paddle.fluid.tests.unittests.test_conv3d_op import (
TestCase1,
TestConv3DOp,
TestWith1x1,
TestWithGroup1,
TestWithGroup2,
TestWithInput1x1Filter1x1,
)
class TestMKLDNN(TestConv3DOp):
def init_kernel_type(self):
self.use_mkldnn = True
... | {
"content_hash": "44c0888b5f20a46c36361da8552b4b2f",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 65,
"avg_line_length": 23.893617021276597,
"alnum_prop": 0.6375779162956366,
"repo_name": "PaddlePaddle/Paddle",
"id": "df6c099e1377a5c9d5694151c77ddd12317ee375",
"size": "... |
"""
Python ICE-CASCADE combined glacial-fluvial-hillslope landscape evolution model
"""
import argparse
import numpy as np
import matplotlib.pyplot as plt
import netCDF4
import sys
import logging
from . import __version__ as py_ice_cascade_version
class main_model():
"""
Composite landscape evolution model. I... | {
"content_hash": "c3030a23b62acf153e7c6d45956af5ea",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 83,
"avg_line_length": 34.68316831683168,
"alnum_prop": 0.5779332001141878,
"repo_name": "keithfma/py_ice_cascade",
"id": "f331f6932ec9c5e3773987868a485cfcbaa27a52",
"size... |
from pycadf import cadftype
from pycadf import identifier
# Metric types can appear outside a cadf:Event record context, in these cases
# a typeURI may be used to identify the cadf:Metric data type.
TYPE_URI_METRIC = cadftype.CADF_VERSION_1_0_0 + 'metric'
METRIC_KEYNAME_METRICID = "metricId"
METRIC_KEYNAME_UNIT = "un... | {
"content_hash": "e1c8d9b4f0f48fb1d6e5308c40524e2e",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 77,
"avg_line_length": 37.21818181818182,
"alnum_prop": 0.6297020029311187,
"repo_name": "saschpe/pycadf",
"id": "190c4909661a8e1833ba72a70f4ad532eca82d1a",
"size": "2694",... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from datasets.imdb import imdb
import datasets.ds_utils as ds_utils
import xml.etree.ElementTree as ET
import numpy as np
import scipy.sparse
import scipy.io as sio
import utils.cython_bbox
import pic... | {
"content_hash": "04871d50eb1947d6c4c4066743e3df66",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 85,
"avg_line_length": 36.28852459016394,
"alnum_prop": 0.5734550054210336,
"repo_name": "junranhe/tf-faster-rcnn",
"id": "1d538551b5d338282ea9b9e0814afb409ed1b46f",
"size... |
import atdlib
from atdlib import *
import logging
import unittest
# ------------------------------------
global host, user, pswd, file, srcip, md5s, jobid, taskid, jobs, sjobs, tasks, stasks, ssl
# ----- Please verify the following test data -----
# ---- before running to get meaningful results ---
ssl = Tr... | {
"content_hash": "17d05cc7360bc58cce14bced83aa4e2a",
"timestamp": "",
"source": "github",
"line_count": 585,
"max_line_length": 92,
"avg_line_length": 31.073504273504273,
"alnum_prop": 0.668610408185719,
"repo_name": "passimens/atdlib",
"id": "6eee3749524fc6943a05b3557a412e2ca6f4d064",
"size": "181... |
import os
import sys
import Targets
import datetime
import logging
if (hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()):
GRAY = '\033[90m'
ENDC = '\033[0m'
ERROR = '\033[91m'
else:
GRAY = ''
ENDC = ''
ERROR = ''
OKLVL = 22
logger = logging.getLogger("Engine")
def create_lockfile(exploi... | {
"content_hash": "72ae9e76918ed1e2399d3b69e56b7edd",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 120,
"avg_line_length": 42.37327188940092,
"alnum_prop": 0.49603045133224577,
"repo_name": "UMD-SEAM/bugbox",
"id": "cd868957a2577522a1dea5a6d0190fda8603d0a0",
"size": "93... |
import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer.testing import attr
if cuda.available:
cuda.init()
class TestReshape(unittest.TestCase):
def setUp(self):
self.x = numpy.random.uniform(-1, 1, (4, 3, 2)).astype(numpy.float32)
s... | {
"content_hash": "0369273961d2ba6634eb8036b0911ac2",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 78,
"avg_line_length": 26.571428571428573,
"alnum_prop": 0.6317204301075269,
"repo_name": "tereka114/chainer",
"id": "580f20d1c7e47996b6465c0c74371e7988901d7b",
"size": "11... |
"""
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": "c3d8c9d3be0aeb6d2c609c36c9435c7a",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 94,
"avg_line_length": 33.96279069767442,
"alnum_prop": 0.6038071761161325,
"repo_name": "arenadata/ambari",
"id": "504a6cbebcc43cb0fae9621437a7b02cc9613da5",
"size": "732... |
from django.conf.urls import url, include
from djanban.apps.fetch.views import fetch
urlpatterns = [
url(r'^fetch$', fetch, name="fetch_boards"),
] | {
"content_hash": "21f9aa6babf45bd365139a3ce8703c94",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 48,
"avg_line_length": 21.857142857142858,
"alnum_prop": 0.7189542483660131,
"repo_name": "diegojromerolopez/djanban",
"id": "fb00df45c4a541ea633d89717557747056b0b3c7",
"siz... |
__license__ = "MIT"
from collections import defaultdict
import itertools
import sys
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
HTMLAwareEntitySubstitution,
nonwhitespace_re
)
__all__ = [
'HTMLTreeBuilder',
'SAXTreeBuilder',
'TreeBuilder',
'TreeB... | {
"content_hash": "3258fe3ee3ba201ad7f04e449c211e05",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 317,
"avg_line_length": 35.9156976744186,
"alnum_prop": 0.6043707001214084,
"repo_name": "deanishe/alfred-duden",
"id": "42077503f7ce0d850d682b42c5aeed6378e37ee3",
"size":... |
from .encoder import encode_packet
from .decoder import decode_packet
from .helpers import create_packet, contains_complete_packet
| {
"content_hash": "edd7896b7538c56c8b3586e2d0167a13",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 60,
"avg_line_length": 43.666666666666664,
"alnum_prop": 0.8320610687022901,
"repo_name": "edvinerikson/frostbite-rcon-utils-python",
"id": "4f5fa3650f41ac76282f479f92b91d209c... |
"""Tests for QueueRunner."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import tensorflow as tf
class QueueRunnerTest(tf.test.TestCase):
def testBasic(self):
with self.test_session() as sess:
# CountUpTo will raise OUT_OF_RAN... | {
"content_hash": "f8bf48a9b08a085fec67caedcd67b8c2",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 77,
"avg_line_length": 36.5969387755102,
"alnum_prop": 0.6340443329150983,
"repo_name": "panmari/tensorflow",
"id": "ef938d1984a608ef80ee202abd256befe05b9c3f",
"size": "78... |
import unittest2 as unittest
from tinycu import *
class SumTests(unittest.TestCase):
def test_full(self):
class MySumTest(TinyCu):
def __call__(self, *args):
return sum([1,2,3,4])
b = MySumTest()
result = b.intercept_call()
self.assertEqual(result,... | {
"content_hash": "b9d50833a95a3ca70b1b667472f88e3f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 40,
"avg_line_length": 21.055555555555557,
"alnum_prop": 0.5514511873350924,
"repo_name": "richardxia/asp-multilevel-debug",
"id": "9e39a876911ebe6923b36ef474e2d22583f1ec4e",... |
from flask import Flask, url_for
import os
app = Flask(__name__)
env = os.environ.get('FLASK_ENV', 'development')
app.config['ENV'] = env
# Function to easily find your assets
# In your template use <link rel=stylesheet href="{{ static('filename') }}">
app.jinja_env.globals['static'] = (
lambda filename: url_for... | {
"content_hash": "f4cfe5fbe9f422d86c32303feed7cb8c",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 76,
"avg_line_length": 25.62162162162162,
"alnum_prop": 0.6518987341772152,
"repo_name": "Code4SA/flask-template",
"id": "4310d98900cea1b3b7860ac6b944d6ab175872ad",
"size":... |
import filecmp
import os
import tempfile
import unittest
import isomedia
TESTDATA = os.path.join(os.path.dirname(__file__), 'testdata')
class TestSanity(unittest.TestCase):
def test_sanity(self):
mp4filename = os.path.join(TESTDATA, 'loop_circle.mp4')
mp4file = open(mp4filename, 'rb')
iso... | {
"content_hash": "d2b1a190ac4c3c58719a6a4c3dc3bc17",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 77,
"avg_line_length": 28.441176470588236,
"alnum_prop": 0.6452947259565667,
"repo_name": "0/isomedia",
"id": "66cb83128ca3c8b554d07927e2843867472b7c26",
"size": "967",
"... |
"""Tests for the Task Cache information collector."""
import unittest
from dfwinreg import definitions as dfwinreg_definitions
from dfwinreg import fake as dfwinreg_fake
from dfwinreg import registry as dfwinreg_registry
from winregrc import task_cache
from tests import test_lib
_DYNAMIC_INFO_DATA = bytes(bytearr... | {
"content_hash": "73739faaed2281cc62a5a60b03942be1",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 78,
"avg_line_length": 34.574074074074076,
"alnum_prop": 0.7054097482592394,
"repo_name": "libyal/winreg-kb",
"id": "c2cc106ba774c5b8965bfac1a49f17576adf561b",
"size": "75... |
import random
def MakeRandomVarificationCode(length = 50):
digits = []
for i in range(length):
digit = random.randint(0,10+26+26-1)
if digit < 10:
digits.append(str(digit))
continue
digit -= 10
if digit < 26:
digits.append(chr(digit+ord('A')))
continue
digit -= 26
digits.append(chr(digit+ord('... | {
"content_hash": "8e8a9a932b6b3e6d870004c941ece29d",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 44,
"avg_line_length": 21.22222222222222,
"alnum_prop": 0.6465968586387435,
"repo_name": "bardia73/Graph",
"id": "8dcfdde78c8783b9d74707bcb3bd1063acf5522b",
"size": "382",
... |
import test_framework.loginit
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import logging
'''
In this test we connect to one node over p2p, send it numerous inv's, and
compare the resulting number of getdata requests to a max all... | {
"content_hash": "45c8ff17f503ba0d9c7c70ff1f8dbf5d",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 110,
"avg_line_length": 39.51063829787234,
"alnum_prop": 0.6149703823371029,
"repo_name": "Justaphf/BitcoinUnlimited",
"id": "56b5cbc8881a70e0fb269f01d6ec6688b2cbbe8b",
"si... |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.quest.QuestPoster
from panda3d.core import NodePath, Point3, TextNode, Vec3, Vec4
from direct.gui.DirectGui import *
import Quests
from toontown.toon import NPCToons
from toontown.toon import ToonHead
from toontown.toon import ToonDNA
from toont... | {
"content_hash": "6d2f9a87e634a9d727ac002e96ec6181",
"timestamp": "",
"source": "github",
"line_count": 779,
"max_line_length": 362,
"avg_line_length": 49.716302952503206,
"alnum_prop": 0.5590126261974231,
"repo_name": "DedMemez/ODS-August-2017",
"id": "ae45e4df118e925fd4404d83e7de8ef7236037c5",
"s... |
from datetime import datetime
import glob
import json
import logging
import os
import sys
# The time format used in the JSON
time_fmt = "%Y-%m-%d %H:%M:%S"
# The Unix epoch
epoch = datetime.utcfromtimestamp(0)
# Differentiate between start and stop events
START = 1
STOP = 2
logging.basicConfig(level=logging.INFO,
... | {
"content_hash": "2fb309b6716d89e2077ac982936b3d74",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 70,
"avg_line_length": 28.28440366972477,
"alnum_prop": 0.5728186831008758,
"repo_name": "ECP-CANDLE/Database",
"id": "569b2710a4ca4a7ee9010442d78028b9f82c3202",
"size": "... |
"""
SET string and integer scalars (SNMPv2c)
++++++++++++++++++++++++++++++++++++++++
Perform SNMP SET operation with the following options:
* with SNMPv2c, community 'public'
* over IPv4/UDP
* to an Agent at demo.snmplabs.com:161
* for OIDs in string form and values in form of pyasn1 objects
This script performs si... | {
"content_hash": "4f979ffcfeb3180a8d2c667b1d647e8c",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 121,
"avg_line_length": 29.242105263157896,
"alnum_prop": 0.7102231821454283,
"repo_name": "etingof/pysnmp",
"id": "60fb251862c889a60ec23dfb477e4d5ceab883ae",
"size": "2778... |
from .Optimizer import Optimizer
from ..utils import create_param_state_as
class Nesterov(Optimizer):
"""
Implementation of "Nesterov's Accelerated Gradient" (NAG) which is explained
in further detail in
"On the importance of initialization and momentum in deep learning"
But the equation for NAG... | {
"content_hash": "2f9215007800eed0695518078e4550dd",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 80,
"avg_line_length": 31.147058823529413,
"alnum_prop": 0.6241737488196412,
"repo_name": "Pandoro/DeepFried2",
"id": "4b94810bd007fbbffcf00892f3f1c9187ac48206",
"size": "1... |
"""
salt._logging
~~~~~~~~~~~~~
This is salt's new logging setup.
As the name suggests, this is considered an internal API which can change without notice,
although, as best effort, we'll try not to break code relying on it.
The ``salt._logging`` package should be imported as soon as possible ... | {
"content_hash": "1a6927a6800d82f239a0a02e5fb9c233",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 93,
"avg_line_length": 28.41176470588235,
"alnum_prop": 0.6866804692891649,
"repo_name": "saltstack/salt",
"id": "43bcbac3aca9931cc50604dbb23fc5ea357de803",
"size": "1449",... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.append(os.path.abspath('../'))
import iterplus
# -... | {
"content_hash": "2bbc00d9f740a5d813fdc6ae42c3b6ce",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 80,
"avg_line_length": 32.904761904761905,
"alnum_prop": 0.7120115774240231,
"repo_name": "bebraw/iterplus",
"id": "77816d2236afdec0853ff3156647f78a9d9c1e6e",
"size": "663... |
import os
import sys
import textwrap
import warnings
from pingpp import error, util
# - Requests is the preferred HTTP library
# - Google App Engine has urlfetch
# - Use Pycurl if it's there (at least it verifies SSL certs)
# - Fall back to urllib2 with a warning if needed
try:
import urllib2
except ImportError:... | {
"content_hash": "cd204a288b21a4a1424f10af1a531c69",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 85,
"avg_line_length": 38.20938628158845,
"alnum_prop": 0.5610355253212396,
"repo_name": "hujiaweibujidao/XingShan",
"id": "2b1bf4547de71cb3e6723d37dd87521d8b46f08e",
"siz... |
import functools
from multiprocessing import Pool
import multiprocessing
import threading
from threading import Thread
import string
import time
import numpy as np
import pandas as pd
from pandas import DataFrame, Series
from sqlalchemy.orm import scoped_session
from sqlalchemy.exc import IntegrityError, ProgrammingEr... | {
"content_hash": "ad23feaa12a7688a6dd2a0cc49d393a8",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 126,
"avg_line_length": 28.428571428571427,
"alnum_prop": 0.6500147797812592,
"repo_name": "ODM2/YODA-Tools",
"id": "256e43e92478d832e3b342e7f800cf575accf972",
"size": "33... |
import email.utils
import functools
import imaplib
import socket
import time
from datetime import datetime, timedelta
from poplib import error_proto
from typing import List
import frappe
from frappe import _, are_emails_muted, safe_encode
from frappe.desk.form import assign_to
from frappe.email.receive import EmailSer... | {
"content_hash": "5afa79637894748b73ae692f50e58f5f",
"timestamp": "",
"source": "github",
"line_count": 828,
"max_line_length": 120,
"avg_line_length": 34.63164251207729,
"alnum_prop": 0.6947863993025284,
"repo_name": "mhbu50/frappe",
"id": "3a1b68339895f0f5a2e029a6670e785f50bf74ac",
"size": "28773... |
"""
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
>>> os.chdir(datadir)
"""
from __future__ import print_function, division, unicode_li... | {
"content_hash": "b8b648d52023f6142c46f090158804b1",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 110,
"avg_line_length": 42.3312101910828,
"alnum_prop": 0.6092386397833284,
"repo_name": "mick-d/nipype",
"id": "654d71b1f1253b2946fda5c5eca21dec9e98e941",
"size": "6670",... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.cloud.automl.v1beta1",
manifest={
"NormalizedVertex",
"BoundingPoly",
},
)
class NormalizedVertex(proto.Message):
r"""A vertex represents a 2D point in the image.
The normalized vertex coordinates are betwe... | {
"content_hash": "655cb88f52c74336d0302b89135f7ed7",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 91,
"avg_line_length": 26.178571428571427,
"alnum_prop": 0.6343792633015006,
"repo_name": "googleapis/python-automl",
"id": "586d4adbca779d2c256e5adab75f8f66686d04c3",
"siz... |
from flask import jsonify, abort
from flask_restful import reqparse, Resource
from config import db
from data.user import UserData
from datetime import datetime, timedelta
from data.user_session import UserSessionData
parser = reqparse.RequestParser()
parser.add_argument('username')
parser.add_argument('password')
c... | {
"content_hash": "2e457dfdf753fffa701cf7b91cbacfd4",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 84,
"avg_line_length": 32.733333333333334,
"alnum_prop": 0.6680244399185336,
"repo_name": "ONSdigital/nsdc",
"id": "b07d0af1d5f8010ec7eddc7c33bb9c1c0be29019",
"size": "982"... |
import os
import sys
from base import Daemon
from shuttl import app
from shuttl.Models.Queue import Queue
from shuttl.Models.Website import Website
## A worker daemon that clears out the publish Queue. This checks the Queue to
# see if there are any publish messages in there, if there is, publish them
# else ignore... | {
"content_hash": "ce0e5ffff531590a8276369eeb032dc8",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 122,
"avg_line_length": 36.08860759493671,
"alnum_prop": 0.4535250789196773,
"repo_name": "shuttl-io/shuttl",
"id": "c466f93a1a8c8a93da45a18ea2ca34cc5faf356d",
"size": "285... |
import socket
import threading
import time
import zlib
import httplib
import urllib2
import urlparse
try:
import cPickle as pickle
except ImportError:
import pickle
from . import UniformRetryStrategy
import logging
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
__all__ = ['W... | {
"content_hash": "ae1f645dc620b4a2b4c35c201204763c",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 96,
"avg_line_length": 28.43778801843318,
"alnum_prop": 0.5733268514017177,
"repo_name": "crypt3lx2k/Imageboard-Web-Interface",
"id": "2b4eed09450b95d1dec500b4b628f0c43b24b0... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import Environment, EnvironmentProject
from sentry.testutils import APITestCase
class ProjectEnvironmentsTest(APITestCase):
def test_get(self):
project = self.create_project()
environment = En... | {
"content_hash": "495fde5bc46bf08a50986bdeeac24513",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 98,
"avg_line_length": 32.43010752688172,
"alnum_prop": 0.5185676392572944,
"repo_name": "mvaled/sentry",
"id": "a3bee0c4d3cbee6fa8b1e261b2d5bad67bd6dd8f",
"size": "3016",
... |
import contextlib
import uuid
from django.db.utils import IntegrityError, InternalError
from django.test import TestCase, TransactionTestCase
from unittest.mock import patch
from casexml.apps.case.mock import CaseBlock, CaseFactory, CaseStructure
from corehq.apps.hqcase.utils import submit_case_blocks
from corehq.app... | {
"content_hash": "937644fcf9cf08abcab1674498c004d3",
"timestamp": "",
"source": "github",
"line_count": 553,
"max_line_length": 111,
"avg_line_length": 38.34719710669078,
"alnum_prop": 0.6375082523814015,
"repo_name": "dimagi/commcare-hq",
"id": "fc04cea6349a9bb9847e7eb0db50fed0e9e30c8a",
"size": "... |
""" Art Gatherer class module """
from collections import namedtuple
from datetime import datetime
from urllib import request
import numpy as np
from mtgsdk import Card, Set
import cv2
from colorpie.image_processing import ImageProcessing
MagicCard = namedtuple('MagicCard', [
'card_id',
'name',
'set_code... | {
"content_hash": "018e9c07c9a0fc5d04a567b2fee3ab3c",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 78,
"avg_line_length": 27.972972972972972,
"alnum_prop": 0.5748792270531401,
"repo_name": "valenc3x/colorpie",
"id": "7b34df2811bea5e7f26152a6967a80c36f3b4f27",
"size": "3... |
from abc import abstractproperty
import requests
class PreparedMoodleRequest(requests.PreparedRequest):
def __init__(self):
super().__init__()
self.function = None
def prepare(self, data=None, **kwargs):
if 'wsfunction' in data:
self.function = data['wsfunction']
s... | {
"content_hash": "1bc1d14b01433b44d12a455f6ab89dc7",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 93,
"avg_line_length": 29.990825688073393,
"alnum_prop": 0.5992658305292138,
"repo_name": "manly-man/moodle-destroyer-tools",
"id": "7eba482f6e558fa5df701603147f0129eb08073b... |
"""Defines plots for clustering models built with scikit-learn."""
from warnings import simplefilter
import pandas as pd
import sklearn
import wandb
from wandb.sklearn import utils
from wandb.sklearn import calculate
# ignore all future warnings
simplefilter(action="ignore", category=FutureWarning)
def clusterer... | {
"content_hash": "fd0d2d3068393e3540ec70c3ef8dfcfa",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 92,
"avg_line_length": 33.710344827586205,
"alnum_prop": 0.6612111292962357,
"repo_name": "wandb/client",
"id": "8704f17099473a6ae77eccc06711be861ae40539",
"size": "4888",... |
from __future__ import unicode_literals
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'ThreadedComment.email_hash'
db.delete_column('generic_threadedcomm... | {
"content_hash": "33fdb83d674baf2bbe4efe6c47aaadc0",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 182,
"avg_line_length": 72.05454545454545,
"alnum_prop": 0.554882664647994,
"repo_name": "eRestin/MezzGIS",
"id": "a94c77297f7c047717ecc781be485c2ad6a3a9ae",
"size": "7944... |
import logging
import time
from datetime import datetime, timedelta
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import connection, transaction
from kitsune.questions.models import Question, QuestionMappingType
from kitsune.search.es_utils import ES_EXCEPTIONS, g... | {
"content_hash": "1ea321de78534e3ac90e0926b3e36936",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 77,
"avg_line_length": 38.717948717948715,
"alnum_prop": 0.5529801324503312,
"repo_name": "anushbmx/kitsune",
"id": "06c374e93e7a0ab23986e63e213b5e85ab4addfe",
"size": "302... |
"""Tests for the reconstruction of non-debugger-decorated GraphDefs."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tempfile
from tensorflow.core.framework import graph_pb2
from tensorflow.core.protobuf import config_pb2
from tensorflow.core.prot... | {
"content_hash": "a9620b175cd4e6c5de4716afbd12a563",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 79,
"avg_line_length": 40.928994082840234,
"alnum_prop": 0.6774613271649559,
"repo_name": "renyi533/tensorflow",
"id": "fb722efab4ef8a8e78ce14f6980c1aa93c95208a",
"size": ... |
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
# '-Wc++98-compat',
'-Wno-long-long',
'-Wno-v... | {
"content_hash": "ae60a343f3096a1154cff47141c2d963",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 80,
"avg_line_length": 31.089171974522294,
"alnum_prop": 0.6805982380659701,
"repo_name": "darthdeus/dotfiles",
"id": "158acae1d4a2aba7665d924022d0fc8c62dcc811",
"size": "... |
import unittest
from quickbooks import QuickBooks
from quickbooks.objects.purchaseorder import PurchaseOrder
class PurchaseOrderTests(unittest.TestCase):
def test_unicode(self):
purchase_order = PurchaseOrder()
purchase_order.TotalAmt = 1000
self.assertEquals(str(purchase_order), '1000')... | {
"content_hash": "a323564bab466393b5982449b9fed02a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 64,
"avg_line_length": 27.263157894736842,
"alnum_prop": 0.7027027027027027,
"repo_name": "ZachGoldberg/python-quickbooks",
"id": "102ae393d5fe9435c459eb56d81375526ec213f9",
... |
import sys
if sys.platform != 'android':
from panda3d.ode import OdeBody, OdeBoxGeom, OdeMass, OdePlaneGeom, OdeSphereGeom, OdeUtil
from panda3d.core import BitMask32, NodePath, Quat, Vec4
from direct.directnotify import DirectNotifyGlobal
from toontown.minigame import DistributedMinigamePhysicsWorld
from too... | {
"content_hash": "594f736e070bfd835428c8f00d7598cd",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 168,
"avg_line_length": 48.752747252747255,
"alnum_prop": 0.6767722303617717,
"repo_name": "DedMemez/ODS-August-2017",
"id": "d70572361cc4079bf4fae902ba2dbd2d0c96fcc5",
"s... |
'''
Created on Mar 17, 2017
@author: tonyq
'''
import codecs
import csv
import pandas as pd
import numpy as np
import re, sys, os
import time
from bs4 import BeautifulSoup
import logging
from keras.preprocessing.sequence import pad_sequences
from tqdm._tqdm import tqdm
from numpy import array, zeros... | {
"content_hash": "1ce015bf7e71fc34ff908a089fbda9b1",
"timestamp": "",
"source": "github",
"line_count": 436,
"max_line_length": 194,
"avg_line_length": 36.10550458715596,
"alnum_prop": 0.5266802185236946,
"repo_name": "tonyqtian/quora-simi",
"id": "cbd56200d377181530c0fbae35367d524948abbf",
"size":... |
"""Script to flash new firmware to the tactile device.
Use: python3 flash_firmware.py [port] firmware.ino.zip
This script uses the nordicsemi.dfu Python library to flash a new ino.zip
firmware binary to a connected tactile device.
Instructions:
1. Install adafruit-nrfutil with `pip3 install --user adafruit-nrfutil`... | {
"content_hash": "860a57268e827be77104e3a69032c988",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 80,
"avg_line_length": 31.363636363636363,
"alnum_prop": 0.6940711462450593,
"repo_name": "google/audio-to-tactile",
"id": "ea6cb91ed3112966468cad3adcc23920e458fecb",
"siz... |
__version__ = '$Revision: 1.3 $'[11:-2]
from twisted.trial import unittest
from twisted.protocols import htb
class DummyClock:
time = 0
def set(self, when):
self.time = when
def __call__(self):
return self.time
class SomeBucket(htb.Bucket):
maxburst = 100
rate = ... | {
"content_hash": "b52eb27eeec60715f812e60547745e0c",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 82,
"avg_line_length": 29.88888888888889,
"alnum_prop": 0.5882899628252788,
"repo_name": "timkrentz/SunTracker",
"id": "7f5ef873decf55ae3d7fe3d721c7407221457f15",
"size": ... |
from django.contrib import admin
from systempay import models
class SystemPayTransactionAdmin(admin.ModelAdmin):
list_display = ['mode', 'operation_type', 'amount', 'currency',
'order_number', 'trans_id', 'trans_date', 'date_created']
readonly_fields = [
'operation_type',
'... | {
"content_hash": "e7b6fd35bfcfd3364e577bc7d96c5b50",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 77,
"avg_line_length": 26,
"alnum_prop": 0.5784023668639053,
"repo_name": "bastien34/django-oscar-systempay",
"id": "feed586a137efae6b054f058aab4ea2c50da357c",
"size": "676... |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = _descriptor.FileDescriptor(
name='managed_user_shared_setting_spec... | {
"content_hash": "baec38099795d57d432a013a04a433cd",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 299,
"avg_line_length": 39.66233766233766,
"alnum_prop": 0.733464309102816,
"repo_name": "smartdj/chrome-sync-server",
"id": "eb0f761a8ab84e8789f55c50ef5c1ff053d9d977",
"si... |
import mraa
IN = mraa.DIR_IN
OUT = mraa.DIR_OUT
class gpio:
def __init__(self, pin, direction):
self.gpio = mraa.Gpio(pin)
self.gpio.dir(direction)
def input(self):
return self.gpio.read()
def output(self, value):
self.gpio.write(value)
def on(self):
self.gpi... | {
"content_hash": "0e14eed482d9afc6c56993a3873162c2",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 39,
"avg_line_length": 18,
"alnum_prop": 0.5767195767195767,
"repo_name": "fjacob21/pycon2015",
"id": "79b45e70b1cbccba78983c2c5ce404acc45e77eb",
"size": "1573",
"binary"... |
from fs.tests import FSTestCases, ThreadingTestCases
import unittest
import os
import sys
import shutil
import tempfile
import subprocess
import time
from os.path import abspath
import urllib
from six import PY3
try:
from pyftpdlib import ftpserver
except ImportError:
if not PY3:
raise ImportError(... | {
"content_hash": "4224b35a1702e5d7896720a74bd95eda",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 103,
"avg_line_length": 29.61467889908257,
"alnum_prop": 0.5641263940520446,
"repo_name": "wylieswanson/agilepyfs",
"id": "588367f7eddc9d7e65f90907310bfe390111997d",
"size... |
from google.appengine.ext import ndb
from logic.notification_request import CONTENT_TYPE_JSON
from models import Employee
class Subscription(ndb.Model):
"""Models a webhook subscription."""
request_method = ndb.StringProperty(required=True, default='post')
request_format = ndb.StringProperty(required=Tru... | {
"content_hash": "1a4d8e8878c38e13811bcffbcddec0dd",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 81,
"avg_line_length": 34.86486486486486,
"alnum_prop": 0.6759689922480621,
"repo_name": "Yelp/love",
"id": "c27732583855c7ad8b41e01353e3783243c8882e",
"size": "1314",
"b... |
from __future__ import absolute_import
from traits.has_traits import Interface
# ============= standard library imports ========================
# ============= local library imports ==========================
class IDVCSource(Interface):
def get_irradiation_import_spec(self, name):
pass
def conne... | {
"content_hash": "297285b7333e9efd50e5bd989044fcf4",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 65,
"avg_line_length": 23.1,
"alnum_prop": 0.474025974025974,
"repo_name": "NMGRL/pychron",
"id": "8a6792cf623c5251db451d45fad6e11032e96ee4",
"size": "1191",
"binary": fa... |
from types import SimpleNamespace
from typing import Dict
from unittest.mock import MagicMock, patch
from django.http import HttpRequest
from django.http.response import HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.actions import do_rename_stream
from zerver.lib.exceptions import InvalidJSON... | {
"content_hash": "86fcd07af6acb830a8c9c2bd16bd4a61",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 178,
"avg_line_length": 42.905660377358494,
"alnum_prop": 0.6655672823218998,
"repo_name": "eeshangarg/zulip",
"id": "97940e7c094f52d67847a5f4b00282b446363323",
"size": "9... |
import argparse
import string
class TestGroup:
def __init__(self, name, parent = None):
self.parent = parent
self.name = name
self.testGroups = {}
self.testCases = {}
if parent:
assert not name in parent.testGroups
parent.testGroups[name] = self
def getName (self):
return self.name
def getPath ... | {
"content_hash": "5b25da2f2dc06afbbbacb91fcc26e602",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 158,
"avg_line_length": 29.021164021164022,
"alnum_prop": 0.7132178669097539,
"repo_name": "geekboxzone/lollipop_external_deqp",
"id": "1f23a2c857bc201fdcec694d7711224a78514... |
import json
import os
from django.contrib import admin
from django.db import models
from .templates import *
from .utils import get_fieldclass_by_name
class BaseSettings(object):
def template(self, *args):
settings_str = self.tpl.format(*args)
return json.loads(settings_str)
@property
d... | {
"content_hash": "e224b58c7c972a287c5787d376830294",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 85,
"avg_line_length": 26.976744186046513,
"alnum_prop": 0.5658045977011494,
"repo_name": "fmarco/django-lite",
"id": "5722f70b2d32aedcd8d43f875e4aa5fa06ad5fb2",
"size": "... |
from isserviceup.services.models.statuspage import StatusPagePlugin
class HashiCorp(StatusPagePlugin):
name = 'HashiCorp'
status_url = 'https://status.hashicorp.com/'
icon_url = '/images/icons/hashicorp.png'
| {
"content_hash": "c39d9f8f0004abaa568b0f210fd65b9d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 67,
"avg_line_length": 31.714285714285715,
"alnum_prop": 0.7477477477477478,
"repo_name": "marcopaz/is-service-up",
"id": "1333ccb3674daca54717768ecfcae785cb9e9371",
"size":... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class abstractclassmethod(classmethod): # NOQA: N801
"""Backport from Python 3.2
Once we are only on Python 3.3+, `abstractmethod` should be sufficient.
"""
__slots__ = ()
__isabstractm... | {
"content_hash": "e95b38e8b8590b0d667d3f1412a81892",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 75,
"avg_line_length": 27.941176470588236,
"alnum_prop": 0.6589473684210526,
"repo_name": "epage/nixnet-python",
"id": "1fbabae7efa4de07ed634d0dead646cb1a4b1ab3",
"size": "... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import os.path
readme = ""
here = os.path.abspath(os.path.dirname(__file__))
readme_path = os.path.join(here, "README.rst")
if os.path.exists(readme_path):
with open(readme_path, "rb") as stream:
readme = strea... | {
"content_hash": "dec14041966b524d9a4acb0625ac82d8",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 81,
"avg_line_length": 32.583333333333336,
"alnum_prop": 0.5933503836317136,
"repo_name": "adamcharnock/lightbus",
"id": "1d26e026f89c7acf328898793ab8d737a2bf664b",
"size":... |
import json
from database import db_models
from logic import db_to_api
R = db_models.Rep
def main():
rep_datas = []
for db_rep in R.query:
rep_datas.append([
db_rep.rep_id,
db_rep.first_name,
db_rep.last_name,
db_rep.state_code,
db_rep.state... | {
"content_hash": "88c024feb78e05f7c9825cdbe5e7bb45",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 62,
"avg_line_length": 24.40740740740741,
"alnum_prop": 0.5417298937784522,
"repo_name": "jlgoldman/writetogov",
"id": "0b692ead3311dfe7f5240513ee58f9ffdddb8783",
"size": "... |
from genologics.entities import Project
from config import RUN_PROCESSES, RAW_DIR, PROCESSED_DIR, NEXTCLOUD_HOST,NEXTCLOUD_WEBDAV_ROOT,NEXTCLOUD_RAW_DIR,NEXTCLOUD_PROCESSED_DIR,NEXTCLOUD_MANUAL_DIR,MAIL_SENDER, NEXTCLOUD_USER, NEXTCLOUD_PW
from os.path import expanduser, exists
from texttable import Texttable
import da... | {
"content_hash": "b8603cf402f83081a0fd69d3744b2143",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 199,
"avg_line_length": 39.27,
"alnum_prop": 0.6258594346829641,
"repo_name": "CuppenResearch/clarity_utils",
"id": "5118f32bf33771dc027b7c42682b4c03ce8566f1",
"size": "15... |
"""Core module. Provides the basic operations needed in sympy.
"""
from .sympify import sympify, SympifyError
from .cache import cacheit
from .basic import Basic, Atom, preorder_traversal
from .singleton import S
from .expr import Expr, AtomicExpr, UnevaluatedExpr
from .symbol import Symbol, Wild, Dummy, symbols, var
... | {
"content_hash": "f995602529750b65b2b629c6ed4b93ea",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 78,
"avg_line_length": 39.57142857142857,
"alnum_prop": 0.7631768953068592,
"repo_name": "kaushik94/sympy",
"id": "380a72ea80bc3a05e7891698aff5ca984d97cc59",
"size": "1385"... |
import os
import re
import sys
import urllib
"""Logpuzzle exercise
Given an apache logfile, find the puzzle urls and download the images.
Here's what a puzzle url looks like:
10.254.254.28 - - [06/Aug/2007:00:13:48 -0700] "GET /~foo/puzzle-bar-aaab.jpg HTTP/1.0" 302 528 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; e... | {
"content_hash": "085b8b1374aa70b46fb3cb6fb54a9b56",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 192,
"avg_line_length": 28.2027027027027,
"alnum_prop": 0.6425491135601341,
"repo_name": "bourneagain/pythonBytes",
"id": "1e4833c5ec76bbddc6989f5d149fa68f08686ceb",
"size"... |
import abc
from typing import Dict, Optional
from paralleldomain.decoding.common import DecoderSettings, LazyLoadPropertyMixin, create_cache_key
from paralleldomain.decoding.map_query.map_query import MapQuery
from paralleldomain.model.map.area import Area
from paralleldomain.model.map.edge import Edge
from paralleldo... | {
"content_hash": "8b7db787bdab6ab3793a141215a3ee11",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 99,
"avg_line_length": 32.421052631578945,
"alnum_prop": 0.6282467532467533,
"repo_name": "parallel-domain/pd-sdk",
"id": "af27020f8f653eca80a89e827f7160d33f2b0935",
"size... |
from django import forms
from django.conf import settings
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.encoding import force_unicode
from django.contrib.admin.util import flatten_fieldsets
from django.contrib.contenttypes.models import ContentType
class AdminForm... | {
"content_hash": "80b46304b1bb770c320bd08dd1c002ad",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 110,
"avg_line_length": 37.12169312169312,
"alnum_prop": 0.6150228050171037,
"repo_name": "chewable/django",
"id": "aaa2e304ced423013af0aea32dfba39ad22af519",
"size": "701... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.