text stringlengths 0 1.05M | meta dict |
|---|---|
# Based on this code: http://tutorials.github.com/pages/retrieving-storm-data-from-nimbus.html
from __future__ import print_function
import datetime
from six import StringIO
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
import petrel.topolog... | {
"repo_name": "AirSage/Petrel",
"path": "petrel/petrel/status.py",
"copies": "1",
"size": "3211",
"license": "bsd-3-clause",
"hash": -7576532625308812000,
"line_mean": 34.2857142857,
"line_max": 121,
"alpha_frac": 0.5630644659,
"autogenerated": false,
"ratio": 4.132561132561133,
"config_test": ... |
# Based on this code: http://tutorials.github.com/pages/retrieving-storm-data-from-nimbus.html
import datetime
from cStringIO import StringIO
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
import petrel.topologybuilder... | {
"repo_name": "arnaudsj/Petrel",
"path": "petrel/petrel/status.py",
"copies": "3",
"size": "3144",
"license": "bsd-3-clause",
"hash": 8020935130578943000,
"line_mean": 35.9882352941,
"line_max": 123,
"alpha_frac": 0.5756997455,
"autogenerated": false,
"ratio": 4.062015503875969,
"config_test": ... |
# Based on this file:
# https://github.com/pallets/werkzeug/blob/master/werkzeug/_reloader.py
import time, os, sys, subprocess
PY2 = sys.version_info[0] == 2
class Reloader(object):
RELOADING_CODE = 3
def start_process(self):
"""Spawn a new Python interpreter with the same arguments as this one,... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/580707_Reload_Tkinter_applicatilike/recipe-580707.py",
"copies": "1",
"size": "2249",
"license": "mit",
"hash": -4576423010840504300,
"line_mean": 29.8082191781,
"line_max": 78,
"alpha_frac": 0.5504668742,
"autogenerated": false,
"ratio": ... |
# based on this: http://wiki.tcl.tk/3314
import subprocess
import tkinter
from tkinter import messagebox
from porcupine import add_action, get_tab_manager, tabs
def start_xterm():
tab = tabs.Tab(get_tab_manager())
tab.title = "Terminal"
content = tkinter.Frame(tab, container=True)
content.pack(fill='... | {
"repo_name": "PurpleMyst/porcupine",
"path": "more_plugins/terminal.py",
"copies": "1",
"size": "1524",
"license": "mit",
"hash": -2912786430405557000,
"line_mean": 32.1304347826,
"line_max": 79,
"alpha_frac": 0.6404199475,
"autogenerated": false,
"ratio": 3.6990291262135924,
"config_test": fa... |
''' Based on Tinrtgu's FTRL code: http://www.kaggle.com/c/avazu-ctr-prediction/forums/t/10927/beat-the-benchmark-with-less-than-1mb-of-memory
'''
from csv import DictReader
from math import exp, copysign, log, sqrt
from datetime import datetime
import random
class FM_FTRL_machine(object):
def __init__(self, ... | {
"repo_name": "hnlaomie/python-tools",
"path": "kaggle/avazu/FM_FTRL_machine.py",
"copies": "1",
"size": "8088",
"license": "mit",
"hash": -4866865362595242000,
"line_mean": 32.9831932773,
"line_max": 187,
"alpha_frac": 0.4774975272,
"autogenerated": false,
"ratio": 3.550482879719052,
"config_t... |
# Based on to http://stackoverflow.com/a/25345286/1579481
"""
Copy a line by number where the cursor is
Example inputs:
For a single line: 25
For line 25 and next 2 lines: 25:2
For line 25 till 27: 25-27
"""
import sublime_plugin
import re
_line = re.compile('^\d+$')
_line_next = re.compile('^\d+\:\d+$')
... | {
"repo_name": "ionutvmi/sublimePacks",
"path": "copy_line.py",
"copies": "1",
"size": "3312",
"license": "mit",
"hash": -6138825946255610000,
"line_mean": 28.3097345133,
"line_max": 69,
"alpha_frac": 0.5202294686,
"autogenerated": false,
"ratio": 3.671840354767184,
"config_test": false,
"has_... |
# Based on tutorial by Alec Radford
# https://github.com/Newmu/Theano-Tutorials/blob/master/4_modern_net.py
import cgt
from cgt import nn
from cgt.distributions import categorical
import numpy as np
from example_utils import fmt_row, fetch_dataset
import time, sys
def init_weights(*shape):
return cgt.shared(np.ra... | {
"repo_name": "codeaudit/cgt",
"path": "examples/demo_mnist.py",
"copies": "9",
"size": "6107",
"license": "mit",
"hash": -7261115116757465000,
"line_mean": 35.5748502994,
"line_max": 120,
"alpha_frac": 0.6109382676,
"autogenerated": false,
"ratio": 2.737337516808606,
"config_test": true,
"ha... |
#Based on UPNP wemo hacking work from issackelly -> see https://github.com/issackelly/wemo
from libs.miranda import upnp, msearch
import os
import json
class wemoUtils:
def __init__(self):
self.conn = upnp()
# Returns list of wemo
def getListOfWemoOnNetwork(self):
msearch(0, 0, self.conn, 2)
listOfWemo = ... | {
"repo_name": "canvin/wemo",
"path": "wemo/wemoManager.py",
"copies": "1",
"size": "4710",
"license": "bsd-3-clause",
"hash": 7143517033362697000,
"line_mean": 29.3935483871,
"line_max": 90,
"alpha_frac": 0.6815286624,
"autogenerated": false,
"ratio": 2.905613818630475,
"config_test": false,
... |
# based on various examples from http://programarcadegames.com/python_examples
# also http://thepythongamebook.com
# TODO: might be fun to reskin for piggy banks that need feeding. Or plants and fertilizer?
import pygame
import random
#import splendgame
#import splendcards as ards
import splendconstants as ants
# T... | {
"repo_name": "joadavis/rpi-coding",
"path": "splendiferous/splendiferous.py",
"copies": "1",
"size": "14273",
"license": "mit",
"hash": -4664135580314163000,
"line_mean": 32.9833333333,
"line_max": 118,
"alpha_frac": 0.5569957262,
"autogenerated": false,
"ratio": 3.2468152866242037,
"config_te... |
# Note: other authors MUST include themselves in the above copyright notice
# in order to abide by the terms of the Apache license
from os.path import join
from ray.util.sgd.torch import TrainingOperator
from tqdm import trange
import torch.nn as nn
from timm.data import Dataset, create_loader
from timm.data... | {
"repo_name": "robertnishihara/ray",
"path": "python/ray/util/sgd/torch/examples/image_models/train.py",
"copies": "1",
"size": "4899",
"license": "apache-2.0",
"hash": -5299028338236046000,
"line_mean": 28.5120481928,
"line_max": 78,
"alpha_frac": 0.655644009,
"autogenerated": false,
"ratio": 3.... |
base_downloader_script = """import sys
import os, os.path
import tempfile, shutil
import time
from urllib.request import Request, urlopen
from urllib.error import HTTPError, URLError
from io import StringIO
try:
import datacube
except:
print("Error importing the Data Cube. Please ensure that your environment h... | {
"repo_name": "ceos-seo/data_cube_ui",
"path": "apps/data_cube_manager/templates/bulk_downloader.py",
"copies": "1",
"size": "5426",
"license": "apache-2.0",
"hash": 1965962353458301400,
"line_mean": 32.0853658537,
"line_max": 169,
"alpha_frac": 0.6306671581,
"autogenerated": false,
"ratio": 3.67... |
"""Base drudge for general quadratic algebra."""
import abc
import collections
import functools
import itertools
import operator
import typing
from pyspark import RDD
from sympy import sympify, Expr, Integer, KroneckerDelta, SympifyError
from .drudge import Drudge
from .term import Term, Vec, parse_terms, ATerms, Te... | {
"repo_name": "tschijnmo/drudge",
"path": "drudge/genquad.py",
"copies": "1",
"size": "13804",
"license": "mit",
"hash": -20502979078811280,
"line_mean": 30.0202247191,
"line_max": 80,
"alpha_frac": 0.5834540713,
"autogenerated": false,
"ratio": 3.9976831740515495,
"config_test": false,
"has_... |
# Based upon:
# http://stackoverflow.com/a/18143318/790973
"""
Usage:
.. exec::
echo "Shell code!"
"""
import codecs
from os.path import basename
import subprocess
import sys
import traceback
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from docutils import nodes, stat... | {
"repo_name": "chemreac/chemreac",
"path": "doc/extensions/exec_directive.py",
"copies": "2",
"size": "1744",
"license": "bsd-2-clause",
"hash": -7504030832230654000,
"line_mean": 28.0666666667,
"line_max": 79,
"alpha_frac": 0.619266055,
"autogenerated": false,
"ratio": 3.9817351598173514,
"con... |
import time
import matplotlib.pyplot as plt
# Import SPI library (for hardware SPI) and MCP3008 library.
import Adafruit_GPIO.SPI as SPI
import Adafruit_MCP3008
import RPi.GPIO as GPIO
# Hardware SPI configuration:
SPI_PORT = 0
SPI_DEVICE = 0
CS = [18,26,22]
mcp = Adafruit_MCP3008.MCP3008(spi=SPI.SpiDev(SPI_PORT, S... | {
"repo_name": "S7uXN37/NineMensMorrisBoard",
"path": "gpio-tests/hall_test.py",
"copies": "1",
"size": "2756",
"license": "mit",
"hash": -5597988856674625000,
"line_mean": 31.4235294118,
"line_max": 125,
"alpha_frac": 0.5380986938,
"autogenerated": false,
"ratio": 3.0352422907488985,
"config_te... |
# Based very loosely on the code at
# http://www.sqlalchemy.org/trac/wiki/UsageRecipes/Profiling
from sqlalchemy.engine import Connection
from time import time
from thread import get_ident
from weakref import ref
thread_query_logs = {}
def _time(fn):
start = time()
fn()
end = time()
return end - star... | {
"repo_name": "NetShepsky/Ferrox",
"path": "ferrox/lib/querylog.py",
"copies": "2",
"size": "2069",
"license": "mit",
"hash": 2631118788084027000,
"line_mean": 32.3709677419,
"line_max": 77,
"alpha_frac": 0.6544224263,
"autogenerated": false,
"ratio": 3.7893772893772892,
"config_test": false,
... |
"Base engine"
import tornado.web
from tornado import template, autoreload
from tornadio2 import SocketServer, TornadioRouter
from airy.core.conf import settings, _preconfigure
from airy.core import web
import os
AIRY_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '../')
class CommandManager(dict):
... | {
"repo_name": "letolab/airy",
"path": "airy/core/manager.py",
"copies": "1",
"size": "2878",
"license": "bsd-2-clause",
"hash": 6172808763688938000,
"line_mean": 30.2826086957,
"line_max": 99,
"alpha_frac": 0.6216122307,
"autogenerated": false,
"ratio": 3.796833773087071,
"config_test": false,
... |
# Base engine
import events
import threading
class Engine:
def __init__(self, config):
self.config = config
self.terminated = False
self.working_thread = threading.Thread(target=self.work_base)
# TODO: make in beauty too
self.on_join_listeners = []
self.on_leave_listeners = []
self.on_message_listene... | {
"repo_name": "d3adc0d3/DeadBot",
"path": "engines/base.py",
"copies": "1",
"size": "1735",
"license": "mit",
"hash": -8352896168020114000,
"line_mean": 21.5324675325,
"line_max": 63,
"alpha_frac": 0.6974063401,
"autogenerated": false,
"ratio": 3.092691622103387,
"config_test": false,
"has_no... |
"""Base entity class for Flo entities."""
from __future__ import annotations
from typing import Any
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.entity import DeviceInfo, Entity
from .const import DOMAIN as FLO_DOMAIN
from .device import FloDeviceDataUpdateCoord... | {
"repo_name": "kennedyshead/home-assistant",
"path": "homeassistant/components/flo/entity.py",
"copies": "2",
"size": "1758",
"license": "apache-2.0",
"hash": -6714829104048007000,
"line_mean": 30.3928571429,
"line_max": 88,
"alpha_frac": 0.6308304892,
"autogenerated": false,
"ratio": 4.107476635... |
"""Base Entity for all TelldusLive entities."""
from datetime import datetime
import logging
from homeassistant.const import ATTR_BATTERY_LEVEL, DEVICE_DEFAULT_NAME
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Ent... | {
"repo_name": "jabesq/home-assistant",
"path": "homeassistant/components/tellduslive/entry.py",
"copies": "1",
"size": "4181",
"license": "apache-2.0",
"hash": -6486469104082866000,
"line_mean": 30.6742424242,
"line_max": 72,
"alpha_frac": 0.6079885195,
"autogenerated": false,
"ratio": 4.21047331... |
"""Base Entity for all TelldusLiveEntities."""
from datetime import datetime
import logging
from homeassistant.const import ATTR_BATTERY_LEVEL, DEVICE_DEFAULT_NAME
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Enti... | {
"repo_name": "PetePriority/home-assistant",
"path": "homeassistant/components/tellduslive/entry.py",
"copies": "1",
"size": "4177",
"license": "apache-2.0",
"hash": -1655594640212331300,
"line_mean": 30.6439393939,
"line_max": 72,
"alpha_frac": 0.6078525257,
"autogenerated": false,
"ratio": 4.20... |
"""Base Entity for all TelldusLive entities."""
from datetime import datetime
import logging
from homeassistant.const import ATTR_BATTERY_LEVEL, DEVICE_DEFAULT_NAME
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Ent... | {
"repo_name": "fbradyirl/home-assistant",
"path": "homeassistant/components/tellduslive/entry.py",
"copies": "4",
"size": "4157",
"license": "apache-2.0",
"hash": -1700671528447343900,
"line_mean": 29.7925925926,
"line_max": 72,
"alpha_frac": 0.6114986769,
"autogenerated": false,
"ratio": 4.17788... |
"""Base Entity for all TelldusLive entities."""
from datetime import datetime
import logging
from tellduslive import BATTERY_LOW, BATTERY_OK, BATTERY_UNKNOWN
from homeassistant.const import ATTR_BATTERY_LEVEL, DEVICE_DEFAULT_NAME
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import asy... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/components/tellduslive/entry.py",
"copies": "3",
"size": "4139",
"license": "apache-2.0",
"hash": 1793657270810901000,
"line_mean": 29.4338235294,
"line_max": 72,
"alpha_frac": 0.6117419667,
"autogenerated": false,
"ratio": 4.1639839... |
"""Base entity."""
import validation
class Entity(object):
"""A GTFS Entity.
Parent-child relationships:
Agency ->
Route ->
Trip ->
StopTime ->
Stop
"""
ENTITY_TYPE = None
KEY = None
REQUIRED = []
OPTIONAL = []
def __init__(self, **data):
"""Row data fro... | {
"repo_name": "brechtvdv/mapzen-gtfs",
"path": "mzgtfs/entity.py",
"copies": "3",
"size": "3492",
"license": "mit",
"hash": -5186106593394261000,
"line_mean": 21.5290322581,
"line_max": 58,
"alpha_frac": 0.6148339061,
"autogenerated": false,
"ratio": 3.8843159065628474,
"config_test": false,
... |
""" Base entropy estimators on distributions. """
from scipy.special import psi, gamma
# from scipy.special import psi, gammaln
from numpy import floor, sqrt, concatenate, ones, sort, mean, log, absolute,\
exp, pi, sum, max, inf
from ite.cost.x_initialization import InitKnnK, InitX, InitKnnKAlpha, \... | {
"repo_name": "gdikov/vae-playground",
"path": "third_party/ite/cost/base_h.py",
"copies": "1",
"size": "19982",
"license": "mit",
"hash": -1709388404154724900,
"line_mean": 29.8840803709,
"line_max": 79,
"alpha_frac": 0.5262736463,
"autogenerated": false,
"ratio": 3.6258392306296496,
"config_t... |
"""Base entry models for Zinnia"""
from django.db import models
from django.db.models import Q
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from zinnia.settings import UPLOAD_TO
from zinnia.models_bases.entry import CoreEntry, Co... | {
"repo_name": "pczhaoyun/obtainfo",
"path": "blog/models.py",
"copies": "1",
"size": "3282",
"license": "apache-2.0",
"hash": -3390298625251221000,
"line_mean": 32.1515151515,
"line_max": 99,
"alpha_frac": 0.6584399756,
"autogenerated": false,
"ratio": 4.149178255372946,
"config_test": false,
... |
"""Base entry models for Zinnia"""
from django.db import models
from django.db.models import Q
from django.utils import timezone
from django.utils.html import strip_tags
from django.utils.html import linebreaks
from django.contrib.sites.models import Site
from django.contrib import comments
from django.contrib.comments... | {
"repo_name": "pczhaoyun/obtainfo",
"path": "zinnia/models_bases/entry.py",
"copies": "1",
"size": "15017",
"license": "apache-2.0",
"hash": -4434074895651666000,
"line_mean": 28.4450980392,
"line_max": 93,
"alpha_frac": 0.6139708331,
"autogenerated": false,
"ratio": 4.3552784222737815,
"config... |
"""Base entry models for Zinnia"""
import os
from django.contrib.sites.models import Site
from django.db import models
from django.db.models import Q
from django.template.defaultfilters import slugify
from django.urls import reverse
from django.utils import timezone
from django.utils.html import strip_tags
from django... | {
"repo_name": "Fantomas42/django-blog-zinnia",
"path": "zinnia/models_bases/entry.py",
"copies": "1",
"size": "16472",
"license": "bsd-3-clause",
"hash": 5161246457008043000,
"line_mean": 27.5972222222,
"line_max": 79,
"alpha_frac": 0.6069694026,
"autogenerated": false,
"ratio": 4.372710379612424... |
"""Base entry models for Zinnia"""
import os
from django.db import models
from django.db.models import Q
from django.utils import timezone
from django.utils.html import strip_tags
from django.utils.html import linebreaks
from django.contrib.sites.models import Site
from django.template.defaultfilters import slugify
fr... | {
"repo_name": "1844144/django-blog-zinnia",
"path": "zinnia/models_bases/entry.py",
"copies": "1",
"size": "15597",
"license": "bsd-3-clause",
"hash": -7800865240417989000,
"line_mean": 27.9369202226,
"line_max": 74,
"alpha_frac": 0.6108225941,
"autogenerated": false,
"ratio": 4.36890756302521,
... |
"""Base entry models for Zinnia"""
import os
from django.db import models
from django.db.models import Q
from django.utils import timezone
from django.utils.text import Truncator
from django.utils.html import strip_tags
from django.utils.html import linebreaks
from django.contrib.sites.models import Site
from django.t... | {
"repo_name": "ZuluPro/django-blog-zinnia",
"path": "zinnia/models_bases/entry.py",
"copies": "1",
"size": "16993",
"license": "bsd-3-clause",
"hash": -9107593259264681000,
"line_mean": 27.8016949153,
"line_max": 79,
"alpha_frac": 0.6070735009,
"autogenerated": false,
"ratio": 4.363893168977914,
... |
"""Base environment for full cluster tests.
Contains functions that all environments should implement along with functions
common to all environments.
"""
# pylint: disable=unused-argument
import json
import random
from vttest import sharding_utils
class VitessEnvironmentError(Exception):
pass
class BaseEnviro... | {
"repo_name": "theskyinflames/bpulse-go-client",
"path": "vendor/github.com/youtube/vitess/test/cluster/base_environment.py",
"copies": "2",
"size": "17865",
"license": "apache-2.0",
"hash": 6362419231653001000,
"line_mean": 32.7075471698,
"line_max": 80,
"alpha_frac": 0.667618248,
"autogenerated":... |
"""Base environment for full end2end tests.
Contains functions that all environments should implement along with functions
common to all environments.
"""
import json
from vttest import sharding_utils
class VitessEnvironmentError(Exception):
pass
class BaseEnvironment(object):
"""Base Environment."""
def _... | {
"repo_name": "dumbunny/vitess",
"path": "test/end2end/base_environment.py",
"copies": "3",
"size": "9939",
"license": "bsd-3-clause",
"hash": 3250958339473012000,
"line_mean": 32.0199335548,
"line_max": 80,
"alpha_frac": 0.6637488681,
"autogenerated": false,
"ratio": 3.855314197051978,
"config... |
"""Base environment for full end2end tests.
Contains functions that all environments should implement along with functions
common to all environments.
"""
import json
import utils
class VitessEnvironmentError(Exception):
pass
class BaseEnvironment(object):
"""Base Environment."""
def __init__(self):
se... | {
"repo_name": "guokeno0/vitess",
"path": "test/end2end/base_environment.py",
"copies": "4",
"size": "8135",
"license": "bsd-3-clause",
"hash": -4830733001650196000,
"line_mean": 31.1541501976,
"line_max": 80,
"alpha_frac": 0.6662569146,
"autogenerated": false,
"ratio": 3.9490291262135924,
"conf... |
"""Base environment for MuJoCo-based environments."""
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# 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/... | {
"repo_name": "google-research/relay-policy-learning",
"path": "adept_envs/adept_envs/mujoco_env.py",
"copies": "1",
"size": "7220",
"license": "apache-2.0",
"hash": -3203103549899451400,
"line_mean": 35.105,
"line_max": 121,
"alpha_frac": 0.5962603878,
"autogenerated": false,
"ratio": 3.97796143... |
"""Base environment for the Bay Bridge."""
import numpy as np
from collections import defaultdict
from flow.envs import Env
EDGE_LIST = [
'11198593', '236348360#1', '157598960', '11415208', '236348361',
'11198599', '35536683', '11198595.0', '11198595.656.0', "gneE5",
'340686911#3', '23874736', '119057701'... | {
"repo_name": "cathywu/flow",
"path": "flow/envs/bay_bridge/base.py",
"copies": "1",
"size": "10082",
"license": "mit",
"hash": -7212487150349966000,
"line_mean": 39.4899598394,
"line_max": 79,
"alpha_frac": 0.523408054,
"autogenerated": false,
"ratio": 3.4934164934164933,
"config_test": false,... |
"""Base estimator adapted from scikit-learn."""
import warnings
import inspect
from distutils.version import LooseVersion
##############################################################################
# adapted from scikit-learn
_DEFAULT_TAGS = {
'non_deterministic': False,
'requires_positive_X': False,
... | {
"repo_name": "glm-tools/pyglmnet",
"path": "pyglmnet/base.py",
"copies": "1",
"size": "7696",
"license": "mit",
"hash": -2954392186491007000,
"line_mean": 35.8229665072,
"line_max": 78,
"alpha_frac": 0.5418399168,
"autogenerated": false,
"ratio": 4.843297671491504,
"config_test": false,
"has... |
""" base estimator class for megaman """
# Author: James McQueen -- <jmcq@u.washington.edu>
# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE
import numpy as np
from scipy.sparse import isspmatrix
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils.validation impo... | {
"repo_name": "jmcq89/megaman",
"path": "megaman/embedding/base.py",
"copies": "4",
"size": "5249",
"license": "bsd-2-clause",
"hash": 167342051043907400,
"line_mean": 35.7062937063,
"line_max": 81,
"alpha_frac": 0.582396647,
"autogenerated": false,
"ratio": 4.028396009209517,
"config_test": fa... |
"""Base estimator class."""
# Copyright 2015-present Scikit Flow Authors. All Rights Reserved.
#
# 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... | {
"repo_name": "dansbecker/skflow",
"path": "skflow/estimators/base.py",
"copies": "1",
"size": "21268",
"license": "apache-2.0",
"hash": -6503542613807347000,
"line_mean": 43.4937238494,
"line_max": 99,
"alpha_frac": 0.597893549,
"autogenerated": false,
"ratio": 4.383347073371805,
"config_test"... |
'''base expcontrol functionality.'''
import datetime
import functools
import numpy
from . import event
def addcustomdict(funhand):
'''
Decorator for save functionality (currently in Experiment class).
'''
@functools.wraps(funhand)
def wrapper(*args, **kwargs): # pylint: disable=missing-docstring
... | {
"repo_name": "jooh/py-expcontrol",
"path": "expcontrol/base.py",
"copies": "1",
"size": "5860",
"license": "isc",
"hash": 4457867929884984300,
"line_mean": 38.5945945946,
"line_max": 83,
"alpha_frac": 0.6298634812,
"autogenerated": false,
"ratio": 4.466463414634147,
"config_test": false,
"ha... |
"""Base extension class for writing new extensions."""
from grow.common import features
class Error(Exception):
"""Base error."""
pass
class MissingHookError(Error):
"""Missing hook error."""
pass
class BaseExtension(object):
"""Base extension for custom extensions."""
def __init__(self,... | {
"repo_name": "grow/pygrow",
"path": "grow/extensions/base_extension.py",
"copies": "1",
"size": "1421",
"license": "mit",
"hash": 6195961988840487000,
"line_mean": 26.3269230769,
"line_max": 68,
"alpha_frac": 0.584799437,
"autogenerated": false,
"ratio": 4.440625,
"config_test": true,
"has_n... |
"""Base extension interface"""
import yaml
from six.moves.urllib.parse import parse_qs
class YamlSettingsExtension:
"""Extension Interface"""
protocols = ()
# Dictionary of expected kwargs and flag for json loading values (bool/int)
default_query = {}
not_found_exception = IOError
@classmeth... | {
"repo_name": "KyleJamesWalker/yamlsettings",
"path": "yamlsettings/extensions/base.py",
"copies": "1",
"size": "1613",
"license": "mit",
"hash": -3564950266406702600,
"line_mean": 32.6041666667,
"line_max": 79,
"alpha_frac": 0.6286422815,
"autogenerated": false,
"ratio": 4.648414985590778,
"co... |
''' Base Extractor class and associated functionality. '''
from abc import ABCMeta, abstractmethod
import json
import pandas as pd
import numpy as np
from pandas.api.types import is_numeric_dtype
from pliers.transformers import Transformer
from pliers.utils import isgenerator, flatten, listify
class Extractor(Tran... | {
"repo_name": "tyarkoni/pliers",
"path": "pliers/extractors/base.py",
"copies": "1",
"size": "17023",
"license": "bsd-3-clause",
"hash": -105641542957298060,
"line_mean": 46.0248618785,
"line_max": 83,
"alpha_frac": 0.5940198555,
"autogenerated": false,
"ratio": 4.452785770337432,
"config_test"... |
"""Base Fanfic class."""
import sys
import os
from collections import OrderedDict
import concurrent.futures
import requests
from requests.auth import HTTPBasicAuth
import urllib.parse
class BaseFanfic:
""" Base Fanfic class. Contains chapters."""
def __init__(self, fanfic_url, program_args):
"""Init ... | {
"repo_name": "KebinuChiousu/FanfictionDB",
"path": "fanfic_scraper/base_fanfic.py",
"copies": "1",
"size": "4940",
"license": "bsd-3-clause",
"hash": -2176844027971495400,
"line_mean": 32.1543624161,
"line_max": 78,
"alpha_frac": 0.5979757085,
"autogenerated": false,
"ratio": 4.059161873459326,
... |
_base_ = '../faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
model = dict(
neck=dict(
type='FPN_CARAFE',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
num_outs=5,
start_level=0,
end_level=-1,
norm_cfg=None,
act_cfg=None,
order=('conv', 'nor... | {
"repo_name": "open-mmlab/mmdetection",
"path": "configs/carafe/faster_rcnn_r50_fpn_carafe_1x_coco.py",
"copies": "1",
"size": "1640",
"license": "apache-2.0",
"hash": -8798452874844048000,
"line_mean": 31.8,
"line_max": 77,
"alpha_frac": 0.5597560976,
"autogenerated": false,
"ratio": 3.241106719... |
_base_ = '../faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
backbone=dict(
type='ResNeSt',
stem_channels=64,
depth=50,
radix=2,
reduction_factor=4,
avg_down_stride=True,
num_stages=4,
out_in... | {
"repo_name": "open-mmlab/mmdetection",
"path": "configs/resnest/faster_rcnn_s50_fpn_syncbn-backbone+head_mstrain-range_1x_coco.py",
"copies": "1",
"size": "1947",
"license": "apache-2.0",
"hash": -8640533216693704000,
"line_mean": 30.4032258065,
"line_max": 79,
"alpha_frac": 0.5665125835,
"autogen... |
_base_ = 'faster_rcnn_r50_fpn_crop640_50e_coco.py'
norm_cfg = dict(type='BN', requires_grad=True)
model = dict(
neck=dict(
type='FPG',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
inter_channels=256,
num_outs=5,
stack_times=9,
paths=['bu'] * 9,
... | {
"repo_name": "open-mmlab/mmdetection",
"path": "configs/fpg/faster_rcnn_r50_fpg_crop640_50e_coco.py",
"copies": "1",
"size": "1452",
"license": "apache-2.0",
"hash": 2180819256725247000,
"line_mean": 29.25,
"line_max": 64,
"alpha_frac": 0.4573002755,
"autogenerated": false,
"ratio": 3.5414634146... |
_base_ = 'faster_rcnn_r50_fpn_mstrain_3x_coco.py'
model = dict(
backbone=dict(
norm_cfg=dict(requires_grad=False),
norm_eval=True,
style='caffe',
init_cfg=dict(
type='Pretrained',
checkpoint='open-mmlab://detectron2/resnet50_caffe')))
# use caffe img_norm
img... | {
"repo_name": "open-mmlab/mmdetection",
"path": "configs/faster_rcnn/faster_rcnn_r50_caffe_fpn_mstrain_3x_coco.py",
"copies": "1",
"size": "1505",
"license": "apache-2.0",
"hash": -2620515256315574000,
"line_mean": 31.0212765957,
"line_max": 72,
"alpha_frac": 0.5813953488,
"autogenerated": false,
... |
_base_ = '../fast_rcnn/fast_rcnn_r50_fpn_1x_coco.py'
model = dict(
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
norm_eval=True,
style='caffe',
in... | {
"repo_name": "open-mmlab/mmdetection",
"path": "configs/guided_anchoring/ga_fast_r50_caffe_fpn_1x_coco.py",
"copies": "1",
"size": "2407",
"license": "apache-2.0",
"hash": 4917795134418901000,
"line_mean": 36.0307692308,
"line_max": 78,
"alpha_frac": 0.5953469049,
"autogenerated": false,
"ratio"... |
_base_ = './fcos_hrnetv2p_w32_gn-head_4x4_1x_coco.py'
img_norm_cfg = dict(
mean=[103.53, 116.28, 123.675], std=[57.375, 57.12, 58.395], to_rgb=False)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='Resize',
img_scale=[(1333, 64... | {
"repo_name": "open-mmlab/mmdetection",
"path": "configs/hrnet/fcos_hrnetv2p_w32_gn-head_mstrain_640-800_4x4_2x_coco.py",
"copies": "1",
"size": "1337",
"license": "apache-2.0",
"hash": 5852854833597434000,
"line_mean": 33.2820512821,
"line_max": 78,
"alpha_frac": 0.593118923,
"autogenerated": fals... |
_base_ = './fcos_r50_caffe_fpn_gn-head_1x_coco.py'
img_norm_cfg = dict(
mean=[102.9801, 115.9465, 122.7717], std=[1.0, 1.0, 1.0], to_rgb=False)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='Resize',
img_scale=[(1333, 640), (1... | {
"repo_name": "open-mmlab/mmdetection",
"path": "configs/fcos/fcos_r50_caffe_fpn_gn-head_mstrain_640-800_2x_coco.py",
"copies": "1",
"size": "1331",
"license": "apache-2.0",
"hash": 6282424753918429000,
"line_mean": 33.1282051282,
"line_max": 75,
"alpha_frac": 0.5912847483,
"autogenerated": false,
... |
""" Base file for all Pythran tests. """
from imp import load_dynamic
from numpy import float32, float64
from numpy import int8, int16, int32, int64, uint8, uint16, uint32, uint64
from numpy import ndarray, isnan, isinf, isneginf, complex128, complex64, bool_
from textwrap import dedent
import copy
import math
import ... | {
"repo_name": "pombredanne/pythran",
"path": "pythran/tests/test_env.py",
"copies": "2",
"size": "17313",
"license": "bsd-3-clause",
"hash": -609017072095185000,
"line_mean": 38.5273972603,
"line_max": 80,
"alpha_frac": 0.5636804713,
"autogenerated": false,
"ratio": 4.32825,
"config_test": true... |
''' Base Filter class and associated functionality. '''
from abc import ABCMeta, abstractmethod
import logging
from pliers.stimuli import AudioStim, VideoStim
from pliers.transformers import Transformer
from pliers.utils import listify
class Filter(Transformer, metaclass=ABCMeta):
''' Base class for Filters.'''... | {
"repo_name": "tyarkoni/pliers",
"path": "pliers/filters/base.py",
"copies": "2",
"size": "2751",
"license": "bsd-3-clause",
"hash": -5723541213161927000,
"line_mean": 39.4558823529,
"line_max": 81,
"alpha_frac": 0.6172300981,
"autogenerated": false,
"ratio": 4.3119122257053295,
"config_test": ... |
"""Base fixtures"""
import copy
import datetime
import json
import shutil
from copy import deepcopy
from pathlib import Path
from typing import List
import pytest
import yaml
from housekeeper.date import get_date
from housekeeper.store import Store, models
from .helper_functions import Helpers
# basic fixtures
@p... | {
"repo_name": "Clinical-Genomics/housekeeper",
"path": "tests/conftest.py",
"copies": "1",
"size": "11409",
"license": "mit",
"hash": 8110606293730499000,
"line_mean": 30.0027173913,
"line_max": 99,
"alpha_frac": 0.6628977123,
"autogenerated": false,
"ratio": 3.4148458545345703,
"config_test": ... |
"""Base for all node resource services."""
from __future__ import absolute_import
import abc
import collections
import contextlib
import errno
import functools
import glob
import importlib
import logging
import os
import select
import shutil
import socket
import struct
import tempfile
import time
import yaml
from .... | {
"repo_name": "toenuff/treadmill",
"path": "lib/python/treadmill/services/_base_service.py",
"copies": "1",
"size": "27932",
"license": "apache-2.0",
"hash": 167751125608360900,
"line_mean": 30.7048808173,
"line_max": 79,
"alpha_frac": 0.5424244594,
"autogenerated": false,
"ratio": 4.220610456331... |
"""Base for all node resource services.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import abc
import collections
import contextlib
import errno
import functools
import glob
import importlib
import io
import l... | {
"repo_name": "captiosus/treadmill",
"path": "treadmill/services/_base_service.py",
"copies": "1",
"size": "27622",
"license": "apache-2.0",
"hash": -604198657624049900,
"line_mean": 30.7494252874,
"line_max": 79,
"alpha_frac": 0.5432988198,
"autogenerated": false,
"ratio": 4.215168625057226,
"... |
"""Base for all node resource services."""
import abc
import collections
import contextlib
import errno
import functools
import glob
import importlib
import logging
import os
import select
import shutil
import socket
import struct
import tempfile
import time
import yaml
from .. import exc
from .. import fs
from .. ... | {
"repo_name": "ThoughtWorksInc/treadmill",
"path": "treadmill/services/_base_service.py",
"copies": "3",
"size": "27602",
"license": "apache-2.0",
"hash": -7559380524594261000,
"line_mean": 30.8362168397,
"line_max": 79,
"alpha_frac": 0.5417723353,
"autogenerated": false,
"ratio": 4.1967462368861... |
# Base for anonymous user
import os
from selenium import webdriver
import numpy as np
from selenium.webdriver.common.keys import Keys
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from .factories import ChartFactory
from django.conf import settings
import contextlib
class FunctionalTest_a(St... | {
"repo_name": "frRoy/Benchmarklib",
"path": "benchmarklib/tests_functional/base_a.py",
"copies": "1",
"size": "2076",
"license": "bsd-3-clause",
"hash": 6634505713400377000,
"line_mean": 33.6,
"line_max": 97,
"alpha_frac": 0.6045279383,
"autogenerated": false,
"ratio": 3.767695099818512,
"confi... |
"""Base for Hass.io entities."""
from __future__ import annotations
from typing import Any
from homeassistant.const import ATTR_NAME
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import DOMAIN, HassioDataUpdateCoordinator
from .const... | {
"repo_name": "kennedyshead/home-assistant",
"path": "homeassistant/components/hassio/entity.py",
"copies": "2",
"size": "2881",
"license": "apache-2.0",
"hash": 435761465701712000,
"line_mean": 29.0104166667,
"line_max": 93,
"alpha_frac": 0.6233946546,
"autogenerated": false,
"ratio": 4.06920903... |
"""Base for Hass.io entities."""
from __future__ import annotations
from typing import Any
from homeassistant.const import ATTR_NAME
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import DOMAIN, HassioDataUpdateCoordinator
from .const import ATTR_SLUG
class HassioAddonEntity(Coordina... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/components/hassio/entity.py",
"copies": "3",
"size": "2837",
"license": "apache-2.0",
"hash": 5284251298113705000,
"line_mean": 28.8631578947,
"line_max": 93,
"alpha_frac": 0.6168487839,
"autogenerated": false,
"ratio": 4.02982954545... |
"""Base for Hass.io entities."""
from typing import Any, Dict
from homeassistant.const import ATTR_NAME
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import DOMAIN, HassioDataUpdateCoordinator
from .const import ATTR_SLUG
class HassioAddonEntity(CoordinatorEntity):
"""Base entity... | {
"repo_name": "partofthething/home-assistant",
"path": "homeassistant/components/hassio/entity.py",
"copies": "1",
"size": "2807",
"license": "mit",
"hash": 4448228661450123000,
"line_mean": 29.1827956989,
"line_max": 93,
"alpha_frac": 0.6152475953,
"autogenerated": false,
"ratio": 4.021489971346... |
"""Base for HTTP endpoint plugins."""
import abc
import copy
import werkzeug.routing
class Endpoint(metaclass=abc.ABCMeta):
"""
Base HTTP endpoint.
Subclasses must implement `url` and `handle`. `url` is a URL pattern in
the standard Werkzeug/Flask form, and `handle` is the method which is
actua... | {
"repo_name": "prophile/jacquard",
"path": "jacquard/service/base.py",
"copies": "1",
"size": "2962",
"license": "mit",
"hash": 331287384768643840,
"line_mean": 28.62,
"line_max": 85,
"alpha_frac": 0.613436867,
"autogenerated": false,
"ratio": 4.839869281045751,
"config_test": false,
"has_no_... |
"""Base formatter class."""
from abc import abstractmethod, ABCMeta
from .registry import register
def counter():
"""Simple Iteratable Counter.
Starting from 0, will continue to give a new counter number every time
this function is iterated over, or with the use of `next()`
Yields:
{int} Cu... | {
"repo_name": "adambullmer/sublime-docblockr-python",
"path": "formatters/base.py",
"copies": "2",
"size": "5853",
"license": "mit",
"hash": 1688946063360282000,
"line_mean": 30.2994652406,
"line_max": 87,
"alpha_frac": 0.6137023749,
"autogenerated": false,
"ratio": 4.777959183673469,
"config_t... |
"""Base form classes for rendering light-compatible html"""
from django.db import models
from django.forms.forms import BaseForm
from django.utils.html import conditional_escape
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
import re
class BaseFormRenderer(BaseForm):
... | {
"repo_name": "AmatanHead/collective-blog",
"path": "s_appearance/forms.py",
"copies": "1",
"size": "4797",
"license": "mit",
"hash": -4545510842115445000,
"line_mean": 31.1946308725,
"line_max": 104,
"alpha_frac": 0.5194913488,
"autogenerated": false,
"ratio": 4.388838060384264,
"config_test":... |
"""Base formgrade authenticator."""
from traitlets.config.configurable import LoggingConfigurable
class BaseAuth(LoggingConfigurable):
"""Base formgrade authenticator."""
def __init__(self, app, ip, port, base_directory, **kwargs):
super(BaseAuth, self).__init__(**kwargs)
self._app = app
... | {
"repo_name": "dementrock/nbgrader",
"path": "nbgrader/auth/base.py",
"copies": "1",
"size": "1076",
"license": "bsd-3-clause",
"hash": -2092191846555394300,
"line_mean": 26.5897435897,
"line_max": 73,
"alpha_frac": 0.6096654275,
"autogenerated": false,
"ratio": 4.446280991735537,
"config_test"... |
"""Base for models"""
import logging
import os
import tensorflow as tf
from tqdm import trange
from ..layers import dense_with_weight_norm
logger = logging.getLogger(__name__)
class BaseBlock(object):
def __init__(self, scope, reuse):
self.scope = scope
self.reuse = reuse
def log_name(sel... | {
"repo_name": "shaform/DeepNetworks",
"path": "deep_networks/models/base.py",
"copies": "1",
"size": "6500",
"license": "apache-2.0",
"hash": 6609652314035269000,
"line_mean": 31.0197044335,
"line_max": 79,
"alpha_frac": 0.5693846154,
"autogenerated": false,
"ratio": 3.910950661853189,
"config_... |
"""Base forms for use in newsletter subscribing"""
from django import forms
from django.utils.translation import ugettext_lazy as _
from satchmo_ext.newsletter import update_subscription
from satchmo_ext.newsletter.models import get_contact_or_fake
_NOTSET = object()
class OptionalBoolean(forms.BooleanField):
de... | {
"repo_name": "mitchellzen/pops",
"path": "satchmo/apps/satchmo_ext/newsletter/forms.py",
"copies": "13",
"size": "1173",
"license": "bsd-3-clause",
"hash": -8878449541672279000,
"line_mean": 36.8387096774,
"line_max": 85,
"alpha_frac": 0.6777493606,
"autogenerated": false,
"ratio": 3.92307692307... |
"""Base forms for use in newsletter subscribing"""
from django import forms
from django.utils.translation import ugettext_lazy as _
from satchmo.newsletter import update_subscription
from satchmo.newsletter.models import get_contact_or_fake
_NOTSET = object()
class OptionalBoolean(forms.BooleanField):
def __init... | {
"repo_name": "roadhead/satchmo",
"path": "satchmo/newsletter/forms.py",
"copies": "2",
"size": "1165",
"license": "bsd-3-clause",
"hash": -9115768758508218000,
"line_mean": 36.5806451613,
"line_max": 85,
"alpha_frac": 0.6772532189,
"autogenerated": false,
"ratio": 3.9491525423728815,
"config_t... |
"""Base for socket communication
"""
import json
import socket
import os.path
import logging
class BaseSocket(object):
"""Base class to represent a socket.
It implements common operations in a very basic way:
* Send data
* Receive data
In this implementation the data is serialized before being... | {
"repo_name": "Darkheir/arithmetic-computing",
"path": "arithmetic_computing/communication/base_socket.py",
"copies": "1",
"size": "2577",
"license": "mit",
"hash": 7889945941880227000,
"line_mean": 32.0384615385,
"line_max": 77,
"alpha_frac": 0.6476523089,
"autogenerated": false,
"ratio": 4.5449... |
""" Base for Taggers """
from logging import getLogger
class Tagger:
"""
Base class for word taggers
Attributes
----------
config : minette.Config
Configuration
timezone : pytz.timezone
Timezone
logger : logging.Logger
Logger
"""
MAX_LENGTH = 1000
def ... | {
"repo_name": "uezo/minette-python",
"path": "minette/tagger/base.py",
"copies": "1",
"size": "2076",
"license": "apache-2.0",
"hash": 7441338086398621000,
"line_mean": 23.7142857143,
"line_max": 71,
"alpha_frac": 0.5197495183,
"autogenerated": false,
"ratio": 4.839160839160839,
"config_test": ... |
"""Base FPCore interpreter."""
import itertools
import traceback
from ..titanic import utils, digital
from ..fpbench import fpcast as ast
from .evalctx import EvalCtx
from ..titanic import ndarray
class EvaluatorError(utils.TitanicError):
"""Base Titanic evaluator error."""
class EvaluatorUnimplementedError(E... | {
"repo_name": "billzorn/fpunreal",
"path": "titanfp/arithmetic/interpreter.py",
"copies": "1",
"size": "35036",
"license": "mit",
"hash": -7140105751470825000,
"line_mean": 35.4958333333,
"line_max": 138,
"alpha_frac": 0.5584256194,
"autogenerated": false,
"ratio": 3.5007993605115906,
"config_t... |
"""Base frame with menu."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
__cvsid__ = "$Id$"
__revision__ = "$Revision$"[11:-2]
import wx
import os
from version import VERSION
import editwindow
import dispatcher
ID_NEW = wx.ID_NEW
ID_OPEN = wx.ID_OPEN
ID_REVERT = wx.ID_REVERT
ID_CLOSE = wx.I... | {
"repo_name": "ktan2020/legacy-automation",
"path": "win/Lib/site-packages/wx-3.0-msw/wx/py/frame.py",
"copies": "1",
"size": "40485",
"license": "mit",
"hash": 8821938627072699000,
"line_mean": 39.1432926829,
"line_max": 96,
"alpha_frac": 0.5570705199,
"autogenerated": false,
"ratio": 3.69962533... |
"""Base FTP module for connecting to FTP servers."""
from ftplib import FTP, error_perm
import os
import contextlib
from OrthoEvol.utilities import FunctionRepeater
class BaseFTPClient(object):
"""The BaseFTP class provides basic functions for managing ftp clients.
.. seealso:: :class:`NcbiFTPClient`
""... | {
"repo_name": "datasnakes/Datasnakes-Scripts",
"path": "OrthoEvol/Tools/ftp/baseftp.py",
"copies": "1",
"size": "2887",
"license": "mit",
"hash": 2202508780034321400,
"line_mean": 32.183908046,
"line_max": 98,
"alpha_frac": 0.6262556287,
"autogenerated": false,
"ratio": 4.196220930232558,
"conf... |
"Base Fts class."
from django.db import transaction
from django.db import models
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
class InvalidFtsBackendError(ImproperlyConfigured):
pass
class BaseClass(object):
class Meta:
abstract = True
clas... | {
"repo_name": "tobych/django-fts",
"path": "fts/backends/base.py",
"copies": "2",
"size": "3839",
"license": "bsd-3-clause",
"hash": -2205286572959122000,
"line_mean": 33.5462962963,
"line_max": 111,
"alpha_frac": 0.5978119302,
"autogenerated": false,
"ratio": 4.337853107344633,
"config_test": ... |
"Base Fts class."
from django.db import transaction
from django.db import models
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
VALID_WEIGHTS = ('A', 'B', 'C', 'D')
class InvalidFtsBackendError(ImproperlyConfigured):
pass
class BaseClass(object):
clas... | {
"repo_name": "mjtorn/django-fts-redux",
"path": "fts/backends/base.py",
"copies": "1",
"size": "3710",
"license": "bsd-3-clause",
"hash": -263979081035511700,
"line_mean": 32.0366972477,
"line_max": 111,
"alpha_frac": 0.5916442049,
"autogenerated": false,
"ratio": 4.41141498216409,
"config_tes... |
"""Base functionality for fancy validation."""
from operator import attrgetter
from flatland.schema.util import find_i18n_function
import six
N_ = lambda translatable: translatable
P_ = lambda *translatable: translatable
_ugettext_finder = attrgetter('ugettext')
_ungettext_finder = attrgetter('ungettext')
class Va... | {
"repo_name": "mbr/flatland0",
"path": "flatland/validation/base.py",
"copies": "1",
"size": "10283",
"license": "mit",
"hash": -9100607749325134000,
"line_mean": 31.4384858044,
"line_max": 79,
"alpha_frac": 0.578527667,
"autogenerated": false,
"ratio": 4.719137218907756,
"config_test": false,
... |
"""Base functionality for fancy validation."""
from operator import attrgetter
from flatland.schema.util import find_i18n_function
N_ = lambda translatable: translatable
P_ = lambda *translatable: translatable
_ugettext_finder = attrgetter('ugettext')
_ungettext_finder = attrgetter('ungettext')
class Validator(obj... | {
"repo_name": "wheeler-microfluidics/flatland-fork",
"path": "flatland/validation/base.py",
"copies": "4",
"size": "10269",
"license": "mit",
"hash": -5484891784853215000,
"line_mean": 31.496835443,
"line_max": 79,
"alpha_frac": 0.5781478235,
"autogenerated": false,
"ratio": 4.723551057957682,
... |
"""Base functionality for font-providers (objects creating fonts)"""
import traceback, weakref
import logging
log = logging.getLogger( __name__ )
class FontProvider( object ):
"""Abstract base class for font-providers
The font-provider allows you to get a system-specific
font via the currently registered ... | {
"repo_name": "alexus37/AugmentedRealityChess",
"path": "pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGLContext/scenegraph/text/fontprovider.py",
"copies": "2",
"size": "6042",
"license": "mit",
"hash": 7008598604113343000,
"line_mean": 37.7307692308,
"line_ma... |
"""Base functionality of ffmpeg HA wrapper."""
import asyncio
import functools
import logging
import re
import shlex
import subprocess
from typing import List, Optional
_LOGGER = logging.getLogger(__name__)
FFMPEG_STDOUT = "stdout"
FFMPEG_STDERR = "stderr"
class HAFFmpeg:
"""HA FFmpeg process async.
Object... | {
"repo_name": "pvizeli/ha-ffmpeg",
"path": "haffmpeg/core.py",
"copies": "1",
"size": "8565",
"license": "bsd-3-clause",
"hash": -5393086931762908000,
"line_mean": 29.5892857143,
"line_max": 78,
"alpha_frac": 0.5481611208,
"autogenerated": false,
"ratio": 4.238000989609104,
"config_test": false... |
#base functions library
from leggidati import *
from irc_con import *
import time
import datetime
ambiente_attivo = ''
#le funzioni di ambiente assegnano il loro identificativo a ambiente_attivo
r=0
started=0
secondi=int(time.time())
def ircsend ( messaggio ): #azione base
irc.send ( messaggio+'\r\n' )
print da... | {
"repo_name": "izabera/izabot",
"path": "bas_lib.py",
"copies": "1",
"size": "1296",
"license": "mit",
"hash": -3405059643048092700,
"line_mean": 26.5744680851,
"line_max": 85,
"alpha_frac": 0.675154321,
"autogenerated": false,
"ratio": 2.7751605995717346,
"config_test": false,
"has_no_keywor... |
# basefunctions.py - Python module that provides basic functionality needed by
# other modules of the flexible data generation system.
#
# Peter Christen and Dinusha Vatsalan, January-March 2012
# =============================================================================
#
# This Source Code Form... | {
"repo_name": "kdurril/mvp_app",
"path": "geco/basefunctions.py",
"copies": "1",
"size": "20033",
"license": "mit",
"hash": -4151286827867059000,
"line_mean": 32.9542372881,
"line_max": 79,
"alpha_frac": 0.551689712,
"autogenerated": false,
"ratio": 3.606949945984876,
"config_test": false,
"h... |
"""Base generator."""
import math
import typing
import keras
import numpy as np
import pandas as pd
import matchzoo as mz
from matchzoo.data_generator.callbacks import Callback
class DataGenerator(keras.utils.Sequence):
"""
Data Generator.
Used to divide a :class:`matchzoo.DataPack` into batches. This... | {
"repo_name": "faneshion/MatchZoo",
"path": "matchzoo/data_generator/data_generator.py",
"copies": "1",
"size": "9187",
"license": "apache-2.0",
"hash": -5420735633273618000,
"line_mean": 30.3549488055,
"line_max": 78,
"alpha_frac": 0.5379340372,
"autogenerated": false,
"ratio": 3.850377200335289... |
# base generator with common functionality
import re
from pseudo.pseudo_tree import Node
from pseudo.code_generator_dsl import Placeholder, Newline, Action, Function, SubTemplate, SubElement, PseudoType, Whitespace, Offset, INTERNAL_WHITESPACE, NEWLINE
from pseudo.middlewares import AugAssignmentMiddleware
LINE_FIRS = ... | {
"repo_name": "alehander42/pseudo",
"path": "pseudo/code_generator.py",
"copies": "1",
"size": "16322",
"license": "mit",
"hash": 30278959080752920,
"line_mean": 35.0309050773,
"line_max": 233,
"alpha_frac": 0.4579708369,
"autogenerated": false,
"ratio": 4.382921589688507,
"config_test": false,... |
"""Base geometry class and utilities
"""
from ctypes import pointer, c_size_t, c_char_p, c_void_p
import sys
import warnings
from shapely.coords import CoordinateSequence
from shapely.ftools import wraps
from shapely.geos import lgeos, ReadingError
from shapely.impl import DefaultImplementation, delegated
GEOMETRY_T... | {
"repo_name": "31415us/trajectory",
"path": "py/env/lib/python2.7/site-packages/shapely/geometry/base.py",
"copies": "1",
"size": "19791",
"license": "mit",
"hash": 1969799774299465000,
"line_mean": 29.1232876712,
"line_max": 80,
"alpha_frac": 0.5917336163,
"autogenerated": false,
"ratio": 4.2828... |
"""Base geometry class and utilities
"""
import sys
from warnings import warn
from binascii import a2b_hex
from ctypes import pointer, c_size_t, c_char_p, c_void_p
from shapely.coords import CoordinateSequence
from shapely.ftools import wraps
from shapely.geos import lgeos, ReadingError
from shapely.geos import WKBWr... | {
"repo_name": "abali96/Shapely",
"path": "shapely/geometry/base.py",
"copies": "5",
"size": "28372",
"license": "bsd-3-clause",
"hash": 5735338353151593000,
"line_mean": 30.6651785714,
"line_max": 79,
"alpha_frac": 0.5796912449,
"autogenerated": false,
"ratio": 4.213871973860092,
"config_test":... |
"""Base geometry class and utilities
"""
import sys
import warnings
from shapely.coords import CoordinateSequence
from shapely.ftools import wraps
from shapely.geos import lgeos
from shapely.impl import DefaultImplementation, delegated
from shapely import wkb, wkt
GEOMETRY_TYPES = [
'Point',
'LineString',
'Lin... | {
"repo_name": "aaronr/shapely",
"path": "shapely/geometry/base.py",
"copies": "1",
"size": "17873",
"license": "bsd-3-clause",
"hash": 1508367105394179000,
"line_mean": 28.8879598662,
"line_max": 80,
"alpha_frac": 0.5888211268,
"autogenerated": false,
"ratio": 4.355019493177388,
"config_test": ... |
"""Base GRR module class. GRR modules should extend it."""
import abc
import tempfile
import time
from grr_api_client import api as grr_api
from grr_api_client import errors as grr_errors
from dftimewolf.lib import module
class GRRBaseModule(module.BaseModule):
"""Base module for GRR hunt and flow modules.
Att... | {
"repo_name": "log2timeline/dftimewolf",
"path": "dftimewolf/lib/collectors/grr_base.py",
"copies": "1",
"size": "4572",
"license": "apache-2.0",
"hash": -4921546293477953000,
"line_mean": 35.2857142857,
"line_max": 79,
"alpha_frac": 0.6391076115,
"autogenerated": false,
"ratio": 3.92783505154639... |
#base_gui.py
from tkinter import *
import time
class App:
'''
Inspired by Ryan Godfrey's YouTube tutorial about tkinter
(https://www.youtube.com/watch?v=v8YQYKDqLME), the App instance
creates a pop up GUI, which will eventually be how the user interacts
with todo-more.
Ri... | {
"repo_name": "emmagras/todo-more",
"path": "todo-more/gui/base_gui.py",
"copies": "1",
"size": "3460",
"license": "mit",
"hash": -3560176006937625600,
"line_mean": 37.8876404494,
"line_max": 98,
"alpha_frac": 0.5395953757,
"autogenerated": false,
"ratio": 4.314214463840399,
"config_test": fals... |
"""Base handler class."""
import inspect
import functools
from asyncio import coroutine, iscoroutine
import ujson as json
from aiohttp.hdrs import METH_ANY
from aiohttp.multidict import MultiDict, MultiDictProxy
from aiohttp.web import StreamResponse, HTTPMethodNotAllowed, Response, View
from muffin.urls import route... | {
"repo_name": "drgarcia1986/muffin",
"path": "muffin/handler.py",
"copies": "1",
"size": "6381",
"license": "mit",
"hash": 3474418696674169000,
"line_mean": 30.905,
"line_max": 99,
"alpha_frac": 0.6031969911,
"autogenerated": false,
"ratio": 4.3085752869682645,
"config_test": false,
"has_no_k... |
"""Base handler class."""
from abc import ABCMeta, abstractmethod
class Handler(metaclass=ABCMeta):
"""Base game handler.
Provides accessing to main State's fields and handle function stub.
:param :class:`xoinvader.state.State` owner: handler's owner
"""
def __init__(self, owner):
self... | {
"repo_name": "pkulev/xoinvader",
"path": "xoinvader/handlers.py",
"copies": "1",
"size": "2210",
"license": "mit",
"hash": -6875039905577151000,
"line_mean": 27.3333333333,
"line_max": 77,
"alpha_frac": 0.6176470588,
"autogenerated": false,
"ratio": 4.376237623762377,
"config_test": false,
"... |
""" Base handlers for constructing APIs handlers from.
"""
import json
import traceback
import treq
import yaml
from twisted.internet.defer import inlineCallbacks, maybeDeferred, returnValue
from twisted.python import log
from cyclone.web import RequestHandler, Application, URLSpec, HTTPError
from ..collections.er... | {
"repo_name": "praekelt/go-api-toolkit",
"path": "go_api/cyclone/handlers.py",
"copies": "1",
"size": "18032",
"license": "bsd-3-clause",
"hash": -2595990560351761000,
"line_mean": 30.690685413,
"line_max": 79,
"alpha_frac": 0.6027617569,
"autogenerated": false,
"ratio": 4.1216,
"config_test": ... |
""" Base handlers for constructing APIs handlers from.
"""
import json
from twisted.internet.defer import maybeDeferred, inlineCallbacks
from twisted.python import log
from cyclone.web import RequestHandler, Application, URLSpec, HTTPError
def ensure_deferred(x):
return maybeDeferred(lambda x: x, x)
def crea... | {
"repo_name": "praekelt/go-store-service",
"path": "go_store_service/api_handler.py",
"copies": "1",
"size": "6207",
"license": "bsd-3-clause",
"hash": 858659186404193200,
"line_mean": 28.0046728972,
"line_max": 73,
"alpha_frac": 0.5872402127,
"autogenerated": false,
"ratio": 4.1657718120805365,
... |
"""Base handlers for the application.
"""
# stdlib imports
import json
# local imports
from app.forms.images import ImageForm
from app.handlers.templates.admin.base import AdminTemplateHandler
from app.models.images import Image
class ImageHandler(AdminTemplateHandler):
form = ImageForm()
def render(self, ... | {
"repo_name": "mjmcconnell/sra",
"path": "src-server/app/handlers/templates/admin/images.py",
"copies": "1",
"size": "1256",
"license": "apache-2.0",
"hash": 6046971711750831000,
"line_mean": 23.1538461538,
"line_max": 72,
"alpha_frac": 0.599522293,
"autogenerated": false,
"ratio": 4.051612903225... |
"""Base handlers for the application.
"""
# stdlib imports
import json
# local imports
from app.forms.pages.about import AboutPageForm
from app.forms.pages.base import PageForm
from app.forms.pages.events import EventsPageForm
from app.forms.pages.gallery import GalleryPageForm
from app.forms.pages.news import NewsPag... | {
"repo_name": "mjmcconnell/sra",
"path": "src-server/app/handlers/templates/admin/pages.py",
"copies": "1",
"size": "1836",
"license": "apache-2.0",
"hash": -7941882568310303000,
"line_mean": 24.8591549296,
"line_max": 72,
"alpha_frac": 0.6339869281,
"autogenerated": false,
"ratio": 3.91471215351... |
"""Base Heroku settings
"""
import os
import dj_database_url
from gamecraft.settings import *
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
# Parse database configuration from $DATABASE_URL
DATABASES['default'] = dj_database_url.config()
# Honor the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_S... | {
"repo_name": "micktwomey/gamecraft-mk-iii",
"path": "gamecraft/settings_heroku_base.py",
"copies": "1",
"size": "1983",
"license": "mit",
"hash": -7902911169337477000,
"line_mean": 26.1643835616,
"line_max": 103,
"alpha_frac": 0.6651538074,
"autogenerated": false,
"ratio": 3.132701421800948,
"... |
_base_ = './htc_without_semantic_r50_fpn_1x_coco.py'
model = dict(
roi_head=dict(
semantic_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0),
out_channels=256,
featmap_strides=[8]),
semanti... | {
"repo_name": "open-mmlab/mmdetection",
"path": "configs/htc/htc_r50_fpn_1x_coco.py",
"copies": "1",
"size": "1953",
"license": "apache-2.0",
"hash": 486321420382817150,
"line_mean": 33.875,
"line_max": 79,
"alpha_frac": 0.5693804403,
"autogenerated": false,
"ratio": 3.2768456375838926,
"config... |
BASE = "https://account-linking.mib.garr.it/oidc/"
# If BASE is https these has to be specified
SERVER_KEY = ''
SERVER_CERT = ''
CA_BUNDLE = None
VERIFY_SSL = False
# information used when registering the client, this may be the same for all OPs
ME = {
"application_type": "web",
"contacts": ["ops@example.com... | {
"repo_name": "biancini/Django-AccountLinking",
"path": "linking_service/oidc_django/conf.py",
"copies": "1",
"size": "1601",
"license": "apache-2.0",
"hash": 1634492710400108000,
"line_mean": 29.7884615385,
"line_max": 100,
"alpha_frac": 0.5877576515,
"autogenerated": false,
"ratio": 3.377637130... |
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 3333)
This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application. It has not been reviewed for security issues,
however, and w... | {
"repo_name": "Reflexe/doc_to_pdf",
"path": "Windows/program/python-core-3.5.0/lib/wsgiref/simple_server.py",
"copies": "3",
"size": "5388",
"license": "mpl-2.0",
"hash": -9087696062467523000,
"line_mean": 30.3255813953,
"line_max": 79,
"alpha_frac": 0.6061618411,
"autogenerated": false,
"ratio":... |
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21)
This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application. It has not been reviewed for security issues,
howev... | {
"repo_name": "nmercier/linux-cross-gcc",
"path": "linux/lib/python2.7/wsgiref/simple_server.py",
"copies": "55",
"size": "4974",
"license": "bsd-3-clause",
"hash": 163144092671504100,
"line_mean": 29.5153374233,
"line_max": 79,
"alpha_frac": 0.6027342179,
"autogenerated": false,
"ratio": 3.95389... |
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21)
This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application. It has not been reviewed for security issues,
... | {
"repo_name": "ericlink/adms-server",
"path": "playframework-dist/1.1-src/python/Lib/wsgiref/simple_server.py",
"copies": "2",
"size": "4994",
"license": "mit",
"hash": -9030964247251848000,
"line_mean": 22.3609756098,
"line_max": 79,
"alpha_frac": 0.5764917901,
"autogenerated": false,
"ratio": 4... |
# base: https://github.com/pytorch/examples/blob/master/mnist/main.py
from __future__ import print_function
import os
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
parser = argparse.ArgumentParser(description=... | {
"repo_name": "odanado/daria",
"path": "examples/mnist_trainer.py",
"copies": "1",
"size": "4132",
"license": "mit",
"hash": 6956814256290831000,
"line_mean": 36.2252252252,
"line_max": 91,
"alpha_frac": 0.6241529526,
"autogenerated": false,
"ratio": 3.5136054421768708,
"config_test": false,
... |
"""Base Image classes"""
from __future__ import division
from tmxlib import helpers, fileio
class ImageBase(helpers.SizeMixin):
"""Provide __getitem__ and __setitem__ for images
Pixel access methods witk with (x, y) pairs for position and (r, g, b, a)
tuples for color.
"""
def __getitem__(self,... | {
"repo_name": "ArmchairArmada/COS125Project01",
"path": "src/tmxlib/image.py",
"copies": "1",
"size": "5003",
"license": "mit",
"hash": -6626382636303394000,
"line_mean": 27.4261363636,
"line_max": 79,
"alpha_frac": 0.5746552069,
"autogenerated": false,
"ratio": 4.057583130575831,
"config_test"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.