text
stringlengths
4
1.02M
meta
dict
from setuptools import setup, find_packages import os def read_file(filename): """Read a file into a string""" path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) try: return open(filepath).read() except IOError: return '' setup( name='Swam...
{ "content_hash": "83e9b9887031c5f8062e64d0c8128286", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 87, "avg_line_length": 34.411764705882355, "alnum_prop": 0.6299145299145299, "repo_name": "mback2k/swampdragon-live", "id": "b4c8c164cfbc1e214661668417155f00682c950b", "siz...
import _plotly_utils.basevalidators class BgcolorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="bgcolorsrc", parent_name="table.hoverlabel", **kwargs ): super(BgcolorsrcValidator, self).__init__( plotly_name=plotly_name, parent...
{ "content_hash": "3158efe558defb41603acb4411f7e2b4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 80, "avg_line_length": 32.76923076923077, "alnum_prop": 0.6126760563380281, "repo_name": "plotly/plotly.py", "id": "3ad225a5a0d67409539761aab1708687a064e0a3", "size": "426"...
from time import time from unittest.mock import patch import pytest from esteid.authentication import Authenticator from esteid.authentication.types import SessionData from esteid.exceptions import EsteidError, SigningSessionDoesNotExist, SigningSessionExists @pytest.fixture() def test_session_data(): return Se...
{ "content_hash": "7d4351d7b9acc4b5c6beb4cfca7db2d4", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 107, "avg_line_length": 34.953271028037385, "alnum_prop": 0.7195187165775401, "repo_name": "thorgate/django-esteid", "id": "f0f0e94017d780f520b68eda0184a2677a227048", "siz...
"""This is a websocket chat example with many servers. A client can connect to any of the servers and their messages will be received by all clients connected to any of the servers. Run the examples like this: $ python examples/chat_bridge.py tcp://127.0.0.1:12345 tcp://127.0.0.1:12346 and the servers like this (cha...
{ "content_hash": "e0385786f95806ea790ce66d1f0f7260", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 102, "avg_line_length": 29.78125, "alnum_prop": 0.6012591815320042, "repo_name": "inercia/evy", "id": "d995c2da51927ada51b3f90072c28d4806fe30b1", "size": "3812", "binary...
"""Utility functions for classifying and solving ordinary and partial differential equations. Contains ======== _preprocess ode_order _desolve """ from __future__ import print_function, division from sympy.core.function import Function, Derivative, AppliedUndef from sympy.core.relational import Equality, Eq from sym...
{ "content_hash": "c9ff22c15aaa9c4a9b830de70690af27", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 90, "avg_line_length": 37.352059925093634, "alnum_prop": 0.5996189712223002, "repo_name": "kmacinnis/sympy", "id": "4c87d0d2289ff6d435865df237589c0bed0260c3", "size": "997...
""" The stacks.mutators module. This module contains mutators that modify the behaviour of Stages. """ import abc import functools from libpb import env, event, log, make, pkg from libpb.stacks import base __all__ = [ "Deinstall", "MakeStage", "Packagable", "PackageInstaller", "PostFetch", "Resolves...
{ "content_hash": "7a08e7d5d5b71c6cffa7f30a09f678dd", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 80, "avg_line_length": 33.05294117647059, "alnum_prop": 0.5700302544936822, "repo_name": "DragonSA/portbuilder", "id": "f551e3c060f722ac31e906c84fd563ce8897ca8e", "size": ...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals import os import subprocess import pytest from flexmock import flexmock from atomic_reactor.constan...
{ "content_hash": "590161693094119bc53542ed283d7e8e", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 100, "avg_line_length": 30.026315789473685, "alnum_prop": 0.6393514460999123, "repo_name": "jarodwilson/atomic-reactor", "id": "0f433def73f16d431ab84cb6722ff43c551c8cd6", "...
__about__ = """ In addition to what is provided by the "zero" project, this project provides thorough integration with django-user-accounts, adding comprehensive account management functionality. It is a foundation suitable for most sites that have user accounts. """ default_app_config = "ich_bau.apps.AppConfig"
{ "content_hash": "83f709828a930261bcb859685415a5f0", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 67, "avg_line_length": 39.375, "alnum_prop": 0.780952380952381, "repo_name": "postpdm/ich_bau", "id": "5f744ac940cc7e07a8f73194cc7966177f46f407", "size": "340", "binary": ...
class NField(object): """ Basic class that represents particle density in observer rest frame. """ def n(self, x, y, z): raise NotImplementedError def n_vec(self, ps): raise NotImplementedError class BKNField(NField): """ Class that describes Blandford-Konigle particle den...
{ "content_hash": "c6afb4f769ed2743f07352fbad37ed7f", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 75, "avg_line_length": 25.806451612903224, "alnum_prop": 0.53625, "repo_name": "ipashchenko/jetsim", "id": "66273ff224f93af6c2f4f87ef8dd1fa6d5da7c85", "size": "800", "bin...
from passphrase import *
{ "content_hash": "b2efed4526f6f1e41c8422c0d085e5ca", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 24, "avg_line_length": 25, "alnum_prop": 0.8, "repo_name": "Version2beta/passphrase", "id": "a597bc2c31498cecd491a21f7bb821b135615dd3", "size": "25", "binary": false, "c...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('repeating_tasks', '0007_auto_20150224_1046'), ] operations = [ migrations.AlterModelOptions( name='taskhistory', options={'o...
{ "content_hash": "21a187bc856b4fae87112e3e8994d2a0", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 65, "avg_line_length": 26.56, "alnum_prop": 0.5542168674698795, "repo_name": "ojarva/home-info-display", "id": "e24bb23780aaa9bfb2b5e197105a56cab11ec3ea", "size": "688", ...
from django.conf.urls import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf import settings from django.conf.urls.static import static from django.views.generic.base import TemplateView from django.contrib import admin from apps.OASIS_Home import views admi...
{ "content_hash": "ad98644abe176f6226219b176fe81b58", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 76, "avg_line_length": 33.19047619047619, "alnum_prop": 0.7546628407460545, "repo_name": "brotherjack/oasison-repo", "id": "77c2e84ef59d502a1d8d1d0018cf2b065dc13b9a", "size...
"""This example adds various types of targeting criteria to a given campaign. To get campaigns, run get_campaigns.py. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authent...
{ "content_hash": "a848d9a3e61fa75445615e37d3157404", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 79, "avg_line_length": 30.09090909090909, "alnum_prop": 0.5830815709969789, "repo_name": "dietrichc/streamline-ppc-reports", "id": "538b56618005331a8e395620075a812544b8c452"...
import boto3 import pprint import argparse import sys from os.path import basename from boto3.dynamodb.conditions import Key def search_known_faceid(f): ddb = boto3.resource('dynamodb', region_name=args.region) table = ddb.Table('faces') hits = {} for i in f['FaceMatches']: record = table.quer...
{ "content_hash": "d51d72c884d17c47088bad14ff8c4710", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 98, "avg_line_length": 45.59, "alnum_prop": 0.42904145645974995, "repo_name": "stevewoolley/riot", "id": "722bd1a59317ab57c24ef9e78834735f58a598de", "size": "4582", "bin...
import oauth2 as oauth import yaml # import urllib import json import os import time # import pytz import datetime import argparse import re import sys DOMAIN = 'https://ads-api.twitter.com' VERBOSE = 0 NON_SUB_PARAM_SEGMENTATION_TYPES = ['PLATFORMS', 'LOCATIONS', 'GENDER', 'INTERESTS', 'KEYWORDS'] def main(options...
{ "content_hash": "72e52831da90a961873e4e905ccda179", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 100, "avg_line_length": 36.5, "alnum_prop": 0.595930002375485, "repo_name": "twitterdev/ads-platform-tools", "id": "1c34a90004311f67906c6ddffd962fb446f1d3c1", "size": "126...
from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('studygroups', '0155_studygroup_unlisted'), ] operations = [ ...
{ "content_hash": "48c06c3d376e132720eb8f7229b1bdde", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 137, "avg_line_length": 44.57575757575758, "alnum_prop": 0.5955132562882393, "repo_name": "p2pu/learning-circles", "id": "98680f6b3ece5e8e15ecf0847264789026d2f63a", "size":...
""" define extension dtypes """ import re import numpy as np from pandas import compat from pandas.core.dtypes.generic import ABCIndexClass class ExtensionDtype(object): """ A np.dtype duck-typed class, suitable for holding a custom dtype. THIS IS NOT A REAL NUMPY DTYPE """ name = None names...
{ "content_hash": "b316f5e96fe07537157ea4a1c06bc4b0", "timestamp": "", "source": "github", "line_count": 694, "max_line_length": 79, "avg_line_length": 29.53602305475504, "alnum_prop": 0.5519075031710411, "repo_name": "Winand/pandas", "id": "d2487905caced2bdb6fa05f68599afa149d371dd", "size": "20498"...
from apsw import SQLError import os from pandas.util.testing import assert_frame_equal import pytest import random import tempfile import bayeslite from bayeslite.exception import BayesLiteException as BLE from bdbcontrib import parallel from bdbcontrib.bql_utils import cursor_to_df import test_bql_utils def test_es...
{ "content_hash": "e316026a3c9f13a4dfc6e3705a1028bd", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 79, "avg_line_length": 34.70520231213873, "alnum_prop": 0.5781145902731513, "repo_name": "probcomp/bdbcontrib", "id": "1e110c6558ac93950cfe5a297d966e98bafe2edf", "size": "...
import json from sqlalchemy import types as sa_types class JSONEncodedDict(sa_types.TypeDecorator): """Represents an immutable structure as a json-encoded string.""" impl = sa_types.Text def process_bind_param(self, value, dialect): if value is not None: value = json.dumps(value) ...
{ "content_hash": "027604e546825fca49a7ceaa7ae2cfe2", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 69, "avg_line_length": 24.894736842105264, "alnum_prop": 0.6469344608879493, "repo_name": "andreykurilin/mlm", "id": "5596f08a2c26200769914b7cf40fda4686de0c00", "size": "10...
"""Support for LaCrosse sensor components.""" from datetime import timedelta import logging import pylacrosse from serial import SerialException import voluptuous as vol from homeassistant.components.sensor import ENTITY_ID_FORMAT, PLATFORM_SCHEMA from homeassistant.const import ( CONF_DEVICE, CONF_ID, CO...
{ "content_hash": "d9778a3e480e45f2e17ed0de17a1b226", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 84, "avg_line_length": 29.575, "alnum_prop": 0.6380670611439843, "repo_name": "partofthething/home-assistant", "id": "f65c792ddb0e95a9d1370c8e423e8c1533e1b0b0", "size": "7...
from case_script import TestPythonScript import os import shutil class ResnetTest(TestPythonScript): @property def script(self): return '../examples/ResNet/imagenet-resnet.py' def test(self): self.assertSurvive(self.script, args=['--data .', ...
{ "content_hash": "5168232f1ce881d8f891805c1b113db4", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 101, "avg_line_length": 27.157894736842106, "alnum_prop": 0.5813953488372093, "repo_name": "haamoon/tensorpack", "id": "b49e0dfa50f0b238ec586719cd8f010ccac030a7", "size": "...
from __future__ import unicode_literals import copy import re import sys from io import BytesIO from itertools import chain from django.conf import settings from django.core import signing from django.core.exceptions import DisallowedHost, ImproperlyConfigured from django.core.files import uploadhandler from django.h...
{ "content_hash": "ddeb923ea7438747532f736460cb1530", "timestamp": "", "source": "github", "line_count": 554, "max_line_length": 110, "avg_line_length": 36.7797833935018, "alnum_prop": 0.5887318413820181, "repo_name": "ntuecon/server", "id": "cec2add58e2709fd8e755d3c5458e706eb7646c9", "size": "20376...
"""Tags for Django template system that help generating QR codes.""" from typing import Optional, Any, Union from django import template from qr_code.qrcode.maker import make_qr_code_with_args, make_qr_code_url_with_args from qr_code.qrcode.utils import ( make_google_play_text, make_tel_text, make_sms_tex...
{ "content_hash": "84649aa061e50b9149e1d0d1959b4bad", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 135, "avg_line_length": 34.72573839662447, "alnum_prop": 0.685176184690158, "repo_name": "dprog-philippe-docourt/django-qr-code", "id": "4239d1af2ff76893fc29865b71602b678d5a...
from django.apps import AppConfig class HobbiesConfig(AppConfig): name = 'hobbies'
{ "content_hash": "17b7cac2df92017e36ffd4c666abffa6", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 17.8, "alnum_prop": 0.7528089887640449, "repo_name": "pollitosabroson/retoglobal", "id": "bc3f4579baf511addc6ba7f7c70d2fe293e47ccc", "size": "89", "...
"""Check possible unbalanced tuple unpacking """ from __future__ import absolute_import from functional.unpacking import unpack # pylint: disable=using-constant-test, useless-object-inheritance def do_stuff(): """This is not right.""" first, second = 1, 2, 3 # [unbalanced-tuple-unpacking] return first + s...
{ "content_hash": "8b8fdadd36f6f61f5709843d0682a2ed", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 90, "avg_line_length": 26.35185185185185, "alnum_prop": 0.6159522136331693, "repo_name": "ekwoodrich/python-dvrip", "id": "afa217f40cbe57d7f6318af82d3c721b445fb489", "size...
""" Module for text processing. """ import nltk.tokenize import re from barbante.utils.profiling import profile import barbante.utils.logging as barbante_logger log = barbante_logger.get_logger(__name__) def get_stems(tokens, language): """ Returns the stems of the informed tokens. :param tokens: A li...
{ "content_hash": "22f39e2cb9391a332529ea0e5f1f36cb", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 109, "avg_line_length": 28.166666666666668, "alnum_prop": 0.6288120163859808, "repo_name": "hypermindr/barbante", "id": "6540a539258deb1aa2112f8c4931bedf720e18b7", "size":...
import datetime import gzip import os import unittest import numpy as np import pytz from cerebralcortex.data_processor.signalprocessing.alignment import timestamp_correct from cerebralcortex.data_processor.signalprocessing.ecg import rr_interval_update, compute_moving_window_int, \ check_peak, compute_r_peaks, r...
{ "content_hash": "6508f1cfb5f53147b4979a9ba0015927", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 116, "avg_line_length": 49.386792452830186, "alnum_prop": 0.6529130850047755, "repo_name": "nasirali1/CerebralCortex", "id": "625c3eabc55c08847067229f4f94f075413bbc24", "s...
import os import shutil import paths VALID_EXTENSIONS = [ '.png', '.jpg', '.jpeg', '.tga', ] VALID_EXTENSIONS_WITHOUT_DOT = map(lambda ext: ext[1:], VALID_EXTENSIONS) def is_valid_extension(extension): """Returns True is `extension` is a valid image extension to be used with custom Steam grid images. Th...
{ "content_hash": "055472437aa2bd807bd70f50ca42e7d7", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 78, "avg_line_length": 35.38235294117647, "alnum_prop": 0.7111388196176226, "repo_name": "scottrice/pysteam", "id": "3295b413aea1880b0ffe06c5004760dc3ac58806", "size": "242...
import json import urllib2 from django.contrib import admin from books.models import Book from data.models import Data domain = "http://smartebook.zmapp.com:9026" # 同步图书详情 def sync_book(bid, cm): # 完结了的图书不更新信息 if Book.objects.filter(id=bid, status=1).count() == 0: page = urllib2.urlopen("http://wap...
{ "content_hash": "33ccb27273028c514cd1c45ea01abb85", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 111, "avg_line_length": 29.795454545454547, "alnum_prop": 0.5671243325705568, "repo_name": "lnybrave/zzbook", "id": "d0ef021963320d71393e8a0e64c06c24381a8ed7", "size": "274...
from __future__ import division, print_function, unicode_literals __doc__ = """ Creates parenthesized letters and numbers: one.paren, two.paren, three.paren, four.paren, five.paren, six.paren, seven.paren, eight.paren, nine.paren, one_zero.paren, one_one.paren, one_two.paren, one_three.paren, one_four.paren, one_five.p...
{ "content_hash": "399ffc46199792144737df368b98504c", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 560, "avg_line_length": 38.68681318681319, "alnum_prop": 0.7308620934526345, "repo_name": "mekkablue/Glyphs-Scripts", "id": "2f0d9052d53c1a8d6079721bfcc69d871f8d7b85", "si...
import wave import numpy as np import struct import audioop import sys SAMPLE_RATE = 24000 # Output/test data sample rate Q_FACTOR = 1 # Additional linear quantization (for testing only) LIMIT = 20 # Number of files MIN_DURATION = 4.0 # Minimum duration in seconds def preprocess(oldFi...
{ "content_hash": "8209ce8e89de90da30decc5a337557df", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 96, "avg_line_length": 28.18918918918919, "alnum_prop": 0.6907957813998082, "repo_name": "YaleDataScience/wavenet", "id": "c324941218e0be9b7e60f858dd8322a7f4f88b6e", "size"...
from requests.adapters import HTTPAdapter from collections.abc import Mapping, Sequence from types import FunctionType from tqdm import tqdm import time import sys import gc class PoolTest(object): def __init__(self, worker_count: int): self.worker_count = worker_count self.pool = self.init_pool(w...
{ "content_hash": "b866a3a2515ca6e164af8eaa66b8822a", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 79, "avg_line_length": 36.56666666666667, "alnum_prop": 0.5755089638407779, "repo_name": "JohnStarich/python-pool-performance", "id": "d83a4bf4abc4187e8123837a1c3ea6367d058ef...
import sys import petsc4py petsc4py.init(sys.argv) import numpy as np # from scipy.io import loadmat from src import stokes_flow as sf from src.stokes_flow import problem_dic, obj_dic from petsc4py import PETSc from src.geo import * from time import time import pickle def save_vtk(problem: sf.StokesFlowProblem): ...
{ "content_hash": "ced099f340cb24f058c84714766f167b", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 165, "avg_line_length": 39.693811074918564, "alnum_prop": 0.5778762514360741, "repo_name": "pcmagic/stokes_flow", "id": "c258fb0b6a19cd72c5cc0f055b34e54fca2912f4", "size":...
import re import subprocess import sys from collections import OrderedDict from .source import Source from .configuration import Configuration import io import codecs try: # Python 2.x and 3.x support for checking string types basestring unicode except NameError: basestring = str unicode = str cla...
{ "content_hash": "11468e9d30699980d9b7121fe6e3fa7f", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 141, "avg_line_length": 35.35643564356435, "alnum_prop": 0.5511061327359283, "repo_name": "JazzCore/python-pdfkit", "id": "784aad08d0caf7eb0c9a8a631c243c40bee13e1f", "size...
import os import sys import sphinx_rtd_theme # 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.insert(0, os.path.abspath(...
{ "content_hash": "8e796c742def055f8e8215c1fc99b83b", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 80, "avg_line_length": 31.636363636363637, "alnum_prop": 0.6966954022988506, "repo_name": "btel/svg_utils", "id": "9302dc378d3588ca4ada4acb784203ff46866143", "size": "7379...
from .resource import Resource class TrackedResource(Resource): """The Resource definition. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource...
{ "content_hash": "cba9efe3fd27b3fb2f73934afa87badf", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 72, "avg_line_length": 27.4, "alnum_prop": 0.5529197080291971, "repo_name": "v-iam/azure-sdk-for-python", "id": "fe840d11b2b019cdf8d05f62208b32c55501f493", "size": "1570", ...
from ratelimit import limits, RateLimitException from tests import unittest, clock class TestDecorator(unittest.TestCase): @limits(calls=1, period=10, clock=clock) def increment(self): ''' Increment the counter at most once every 10 seconds. ''' self.count += 1 @limits(cal...
{ "content_hash": "ca1547a859c06f2f9bd7df357b9d7b65", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 78, "avg_line_length": 26.363636363636363, "alnum_prop": 0.6241379310344828, "repo_name": "tomasbasham/ratelimit", "id": "ceefdfdd636e1c2315929021d57463eee7fcb899", "size":...
from robot.errors import DataError from robot.utils import is_dict_like from .argumentvalidator import ArgumentValidator class ArgumentResolver(object): def __init__(self, argspec, resolve_named=True, resolve_variables_until=None, dict_to_kwargs=False): self._named_resolver = NamedArgum...
{ "content_hash": "fe027ef5bc3242d77431b39f83f5005a", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 80, "avg_line_length": 35.427350427350426, "alnum_prop": 0.6086851628468034, "repo_name": "fiuba08/robotframework", "id": "378ef1ba999bbe2db5da66d77c53b24b2f77d72c", "size...
from papermill.cli import papermill if __name__ == '__main__': papermill()
{ "content_hash": "f5bf945d70957b044a3e53120ab3b8f5", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 35, "avg_line_length": 20, "alnum_prop": 0.625, "repo_name": "nteract/papermill", "id": "c386c2ff143222504f39d3bf85bc254f4bf799a8", "size": "80", "binary": false, "copie...
import uuid from django import template from django.forms.widgets import Media from django.utils.safestring import mark_safe from django.core.urlresolvers import reverse from settings import PROGRESSBARUPLOAD_INCLUDE_JQUERY register = template.Library() @register.simple_tag def progress_bar(): """ progress...
{ "content_hash": "2235346f969ecd7705b0bcb5dd192c10", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 74, "avg_line_length": 28.022727272727273, "alnum_prop": 0.6682887266828873, "repo_name": "foobarbecue/afterflight", "id": "f75a2262207b19434ba5d3b7c28049e77aa78d32", "size...
if ENABLE_FINANCIAL_AID: db.define_table( 'fa', # Idendtification: # - Legal name => fa.person.first_name + fa.person.last_name # - Address => fa.person.{address1,address2,city,state,country,zip_code} # - email address => fa.person.email # Registration: # - registration typ...
{ "content_hash": "7f29489b3b0dec61dcb677720994d06b", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 154, "avg_line_length": 55.63265306122449, "alnum_prop": 0.5833944729762778, "repo_name": "reingart/web2conf", "id": "10ffdb053f4dc92d26c11cf9b267642bd1e45700", "size": "8...
import json from google.appengine.ext import ndb from controllers.account.account_base import AccountBaseHandler from models.Caucus import Caucus class CaucusInfoHandler(AccountBaseHandler): @ndb.toplevel def get(self, caucus_id): caucus = Caucus.get_by_id(int(caucus_id)) self.template_value...
{ "content_hash": "099b35727f2296475c495a28ba1e3380", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 116, "avg_line_length": 37.31666666666667, "alnum_prop": 0.6556498436802144, "repo_name": "PatrickLaban/OnlineCaucus", "id": "6137bcd6d3eb63444c86efd73f230a693075267b", "si...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations ...
{ "content_hash": "7da539984566ea454ba4a066e64aed32", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 146, "avg_line_length": 42.714285714285715, "alnum_prop": 0.6092530657748049, "repo_name": "TrainerProjectF13X/trainer_web_app", "id": "293ffa3e2616057592916d5e75d59a7e3cfa8a...
__author__ = "Simone Campagna" import re from .py23 import BASE_STRING class Values(object): __re_split__ = re.compile("[,x]") __default_separator__ = 'x' def __init__(self, init): if isinstance(init, Values): values = init._values elif isinstance(init, (list, tuple)): ...
{ "content_hash": "64e5f9e36a96ad4001f095f731e19db5", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 81, "avg_line_length": 27.123287671232877, "alnum_prop": 0.5232323232323233, "repo_name": "simone-campagna/rubik", "id": "868db4d116a7bcebb26cbada11b552e5285a461f", "size":...
import logging logger = logging.getLogger(__name__) def parse_config(description_str): output_dict = {} # ##!!##logger.debug('parsing abstraction parameters') # split the description into lines by breaking at "\n" description_arr = description_str.splitlines() for l in description_arr: ...
{ "content_hash": "0917fbc341ab4cb37c44a3f806aad62e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 70, "avg_line_length": 23.17142857142857, "alnum_prop": 0.6177558569667078, "repo_name": "zutshi/S3CAMX", "id": "5f39d39366a51bf9f8984998f999f82b4e06b5ce", "size": "853", ...
""" Flask routing """ from flask import Flask, request, session, send_from_directory, render_template from werkzeug.contrib.fixers import ProxyFix app = Flask(__name__, static_path="/") app.wsgi_app = ProxyFix(app.wsgi_app) import api import json import mimetypes import os.path from datetime import datetime from ap...
{ "content_hash": "aa498a52e1ced24972e1dd179cba16ef", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 98, "avg_line_length": 34.54117647058823, "alnum_prop": 0.7173024523160763, "repo_name": "alpire/picoCTF-web", "id": "b216fee2186752fdef5fa6148692ffa141bdbc47", "size": "29...
def get_json(suffix): import urllib, json url_object = urllib.urlopen('http://api.pugetsound.onebusaway.org/api/where/' + suffix) return json.loads(url_object.read()) def test_sql(cnx): from datetime import datetime, date cursor = cnx.cursor() test_insert = ("INSERT INTO test (word, number, da...
{ "content_hash": "cc354628d4362dc8840b29ccb9cfd08c", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 91, "avg_line_length": 25.30188679245283, "alnum_prop": 0.5712155108128263, "repo_name": "rohanaras/bus_bunching", "id": "1ca68092101829c51ad61502a84476733374a3e6", "size":...
from __future__ import absolute_import import json import jsonpath_rw import six import orjson from st2common.util import db as db_util from st2common.constants.meta import yaml_safe_load from st2common.constants.meta import yaml_safe_dump __all__ = [ "from_json_string", "from_yaml_string", "json_escape...
{ "content_hash": "0e9ff965c90e161a31dda4a2f10aec39", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 80, "avg_line_length": 25.307692307692307, "alnum_prop": 0.6778115501519757, "repo_name": "StackStorm/st2", "id": "e314040c80362eee34398bb3d2c1d37f2d38888c", "size": "3260...
""" Test calling an expression without a target. """ import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestCalculatorMode(TestBase): mydir = TestBase.compute_mydir(__file__) NO_DEBUG_INFO_TESTCASE = True def test__calcu...
{ "content_hash": "24378c52f18209f70e4f0d6f483dc226", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 107, "avg_line_length": 28.434782608695652, "alnum_prop": 0.6773700305810397, "repo_name": "endlessm/chromium-browser", "id": "9cd3c8170470479515d30e52fd8dbf9403a10301", "s...
"""Controller class that auto detects the platform returning the appropriate class as controller """ from .controller import Controller try: # Attempt to load RPi Module import RPi.GPIO as GPIO from .rpi import rpi as Controller except: try: # Attempt to load Beagle Bone Module import A...
{ "content_hash": "7ebea32a3c3d4defb35b3f25d1c68aaf", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 50, "avg_line_length": 28.41176470588235, "alnum_prop": 0.6935817805383023, "repo_name": "3dinfluence/opensprinklerlib", "id": "430740a0f1a9a38bca9b7810c030288e875992ce", "...
class CloudbaseInitException(Exception): pass
{ "content_hash": "ca629dbd955b6a548bf3d1ca9c84cb20", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 40, "avg_line_length": 25, "alnum_prop": 0.8, "repo_name": "cernops/cloudbase-init", "id": "147611b979f24b24d25f7525cd98237d7f081eb7", "size": "667", "binary": false, "c...
def read_checksum(filehandle): # We expect the comment to be at the beginning of the file. data = filehandle.read(2048) comment_key = 'tEXtchecksum\x00' comment_pos = data.find(comment_key) if comment_pos == -1: return checksum_pos = comment_pos + len(comment_key) return data[checks...
{ "content_hash": "924ddbea8f7c3b59054c3420d9c00c9f", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 63, "avg_line_length": 34.6, "alnum_prop": 0.6705202312138728, "repo_name": "mogoweb/webkit_for_android5.1", "id": "70a0502b73bf758eda51642fc16f9b9c1ed4d0af", "size": "1899...
from flask import Flask, request, url_for, render_template, jsonify import ConfigParser import urllib, json import serial import subprocess config = ConfigParser.RawConfigParser() config.read('defaults.cfg') WEATHER_API_KEY = config.get('openweathermap', 'api_key') CITY_ID = config.get('openweathermap', 'city_id') WEA...
{ "content_hash": "d72c652e3b2d7273b54e38bcc6bfee2e", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 87, "avg_line_length": 26.488372093023255, "alnum_prop": 0.6900790166812993, "repo_name": "asommer70/mirror-pila", "id": "2bc526b491e5fe681753cc945f91a6e4c8c4cdd0", "size":...
import ctypes import gi gi.require_version('WebKit', '3.0') from gi.repository import Gtk, WebKit, Soup webView = WebKit.WebView() webView.open('http://html5.grooveshark.com/') window = Gtk.Window() icon_theme=Gtk.IconTheme.get_default() if icon_theme.lookup_icon("gnome-multimedia", 96, 0) : window.set_icon(icon_t...
{ "content_hash": "52cc9ad8c2ca5926199259fa16502340", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 119, "avg_line_length": 24.71875, "alnum_prop": 0.7534766118836915, "repo_name": "dbtek/groove-play", "id": "6d684eb0b37fbe516aeaf96dd7747703cb3b1695", "size": "814", "bi...
""" Form Widget classes specific to the Django admin site. """ from __future__ import unicode_literals import copy from django import forms from django.contrib.admin.templatetags.admin_static import static from django.core.urlresolvers import reverse from django.forms.widgets import RadioFieldRenderer from django.for...
{ "content_hash": "64bd68a3d35c7812977098f726070eb8", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 137, "avg_line_length": 40.26488095238095, "alnum_prop": 0.60300096089881, "repo_name": "tastynoodle/django", "id": "2d50f47396e1432b04d9bee6166ac3e006b0625e", "size": "13...
import random def gen_random(): index = random.randint(0, len(quotes) - 1) return quotes[index] quotes = ('Happiness can be found, even in the darkest of times, if one only remembers to turn on the light. - Albus Dumbledore', 'Indeed, your failure to understand that there are things much worse than ...
{ "content_hash": "787fb8382d0c5f1f6cbc53e4dadcc69f", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 163, "avg_line_length": 93.5079365079365, "alnum_prop": 0.6761161093193007, "repo_name": "OrkoHunter/PotterScript", "id": "0a9296121aa145a3b702ebe9bfdb5d6154082b87", "size"...
"""SoundCloud directive for reStructuredText.""" from docutils import nodes from docutils.parsers.rst import Directive, directives from nikola.plugin_categories import RestExtension class Plugin(RestExtension): """Plugin for soundclound directive.""" name = "rest_soundcloud" def set_site(self, site):...
{ "content_hash": "6c878cadb81c4738b70a6bee0781256d", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 81, "avg_line_length": 27.985915492957748, "alnum_prop": 0.6039255158530448, "repo_name": "atiro/nikola", "id": "2577ff1d500e578872d8974b9ef420b00cad1bb0", "size": "2012", ...
from __future__ import unicode_literals from django.core.checks import Error from django.db import connections, models from django.test import SimpleTestCase, mock from django.test.utils import isolate_apps def dummy_allow_migrate(db, app_label, **hints): # Prevent checks from being run on the 'other' d...
{ "content_hash": "d517c260d9ed884e94e4508537696cd2", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 103, "avg_line_length": 35.46666666666667, "alnum_prop": 0.6738721804511278, "repo_name": "yephper/django", "id": "d56f53df0ded24bcf09fdd14ec51a549189b2b64", "size": "1091"...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest im...
{ "content_hash": "bd3d1542ee74f7f28937baa8a95c540b", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 105, "avg_line_length": 21.65, "alnum_prop": 0.6997690531177829, "repo_name": "skuda/client-python", "id": "d4f820e7998343b1c53d62ac1360dd725c2862ae", "size": "883", "bin...
import bayessb from pysb.examples.robertson import model from pysb.integrate import odesolve import numpy import matplotlib.pyplot as plt import sys scenario = 2 if len(sys.argv) > 1: scenario = int(sys.argv[1]) seed = 2 random = numpy.random.RandomState(seed) sigma = 0.1; ntimes = 20; tspan = numpy.linspace(0, 4...
{ "content_hash": "adc515e31a95dd17f7f271a4af67c6ef", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 109, "avg_line_length": 31.544, "alnum_prop": 0.6107025107785949, "repo_name": "jmuhlich/bayessb", "id": "2473628feed3967180e9320a7291b498242687f2", "size": "3943", "bin...
import flask import flask_bootstrap from configobj import ConfigObj from redmine import Redmine config = ConfigObj('config.ini') RM_USER = config['user'] RM_KEY = config['key'] RM_URL = config['url'] PROJ_ID = config['project'] TRACKER_MAP = {'epic': 11, 'bug': 1, 'task': 12, ...
{ "content_hash": "af0dabc226808c6971bd5be475d9e6b8", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 74, "avg_line_length": 24.347826086956523, "alnum_prop": 0.5297619047619048, "repo_name": "kremlinkev/red_list", "id": "3bb8fa8c9f64eca7e5f1613aa96b27902c37721a", "size": "...
from __future__ import annotations from pathlib import Path SOURCE_ROOT = Path(__file__).resolve().parents[1]
{ "content_hash": "d18fedb11fbde0278fbb890db9f8bbf2", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 49, "avg_line_length": 22.4, "alnum_prop": 0.7232142857142857, "repo_name": "cfei18/incubator-airflow", "id": "db79d1d862c27cefd690875330723c1e7f5ccead", "size": "897", "b...
import pytest import tensorflow as tf import numpy as np import tfs.core.layer.ops as ops from tfs.core.layer.dropout import Dropout from tfs.network import Network net = Network() @pytest.fixture def l(): l = Dropout( net, keep_prob=1.0, ) return l class TestDropout: def test_build_inverse(self,l): ...
{ "content_hash": "d8c47a6ebdce7f62858b9e326c0961ad", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 50, "avg_line_length": 18.52173913043478, "alnum_prop": 0.6713615023474179, "repo_name": "crackhopper/TFS-toolbox", "id": "31a44f6ab4b8dfd0c8046dc1c3d101280df0810b", "size"...
"""OpenStack-related utilities.""" import sys try: if sys.version_info > (3, 2, 0): # pragma: no cover import urllib.parse as urlparse else: # pragma: no cover import urlparse except ImportError: # pragma: no cover raise SystemExit('No urlparse module was found.') try: from ope...
{ "content_hash": "2ead87eb3413e357d630112cd38e4346", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 78, "avg_line_length": 32.00956937799043, "alnum_prop": 0.5412556053811659, "repo_name": "major/monitorstack", "id": "2572d78503068a0c869566a20efac91d761ab4a8", "size": "7...
"""Abstract base classes related to import.""" from . import _bootstrap from . import machinery import abc import types class Loader(metaclass=abc.ABCMeta): """Abstract base class for import loaders.""" @abc.abstractmethod def load_module(self, fullname:str) -> types.ModuleType: """Abstract meth...
{ "content_hash": "c29312aae0201b4a4e722bd1d60cf428", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 79, "avg_line_length": 30.262295081967213, "alnum_prop": 0.7055796316359697, "repo_name": "MalloyPower/parsing-python", "id": "b2bdb02c92645f79d08bb388b1aa3ef3524b0b4a", "...
from copy import deepcopy import ctypes from itertools import chain import re import struct import traceback import time import datetime from urllib import unquote import uuid from hashlib import md5 from random import randrange, choice import greenlet from eventlet import GreenPile from eventlet import GreenPool from ...
{ "content_hash": "73db6a2acb0775d65582c746759d658e", "timestamp": "", "source": "github", "line_count": 2799, "max_line_length": 80, "avg_line_length": 46.123972847445515, "alnum_prop": 0.5374086955174631, "repo_name": "zerovm/zerocloud", "id": "d7999cc88ee11a5e555bc598690ab64966eeb949", "size": "1...
import _plotly_utils.basevalidators class LineValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="line", parent_name="violin.box", **kwargs): super(LineValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, da...
{ "content_hash": "2c9afb2fcf22f0f71e77698d80fd3044", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 79, "avg_line_length": 33.15, "alnum_prop": 0.5384615384615384, "repo_name": "plotly/python-api", "id": "615b3abab97eff574b656edb638d433f179891ff", "size": "663", "binary...
import unittest import torch from parameterized import parameterized from monai.engines import PrepareBatchExtraInput, SupervisedEvaluator from tests.utils import assert_allclose TEST_CASE_0 = [ {"extra_keys": "extra1"}, {"x": torch.tensor([1, 2]), "t1": torch.tensor([5, 6]), "t2": None, "t3": None}, ] TEST...
{ "content_hash": "cb750c9ffebcb266b95af4eb6c257dd8", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 86, "avg_line_length": 32.84615384615385, "alnum_prop": 0.5522248243559719, "repo_name": "Project-MONAI/MONAI", "id": "79c9a13679f59c194ed0db4721ee41b1fe4c068c", "size": "2...
import logging import os import pytest from copy import copy from subprocess import call from tests.beeswax.impala_beeswax import ImpalaBeeswaxException from tests.common.impala_test_suite import * from tests.common.test_vector import * from tests.common.impala_cluster import ImpalaCluster from tests.common.test_dimens...
{ "content_hash": "4a01d0ca58cd124e94f349397babdd81", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 99, "avg_line_length": 35.03658536585366, "alnum_prop": 0.7201531500174034, "repo_name": "kapilrastogi/Impala", "id": "53ea98c0bbdb87b72985fe010f871d4530c1888e", "size": "3...
import os import re import shutil import subunit import sys from functools import partial from io import BytesIO from testtools import CopyStreamResult from testtools import StreamResult from testtools import StreamSummary from testtools import StreamToDict from testrepository.repository.file import RepositoryFactor...
{ "content_hash": "f7e1a76ddf6f9ea23fa74f393aa6ccc1", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 79, "avg_line_length": 26.930232558139537, "alnum_prop": 0.6340673575129534, "repo_name": "timothyb89/stackviz-ng", "id": "868c314a8e178b0792826193bff80881292f022f", "size...
from __future__ import annotations import unittest from unittest import mock from airflow.providers.amazon.aws.hooks.glue_crawler import GlueCrawlerHook from airflow.providers.amazon.aws.sensors.glue_crawler import GlueCrawlerSensor class TestGlueCrawlerSensor(unittest.TestCase): def setUp(self): self.s...
{ "content_hash": "931d78b1e27df47acc06e245365f528a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 79, "avg_line_length": 37.55, "alnum_prop": 0.6750998668442078, "repo_name": "cfei18/incubator-airflow", "id": "0821141bb9e2ece7a181dab96b373d4029224114", "size": "2287", ...
import collections from unittest import mock from oslo_utils.fixture import uuidsentinel as uuids from oslo_utils import timeutils from oslo_versionedobjects import fixture from nova import exception from nova.notifications.objects import base as notification from nova import objects from nova.objects import base fro...
{ "content_hash": "80966fdb0a6453566acca2c2ac952a2c", "timestamp": "", "source": "github", "line_count": 483, "max_line_length": 79, "avg_line_length": 42.33126293995859, "alnum_prop": 0.6525970850044018, "repo_name": "mahak/nova", "id": "de9e6f276232fc7aeb6965bc12817e793d6586a7", "size": "21043", ...
import base64 import email.policy import os import subprocess from email import message_from_string from email.message import EmailMessage, MIMEPart from typing import Any, Callable, Dict, Mapping, Optional from unittest import mock import orjson from django.conf import settings from django.http import HttpResponse f...
{ "content_hash": "e397f563bdca0cafbc762fb533becb66", "timestamp": "", "source": "github", "line_count": 1458, "max_line_length": 171, "avg_line_length": 46.71604938271605, "alnum_prop": 0.6399753347427766, "repo_name": "showell/zulip", "id": "95ed80197e3ba6e02a88aee80378db590cc110e7", "size": "6813...
"""Select individuals into a new population trying to maintain diversity. This selection mechanism seeks to try and get both high fitness levels and high diversity levels in the population. """ # standard modules import random import math # biopython from Bio.Seq import MutableSeq # local modules from .Abstract impo...
{ "content_hash": "72f31d50b56ee7e6391d7612a927a00b", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 78, "avg_line_length": 35.402061855670105, "alnum_prop": 0.6429819452533488, "repo_name": "zjuchenyuan/BioWeb", "id": "d9b1bceb3229721f513f01394214ab7e2a2d972a", "size": "3...
from collections import Counter if __name__ == '__main__': k = int(input()) room_captain = Counter(map(int, input().split())).most_common()[:-2:-1] print(room_captain[0][0])
{ "content_hash": "19a650fd0605123448259a82c9b448b5", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 76, "avg_line_length": 31.166666666666668, "alnum_prop": 0.5935828877005348, "repo_name": "neiesc/Problem-solving", "id": "f9ce968f21d6e6f401b8601663fad589082a13f8", "size":...
import logging from typing import Tuple from praw.models import Comment, Submission # type: ignore from tor import __BOT_NAMES__ from tor.core.config import Config from tor.core.helpers import clean_id, flair, send_to_modchat from tor.core.users import User log = logging.getLogger(__name__) def flair_post(post: S...
{ "content_hash": "2280e38a4d589dd270f2ef02b935ddd2", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 85, "avg_line_length": 33.91503267973856, "alnum_prop": 0.63923684717672, "repo_name": "TranscribersOfReddit/TranscribersOfReddit", "id": "cadfd85c18206dc91d133e948455dc381b...
"""Generic training script that trains a model using a given dataset.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from datasets import dataset_factory from deployment import model_deploy from nets import nets_factory from pre...
{ "content_hash": "6287f61f4be7f0d7630f232f32fd1781", "timestamp": "", "source": "github", "line_count": 559, "max_line_length": 81, "avg_line_length": 34.67262969588551, "alnum_prop": 0.634041894541327, "repo_name": "r888888888/models", "id": "82394464fae53c39b672288d56ed292294acac63", "size": "200...
from asynq import asynq, result from .helpers import Profiler counter = 0 def test(): global counter @asynq(pure=True) def incr(): global counter counter += 1 print("Counter: %i" % counter) return counter yield def sync_incr(): global counter ...
{ "content_hash": "1ada12b5952cc36e5042277ca5926f21", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 54, "avg_line_length": 22.955555555555556, "alnum_prop": 0.5082284607938045, "repo_name": "quora/asynq", "id": "e159d2774069b75b7b0dc6c7c3e5c73943640180", "size": "1607", ...
import sys import numpy as np from scipy.optimize import minimize import cv2 import image_utils as utils from my_gradient_map import gradient_map img_list = [] N = 30 gmap = None weight = 1 # TODO: This function is the same as the one in diffuse light def sum_lambda_int(l, r, c): # channels = img_list[0].shape...
{ "content_hash": "30b610d4414bfd5cca38acc6588eb7d9", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 78, "avg_line_length": 24.67032967032967, "alnum_prop": 0.5630289532293986, "repo_name": "tjaartvdwalt/light-compositing", "id": "9d4b4aa7308deca7be7c14caac179744b9c3f6d3", ...
from schedule import Schedule class SSGS(object): def __init__(self, problem): self.problem = problem def get_schedule(self, activity_list): S = Schedule(self.problem) self.al_iter = activity_list.__iter__() for i in xrange(self.problem.num_activities): activity = ...
{ "content_hash": "4c470b61a227c1404df7a5faae76277a", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 110, "avg_line_length": 37, "alnum_prop": 0.6236236236236237, "repo_name": "Artimi/ukko", "id": "b3c5b7280b5a1dbb59eb411a723e50aa23dc188d", "size": "1024", "binary": fals...
import os import re from typing import Optional # Possible values for env variables ENV_VARS_TRUE_VALUES = {"1", "ON", "YES", "TRUE"} ENV_VARS_TRUE_AND_AUTO_VALUES = ENV_VARS_TRUE_VALUES.union({"AUTO"}) def _is_true(value: Optional[str]) -> bool: if value is None: return False return value.upper() ...
{ "content_hash": "b23ad97265a44928aa964e3599fa79dc", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 87, "avg_line_length": 30.601769911504423, "alnum_prop": 0.7082128397917872, "repo_name": "huggingface/huggingface_hub", "id": "c08cf1bbdcf01c45898d1984490b1e9ea32051d5", ...
"""The pi_hole component.""" import asyncio import logging from hole import Hole from hole.exceptions import HoleError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import ( CONF_API_KEY, CONF_HOST, CONF_NAME, CONF_SSL, CONF_VERIFY_SSL, ) ...
{ "content_hash": "f1384aa26f5885f799e1cf41474b5f95", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 82, "avg_line_length": 27.254054054054055, "alnum_prop": 0.6150337167790559, "repo_name": "adrienbrault/home-assistant", "id": "bc486a0c9014ece546298def8343cbe70c6133df", ...
from __future__ import with_statement import hashlib import importlib import json from datetime import datetime import django from django.conf import settings from django.conf.urls import url from django.contrib import admin from django.contrib import messages from django.contrib.admin.models import LogEntry, ADDITIO...
{ "content_hash": "9de0cbe7ad09f61eae8be6ac854ef58d", "timestamp": "", "source": "github", "line_count": 700, "max_line_length": 141, "avg_line_length": 36.88857142857143, "alnum_prop": 0.5887615211834869, "repo_name": "Apkawa/django-import-export", "id": "bb0115fe82097719ffbc1a50a0031d81a16feea0", ...
import json from geofire_utils import validate_key, validate_location, encode_geofire_object, encode_geohash class GeoFire: def __init__(self, firebaseRef): self._firebaseRef = firebaseRef def set(self, key, location): validate_key(key) if location: # Setting location to null is valid since it...
{ "content_hash": "c41730654c0816465f3b21d09ee6deb9", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 104, "avg_line_length": 31.29032258064516, "alnum_prop": 0.6907216494845361, "repo_name": "alpire/pitlivebus", "id": "411b647c5324fe79190a8a415bb2f9922f98ce93", "size": "97...
from django.conf.urls.defaults import url, patterns, include from mint.django_rest.rbuilder.discovery import views as discoveryviews from mint.django_rest.rbuilder.inventory.views.v1 import views as inventoryviews class URLRegistry(object): _registry = {} VERSION = '1' @classmethod def URL(cls, regex, ...
{ "content_hash": "984544c5114b72e06c5001c8d1e4522c", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 84, "avg_line_length": 33.76744186046512, "alnum_prop": 0.6150137741046832, "repo_name": "sassoftware/mint", "id": "bf90f2c53b5f8b108401187164371e861c22c032", "size": "2039...
__author__ = 'tilmannbruckhaus' class LargestPalindrome: # Largest palindrome product # Problem 4 # A palindromic number reads the same both ways. # The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 x 99. # Find the largest palindrome made from the product of two 3-...
{ "content_hash": "58b0f51c899047be82f29e7a31bec712", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 102, "avg_line_length": 31.205128205128204, "alnum_prop": 0.5414954806902219, "repo_name": "bruckhaus/challenges", "id": "a1ce906a3cbee1f7c80b20a40281e92c48f73930", "size":...
import shutil from subprocess import call from os.path import join, isfile import argparse WINDOWS = 'win64' WINDOWS_DEBUG = 'win64-debug' LINUX = 'linux' parser = argparse.ArgumentParser() parser.add_argument("os", help="the operating system being built for", choices=[WINDOWS, WINDOWS_DEBUG, LINUX]) parser.add_argum...
{ "content_hash": "3c502101a070ce0eece355eb5be831bf", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 121, "avg_line_length": 35.666666666666664, "alnum_prop": 0.7075316107751511, "repo_name": "danaugrs/gokoban", "id": "e11530957eddb560c07bb3b80b3843ada538e3d4", "size": "18...
import statsmodels import survivalstan import random random.seed(9001) def load_test_dataset(n=50): ''' Load test dataset from R survival package ''' dataset = statsmodels.datasets.get_rdataset(package='survival', dataname='flchain' ) d = dataset.data.query('futime > 7').sample(n=n) d.reset_index(l...
{ "content_hash": "77f64a363ec590822c135a6864c1fa5c", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 88, "avg_line_length": 30.225806451612904, "alnum_prop": 0.6755602988260405, "repo_name": "jburos/survivalstan", "id": "3da952ffd1889c4b57327d3030f5b72ddc2d93e2", "size": "...
from django import forms from django_core.forms.widgets import CommaSeparatedListWidget from test_objects.models import TestIntegerListFieldModel from test_objects.models import TestListFieldModel class TestListFieldForm(forms.ModelForm): class Meta: model = TestListFieldModel class TestIntegerListFie...
{ "content_hash": "ce6b67983a2b2882bf1c980656de68be", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 62, "avg_line_length": 24.444444444444443, "alnum_prop": 0.740909090909091, "repo_name": "InfoAgeTech/django-core", "id": "9bbdb32fd92c4d521a77d75f9d1099ebba7c3b7d", "size"...
import os try: from setuptools import setup except: from distutils.core import setup from muppet import __version__ readMeFile = open(os.path.join(os.path.dirname(__file__), "README.rst")) long_description = readMeFile.read() readMeFile.close() setup( name="muppet", version=__version__, description="Durab...
{ "content_hash": "2e491b447a8aba7821a92fdfd756a50f", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 72, "avg_line_length": 29.20689655172414, "alnum_prop": 0.7260920897284534, "repo_name": "pandastrike/muppet", "id": "93cc0b5e65835cdb37524a834eabd62d2782a3cf", "size": "86...
from django import setup from django.conf import settings if not settings.configured: settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } }, ) setup()
{ "content_hash": "9ee512f1dc4f68eb72cc9c1036fa499d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 55, "avg_line_length": 20.857142857142858, "alnum_prop": 0.5102739726027398, "repo_name": "Relrin/aiorest-ws", "id": "eb9e0b9aa4820d54a505ac1dbac534213ad15cc2", "size": "31...
from __future__ import print_function import argparse import pandora.utils from pandora.tagger import Tagger def main(config, train='data/wilhelmus/all_train', dev='data/wilhelmus/all_dev', **kwargs): print('::: started :::') params = pandora.utils.get_param_dict(config) params['config_path'] = config ...
{ "content_hash": "0cbb566937847728264803407e1dc4ba", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 91, "avg_line_length": 31.385964912280702, "alnum_prop": 0.6171045276690889, "repo_name": "PonteIneptique/pandora", "id": "9e1e49574f531f881b6e038db92257f70d028e29", "size"...
import time from logging import getLogger from Doctopus.Doctopus_main import Check, Handler log = getLogger('Doctopus.plugins') class MyCheck(Check): def __init__(self, configuration): super(MyCheck, self).__init__(configuration=configuration) def user_check(self): """ :param comma...
{ "content_hash": "f2455f4428e2ac4921a769a99d44f3c6", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 68, "avg_line_length": 26.753846153846155, "alnum_prop": 0.5658424381828637, "repo_name": "maboss-YCMan/Doctopus", "id": "09e4b1263486c30349c186bfd316d18187158cac", "size":...
""" This is a simple light weight plotting module that can be used with Boa or easily integrated into your own wxPython application. The emphasis is on small size and fast plotting for large data sets. It has a reasonable number of features to do line and scatter graphs easily. It is not as sophisticated or as power...
{ "content_hash": "8599263dc283a5d4d13c69efcfbde497", "timestamp": "", "source": "github", "line_count": 1461, "max_line_length": 134, "avg_line_length": 39.27926078028747, "alnum_prop": 0.5665568857058219, "repo_name": "ivoflipse/devide", "id": "e8cca12ebf8d7979036aa8c1e4bdb99c92a772ab", "size": "5...
"""Private utility functions.""" from collections import ChainMap from datetime import datetime, date, time, timedelta, tzinfo from functools import partial from pickle import dumps, loads, HIGHEST_PROTOCOL from msgpack import ExtType, packb, unpackb _default = { 127: (date, partial(dumps, protocol=HIGHEST_PROTO...
{ "content_hash": "b97375b0fd4587455ac108df9071defe", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 71, "avg_line_length": 38.26086956521739, "alnum_prop": 0.5984848484848485, "repo_name": "claws/aiozmq", "id": "ce4decaea673f82872421af66dfd9995b21a3445", "size": "2640", ...
from __future__ import annotations import base64 import logging from collections import Counter from typing import cast from pants.engine.internals.scheduler import Workunit from pants.engine.rules import collect_rules, rule from pants.engine.streaming_workunit_handler import ( StreamingWorkunitContext, Worku...
{ "content_hash": "e0d6238d9fd08f3ea87b070b508cb853", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 100, "avg_line_length": 34.61038961038961, "alnum_prop": 0.6125703564727955, "repo_name": "patricklaw/pants", "id": "68285c2d4a6d867d302d9f9babc7eb646f2ab74f", "size": "54...
from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^loader/', include('loader.urls', namespace='loader')), ]
{ "content_hash": "20919d3c9926cc9274a4af05d40d00ec", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 65, "avg_line_length": 28.285714285714285, "alnum_prop": 0.6919191919191919, "repo_name": "lnlfp/lnlfp", "id": "d65c2d7eb8a962905ba878e9a201f410909f0df6", "size": "198", "...
import _plotly_utils.basevalidators class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="thicknessmode", parent_name="layout.coloraxis.colorbar", **kwargs, ): super(ThicknessmodeValidator, self).__init__( ...
{ "content_hash": "f22dda1e27b069440a9b81a2bd198502", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 79, "avg_line_length": 32.11764705882353, "alnum_prop": 0.5952380952380952, "repo_name": "plotly/plotly.py", "id": "c6a034cee8aa2aa28a79932a70f1c03e397cf714", "size": "546"...
import calendar import os import sys from nikola.plugin_categories import Task from nikola.utils import config_changed class Archive(Task): """Render the post archives.""" name = "render_archive" def gen_tasks(self): kw = { "messages": self.site.MESSAGES, "translations":...
{ "content_hash": "3ee8065b2bca9a7c29e83c356fd1e22c", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 120, "avg_line_length": 42.34146341463415, "alnum_prop": 0.48444700460829493, "repo_name": "servalproject/nikola", "id": "a67826f3433758e9320ae442eb3fd8fd28377bf4", "size"...
from typing import Dict import pytest from bs4 import BeautifulSoup from torrt.trackers.ytsmx import YtsmxTracker @pytest.fixture() def tracker(): return YtsmxTracker() @pytest.fixture(scope='module') def stub_links(): return { '720P.WEB': '720p_torrent.link', '1080P.WEB': '1080p_torrent.l...
{ "content_hash": "bd727196833d44b81b0badc9a816219d", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 69, "avg_line_length": 27.444444444444443, "alnum_prop": 0.5807467386414755, "repo_name": "idlesign/torrt", "id": "31909d03781c04e571c36da1bcb70838e9ae0e8f", "size": "2223"...