text stringlengths 4 1.02M | meta dict |
|---|---|
from setuptools import setup
CPSVERSION = '1.4.1'
long_description = """
Command line client to ConPaaS, an integrated runtime environment for elastic
Cloud applications
"""
setup(name='cps-tools',
version=CPSVERSION,
description='ConPaaS command line client',
author='ConPaaS team',
author_ema... | {
"content_hash": "31383aea35eaf2383ecb078a4e77021a",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 82,
"avg_line_length": 37.16216216216216,
"alnum_prop": 0.5483636363636364,
"repo_name": "ConPaaS-team/conpaas",
"id": "efbd9c94fd13ca9259b46a6a02e432c76f3756c9",
"size": "... |
import setuptools
setuptools.setup(
name="blender_vraag",
version="0.1.0",
url="https://github.com/akloster/blender-vraag.git",
author="Andreas Klostermann",
author_email="andreasklostermann@gmail.com",
description="A higherAPI for Blender Addons",
long_description=open('README.rst').read... | {
"content_hash": "f90720ffaeb5ae1b0a61d7e706731780",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 56,
"avg_line_length": 23.454545454545453,
"alnum_prop": 0.6511627906976745,
"repo_name": "akloster/blender-vraag",
"id": "7477887b29e7a31c1c1d2c1377bb206dc646e454",
"size"... |
import requests
from tc import Test
import re
from bs4 import BeautifulSoup
#see QuickStart https://github.com/kennethreitz/requests/blob/master/docs/user/quickstart.rst
regex = r'charset=([a-zA-Z0-9-]+)?'
pattern = re.compile(regex, re.IGNORECASE)
@Test
def test():
response = requests.get('https://github.com/ti... | {
"content_hash": "92d5562de20da70b035481e5d11cdc3f",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 111,
"avg_line_length": 24.3,
"alnum_prop": 0.6035665294924554,
"repo_name": "Jayin/practice_on_py",
"id": "c6d2e7e758935309a8021a197c0e2082e1941d33",
"size": "1472",
"bi... |
import mock
from oslo_config import cfg
from oslo_log import log as logging
import testtools
from mistral.db.v2 import api as db_api
from mistral.services import workbooks as wb_service
from mistral.tests.unit.engine import base
from mistral.utils import javascript
from mistral.workflow import states
LOG = logging.ge... | {
"content_hash": "76bd39669ae44879c99e9d7efb779f1d",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 74,
"avg_line_length": 28.53846153846154,
"alnum_prop": 0.653831343858298,
"repo_name": "dennybaa/mistral",
"id": "2878429d7c8d3081fb55a30ff4d34a27c009b906",
"size": "3202"... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_3po_protocol.iff"
result.attribute_template_id = 9
result.stfName("droid_name","3po_base")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "18dcc5c844d4104c55f8886a484071b5",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 58,
"avg_line_length": 22.076923076923077,
"alnum_prop": 0.686411149825784,
"repo_name": "obi-two/Rebelion",
"id": "33de249175a6adb5a4b68fbff5d32746c91efdce",
"size": "432"... |
from pylons import config
# directory to save downloaded files to
ARCHIVE_DIR = config.get('ckanext-archiver.archive_dir', '/tmp/archive')
# Max content-length of archived files, larger files will be ignored
MAX_CONTENT_LENGTH = int(config.get('ckanext-archiver.max_content_length',
... | {
"content_hash": "e3e8ba99d62e663b416c9a6b169c1fa5",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 74,
"avg_line_length": 43,
"alnum_prop": 0.6833631484794276,
"repo_name": "DanePubliczneGovPl/ckanext-archiver",
"id": "2e9cf0a61bf951606597f274d78c668d80b76625",
"size": "... |
"""API Module for working with EOS local user resources
The Users resource provides configuration of local user resources for
an EOS node.
Parameters:
username (string): The username parameter maps to the local username
defined in the running-config.
nopassword (boolean): Configures the username to u... | {
"content_hash": "21f128c0adfe4fa81f67e1fe6c07f796",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 78,
"avg_line_length": 33.447272727272725,
"alnum_prop": 0.5975212002609263,
"repo_name": "mith1979/ansible_automation",
"id": "d840b757f3d942db68330847bfe516df2a1fd2ba",
... |
"""Init module for puckfetcher tests."""
| {
"content_hash": "249303860e45f7f5eec177ba7af0cf39",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 40,
"avg_line_length": 41,
"alnum_prop": 0.7073170731707317,
"repo_name": "andrewmichaud/FuckPodcatchers",
"id": "bea3336652aad6b7680ddd9fadfb0ed979e5adc9",
"size": "41",
... |
from __future__ import print_function
import argparse
import difflib
import io
import os
import sys
from test_util import TestFailedError, serializeIncrParseMarkupFile
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='Utility for tes... | {
"content_hash": "7fa2e1dee8061c40bd405d71e9aaf410",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 88,
"avg_line_length": 44.55263157894737,
"alnum_prop": 0.5663024217365623,
"repo_name": "airspeedswift/swift",
"id": "8f69591fb8aaae29dc24dd137fda3e56f255c213",
"size": "... |
from factory import base
from factory import containers
from factory import declarations
from .compat import unittest
class LazyStubTestCase(unittest.TestCase):
def test_basic(self):
stub = containers.LazyStub({'one': 1, 'two': 2})
self.assertEqual({'one': 1, 'two': 2}, stub.__fill__())
def ... | {
"content_hash": "8518cb9ad8e36a844f9f5b07b7346cb8",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 92,
"avg_line_length": 31.880165289256198,
"alnum_prop": 0.5530784186649385,
"repo_name": "muhammad-ammar/factory_boy",
"id": "083b306fbad6071afec69955f355f571e405346b",
"... |
import math
import copy
import numpy as np
from monty.fractions import gcd
from sympy import Symbol, nsolve, Integer, Float, Matrix, exp, solve, Eq
from monty.dev import deprecated
"""
Evaluate the defect concentration based on composition, temperature,
and defect energies using "Dilute Solution Model"
Reference: Ph... | {
"content_hash": "abb0d28d7c167bb8fa95f3fbed7dfe82",
"timestamp": "",
"source": "github",
"line_count": 1366,
"max_line_length": 120,
"avg_line_length": 39.25402635431918,
"alnum_prop": 0.5300535238059716,
"repo_name": "montoyjh/pymatgen",
"id": "91182dbecd38f0e807c1cd4fb962ccabdade6c52",
"size": "... |
from . import AWSHelperFn, AWSObject, AWSProperty, Ref
from .validators import integer
try:
from awacs.aws import Policy
policytypes = (dict, Policy)
except ImportError:
policytypes = dict,
Active = "Active"
Inactive = "Inactive"
class AccessKey(AWSObject):
resource_type = "AWS::IAM::AccessKey"
... | {
"content_hash": "87eb8e415221358514713ec412859cce",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 65,
"avg_line_length": 21.575757575757574,
"alnum_prop": 0.5880149812734082,
"repo_name": "DualSpark/troposphere",
"id": "8a4b2f360519d6b100cae5bdc3953d78469b9ce5",
"size":... |
import os, sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "backend.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "692cbc4a1efa25b8f3fa0dc31ea710ea",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 71,
"avg_line_length": 36.666666666666664,
"alnum_prop": 0.7090909090909091,
"repo_name": "MadeInHaus/django-template",
"id": "f88ca9abf3114a7bf8bade56c7c5d7f176f19f0e",
"si... |
from __future__ import print_function
from setuptools import setup
from setuptools.command.test import test as TestCommand
import os
import sys
import uberdict
here_dir = os.path.abspath(os.path.dirname(__file__))
tests_require = ['pytest', 'pytest-pep8']
if sys.version_info[0] == 2:
tests_require.append('mock... | {
"content_hash": "6404fd53b0a4504ff0074f86b5c286ff",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 71,
"avg_line_length": 28.729411764705883,
"alnum_prop": 0.6011466011466011,
"repo_name": "eukaryote/uberdict",
"id": "e003f5546b1083bf81fb82d9c98062347eeabba6",
"size": "2... |
import inspect
import re
from oslo_config import cfg
from oslo_log import log as logging
import six
from stevedore import dispatch
from murano.common.i18n import _LE, _LI, _LW
from murano.dsl import murano_package
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
# regexp validator to ensure that the entry-point n... | {
"content_hash": "15967503d2d84bb3b43e85c04b010927",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 79,
"avg_line_length": 39.4765625,
"alnum_prop": 0.5974668513754205,
"repo_name": "DavidPurcell/murano_temp",
"id": "d4e88e6538ff1dd4b2608e74f4e350eb081ce575",
"size": "56... |
import os
import sys
import logging
from ofp_checker import ofp_checker_start, ofp_checker_stop
from ofp_checker import ofp_checker_get_dp, ofp_checker_get_dps
from ofp_checker import ofp_checker_send_msg, ofp_checker_recv_msg
from ofp_checker import OFPChecker
from datastore_checker import datastore_checker_start, da... | {
"content_hash": "b869f4f34a5abe4006aaa9caba5237bd",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 77,
"avg_line_length": 30.46153846153846,
"alnum_prop": 0.6117998163452709,
"repo_name": "lagopus/lagopus",
"id": "41bad1fd96eca30cdd00884e85bd3af429b74267",
"size": "4356... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "arzeit.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "b20e938daaa8d5b3c78559502ab3df1f",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 70,
"avg_line_length": 25.22222222222222,
"alnum_prop": 0.7092511013215859,
"repo_name": "peap/arzeit",
"id": "2a5c6487082b0764367f58e7375bff203b975924",
"size": "249",
"b... |
import web
import string
import re
import karesansui
from karesansui.lib.rest import Rest, auth
from karesansui.db.model._2pysilhouette import Job, JobGroup, JOBGROUP_TYPE
from karesansui.db.access.machine import findbyhost1
from karesansui.db.access._2pysilhouette import jg_findby1, jg_save, corp
from karesansui.db.... | {
"content_hash": "53a250a39d1a06aef4f123c89570725f",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 139,
"avg_line_length": 41.76802507836991,
"alnum_prop": 0.49819873911738216,
"repo_name": "karesansui/karesansui",
"id": "b0b2259c00338cfdd0599f8611052e59afab3586",
"size... |
"""
Support for Unifi WAP controllers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.unifi/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.device_tracker imp... | {
"content_hash": "9471ee567d6a40f34f0b3642d008ab07",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 74,
"avg_line_length": 32.94,
"alnum_prop": 0.6554341226472374,
"repo_name": "MungoRae/home-assistant",
"id": "a471ca5c96a10d9683319efebbd799d5aa5d1494",
"size": "3294",
... |
import re
from django.test.client import RequestFactory
from django.template import RequestContext
from haystack import indexes
from cms import models as cmsmodels
rf = RequestFactory()
HTML_TAG_RE = re.compile(r'<[^>]+>')
def cleanup_content(s):
"""
Removes HTML tags from data and replaces them with sp... | {
"content_hash": "0f740cf386be6a91e9559b6336b8163a",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 76,
"avg_line_length": 30.76923076923077,
"alnum_prop": 0.6055,
"repo_name": "EuroPython/djep",
"id": "44456141a6f36bb37dd9caccc1d8a4bb20574549",
"size": "2000",
"binary"... |
from pythonforandroid.recipe import Recipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join, realpath
from multiprocessing import cpu_count
import sh
TARGETS = {
'armeabi-v7a': 'armv7-android-gcc',
'arm64-v8a': 'arm64-android-gcc',
}
class VPXRecipe(Recipe):
ver... | {
"content_hash": "059f42f1274f21b98f1f252c01d536b2",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 75,
"avg_line_length": 29.70149253731343,
"alnum_prop": 0.4979899497487437,
"repo_name": "PKRoma/python-for-android",
"id": "9c2957a2da8b51450d661d26b8bbfb94bbf44463",
"siz... |
import hashlib
class ScarecrowIdent(str): pass
def ident(name):
if isinstance(name, ScarecrowIdent):
return name
else:
return ScarecrowIdent(hashlib.md5(name).digest()) | {
"content_hash": "8b03d6c3ea5ddcbd6cd9e806a0012258",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 57,
"avg_line_length": 21.555555555555557,
"alnum_prop": 0.6958762886597938,
"repo_name": "ysimonson/scarecrow",
"id": "dc18304245a7783c786a427be73f49afd24ace3a",
"size": "1... |
from __future__ import unicode_literals
from os.path import dirname, join
from django.db import migrations
from postcode_api.importers.countries_importer import CountriesImporter
def create_countries(apps, schema_editor):
data_file = join( dirname(__file__), '../data/countries.csv' )
CountriesImporter().im... | {
"content_hash": "bd444d140a0246bfe7fd7a26f9e3444a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 71,
"avg_line_length": 24.043478260869566,
"alnum_prop": 0.7070524412296564,
"repo_name": "ministryofjustice/postcodeinfo",
"id": "3ceff474db1755c848ff1343f8c7ec4e0a4c05b3",
... |
import time
import os
import sys
import logging
import threading
import http.server
import random
import subprocess
import settings
import patch
import schedule
from os.path import dirname, abspath, join
import cron
import github_api as gh
import github_api.prs
import github_api.voting
import github_api.repos
import ... | {
"content_hash": "b8c52a09e8e9964786caee1cbdbbb7a2",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 71,
"avg_line_length": 22.344827586206897,
"alnum_prop": 0.6952160493827161,
"repo_name": "tuborgclassic/carlsberg",
"id": "503ffc94d601ba4f2dcdae47e137f84401bef570",
"size... |
import mock
import unittest
class BaseTestCase(unittest.TestCase):
_patchers = {}
def mock_base(self):
if 'Base' not in self._patchers:
self._patchers['Base'] = 'otopi.base.Base'
def mock_plugin(self):
import otopi.plugin # imported here to make mock happy
assert ot... | {
"content_hash": "0a00c5980e4b8e2019ff0da94aad2818",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 69,
"avg_line_length": 31.82857142857143,
"alnum_prop": 0.6131059245960503,
"repo_name": "oVirt/ovirt-setup-lib",
"id": "35c1debbd82d5c535de6fa722acdc11bc73b0a11",
"size": ... |
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.develop import develop
import fnmatch
import os
import platform
from uuid import getnode
from noworkflow import __version__
def recursive_path(pac... | {
"content_hash": "71a8a97a4b83f303968a188970c8e946",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 76,
"avg_line_length": 30.57983193277311,
"alnum_prop": 0.597966474306128,
"repo_name": "paopao74cn/noworkflow",
"id": "367f84ab01a28b04d768165b2ba3d206d51b837c",
"size": ... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class GetObjectMetadata(Choreography):
def __init__(self, temboo_session):
"""
Crea... | {
"content_hash": "e564f6a37dd1dd43cc49ec15a722b5b7",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 254,
"avg_line_length": 49.30769230769231,
"alnum_prop": 0.7047024738132383,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "4b09fe2f88e66a977cc3cad2bceffdf2cc942097",
"siz... |
'''
Created on 2016年4月8日
@author: yun.bo
'''
from concurrent.futures.thread import ThreadPoolExecutor
from distutils import dir_util
from functools import cmp_to_key
import multiprocessing
import queue
import hashlib
import sys
import traceback
import os
import re
import shutil
import time
fro... | {
"content_hash": "52173501835014541f86bf5f0a0fa03b",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 134,
"avg_line_length": 31.695652173913043,
"alnum_prop": 0.5855379188712522,
"repo_name": "lyzardiar/RETools",
"id": "2281640f185a95ff322508bc133c856c41c32eb3",
"size": "... |
import yaml
import os
import logging
from events import Events
log = logging.getLogger(__name__)
CONFIG_FILE = os.path.expanduser("~/.bakthat.yml")
PLUGINS_DIR = os.path.expanduser("~/.bakthat_plugins")
DATABASE = os.path.expanduser("~/.bakthat.sqlite")
DEFAULT_LOCATION = "us-east-1"
DEFAULT_DESTINATION = "s3"
EXC... | {
"content_hash": "e3ee55fff159f54faf13bc13fdde0d6a",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 69,
"avg_line_length": 24.774193548387096,
"alnum_prop": 0.6705729166666666,
"repo_name": "tsileo/bakthat",
"id": "081b69b7fab74463d8ebe916543142f48828484a",
"size": "794",... |
from distutils.core import setup
setup(
name = 'email_phone_block',
packages = ['email_phone_block'],
version = '0.5',
description = 'Substitute emails and phone numbers with dummy in your text.',
long_description=open('README.md').read(),
author = 'Mauro De Giorgi',
author_email = 'mauro.degiorgi@gmail.c... | {
"content_hash": "e27df4659044f96fb5f9abad3eeb34e8",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 39.07142857142857,
"alnum_prop": 0.6819012797074955,
"repo_name": "mdgart/email_phone_block",
"id": "0278164ecce9be0604f55040ecd536c02f9534ee",
"size... |
from runner.koan import *
class AboutControlStatements(Koan):
def test_if_then_else_statements(self):
if True:
result = 'true value'
else:
result = 'false value'
self.assertEqual('true value', result)
def test_if_then_statements(self):
result = 'default... | {
"content_hash": "ba7052046d09e426a76a2aa53ad71c6a",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 84,
"avg_line_length": 29.11764705882353,
"alnum_prop": 0.5222222222222223,
"repo_name": "dewaka/python-koans",
"id": "b9a70092d0798dfe6a4255bbc55ba1f6a70afdee",
"size": "2... |
"""Module to store resource items in Redis."""
import json
import redis
from .resource import Conflict, NotFound, Resource
class RedisResource(Resource):
def __init__(self, connection_pool, schema=None, id_schema=None, ttl=None, name=None, description=None):
"""
Initialize Redis resource.
... | {
"content_hash": "3b1842e326095db9cc619a3b2e654d45",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 108,
"avg_line_length": 38.69491525423729,
"alnum_prop": 0.6224266316250547,
"repo_name": "pbryan/roax",
"id": "03b441e58d9dbe48a59fb066c3b0979419629f2d",
"size": "2283",
... |
import pytest
from mock import patch
from polyaxon.cli.components import components
from tests.test_cli.utils import BaseCommandTestCase
@pytest.mark.cli_mark
class TestCliComponent(BaseCommandTestCase):
@patch("polyaxon_sdk.ProjectsV1Api.create_version")
@patch("polyaxon_sdk.ProjectsV1Api.get_version")
... | {
"content_hash": "2d1146fdfd3dddc36ce444555a50a82a",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 78,
"avg_line_length": 38.95454545454545,
"alnum_prop": 0.6662777129521587,
"repo_name": "polyaxon/polyaxon",
"id": "2b813e40770fd9ccea45f904777e735810d200b8",
"size": "231... |
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
Returns :class:`Response <Resp... | {
"content_hash": "84e5a93bb31ffbbbcd270234e7ae4f93",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 144,
"avg_line_length": 38.054263565891475,
"alnum_prop": 0.6701975962517824,
"repo_name": "la0rg/Genum",
"id": "b081d0a501a9f6dcdf3ebc2c1d14e8be74747715",
"size": "4934",... |
"""Generate documentation of structure of system"""
__revision__ = "$Id: __init__.py,v 1.4 2009-10-27 20:06:27 rliebscher Exp $"
| {
"content_hash": "df3e7ad8f63f53f24df21b181d33501d",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 76,
"avg_line_length": 43.333333333333336,
"alnum_prop": 0.6615384615384615,
"repo_name": "avatar29A/pyfuzzy",
"id": "9c23b01ab5f2463d8f9b298955e3be2644aa4726",
"size": "854... |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
"""Make sure json library being used does not lose precision converting PLC values"""
n = Decimal("20000... | {
"content_hash": "5d91d2aa13cb4ac883f7b5d643424571",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 111,
"avg_line_length": 38.392857142857146,
"alnum_prop": 0.6155038759689923,
"repo_name": "pdrobek/Polcoin-1-3",
"id": "f53f3ead92b271d37601ffff4a79e9a214e5c0f1",
"size":... |
'''
Converts a color to a black/white image.
-----------------------------------------------------------
(c) 2013 Allegra Via and Kristian Rother
Licensed under the conditions of the Python License
This code appears in section 18.4.3 of the book
"Managing Biological Data with Python".
-------------------... | {
"content_hash": "c839e4ccac4886d63f2e9c325f0841ed",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 59,
"avg_line_length": 28.42105263157895,
"alnum_prop": 0.5425925925925926,
"repo_name": "raymonwu/Managing_Your_Biological_Data_with_Python_3",
"id": "c074bbe2b2b3eead6c92e0... |
import os
import netaddr
import lglass.dns
import lglass.nic
def _format_as_block_key(obj):
return "AS{}-AS{}".format(obj.start, obj.end)
def fix_object(obj):
if obj.object_class in {"route", "route6"}:
for origin in obj.get("origin"):
nobj = lglass.nic.RouteObject(obj)
nob... | {
"content_hash": "eb5a91b9e3584ee47eb0db598a2a5cef",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 76,
"avg_line_length": 36.68888888888889,
"alnum_prop": 0.5369473046638401,
"repo_name": "fritz0705/lglass",
"id": "38a6391bcd01222480c4b0188a3a225adf6268db",
"size": "660... |
from bcc import BPF, USDT
import argparse
import re
import os
import subprocess
examples = """examples:
bpflist # display all processes currently using BPF
bpflist -v # also count kprobes/uprobes
bpflist -vv # display kprobes/uprobes and count them
"""
parser = argparse.ArgumentParser(
description... | {
"content_hash": "030c010aba1dfbe60cf1259b2fceccc3",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 76,
"avg_line_length": 30.945205479452056,
"alnum_prop": 0.5958388667552014,
"repo_name": "tuxology/bcc",
"id": "2d9793e6d209104c7da1caacec1b139a33f00d3c",
"size": "2599",
... |
import inspect
import logging
from typing import Dict, List, Optional, Type, Union
from pytorch_lightning import Callback, Trainer, LightningModule
from ray import tune
from ray.util import PublicAPI
import os
logger = logging.getLogger(__name__)
# Get all Pytorch Lightning Callback hooks based on whatever PTL vers... | {
"content_hash": "47ff066ae024f9f2d757718ecfda2c07",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 88,
"avg_line_length": 35.67672413793103,
"alnum_prop": 0.6237767306995288,
"repo_name": "ray-project/ray",
"id": "7757bd0c6617ba6e04fad96bafcd8bc767248612",
"size": "8277... |
import sqlalchemy as tsa
from sqlalchemy import create_engine
from sqlalchemy import create_mock_engine
from sqlalchemy import event
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy import text
from sqlalchemy.schema import AddCo... | {
"content_hash": "fe561f37923d5565e39bb4b5777a32b5",
"timestamp": "",
"source": "github",
"line_count": 628,
"max_line_length": 79,
"avg_line_length": 32.46656050955414,
"alnum_prop": 0.5053705429398205,
"repo_name": "graingert/sqlalchemy",
"id": "8f5834cc90f8f47bb9aa8a1a34d05d59ef288c12",
"size": ... |
import m3.toolbox as m3t
import m3.actuator_ec as m3aec
import m3.actuator as m3a
import m3.ctrl_simple as m3cs
import m3.pwr as m3power
import argparse
class M3Tuning:
def __init__(self):
self.comps = {'act': {'name': 'm3actuator_', 'type':m3a.M3Actuator, 'child_name':'act_ec_component' },
'act_ec': {'name'... | {
"content_hash": "7239575e1d0f04e375603f4c9fcd29b7",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 110,
"avg_line_length": 41.10476190476191,
"alnum_prop": 0.6786376274328082,
"repo_name": "ahoarau/m3meka",
"id": "74838c524214d481b51552b4f33dcebad6786309",
"size": "4336... |
"""Utility functions for classifying and solving
ordinary and partial differential equations.
Contains
========
_preprocess
ode_order
_desolve
"""
from __future__ import print_function, division
from sympy.core.function import Function, Derivative, AppliedUndef
from sympy.core.relational import Equality, Eq
from sym... | {
"content_hash": "cc96706f7e7f50c1b579d59b2e5d85fe",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 90,
"avg_line_length": 37.43333333333333,
"alnum_prop": 0.6020579796180865,
"repo_name": "hrashk/sympy",
"id": "5d0b4650396b2f96fd5c7360462f99b27d865ae9",
"size": "10107",... |
class PriorityQueue(object):
'''Create queue using nodes'''
def __init__(self, user_input=None):
self.queue = []
if user_input is not None:
try:
[self.insert(tup) for tup in user_input]
except TypeError:
print('Argument is not iterable.')
... | {
"content_hash": "83474b884f973c0df1f557266b9b1ca3",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 97,
"avg_line_length": 32.716981132075475,
"alnum_prop": 0.4925028835063437,
"repo_name": "paulsheridan/data-structures",
"id": "ad2f669d420819df594feea0d1a8d6cdc293cb44",
... |
from rucio.client import Client as RucioClient
from rucio.common.exception import DataIdentifierNotFound, DuplicateRule, DataIdentifierAlreadyExists, \
FileAlreadyExists
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermove... | {
"content_hash": "6499c018b9ab8f689584e448a8f72324",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 149,
"avg_line_length": 52.45059288537549,
"alnum_prop": 0.5011303692539563,
"repo_name": "PanDAWMS/panda-harvester",
"id": "17342789118143367a6ce31df10772ff2cd6de5f",
"si... |
"""
Django settings for test_project project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import ... | {
"content_hash": "d485bd00e4e18bea12d31e8b05eef6e7",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 90,
"avg_line_length": 29.22222222222222,
"alnum_prop": 0.6667412212033103,
"repo_name": "3YOURMIND/django-migration-linter",
"id": "53d9c8bbcd1f53b19ffba731e0b3d41e0337831c... |
from unittest import TestCase
from app import matematica
class TestSumar(TestCase):
def test_sumar(self):
resultado = matematica.sumar(1, 2)
self.assertEqual(resultado, 3)
| {
"content_hash": "c116b4bddd47eb3dd0c94cbc4839055b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 42,
"avg_line_length": 27.571428571428573,
"alnum_prop": 0.7150259067357513,
"repo_name": "FreddyGJ/Portafolio-de-prog-3",
"id": "9308dcfab4ccc21e9e8e6c6a001c4098143ee320",
... |
from __future__ import print_function
# the following is a hack to get the baseclient to import whether we're in a
# package or not. This makes pep8 unhappy hence the annotations.
try:
# baseclient and this client are in a package
from .baseclient import BaseClient as _BaseClient # @UnusedImport
except ImportE... | {
"content_hash": "93721727da0570e094a1bab8f5665dd1",
"timestamp": "",
"source": "github",
"line_count": 2520,
"max_line_length": 90,
"avg_line_length": 70.39682539682539,
"alnum_prop": 0.6541319052987599,
"repo_name": "kbase/narrative_method_store",
"id": "c98684a3e8fafea10c8bb88ebfda4affadbc7072",
... |
from __future__ import absolute_import
from lxml import etree
from pythonic_testcase import PythonicTestCase, assert_contains
from soapfish.soap12 import Code, get_error_response
class SOAP12Test(PythonicTestCase):
def test_get_error_response(self):
response = get_error_response(Code.SERVER, u'some erro... | {
"content_hash": "e4f7e56b8381ae30e8dc61a7f17dd8fa",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 89,
"avg_line_length": 37.77777777777778,
"alnum_prop": 0.7058823529411765,
"repo_name": "iurisilvio/soapfish",
"id": "aa557792dd53140fad9227246aed12be05225438",
"size": "6... |
'''
@author: jnaous
'''
from django.views.generic import date_based, create_update
from models import DatedMessage
from django.http import HttpResponseRedirect, HttpResponseNotAllowed
from django.core.urlresolvers import reverse
from forms import MessageForm, MessageFormNoIM
from django.forms.models import ModelFormMe... | {
"content_hash": "2e73d13300617ee53edb7cfbef9e5a83",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 171,
"avg_line_length": 40.189655172413794,
"alnum_prop": 0.6392106392106393,
"repo_name": "avlach/univbris-ocf",
"id": "a1b68c7ae18141d3a7737bc7c5d451c3c2cb6e33",
"size":... |
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from {{ cookiecutter.project_slug }}.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):
form ... | {
"content_hash": "b8cb7b9ff8ba921ecdcfc843e268bfc6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 88,
"avg_line_length": 29.42105263157895,
"alnum_prop": 0.7048300536672629,
"repo_name": "luzfcb/cookiecutter-django",
"id": "a68a94a9545a925e53431d14360ce6d77e238bc9",
"si... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_rebel_lieutenant_colonel_human_male_02.iff"
result.attribute_template_id = 9
result.stfName("npc_name","human_base_male")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return ... | {
"content_hash": "2686939768ff4934d2441b890ba4355e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 92,
"avg_line_length": 25.076923076923077,
"alnum_prop": 0.7055214723926381,
"repo_name": "obi-two/Rebelion",
"id": "958a712031414370df0716cadf9441744c480a4e",
"size": "471... |
import mc
def run(mc):
print('run')
# write 2kb entry
v = 2046*'a'
if not mc.set('test_key', v):
raise RuntimeError("failed to set value")
if v != mc.get('test_key'):
raise RuntimeError("returned value differs")
if __name__ == '__main__':
mc.run_tcp(run)
| {
"content_hash": "bbf722da15b954ec04ee5960faf62764",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 52,
"avg_line_length": 18.75,
"alnum_prop": 0.5566666666666666,
"repo_name": "radoondas/apachebeat",
"id": "8ca849ffcdfe70b5d1c058f1c0c93022b4877411",
"size": "323",
"bin... |
import datetime
import mock
from django.contrib.auth.models import Permission
from django.core.exceptions import ValidationError
from django.test import TestCase
from timepiece.contracts.models import ProjectContract, ContractHour
from timepiece.tests.base import ViewTestMixin
from timepiece.tests import factories
... | {
"content_hash": "84785207a5ae3fe839162dd77ccd14ae",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 91,
"avg_line_length": 41.12992125984252,
"alnum_prop": 0.664784148559395,
"repo_name": "BocuStudio/django-timepiece",
"id": "69c954a7db927dc1da07ed54017509ff4398ef4d",
"s... |
import os
# General configuration
# ---------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx"]
# autoclass options
#autoclass_content = "both"
# ... | {
"content_hash": "9077f256c827aa678c55a96d027d8be1",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 98,
"avg_line_length": 28.285714285714285,
"alnum_prop": 0.7027972027972028,
"repo_name": "javioreto/google_cloud_iot",
"id": "a933a8ebde192bc535d2da8a41b8345a7176df5f",
"s... |
"""Cement core backend module."""
VERSION = (2, 8, 2, 'final', 0) # pragma: nocover
# global hooks/handlers (DEPRECATED)
__handlers__ = {} # pragma: nocover
__hooks__ = {} # pragma: nocover
| {
"content_hash": "88b28c060eb67557b405b12bfa2fd097",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 50,
"avg_line_length": 27.857142857142858,
"alnum_prop": 0.6153846153846154,
"repo_name": "AccelAI/accel.ai",
"id": "3f2b053c45bf984538517c244d23a65ffebe1c7f",
"size": "195"... |
"""
try:
print(5/0)
except ZeroDivisionError:
print("You can't divide by zero!")
"""
print("Give me two numbers, and I'll divide them.")
print("Enter 'q' to quit.")
while True:
first_number = input("\nFirst number: ")
if first_number == 'q':
break
second_number = input("\nSecond number: ")... | {
"content_hash": "9b753021fbb8faa04213ed2641be3d24",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 55,
"avg_line_length": 23.238095238095237,
"alnum_prop": 0.6024590163934426,
"repo_name": "mccarrion/python-practice",
"id": "867b4fd57bdd3bd9ff9d916ec64d9505bd61174a",
"si... |
class OneTwoThree:
def __iter__(self):
value = 0
class OneTwoThreeIterator:
def __next__(self):
nonlocal value
value += 1
if value > 3:
raise StopIteration()
return value
return OneTwoThreeIterato... | {
"content_hash": "322e6ac0efade689f7c56b30c6d0c7b9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 41,
"avg_line_length": 25.857142857142858,
"alnum_prop": 0.47513812154696133,
"repo_name": "rtoal/ple",
"id": "75597ecf7fe2e86e3e9b1c57ca08c0b91640bd9a",
"size": "362",
"... |
import unittest
from webkitpy.common.host_mock import MockHost
from webkitpy.layout_tests.controllers import test_result_writer
from webkitpy.layout_tests.models import test_failures
from webkitpy.layout_tests.port.driver import DriverOutput
from webkitpy.layout_tests.port.test import TestPort
class TestResultWriter... | {
"content_hash": "0998908c16d588cdea569f96b8e9aab4",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 120,
"avg_line_length": 44.970588235294116,
"alnum_prop": 0.6886854153041203,
"repo_name": "leighpauls/k2cro4",
"id": "dfd604187a715d0a724afdcaa237081595fd4089",
"size": "2... |
import django_tables2 as tables
from django.template import Context
from django.utils.translation import ugettext_lazy as _
from django.contrib.gis.geos import GEOSGeometry
from django.utils import simplejson
import models
class JellyfishObservationTable(tables.Table):
# LinkColum does not work with localeurl
... | {
"content_hash": "f705d682e685ebf53ba0a3211d934003",
"timestamp": "",
"source": "github",
"line_count": 370,
"max_line_length": 179,
"avg_line_length": 33.68648648648649,
"alnum_prop": 0.5539152759948652,
"repo_name": "socib/grumers",
"id": "bb3546ef30f0a3e802f8f3d74765acbbd12ad8c3",
"size": "12464... |
from __future__ import unicode_literals
from flask import session
from indico.core import signals
from indico.modules.groups.core import GroupProxy
from indico.util.i18n import _
from indico.web.flask.util import url_for
from indico.web.menu import SideMenuItem
__all__ = ('GroupProxy',)
@signals.menu.items.connec... | {
"content_hash": "35ccaa310908825edc232e8a86b6a45b",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 103,
"avg_line_length": 28.125,
"alnum_prop": 0.7392592592592593,
"repo_name": "mvidalgarcia/indico",
"id": "33499c809e3f2b8344da58f939b89c2bb6076489",
"size": "889",
"bi... |
"""Support for Atlantic Pass APC Zone Control."""
from typing import cast
from pyoverkiz.enums import OverkizCommand, OverkizCommandParam, OverkizState
from homeassistant.components.climate import ClimateEntity, HVACMode
from homeassistant.const import TEMP_CELSIUS
from ..entity import OverkizEntity
OVERKIZ_TO_HVAC... | {
"content_hash": "05f43d45e7d429b2aafa1cf3bfc2cbcd",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 88,
"avg_line_length": 33.725,
"alnum_prop": 0.6975537435137139,
"repo_name": "w1ll1am23/home-assistant",
"id": "ba95785fbc7e73a9dc38ef8cce60d6c615dcae42",
"size": "1349",
... |
import os
import subprocess
from contextlib import contextmanager
import psycopg2
from psycopg2.extensions import (ISOLATION_LEVEL_AUTOCOMMIT,
ISOLATION_LEVEL_READ_COMMITTED)
_interrupt = (KeyboardInterrupt, SystemExit)
class Database(object):
def __init__(self, database, user,... | {
"content_hash": "1d5adf547e0e0708094a8f5e408de23e",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 68,
"avg_line_length": 30.708333333333332,
"alnum_prop": 0.5491858887381276,
"repo_name": "tsuru/postgres-api",
"id": "40e8a58b895d322cd0a748b6e1714f58d9a2936c",
"size": "2... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='BlogPost',
fields=[
('id', models.AutoField(verbose_name='ID', serializ... | {
"content_hash": "cdbfa6ff6a212897fff0740f37973f97",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 114,
"avg_line_length": 26.761904761904763,
"alnum_prop": 0.5533807829181495,
"repo_name": "jiasir/techblog",
"id": "82e38a65686c338e1130e3392409b7bd84e93d29",
"size": "586... |
def main(argv = None):
import test, glob
import os.path as op
def jglob(*s):
return glob.glob(op.join(*s))
prefix = op.dirname(__file__)
return test.app(
doctests=['interval', 'test.helpers'],
docfiles=jglob(prefix, '*', '*.rst')).main(argv)
if __name__ == '__main__':
i... | {
"content_hash": "243acc259fef257fbd0b0c50a02ea923",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 56,
"avg_line_length": 24,
"alnum_prop": 0.5583333333333333,
"repo_name": "abarnert/pyinterval",
"id": "9052a0b041618d694ead29c67f87a43f52e61ec4",
"size": "495",
"binary"... |
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import (
InvalidSignature, UnsupportedAlgorithm, _Reasons
)
from cryptography.hazmat.backends.openssl.utils import (
_calculate_digest_and_algorithm
)
from cryptography.hazmat.primitives... | {
"content_hash": "fba622fffed20b9b36199d7586e7acf6",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 78,
"avg_line_length": 34.51418439716312,
"alnum_prop": 0.6297133463474777,
"repo_name": "FrancescoRizzi/AWSomesauce",
"id": "cecd25e11fd62ed44a45931e06cb8d1509b86310",
"s... |
import logging
import posixpath
import traceback
from branch_utility import BranchUtility
from environment import IsPreviewServer
from file_system import FileNotFoundError
from redirector import Redirector
from servlet import Servlet, Response
from special_paths import SITE_VERIFICATION_FILE
from third_party.handlebar... | {
"content_hash": "ef71d5fcaa12288b06390b7067984636",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 79,
"avg_line_length": 39,
"alnum_prop": 0.6789824348879467,
"repo_name": "patrickm/chromium.src",
"id": "c714b5de031f8ca7e8b0cac2a10e01e2266ae6f1",
"size": "5116",
"bin... |
def init_ephem(orbits, load_path=None, show=False,
parallax_correction=False):
'''Initialize Skyfield ephemeris for Jupiter BSP file
Takes output of io.parse_occ as input.
Requires Astropy and SkyField
Optional:
load_path (where the bsp and SkyField data files are found.
... | {
"content_hash": "38d01074175e1046eee076a146415e89",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 96,
"avg_line_length": 28.713375796178344,
"alnum_prop": 0.5876220053238687,
"repo_name": "bwgref/nustar_moving_target",
"id": "efa38e065210daf2c4e8ad6a0ea32bc5153873ad",
... |
from __future__ import absolute_import, unicode_literals
import re
from django import template
from django.utils.functional import cached_property
from wagtail.wagtailimages.models import Filter
from wagtail.wagtailimages.shortcuts import get_rendition_or_not_found
register = template.Library()
allowed_filter_patte... | {
"content_hash": "3563c5557589e5e847a7785f30881ee6",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 117,
"avg_line_length": 34.06,
"alnum_prop": 0.5857310628302995,
"repo_name": "hamsterbacke23/wagtail",
"id": "b86247876fd64d3c716d21ccc6cf64a331e4762b",
"size": "3406",
... |
from .sub_resource import SubResource
class RouteFilterRule(SubResource):
"""Route Filter Rule Resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:param access: The access type of the rule. Valid values are:... | {
"content_hash": "327f6cd33970dc4359a4c219d102e671",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 91,
"avg_line_length": 39.65151515151515,
"alnum_prop": 0.6182651891478792,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "a8253fc60c475df1df945d25befd40b057f7d7a5",
... |
from __future__ import absolute_import
import mock
import unittest
from exam import fixture
from django.http import HttpRequest
from sentry import options
from sentry.models import Project
from sentry.testutils import TestCase
from sentry.utils.http import (
is_same_domain,
is_valid_origin,
get_origins,
... | {
"content_hash": "0247d0311e733ccb0958a3a23923d54b",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 98,
"avg_line_length": 39.082687338501295,
"alnum_prop": 0.6325289256198348,
"repo_name": "mvaled/sentry",
"id": "11cda37016c6fb82ff8acbaf26d6dfc729b2db5a",
"size": "15150... |
from django.test import TestCase
from django.urls import reverse
class SearchProjectViewTest(TestCase):
def setUp(self):
self.url = reverse('search:index')
def test_template_used(self):
response = self.client.get(self.url)
self.assertEqual(response.status_code, 200)
self.asse... | {
"content_hash": "d44ea1b0ab5318edab5341ad577cbece",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 61,
"avg_line_length": 29,
"alnum_prop": 0.665948275862069,
"repo_name": "srtab/alexandria-docs",
"id": "fea6e2d8cb83d8a1eda2cfe916c82ba6744c6a20",
"size": "952",
"binary... |
"""Example of how to create a Peripheral device/GATT Server"""
# Standard modules
import logging
import random
# Bluezero modules
from bluezero import async_tools
from bluezero import adapter
from bluezero import peripheral
# constants
# Custom service uuid
CPU_TMP_SRVC = '12341000-1234-1234-1234-123456789abc'
# http... | {
"content_hash": "d62b5731cd9d570f1f5ced166c1251fc",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 79,
"avg_line_length": 37.44444444444444,
"alnum_prop": 0.6379821958456974,
"repo_name": "ukBaz/python-bluezero",
"id": "0d98b8fa7b3aa53d148c0c084a95d15d6ab5e265",
"size": ... |
import unittest
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from src.laserstructure import *
class TestLaserstructureOutput(unittest.TestCase):
def setUp(self):
self.laser = Laser((0.85, [0.8, 0.8, 0.8, 0.8, 0.8], [0.8, 0.8, 0.8, 0.8, 0.8]))
... | {
"content_hash": "f8a8daa0cca4321a2710c1496a8f2d99",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 88,
"avg_line_length": 29.964285714285715,
"alnum_prop": 0.567342073897497,
"repo_name": "DQE-Polytech-University/Beamplex",
"id": "9dd7e52db8dadf03d1df64531a61bace72a2023f",... |
import os
import hashlib
import pybossa_gravatar
from mock import patch, MagicMock
from factories import UserFactory
from default import Test, with_context
from helper import web
class TestEventListener(Test):
@with_context
@patch('pybossa_gravatar.event_listeners.gravatar.set', return_value=True)
def te... | {
"content_hash": "14f918be00b954ff4c551742b44eee68",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 79,
"avg_line_length": 38.10679611650485,
"alnum_prop": 0.6405095541401273,
"repo_name": "alexandermendes/pybossa-gravatar",
"id": "8e219b90fea70ae9158b4e7558016b41607900ed"... |
from django.core.urlresolvers import reverse
from django.db.models import *
from django_extensions.db.fields import AutoSlugField
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth import models as auth_models
from django.... | {
"content_hash": "db1b8dc2ec861783dc0a2fa802d67c9c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 75,
"avg_line_length": 31.764705882352942,
"alnum_prop": 0.7351851851851852,
"repo_name": "mainecivichackday/wheresyourtrash",
"id": "93b5e345f0d268e4f701b22c6b7eb3d06dd7023f... |
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": "0ea1b83896a6d0820b63e883cd12fb07",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 79,
"avg_line_length": 39.31487889273357,
"alnum_prop": 0.620049287097342,
"repo_name": "olivierlambert/xscontainer",
"id": "2cb9d8fc5245041f14d89524606bdf752116524c",
"si... |
"""Integration code for Entropic fuzzer."""
import os
from fuzzers import utils
from fuzzers.libfuzzer import fuzzer as libfuzzer_fuzzer
def build():
"""Build benchmark."""
cflags = ['-fsanitize=fuzzer-no-link']
utils.append_flags('CFLAGS', cflags)
utils.append_flags('CXXFLAGS', cflags)
os.envi... | {
"content_hash": "0c01cf5ad00297a2f7f08ebf1e6a2795",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 70,
"avg_line_length": 31.5,
"alnum_prop": 0.49206349206349204,
"repo_name": "google/fuzzbench",
"id": "4caa7ea1e463d882420c58a0cd1b76b70656727f",
"size": "1578",
"binary... |
from uuid import uuid1
from setuptools import setup, find_packages
from pip.req import parse_requirements
# parse_requirements() returns generator of pip.req.InstallRequirement objects
install_reqs = parse_requirements("requirements.txt", session=uuid1())
requirements = [str(ir.req) for ir in install_reqs]
setup(
... | {
"content_hash": "2ff85b01eecae3ab824852ab9dfd82fe",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 78,
"avg_line_length": 33.588235294117645,
"alnum_prop": 0.7267950963222417,
"repo_name": "nwlunatic/vmmaster-client",
"id": "2bf98a17e3687571ac7e6d7e67e4ab5add75a8ed",
"si... |
from sqlalchemy.orm import scoped_session, sessionmaker
import sqlalchemy as sa
import sqlalchemy.ext.declarative
Base = sqlalchemy.ext.declarative.declarative_base()
session = scoped_session(sessionmaker())
class ChargeObservation(Base):
__tablename__ = 'charge_observation'
id = sa.Column(sa.Integer(), pri... | {
"content_hash": "543f1d4647cefaf073771ce7bb14d460",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 55,
"avg_line_length": 28.615384615384617,
"alnum_prop": 0.7553763440860215,
"repo_name": "jhanley634/testing-tools",
"id": "0a14debf3a3e2b18ab7667d2a3563d6822dd2460",
"siz... |
import sys
import json
import xml.dom.minidom as xml
def _json(infile, outfile):
try:
obj = json.load(infile)
except ValueError as e:
raise SystemExit(e)
json.dump(obj, outfile, sort_keys=True, indent=4, separators=(',', ': '))
def _xml(infile, outfile):
try:
obj = xml.parse(... | {
"content_hash": "c3b7eb69309f27f9b2a9e141b2dde215",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 77,
"avg_line_length": 22.6,
"alnum_prop": 0.5979772439949431,
"repo_name": "juliosueiras/atlas-vim",
"id": "93300818cf5535bd927b2705e412cc33fe04a510",
"size": "791",
"bi... |
"""Pseudoterminal transport class.
Some processes like the simulator shell script can fork/exec other
processes and need job control. A common way of overcoming this problem is
for the shell script to become a process leader. This is usually achieved by
using pseudoterminals.
More details: https://goo.gl/ckgF91
Pseu... | {
"content_hash": "638b86dcfe2a8c311fb663aeef976061",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 88,
"avg_line_length": 32.570247933884296,
"alnum_prop": 0.6604922608475007,
"repo_name": "google/gazoo-device",
"id": "498f678707e3d406fb9c9bccc87c2b93285b110b",
"size": ... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("product", "0112_auto_20200129_0050"),
]
operations = [
migrations.AlterField(
model_name="attribute",
name="name",
field=models.CharField(max_length=255)... | {
"content_hash": "d61416d2102e40dfb4a564f857373bf0",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 64,
"avg_line_length": 29.721311475409838,
"alnum_prop": 0.5295091009376723,
"repo_name": "mociepka/saleor",
"id": "a68b37a70893393dfbf2c3883e10db0125cf03ef",
"size": "1862... |
__author__ = 'donal'
__project__ = 'ribcage'
from flask import current_app
from . import log_recs
from ..log_auth.views import admin_required, set_template
@log_recs.route('/logs')
@admin_required
def logs():
txt = open('logs/Devel_logs.log').readlines()
return set_template('panelbuilder.html', txt, '',
... | {
"content_hash": "8a77342fcd0990b1dc6a2e8e1dbabc91",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 76,
"avg_line_length": 33.76470588235294,
"alnum_prop": 0.5174216027874564,
"repo_name": "carverdo/homer",
"id": "71142fe4bb9f0a83bd5c0ea1c3962ab01206f3ad",
"size": "574",
... |
import re
from lxml import etree
def remove_encoding(xml_root):
return re.sub(r'(<\?xml version=".+" encoding=".+"\?>)\n', '', xml_root)
class XMLValidator(object):
def __init__(self, xmlschema_root):
self.xml_schema = etree.XMLSchema(etree.fromstring(remove_encoding(xmlschema_root)))
self.xml... | {
"content_hash": "02035655b0834322f8a1f936ca8b9acf",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 92,
"avg_line_length": 33.94117647058823,
"alnum_prop": 0.6429809358752167,
"repo_name": "marekhakala/temperaturehub",
"id": "7e9508d96c3b1aea6da6dba9ba3ce94fb40008a3",
"si... |
"""
%store magic for lightweight persistence.
Stores variables, aliases and macros in IPython's database.
To automatically restore stored variables at startup, add this to your
:file:`ipython_config.py` file::
c.StoreMagics.autorestore = True
"""
from __future__ import print_function
#-----------------------------... | {
"content_hash": "ed18248c6fc5a8027c9c98427d3229f1",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 100,
"avg_line_length": 34.06611570247934,
"alnum_prop": 0.480228044638525,
"repo_name": "wolfram74/numerical_methods_iserles_notes",
"id": "edf3a5c5407d235526ca1ab2e50bc822... |
from fabric.api import *
from fabric.contrib.files import exists
from dlab.edge_lib import configure_http_proxy_server
import argparse
import json
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--hostname', type=str, default='')
parser.add_argument('--keyfile', type=str, default='')
parser.add_argu... | {
"content_hash": "9efb6f79bb42f5ab0bf21bb17d0351bf",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 82,
"avg_line_length": 30.375,
"alnum_prop": 0.6460905349794238,
"repo_name": "epam/DLab",
"id": "159bb5dfbee17110816e8922cdaabf4934b5563b",
"size": "1741",
"binary": fal... |
""" $lic$
Copyright (C) 2016-2020 by Tsinghua University and The Board of Trustees of
Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiative.
This program is distributed in the hope that it wi... | {
"content_hash": "8f34ab5989f14ac6448b16ab162dad19",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 29.375,
"alnum_prop": 0.7631205673758865,
"repo_name": "stanford-mast/nn_dataflow",
"id": "63dd6bdde445fe2c1bcd46231a0e83ea039e6ded",
"size": "705",
... |
"""
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... | {
"content_hash": "e96bf6d0c5e08984189f1846f8bd900c",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 91,
"avg_line_length": 26.123966942148762,
"alnum_prop": 0.6871243277443847,
"repo_name": "bpfuri/sample-django-poll-ci",
"id": "acc74f9d90b2d1348ef0a19c080834b3fbb1e789",
... |
"""
The :mod:`sklearn.kernel_approximation` module implements several
approximate kernel feature maps based on Fourier transforms and Count Sketches.
"""
# Author: Andreas Mueller <amueller@ais.uni-bonn.de>
# Daniel Lopez-Sanchez (TensorSketch) <lope@usal.es>
# License: BSD 3 clause
import warnings
import n... | {
"content_hash": "9f4d98bc79d9e383860208e69c489079",
"timestamp": "",
"source": "github",
"line_count": 840,
"max_line_length": 79,
"avg_line_length": 35.93214285714286,
"alnum_prop": 0.5951694662558393,
"repo_name": "ogrisel/scikit-learn",
"id": "ca02aac3e982c19d0894223b34a25bec63bdebda",
"size": ... |
from git_code_debt.file_diff_stat import FileDiffStat
from git_code_debt.file_diff_stat import Status
from git_code_debt.metric import Metric
from git_code_debt.metrics.lines_in_init import Python__init__LineCount
from git_code_debt.repo_parser import BLANK_COMMIT
def test_lines_in_init():
parser = Python__init__... | {
"content_hash": "db6439310349e51febc95f370a82f7fd",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 71,
"avg_line_length": 33.473684210526315,
"alnum_prop": 0.64937106918239,
"repo_name": "Yelp/git-code-debt",
"id": "ef0792fdd52f2dbfa67fd8c08cae2ab28fbc372e",
"size": "636... |
""" Set of basic plotting functions. """
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from seaborn import utils
def corrfunc(x, y, loc=(0.1, .5), template="r = {:0.4f}", type='spearman', **kwargs):
""" Adds text to the current axes with either the sparman or pearson... | {
"content_hash": "7ef393807db3cb311756b27378fb926d",
"timestamp": "",
"source": "github",
"line_count": 359,
"max_line_length": 85,
"avg_line_length": 32.69637883008357,
"alnum_prop": 0.5506900664508434,
"repo_name": "lcdb/lcdblib",
"id": "0922417e321510e05cc321797c560c8432910a49",
"size": "11760",... |
from oslo_config import cfg
from oslo_log import log
from keystone.common import config
from keystone.common import dependency
from keystone.common import sql
from keystone.i18n import _LW
from keystone.server import backends
CONF = cfg.CONF
LOG = log.getLogger(__name__)
def configure(version=None, config_files=No... | {
"content_hash": "8f881643e83ad819bbfe13d70363bec4",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 75,
"avg_line_length": 27.512820512820515,
"alnum_prop": 0.6933830382106244,
"repo_name": "himanshu-setia/keystone",
"id": "4b1ee4694129a1009449e876cd59a60894b17ddb",
"size... |
import json
import unittest
from uuid import uuid4
import requests_mock
from alerta.app import create_app, db, plugins
from alerta.models.enums import Scope
from alerta.models.key import ApiKey
from alerta.utils.response import base_url
class ForwarderTestCase(unittest.TestCase):
def setUp(self):
test... | {
"content_hash": "2fe43acec9ed9affe429d93bff573cc6",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 135,
"avg_line_length": 38.39575971731449,
"alnum_prop": 0.5728879072335726,
"repo_name": "guardian/alerta",
"id": "e06b0abc6796494716760ca87366182916896a79",
"size": "108... |
__all__ = ["test_connectfour"] | {
"content_hash": "bfa1da7f23c1d42c656bf994dd6dec64",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 30,
"avg_line_length": 30,
"alnum_prop": 0.6,
"repo_name": "amwhalen/connectfour",
"id": "2923bb1ac107136dfd5d5ce034b6d189622a34f1",
"size": "30",
"binary": false,
"copi... |
import os
import sys
import django
import tmdbsimple
from django.conf import settings
from django.test.utils import get_runner
tmdbsimple.API_KEY = os.environ['MM2_TMDB_API_KEY']
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings'
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner()
f... | {
"content_hash": "6de1d5d7a3968a1c15d131b404e265cf",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 60,
"avg_line_length": 24.5,
"alnum_prop": 0.7729591836734694,
"repo_name": "simon-andrews/movieman2",
"id": "ff1f51389be0408ee7e05b143b704029da93e575",
"size": "414",
"b... |
from awscli.customizations.emr import emrutils
from awscli.customizations.emr import exceptions
from awscli.customizations.emr import helptext
from awscli.customizations.emr.command import Command
class ModifyClusterAttr(Command):
NAME = 'modify-cluster-attributes'
DESCRIPTION = ("Modifies the cluster attribu... | {
"content_hash": "c6cc97db6c55b531ac2837c01d20eebf",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 79,
"avg_line_length": 52.08474576271186,
"alnum_prop": 0.5863976570126912,
"repo_name": "mnahm5/django-estore",
"id": "87aba1bfcf0dbc090bdae90e753e9f10714bb5de",
"size": "... |
import discord
from discord.ext import commands
import asyncio
import concurrent.futures
import math
import multiprocessing
import aiohttp
import sympy
from utilities import checks
async def setup(bot):
await bot.add_cog(Math())
class Math(commands.Cog):
"""Also see Matrix category"""
async def cog_check(sel... | {
"content_hash": "4de820927025824264bc9d6b47c2b7cd",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 104,
"avg_line_length": 29.10948905109489,
"alnum_prop": 0.6517051153460381,
"repo_name": "Harmon758/Harmonbot",
"id": "b0fe70eb13bc11091dfd7b6e8ef0fa42fdb333b3",
"size": ... |
import base64
from flask import Flask, redirect, request, session, url_for, jsonify
from spotify import OAuth, Client
app = Flask(__name__)
app.config['SECRET_KEY'] = 'supersecret'
def get_auth(token=None):
auth = OAuth(
'CLIENT_ID', # Replace these with your client id and secret
'CLIENT_SECRET'... | {
"content_hash": "e4fb439a5c3eceaf57d3ee0998018887",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 78,
"avg_line_length": 27.390625,
"alnum_prop": 0.6297775242441529,
"repo_name": "steinitzu/spotify-api",
"id": "6b7493f7791abf101e7502eeea283da26a96eb56",
"size": "1753",
... |
from django.test import TestCase
from vendor.xapi.lrs.exceptions import ParamError
from vendor.xapi.lrs.models import Agent
import hashlib
import json
import base64
from vendor.xapi.lrs import models, views
from vendor.xapi.lrs.objects.AgentManager import AgentManager
from django.core.urlresolvers import reverse
from d... | {
"content_hash": "a2119eb1d4b89a07a8f466572fe7d9a2",
"timestamp": "",
"source": "github",
"line_count": 547,
"max_line_length": 139,
"avg_line_length": 46.37477148080439,
"alnum_prop": 0.6156423700082785,
"repo_name": "Nuevosmedios/ADL_LRS",
"id": "20770017151e5e8cf2d0fd624f2c3a5d06d46a36",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.