text stringlengths 4 1.02M | meta dict |
|---|---|
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/engine/shared_eng_sorosuub_tuned_l_337_ion_engine.iff"
result.attribute_template_id = 8
result.stfName("space/space_item","eng_sorosuub_tuned_l_337_ion_engine_n")
#### BEGIN MODIFICATIONS ##... | {
"content_hash": "87ad0b5b8a6b8c35d789b11bfeefd19c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 106,
"avg_line_length": 28.46153846153846,
"alnum_prop": 0.7162162162162162,
"repo_name": "obi-two/Rebelion",
"id": "7da68a7b7088b39a11a075204642b771d10753c6",
"size": "515... |
#!/usr/bin/python
#//////////////////////////////////////////////////////////////////////////////
#
# Copyright (c) 2007,2009 Daniel Adler <dadler@uni-goettingen.de>,
# Tassilo Philipp <tphilipp@potion-studios.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purp... | {
"content_hash": "1c327bc047f2706e0e34fe7c0e72ffb6",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 79,
"avg_line_length": 29.507462686567163,
"alnum_prop": 0.5892766818411735,
"repo_name": "atsushieno/jenoa",
"id": "3fea7db3ea35d92a468e2dfd1cac13807f6e71cc",
"size": "197... |
"""
Volume driver for NetApp NFS storage.
"""
import os
from oslo_log import log as logging
from oslo_log import versionutils
import six
from cinder import exception
from cinder.i18n import _
from cinder import interface
from cinder import utils
from cinder.volume.drivers.netapp.dataontap.client import client_7mode
... | {
"content_hash": "261166ecd63f4c9094f6d00dbfabd2f9",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 79,
"avg_line_length": 41.09848484848485,
"alnum_prop": 0.6068202764976959,
"repo_name": "ge0rgi/cinder",
"id": "478879c4a98693e63e9a6713d59e04b49de10d5f",
"size": "11825"... |
""" History related magics and functionality """
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team.
#
# Distributed under the terms of the BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
... | {
"content_hash": "2bf58f3667e79eda61edc1de7c8bbc92",
"timestamp": "",
"source": "github",
"line_count": 877,
"max_line_length": 93,
"avg_line_length": 35.93728620296465,
"alnum_prop": 0.5611574705714376,
"repo_name": "bdh1011/wau",
"id": "adae60dc2bebdd123ffdd765207e9b0da206ccf0",
"size": "31517",
... |
"""A collection of metrics which sample per-example values."""
from typing import Any, List, Optional, Text, Tuple
import apache_beam as beam
import numpy as np
from tensorflow_model_analysis.metrics import metric_types
from tensorflow_model_analysis.utils import beam_util
from tensorflow_model_analysis.utils import ... | {
"content_hash": "3f4dfc433109d82c2adeac46fc420812",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 79,
"avg_line_length": 36.825,
"alnum_prop": 0.662367051369088,
"repo_name": "tensorflow/model-analysis",
"id": "10abcee60b68131ab723b4c5f4464305dae790d2",
"size": "4994",... |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple
from google.api_core import grpc_helpers
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # ty... | {
"content_hash": "5f9f3da866d5b8b8d58a9ec90e2f1111",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 114,
"avg_line_length": 44.31782945736434,
"alnum_prop": 0.6107224068567431,
"repo_name": "googleads/google-ads-python",
"id": "07937681f6c5c53381b0ccf4b5b32711f140ea16",
... |
from msrest.serialization import Model
class ErrorEntity(Model):
"""Body of the error response returned from the API.
:param code: Basic error code.
:type code: str
:param message: Any details of the error.
:type message: str
:param extended_code: Type of error.
:type extended_code: str
... | {
"content_hash": "5e9aec2cdee39a1d0473c40351a8eb81",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 127,
"avg_line_length": 37.37837837837838,
"alnum_prop": 0.6276211135213304,
"repo_name": "rjschwei/azure-sdk-for-python",
"id": "e559412a967f75fafa517e1e4685a03e10913ba2",
... |
import warnings
import numpy as np
from numbers import Integral, Real
from scipy import sparse
from math import sqrt
from ..metrics import pairwise_distances_argmin
from ..metrics.pairwise import euclidean_distances
from ..base import (
TransformerMixin,
ClusterMixin,
BaseEstimator,
ClassNamePrefixFeat... | {
"content_hash": "cf21586b1627e465590b9d8801e88a2a",
"timestamp": "",
"source": "github",
"line_count": 737,
"max_line_length": 88,
"avg_line_length": 35.260515603799185,
"alnum_prop": 0.6011467272097587,
"repo_name": "espg/scikit-learn",
"id": "4c9d7921fdc704fc95496fd683c2eaab1deb0b70",
"size": "2... |
"""Test runner for typeshed.
Depends on mypy and pytype being installed.
If pytype is installed:
1. For every pyi, run "pytd <foo.pyi>" in a separate process
"""
import os
import re
import sys
import argparse
import subprocess
import collections
parser = argparse.ArgumentParser(description="Pytype tests.")
pars... | {
"content_hash": "12f7312d2d5c72a2398e79c9e2bd5fa2",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 92,
"avg_line_length": 27.02777777777778,
"alnum_prop": 0.5686879068174032,
"repo_name": "vvv1559/intellij-community",
"id": "e7475c0be115903003c1420c3dfa08507779849b",
"s... |
"""
Sponge Knowledge Base
Demo
"""
from java.util import Random
class SubmittableActionArg(Action):
def onConfigure(self):
self.withLabel("Submittable argument")
self.withArgs([
StringType("arg1").withLabel("Argument 1").withNullable().withProvided(
ProvidedMeta().withV... | {
"content_hash": "57b6d19902b64c2a96e63c8464e53422",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 115,
"avg_line_length": 52.22222222222222,
"alnum_prop": 0.65,
"repo_name": "softelnet/sponge",
"id": "f144280a19bb4c2b43cc670e7ea6a6a3a48aa06f",
"size": "1880",
"binary"... |
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = 'django-timesheet',
version = '0.1',
url = 'http://github.com/myles/django-timesheet',
license = 'BSD License',
description = 'A Django timesheet application.'... | {
"content_hash": "111c7f50aa782dffe59c46fde4c46cf0",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 67,
"avg_line_length": 23.36111111111111,
"alnum_prop": 0.6611177170035671,
"repo_name": "philippeowagner/django-timesheet",
"id": "814bab92faadc081bb52e9e78f4d98194afac296",... |
"""Web screen capture script with QtWebKit
How to use
==========
$ python screenshot.py -h
usage: screenshot.py [-h] [-a AGENT] [-l LANGUAGE] [-w WIDTH] [-H HEIGHT]
[-p PREFIX] [-s]
url
positional arguments:
url specify request url
optional... | {
"content_hash": "7aec2e82d53175bf97963c5713d89dde",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 106,
"avg_line_length": 34.11219512195122,
"alnum_prop": 0.5958815958815958,
"repo_name": "shkumagai/pyside-sandbox",
"id": "0aa07f0aaaedf3227329c069d5a8fa5bd475f721",
"si... |
import pathlib
from typing import Any, BinaryIO, Dict, List, Tuple, Union
import numpy as np
from torchdata.datapipes.iter import IterDataPipe, Mapper, UnBatcher
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import hint_shardi... | {
"content_hash": "105e34279e20cec038754ecd0e46ebf6",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 105,
"avg_line_length": 33.21686746987952,
"alnum_prop": 0.6180631120783461,
"repo_name": "pytorch/vision",
"id": "6dd55a77c99f2d17457fe94db54fa53f3e78490d",
"size": "2757"... |
from django.test import TestCase
from django_dynamic_fixture import get
from readthedocs_build.config import BuildConfig
from readthedocs.builds.models import Version
from readthedocs.projects.models import Project
from readthedocs.doc_builder.config import ConfigWrapper
def get_build_config(config, env_config=None... | {
"content_hash": "b29fdea95a733fedfbfbcb1b852cc3a7",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 78,
"avg_line_length": 41.324675324675326,
"alnum_prop": 0.6731615336266499,
"repo_name": "espdev/readthedocs.org",
"id": "dda9c8ac3fae1005dc1df02fc0324dc5c3220d25",
"size"... |
"""
Lasagne implementation of ILSVRC2015 winner on the mnist dataset
Deep Residual Learning for Image Recognition
http://arxiv.org/abs/1512.03385
"""
from __future__ import print_function
import sys
import os
import time
import string
import numpy as np
import theano
import theano.tensor as T
import lasagne
import ... | {
"content_hash": "2f76a9fffa7436bb29d6dfe65fd49415",
"timestamp": "",
"source": "github",
"line_count": 491,
"max_line_length": 122,
"avg_line_length": 41.78615071283096,
"alnum_prop": 0.6134912511575766,
"repo_name": "VCG/gp",
"id": "7d172a566d076c04cb52120ecd527543b719cbb2",
"size": "20540",
"b... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_rebel_brigadier_general_trandoshan_female.iff"
result.attribute_template_id = 9
result.stfName("npc_name","trandoshan_base_female")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
... | {
"content_hash": "8de39edc5be90580bd40b684cc328738",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 95,
"avg_line_length": 25.846153846153847,
"alnum_prop": 0.7172619047619048,
"repo_name": "obi-two/Rebelion",
"id": "a1317bcdf52cf2d76b3d7686c8c832f4667b46e7",
"size": "481... |
"""
The top-most bit of code that ties everything together into one runnable
server process. The two important parts here are:
* The RESTful JSON API that runs under twisted.web. This is primarily used
to pipe commands into the Minecraft process from websites or other
applications.
* The Minecraft server process w... | {
"content_hash": "22ded7a20e03265434282be4727b30f2",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 79,
"avg_line_length": 43.2037037037037,
"alnum_prop": 0.7625375053579083,
"repo_name": "gtaylor/zombiepygman",
"id": "c529781673af87fe36868000059d204815f9a51e",
"size": "2... |
"""
NewzbinDownloader - Downloads NZBs directly from v3.newzbin.com via the
DirectNZB API: http://docs.newzbin.com/Newzbin::DirectNZB
(c) Copyright 2005-2007 Philip Jenvey
Thomas Hurst <freaky@newzbin.com>
Dan Borello
[See end of file]
"""
import os, random, Hellanzb.NZB... | {
"content_hash": "7d757c7d038809c2891f5aa31325cd81",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 102,
"avg_line_length": 41.81725888324873,
"alnum_prop": 0.6188395241563486,
"repo_name": "emikulic/hellanzb",
"id": "6d25ba5f55533a14c3c45501c6a580af53022403",
"size": "8... |
'''
I N S T A L L A T I O N::
Step 1:
Copy "no_flip_pole_vector_tool.py" to your Maya plugins directory.
Windows: C:\Users\UserName\Documents\maya\scripts
Step 2:
Run this in the Maya's Script Editor under the Python tab...
import no_flip_pole_vector_tool as nfpv
nfpv.No_Flip_Pole_Vector().show_ui()
If you have a... | {
"content_hash": "8e0258e8f695ba6a2ccdd27624c7b6fb",
"timestamp": "",
"source": "github",
"line_count": 529,
"max_line_length": 159,
"avg_line_length": 35.119092627599244,
"alnum_prop": 0.5504898266767144,
"repo_name": "nicholas-silveira/art_pipeline",
"id": "f707dabc00b526292b8df6dd3bfa36d64cc75e28"... |
"""
pygments.lexers.foxpro
~~~~~~~~~~~~~~~~~~~~~~
Simple lexer for Microsoft Visual FoxPro source code.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer
from pygments.token import Punctu... | {
"content_hash": "9d534679b92eb77c3e01fdf302cd3a3c",
"timestamp": "",
"source": "github",
"line_count": 427,
"max_line_length": 80,
"avg_line_length": 61.386416861826696,
"alnum_prop": 0.6577521745765298,
"repo_name": "jinie/sublime-wakatime",
"id": "868a44d820c4a3e1a2bad92a0d707bc8fce16bc4",
"size... |
import os
import sys
CURRENT_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
sys.path.append(CURRENT_DIRECTORY + '/')
from webpages import homepage, weather
PAGES = {
'/': homepage,
'/weather': weather
}
def application(environ, start_response):
page = environ.get('PATH_INFO')
request_type = environ.ge... | {
"content_hash": "88dcc5fdfde3382c3d80873179efb3af",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 63,
"avg_line_length": 23.27027027027027,
"alnum_prop": 0.6957026713124274,
"repo_name": "chughtaimh/chughtaimh-pythonanywhere",
"id": "50c26f8ccea50a22e282f9e836c3780dcec3db... |
from xscontainer import api_helper
from xscontainer import util
from xscontainer.util import log
from xscontainer.docker_monitor import api as docker_monitor_api
import glob
import os
import random
import re
import shutil
import tempfile
CLOUD_CONFIG_OVERRIDE_PATH = (
"/opt/xensource/packages/files/xscontainer/c... | {
"content_hash": "6023d81079c612dcf62a534267333269",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 79,
"avg_line_length": 38.02250803858521,
"alnum_prop": 0.6178435517970402,
"repo_name": "xenserver/xscontainer",
"id": "f6152f39e24bb9dd54ca82ec028f1d08a4de483f",
"size":... |
"""
[2016-05-04] Challenge #265 [Easy] Permutations and combinations part 2
https://www.reddit.com/r/dailyprogrammer/comments/4htg9t/20160504_challenge_265_easy_permutations_and/
Basically the same challenge as Monday's, but with much larger numbers and so code that must find permutation and
combination numbers witho... | {
"content_hash": "a896f7307b601d8f213c90983db8336b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 119,
"avg_line_length": 40.345454545454544,
"alnum_prop": 0.7210455159981974,
"repo_name": "DayGitH/Python-Challenges",
"id": "a264ec89a30d6ff33bb9ffb417f7251d78e8e84f",
"s... |
__author__ = 'adeb'
# Hack to be able to run this module
import sys
import os
sys.path.insert(0, os.path.abspath('../..'))
import matplotlib
matplotlib.use('Agg')
import PIL
from spynet.models.network import *
from spynet.models.neuron_type import *
from spynet.data.dataset import Dataset
from spynet.utils.utilities... | {
"content_hash": "bab2d120c0a91e6a802e3bbe76352d8c",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 116,
"avg_line_length": 33.55769230769231,
"alnum_prop": 0.5684813753581662,
"repo_name": "adbrebs/spynet",
"id": "c1961dd813387c28a82043308de1b267d2f645b5",
"size": "1745"... |
import yaml
import json
import urllib.request
import time
from wallet import Wallet
from database.database import Database
config = yaml.safe_load(open("config.yml"))
f = open('dataset.txt', 'r')
dataset = f.readlines()
dataset = [float(i) for i in dataset]
walletBitcoin = 0.0
cash_wallet = Wallet()
firstrun = True
... | {
"content_hash": "4aa1dc9d768654ebd1a554f66142fa99",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 101,
"avg_line_length": 26.83431952662722,
"alnum_prop": 0.6116868798235943,
"repo_name": "ifcodingmaastricht/blockchainbot",
"id": "42dd0d9db5b06bf7e23693b44f3c48aae1381257... |
from datetime import timedelta
from flexget.manager import Session
from flexget.plugins.filter.delay import DelayedEntry
class TestDelay:
config = """
tasks:
test:
mock:
- title: entry 1
delay: 1 hours
"""
def test_delay(self, execute_task):
... | {
"content_hash": "32f2bc877a34378eaa4622526d9cf297",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 79,
"avg_line_length": 32.206896551724135,
"alnum_prop": 0.6134903640256959,
"repo_name": "Flexget/Flexget",
"id": "6a83c9d76996a3a3927b43c6f6c24440d6c00416",
"size": "934"... |
from __future__ import (absolute_import, division, print_function)
import cgi
try: # Python 3
from urllib.parse import urlencode
except ImportError: # Python 2
from urllib import urlencode
from owslib.etree import etree
from owslib.util import openURL, strip_bom
class WMSCapabilitiesR... | {
"content_hash": "a5e757cbb11da03c5813a68cbad46794",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 89,
"avg_line_length": 35.36904761904762,
"alnum_prop": 0.5950858296869741,
"repo_name": "geographika/OWSLib",
"id": "7de5d6e2ab97b352f913c78c8179f5d6fb87df3a",
"size": "29... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import sys
if sys.version_info[0] != 2:
basestring = str
class Processor:
"""
Framework for allowing modules to modify the input data as a set of
transforms. Once the original input d... | {
"content_hash": "99eb858d3f798ca5ccdac9a21f645ef7",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 79,
"avg_line_length": 31,
"alnum_prop": 0.5956989247311828,
"repo_name": "csparkresearch/ExpEYES17-Qt",
"id": "cb7f029ad2604cb29ab0710082f776b758cf3c44",
"size": "2387",
... |
"""Tools to allow different io formats."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_data
from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_l... | {
"content_hash": "29c71a6f2fadf5e1d57cdd295475a44c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 107,
"avg_line_length": 74.04166666666667,
"alnum_prop": 0.8300506471581317,
"repo_name": "mengxn/tensorflow",
"id": "456792835827f86c0fbc42822e688240e6643ed4",
"size": "24... |
from .data_viz import DataVisualizationNode, SplomPlotNode
from .cv_plot import CrossValidationVisualizationNode
__all__ = ["DataVisualizationNode",
"SplomPlotNode",
"CrossValidationVisualizationNode"]
| {
"content_hash": "64a37595afa17eeefb0caa26ff78e42c",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 58,
"avg_line_length": 37.5,
"alnum_prop": 0.7466666666666667,
"repo_name": "CurryBoy/ProtoML-Deprecated",
"id": "a2d074068423e6c6bcb4235fd1b83f73009fbb4d",
"size": "225",
... |
import flask
from openahjo_activity_streams import convert
import requests
import logging
import json
OPENAHJO_URL = 'http://dev.hel.fi/paatokset/v1/agenda_item/?order_by=-last_modified_time'
def create_app(remote_url=OPENAHJO_URL, converter=convert.to_activity_stream):
logging.basicConfig(level=logging.INFO)
... | {
"content_hash": "e7b411368e9cb9f680da9b5e49baa3a4",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 107,
"avg_line_length": 33.46153846153846,
"alnum_prop": 0.7218390804597701,
"repo_name": "ThoughtWorksInc/HelsinkiActivityStream",
"id": "1e0b094ff56f9301f3986dcc6adbfbde063... |
"""Provides the Session class and related utilities."""
import weakref
from .. import util, sql, engine, exc as sa_exc, event
from ..sql import util as sql_util, expression
from . import (
SessionExtension, attributes, exc, query, util as orm_util,
loading, identity
)
from .util import (
object_mapper,... | {
"content_hash": "b4749ed42c0ec5d5f0548296f0c37a70",
"timestamp": "",
"source": "github",
"line_count": 2305,
"max_line_length": 83,
"avg_line_length": 39.52234273318872,
"alnum_prop": 0.6031789591543266,
"repo_name": "femmerling/DirMaker",
"id": "71e617e365787dd552e7c0b98d1ca95475c01a51",
"size": ... |
"""Query list of all contributors and reviewers in a release"""
import json
import re
import sys
import requests
from sh.contrib import git
if len(sys.argv) != 5:
print(f'Usage: {sys.argv[0]} [starting commit/tag] [ending commit/tag] [GitHub username] ' +
'[GitHub password]')
sys.exit(1)
from_com... | {
"content_hash": "7390487482c88c1a56149c71ad055a67",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 104,
"avg_line_length": 38.733333333333334,
"alnum_prop": 0.5938037865748709,
"repo_name": "dmlc/xgboost",
"id": "d57ad3f7c28ae22ab4c8548c5e9c3b7043379b45",
"size": "2905",... |
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
import sys
# Define required packages.
requires = []
# Assume spidev is required on non-windows & non-mac platforms (i.e. linux).
if sys.platform != 'win32' and sys.platform != 'darwin':
requires.append('spidev')
set... | {
"content_hash": "c670da3cd38d5ddc52675715fa322eb1",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 168,
"avg_line_length": 40.04545454545455,
"alnum_prop": 0.619750283768445,
"repo_name": "MinnowBoard/minnow-maker",
"id": "394d08c119b1d39c1a67d4ca095aa70cb0ea640c",
"size... |
"""Loss helper functions."""
import tensorflow.compat.v2 as tf
def softmax_cross_entropy(pos, neg):
"""softmax cross entropy loss.
Let d_p = pos, d_n = neg.
we minimize:
log(1+exp(d_p)) + log(1+exp(-d_n))
for stability, is it equivalent to
d_p + log(1+exp(-d_p)) + log(1+exp(-d_n))
Args:
pos: Tens... | {
"content_hash": "bfdcb0026d29bd07019d99b96b500e33",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 59,
"avg_line_length": 24.291666666666668,
"alnum_prop": 0.6363636363636364,
"repo_name": "google-research/google-research",
"id": "11f6c50dff84713f5269d2c155ff1acce8fa337b",... |
from models.scf import Element, SCF
from models.rasp import *
import re
## Extractor for RASP dependency format
# @author Adriano Zanette
# @version 0.1
class RaspDependencyExtractor:
## Class constuctor
# @author Adriano Zanette
# @version 0.1
# @return DatabaseBuilder
def __init__(self):
... | {
"content_hash": "303a8d55f2ea2d95cd843aaca6f9d478",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 108,
"avg_line_length": 25.46031746031746,
"alnum_prop": 0.614713216957606,
"repo_name": "adzanette/scf-extractor",
"id": "712b770445aa328aa877d2b193892bbfda14c8c3",
"size"... |
"""
**********
Exceptions
**********
Base exceptions and errors for NetworkX.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult(dschult@colgate.edu)"""
# Copyright (C) 2004-2008 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Piet... | {
"content_hash": "2ab5044cd496da23ace328d772060b93",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 114,
"avg_line_length": 26.71875,
"alnum_prop": 0.6970760233918128,
"repo_name": "JaneliaSciComp/Neuroptikon",
"id": "de2d958beb12051c06e11b4426fb7c6e50ca6d0f",
"size": "85... |
from rx.core import Observable, AnonymousObservable
from rx.disposables import SerialDisposable, CompositeDisposable, \
SingleAssignmentDisposable
from rx.concurrency import immediate_scheduler
from rx.internal import extensionmethod
@extensionmethod(Observable)
def expand(self, selector, scheduler=None):
""... | {
"content_hash": "4c9cb1e34e5a62d31379efe2eba631ee",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 88,
"avg_line_length": 32.12820512820513,
"alnum_prop": 0.5494812450119713,
"repo_name": "Sprytile/Sprytile",
"id": "24f89cd51c3422d45b0d5baa432f4481a4616a41",
"size": "250... |
from django.apps import AppConfig
class BallerShotCallerConfig(AppConfig):
name = 'baller_shot_caller'
| {
"content_hash": "3b049c5d3086d12a003bf064dffd9761",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 40,
"avg_line_length": 21.8,
"alnum_prop": 0.7798165137614679,
"repo_name": "kizzen/Baller-Shot-Caller",
"id": "f09e480cd8cdb49246f03910c36d56729a37f0a5",
"size": "109",
"... |
from datahub.configuration.common import AllowDenyPattern
def test_allow_all() -> None:
pattern = AllowDenyPattern.allow_all()
assert pattern.allowed("foo.table")
def test_deny_all() -> None:
pattern = AllowDenyPattern(allow=[], deny=[".*"])
assert not pattern.allowed("foo.table")
def test_single_... | {
"content_hash": "54e124564007185c1ba6be228b15d7f5",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 71,
"avg_line_length": 31.955555555555556,
"alnum_prop": 0.694019471488178,
"repo_name": "linkedin/WhereHows",
"id": "6f3af9cba287fe93a6feb253dd4ba83b255871a3",
"size": "14... |
import json
from twisted.web.client import Agent
from twisted.internet import defer, reactor
from twisted.internet.endpoints import TCP4ClientEndpoint
from ooni import errors as e
from ooni.settings import config
from ooni.utils import log
from ooni.utils.net import BodyReceiver, StringProducer, Downloader
from ooni.... | {
"content_hash": "a52dc235f1bb88fc758c96b1a0c495c3",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 99,
"avg_line_length": 32.00452488687783,
"alnum_prop": 0.5496960271454828,
"repo_name": "0xPoly/ooni-probe",
"id": "388bb6817b95531dd15ccf8c6e446952744b767f",
"size": "70... |
from __future__ import print_function
from flexbe_core import EventState, Logger
import rospy
from wm_nlu.srv import AnswerQuestion
from std_msgs.msg import String
class SaraNLUspr(EventState):
'''
Use wm_nlu to parse a sentence and return the answer.
># sentence string sentence to parse
... | {
"content_hash": "b991d8a1ab45c617301ca431802895b1",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 116,
"avg_line_length": 32.023809523809526,
"alnum_prop": 0.6237918215613383,
"repo_name": "WalkingMachine/sara_behaviors",
"id": "7460556284461fa70f7d937d41175d7c42d74b24",
... |
import os
from pip.backwardcompat import urllib
from tests.lib.path import Path
from pip.index import package_to_requirement, HTMLPage
from pip.index import PackageFinder, Link, INSTALLED_VERSION
from tests.lib import path_to_url
from string import ascii_lowercase
from mock import patch
def test_package_name_should_b... | {
"content_hash": "f3e43f12fde30c850e1f8ab0c9e5e7e9",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 114,
"avg_line_length": 34.21052631578947,
"alnum_prop": 0.662051282051282,
"repo_name": "alquerci/pip",
"id": "63d49d63361ce1752e6949f712263b50f6e41ab4",
"size": "1950",
... |
import logging
from collections import defaultdict
from paddle.nn import Layer
from paddle.jit import to_static, not_to_static
from paddle.fluid.framework import Parameter
from paddle.fluid.framework import program_guard
from paddle.fluid.executor import global_scope
from paddle.fluid.dygraph.dygraph_to_static.program... | {
"content_hash": "d64d76a5583a4970e4d9ca246f80c670",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 98,
"avg_line_length": 31.392857142857142,
"alnum_prop": 0.5948192876520522,
"repo_name": "luotao1/Paddle",
"id": "31deaea4275eb969a5e9bed344663cd78b054236",
"size": "1203... |
from nose.tools import assert_equal, assert_true
from numpy.testing import assert_array_equal
import os
import sqlite3
import tables
import numpy as np
from tools import check_cmd
from helper import tables_exist, find_ids, exit_times, \
h5out, sqliteout, clean_outs, to_ary, which_outfile
"""Tests"""
def test_sourc... | {
"content_hash": "533631922b2f9fc7654b876b3e6acf72",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 79,
"avg_line_length": 39.604166666666664,
"alnum_prop": 0.6212519726459758,
"repo_name": "rwcarlsen/cyclus",
"id": "ab9210d6c0dbee65292599d75510c4b08394c43f",
"size": "382... |
import unittest
import openmesh
class TriMeshGarbageCollection(unittest.TestCase):
def setUp(self):
self.mesh = openmesh.TriMesh()
self.mesh.request_vertex_status()
self.mesh.request_edge_status()
self.mesh.request_halfedge_status()
self.mesh.request_face_status()
... | {
"content_hash": "7cd6a389305536a61ed0802f49db3afa",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 99,
"avg_line_length": 43.45238095238095,
"alnum_prop": 0.5909589041095891,
"repo_name": "svn2github/OpenMesh4",
"id": "07c820b2c216acb7d00b57f7ef539fa9b9d6985c",
"size": ... |
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import FileSystemStorage
from django.utils.importlib import import_module
from django.contrib.staticfiles import utils
class StaticFilesStorage(FileSystemStorage):
"""
... | {
"content_hash": "ee60521e6924fec33c24eacb10d63908",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 85,
"avg_line_length": 39.74418604651163,
"alnum_prop": 0.6012287887653599,
"repo_name": "GoSteven/Diary",
"id": "a7784b56453f318d00b5518b49425c3c9a64f795",
"size": "3418",... |
import shutil
import sys
from os.path import join
from test import base
class TestImportHook(base.TestPyConcreteBase):
def test_py_import_hook(self):
import os
assert os
import csv
assert csv
def test_py_relative_import(self):
import os
sys.path.insert(0, os... | {
"content_hash": "fbec9bb23f1e59e0a678c56a074a65b6",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 75,
"avg_line_length": 27.416666666666668,
"alnum_prop": 0.6362715298885512,
"repo_name": "Falldog/pyconcrete",
"id": "9081479a4d543d132e8e2c18a2ea7c76a73fc79c",
"size": "1... |
"""
The __init__ module of the protocol package.
This module contains some fuctions common to all sub packages.
Attributes:
DATA_BLOCK (str): Data block type string.
METADATA_BLOCK (str): Metadata block type string.
build (function): Message building function.
parse (function): message parsin... | {
"content_hash": "8a5bce6277ac49da1aa3fb201887db4f",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 64,
"avg_line_length": 20.576470588235296,
"alnum_prop": 0.5900514579759862,
"repo_name": "doctoromer/haya-data",
"id": "568264d93d7d6ff5b7f0be8e7ef7f0efff9a58d4",
"size": ... |
def extractBarnnnBlogspotCom(item):
'''
Parser for 'barnnn.blogspot.com'
'''
if 'Voice Drama' in item['tags']:
return None
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
if 'Lower Bound Volume' in item['title... | {
"content_hash": "cedc8dc6fbcbb47d18a1d70b5641ea0c",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 140,
"avg_line_length": 39.53333333333333,
"alnum_prop": 0.5868465430016864,
"repo_name": "fake-name/ReadableWebProxy",
"id": "344522d525095cb68d61bede63575c5a31ef1561",
"s... |
import datetime
import unittest
import mock
from airflow.models.dag import DAG
from airflow.providers.microsoft.azure.sensors.wasb import WasbBlobSensor, WasbPrefixSensor
class TestWasbBlobSensor(unittest.TestCase):
_config = {
'container_name': 'container',
'blob_name': 'blob',
'wasb_co... | {
"content_hash": "4b7bba75f34db3d16bc3a00d3da4a9b4",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 91,
"avg_line_length": 31.63302752293578,
"alnum_prop": 0.5672853828306265,
"repo_name": "wooga/airflow",
"id": "74dc0f17f0692cceaed65b106542db9e065bc004",
"size": "4238",... |
from fabric.api import *
root_dir = '/srv/http'
# the user to use for the remote commands
env.user = 'www-data'
# the servers where the commands are executed
env.hosts = ['c-hans.de']
def pack():
# create a new source distribution as tarball
local('python setup.py sdist --formats=gztar', capture=False)
def ... | {
"content_hash": "759b2f1ec66784dad32dfc7a4d16694a",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 71,
"avg_line_length": 34.361111111111114,
"alnum_prop": 0.6645109135004043,
"repo_name": "christianhans/mensafeed",
"id": "6e5129dfb5713a0a4b60c9bbbd816094f637b5e1",
"size... |
from proxy import Proxy
from .basespider import BaseSpider
from scrapy.selector import Selector
class ProxyRoxSpider(BaseSpider):
name = 'proxyrox'
def __init__(self, *a, **kwargs):
super(ProxyRoxSpider, self).__init__(*a, **kwargs)
self.urls = ['https://proxyrox.com/?p=%s' % n for n in rang... | {
"content_hash": "798ed7df88c6286f5dbece5dc540a05f",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 111,
"avg_line_length": 32.95454545454545,
"alnum_prop": 0.5206896551724138,
"repo_name": "meihuanyu/rental",
"id": "275944fdaa0ec028f9eccdf16a60bf8a3b0806f9",
"size": "146... |
from unittest import TestCase
from django.test import ignore_warnings
from django.utils.deprecation import RemovedInDjango50Warning
with ignore_warnings(category=RemovedInDjango50Warning):
from django.utils.baseconv import (
BaseConverter, base2, base16, base36, base56, base62, base64,
)
# RemovedIn... | {
"content_hash": "17cc950fdb0bdcd08cbf8adb301ab78b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 76,
"avg_line_length": 38.30909090909091,
"alnum_prop": 0.6483151400094922,
"repo_name": "ghickman/django",
"id": "989e1eb0bf5e04564f13154c034b50cb14fb7e67",
"size": "2107"... |
"""
This module contains the default values for all settings used by Scrapy.
For more information about these settings you can read the settings
documentation in docs/topics/settings.rst
Scrapy developers, if you add a setting here remember to:
* add it in alphabetical order
* group similar settings without leaving ... | {
"content_hash": "5a9adb536a62f7498a30aadb8a63579d",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 100,
"avg_line_length": 30.2984496124031,
"alnum_prop": 0.75399769732634,
"repo_name": "xtmhm2000/scrapy-0.22",
"id": "8acca09285439019b514529a3241492de2aa570b",
"size": "... |
import string,random
import hashlib
import datetime
from faker import Faker
from web.util.db import db
from .feed import FeedSite,Feed
class UserInfo(db.EmbeddedDocument):
nickname = db.StringField()
class UserSetting(db.EmbeddedDocument):
unread_only = db.BooleanField(default=True)
theme = db.... | {
"content_hash": "ceb55f4e5ce211cce5985bc5e9b89772",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 84,
"avg_line_length": 28.26865671641791,
"alnum_prop": 0.5850052798310454,
"repo_name": "zhy0216/Conuread",
"id": "dbeaa1ab539cc74a6d8dd7c243833c21d70af4c3",
"size": "570... |
"""
"""
import argparse
import subprocess
import tempfile
import logging
import os
from bingo import bingo
from bingo import card_maker
def get_words_from_textfile(textfile_handler):
"""Yield the words by parsing a given text fileahandler."""
for line in textfile_handler:
line = line.rstrip()
... | {
"content_hash": "d2e8051a5960d496426f9a1a50ab7862",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 76,
"avg_line_length": 32.00917431192661,
"alnum_prop": 0.5543135568930926,
"repo_name": "Commonists/bingo",
"id": "c5ffc1f80ebfc1a37b791fe3313e81bf65123b4e",
"size": "348... |
"""
Summarize the deny log messages from ipfw.
Use the given file names, or /var/log/security if no filenames are given.
This program can handle compressed files like /var/log/security.?.bz2.
"""
import argparse
import bz2
import logging
import re
import sys
__version__ = "2020.03.31"
def main():
"""
Entry... | {
"content_hash": "534e55d28b1bdc52bd112d839f85a5f4",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 86,
"avg_line_length": 25.84,
"alnum_prop": 0.5661764705882353,
"repo_name": "rsmith-nl/scripts",
"id": "3ddf3106343394e54bb665ed1bcaf645b7d9c6e4",
"size": "2839",
"bina... |
import sys
# sys.path.append('<path to macfp-db>/macfp-db/Utilities/')
sys.path.append('../../../../../../macfp-db/Utilities/')
import macfp
import importlib
importlib.reload(macfp) # use for development (while making changes to macfp.py)
import matplotlib.pyplot as plt
macfp.dataplot(config_filename='UConn_FM_Burner... | {
"content_hash": "d05c20f800d5593fc484192af7f35e42",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 80,
"avg_line_length": 32.05555555555556,
"alnum_prop": 0.6065857885615251,
"repo_name": "rmcdermo/macfp-db",
"id": "56ba9350a6638cc9ddcb2d5c7c9694f45e83d70f",
"size": "821... |
from revscoring.dependencies import DependentSet
from ...feature import Feature
from ...meta import aggregators, bools
from .diff import Diff
class Revision(DependentSet):
def __init__(self, name, revision_datasources):
super().__init__(name)
self.datasources = revision_datasources
sel... | {
"content_hash": "a4aac2178fb9e2cab4ca964da47334e3",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 79,
"avg_line_length": 40.275510204081634,
"alnum_prop": 0.601216113503927,
"repo_name": "he7d3r/revscoring",
"id": "918e5be23ca2b9a15573e427536d5f260020c461",
"size": "394... |
"""AWS platform for notify component."""
import asyncio
import base64
import json
import logging
from homeassistant.components.notify import (
ATTR_TARGET,
ATTR_TITLE,
ATTR_TITLE_DEFAULT,
BaseNotificationService,
)
from homeassistant.const import CONF_PLATFORM, CONF_NAME
from homeassistant.helpers.json... | {
"content_hash": "6723e494a7b642b4e912477eb2cb9543",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 84,
"avg_line_length": 31.421940928270043,
"alnum_prop": 0.5847992480193367,
"repo_name": "fbradyirl/home-assistant",
"id": "fa1cf3fa36334567a47b897433b6c7ac6a69b686",
"si... |
from flask import Flask
from flask import escape
def build_flask_app():
flask_app = Flask(__name__, static_folder="../../dashboardapp/dist", static_url_path="/app")
# The following settings will likely be overriden.
flask_app.config["DEBUG"] = False
flask_app.config["SECRET_KEY"] = "SECRET"
flas... | {
"content_hash": "0b5d31b6a2e9f4393c4b00d947c1086c",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 96,
"avg_line_length": 29.46153846153846,
"alnum_prop": 0.6266318537859008,
"repo_name": "zstars/weblabdeusto",
"id": "6870bafbc3150513221a6ef1c4c9c9ea1889e371",
"size": "7... |
import __builtin__
import __future__
import functools
import imp
import inspect
import json
from pathlib import Path
import optparse
import os
import os.path
import subprocess
import sys
# When build files are executed, the functions in this file tagged with
# @provide_for_build will be provided in the build file's l... | {
"content_hash": "5110b656651c9b9b8f5faf057d774a8e",
"timestamp": "",
"source": "github",
"line_count": 694,
"max_line_length": 99,
"avg_line_length": 35.22766570605187,
"alnum_prop": 0.6198053010471204,
"repo_name": "luiseduardohdbackup/buck",
"id": "e5cc66bbe43fde44705376eb7fc479482bb239e0",
"siz... |
import logging
import os
import re
import sys
from nose.plugins import Plugin
from base import Knows
def modname(qualname):
candidate = qualname[0]
for elem in qualname[1:]:
if ".".join((candidate, elem)) not in sys.modules:
return candidate
candidate = ".".join((candidate, elem)... | {
"content_hash": "e10647e750bf35bc2029403782bee77c",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 79,
"avg_line_length": 31.339130434782607,
"alnum_prop": 0.5574361820199778,
"repo_name": "venmo/nose-knows",
"id": "a1258917f8b99ca033b65c7b124bab6b7bfd95cc",
"size": "36... |
"""test_mock_chroot.py - Testing for mock_chroot.py
"""
import pytest
from subprocess import CalledProcessError
from mock_chroot import MockChroot
import mock_chroot
class TestMockChroot(object):
@pytest.mark.parametrize(
('init_args', 'more_args', 'expected'),
[
(
dic... | {
"content_hash": "b603606f9f08c6baa72021c67ccbb487",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 80,
"avg_line_length": 34.38461538461539,
"alnum_prop": 0.5105833763551885,
"repo_name": "ifireball/python-mockchroot",
"id": "46a7d38944c2c4fd491a85933f7eb35af3fb0d90",
"... |
class LinkActionType(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type.
attributeMap... | {
"content_hash": "49faccb32a548684b335f45c2568edad",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 97,
"avg_line_length": 26.2,
"alnum_prop": 0.5629770992366412,
"repo_name": "farooqsheikhpk/Aspose_Pdf_Cloud",
"id": "6b3363c1c994a9ce1cec14368da5cb8c22f69617",
"size": "54... |
from setuptools import setup, find_packages
version = '1.8'
LONG_DESCRIPTION = """
How to use django-pagination
----------------------------
``django-pagination`` allows for easy Digg-style pagination without modifying
your views.
There are really 5 steps to setting it up with your projects (not including
installa... | {
"content_hash": "34133a8a513958e2781b71ef09b6f883",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 81,
"avg_line_length": 32.954198473282446,
"alnum_prop": 0.6905258281213806,
"repo_name": "intelligenia/django-pagination",
"id": "90da75ef3c591e5206a77e0e9372d2fdee3dc769",... |
import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
fX = theano.config.floatX
def test_tied_init():
network = tn.SequentialNode(
"s",
[tn.InputNode("i", shape=()),
tn.AddBiasNode("b1", inits=[treeano.inits.Constant... | {
"content_hash": "84f24ab427b1bf5cf588ef4e520be065",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 74,
"avg_line_length": 27.40909090909091,
"alnum_prop": 0.6334991708126037,
"repo_name": "jagill/treeano",
"id": "699a6558a829a06f079a4940aed02e012b94659d",
"size": "603",
... |
from django.db import models
from core.mixins import ObjectUrlMixin
from core.keyvalue.base_option import DHCPKeyValue, CommonOption
class Group(models.Model, ObjectUrlMixin):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=255)
#parent_group = models.ForeignKey('Group', null=... | {
"content_hash": "b9325be39ba44e94fdb73862cc0f80ab",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 75,
"avg_line_length": 23.78048780487805,
"alnum_prop": 0.6235897435897436,
"repo_name": "rtucker-mozilla/inventory",
"id": "256437d33f0cdd38c9296b81f980eb1383b5eb2d",
"siz... |
import posixpath
from compiled_file_system import Unicode
from extensions_paths import (
API_FEATURES, JSON_TEMPLATES, MANIFEST_FEATURES, PERMISSION_FEATURES)
import features_utility
from future import Gettable, Future
from third_party.json_schema_compiler.json_parse import Parse
def _AddPlatformsFromDependencie... | {
"content_hash": "4bd08ea1770d8d87ad49486034189498",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 80,
"avg_line_length": 38.27777777777778,
"alnum_prop": 0.6823899371069182,
"repo_name": "ChromiumWebApps/chromium",
"id": "a81321492dcef55210888832f0cf5df54a3025a0",
"siz... |
import math
import os
import random
import re
import sys
# Complete the flippingBits function below.
def flippingBits(n):
swapped = [1 if x is '0' else 0 for x in "{:032b}".format(n)]
swapped_str = ''.join(str(x) for x in swapped)
i = int(swapped_str, 2)
return i
if __name__ == '__main__':
fptr = ... | {
"content_hash": "dd85295b4102e55f61823ab4ec72f09e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 65,
"avg_line_length": 22.304347826086957,
"alnum_prop": 0.5964912280701754,
"repo_name": "jekhokie/scriptbox",
"id": "bc95f472407e0fa118e5fe32da55dff1c49cfc5a",
"size": "6... |
"""Unit tests for scripts/concurrent_task_utils.py."""
from __future__ import annotations
import builtins
import threading
import time
from core import python_utils
from core.tests import test_utils
from . import concurrent_task_utils
def test_function(unused_arg):
return python_utils.OBJECT
class Concurren... | {
"content_hash": "d685607de23fa1b1cafa28b5e805587c",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 80,
"avg_line_length": 35.66111111111111,
"alnum_prop": 0.6050786726904502,
"repo_name": "kevinlee12/oppia",
"id": "5c2491c43418e21e3f85dd1a6eb9e425aeb1e16d",
"size": "704... |
import os
from setuptools import setup
import jsonrpyc
this_dir = os.path.dirname(os.path.abspath(__file__))
keywords = [
"rpc", "json", "json-rpc", "2.0",
]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Developm... | {
"content_hash": "c171b2c87dab722caa87e10efd439ff3",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 79,
"avg_line_length": 26.705882352941178,
"alnum_prop": 0.6527165932452276,
"repo_name": "riga/jsonrpyc",
"id": "3b59617621ef5fbefcd5e720f7a814f9e32a12a3",
"size": "1381",... |
import plyvel
import ast
import hashlib
import os
import sys
import threading
from processor import print_log, logger
from utils import bc_address_to_hash_160, hash_160_to_pubkey_address, Hash, \
bytes8_to_int, bytes4_to_int, int_to_bytes8, \
int_to_hex8, int_to_bytes4, int_to_hex4
"""
Patricia tree for hash... | {
"content_hash": "20e5ba5c31271a2a9226a6356ccd103e",
"timestamp": "",
"source": "github",
"line_count": 665,
"max_line_length": 143,
"avg_line_length": 32.25714285714286,
"alnum_prop": 0.5126101347256539,
"repo_name": "pooler/electrum-ltc-server",
"id": "506c74a02fb16bfa13bb451827b14dbc7c8773c8",
"... |
import unittest
from asp.config import *
class CompilerDetectorTests(unittest.TestCase):
def test_detect(self):
self.assertTrue(CompilerDetector().detect("gcc"))
self.assertFalse(CompilerDetector().detect("lkasdfj"))
class CPUInfoTests(unittest.TestCase):
def test_num_cores(self):
d... | {
"content_hash": "9ab2361d1a955ae23e86c6c94c61e2ce",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 97,
"avg_line_length": 31,
"alnum_prop": 0.6048387096774194,
"repo_name": "richardxia/asp-multilevel-debug",
"id": "8f6ef85b077c414458004dd7461a9ad5dead84ab",
"size": "2232... |
try:
import smbus
except ImportError:
raise ImportError("python3-smbus not found. Install with 'sudo apt-get install python3-smbus'")
try:
import spidev
except ImportError:
raise ImportError("spidev not found. Visit https://www.abelectronics.co.uk/kb/article/2/spi-and-raspbian-linux-on-a-raspberry-pi fo... | {
"content_hash": "68b3ea6c8cf9ca265d60b0e1163a6b94",
"timestamp": "",
"source": "github",
"line_count": 841,
"max_line_length": 157,
"avg_line_length": 34.902497027348396,
"alnum_prop": 0.5636221169897455,
"repo_name": "abelectronicsuk/ABElectronics_Python3_Libraries",
"id": "8ee340d28477b74233fc66f1... |
import os
current_path = os.path.abspath(os.path.curdir)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db',
}
}
USE_TZ = True
SITE_ID = 1
SECRET_KEY = 'keepitsecretkeepitsafe'
ROOT_URLCONF = 'test_app.urls'
STATIC_URL = '/... | {
"content_hash": "9dd072fa272d6768a426d1ceee5b2004",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 47,
"avg_line_length": 20.02173913043478,
"alnum_prop": 0.6351791530944625,
"repo_name": "toolhub/toolhub.co",
"id": "36ee83cec5bf991cd6e93b537e7c3836f5e77da4",
"size": "92... |
"""
This code is adapted from Deep Learning Tutorials
http://deeplearning.net/tutorial/logreg.html
Copyright (c) 2008–2013, Theano Development Team All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
R... | {
"content_hash": "e26a68550a86bd05d1b67ccafd937b80",
"timestamp": "",
"source": "github",
"line_count": 504,
"max_line_length": 105,
"avg_line_length": 37.226190476190474,
"alnum_prop": 0.6132075471698113,
"repo_name": "zhengsx/multiverso",
"id": "cc81373445fec6197c5e2c5bdda21dfe7c8f41a9",
"size": ... |
"""
NLTK corpus readers. The modules in this package provide functions
that can be used to read corpus fileids in a variety of formats. These
functions can be used to read both the corpus fileids that are
distributed in the NLTK corpus package, and corpus fileids that are part
of external corpora.
Corpus Reader Func... | {
"content_hash": "709d7002a92580b85154b33b9d52715a",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 72,
"avg_line_length": 41.448,
"alnum_prop": 0.7598919127581548,
"repo_name": "devs4v/devs4v-information-retrieval15",
"id": "e48be766bf67a2881591035b2cab4e584961f243",
"s... |
import unittest
from CelestialMechanics.orbits.hyperbola import angle_asymptotic
class MyTestCase(unittest.TestCase):
def test_something(self):
angle1, angle2 = angle_asymptotic(1.5)
self.assertAlmostEqual(131.81031489577862, angle1)
self.assertAlmostEqual(228.18968510422138, angle2)
if... | {
"content_hash": "9a026cc5ea1338eebd6d26b325dcc0d9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 64,
"avg_line_length": 26.071428571428573,
"alnum_prop": 0.7178082191780822,
"repo_name": "Camiloasc1/AstronomyUNAL",
"id": "4e549e1f581cd03b7075950c9350d1317b727c9a",
"siz... |
from django.conf.urls import url, include
from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token
from api import views
urlpatterns = format_suffix_patterns([
# swagger documentation url
url(r'^docs/', include('rest_framework_swag... | {
"content_hash": "6aaf3f9196e4dddaec1aadcfa70cb9b2",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 72,
"avg_line_length": 33.475,
"alnum_prop": 0.6250933532486931,
"repo_name": "andela-cdike/django_bucketlist_app",
"id": "1bfbab4e100be92ea29cfdcda3697ff189fdff7d",
"size"... |
from runner.koan import *
class AboutClasses(Koan):
class Dog(object):
"Dogs need regular walkies. Never, ever let them drive."
def test_instances_of_classes_can_be_created_adding_parentheses(self):
fido = self.Dog()
self.assertEqual(__, type(fido).__name__)
def test_classes_have... | {
"content_hash": "0a85d8fb2b4c897fa462ef4cca135c21",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 79,
"avg_line_length": 29.954545454545453,
"alnum_prop": 0.5289399523086928,
"repo_name": "brainstorm/python_koans",
"id": "564554bbad66969d709225ff8858c2045e0f3d83",
"siz... |
import txaio
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
from autobahn.wamp.types import SubscribeOptions, RegisterOptions
from autobahn.wamp.cryptobox import KeyRing, Key
from autobahn.wamp.exception import ApplicationError
from sample_ke... | {
"content_hash": "949516185eb0e546854173f227b08135",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 102,
"avg_line_length": 43.73809523809524,
"alnum_prop": 0.6622210125204138,
"repo_name": "crossbario/crossbar-examples",
"id": "9d0b6c84aba41e5eb27e6670c7a2e9fed53934cc",
... |
import json
import tempfile
import unittest
from unittest import mock
from unittest.mock import patch
import kubernetes
from parameterized import parameterized
from airflow import AirflowException
from airflow.models import Connection
from airflow.providers.cncf.kubernetes.hooks.kubernetes import KubernetesHook
from ... | {
"content_hash": "a10f0899b5f61292a1c350f98786ae19",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 110,
"avg_line_length": 44.06837606837607,
"alnum_prop": 0.6662141194724592,
"repo_name": "DinoCow/airflow",
"id": "9a01d8fa5007be77f4bb3c74b3f84f5a924167e8",
"size": "594... |
from datetime import datetime
from django.contrib.auth import get_user_model
from django.utils import timezone
import factory
from factory.django import DjangoModelFactory
class UserFactory(DjangoModelFactory):
class Meta:
model = get_user_model()
first_name = "Jane"
last_name = factory.Sequenc... | {
"content_hash": "010e3babb248d360637b83b75b9d4519",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 76,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.6895761741122566,
"repo_name": "fin/froide",
"id": "e7b7303399b9370581a81f0bf756019cb367f902",
"size": "873",
"... |
from __future__ import absolute_import, division, print_function
from cryptography.hazmat._oid import ObjectIdentifier
from cryptography.hazmat.primitives import hashes
class ExtensionOID(object):
SUBJECT_DIRECTORY_ATTRIBUTES = ObjectIdentifier("2.5.29.9")
SUBJECT_KEY_IDENTIFIER = ObjectIdentifier("2.5.29.14... | {
"content_hash": "5647d62fb6174b5ea339da126bc7f1ad",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 79,
"avg_line_length": 47.559386973180075,
"alnum_prop": 0.7226295013292516,
"repo_name": "kimjinyong/i2nsf-framework",
"id": "2bf606e50d6bbadac859f3f147153f7a99d999c5",
"... |
from unittest import mock
import pytest
@pytest.mark.django_db
@mock.patch("django_rocket.models.uuid4")
@mock.patch("django_rocket.models.get_random_string")
def test_invitation_tokens(get_random_string, uuid4):
get_random_string.return_value = "CODE"
uuid4.return_value.hex = "TOKEN"
from django_rocket... | {
"content_hash": "3f9f387e45645afa9f9ac08eef63ec32",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 53,
"avg_line_length": 25.444444444444443,
"alnum_prop": 0.7270742358078602,
"repo_name": "mariocesar/django-rocket",
"id": "bb148185a95240498e1fddd1273895934abaab07",
"siz... |
from unittest import mock
from keystoneauth1 import session
from requests_mock.contrib import fixture
import testtools
from barbicanclient import client
from barbicanclient import exceptions
class TestClient(testtools.TestCase):
def setUp(self):
super(TestClient, self).setUp()
self.responses = ... | {
"content_hash": "d425bcded1f98a827b91b3427d1fe037",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 79,
"avg_line_length": 40.711191335740075,
"alnum_prop": 0.6250775915580384,
"repo_name": "openstack/python-barbicanclient",
"id": "87c7296981b717cfcd3329a227f164b9c0a36534"... |
from a10sdk.common.A10BaseClass import A10BaseClass
class Limit(A10BaseClass):
"""Class Description::
Specify limit for GSLB Message Protocol.
Class limit supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param ardt_respo... | {
"content_hash": "186757d54d413c1e9bb881c548b8b775",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 215,
"avg_line_length": 51.319148936170215,
"alnum_prop": 0.6364013266998342,
"repo_name": "a10networks/a10sdk-python",
"id": "c11bb7c3b8dcd2a58f82538520d805f9f7bcaa90",
"s... |
"""
@file test_temperature_lps331ap.py
"""
##
# @addtogroup soletta sensor
# @brief This is sensor test based on soletta app
# @brief test temperature function of sensor lps331ap on Galileo/MinnowMax
import os
import time
from oeqa.utils.helper import shell_cmd
from oeqa.oetest import oeRuntimeTest
from EnvirSetup imp... | {
"content_hash": "b153cc526d28c996387fb4bc0e6c3170",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 88,
"avg_line_length": 38.80882352941177,
"alnum_prop": 0.5892383478590375,
"repo_name": "daweiwu/meta-iotqa-1",
"id": "c472def0d82548a501cc590f1310da93a910fee3",
"size": "... |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename('chart_gap04.xlsx')
def test_create_file... | {
"content_hash": "9bb34a894681f13903392ec5deacfa17",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 68,
"avg_line_length": 27.522727272727273,
"alnum_prop": 0.5309661436829067,
"repo_name": "jmcnamara/XlsxWriter",
"id": "34a51aca8dac7c801ee7ea7ac2504190a0ab1d08",
"size": ... |
import sys
import os
from os.path import abspath, join, dirname
sys.path.append(abspath(join(dirname(__file__), "..")))
from shared_conf import *
# Releases changelog extension
extensions.append("releases")
releases_document_name = ["changelog", "changelog-v1"]
releases_github_path = "fabric/fabric"
# Intersphinx f... | {
"content_hash": "af69f089d0b0cf867acdb719a61445b3",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 29.96153846153846,
"alnum_prop": 0.7150192554557124,
"repo_name": "fabric/fabric",
"id": "a0a3d72860720adfe3c038d0dd7d0805cd880142",
"size": "809",
... |
"""Basic tests for TF-TensorRT integration."""
import numpy as np
from tensorflow.python.compiler.tensorrt.test import tf_trt_integration_test_base as trt_test
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow... | {
"content_hash": "c64cbfc1a4547f111dc10ce6856ed3ef",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 93,
"avg_line_length": 36.4496644295302,
"alnum_prop": 0.6032958939421837,
"repo_name": "Intel-Corporation/tensorflow",
"id": "cbdabaec942988eaa41f481b3f74a61d77f3ed5c",
"... |
import urllib2
import re
import time
# Default retry timeout (seconds) and sleep-time
VERIFY_TIMEOUT = 300
SLEEP_INTERVAL = 10
class VerifyRetry(object):
def __init__(self, timeout=VERIFY_TIMEOUT, interval=SLEEP_INTERVAL):
"""
Decorator to wrap verify operations to retry until timeout
"""... | {
"content_hash": "ec4c8b545e8ee210bb974605d80c5728",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 74,
"avg_line_length": 29.619718309859156,
"alnum_prop": 0.5915359010936757,
"repo_name": "Triv90/Heat",
"id": "eab1070067f4210cf555361cee55090ac63fe54d",
"size": "2723",
... |
import json
import uuid
import mimetypes
from collections import OrderedDict
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext
from django.conf import settings
from django.core.urlresolvers import reverse... | {
"content_hash": "821530d2e7e7aeda8fe4b8f189458eea",
"timestamp": "",
"source": "github",
"line_count": 707,
"max_line_length": 153,
"avg_line_length": 36.64639321074964,
"alnum_prop": 0.6335636265390405,
"repo_name": "Nnonexistent/chemphys",
"id": "ac4ad393e672054ccd20d8082073795e8e543a1d",
"size"... |
'''
Return salt data via pushover (http://www.pushover.net)
.. versionadded:: 2016.3.0
The following fields can be set in the minion conf file::
pushover.user (required)
pushover.token (required)
pushover.title (optional)
pushover.device (optional)
pushover.priority (optional)
pushover.expire... | {
"content_hash": "d50704fe42e8cacad5b25ee57bd4ccc8",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 107,
"avg_line_length": 31.128,
"alnum_prop": 0.5537136982780776,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "ece9d631590cb478c647ac62561676270c7fe34b",
"... |
from .mutex import Mutex
from .sema import Semaphore
class Cond(object):
""" Cond implements a condition variable, a rendezvous point for coroutines
waiting for or announcing the occurrence of an event.
Each Cond has an associated Locker L (often a Mutex or RWMutex), which
must be held when changing t... | {
"content_hash": "757678108f0ee7736d670153863f398c",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 86,
"avg_line_length": 34.2,
"alnum_prop": 0.5906432748538012,
"repo_name": "benoitc/offset",
"id": "0cf86b2147bf0eb8f23f7f2dd7096169b514cd62",
"size": "3422",
"binary":... |
import unittest
import datetime
from pyetherscan import response, ethereum, error
class BaseEthereumTestCase(unittest.TestCase):
def setUp(self):
pass
class TestAddressObject(BaseEthereumTestCase):
def test_retrieve_balance(self):
_address = '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae'
... | {
"content_hash": "3c015af2c4f3eb72dd1fdc836a3557a3",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 79,
"avg_line_length": 33.2212389380531,
"alnum_prop": 0.6092168353755993,
"repo_name": "Marto32/pyetherscan",
"id": "b67461cec0f5d311177585eaeeb1f0533e055ef8",
"size": "1... |
from __future__ import unicode_literals
from datetime import timedelta
from functools import wraps
import json
import logging
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts import render
from axes import get_version
from axes.conf import settings
from axes.att... | {
"content_hash": "617977cee59c30244faf7c2a3585a430",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 72,
"avg_line_length": 27.525,
"alnum_prop": 0.6639418710263397,
"repo_name": "cloudera/hue",
"id": "7a5085727393d2c06789c3d492ffefc729040163",
"size": "2202",
"binary": ... |
import django_filters
from django.db.models import Q
from django.forms import SelectMultiple
from django_filters import FilterSet, MethodFilter
from pdc.apps.common.filters import MultiValueFilter, value_is_not_empty
from . import models
from .models import (Person,
Maillist,
... | {
"content_hash": "209cb5f50a2e6d5e422b9f1eb4d6666d",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 88,
"avg_line_length": 33.36585365853659,
"alnum_prop": 0.689327485380117,
"repo_name": "tzhaoredhat/automation",
"id": "39688834fb65a9e25183d40b35a84f5684a2775d",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.