text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import unicode_literals
from indico.core.db import db
from indico.util.string import format_repr, return_ascii
class MapArea(db.Model):
__tablename__ = 'map_areas'
__table_args__ = (db.Index(None, 'is_default', unique=True, postgresql_where=db.text('is_default')),
{'sche... | {
"content_hash": "73a04e42a3d18a539fc03c674e142db9",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 104,
"avg_line_length": 23.386363636363637,
"alnum_prop": 0.5685131195335277,
"repo_name": "mic4ael/indico",
"id": "f672300fdc7199479c4e8df40f6f7108a7516572",
"size": "1243... |
class Student(object):
_slots_ = ('name', 'age')
class GraduateStudent(Student):
pass
s = Student()
s.name = 'Michael'
s.age = 15
try:
s.score = 88
except AttributeError as e:
print('AttributeError:', e)
g = GraduateStudent()
g.score = 99
print(g.score)
| {
"content_hash": "f849c39f9d7469a725f5b97362104468",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 31,
"avg_line_length": 14.473684210526315,
"alnum_prop": 0.64,
"repo_name": "wuchengang/PythonLearing",
"id": "ef36129ae7c296f393e6a999894bf058a94b8aeb",
"size": "323",
"... |
"""Tests for the fake storage."""
from __future__ import unicode_literals
import unittest
from plaso.containers import event_sources
from plaso.containers import reports
from plaso.containers import sessions
from plaso.containers import tasks
from plaso.containers import warnings
from plaso.lib import definitions
fr... | {
"content_hash": "009de7cf127a05391d3cd80dc3e5cac5",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 80,
"avg_line_length": 29.24334600760456,
"alnum_prop": 0.725003250552594,
"repo_name": "rgayon/plaso",
"id": "fa1f49d84a1992ff73bf2e920844944f125a07bd",
"size": "7738",
... |
import canmatrix.formats
import sys
import optparse
# command line options...
usage = """
%prog [options] matrix
matrixX can be any of *.dbc|*.dbf|*.kcd|*.arxml
"""
parser = optparse.OptionParser(usage=usage)
parser.add_option(
"-f", "--frames",
dest="frames",
help="encode list of frames",
default="... | {
"content_hash": "8f369878cbe19d63fdeb6a7458fbf75b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 100,
"avg_line_length": 28.253521126760564,
"alnum_prop": 0.6470588235294118,
"repo_name": "altendky/canmatrix",
"id": "1e36f64b8e530e1a406788709063cb4fadacf675",
"size": "... |
def parimad_katsed(sonastik):
tagastatav=set()
for nimi in sonastik:
tagastatav.add((nimi, max(sonastik[nimi])))
return tagastatav
sisend=input("Sisesta failinimi: ")
tulemused={}
f=open(sisend, encoding="utf-8")
while True:
nimi=f.readline().strip()
if nimi=="":
break
... | {
"content_hash": "ca5357a42be6d17bce358623b7ce61c0",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 59,
"avg_line_length": 23.21875,
"alnum_prop": 0.6258411843876177,
"repo_name": "macobo/python-grader",
"id": "2703d2f488e46493f1cbf3b8891df5e8f3bff4c0",
"size": "743",
"... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('EOSS', '0016_engineercontext_measurement_parameter'),
]
operations = [
migrations.AddField(
model_name='eosscontext',
name='cluster_... | {
"content_hash": "c9ed334106e03b96902fee4f7759826d",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 119,
"avg_line_length": 35.74193548387097,
"alnum_prop": 0.5577617328519856,
"repo_name": "seakers/daphne_brain",
"id": "c617b797c51dbb175f62b7572b00114855b8bf12",
"size":... |
from __future__ import unicode_literals
import re
__all__ = ('JsMinifier', 'minify')
PLACEHOLDER = '~{{[({0})]}}~'
COMMENTS_RE = re.compile(r'// .*?')
EMPTY_LINES_RE = re.compile(r'\n{2,}')
LEADING_SPACES_RE = re.compile(r'^ +', re.M)
MULTI_LINE_COMMENTS_RE = re.compile(r'/\*.*?\*/', re.DOTALL)
NEWLINES_RE = re.com... | {
"content_hash": "7fef7bec664394afa1bb0575504b4585",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 74,
"avg_line_length": 28.493506493506494,
"alnum_prop": 0.6107566089334548,
"repo_name": "samuelmaudo/yepes",
"id": "18fbae2d7050c2adaeb1bdbd180bbebcd3439079",
"size": "22... |
""" Utilities for authentication and authorization """
import binascii
from base64 import b64decode
# pylint: disable=E0611,W0403
from paste.httpheaders import AUTHORIZATION, WWW_AUTHENTICATE
# pylint: enable=E0611,W0403
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.httpexceptions import HTTPF... | {
"content_hash": "5b79390be054fc557b55b8a12b951111",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 85,
"avg_line_length": 35.33136094674556,
"alnum_prop": 0.6749288226427734,
"repo_name": "mathcamp/pypicloud",
"id": "0142f29091732a34b56db38ad9da08a25d4c10ca",
"size": "5... |
import os
import unittest
from rspub.pluggable.gate import ResourceGateBuilder
class TestResourceGateBuilder(unittest.TestCase):
def test_path_predicates(self):
resource_dir = os.path.expanduser("~")
builder = ResourceGateBuilder(resource_dir=resource_dir)
includes = builder.build_includ... | {
"content_hash": "6d58c66fc34a9b5755f427ba499ade89",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 82,
"avg_line_length": 29.571428571428573,
"alnum_prop": 0.6827697262479872,
"repo_name": "cegesoma/rspub-core",
"id": "f5ee9ad47f9cad4d4c5d72058e6571f214f35c9f",
"size": "... |
from __future__ import annotations
import os
from datetime import datetime
from pathlib import Path
from airflow import models
from airflow.models.baseoperator import chain
from airflow.providers.google.cloud.operators.gcs import GCSCreateBucketOperator, GCSDeleteBucketOperator
from airflow.providers.google.cloud.ope... | {
"content_hash": "8272551aeb3b8234332d2f66a7ba4e62",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 109,
"avg_line_length": 30.696,
"alnum_prop": 0.6142819911389106,
"repo_name": "apache/airflow",
"id": "73c4d701b7a143870486ae57068618e6cd9c3bd3",
"size": "4624",
"binar... |
import random
nums = []
for i in range(100):
nums.append(int((random.random())*10000)) #fills empty nums list with 100 random int's from 0-1000
count=0
while count<(len(nums)-1):
min_place=count
for i in range(count,len(nums)):
if nums[i]<nums[min_place]:
min_place=i
nums[count]... | {
"content_hash": "d8fde85845ebab3fea6ec6cc1c0804c0",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 102,
"avg_line_length": 21.68421052631579,
"alnum_prop": 0.6432038834951457,
"repo_name": "dallaspythondojo/python",
"id": "09d9c318ca543d40256519af0d891fbfe65a5aac",
"size... |
import logging
from decorator.injectdbsession import inject_db_session
from .entity import Album
from sqlalchemy.orm import lazyload
@inject_db_session()
class AlbumRepo:
logger = logging.getLogger(__name__)
def get_albums_by_name(self, album_name):
query = self._session.query(Album).options(
... | {
"content_hash": "6621c4e6bb9a69d6bc52fe83c18045e6",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 77,
"avg_line_length": 25.78787878787879,
"alnum_prop": 0.5863689776733255,
"repo_name": "rockers7414/xmusic-crawler",
"id": "90372f8c44180f7c05f1c06a2e4a8062a8a008c7",
"si... |
"""Notebook implementation of _Renderer and GUI."""
# Authors: Guillaume Favelier <guillaume.favelier@gmail.com>
#
# License: Simplified BSD
from contextlib import contextmanager, nullcontext
from distutils.version import LooseVersion
import pyvista
from IPython.display import display
from ipywidgets import (Button,... | {
"content_hash": "3fa0553406660845b0057944b19bd413",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 115,
"avg_line_length": 33.25459317585302,
"alnum_prop": 0.5996053670086819,
"repo_name": "rkmaddox/mne-python",
"id": "5eb2ae10bdc21405bfe3504fadf58987ef6f153e",
"size": ... |
import base64
import os
import re
import time
import datetime
import hashlib
import logging
import string
import StringIO
import random
import math
from google.appengine.ext import webapp
from google.appengine.api import memcache
from google.appengine.api import images
from google.appengine.ext import db
from google.a... | {
"content_hash": "de461f504032942e04ef19043fb065ad",
"timestamp": "",
"source": "github",
"line_count": 2328,
"max_line_length": 182,
"avg_line_length": 49.19115120274914,
"alnum_prop": 0.4665857470943179,
"repo_name": "woshilaowang/v2ex",
"id": "2ad687421c7f978ecf1aecd6ea7fb9d5c762b9f5",
"size": "... |
import math
from .adjacency import adj_list_with_edges
from ..ds import PriorityQueue
class Vertex:
def __init__(self, index, dist):
self.index = index
self.dist = dist
def vertex_comp(vertex1, vertex2):
return vertex1.dist < vertex2.dist
def dijkstra(vertices, source, target, weighted_edges, visual = False):
... | {
"content_hash": "93abc78daaa6af67eacc971a4258c0ec",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 90,
"avg_line_length": 27.205128205128204,
"alnum_prop": 0.6856738925541942,
"repo_name": "aryrobocode/apothecary",
"id": "2c0c70f8afc804432f4f7bb27a35b3bc65dc3bcc",
"size"... |
while True:
pass
| {
"content_hash": "c9a4451ff7c3259a28653fafe73525b3",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 11,
"avg_line_length": 10.5,
"alnum_prop": 0.6190476190476191,
"repo_name": "kadashu/satori",
"id": "52492121bddc23c51f323a20bc9f67c8bcfcd9b4",
"size": "40",
"binary": fal... |
'''
Metadata driver for Digital Globe imagery
B{Format specification}:
- U{http://www.digitalglobe.com/downloads/Imagery_Support_Data_Documentation.pdf}
'''
format_regex=[r'-[0-9]*_[0-9]{2,2}_[A-Z][0-9]{3,3}.*\.imd$',
r'-[0-9]*_[0-9]{2,2}_[A-Z][0-9]{3,3}.*\.tif$',
r'-[0-9]*_... | {
"content_hash": "0d7027fa2f81529ec96229dbbfa25aac",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 223,
"avg_line_length": 49.37777777777778,
"alnum_prop": 0.5597809780978098,
"repo_name": "lpinner/metageta",
"id": "fc1905a6dca16aeb3e744ff0e4f09951dfafa75f",
"size": "14... |
from __future__ import unicode_literals
import string
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.db import models
from django.db.models.signals import pre_delete, pre_save
from django.http.request import split_domain_port
from django.utils.encoding import python_2_unicode_com... | {
"content_hash": "0654d9d5757b76a7d8235f921c1aec43",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 78,
"avg_line_length": 32.530434782608694,
"alnum_prop": 0.6209569633787757,
"repo_name": "bretlowery/snakr",
"id": "0b2996094de326dd634d1dd6a3c3c6d7da73b1bc",
"size": "37... |
import logging
import irc.client
class IRCClient(object):
def __init__(self, network, port, nickname):
self.log = logging.getLogger("irchooky")
self.network = network
self.port = int(port)
self.nickname = nickname
self.server = None
self.client = None
self.... | {
"content_hash": "7bb98ee8c56f3abea7b0f2e05438a962",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 76,
"avg_line_length": 38.86046511627907,
"alnum_prop": 0.5774985038898863,
"repo_name": "marvinpinto/irc-hooky",
"id": "e63ad19e20761bdc7b21fcbabef5c72e4f4bcd78",
"size": ... |
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).
"""
from __future__ import unicode_literals
import os
import sys
from optparse import make_option, OptionParser
import django
from django.core.exceptions import ImproperlyConfigured
... | {
"content_hash": "b4eaa54981be9fc720c6f57bbcc7adb9",
"timestamp": "",
"source": "github",
"line_count": 428,
"max_line_length": 177,
"avg_line_length": 38.52570093457944,
"alnum_prop": 0.625265328400752,
"repo_name": "rogerhu/django",
"id": "ef967d021fd153daa829f08b0ecb716170ff08ca",
"size": "16489... |
from pony.orm import *
db = Database()
class Profile(db.Entity):
username = PrimaryKey(str, 16)
status = Required(str, 10)
firstName = Optional(unicode, 160)
lastName = Optional(unicode, 160)
mean = Optional(float)
requirements = Optional(Json)
classrooms = Set('Classroom')
topicmean... | {
"content_hash": "4476a1c26ad2033eadcc619da95b264b",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 61,
"avg_line_length": 23.415584415584416,
"alnum_prop": 0.6688851913477537,
"repo_name": "yamath/xprym",
"id": "f00e3bc1a4b26bdcfb1899dfab71d486b9de6947",
"size": "1803",
... |
import gtk
import gio
import odml
import odml.terminology as terminology
import odml.format as format
import commands
from TreeView import TerminologyPopupTreeView
from treemodel import PropertyModel
from DragProvider import DragProvider
from ChooserDialog import ChooserDialog
import TextEditor
COL_KEY = 0
COL_VALUE ... | {
"content_hash": "463d4ab68054dc282868768eea9f8dca",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 186,
"avg_line_length": 35.31395348837209,
"alnum_prop": 0.5784491274283833,
"repo_name": "stoewer/python-odml",
"id": "7668e757f9283d3abc959f2bda8ed720860e9043",
"size": ... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 0, transform = "RelativeDifference", sigma = 0.0, exog_count = 20, ar_order = 0); | {
"content_hash": "d36ebbb18cd7c00e0803633f130ece67",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 176,
"avg_line_length": 39.42857142857143,
"alnum_prop": 0.717391304347826,
"repo_name": "antoinecarme/pyaf",
"id": "b45fa366221438da15124ce1d5da6cb0f5c47949",
"size": "276"... |
"""Module implementing the job queue handling.
Locking: there's a single, large lock in the L{JobQueue} class. It's
used by all other classes in this module.
@var JOBQUEUE_THREADS: the number of worker threads we start for
processing jobs
"""
import logging
import errno
import time
import weakref
import threadi... | {
"content_hash": "6f1cec181137b799ec066a345fca2921",
"timestamp": "",
"source": "github",
"line_count": 2146,
"max_line_length": 80,
"avg_line_length": 30.088536812674743,
"alnum_prop": 0.6388725414279077,
"repo_name": "dimara/ganeti",
"id": "2b90d00d018db1af7e74c3264516d050eb149b63",
"size": "6595... |
"""
Simple peformance tests.
"""
import sys
import time
import couchdb
def main():
print 'sys.version : %r' % (sys.version,)
print 'sys.platform : %r' % (sys.platform,)
tests = [create_doc, create_bulk_docs]
if len(sys.argv) > 1:
tests = [test for test in tests if test.__name__ in sys.argv... | {
"content_hash": "55a77b3bc4416f02ab1b9f0a2ec9f185",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 86,
"avg_line_length": 24.033333333333335,
"alnum_prop": 0.5471567267683772,
"repo_name": "kxepal/couchdb-python",
"id": "bac2af7d5d3aeaaf57e970b53b46df3e5e828750",
"size":... |
import datetime
import unittest
from pamqp import decode, encode
class EncodeDecodeTests(unittest.TestCase):
def test_encode_decode_field_table_long_keys(self):
"""Encoding and decoding a field_table with too long keys."""
# second key is 126 A's + \N{PILE OF POO}
data = {'A' * 256: 1,
... | {
"content_hash": "f575fed891814ae16bf5f9e6ebadf852",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 76,
"avg_line_length": 37.541666666666664,
"alnum_prop": 0.6315205327413984,
"repo_name": "gmr/pamqp",
"id": "a8d4bbd74bd163782f51e4c10c9733f4a5310746",
"size": "927",
"b... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import * # noqa
import os
import logging
import ycm_core
from collections import def... | {
"content_hash": "bb1dec61babe9ce8f02793e726f4eacf",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 80,
"avg_line_length": 32.92173913043478,
"alnum_prop": 0.6835710512414157,
"repo_name": "rfguri/vimfiles",
"id": "742a3be60001a2554eb666ce5db6a9412fff8673",
"size": "8255... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import IntegrityError, models, transaction
class Migration(DataMigration):
def forwards(self, orm):
db.commit_transaction()
try:
self._forwards(orm)
exce... | {
"content_hash": "b3fa46eedb5729a93e420fd1558c6ce4",
"timestamp": "",
"source": "github",
"line_count": 2757,
"max_line_length": 97,
"avg_line_length": 36.95538628944505,
"alnum_prop": 0.39922069764246315,
"repo_name": "mvaled/sentry",
"id": "8c48d7c2006499ad831bacd38c6b94705533f308",
"size": "1019... |
from __future__ import division
from __future__ import unicode_literals
import numpy as np
from rdkit import Chem
from deepchem.feat import Featurizer
from deepchem.feat.mol_graphs import ConvMol, WeaveMol
def one_of_k_encoding(x, allowable_set):
if x not in allowable_set:
raise Exception("input {0} not in al... | {
"content_hash": "7ff251688723a32931b1de46cdba5e29",
"timestamp": "",
"source": "github",
"line_count": 413,
"max_line_length": 89,
"avg_line_length": 31.818401937046005,
"alnum_prop": 0.600867513887832,
"repo_name": "Agent007/deepchem",
"id": "06510f6c556ab1684777179b3b67526c1eed5271",
"size": "13... |
"""
test_product
Tests Product
"""
import sys
import os
from decimal import Decimal
DIR = os.path.abspath(os.path.normpath(
os.path.join(
__file__,
'..', '..', '..', '..', '..', 'trytond'
)
))
if os.path.isdir(DIR):
sys.path.insert(0, os.path.dirname(DIR))
import unittest
import t... | {
"content_hash": "423f55a6f71a4f55d472c4f07b7de657",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 71,
"avg_line_length": 29.81,
"alnum_prop": 0.5182824555518283,
"repo_name": "priyankarani/trytond-amazon-mws",
"id": "7e080fd15d89c97698f8f768d5622d202904966c",
"size": "... |
from msrest.service_client import ServiceClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from .operations.paths import Paths
from . import models
class AutoRestParameterizedHostTestClientConfiguration(Configuration):
"""Configuration for AutoRestParameterizedHostTest... | {
"content_hash": "3fdd89493373080226208200c92383df",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 98,
"avg_line_length": 33.57377049180328,
"alnum_prop": 0.69580078125,
"repo_name": "xingwu1/autorest",
"id": "14b292dfa6387815734b656fbef930e2f1637eba",
"size": "2522",
... |
import discord
import src.CommandProcessor as CP
import src.permission as perm
import src.Utilities as utilis
from config.auth import User
import src.Database as database
class Bot:
# Define Bot Init to the use of self.
def __init__(self):
# self.commands = dir to commands
# self.prefix = dir ... | {
"content_hash": "39e77a1ff0710660eed98d6432d8f9f0",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 55,
"avg_line_length": 28.313725490196077,
"alnum_prop": 0.574792243767313,
"repo_name": "KvasirSGDevelopment/Aurora",
"id": "783560746e9fe380f3c15b01bc740c8b0f1bc426",
"si... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.'))
# make sure we are documen... | {
"content_hash": "d6c81dfd87f45edb591dda7feeef7e9d",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 80,
"avg_line_length": 32.43629343629344,
"alnum_prop": 0.7013450779669087,
"repo_name": "mcfletch/django-assets",
"id": "d0bf13d3ae10808ed6cfa6feb4dc6997eb0e5124",
"size"... |
import datetime
from cStringIO import StringIO
from csvkit import CSVKitReader, CSVKitWriter
from csvkit import sniffer
from csvkit import typeinference
from csvkit.cli import parse_column_identifiers
class InvalidType(object):
"""
Dummy object type for Column initialization, since None is being used as a val... | {
"content_hash": "9e920749aa7898633fd6b8577fd56676",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 146,
"avg_line_length": 29.584313725490198,
"alnum_prop": 0.5597826086956522,
"repo_name": "jsvine/csvkit",
"id": "143b3169b25659932151782cb6dbb2498fc439f7",
"size": "7567... |
from django import forms
from teachers.models import *
# from baseapp.models import *
class Teacher_detailform(forms.ModelForm):
class Meta:
model = Teacher_detail
exclude = ('count','transfer_flag','ofs_flag','ofs_reason','ofs_date','super_annum_flag')
class Teacher_outofserviceform(forms.ModelFo... | {
"content_hash": "eaffefc9fa230ad0039c445a1ae27832",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 97,
"avg_line_length": 27.11042944785276,
"alnum_prop": 0.6605566870332654,
"repo_name": "mravikumar281/staging-server",
"id": "eb6eebca413e50c245d84af17ea254ee106334fb",
... |
import queue
import unittest
from contextlib import contextmanager, ExitStack
from unittest.mock import patch
import pytest
from coalib.bearlib.abstractions.LinterClass import LinterClass
from coalib.testing.BearTestHelper import generate_skip_decorator
from coalib.bears.LocalBear import LocalBear
from coala_utils.Co... | {
"content_hash": "d43da1c17714817571e140a9b3ba88f1",
"timestamp": "",
"source": "github",
"line_count": 346,
"max_line_length": 79,
"avg_line_length": 45.283236994219656,
"alnum_prop": 0.4951493489915752,
"repo_name": "IPMITMO/statan",
"id": "958c450c393c5489b16ee0eb513d2485e94c3a62",
"size": "1566... |
__version__ = "0.0.1"
from .interact import StaticInteract
from .widgets import RadioWidget, RangeWidget, DropDownWidget
| {
"content_hash": "4842593e9b49d40fd71fa8be3bfaf0f2",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 61,
"avg_line_length": 30.5,
"alnum_prop": 0.7786885245901639,
"repo_name": "jakevdp/ipywidgets-static",
"id": "eebe2cc357b75e4d1564479138951b80ab9210ae",
"size": "122",
"... |
import hashlib
import os
from eventlet import tpool
import walkdir
from .bep import protocol
from .bep import messages
NOTHING_SHA = hashlib.sha256().digest()
def _hash_file(stream):
blocks = []
add_block = blocks.append
offset = 0
data = stream.read(protocol.BLOCK_SIZE)
while data:
... | {
"content_hash": "8bf45c1abb6cd3f593b4965e81905f55",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 73,
"avg_line_length": 22.176470588235293,
"alnum_prop": 0.614500442086649,
"repo_name": "jkoelker/syncthang",
"id": "e348734f3e0cb3916341e0db415608c2d034e48d",
"size": "11... |
''' Given a valgrind XML file, parses errors and uniques them.'''
import gdb_helper
from collections import defaultdict
import hashlib
import logging
import optparse
import os
import re
import subprocess
import sys
import time
from xml.dom.minidom import parse
from xml.parsers.expat import ExpatError
import common
... | {
"content_hash": "ee4f434382ed15e39dfd233876929252",
"timestamp": "",
"source": "github",
"line_count": 633,
"max_line_length": 137,
"avg_line_length": 35.88309636650869,
"alnum_prop": 0.597913181297878,
"repo_name": "wangcy6/storm_app",
"id": "80e85eb4ab1d4d94c2087d2fa366c5f2fa5987a5",
"size": "23... |
import requests
from allauth.socialaccount import providers
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import LinkedInOAu... | {
"content_hash": "6900938ab66d0add347e5505335c58dc",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 134,
"avg_line_length": 46.6875,
"alnum_prop": 0.6680053547523427,
"repo_name": "agconti/njode",
"id": "b06996e443f8c56acf8f24f030443bfcef220224",
"size": "1494",
"binary... |
import httplib
import k.stdlib.urllib2.urlopen_error_message
import logging
import mock
import socket
import unittest
import urllib2
from StringIO import StringIO
from k.stdlib.urllib2 import urlopen
class UrlopenTests(unittest.TestCase):
def setUp(self):
self.response_text = """<!doctype html>
<html>
<head><title... | {
"content_hash": "587908e446792109da2779f3c3e8fc3b",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 93,
"avg_line_length": 32.097674418604655,
"alnum_prop": 0.6826546877264165,
"repo_name": "Knewton/k.stdlib",
"id": "aba40a4c2d560b63303a239cc4cff2958138b337",
"size": "69... |
import torch
import numpy as np
path = './checkpoints/linknet/model_best.pth.tar'
c = torch.load(path)
print c.keys()
print c['state_dict']
| {
"content_hash": "d46edca4f261ab34e31fcb8fdeef3637",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 49,
"avg_line_length": 17.75,
"alnum_prop": 0.7183098591549296,
"repo_name": "hzh8311/project",
"id": "cb48a11785363d880718eadba4812956db98132d",
"size": "142",
"binary": ... |
"""
The tests exercise the casting machinery in a more low-level manner.
The reason is mostly to test a new implementation of the casting machinery.
Unlike most tests in NumPy, these are closer to unit-tests rather
than integration tests.
"""
import pytest
import textwrap
import enum
import itertools
import random
i... | {
"content_hash": "2877ec12188e128e6c2a1f52f1b61170",
"timestamp": "",
"source": "github",
"line_count": 707,
"max_line_length": 84,
"avg_line_length": 41.25176803394625,
"alnum_prop": 0.546922681296074,
"repo_name": "simongibbons/numpy",
"id": "d41d6dcc0541e7d1e1ee7d6619771c5fbaf64f37",
"size": "29... |
"""
Global settings used through clifford.
"""
# private names for internal use within clifford
_eps = 1e-12 # float epsilon for float comparisons
_pretty = True # pretty-print global
_print_precision = 5 # pretty printing precision on floats
# public accessor functions to get and set the set... | {
"content_hash": "09a931cbeba7e1a1741215d9959d27c5",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 19.98507462686567,
"alnum_prop": 0.6131441374159821,
"repo_name": "arsenovic/clifford",
"id": "0196078d111ad745cf1af113a5dfdbe98f95437e",
"size": "13... |
import os
from setuptools import setup, find_packages
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
version = '0.1.0'
long_description = (read('../../readme.rst'))
setup(name='nexiles.gateway.example',
version=version,
description="A example nexiles|gateway... | {
"content_hash": "ef6873e633ee22e5c8f9718fede87055",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 73,
"avg_line_length": 31.941176470588236,
"alnum_prop": 0.5994475138121547,
"repo_name": "nexiles/nexiles.gateway.example",
"id": "d31c2208079401a60d27bba931566d264fd52057",... |
from JumpScale import j
# import JSModel
import time
# from abc import ABCMeta, abstractmethod
import collections
import msgpack
import snappy
import re
# IMPORTANT: had to remove class for manipulating kvs object, class was more clear but 2 issues
# - this needs to be converted to a functional C module which can b... | {
"content_hash": "2228445d1d4329ba0251a546287ac174",
"timestamp": "",
"source": "github",
"line_count": 686,
"max_line_length": 132,
"avg_line_length": 35.36880466472303,
"alnum_prop": 0.5494786300127766,
"repo_name": "Jumpscale/jumpscale_core8",
"id": "9b85c0979d558536dfda5e1e960544599962c414",
"s... |
import MySQLdb
class Connetion():
def __init__(self):
pass
def get_connetction(self):
return MySQLdb.connect(host="localhost", user="root", passwd="123", db="graduation",
use_unicode=True, charset="utf8")
| {
"content_hash": "eff5760ecdb222dda9ba9dfe2ef9d91d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 92,
"avg_line_length": 26.3,
"alnum_prop": 0.5703422053231939,
"repo_name": "zhangsh950618/graduation",
"id": "c12840e962c5ef17c724832e3fcb5133250c0623",
"size": "288",
"... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("zerver", "0264_migrate_is_announcement_only"),
]
operations = [
migrations.RemoveField(
model_name="stream",
name="is_announcement_only",
),
]
| {
"content_hash": "5b65636d4e20758fc8ee975bbe527433",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 56,
"avg_line_length": 20.133333333333333,
"alnum_prop": 0.5827814569536424,
"repo_name": "punchagan/zulip",
"id": "1eec63286bb469644c1c4a1989b822686e308b44",
"size": "353"... |
"""Helper methods for running Tensorboard from the client."""
from typing import Any, Mapping, Optional
from xmanager import xm
class TensorboardProvider:
"""A class to generate package and job/args to Tensorboard jobs."""
DEFAULT_TENSORBOARD_PORT = 6006
@staticmethod
def get_tensorboard_packageable(timeou... | {
"content_hash": "0cd9f2fb38652cecb39460bdb26acc0c",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 86,
"avg_line_length": 32.08536585365854,
"alnum_prop": 0.6731280881793995,
"repo_name": "deepmind/xmanager",
"id": "973de15db1433e0d06bd57abb871dfe972827886",
"size": "322... |
from nose import tools
from datetime import date
import model_helpers
from django.conf import settings
# Specify a filename template that make use of all capabilities of upload_to template
settings.UPLOAD_TO_OPTIONS = {"file_name_template": "{model_name}/%Y/{filename}-{instance.pk}.{extension}"}
class FakeModel(obje... | {
"content_hash": "cf2e93bbd633efaa535e5dfdb411370f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 108,
"avg_line_length": 40.84375,
"alnum_prop": 0.7084927314460597,
"repo_name": "rewardz/django_model_helpers",
"id": "9a59af56ad2efe41de5d834fd157ace67c944897",
"size": "... |
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:55903")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60) | {
"content_hash": "c502e57edb9e898c24f9ae182f3ad300",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 47,
"avg_line_length": 39.5,
"alnum_prop": 0.7658227848101266,
"repo_name": "grumpycoin/grumpycoin-v.1.2",
"id": "8cf711cdd585efbca62c2174c87613c21fd08b21",
"size": "158",
... |
import mock
from oslo_utils import timeutils
from oslo_versionedobjects import exception as ovo_exc
from nova.compute import manager as compute_manager
from nova import db
from nova import exception
from nova import objects
from nova.objects import aggregate
from nova.objects import service
from nova import test
from ... | {
"content_hash": "8898b958c753c3b6949ab170b19924e0",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 79,
"avg_line_length": 42.34231805929919,
"alnum_prop": 0.592844866000382,
"repo_name": "raildo/nova",
"id": "9dacdb5358646f3cd9938c894483fc45df5b5687",
"size": "16314",
... |
import datetime
import mock
from os_win import constants as os_win_const
from oslo_config import cfg
from oslo_serialization import jsonutils
from oslo_utils import units
from jacket.tests.compute.unit.virt.hyperv import test_base
from jacket.compute.virt.hyperv import constants
from jacket.compute.virt.hyperv import... | {
"content_hash": "27199982d848f0de40785843aab5aa57",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 79,
"avg_line_length": 44.285714285714285,
"alnum_prop": 0.5896505376344086,
"repo_name": "HybridF5/jacket",
"id": "58b75d17a880f59c56a0543c2517840ece1314c1",
"size": "807... |
""" Testing sphinxext module
"""
import os
from os.path import abspath, dirname, join as pjoin
import sys
from subprocess import check_call
_my_path = abspath(dirname(__file__))
doc_path = pjoin(_my_path, 'doc')
# path to custom style
sys.path.insert(0, _my_path)
from .. import bibref as bs
from nose.tools import ... | {
"content_hash": "bbadbfa816d740f7a2a4b406a393dc2e",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 75,
"avg_line_length": 29.977272727272727,
"alnum_prop": 0.6345716451857468,
"repo_name": "matthew-brett/bibstuff",
"id": "3b9dcef107be7f77f95bc0b6c2780bee3af1175a",
"size"... |
import pytest
def test_all_have_star_name(SCdata):
# Test every entry has a "Star" name
df, _ = SCdata
assert not df.Star.isnull().values.any()
def test_all_have_link(SCdata):
# Test each entry has an associated author/paper.
df, _ = SCdata
null_links = df.link.isnull()
# printing is for... | {
"content_hash": "70b2092a8757e52396ed7257099e7617",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 74,
"avg_line_length": 32.04545454545455,
"alnum_prop": 0.6872340425531915,
"repo_name": "DanielAndreasen/SWEETer-Cat",
"id": "e019550048ba4464719a6a190304b8776345d1e5",
"s... |
from __future__ import unicode_literals
import base64
import datetime
import mimetypes
import six
from parse_rest.connection import API_ROOT, ParseBase
from parse_rest.query import QueryManager
from parse_rest.core import ParseError
def complex_type(name=None):
'''Decorator for registering complex types'''
... | {
"content_hash": "37b53ba7406ea880cf06d02d6e452b4e",
"timestamp": "",
"source": "github",
"line_count": 625,
"max_line_length": 135,
"avg_line_length": 32.2432,
"alnum_prop": 0.5721020246129417,
"repo_name": "alacroix/ParsePy",
"id": "46de98aa31355f38ce02e90ce782363828d050e5",
"size": "20816",
"b... |
"""
:mod:`nova` -- Cloud IaaS Platform
===================================
.. automodule:: nova
:platform: Unix
:synopsis: Infrastructure-as-a-Service Cloud platform.
.. moduleauthor:: Jesse Andrews <jesse@ansolabs.com>
.. moduleauthor:: Devin Carlen <devin.carlen@gmail.com>
.. moduleauthor:: Vishvananda Ishaya ... | {
"content_hash": "5af0f6578ce1451484a077522e47c8c6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 60,
"avg_line_length": 29.157894736842106,
"alnum_prop": 0.6823104693140795,
"repo_name": "KarimAllah/nova",
"id": "f2e9684d3033f7136430a69f44b7bda768ff6b00",
"size": "1331... |
"""Provides access to the extensions of a program."""
import importlib
import tensorflow as tf
import vesper.birdvox.detectors as birdvox_detectors
import vesper.util.yaml_utils as yaml_utils
# Note that even though the `ExtensionManager` class is typically used as a
# singleton, we make it a class rather than a ... | {
"content_hash": "1a970737652b919c0e2e1f86881c5320",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 126,
"avg_line_length": 44.337704918032784,
"alnum_prop": 0.7355616357317163,
"repo_name": "HaroldMills/Vesper",
"id": "39be4a71569f4a8377d504901ca427c29699377e",
"size": ... |
"""Collection for Entrez gene records
given an entrez gene id
most data fetched from ncbi entrez gene"""
import requests
import time
from snovault import (
collection,
load_schema,
calculated_property
)
from snovault.validators import (
validate_item_content_post,
validate_item_content_patch... | {
"content_hash": "d73ff7b6d11af8f5a4025e506735d9d8",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 121,
"avg_line_length": 31.91111111111111,
"alnum_prop": 0.5807799442896936,
"repo_name": "hms-dbmi/fourfront",
"id": "4534d6d4a3754e77a99ad84742dac1d917e5c162",
"size": "... |
from __future__ import absolute_import
from django.conf import settings
from django.conf.urls import url
from wagtail.wagtailimages.views.serve import ServeView
from .api import router
from .views import image
urlpatterns = [
url(r'^api/v1/', router.urls),
url('^images/(?P<pk>\d+)/(?P<specs>.+)$', image, nam... | {
"content_hash": "fe7b236c274307bdad9719fda90b04f3",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 98,
"avg_line_length": 31.52173913043478,
"alnum_prop": 0.6537931034482759,
"repo_name": "apihackers/wapps",
"id": "54d04219acfd062a8fdd702d83fb5c85a241d38f",
"size": "725"... |
"""Polish-specific form helpers."""
import datetime
import re
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import gettext_lazy as _
from .pl_administrativeunits import ADMINISTRATIVE_UNIT_CHOICES
from .pl_voivodeships import VOIVODESHIP_CHO... | {
"content_hash": "d03d40d5f6b860a202817d44f066b58f",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 113,
"avg_line_length": 32.531120331950206,
"alnum_prop": 0.5644132653061225,
"repo_name": "rsalmaso/django-localflavor",
"id": "8dd86919573cf8dbb76361096794074d7ec4be19",
... |
from runner.koan import *
class AboutLists(Koan):
def test_creating_lists(self):
empty_list = list()
self.assertEqual(list, type(empty_list))
self.assertEqual(0, len(empty_list))
def test_list_literals(self):
nums = list()
self.assertEqual([], nums)
nu... | {
"content_hash": "c4f0dcb2ffcaa0bb237845c95930c651",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 79,
"avg_line_length": 33.45454545454545,
"alnum_prop": 0.5410628019323671,
"repo_name": "jrumball/PyKoans",
"id": "37abdabb3bb2bc112123346cabb3401b5549ad5e",
"size": "3405... |
import logging
import zlib
import io
from .exceptions import DecodeError
from .packages.six import string_types as basestring, binary_type
from .util import is_fp_closed
log = logging.getLogger(__name__)
class DeflateDecoder(object):
def __init__(self):
self._first_try = True
self._data = bina... | {
"content_hash": "1864b9bfcda46b7674a30ce03ab2b0fb",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 89,
"avg_line_length": 33.80068728522337,
"alnum_prop": 0.574013826758845,
"repo_name": "slashk/prowl.alfredworkflow",
"id": "74a5156c4382187aa39680c714ab963491f20ca6",
"s... |
import ctypes
from sheep.shepherd import Shepherd
class Cons(Shepherd):
def do_work(self):
print "trying to be nasty"
ctypes.string_at(1)
if __name__ == "__main__":
Cons.run()
| {
"content_hash": "665b840d68d8c3a2e57b96eefe0f1f06",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 35,
"avg_line_length": 17,
"alnum_prop": 0.6127450980392157,
"repo_name": "heynemann/sheep",
"id": "bc442f4607559b92a8cf7f9240e9d05c159d2c00",
"size": "251",
"binary": fa... |
"""An RFC-4217 asynchronous FTPS server supporting both SSL and TLS.
Requires PyOpenSSL module (http://pypi.python.org/pypi/pyOpenSSL).
"""
import os
from pyftpdlib import ftpserver
from pyftpdlib.contrib.handlers import TLS_FTPHandler
CERTFILE = os.path.abspath(os.path.join(os.path.dirname(__file__),
... | {
"content_hash": "b543b95f7bb4d180eb1808084a874b04",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 68,
"avg_line_length": 31.678571428571427,
"alnum_prop": 0.6696730552423901,
"repo_name": "Teamxrtc/webrtc-streaming-node",
"id": "71ed8205833367608d0914157c780114407b6458",
... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 30, transform = "None", sigma = 0.0, exog_count = 0, ar_order = 0); | {
"content_hash": "33a54b670e8d8d85dfec60b3f6a224eb",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 158,
"avg_line_length": 36.857142857142854,
"alnum_prop": 0.6976744186046512,
"repo_name": "antoinecarme/pyaf",
"id": "48801f0d2032420a8adfd7266a7868cee5303896",
"size": "25... |
class _Namespace:
def __init__(self):
self._scope = 0
self._space = {self._scope: {}}
def add_name(self, name, value):
self._space[self._scope][name] = value
def del_name(self, name):
del self._space[self._scope][name]
def add_scope(self):
self._scope += 1
... | {
"content_hash": "cf647f59c7cc29a430a0faadf9ed0e4e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 49,
"avg_line_length": 22.17948717948718,
"alnum_prop": 0.5479768786127167,
"repo_name": "adrian-lang/adrian.cgen",
"id": "231a7cf09b073f97be186fe85fef176ce441f851",
"size"... |
"""
Functions to generate the HTML output
"""
from jinja2 import Template
def load_template(template_file_path):
"""
Load a Jinja2 template and return it
Args:
template_file_path (str): path to the Jinja2 template file
Returns:
Template: contains jinja2 template
"""
retur... | {
"content_hash": "c120ce8a18290e818111f9425933138b",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 85,
"avg_line_length": 23.032258064516128,
"alnum_prop": 0.6666666666666666,
"repo_name": "mgrijalva/nose2-html-report",
"id": "67bbc674af0185f60b08f580689ae283a61aa3c5",
"... |
from django.test import TestCase, RequestFactory
from django.test import Client
from django.core import mail
from django.utils import timezone
from django.conf import settings
from unittest.mock import patch
from freezegun import freeze_time
from studygroups.models import StudyGroup
from studygroups.models import Fac... | {
"content_hash": "49d65f1e4236840d42314dd6fb97e200",
"timestamp": "",
"source": "github",
"line_count": 1534,
"max_line_length": 126,
"avg_line_length": 40.428292046936114,
"alnum_prop": 0.5659738458809681,
"repo_name": "p2pu/learning-circles",
"id": "86d8644f9a26fb88083247dbb42c8855696688a6",
"siz... |
"""Suite Required Suite: Events that every application should support
Level 1, version 1
Generated from /Applications/Internet Explorer.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'reqd'
from StdSuites.Required_Suite import *
class Required_Suite_Events(Required_... | {
"content_hash": "767e14d9e5279456f2b6651e75fa7c32",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 72,
"avg_line_length": 30.73148148148148,
"alnum_prop": 0.600180777342573,
"repo_name": "MalloyPower/parsing-python",
"id": "0a985d123bba45f3dd16f8113174eb651226ea8d",
"si... |
#
class _DefaultsStandalone(object):
"""Do not use this class outside of this module."""
SPAWN_CLIENT_DAEMON = False
SPAWN_SERVER_DAEMON = False
SERVER_IPC_PORT = 54321
CLIENT_IPC_PORT = 12345
SERVER_ADDRESS = "127.0.0.1"
SERVER_COAP_PORT = 5683
CLIENT_COAP_PORT = 6000
#DAEMON_P... | {
"content_hash": "55521ff46bbac091ee95f2f688da0970",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 135,
"avg_line_length": 30.30597014925373,
"alnum_prop": 0.6729869490273331,
"repo_name": "FlowM2M/AwaLWM2M",
"id": "a95a10c8e501484b29426f9d36f8a01947f024a6",
"size": "59... |
from django.db import models
from django.utils.translation import (
gettext,
gettext_lazy,
)
class Category(models.Model):
title = models.CharField(max_length=255, verbose_name=gettext('Title'))
def __str__(self):
return 'Category: {}'.format(self.title)
class Meta:
ordering = ['... | {
"content_hash": "0b4875379b6bd24b9511e8693e4323e1",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 98,
"avg_line_length": 32.170212765957444,
"alnum_prop": 0.6547619047619048,
"repo_name": "dArignac/scapegoat",
"id": "40fc07c00285050f0085e354b812a4c04d834fe8",
"size": "1... |
import sys
import unittest
from mock import MagicMock
from libcloud.test import MockHttp
from libcloud.utils.py3 import httplib
from libcloud.dns.drivers.zonomi import ZonomiDNSDriver
from libcloud.test.secrets import DNS_PARAMS_ZONOMI
from libcloud.test.file_fixtures import DNSFileFixtures
from libcloud.dns.types im... | {
"content_hash": "8a1ec3af41ec7e95e3381c3479f707a1",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 79,
"avg_line_length": 42.49307479224377,
"alnum_prop": 0.6047588005215124,
"repo_name": "ByteInternet/libcloud",
"id": "230b1caba483a52a9ce724e68cdf8b96db31cfcb",
"size":... |
import sys
import os
import traceback
from optparse import OptionParser, OptionGroup
# Path adjustment for non-dev deployments
local_libdir = os.path.realpath(os.path.dirname(os.path.realpath(__file__)) + '/../lib')
if os.path.exists(local_libdir):
sys.path.insert(0, local_libdir)
import tstracker.config.config_d... | {
"content_hash": "26296c75b8d508630a57b932a7fc3608",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 166,
"avg_line_length": 41.68604651162791,
"alnum_prop": 0.6552301255230125,
"repo_name": "terasaur/tstracker",
"id": "3c127b52712b84b9b4a59ab8f1dd544659adac2f",
"size": "4... |
import sys
import dns
import dns.exception
import dns.name
import dns.query
import dns.resolver
import re
from sentry_sdk import capture_exception
from lemur.extensions import metrics
class DNSError(Exception):
"""Base class for DNS Exceptions."""
pass
class BadDomainError(DNSError):
"""Error for when ... | {
"content_hash": "60e47515a408eadef61de985ffb2e5e1",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 100,
"avg_line_length": 28.663366336633665,
"alnum_prop": 0.6107081174438688,
"repo_name": "Netflix/lemur",
"id": "62a988b80474849431ed16060de397d0550e9c01",
"size": "2895... |
import os
from .utils import make_dir, INSTANCE_FOLDER_PATH
class BaseConfig(object):
PROJECT = 'server'
NAME = PROJECT
# Get app root path, also can use flask.root_path.
# ../../config.py
PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DEBUG = False
TESTING = False
# h... | {
"content_hash": "2dc13f0fbcf2dbe5eaf70e56fc78930a",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 83,
"avg_line_length": 22.185185185185187,
"alnum_prop": 0.6986644407345576,
"repo_name": "robinandeer/scout",
"id": "72ec75b3352b84c2b62761721bc72e751f6a86e7",
"size": "12... |
"""
`paddle.v2.layer` is a part of model config packages in paddle.v2. In API v2,
we want to make Paddle a plain Python package. The model config package defined
the way how to configure a neural network topology in Paddle Python code.
The primary usage shows below.
.. code-block:: python
import paddle.v2 as pa... | {
"content_hash": "18eb01de56786a47658491e206320304",
"timestamp": "",
"source": "github",
"line_count": 485,
"max_line_length": 86,
"avg_line_length": 33.02061855670103,
"alnum_prop": 0.5815797689665938,
"repo_name": "gangliao/Paddle",
"id": "1e4efedde363f20fde168941adcb6e8a594b533a",
"size": "1662... |
from django.core.cache.backends.dummy import DummyCache
class FakeRedisCache(DummyCache): # pragma: no cover
def __init__(self, *args, **kwargs):
DummyCache.__init__(self, *args, **kwargs)
self.setex = None
self.lrem = None
self.zadd = None
self.pipeline = None
se... | {
"content_hash": "a21cfb94e09edc1e198c0a90f037c576",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 55,
"avg_line_length": 22.94736842105263,
"alnum_prop": 0.5871559633027523,
"repo_name": "Benoss/django-cookiecutter",
"id": "5c05fac42f8f0fb38488d52f47157813cb6f2722",
"si... |
import string
template = string.Template("""
# Show what aspects might need attention
cobbler check
# Act on the 'check' above, then re-check until satisfactory.
# (Details beyond the scope of this particular example.)
# Import a client OS from a DVD. This automatically sets up a "distro" and names it.
# (See below... | {
"content_hash": "e7dec21f426da6d7bd09f8739e0b77c6",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 99,
"avg_line_length": 35.6875,
"alnum_prop": 0.7390542907180385,
"repo_name": "Juniper/contrail-provisioning",
"id": "2c776f0f10286018d4640584c00f1db8c5535e5c",
"size": "1... |
"""
Created on Sat Jan 24 15:20:47 2015
@author: rlabbe
"""
import numpy as np
import matplotlib.pyplot as plt
try:
data
except:
cols = ('time','millis','ax','ay','az','rollrate','pitchrate','yawrate',
'roll','pitch','yaw','speed','course','latitude','longitude',
'altitude','pdop','hd... | {
"content_hash": "0f8cf63f35525b19dce352b51ce42799",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 76,
"avg_line_length": 21.216216216216218,
"alnum_prop": 0.6509554140127388,
"repo_name": "zaqwes8811/micro-apps",
"id": "5353759302bd04cbb3d55a4e8c45511607638525",
"size":... |
"""try to find more bugs in the code using astroid inference capabilities
"""
import re
import shlex
import astroid
from astroid import InferenceError, NotFoundError, YES, Instance
from astroid.bases import BUILTINS
from pylint.interfaces import IAstroidChecker, INFERENCE, INFERENCE_FAILURE
from pylint.checkers impo... | {
"content_hash": "7d0fb810be93483df97fa42378206cc1",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 86,
"avg_line_length": 42.41350906095552,
"alnum_prop": 0.5573120994367838,
"repo_name": "Titulacion-Sistemas/PythonTitulacion-EV",
"id": "10b9f8669fb9353ab9e4766e5174a6ef5a... |
import collections.abc
import contextlib
import hashlib
import logging
import math
import operator
import os
import signal
import warnings
from collections import defaultdict
from datetime import datetime, timedelta
from functools import partial
from types import TracebackType
from typing import (
TYPE_CHECKING,
... | {
"content_hash": "2d02d107e49c2366409b8c95cf516ef5",
"timestamp": "",
"source": "github",
"line_count": 2600,
"max_line_length": 110,
"avg_line_length": 39.223461538461535,
"alnum_prop": 0.5925417479726616,
"repo_name": "Acehaidrey/incubator-airflow",
"id": "89503852487d009918c65f7662980325c4dbea6b",... |
import os
from distutils.version import LooseVersion # pylint: disable=E0611,E0401
from nose.plugins.attrib import attr
# project
from checks import AgentCheck
from tests.checks.common import AgentCheckTest
@attr(requires='zk')
class ZooKeeperTestCase(AgentCheckTest):
CHECK_NAME = 'zk'
CONFIG = {
'h... | {
"content_hash": "3fb9b396ba2f588f0b349dca099620d5",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 84,
"avg_line_length": 28.36231884057971,
"alnum_prop": 0.5822687787429739,
"repo_name": "itsuugo/integrations-core",
"id": "c3d05c823841d9fc05379c5fe63541cdf4b0dcac",
"si... |
from __future__ import annotations
import json
import unittest
from unittest import mock
from unittest.mock import PropertyMock
import httplib2
import pytest
from googleapiclient.errors import HttpError
from parameterized import parameterized
from airflow.exceptions import AirflowException
from airflow.models import... | {
"content_hash": "a6a64a2d44a666bccc0b5ea974921584",
"timestamp": "",
"source": "github",
"line_count": 1172,
"max_line_length": 110,
"avg_line_length": 48.02047781569966,
"alnum_prop": 0.6441719971570717,
"repo_name": "cfei18/incubator-airflow",
"id": "9e7bdaa5c79c8de25309053d95082857d6c02154",
"s... |
""" Class for representing individuals within the `lineage` framework. """
"""
MIT License
Copyright (c) 2016 Andrew Riha
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, inc... | {
"content_hash": "b0864580c67bd01f28763e430d37236c",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 95,
"avg_line_length": 34.52577319587629,
"alnum_prop": 0.6434756643774261,
"repo_name": "apriha/lineage",
"id": "102ffcf42a82b372ddee705d1f33ddc029061105",
"size": "3349",... |
from unittest import TestCase
from logentries_api.alerts import (
PagerDutyAlertConfig, WebHookAlertConfig,
EmailAlertConfig, SlackAlertConfig,
HipChatAlertConfig
)
class AlertConfigsTests(TestCase):
"""
Test each alert type
"""
def test_pagerduty(self):
"""
Test PagerDuty... | {
"content_hash": "e3e4a550e8072db4aea5fb815f882e52",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 84,
"avg_line_length": 24.649484536082475,
"alnum_prop": 0.437892095357591,
"repo_name": "ambitioninc/python-logentries-api",
"id": "6c4b319c586af232db7fb26bbe28428086bd90d9"... |
DATABASE = './database.db'
JOB_FILE = './job_configuration'
try:
# This is the path to the upload directory
app.config['UPLOAD_FOLDER'] = './uploads/'
app.config['MAX_CONTENT_LENGTH'] = 60 * 1024 * 1024
except:
pass
| {
"content_hash": "512f6c69babb718362c9b14834dce010",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 55,
"avg_line_length": 25.88888888888889,
"alnum_prop": 0.6437768240343348,
"repo_name": "DCGM/EmotionService",
"id": "ec21cc509674985de6ac0d354cd98d30fda17501",
"size": "23... |
import os
import sys
import subprocess
from os import access, getenv, X_OK
jar_file = 'hops0.33.jar'
default_jvm_mem_opts = ['-Xms1g', '-Xmx2g']
# !!! End of parameter section. No user-serviceable code below this line !!!
def real_dirname(path):
"""Return the symlink-resolved, canonicalized directory-portion of ... | {
"content_hash": "42223a0f98c781286b95ff0184388307",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 81,
"avg_line_length": 28.950617283950617,
"alnum_prop": 0.6132196162046908,
"repo_name": "Luobiny/bioconda-recipes",
"id": "fa77e3c82a73284ab0d80fa3b63015d0cf49c08c",
"siz... |
from ._models_py3 import AadAuthenticationParameters
from ._models_py3 import AddressSpace
from ._models_py3 import ApplicationGateway
from ._models_py3 import ApplicationGatewayAuthenticationCertificate
from ._models_py3 import ApplicationGatewayAutoscaleConfiguration
from ._models_py3 import ApplicationGatewayAvailab... | {
"content_hash": "6c55e1483225ace8d48452981f8dfb53",
"timestamp": "",
"source": "github",
"line_count": 1311,
"max_line_length": 105,
"avg_line_length": 44.36079328756674,
"alnum_prop": 0.8260570524614406,
"repo_name": "Azure/azure-sdk-for-python",
"id": "425b5433d9da4f1152e3b697fc84e60af9494f79",
... |
""" Sahana Eden Person Registry Model
@author: Dominic König <dominic[at]aidiq.com>
@copyright: 2009-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Softwar... | {
"content_hash": "cacc773dcea8fbf8af68d07127e6c8c8",
"timestamp": "",
"source": "github",
"line_count": 3884,
"max_line_length": 267,
"avg_line_length": 40.48043254376931,
"alnum_prop": 0.42929286504776565,
"repo_name": "flavour/cedarbluff",
"id": "e324effc6c425beda029dc64c6075158e0ec0804",
"size":... |
"""autogenerated by genpy from se306Project/PoseMsg.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import geometry_msgs.msg
import std_msgs.msg
class PoseMsg(genpy.Message):
_md5sum = "6e8ef06f4a76cd2ca058c153a18cd476"
_type = "se306Project/Pose... | {
"content_hash": "6906e2cd081fc7ab84bf3b41b8b4cf2b",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 92,
"avg_line_length": 30.593023255813954,
"alnum_prop": 0.6180159635119726,
"repo_name": "TomHulme/306-Swarm-Robotics-Project",
"id": "accc9457ea3659dfaac70c55e314ef382af42... |
import argparse
import imp
import os
import sys
import manifest
from . import vcs
from .log import get_logger
here = os.path.dirname(__file__)
wpt_root = os.path.abspath(os.path.join(here, os.pardir, os.pardir))
def update(tests_root, manifest, working_copy=False):
tree = None
if not working_copy:
... | {
"content_hash": "44c742c63b6220798a287cd085ab3d8c",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 87,
"avg_line_length": 25.705263157894738,
"alnum_prop": 0.6101556101556102,
"repo_name": "youtube/cobalt_sandbox",
"id": "0bbbefb9111c077589d2fab23c7f289f530067b9",
"size"... |
from settings import *
DEBUG = CAPTCHA_TEST_MODE = TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', '.freeward.ca']
| {
"content_hash": "42fbcdc529859d2656a426c77a79171b",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 58,
"avg_line_length": 33.5,
"alnum_prop": 0.6940298507462687,
"repo_name": "vollov/django-blog",
"id": "a99a1c41fe310827070a8c3b406bc2a0dee762e4",
"size": "134",
"binary"... |
import absl.testing
import numpy
from . import test_util
model_path = "https://tfhub.dev/sayakpaul/lite-model/east-text-detector/dr/1?lite-format=tflite"
class EastTextDetectorTest(test_util.TFLiteModelTest):
def __init__(self, *args, **kwargs):
super(EastTextDetectorTest, self).__init__(model_path, *args, **... | {
"content_hash": "edf8b6ac55c635b016bdb3999b5eef30",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 96,
"avg_line_length": 38.27272727272727,
"alnum_prop": 0.6642913697545526,
"repo_name": "google/iree",
"id": "b5d9f26470e4cce9ff3c213fe5ef94d87c08a5c6",
"size": "1481",
... |
__version__ = '0.10.2'
import logging
try:
# not available in python 2.6
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
# Add NullHandler to prevent logging warnings
logging.getLogger(__name__).addHandler(NullHandl... | {
"content_hash": "decb93d8ac196755ddd458d19143f62a",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 53,
"avg_line_length": 28.22222222222222,
"alnum_prop": 0.7979002624671916,
"repo_name": "knowsis/pika",
"id": "602b6a31e75306ee62ed662c8849171012c3dd6d",
"size": "762",
... |
"""Support for Nanoleaf Lights."""
import logging
from pynanoleaf import Nanoleaf, Unavailable
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_EFFECT,
ATTR_HS_COLOR,
ATTR_TRANSITION,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
SUPPO... | {
"content_hash": "6a8d01e0577e6a17bb16e9719c183aac",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 82,
"avg_line_length": 29.470338983050848,
"alnum_prop": 0.6018691588785047,
"repo_name": "postlund/home-assistant",
"id": "4b08d0b9751a40fd814649085954cb4349b3e145",
"siz... |
# Copyright 2014-2016 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | {
"content_hash": "b9363e7ee76b7726274b8b60921f30c3",
"timestamp": "",
"source": "github",
"line_count": 749,
"max_line_length": 94,
"avg_line_length": 35.416555407209614,
"alnum_prop": 0.6275492894032495,
"repo_name": "ros-infrastructure/ros_buildfarm",
"id": "3bf0dc81a279c7afaa6e437956fc8ba94789a9b7... |
from google.cloud import aiplatform_v1beta1
async def sample_get_artifact():
# Create a client
client = aiplatform_v1beta1.MetadataServiceAsyncClient()
# Initialize request argument(s)
request = aiplatform_v1beta1.GetArtifactRequest(
name="name_value",
)
# Make the request
respon... | {
"content_hash": "3b393b3212767e19c4e044a6046a3b00",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 81,
"avg_line_length": 26.210526315789473,
"alnum_prop": 0.7309236947791165,
"repo_name": "googleapis/python-aiplatform",
"id": "d7ac573e0b400fbb88e82ac3b2b677627aa69ffa",
... |
from __future__ import print_function
from datetime import datetime
from bs4 import BeautifulSoup
import socket
import socks
import hashlib
import magic
import os
import argparse
import sys
import threading
import logging
from logging import getLogger, StreamHandler, DEBUG
def fetch_soup(name, url):
request = urll... | {
"content_hash": "b875201be95c3f8d994290ea6e59dd5a",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 145,
"avg_line_length": 36.034013605442176,
"alnum_prop": 0.5514442137058713,
"repo_name": "ntddk/Abyss-Watcher",
"id": "9b78368393b0cd5aad902773f888b25dac1bb575",
"size":... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/item/quest_item/shared_current_motivator.iff"
result.attribute_template_id = -1
result.stfName("craft_item_ingredients_n","current_motivator")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATION... | {
"content_hash": "a2c44efe21eb9b2d17945523970f3323",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 91,
"avg_line_length": 26.46153846153846,
"alnum_prop": 0.7180232558139535,
"repo_name": "obi-two/Rebelion",
"id": "2046762b2c1a99a7a51b473c0a57e95246e055cd",
"size": "489"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.