text stringlengths 4 1.02M | meta dict |
|---|---|
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 0.5, s, t 1, s, t 1.5, s, t 2.1, s, q"
tags = "TurnOffTilesTransition"
import summa
from summa.director import director
from summa.actions import *
from summa.layer import *
from summa.scenes import *
from summa.... | {
"content_hash": "f9a829fc1fde1dddb740c3ae25ac1792",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 65,
"avg_line_length": 24.77777777777778,
"alnum_prop": 0.6385650224215247,
"repo_name": "shackra/thomas-aquinas",
"id": "7c192775f130ac34802c91017d9f87c91496e4da",
"size":... |
from enum import Enum
class FollowType(Enum):
ORG = 1
USER = 2
class Follow(object):
followType = None
id = ""
name = ""
href = ""
def __init__(self,followType,id,name,href):
assert type(followType) == type(FollowType.ORG)
self.followType = followType
self.id = id... | {
"content_hash": "c87b8159cfadb9707b55c66af334dede",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 104,
"avg_line_length": 25.2,
"alnum_prop": 0.5682539682539682,
"repo_name": "XJouYi/SinaWeibo",
"id": "e91e40108fe8e8a52c76003d223e35c6aa6f10b1",
"size": "672",
"binary"... |
from rest_framework import serializers
from placements.models import Bed, Plant, Inventory_Placement, Row
class BedSerializer(serializers.ModelSerializer):
class Meta:
model = Bed
fields = ('id', 'name')
class RowSerializer(serializers.ModelSerializer):
class Meta:
model = Row
... | {
"content_hash": "5a68391d331be18f91b4cd079c85d09d",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 83,
"avg_line_length": 30.675675675675677,
"alnum_prop": 0.6405286343612335,
"repo_name": "pgenho/PPPRO",
"id": "70d1ad80edb1e08ca028183ed1bade25b71a67c0",
"size": "1136",
... |
#============================ adjust path =====================================
import sys
import os
if __name__ == "__main__":
here = sys.path[0]
sys.path.insert(0, os.path.join(here, '..', '..'))
#============================ imports =========================================
from SmartMeshSDK.H... | {
"content_hash": "30f980d628d47e9658db125c5dc6cbe0",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 94,
"avg_line_length": 33.125,
"alnum_prop": 0.5106918238993711,
"repo_name": "bubbalinear/smartmeshsdk",
"id": "5008c935d35a87f119763939b8b846c638b55222",
"size": "2404",
... |
from .base import (
Submodule,
UpdateProgress
)
from .util import (
find_first_remote_branch
)
from git.exc import InvalidGitRepositoryError
import git
import logging
__all__ = ["RootModule", "RootUpdateProgress"]
log = logging.getLogger('git.objects.submodule.root')
log.addHandler(logging.NullHandler())... | {
"content_hash": "f135646ae83a8b90b362ad5dc07dfc54",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 120,
"avg_line_length": 50.47428571428571,
"alnum_prop": 0.5012453300124533,
"repo_name": "jeblair/GitPython",
"id": "fbd658d7c055f6857743cb98f990b138fdbf4334",
"size": "1... |
"""
Implementing logistic regression for classification problem
Helpful resources:
Coursera ML course
https://medium.com/@martinpella/logistic-regression-from-scratch-in-python-124c5636b8ac
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn import datasets
# get_ipython().run_line_magic('matplotl... | {
"content_hash": "9084bba43106ef90bb3982a17d07c306",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 87,
"avg_line_length": 30.68831168831169,
"alnum_prop": 0.6089716462124418,
"repo_name": "wuweilin/python",
"id": "48d88ef61185af0fe894bca3828ece4c06731a07",
"size": "2480"... |
import copy
from direct.directnotify import DirectNotifyGlobal
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import *
import math
from pandac.PandaModules import *
import random
import Fanfare
from otp.otpbase import OTPGlobals
from toontown.coghq import CogDisguiseGlobals
from toontown.quest ... | {
"content_hash": "3457b296c68771f66f932f4233307504",
"timestamp": "",
"source": "github",
"line_count": 813,
"max_line_length": 245,
"avg_line_length": 46.141451414514144,
"alnum_prop": 0.6060032522059019,
"repo_name": "linktlh/Toontown-journey",
"id": "28c4d6f892990369986a07d8df7010833b0153e2",
"s... |
#!/usr/bin/env python
#
# Merge multiple JavaScript source code files into one.
#
# Usage:
# This script requires source files to have dependencies specified in them.
#
# Dependencies are specified with a comment of the form:
#
# // @requires <file path>
#
# e.g.
#
# // @requires Geo/DataSource.js
#
# This scri... | {
"content_hash": "8cf01453b89b8b75fc987219cb569f8f",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 102,
"avg_line_length": 30.166666666666668,
"alnum_prop": 0.59221257563799,
"repo_name": "spatindsaongo/geos",
"id": "865081e1acc6b9643572a7475beb2a56505b7773",
"size": "7... |
__all__ = ["Categorical", "code"]
import numpy as np
from charlton import CharltonError
# A simple wrapper around some categorical data. Provides basically no
# services, but it holds data fine... eventually it'd be nice to make a custom
# dtype for this, but doing that right will require fixes to numpy itself.
class... | {
"content_hash": "f19660a8ac492852e178feb62af6f8ce",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 80,
"avg_line_length": 39.43312101910828,
"alnum_prop": 0.5795509610725247,
"repo_name": "wesm/charlton",
"id": "ffda80c394b0f6c78bd7e79650607634d57cbde7",
"size": "6321",... |
import sys
import pytest
from numbers import Real, Integral
from valid8 import Boolean, validate, validate_arg, InputValidationError
from valid8.validation_lib import instance_of, is_multiple_of
try:
from typing import Optional
except ImportError:
pass
from autoclass import autoargs, autoprops, setter_overr... | {
"content_hash": "6e48f68c4f5539abf15a121c067706fc",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 110,
"avg_line_length": 32.00735294117647,
"alnum_prop": 0.5822421318630829,
"repo_name": "smarie/python-classtools-autocode",
"id": "1bc25eb3e3c3979e2c8caa6aa154c367f84061b... |
'''
Created on Aug 3, 2015
@author: Max
'''
import numpy as np
from liexperiment.lithium.polarizability import polarizability
from amo.core.physicalconstants import PhysicalConstantsSI as c
import amo.optics.monochromaticfields as field
from liexperiment.traps.calibrations import TrapCalibrations
import matplotlib.pyl... | {
"content_hash": "cb06f730b7c96e04253eda1208bffc18",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 179,
"avg_line_length": 43.66451612903226,
"alnum_prop": 0.6134751773049646,
"repo_name": "MaxParsons/amo-physics",
"id": "70e84a2b71eae2fb8c3ebf941e04c281c340eeb6",
"size... |
"""
This module implements a TEM pattern calculator.
"""
import json
import os
from collections import namedtuple
from fractions import Fraction
from functools import lru_cache
from typing import Dict, List, Tuple, cast, Union
import numpy as np
import pandas as pd
import plotly.graph_objs as go
import scipy.constant... | {
"content_hash": "018447ddfd4a7df6ccabac32cc7a0969",
"timestamp": "",
"source": "github",
"line_count": 660,
"max_line_length": 119,
"avg_line_length": 40.722727272727276,
"alnum_prop": 0.555307511999107,
"repo_name": "gmatteo/pymatgen",
"id": "901a0acd84727cba89a4c846ed8cedc4539daf34",
"size": "27... |
import sqlite3
import re
from cStringIO import StringIO
ALLOWEDCHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}'
ALLOWEDCHARS_IDENT = ALLOWEDCHARS+"~"
ALLOWEDCHARS_HOST = ALLOWEDCHARS + ":."
class InvalidCharacterUsed(Exception):
def __init__(self, string, char, pos):
se... | {
"content_hash": "0fb53d47c53bbb57d282375e945338a6",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 104,
"avg_line_length": 37.73065015479876,
"alnum_prop": 0.49421514728809385,
"repo_name": "RenolY2/Renol-IRC",
"id": "8b9bf8f1d03c8a8ce27d0693890defe944c4fc0f",
"size": "... |
import posix_ipc
import utils
try:
posix_ipc.unlink_message_queue(utils.QUEUE_NAME)
s = "message queue %s removed" % utils.QUEUE_NAME
print (s)
except:
print ("queue doesn't need cleanup")
print ("\nAll clean!")
| {
"content_hash": "d1fd7b85d0e36360d62ad1860f60b875",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 53,
"avg_line_length": 18.153846153846153,
"alnum_prop": 0.6610169491525424,
"repo_name": "overcastcloud/posix_ipc",
"id": "53ada4220572bbbc9b79db9f7dfb524f3c57b563",
"size... |
from __future__ import with_statement
import json
from cms.api import add_plugin
from cms.constants import PLUGIN_MOVE_ACTION, PLUGIN_COPY_ACTION
from cms.models import StaticPlaceholder, Placeholder, CMSPlugin
from cms.tests.plugins import PluginsTestBaseCase
from cms.utils.compat.dj import force_unicode
from cms.uti... | {
"content_hash": "351d856c099132be9895de6ee1b2e48c",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 143,
"avg_line_length": 51.104166666666664,
"alnum_prop": 0.647778230737872,
"repo_name": "samirasnoun/django_cms_gallery_image",
"id": "6e0bfc58d71864a734eb11c71e81206376b4... |
from functools import wraps
from itertools import islice
from nose.tools import assert_false
from nose.tools import assert_in
from nose.tools import eq_
from nose.tools import ok_
def _mock_method(function):
function_name = function.func_name
@wraps(function)
def decorator(self, *args, **kwargs):
... | {
"content_hash": "baf1812605d94168281e28ab68c6692b",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 80,
"avg_line_length": 27.162650602409638,
"alnum_prop": 0.5169660678642715,
"repo_name": "franciscoruiz/python-elm",
"id": "20d1e922e91a2038b653119f0d35b6d62b940f95",
"si... |
from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from django.db import IntegrityError
# from . import factory
from ..models import Configuration
import logging
import hashlib
import datetime
from . import factory
LOG = logging.getLogger(__name__)
class ConfigurationTest(TestC... | {
"content_hash": "2bc189f423a7d979a7c68f90e8d96d06",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 71,
"avg_line_length": 28.321428571428573,
"alnum_prop": 0.5910046237915091,
"repo_name": "globocom/database-as-a-service",
"id": "81ae29e434d8b941dafd673450684c96cbc6fb39",
... |
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
driver = self.app.driver
# open groups page
driver.find_element_by_link_text("groups").click()
def create(self, group):
driver = self.app.driver
# open grou... | {
"content_hash": "5ae446d0c7c36e133700de858620b11e",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 75,
"avg_line_length": 36.833333333333336,
"alnum_prop": 0.616677440206852,
"repo_name": "Antikiy/python_training",
"id": "cbf82ccb51e3075bab10d14a6c3b105908ad3722",
"size"... |
import functools
import inspect
from nova.db import base
from nova import hooks
from nova.i18n import _
from nova.network import model as network_model
from nova import objects
from nova.openstack.common import excutils
from nova.openstack.common import lockutils
from nova.openstack.common import log as logging
LOG ... | {
"content_hash": "e8065a42233fa60b022b7463f0599232",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 79,
"avg_line_length": 38.772277227722775,
"alnum_prop": 0.6287027579162411,
"repo_name": "redhat-openstack/nova",
"id": "f43820bf5affa94f4496e062535e1aac0c5c1ab0",
"size"... |
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import re
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Match'... | {
"content_hash": "c6176dfe171d00b84c741d1bcf32ca9b",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 225,
"avg_line_length": 50.17910447761194,
"alnum_prop": 0.565437239738251,
"repo_name": "lucashanke/houseofdota",
"id": "aeab7e1683e2bc58f35c4d56aca0d947b6ee872f",
"size":... |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='KubePod',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True,
... | {
"content_hash": "cb215ece6b1377a65a7213095fdfeb6f",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 77,
"avg_line_length": 28.52173913043478,
"alnum_prop": 0.5076219512195121,
"repo_name": "mlbench/mlbench",
"id": "cb8c80931cf1d24e2b48e253f7344a6445809b1d",
"size": "705",... |
import time
from dfa.common import config
from dfa.common import dfa_logger as logging
from dfa.server.services.firewall.native import fabric_setup_base as FP
from dfa.server.services.firewall.native.drivers import base
import dfa.server.services.firewall.native.fw_constants as fw_const
from dfa.server.dfa_openstack_h... | {
"content_hash": "b2c0634a66335321f50c167217888982",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 79,
"avg_line_length": 42.19634703196347,
"alnum_prop": 0.5421491180608159,
"repo_name": "CiscoSystems/fabric_enabler",
"id": "240663a170a8ab568b01b95b53d4e188657a9ba2",
"... |
from collections import OrderedDict
from typing import Dict, Type
from .base import LabelServiceTransport
from .grpc import LabelServiceGrpcTransport
# Compile a registry of transports.
_transport_registry = (
OrderedDict()
) # type: Dict[str, Type[LabelServiceTransport]]
_transport_registry["grpc"] = LabelServi... | {
"content_hash": "b068b632cf119be5cd3845ceafa5e803",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 55,
"avg_line_length": 25.8125,
"alnum_prop": 0.7675544794188862,
"repo_name": "googleads/google-ads-python",
"id": "4d2b0c75098213d3776623ec45a9580462b67ea7",
"size": "101... |
import os
from flask import redirect, url_for, request, session
from flask_restplus import Namespace, Resource
from flask_dance.contrib.google import make_google_blueprint
from flask_dance.consumer import oauth_authorized
from flask_dance.consumer.storage.sqla import SQLAlchemyStorage
from flask_login import current_us... | {
"content_hash": "416a26997fb4e8ac79163bdf246bf05e",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 123,
"avg_line_length": 36.88607594936709,
"alnum_prop": 0.648936170212766,
"repo_name": "willrp/willbuyer",
"id": "51d33f2cf30a4e13a15447a561249b8d30b84a4e",
"size": "2914... |
__author__ = 'prossi'
class USER:
def __init__(self, obj, connection):
self.__dict__ = dict(obj.attrib)
self.connection = connection
| {
"content_hash": "8888500c9e29d4bca94cd44b7ff1ea75",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 40,
"avg_line_length": 19.5,
"alnum_prop": 0.5769230769230769,
"repo_name": "skyscape-cloud-services/skyscape_python",
"id": "52b8c80ba4549319f8f28c0e75544465cfdce08e",
"siz... |
from base64 import b64encode
import pytest
from hypothesis import given
from hypothesis import strategies as st
from argon2 import Parameters, Type, extract_parameters
from argon2._utils import NoneType, _check_types, _decoded_str_len
from argon2.exceptions import InvalidHash
class TestCheckTypes:
def test_suc... | {
"content_hash": "5e9c70f55135bfbdd23555f42161f787",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 73,
"avg_line_length": 24.95774647887324,
"alnum_prop": 0.5634875846501128,
"repo_name": "hynek/argon2_cffi",
"id": "ca0d6b683e8f3e91c8c54fdc9ddba8ebf4a2973a",
"size": "35... |
"""
Support for Linode.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/linode/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.util import Throttle
import ... | {
"content_hash": "02d91049672a8f0b729e48a1393c1284",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 75,
"avg_line_length": 24.908163265306122,
"alnum_prop": 0.6366243342892257,
"repo_name": "persandstrom/home-assistant",
"id": "c98ef16c7ed6672c6b730f708ce56816169f2faa",
"... |
from distutils.core import setup
import py2exe
setup(console=['mappy.py']) | {
"content_hash": "86867d46e7a853371a07dd18f8f322d7",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 32,
"avg_line_length": 18.75,
"alnum_prop": 0.7866666666666666,
"repo_name": "kevinzhou96/15-112-Term-Project",
"id": "fdbb07f865107dd08b0f1261cc83bc8021bb7dc9",
"size": "75... |
"""
core of the graphics library - defines Drawing and Shapes
"""
__version__=''' $Id: shapes.py 3089 2007-05-23 11:45:58Z rgbecker $ '''
import string, os, sys
from math import pi, cos, sin, tan
from types import FloatType, IntType, ListType, TupleType, StringType, InstanceType
from pprint import pprint
from reportl... | {
"content_hash": "fdaab552dd6016505cf0c58512b53f8b",
"timestamp": "",
"source": "github",
"line_count": 1301,
"max_line_length": 159,
"avg_line_length": 35.32436587240584,
"alnum_prop": 0.5757338381530561,
"repo_name": "alexissmirnov/donomo",
"id": "03622906110ef2a6c608341fc8aeddba6656bbb1",
"size"... |
import gettext
from core import config
_ = gettext.translation('message', config.localesDir).ugettext
| {
"content_hash": "b80127905ef7b25b7a97b6eb4de86d1c",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 62,
"avg_line_length": 25.75,
"alnum_prop": 0.7961165048543689,
"repo_name": "rrpg/world-editor",
"id": "adb175f6af5f1925db6dfebe221c45a97f2f6654",
"size": "103",
"binary"... |
from sympy import I, Matrix
from sympy.physics.quantum import hbar, represent, Commutator
from sympy.physics.quantum import apply_operators
from sympy.physics.quantum.spin import *
def test_represent():
assert represent(Jz) == hbar*Matrix([[1,0],[0,-1]])/2
assert represent(Jz, j=1) == hbar*Matrix([[1,0,0],[0... | {
"content_hash": "b45df0a426bbaac450b64c9b84ae600a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 72,
"avg_line_length": 34.625,
"alnum_prop": 0.6750902527075813,
"repo_name": "tarballs-are-good/sympy",
"id": "47dacc3ea6da5a173554c3438b4361fa9bace3db",
"size": "554",
... |
from oslo_config import cfg
from nova import exception
from nova.tests.functional.api_sample_tests import test_servers
from nova.tests.unit.objects import test_network
from nova.tests.unit import utils as test_utils
CONF = cfg.CONF
CONF.import_opt('osapi_compute_extension',
'nova.api.openstack.compute... | {
"content_hash": "d810a937e3f8a6f1d78c7d669ec96686",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 75,
"avg_line_length": 38.24107142857143,
"alnum_prop": 0.5199626430072379,
"repo_name": "dims/nova",
"id": "2cf6b10bd2ec5a9bd089624d067d63675feb4fbf",
"size": "4885",
"... |
import sys
import boto3
def testJob(txtfile):
with open(txtfile, "r") as f:
newFile = open("output.txt", "w")
newFile.write(str(f.readline()) + "WORLD")
newFile.close()
return newFile.name
def getData(key, datadir):
s3 = boto3.resource('s3')
filename = datadir + '/' + key
d... | {
"content_hash": "57ad368568b5ba4444d589a0b1f3e893",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 71,
"avg_line_length": 28.72,
"alnum_prop": 0.6364902506963789,
"repo_name": "NeuroDataDesign/pan-synapse",
"id": "4b8b8387c81b61ca57a6485c1ccf4514dda2b34b",
"size": "718",... |
import numpy as np
import pandas as pd
try:
import pandas.core.computation.expressions as expr
except ImportError:
import pandas.computation.expressions as expr
class Eval:
params = [["numexpr", "python"], [1, "all"]]
param_names = ["engine", "threads"]
def setup(self, engine, threads):
... | {
"content_hash": "cf5bf4fe56ebd47195d4b59cbacb5d3e",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 86,
"avg_line_length": 30.136363636363637,
"alnum_prop": 0.5922574157868276,
"repo_name": "TomAugspurger/pandas",
"id": "cbab9fdc9c0baeec0a126a670595a98a52e2e3a7",
"size": ... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "def92478ddbc24bd6f97ffc1216985a3",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 540,
"avg_line_length": 49.07121661721068,
"alnum_prop": 0.7515268791195501,
"repo_name": "benfinke/ns_python",
"id": "1e3fde759248151802227ef0673d2e34fa5c24e5",
"size": "... |
import sys
from setuptools import setup
from n_utils import PATH_COMMANDS, CONSOLESCRIPTS
setup(name='nitor_deploy_tools',
version='1.60',
description='Tools for deploying to AWS via CloudFormation and Serverless framework that support a pull request based workflow',
url='http://github.com/NitorCreat... | {
"content_hash": "563bcc5c5a71f84c3db9914344caed2f",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 134,
"avg_line_length": 28.058823529411764,
"alnum_prop": 0.5359888190076869,
"repo_name": "NitorCreations/nitor-deploy-tools",
"id": "e2883223d46c720e558be5261db3bdbb900f933... |
DOCUMENTATION = '''
---
module: ec2_group
author: "Andrew de Quincey (@adq)"
version_added: "1.3"
short_description: maintain an ec2 VPC security group.
description:
- maintains ec2 security groups. This module has a dependency on python-boto >= 2.5
options:
name:
description:
- Name of the security gro... | {
"content_hash": "e8689c1a0c6e99563c86b8c9d779002a",
"timestamp": "",
"source": "github",
"line_count": 455,
"max_line_length": 201,
"avg_line_length": 37.96923076923077,
"alnum_prop": 0.557247047927761,
"repo_name": "daniel-rhoades/hippo-production-example",
"id": "6a696eacc6c93d9709aacb78a439e89ddf... |
from t_core.messages import Packet
from t_core.iterator import Iterator
import time
from multiprocessing import Process
from core.himesis_utils import expand_graph, shrink_graph, delete_graph, disjoint_model_union, print_graph, graph_to_dot, get_preds_and_succs
from copy import deepcopy
import numpy.random as nprn... | {
"content_hash": "df837feab69b51a87918580ef739f88f",
"timestamp": "",
"source": "github",
"line_count": 707,
"max_line_length": 154,
"avg_line_length": 47.001414427157,
"alnum_prop": 0.45428829371050256,
"repo_name": "levilucio/SyVOLT",
"id": "6ae650c025a6ccf00bd32265f246f7e3529dfcf9",
"size": "332... |
"""Support for Tuya Fan."""
from __future__ import annotations
from typing import Any
from tuya_iot import TuyaDevice, TuyaDeviceManager
from homeassistant.components.fan import (
DIRECTION_FORWARD,
DIRECTION_REVERSE,
FanEntity,
FanEntityFeature,
)
from homeassistant.config_entries import ConfigEntry... | {
"content_hash": "363c7fec0880c150c082570b1f47f2f5",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 87,
"avg_line_length": 33.13026819923372,
"alnum_prop": 0.5716433445125477,
"repo_name": "toddeye/home-assistant",
"id": "2d16ed36d404bda99ff49f22296301365a6e42fa",
"size"... |
from django.db.models import CharField
from jeevesdb.JeevesModel import JeevesModel as Model, JeevesForeignKey as ForeignKey
from sourcetrans.macro_module import macros, jeeves
from jeevesdb.JeevesModel import label_for
import JeevesLib
# An example model.
# Right now self-reference is either impossible or difficult ... | {
"content_hash": "5df57445c2c11a152a7e22320d6ac29c",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 88,
"avg_line_length": 31.585365853658537,
"alnum_prop": 0.7837837837837838,
"repo_name": "BambooL/jeeves",
"id": "f1ef19d7966c58c003a2f7e31532df332c615627",
"size": "1295"... |
"""
Tests for NetApp API layer
"""
from cinder.i18n import _
from cinder import test
from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api
class NetAppApiElementTransTests(test.TestCase):
"""Test case for NetApp API element translations."""
def setUp(self):
super(NetAppApiElem... | {
"content_hash": "2d4480146dd74c73ae5c452e733141cf",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 75,
"avg_line_length": 39.70289855072464,
"alnum_prop": 0.5831356086877167,
"repo_name": "tlakshman26/cinder-bug-fix-volume-conversion-full",
"id": "7910a68ca7629774dce87da0... |
import datetime
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline... | {
"content_hash": "fdc85b581bfd68675f9f45bbfdd550f5",
"timestamp": "",
"source": "github",
"line_count": 1456,
"max_line_length": 174,
"avg_line_length": 57.559065934065934,
"alnum_prop": 0.6608954012839177,
"repo_name": "Azure/azure-sdk-for-python",
"id": "ed32bc96241b6d38d202052291f52153f05af79e",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('team', '0004_remove_player_active'),
]
operations = [
migrations.CreateModel(
name=... | {
"content_hash": "5c487a2d677cdea2ed1be262ef78db81",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 158,
"avg_line_length": 48.055045871559635,
"alnum_prop": 0.5435280641466208,
"repo_name": "vollov/lotad",
"id": "0cf20c5999fe989a00ab85ba2b20431941c21885",
"size": "5309"... |
import re
import pywikibot
from api.model.word import Entry
from .base import WiktionaryProcessor
from .base import stripwikitext
class FRWiktionaryProcessor(WiktionaryProcessor):
@property
def language(self):
return 'fr'
def __init__(self, test=False, verbose=False):
super(FRWiktionary... | {
"content_hash": "5d0bfa82eb0186f8492b8f4011691918",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 90,
"avg_line_length": 32.02325581395349,
"alnum_prop": 0.47615589445654805,
"repo_name": "radomd92/botjagwar",
"id": "c742a6261e149f90fcdaed52902c8160a0463106",
"size": "... |
import inspect
import numpy as np
from .bdf import BDF
from .radau import Radau
from .rk import RK23, RK45, DOP853
from .lsoda import LSODA
from scipy.optimize import OptimizeResult
from .common import EPS, OdeSolution
from .base import OdeSolver
METHODS = {'RK23': RK23,
'RK45': RK45,
'DOP853': ... | {
"content_hash": "c590bce9c1608acd4503a5eb16127d97",
"timestamp": "",
"source": "github",
"line_count": 663,
"max_line_length": 92,
"avg_line_length": 41.542986425339365,
"alnum_prop": 0.6049813019642014,
"repo_name": "matthew-brett/scipy",
"id": "79c65414fbd649c3a2bda47faa8a5279f88ed28a",
"size": ... |
from collections import defaultdict
from snoopy.helpers import get_app_root, default_json_serializer
from snoopy.trace import Trace
import datetime
import json
import re
DJANGO_DB_QUERY_FILE = "django/db/models/query.py"
class TraceAnalyzer(object):
def __init__(self, data):
self.trace_data = data
... | {
"content_hash": "f74aef988189e43c44eb4c25891d0993",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 91,
"avg_line_length": 34.36879432624114,
"alnum_prop": 0.5489063144861742,
"repo_name": "Pradeek/django-snoopy",
"id": "cb8b31619a758adb35f1341a2d04d9828c375a0e",
"size":... |
"""
An internal immutable DataFrame with some metadata to manage indexes.
"""
import re
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, TYPE_CHECKING, cast
import numpy as np
import pandas as pd
from pandas.api.types import CategoricalDtype # noqa: F401
from pyspark._globals import _NoValue, _No... | {
"content_hash": "61da0cf903398e6616a81a36c4e719dd",
"timestamp": "",
"source": "github",
"line_count": 1567,
"max_line_length": 100,
"avg_line_length": 40.029993618379066,
"alnum_prop": 0.5485197761729399,
"repo_name": "jiangxb1987/spark",
"id": "53bb9644fd89266ebae4bd5e101a72c08c71c943",
"size": ... |
from blinkpy.common.checkout.git_mock import MockGit
from blinkpy.common.net.results_fetcher_mock import MockTestResultsFetcher
from blinkpy.common.net.web_mock import MockWeb
from blinkpy.common.path_finder import PathFinder
from blinkpy.common.system.system_host_mock import MockSystemHost
# New-style ports need to m... | {
"content_hash": "a7a91be66bb7da6bc88242107ce9f135",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 91,
"avg_line_length": 39.14141414141414,
"alnum_prop": 0.5641290322580645,
"repo_name": "scheib/chromium",
"id": "e81a7ef7b569c763316915733b7dd951e4284792",
"size": "5402"... |
"""
This script parse a directory tree looking for python modules and packages and
create ReST files appropriately to create code documentation with Sphinx.
It also create a modules index.
"""
import os
import optparse
# automodule options
OPTIONS = ['members',
'undoc-members',
# 'inherited-m... | {
"content_hash": "8ddae5aa75e5f0300c0f4f84a9e289f9",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 164,
"avg_line_length": 37.951310861423224,
"alnum_prop": 0.5755452481989539,
"repo_name": "pombreda/pyamg",
"id": "7606a403fc1aebaea27365347e5dd7d1023f162b",
"size": "109... |
import json
import urllib
import datetime
from gdata.youtube import service
from utils.text import style
from commands import Command
class youtube(Command):
syntax = "Syntax %s %s" % (
style.bold("!youtube"),
style.underline("phrase"))
def __init__(self, *args, **kwargs):
Command.... | {
"content_hash": "e7166fd46e748cf9c6f692220e388d97",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 86,
"avg_line_length": 29.606060606060606,
"alnum_prop": 0.601842374616172,
"repo_name": "ryonsherman/rcbot",
"id": "7edd7f3053af179160b5b856711a652d15a7a26e",
"size": "100... |
from queue import PriorityQueue
import math
import random
from app.logic.incoming_event import IncomingEvent
from app.logic.outcoming_event import OutcomingEvent
from app.logic.device import Device
from app.logic.request import Request
class Model:
work_time = None
interval_time = None
event_list = None
... | {
"content_hash": "1eaa2211561d38e3c8e5fdc7a72f28b5",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 81,
"avg_line_length": 32.41558441558441,
"alnum_prop": 0.6430288461538461,
"repo_name": "ordinary-developer/modelling_1",
"id": "ab2499603edcb5960a519e79b246a3d9284dfb8f",
... |
from django import forms
from django.forms import HiddenInput
from django.forms import formset_factory
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, HTML, Submit
from crispy_forms.bootstrap import FormActions
from selectable import forms as selectable
from workshops.models im... | {
"content_hash": "ac7a7c98eaf5206f7bbc804a74909db2",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 85,
"avg_line_length": 30.57051282051282,
"alnum_prop": 0.5712937722793039,
"repo_name": "shapiromatron/amy",
"id": "f8e25e295d3dadde78417623a85b7471df1abb30",
"size": "95... |
from file_preprocessor import FileView
from subprocess import Popen, PIPE, STDOUT
import tempfile
import os
import json
def franken_interpreter(file_view, user_solutions, file_pointer):
in_question = False
for line_data in file_view.line_datas:
if 'macro' in line_data:
if line_data['text']... | {
"content_hash": "3868382dd3273bc568ba18958e85a6aa",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 78,
"avg_line_length": 42.1958762886598,
"alnum_prop": 0.46713901783532863,
"repo_name": "RaphaelArkadyMeyer/LiveCoding",
"id": "1912c3966a89067d2d7e1191b4c648c9aa47aeaa",
... |
import logging
import urllib
log = logging.getLogger(__name__)
def parse_basic_info(x):
integers = ['port', 'err', 'pv']
booleans = ['pow', 'led']
parse_data(x, integers=integers, booleans=booleans)
x['name'] = urllib.parse.unquote(x['name'])
return x
def parse_sensor_info(x):
integers = [... | {
"content_hash": "9d77d0eb0e843bbd6b2bbe4d1767a9ce",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 84,
"avg_line_length": 24.926315789473684,
"alnum_prop": 0.5219594594594594,
"repo_name": "ael-code/daikin-aricon-pylib",
"id": "be99f598482d86d7a7f672e386d254c0ba4076d3",
... |
import warnings
import numpy as np
import astropy.units as u
import astropy.wcs
from astropy.coordinates import SkyCoord
from sunpy.coordinates import frames
from sunpy.util import MetaDict
from sunpy.util.exceptions import SunpyUserWarning
__all__ = ['meta_keywords', 'make_fitswcs_header']
def meta_keywords():
... | {
"content_hash": "a9973774acd52e682b106ec28ee23cab",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 108,
"avg_line_length": 37.506410256410255,
"alnum_prop": 0.639890616988549,
"repo_name": "dpshelio/sunpy",
"id": "12ccc46579cbd8cfb9c4deef050860272a5ed78d",
"size": "1170... |
from test_framework.test_framework import PhtevencoinTestFramework
from test_framework.util import *
from struct import *
import binascii
import json
import StringIO
import decimal
try:
import http.client as httplib
except ImportError:
import httplib
try:
import urllib.parse as urlparse
except ImportError:... | {
"content_hash": "e18df274410c14f30307ddd9f4636013",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 132,
"avg_line_length": 45.171171171171174,
"alnum_prop": 0.6149448211673979,
"repo_name": "ravenbyron/phtevencoin",
"id": "5e28cc625c39777e7e69ab50108adb48f5e4c70c",
"siz... |
import unittest
from base import BaseTestCase
class PhoneNumberTestCase(unittest.TestCase, BaseTestCase):
def create_docstring(self, phone_number):
return """
BEFORE: My phone number is %s
AFTER: My phone number is {{PHONE}}
""" % phone_number
def check_phone_numbers(self, ... | {
"content_hash": "07b9f612145f6de5c4b3cb8f62d7abb2",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 75,
"avg_line_length": 30.833333333333332,
"alnum_prop": 0.5410810810810811,
"repo_name": "datascopeanalytics/scrubadub",
"id": "44679082923e024843dab607e9bd1340db00e86a",
... |
from __future__ import absolute_import
from __future__ import unicode_literals
import json
import logging
import time
from requests.adapters import HTTPAdapter
from requests import Session
import acos_client
from acos_client import logutils
from acos_client.v30 import responses as acos_responses
LOG = logging.getLo... | {
"content_hash": "212a5f0c3aad3437ef2a79b937523bc4",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 114,
"avg_line_length": 41.61578947368421,
"alnum_prop": 0.5755659542177817,
"repo_name": "a10networks/acos-client",
"id": "382d09c8bedc35502a9bcb8065b64f3f2d5a37b6",
"siz... |
'''
Created on Oct 22, 2010
@author: Stephen O'Hara
'''
# PyVision License
#
# Copyright (c) 2006-2008 Stephen O'Hara
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of s... | {
"content_hash": "88e950567ed1151ca03174f5251d9144",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 100,
"avg_line_length": 40.357142857142854,
"alnum_prop": 0.6435957149510946,
"repo_name": "mikeseven/pyvision",
"id": "7f4c65157ef059c30fcb43c72242d41c89874ad3",
"size": ... |
from akagi.content import Content
from akagi.iterator import Iterator
class LocalFileContent(Content):
is_local = True
def __init__(self, path, file_format='csv'):
self.path = path
self.file_format = file_format
self.iterator_class = Iterator.get_iterator_class(file_format)
def _... | {
"content_hash": "0d43f0132dff70e5ed9be0388bf04df0",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 23.09090909090909,
"alnum_prop": 0.6358267716535433,
"repo_name": "ayemos/osho",
"id": "08e39389f57063d6893b64655595acf92ef2c52d",
"size": "508",
"... |
import sys
import struct
equals_button = 0x01005D51
memory_file = "/Users/justin/Documents/Virtual Machines.localized/Windows Server 2003 Standard Edition.vmwarevm/564d9400-1cb2-63d6-722b-4ebe61759abd.vmem"
slack_space = None
trampoline_offset = None
# read in our shellcode
sc_fd = open("cmeasure.bin","... | {
"content_hash": "a8472fd3c741aa34216537fb0b639bc8",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 160,
"avg_line_length": 33.0462962962963,
"alnum_prop": 0.4858503782572149,
"repo_name": "vdrey/Toolbox",
"id": "69d162f2eaeabe51fa6233fb83f4d61871cd5b41",
"size": "3569",... |
from django_cas_ng.backends import * # noqa
from django_cas_ng.decorators import * # noqa
from django_cas_ng.middleware import * # noqa
from django_cas_ng.models import * # noqa
from django_cas_ng.views import * # noqa
def test_nothing_is_on_fire():
# Nothing to do here, this file is used for testing import ... | {
"content_hash": "52b0948a878899e5315f6f6e8d2606fb",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 69,
"avg_line_length": 33.6,
"alnum_prop": 0.7142857142857143,
"repo_name": "mingchen/django-cas-ng",
"id": "64ed5ba487975028087698ea42c6cb99562ccd59",
"size": "336",
"bi... |
import logging
from fuel_health import nmanager
LOG = logging.getLogger(__name__)
class SanityHeatTest(nmanager.SanityChecksTest):
"""Class contains tests that check basic Heat functionality.
Special requirements:
1. Heat component should be installed.
"""
def test_list_stacks(self):
... | {
"content_hash": "51efc0da65b601029d933c7df5c3db4f",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 64,
"avg_line_length": 24.846153846153847,
"alnum_prop": 0.586687306501548,
"repo_name": "mcloudv/fuel-ostf",
"id": "9afcb162f421d7deba03c1fd7847bcbc117d1925",
"size": "126... |
from msrest.serialization import Model
class JobEnableOptions(Model):
"""Additional parameters for enable operation.
:param timeout: The maximum time that the server can spend processing the
request, in seconds. The default is 30 seconds. Default value: 30 .
:type timeout: int
:param client_requ... | {
"content_hash": "444da5de0ce04c82def82ad6fef15c06",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 191,
"avg_line_length": 51.88,
"alnum_prop": 0.723207401696222,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "52157c07bc41e3d84ab0771074c59944eef072b9",
"size": "3... |
from django.db import models
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser
class UserManager(BaseUserManager):
def create_user(self, yiban_id, password):
if not yiban_id:
raise ValueError("易班id不能为空")
user = self.model(
login_id=yiban_id,
... | {
"content_hash": "f580830ae526d4dc55748e7e3af76dae",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 97,
"avg_line_length": 25.84375,
"alnum_prop": 0.6088270858524788,
"repo_name": "trickTech/BRB",
"id": "4c0ff271d5f5b4cb42a5bad4ed0ce9a7f41cede6",
"size": "1716",
"binary... |
"""
This example demonstrates the SpinBox widget, which is an extension of
QDoubleSpinBox providing some advanced features:
* SI-prefixed units
* Non-linear stepping modes
* Bounded/unbounded values
"""
import initExample ## Add path to library (just for examples; you do not need this)
import pyqtgraph as pg
... | {
"content_hash": "55ea1ceeeb69bde735e96c945f987b89",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 132,
"avg_line_length": 35.646153846153844,
"alnum_prop": 0.6486836426413466,
"repo_name": "pmaunz/pyqtgraph",
"id": "2faf10eec8ef04c09beacec602ace44c2027acc5",
"size": "4... |
import hashlib
import sys
import time
from django.conf import settings
from django.db.utils import load_backend
from django.utils.encoding import force_bytes
from django.utils.functional import cached_property
from django.utils.six.moves import input
from .utils import truncate_name
# The prefix to put on the defaul... | {
"content_hash": "84f5a449f6544fc2dd1f8e9e6fdfffab",
"timestamp": "",
"source": "github",
"line_count": 486,
"max_line_length": 105,
"avg_line_length": 41.7201646090535,
"alnum_prop": 0.5645590846320774,
"repo_name": "mbox/django",
"id": "b2b82c13c2c5671abf0773669fe88427e357eb6e",
"size": "20276",
... |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Author(models.Model):
name = models.CharField(max_length=50)
def __unicode__(self):
return self.name
class Tag(models.Model):
tag_name = models.CharField(max_length=30)
def __unicode_... | {
"content_hash": "f9b22fc3d8e38cdaf0769a313e7d3c0f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 66,
"avg_line_length": 25.488372093023255,
"alnum_prop": 0.6879562043795621,
"repo_name": "XenonSumback/stroustrup-back",
"id": "90ab0dfe7c3b6f270c27b215013cd8ce41f42534",
... |
import os
import re
import configparser
from i3pystatus import IntervalModule, formatp
from i3pystatus.core.util import lchop, TimeWrapper, make_bar
from i3pystatus.core.desktop import DesktopNotification
from i3pystatus.core.command import run_through_shell
class UEventParser(configparser.ConfigParser):
@static... | {
"content_hash": "10d13fe7d15a61d8a33e44b6636a15c7",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 131,
"avg_line_length": 38.56832298136646,
"alnum_prop": 0.5881310894596988,
"repo_name": "juliushaertl/i3pystatus",
"id": "93eef7dce4ea7f8a4c8ccd13af972076e195e004",
"siz... |
import discord
from discord.ext import commands
class Misc(commands.Cog):
"""I'm not very good at categorizing things."""
def __init__(self, bot):
self.chiaki = bot
@commands.command()
async def say(self, context, *, repeat):
"""A generic repeat command."""
await con... | {
"content_hash": "aeef088c34e76951496b8ee715775abf",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 81,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.5692307692307692,
"repo_name": "adelie/chiakibot",
"id": "5a319e919290b349fc97716711e4558a8408fa57",
"size": "156... |
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("contentstore", "0003_auto_20160513_1115")]
operations = [
migrations.AlterField(
model_name="message",
n... | {
"content_hash": "0d6e14f3301c0f548286939e643eeb06",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 64,
"avg_line_length": 26.73913043478261,
"alnum_prop": 0.5739837398373984,
"repo_name": "praekelt/seed-stage-based-messaging",
"id": "cc06d2437373d76fb10362931b67e9132c436b3... |
"""
Encoders for sequence-to-sequence models.
"""
import inspect
import logging
from abc import ABC, abstractmethod
from math import ceil, floor
from typing import Callable, List, Optional, Tuple, Union, Dict
import mxnet as mx
from . import config
from . import constants as C
from . import convolution
from . import ... | {
"content_hash": "59116e25b34f8083c8e4696743578318",
"timestamp": "",
"source": "github",
"line_count": 1265,
"max_line_length": 119,
"avg_line_length": 41.95573122529644,
"alnum_prop": 0.5692994686663904,
"repo_name": "artemsok/sockeye",
"id": "95c313bb6d419aacf05ada826c4b6335cd603e1a",
"size": "5... |
from django.db import models
from django.contrib.auth.models import User
class StudyUserResearcher(models.Model):
"""A researcher user.
fields:
user: OneToOne, to Django User model
"""
user = models.OneToOneField(User)
class StudyUserParticipant(models.Model):
"""A study participant.
... | {
"content_hash": "588876769a3d9545963d67938491b050",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 52,
"avg_line_length": 22.73913043478261,
"alnum_prop": 0.6864244741873805,
"repo_name": "PersonalGenomesOrg/studyus-project",
"id": "ac345c32c18b9aa67c14b07e04fb4036c51f4f72... |
from requests import utils as requests_utils
from gerritclient.v1 import base
class ChangeClient(base.BaseV1Client):
api_path = "/changes/"
def get_all(self, query, options=None, limit=None, skip=None):
"""Query changes.
:param query: Queries as a list of string
:param options: Lis... | {
"content_hash": "86ed119b3bb3091caac8908c6dcefe2a",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 79,
"avg_line_length": 42.26315789473684,
"alnum_prop": 0.5983331736756394,
"repo_name": "tivaliy/python-gerritclient",
"id": "32d2ea6f84fe4fcdcadf7582cfa2326f6e9d4e40",
"... |
import time
import hashlib
import globaldb
class User(object):
def __init__(self):
self.db = globaldb.db
# password encoding
def encode_pwd(self, str):
if str is not None:
m = hashlib.md5()
m.update(str)
return m.hexdigest()
else:
r... | {
"content_hash": "ad6d33b4732d0b1ee24d2db447d255a8",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 86,
"avg_line_length": 26.604395604395606,
"alnum_prop": 0.4836844279223461,
"repo_name": "vincentpc/yagra",
"id": "4c5e49795fdc60dff57b4b3a3fa98135d09e7c20",
"size": "2459... |
"""
Run unit tests for modules.
"""
from __future__ import print_function
import os
import sys
import unittest
import coverage
def main():
# Add the root program directory and the module tests directory to sys.path
call_paths = list()
split_call_path_list = os.path.abspath(sys.argv[0]).split(os.sep)
... | {
"content_hash": "0ebac0521ee2ae09f08017747ccb86a4",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 113,
"avg_line_length": 36.1,
"alnum_prop": 0.5933518005540166,
"repo_name": "Drudenhaus/aws-ec2rescue-linux",
"id": "e210393dc770b34f3b6c56be1b8a321404c6b275",
"size": "23... |
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... | {
"content_hash": "41eb33243140843a1ffb8d85416eafad",
"timestamp": "",
"source": "github",
"line_count": 3028,
"max_line_length": 91,
"avg_line_length": 33.80680317040951,
"alnum_prop": 0.5980442916174158,
"repo_name": "Hoekz/hackness-monster",
"id": "8ac7f2fa80f551bcbf2cc0a8c4f7cc4735c8d5ec",
"size... |
from test_plus.test import TestCase
from django.test import Client
# from unittest import skip
class Testnew_chart(TestCase):
def setUp(self):
self.client = Client()
# self.client.login(username='fred', password='secret')
def test_charts_renders_new_charts(self):
response = self.clie... | {
"content_hash": "edc6f245b50697433d7c5226fdfacf39",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 77,
"avg_line_length": 35.60526315789474,
"alnum_prop": 0.663710273466371,
"repo_name": "frRoy/Benchmarklib",
"id": "3e73743af9758f2995209d52b7aeb3289a8de55c",
"size": "135... |
import argparse
import mock
from blazarclient import shell
from blazarclient import tests
from blazarclient.v1.shell_commands import networks
class CreateNetworkTest(tests.TestCase):
def setUp(self):
super(CreateNetworkTest, self).setUp()
self.create_network = networks.CreateNetwork(shell.Blazar... | {
"content_hash": "a97d6329bdf66c3bbf92905c61fd1f9a",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 86,
"avg_line_length": 30.93846153846154,
"alnum_prop": 0.5785678766782695,
"repo_name": "ChameleonCloud/python-blazarclient",
"id": "481ba2066c40d747fac8e1be64136189dbd2921... |
import argparse
import datetime
import json
import os
import sys
import urllib.request
# TODO(crbug.com/1336630): This is compared lexically. Remove it before M1000.
MIN_VERSION = '107.0.5298.0'
def fetch():
"""
Queries the VersionHistory API to determine the version of the updater that
was serving on Mon... | {
"content_hash": "a7c16ae4e09c9cd633b917508e61d46f",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 79,
"avg_line_length": 29.964912280701753,
"alnum_prop": 0.6176814988290398,
"repo_name": "nwjs/chromium.src",
"id": "7eb925a3304c4a3acd54d389bfd5de31d7a6d781",
"size": "18... |
from azure.core.exceptions import ClientAuthenticationError
from azure.core.pipeline.policies import SansIOHTTPPolicy
from azure.core.pipeline.transport import RequestsTransport
from azure.identity import InteractiveBrowserCredential
from azure.identity._internal.user_agent import USER_AGENT
import pytest
from unittest... | {
"content_hash": "a6eedc16daaa64291a850986ae0ec32b",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 110,
"avg_line_length": 38.55263157894737,
"alnum_prop": 0.7375426621160409,
"repo_name": "Azure/azure-sdk-for-python",
"id": "113ce21dcaeefb7ed27b51fc721c2c66bde8356a",
"s... |
import telnetlib
import time
PLUGIN_NAME = "ts3_stats"
# COMMAND LINE CONFIG
# Because we don't know where the config file is (it is read by collectd)
HOST = '127.0.0.1'
PORT = '10011'
USERNAME = 'serveradmin'
PASSWORD = ''
TYPE_GAUGE = 'gauge'
TYPE_BYTES = 'bytes'
try:
import collectd
except:
import sys
class ... | {
"content_hash": "d147203d82aab1d6ec88730ff48750b6",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 122,
"avg_line_length": 22.03030303030303,
"alnum_prop": 0.6711141678129299,
"repo_name": "Silberling/collectd_teamspeak3",
"id": "9934e6f4173bc45aee0493f44d1768e0318976a7",... |
from direct.distributed import DistributedObject
from direct.distributed.ClockDelta import *
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import FSM
from direct.gui.DirectGui import *
from panda3d.core import *
from panda3d.direct import *
from direct.task import Task
from toontown.fishing import ... | {
"content_hash": "d813823abd65390688ef46243b699c6b",
"timestamp": "",
"source": "github",
"line_count": 355,
"max_line_length": 103,
"avg_line_length": 36.78591549295775,
"alnum_prop": 0.6378742629604105,
"repo_name": "silly-wacky-3-town-toon/SOURCE-COD",
"id": "73139ee726ca8ceef8fbe48abe0049a9e9ed20... |
import datetime
from django.conf import settings
from django.test import TestCase
from timepiece import utils
from timepiece.tests import factories
from timepiece.reports.utils import generate_dates
class ReportsTestBase(TestCase):
def setUp(self):
super(ReportsTestBase, self).setUp()
self.use... | {
"content_hash": "c4bd778ec85606ea989a903a9f5e619f",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 77,
"avg_line_length": 40.888888888888886,
"alnum_prop": 0.6049592391304348,
"repo_name": "caktus/django-timepiece",
"id": "ce18eb5f33bc16c10617993930c258d0ca458c0d",
"size... |
import _plotly_utils.basevalidators
class YshiftValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="yshift", parent_name="layout.annotation", **kwargs):
super(YshiftValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "c3cf69cfaf4e6c7098b334344767cd4d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 88,
"avg_line_length": 37.63636363636363,
"alnum_prop": 0.6328502415458938,
"repo_name": "plotly/plotly.py",
"id": "5633cad75994be08e97a0dc517dacc04e9e25cc4",
"size": "414"... |
"""Test the Smart Meter Texas config flow."""
import asyncio
from unittest.mock import patch
from aiohttp import ClientError
import pytest
from smart_meter_texas.exceptions import (
SmartMeterTexasAPIError,
SmartMeterTexasAuthError,
)
from homeassistant import config_entries, setup
from homeassistant.componen... | {
"content_hash": "29b68328fb6b5227522342e36a84c66a",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 82,
"avg_line_length": 31.43089430894309,
"alnum_prop": 0.6497672012415934,
"repo_name": "kennedyshead/home-assistant",
"id": "246ae4edc7d1f34985e9746baca16da5ce81fc38",
"... |
import argparse
import sys
# 3rd Party Imports
from PIL import Image
from prettytable import PrettyTable
class PixelCount:
# Dictionary to convert channel letters to their equivalent number.
channel_indexes = {
'r': 0,
'g': 1,
'b': 2
}
def __init__(self, image_file, channel,... | {
"content_hash": "8888012ef24ce3ab1025db0e7ebcacfd",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 76,
"avg_line_length": 31.939393939393938,
"alnum_prop": 0.5866540164452878,
"repo_name": "hughsaunders/pixelcount",
"id": "fd367d9b7ccc147adfe5b32c280d828a6ed8a865",
"size... |
from kraken.ui.Qt import QtGui, QtWidgets, QtCore
from undo_redo_manager import UndoRedoManager, Command
class ValueChangeCommand(Command):
def __init__(self, valueController, newValue):
super(ValueChangeCommand, self).__init__()
self._valueController = valueController
self.oldValue = self... | {
"content_hash": "49c1523be0664f841266570f16024a9e",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 141,
"avg_line_length": 28.167539267015705,
"alnum_prop": 0.616728624535316,
"repo_name": "oculusstorystudio/kraken",
"id": "2f07d9eab62e6cb3e988a8cf936e5be80ad85ca6",
"si... |
import pickle
from io import BytesIO
import numpy as np
import scipy.sparse
from sklearn.datasets import load_digits, load_iris
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert... | {
"content_hash": "a8d991f06ee3abcaa8e8e89a7f96f377",
"timestamp": "",
"source": "github",
"line_count": 586,
"max_line_length": 81,
"avg_line_length": 37.2098976109215,
"alnum_prop": 0.6187571657876634,
"repo_name": "rvraghav93/scikit-learn",
"id": "f43ddf0a0c553cf502a5e373476b8d64a8c9505e",
"size"... |
import json
import socket
import unittest
import picklepipe
def _safe_close(pipe):
try:
pipe.close()
except:
pass
class TestJSONPipe(unittest.TestCase):
def make_pipe_pair(self):
rd, wr = picklepipe.make_pipe_pair(picklepipe.JSONPipe)
assert isinstance(rd, picklepipe.Base... | {
"content_hash": "eed7d073df2a660acfd7da02aec5ce90",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 74,
"avg_line_length": 30.5,
"alnum_prop": 0.5505464480874317,
"repo_name": "SethMichaelLarson/picklepipe",
"id": "dc0afb6470b13cbbae196b96aa3734cd2128073e",
"size": "1464"... |
from __future__ import print_function
from permuta import *
import permstruct
import permstruct.dag
from permstruct import *
from permstruct.dag import taylor_dag
import sys
is_classical = True
# -- Examples from Vatter paper -- #
# STATUS ================================================ >
patts = map(Permutation,... | {
"content_hash": "83d9cab498bf42148b4e6c088986459a",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 80,
"avg_line_length": 26.8,
"alnum_prop": 0.5022388059701492,
"repo_name": "PermutaTriangle/PermStruct",
"id": "68b762ae815951d629c9938dbe1187e1fc9cab95",
"size": "1340",
... |
import io
import os
import sys
from codecs import open
from setuptools import setup, find_packages, Command
from shutil import rmtree
# General Attributes and Requirements
NAME = 'getmagpi'
DESCRIPTION = 'A simple utility to synchronize free MagPi PDF content.'
URL = 'https://jnario.github.io/getmagpi/'
EMAIL = 'jose... | {
"content_hash": "2406ab732de08129476ad63c1bb677dc",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 86,
"avg_line_length": 28.23076923076923,
"alnum_prop": 0.6130790190735694,
"repo_name": "jnario/getmagpi",
"id": "5790289265b0254843918585ce3cab362fc51ee5",
"size": "2978... |
from ._base import SQLBaseStore, cached
from twisted.internet import defer
import logging
import simplejson as json
logger = logging.getLogger(__name__)
class PushRuleStore(SQLBaseStore):
@cached()
@defer.inlineCallbacks
def get_push_rules_for_user(self, user_name):
rows = yield self._simple_sel... | {
"content_hash": "0bea265702ed5effc7be5db592f47dc7",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 85,
"avg_line_length": 30.693181818181817,
"alnum_prop": 0.5418980624460077,
"repo_name": "illicitonion/synapse",
"id": "4cac118d17c9965c9d9f9f34710e62015bc59762",
"size":... |
def allianceVersusMonster(health_points, attack_damage):
monster_hp = health_points[0]
monster_dm = attack_damage[0]
soldiers_hp = health_points[1:]
soldiers_dm = attack_damage[1:]
soldiers = [(soldiers_dm[i], soldiers_hp[i]) for i in range(len(soldiers_hp))]
# Attack with the most powerful sol... | {
"content_hash": "a53f20f0c20907157c21af75ba96325e",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 83,
"avg_line_length": 43.851063829787236,
"alnum_prop": 0.62882096069869,
"repo_name": "zubie7a/Algorithms",
"id": "3e1ac18210c46af8cefdbf955b3ece9749969ff6",
"size": "213... |
"""API test module."""
#
# (C) Pywikibot team, 2007-2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
import datetime
import types
import pywikibot.data.api as api
import pywikibot.family
import pywikibot.login
import pywikibot.pa... | {
"content_hash": "a6dd54812f0a6e97ad1495e9fecaa919",
"timestamp": "",
"source": "github",
"line_count": 1032,
"max_line_length": 94,
"avg_line_length": 37.87112403100775,
"alnum_prop": 0.584397308292608,
"repo_name": "h4ck3rm1k3/pywikibot-core",
"id": "3e3e61a0b873ca4b868279eda88feba95c52914b",
"si... |
""" Models for computing good tick locations on different kinds
of plots.
"""
from __future__ import absolute_import
from ..plot_object import PlotObject
from ..properties import abstract
from ..properties import Int, Float, Seq, Instance
@abstract
class Ticker(PlotObject):
""" A base class for all ticker types.... | {
"content_hash": "4e2436a0f147d63122743da008e1f5be",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 74,
"avg_line_length": 25.615384615384617,
"alnum_prop": 0.6562926562926563,
"repo_name": "gpfreitas/bokeh",
"id": "6818b1771cee6d0efba463a134489a2dda02c178",
"size": "366... |
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('Dog', fido.__class__.__name__)
def test_class... | {
"content_hash": "64ac6991ee51b0745322f161a7128c83",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 79,
"avg_line_length": 31.038709677419355,
"alnum_prop": 0.5364789025150696,
"repo_name": "topliceanu/learn",
"id": "2d2a473efa44006a83cdde4b6a896392a34a16e7",
"size": "48... |
from flask_sqlalchemy import SQLAlchemy
from application import app, db, SECRET_KEY
from sqlalchemy.sql import func
import bcrypt
import jwt
from datetime import datetime, timedelta
class User(db.Model):
""" Creates users on the system """
__tablename__ = "users"
id = db.Column(db.Integer, primary_key=T... | {
"content_hash": "4411a38056504ea20eb06e24b89f617f",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 82,
"avg_line_length": 31.397959183673468,
"alnum_prop": 0.6243093922651933,
"repo_name": "bmwachajr/bucketlist",
"id": "64dca552c105c53c5f52b97cef1a7bbcbe8b84ad",
"size": ... |
"""
This file basically contains viewsets for the courseware API
Category API:
- List, Create, Update, Retrieve, Destroy, Partial Update Category
- Get all courses in a category
- Add a course in that category
Course API:
- Retrieve, Update, Partial Update, Destroy info of a course
- Retrieve, Upd... | {
"content_hash": "5d94888f7a16d9aa30a0e330525e749e",
"timestamp": "",
"source": "github",
"line_count": 498,
"max_line_length": 251,
"avg_line_length": 37.75100401606426,
"alnum_prop": 0.6154255319148936,
"repo_name": "kartikshah1/Test",
"id": "f3825ac7f412bc30934e570b8874c862d446065d",
"size": "18... |
import tkinter as tk
from time import sleep
from playsound import playsound
import config
import fasttick
from helpmessage import fasttick_help_message
import misc
from tickerwindow import TickerWindow
class GUIfasttick(TickerWindow):
def __init__(self, app):
super().__init__(app)
misc.delete_anci... | {
"content_hash": "43b5e2be82cab3faa6eff985dde5f0da",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 87,
"avg_line_length": 36.93103448275862,
"alnum_prop": 0.599128540305011,
"repo_name": "JevinJ/Bittrex-Notify",
"id": "a7b178488e1bd5423d91d96fd5e4350b6f445f15",
"size": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.