text stringlengths 0 1.05M | meta dict |
|---|---|
"""Abstraction form AEMET OpenData sensors."""
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import ATTRIBUTION, SENSOR_DEVICE_CLASS, SENSOR_NAME, SENSOR_UNIT
from .weather_upd... | {
"repo_name": "w1ll1am23/home-assistant",
"path": "homeassistant/components/aemet/abstract_aemet_sensor.py",
"copies": "3",
"size": "1822",
"license": "apache-2.0",
"hash": 5317964490455318000,
"line_mean": 30.4137931034,
"line_max": 77,
"alpha_frac": 0.6586169045,
"autogenerated": false,
"ratio"... |
"""Abstraction form AEMET OpenData sensors."""
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import ATTRIBUTION, SENSOR_DEVICE_CLASS, SENSOR_NAME, SENSOR_UNIT
from .weather_update_coordinator import WeatherUpdateCoordinator
class A... | {
"repo_name": "partofthething/home-assistant",
"path": "homeassistant/components/aemet/abstract_aemet_sensor.py",
"copies": "2",
"size": "1752",
"license": "mit",
"hash": 5093971263165801000,
"line_mean": 29.7368421053,
"line_max": 77,
"alpha_frac": 0.649543379,
"autogenerated": false,
"ratio": 4... |
"""Abstraction form OWM sensors."""
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from .const import ATTRIBUTION, SENSOR_DEVICE_CLASS, SENSOR_NAME, SENSOR_UNIT
class AbstractOpenWeat... | {
"repo_name": "w1ll1am23/home-assistant",
"path": "homeassistant/components/openweathermap/abstract_owm_sensor.py",
"copies": "3",
"size": "2398",
"license": "apache-2.0",
"hash": -7493894730500949000,
"line_mean": 30.1428571429,
"line_max": 77,
"alpha_frac": 0.647206005,
"autogenerated": false,
... |
"""Abstraction form OWM sensors."""
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from .const import ATTRIBUTION, SENSOR_DEVICE_CLASS, SENSOR_NAME, SENSOR_UNIT
class AbstractOpenWeatherMapSen... | {
"repo_name": "balloob/home-assistant",
"path": "homeassistant/components/openweathermap/abstract_owm_sensor.py",
"copies": "9",
"size": "2384",
"license": "apache-2.0",
"hash": -4179208670834003500,
"line_mean": 29.961038961,
"line_max": 77,
"alpha_frac": 0.6451342282,
"autogenerated": false,
"r... |
"""Abstraction form OWM sensors."""
import logging
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from .const import ATTRIBUTION, SENSOR_DEVICE_CLASS, SENSOR_NAME, SENSOR_UNIT
_LOGGER = loggin... | {
"repo_name": "tchellomello/home-assistant",
"path": "homeassistant/components/openweathermap/abstract_owm_sensor.py",
"copies": "1",
"size": "2439",
"license": "apache-2.0",
"hash": -4053187661174629000,
"line_mean": 29.1111111111,
"line_max": 77,
"alpha_frac": 0.6465764658,
"autogenerated": false... |
# abstraction layer for dfrotz
# parts for non-blocking communication are taken from
# https://gist.github.com/EyalAr/7915597
# this code is still somewhat shitty...
import os
import queue
import subprocess
import sys
import threading
class DFrotz():
def __init__(self, arg_frotz_path, arg_game_path):
sel... | {
"repo_name": "sneaksnake/z5bot",
"path": "dfrotz.py",
"copies": "1",
"size": "2614",
"license": "mit",
"hash": 382593423080654600,
"line_mean": 29.4069767442,
"line_max": 97,
"alpha_frac": 0.5443764346,
"autogenerated": false,
"ratio": 3.8216374269005846,
"config_test": false,
"has_no_keywor... |
"""Abstraction layer for motors."""
import bbb.pwm as pwm_mod
import bbb.gpio as gpio_mod
import bot.lib.lib as lib
FORWARD = 1
REVERSE = 0
class Motor(object):
"""Class for abstracting motor settings.
Note that motors without GPIO pins are assumed to not need to change
direction in-code. Their direc... | {
"repo_name": "IEEERobotics/bot",
"path": "bot/hardware/motor.py",
"copies": "2",
"size": "6558",
"license": "bsd-2-clause",
"hash": 1589283851955610400,
"line_mean": 31.4653465347,
"line_max": 79,
"alpha_frac": 0.5946935041,
"autogenerated": false,
"ratio": 4.228239845261122,
"config_test": tr... |
"""Abstraction layer to deal with Django related changes in order to keep
compatibility with several Django versions simultaneously."""
from django import VERSION as DJANGO_VERSION
from django.db import transaction
from django.conf import settings as django_settings
# Django 1.5+
if DJANGO_VERSION >= (1,5):
USER_... | {
"repo_name": "Si-elegans/Web-based_GUI_Tools",
"path": "wiki/core/compat.py",
"copies": "2",
"size": "1180",
"license": "apache-2.0",
"hash": -6985631712228756000,
"line_mean": 31.7777777778,
"line_max": 80,
"alpha_frac": 0.7228813559,
"autogenerated": false,
"ratio": 3.8436482084690553,
"conf... |
'''Abstraction model for our lab containers managed in Docker'''
from datetime import datetime
import functools
import logging
import os
import os.path
import shutil
from docker import Client
from docker import errors
import lsc.config as config
class Instance(object):
'''Wraps all operations on Lab instances... | {
"repo_name": "CoderDojoTC/python-minecraft",
"path": "lab-server/controller/lsc/model/instance.py",
"copies": "1",
"size": "8775",
"license": "mit",
"hash": -1801139819291748000,
"line_mean": 33.5472440945,
"line_max": 96,
"alpha_frac": 0.5582905983,
"autogenerated": false,
"ratio": 4.2432301740... |
"""Abstraction of an OF table."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... | {
"repo_name": "byllyfish/faucet",
"path": "faucet/valve_table.py",
"copies": "1",
"size": "5959",
"license": "apache-2.0",
"hash": 1335451933375703600,
"line_mean": 34.2603550296,
"line_max": 95,
"alpha_frac": 0.5982547407,
"autogenerated": false,
"ratio": 3.819871794871795,
"config_test": fals... |
"""Abstraction point allowing use with numpy or Numeric
Chooses numpy if available because when it's installed
Numeric tends to be a bit flaky...
"""
from numpy import *
try:
from vrml_accelerate import tmatrixaccel
from vrml_accelerate import frustcullaccel
except ImportError as err:
tmatrixaccel = frustc... | {
"repo_name": "alexus37/AugmentedRealityChess",
"path": "pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/vrml/arrays.py",
"copies": "2",
"size": "2169",
"license": "mit",
"hash": -8949563515783074000,
"line_mean": 32.3692307692,
"line_max": 82,
"alpha_frac": 0.6588... |
""" Abstractions for handling resources via Amazon Web Services (AWS) API
The intention of these utilities is to allow other infrastructure to
interact with AWS without having to understand AWS APIs. Additionally,
this module provides helper functions for the most common queries required
to manipulate and test a DC/OS... | {
"repo_name": "dcos/dcos-launch",
"path": "dcos_launch/platforms/aws.py",
"copies": "1",
"size": "32722",
"license": "apache-2.0",
"hash": 7998396213300687000,
"line_mean": 41.9422572178,
"line_max": 146,
"alpha_frac": 0.5986492268,
"autogenerated": false,
"ratio": 3.7032593933906743,
"config_t... |
# abstractions for LED strip
import time
import colorsys
import random as Random
from neopixel import *
# LED strip configuration:
# LED_COUNT = 300 # Number of LED pixels.
LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!).
## LED_PIN = 10 # GPIO pin connected to the pi... | {
"repo_name": "ethanacm/the_snake_lights",
"path": "StrandMethods.py",
"copies": "1",
"size": "5211",
"license": "mit",
"hash": 9036758327119945000,
"line_mean": 37.8955223881,
"line_max": 134,
"alpha_frac": 0.5810784878,
"autogenerated": false,
"ratio": 3.3511254019292607,
"config_test": false... |
"""Abstractions for Swimlane app field types to simplify getting/setting values on records"""
from six import string_types as _string_types
from swimlane.core.fields.base import Field
from swimlane.utils import (
get_recursive_subclasses as _get_recursive_subclasses,
import_submodules as _import_submodules
)
... | {
"repo_name": "Swimlane/sw-python-client",
"path": "swimlane/core/fields/__init__.py",
"copies": "1",
"size": "1544",
"license": "mit",
"hash": 7006865815795158000,
"line_mean": 32.5652173913,
"line_max": 117,
"alpha_frac": 0.6347150259,
"autogenerated": false,
"ratio": 3.969151670951157,
"conf... |
"""Abstractions for working with powerpoint files"""
import tempfile
import shutil
import re
import os
from win32 import run
runpowerpoint = lambda: run('PowerPoint.Application')
def new(app, filename):
presentation = app.Presentations.Add()
presentation.SaveAs(filename)
return presentation
def addslide(... | {
"repo_name": "Intelimetrica/coati",
"path": "coati/powerpoint.py",
"copies": "1",
"size": "4177",
"license": "mit",
"hash": 1417743327286144500,
"line_mean": 27.4149659864,
"line_max": 72,
"alpha_frac": 0.6191046205,
"autogenerated": false,
"ratio": 3.7095914742451153,
"config_test": false,
... |
"""Abstractions related to the game and game logic"""
class Cell:
"""Represents one element of the board"""
def __init__(self, z=0, active=False, lit=False): # setting default values
self.z = z
self.active = active
self.lit = lit
def __repr__(self):
return 'z = {}, active... | {
"repo_name": "5tr1k3r/lightbot-python",
"path": "lightbot/game.py",
"copies": "1",
"size": "1455",
"license": "mit",
"hash": -6713374500320594000,
"line_mean": 32.8372093023,
"line_max": 87,
"alpha_frac": 0.5450171821,
"autogenerated": false,
"ratio": 3.75968992248062,
"config_test": false,
... |
"""Abstractions to interact with service models."""
from collections import defaultdict
from botocore_eb.utils import CachedProperty
from botocore_eb.compat import OrderedDict
NOT_SET = object()
class NoShapeFoundError(Exception):
pass
class InvalidShapeError(Exception):
pass
class OperationNotFoundEr... | {
"repo_name": "raulanatol/awsebcli",
"path": "botocore_eb/model.py",
"copies": "2",
"size": "18977",
"license": "apache-2.0",
"hash": -1002783745928076800,
"line_mean": 32.8875,
"line_max": 79,
"alpha_frac": 0.5921378511,
"autogenerated": false,
"ratio": 4.448429442100328,
"config_test": false,... |
"""Abstractions to interact with service models."""
from collections import defaultdict
from botocore.utils import CachedProperty
from botocore.compat import OrderedDict
NOT_SET = object()
class NoShapeFoundError(Exception):
pass
class InvalidShapeError(Exception):
pass
class OperationNotFoundError(Exc... | {
"repo_name": "ianblenke/awsebcli",
"path": "ebcli/bundled/botocore/model.py",
"copies": "1",
"size": "20151",
"license": "apache-2.0",
"hash": -4525155215634181000,
"line_mean": 33.32879046,
"line_max": 79,
"alpha_frac": 0.5956031959,
"autogenerated": false,
"ratio": 4.473029966703662,
"config... |
"""Abstractions to interact with service models."""
from collections import defaultdict
from .utils import CachedProperty
from .compat import OrderedDict
NOT_SET = object()
class NoShapeFoundError(Exception):
pass
class InvalidShapeError(Exception):
pass
class OperationNotFoundError(Exception):
pas... | {
"repo_name": "gdm/aws-cfn-resource-bridge",
"path": "aws/cfn/bridge/vendored/botocore/model.py",
"copies": "3",
"size": "20135",
"license": "apache-2.0",
"hash": 5658549569592250000,
"line_mean": 33.3015332198,
"line_max": 79,
"alpha_frac": 0.5952818475,
"autogenerated": false,
"ratio": 4.471463... |
"""Abstraction to send a TunnelingRequest and wait for TunnelingResponse."""
from __future__ import annotations
from typing import TYPE_CHECKING
from xknx.knxip import (
CEMIFrame,
CEMIMessageCode,
KNXIPFrame,
TunnellingAck,
TunnellingRequest,
)
from .request_response import RequestResponse
if T... | {
"repo_name": "XKNX/xknx",
"path": "xknx/io/request_response/tunnelling.py",
"copies": "1",
"size": "1752",
"license": "mit",
"hash": 7131248798359292000,
"line_mean": 28.6949152542,
"line_max": 76,
"alpha_frac": 0.6484018265,
"autogenerated": false,
"ratio": 3.5609756097560976,
"config_test": ... |
"""Abstraction to send ConnectonStateRequest and wait for ConnectionStateResponse."""
from __future__ import annotations
from typing import TYPE_CHECKING
from xknx.io.const import CONNECTIONSTATE_REQUEST_TIMEOUT
from xknx.knxip import HPAI, ConnectionStateRequest, ConnectionStateResponse, KNXIPFrame
from .request_re... | {
"repo_name": "XKNX/xknx",
"path": "xknx/io/request_response/connectionstate.py",
"copies": "1",
"size": "1686",
"license": "mit",
"hash": -1829749085372579600,
"line_mean": 33.4081632653,
"line_max": 88,
"alpha_frac": 0.662514828,
"autogenerated": false,
"ratio": 4.052884615384615,
"config_tes... |
"""Abstraction to send ConnectRequest and wait for ConnectResponse."""
from __future__ import annotations
from typing import TYPE_CHECKING
from xknx.knxip import (
HPAI,
ConnectRequest,
ConnectRequestType,
ConnectResponse,
KNXIPFrame,
)
from .request_response import RequestResponse
if TYPE_CHECK... | {
"repo_name": "XKNX/xknx",
"path": "xknx/io/request_response/connect.py",
"copies": "1",
"size": "1907",
"license": "mit",
"hash": -4680766646573685000,
"line_mean": 34.9811320755,
"line_max": 92,
"alpha_frac": 0.6717357105,
"autogenerated": false,
"ratio": 3.9238683127572016,
"config_test": fa... |
"""Abstraction to send DisconnectRequest and wait for DisconnectResponse."""
from __future__ import annotations
from typing import TYPE_CHECKING
from xknx.knxip import HPAI, DisconnectRequest, DisconnectResponse, KNXIPFrame
from .request_response import RequestResponse
if TYPE_CHECKING:
from xknx.io.udp_client ... | {
"repo_name": "XKNX/xknx",
"path": "xknx/io/request_response/disconnect.py",
"copies": "1",
"size": "1488",
"license": "mit",
"hash": -4916549600577353000,
"line_mean": 32.8181818182,
"line_max": 78,
"alpha_frac": 0.6572580645,
"autogenerated": false,
"ratio": 3.8449612403100777,
"config_test":... |
"""Abstract linear algebra library.
This module defines a class hierarchy that implements a kind of "lazy"
matrix representation, called the ``LinearOperator``. It can be used to do
linear algebra with extremely large sparse or structured matrices, without
representing those explicitly in memory. Such matrices can be ... | {
"repo_name": "scipy/scipy",
"path": "scipy/sparse/linalg/interface.py",
"copies": "12",
"size": "25267",
"license": "bsd-3-clause",
"hash": -2462375166692827600,
"line_mean": 29.5895883777,
"line_max": 81,
"alpha_frac": 0.5721296553,
"autogenerated": false,
"ratio": 3.985959930588421,
"config_... |
"""Abstract model describing WorldMap Layers"""
from __future__ import print_function
from abc import abstractmethod
from urlparse import urlparse
import logging
from django.conf import settings
from django.db import models
from django import forms
import jsonfield # using jsonfield.JSONField
from shared_dataverse_... | {
"repo_name": "IQSS/geoconnect",
"path": "gc_apps/worldmap_layers/models.py",
"copies": "1",
"size": "14537",
"license": "apache-2.0",
"hash": -686569487382985700,
"line_mean": 32.8857808858,
"line_max": 99,
"alpha_frac": 0.5721262984,
"autogenerated": false,
"ratio": 4.205091119467746,
"config... |
"""Abstract models for use in other applications"""
import datetime
from django.contrib.auth.models import User
from django.contrib.postgres.fields import JSONField
from django.db import transaction
from django.db.models import DateTimeField, ForeignKey, Manager, Model, SET_NULL
from django.db.models.query import Quer... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "main/models.py",
"copies": "1",
"size": "3965",
"license": "bsd-3-clause",
"hash": 4307491312650223000,
"line_mean": 28.1544117647,
"line_max": 91,
"alpha_frac": 0.6315258512,
"autogenerated": false,
"ratio": 4.272629310344827,
"config_test": ... |
"""ABSTRACT:
This module analyses paths of a state machine. For each path through a state a
PathTrace object is created. A PathTrace object tells something about the
acceptance behavior of a state in terms of a list of AcceptInfo objects. As a
basic result of this process a map is generated with the following propert... | {
"repo_name": "coderjames/pascal",
"path": "quex-0.63.1/quex/engine/analyzer/track_analysis.py",
"copies": "1",
"size": "31429",
"license": "bsd-2-clause",
"hash": 2818694341615683600,
"line_mean": 47.3523076923,
"line_max": 126,
"alpha_frac": 0.5748830698,
"autogenerated": false,
"ratio": 4.5078... |
"""ABSTRACT:
This module produces an object of class Analyzer. It is a representation of an
analyzer state machine (object of class StateMachine) that is suited for code
generation. In particular, track analysis results in 'decorations' for states
which help to implement efficient code.
Formally an Analyzer consists ... | {
"repo_name": "coderjames/pascal",
"path": "quex-0.63.1/quex/engine/analyzer/core.py",
"copies": "1",
"size": "24510",
"license": "bsd-2-clause",
"hash": 277877732692961300,
"line_mean": 46.87109375,
"line_max": 117,
"alpha_frac": 0.5943288454,
"autogenerated": false,
"ratio": 4.516307352128248,
... |
abstractPath = './abstracts/'
logFile = './output/all_no_data_abstracts_lda_50_passes_10_topics.txt'
dictFile = './output/agu_no_data_wordDict.dict'
corpusFile = './output/agu_no_data_topicCorpus.mm'
stoplist = set(
['data','a', 'about', 'above', 'above', 'across', 'after', 'afterwards', 'again', 'against', 'al... | {
"repo_name": "narock/narock.github.io",
"path": "research/agu_scientometrics/utils.py",
"copies": "1",
"size": "3868",
"license": "mit",
"hash": 2147262334741369000,
"line_mean": 95.725,
"line_max": 124,
"alpha_frac": 0.5175801448,
"autogenerated": false,
"ratio": 2.6348773841961854,
"config_t... |
"""Abstract permissions container.
"""
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Iterable
import six
from ._typing import Text
if typing.TYPE_CHECKING:
from typing import Iterator, List, Optional, Tuple, Type, Union
def make_mode(init):
... | {
"repo_name": "PyFilesystem/pyfilesystem2",
"path": "fs/permissions.py",
"copies": "1",
"size": "9840",
"license": "mit",
"hash": -7365286591246904000,
"line_mean": 29.8463949843,
"line_max": 85,
"alpha_frac": 0.5217479675,
"autogenerated": false,
"ratio": 3.786071565986918,
"config_test": fals... |
""" **abstract_phasechange_simulation.py** provides an abstract class for phase-change simulations,
including the natural and compositional convection of binary alloys.
"""
import phaseflow
import fenics
import matplotlib
import math
import sys
class AbstractPhaseChangeSimulation(phaseflow.abstract_simulation.Abstra... | {
"repo_name": "geo-fluid-dynamics/phaseflow-fenics",
"path": "phaseflow/abstract_phasechange_simulation.py",
"copies": "1",
"size": "20958",
"license": "mit",
"hash": 4807334492384036000,
"line_mean": 34.0484949833,
"line_max": 112,
"alpha_frac": 0.5229983777,
"autogenerated": false,
"ratio": 4.0... |
''' Abstract request handler that handles bokeh-session-id
'''
from __future__ import absolute_import, print_function
import logging
log = logging.getLogger(__name__)
from tornado import gen
from tornado.web import RequestHandler, HTTPError
from bokeh.util.session_id import generate_session_id, check_session_id_sig... | {
"repo_name": "dennisobrien/bokeh",
"path": "bokeh/server/views/session_handler.py",
"copies": "9",
"size": "1894",
"license": "bsd-3-clause",
"hash": -8860683203927499000,
"line_mean": 41.0888888889,
"line_max": 99,
"alpha_frac": 0.6372756072,
"autogenerated": false,
"ratio": 4.354022988505747,
... |
""" Abstracts all Widgets of the pySUMO GUI.
This module contains:
- Widget: The main widget representation in the GUI.
- RWidget: The class of widgets which only have access to the IndexAbstractor and therefore cannot modify the Ontologies.
- RWWidget: The class of widgets which have access to the SyntaxController a... | {
"repo_name": "pySUMO/pysumo",
"path": "src/pySUMOQt/Widget/Widget.py",
"copies": "1",
"size": "5959",
"license": "bsd-2-clause",
"hash": 7266475493619759000,
"line_mean": 27.5119617225,
"line_max": 121,
"alpha_frac": 0.6042960228,
"autogenerated": false,
"ratio": 4.262517882689557,
"config_tes... |
"""Abstracts away file storage and retrieval.
It's not uncommon to want to switch between a local filesystem or mogilefs or
some kind of cloud thing, and that's a pain when the relevant code is strewn
everywhere. So, this class is a wrapper around the operations needed on
uploaded files. It also provides the necessa... | {
"repo_name": "eevee/floof",
"path": "floof/model/filestore/__init__.py",
"copies": "1",
"size": "5219",
"license": "isc",
"hash": -6775711562192942000,
"line_mean": 35.7535211268,
"line_max": 97,
"alpha_frac": 0.6754167465,
"autogenerated": false,
"ratio": 4.309661436829067,
"config_test": fal... |
# abstractsession.py
"""A common interface shared between publish and consumer sessions.
This file defines a class 'AbstractSession' - an interface which is shared
between its concrete implementations 'Session' and 'ProviderSession'.
"""
from __future__ import absolute_import
from .exception import _ExceptionUtil
f... | {
"repo_name": "anshulkgupta/viznow",
"path": "Mayank/blpapi_python3.5.5/build/lib.linux-i686-2.7/blpapi/abstractsession.py",
"copies": "2",
"size": "12218",
"license": "mit",
"hash": 1118100056301955500,
"line_mean": 42.6357142857,
"line_max": 78,
"alpha_frac": 0.6966770339,
"autogenerated": false,... |
""" **abstract_simulation.py** provides an abstract class for unsteady adaptive FEM simulations.
We define a simulation as a sequence of time-dependent initial boundary value problems.
This module only provides an abstract base class for simulations.
For an example of implementing a specific set of governing equati... | {
"repo_name": "geo-fluid-dynamics/phaseflow-fenics",
"path": "phaseflow/abstract_simulation.py",
"copies": "1",
"size": "19299",
"license": "mit",
"hash": 4228228136344768500,
"line_mean": 35.2763157895,
"line_max": 113,
"alpha_frac": 0.5685786828,
"autogenerated": false,
"ratio": 4.4122085048010... |
""" Abstract sql statements to query schema """
import asyncio
import logging
from zope.interface import implementer
from aiorm import registry
from . import interfaces
log = logging.getLogger(__name__)
class _Query:
def __init__(self, *args, **kwargs):
self._args = args
self._kwargs = kwarg... | {
"repo_name": "mardiros/aiorm",
"path": "aiorm/orm/query/statements.py",
"copies": "1",
"size": "7562",
"license": "bsd-3-clause",
"hash": 5992269424044634000,
"line_mean": 28.6549019608,
"line_max": 76,
"alpha_frac": 0.617825972,
"autogenerated": false,
"ratio": 4.141292442497262,
"config_test... |
""" Abstracts the capturing and interfacing of applications """
import os
import re
import time
import pyperclip
import platform
import subprocess
from .RegionMatching import Region
from .SettingsDebug import Debug
if platform.system() == "Windows":
from .PlatformManagerWindows import PlatformManagerWindows
P... | {
"repo_name": "glitchassassin/lackey",
"path": "lackey/App.py",
"copies": "1",
"size": "10479",
"license": "mit",
"hash": 1650966455382736100,
"line_mean": 38.5433962264,
"line_max": 170,
"alpha_frac": 0.5995801126,
"autogenerated": false,
"ratio": 4.432741116751269,
"config_test": false,
"ha... |
""" Abstract Storage. """
from __future__ import print_function
from os import path as op, walk
class BaseStorage():
""" Base class for storages. """
def __init__(self, collect, verbose=False):
self.verbose = verbose
self.collect = collect
def __iter__(self):
""" Seek static fi... | {
"repo_name": "jirikuncar/Flask-Collect",
"path": "flask_collect/storage/base.py",
"copies": "1",
"size": "1374",
"license": "bsd-3-clause",
"hash": 7436117648085603000,
"line_mean": 34.2307692308,
"line_max": 81,
"alpha_frac": 0.481077147,
"autogenerated": false,
"ratio": 4.549668874172186,
"c... |
"""Abstract syntax for edn.
Roughly speaking, every edn element gets its own terml symbol. Thus, an edn
stream consisting of a vector of two strings, e.g.::
["foo" "bar"]
Will be mapped to::
Vector((String(u'foo'), String(u'bar')))
Beyond that::
#foo 42 <=> TaggedValue(Symbol('foo'), 42)
:my/keyword <=> ... | {
"repo_name": "dreid/edn",
"path": "edn/_ast.py",
"copies": "1",
"size": "4515",
"license": "mit",
"hash": 8023433229935271000,
"line_mean": 23.1443850267,
"line_max": 76,
"alpha_frac": 0.5858250277,
"autogenerated": false,
"ratio": 3.4571209800918834,
"config_test": false,
"has_no_keywords":... |
# Abstract Syntax Tree (AST) for Latex (Mixed) Linear Progamming formulation (MLP)
class LinearProgram:
"""
Class representing the root node in the AST of a MLP
"""
def __init__(self, objectives, constraints, declarations = None):
"""
Set the objective and the constraints
... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/LinearProgram.py",
"copies": "1",
"size": "1111",
"license": "mit",
"hash": -1023045377291000200,
"line_mean": 26.775,
"line_max": 82,
"alpha_frac": 0.5805580558,
"autogenerated": false,
"ratio": 4.57201646090535,
"config_test":... |
"""Abstract syntax tree for songs.
Basic structure:
* A song consists of verses, choruses and maybe comments.
* Verses and choruses consist of lines and maybe comments.
Global information like titles and chords
are properties of the top-level Song object.
"""
# TODO: Rename to song_ast?
class Line(object):
def _... | {
"repo_name": "gnoack/ukechord",
"path": "song.py",
"copies": "1",
"size": "1973",
"license": "apache-2.0",
"hash": 4582273945225376000,
"line_mean": 24.2948717949,
"line_max": 84,
"alpha_frac": 0.6523061328,
"autogenerated": false,
"ratio": 3.4735915492957745,
"config_test": false,
"has_no_k... |
"""Abstract tensor product."""
from __future__ import print_function, division
from sympy import Expr, Add, Mul, Matrix, Pow, sympify
from sympy.core.compatibility import range
from sympy.core.trace import Tr
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.qexpr import QuantumError... | {
"repo_name": "madan96/sympy",
"path": "sympy/physics/quantum/tensorproduct.py",
"copies": "23",
"size": "13565",
"license": "bsd-3-clause",
"hash": -5662125056116942000,
"line_mean": 33.5165394402,
"line_max": 96,
"alpha_frac": 0.5525248802,
"autogenerated": false,
"ratio": 3.9559638378536017,
... |
"""Abstract tensor product."""
from __future__ import print_function, division
from sympy import Expr, Add, Mul, Matrix, Pow, sympify
from sympy.core.compatibility import u
from sympy.core.trace import Tr
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.matrixutils import (
numpy... | {
"repo_name": "sympsi/sympsi",
"path": "sympsi/tensorproduct.py",
"copies": "1",
"size": "13390",
"license": "bsd-3-clause",
"hash": -4105018808006211000,
"line_mean": 32.9847715736,
"line_max": 79,
"alpha_frac": 0.5482449589,
"autogenerated": false,
"ratio": 3.935920047031158,
"config_test": f... |
"""Abstract tensor product."""
from __future__ import print_function, division
from sympy import Expr, Add, Mul, Matrix, Pow, sympify
from sympy.core.compatibility import u, range
from sympy.core.trace import Tr
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.qexpr import QuantumEr... | {
"repo_name": "vipulroxx/sympy",
"path": "sympy/physics/quantum/tensorproduct.py",
"copies": "64",
"size": "13572",
"license": "bsd-3-clause",
"hash": 5962044668408874000,
"line_mean": 33.534351145,
"line_max": 100,
"alpha_frac": 0.5523135868,
"autogenerated": false,
"ratio": 3.9545454545454546,
... |
"""Abstract tensor product."""
from sympy import Expr, Add, Mul, Matrix, Pow, sympify
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.qexpr import QuantumError
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.commutator import Commutator
from sympy.physics.... | {
"repo_name": "ichuang/sympy",
"path": "sympy/physics/quantum/tensorproduct.py",
"copies": "1",
"size": "10569",
"license": "bsd-3-clause",
"hash": -4380075969612379000,
"line_mean": 32.3406940063,
"line_max": 98,
"alpha_frac": 0.5568171066,
"autogenerated": false,
"ratio": 3.9217068645640074,
... |
"""Abstract tensor product."""
from sympy import Expr, Add, Mul, Matrix, Pow, sympify
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.qexpr import QuantumError, split_commutative_parts
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.commutator import Commu... | {
"repo_name": "Cuuuurzel/KiPyCalc",
"path": "sympy_old/physics/quantum/tensorproduct.py",
"copies": "2",
"size": "10892",
"license": "mit",
"hash": -7167864914925618000,
"line_mean": 32.9314641745,
"line_max": 98,
"alpha_frac": 0.5498531032,
"autogenerated": false,
"ratio": 3.957848837209302,
"... |
"""Abstract TestCase for all resources related tests."""
# pylint: disable=attribute-defined-outside-init
# pylint: disable=too-many-public-methods,invalid-name
from __future__ import absolute_import
import time
from threading import current_thread
from django.test.testcases import TransactionTestCase
from rotest.cor... | {
"repo_name": "gregoil/rotest",
"path": "tests/management/resource_base_test.py",
"copies": "1",
"size": "2749",
"license": "mit",
"hash": -4591869192664641500,
"line_mean": 35.1710526316,
"line_max": 76,
"alpha_frac": 0.6984357948,
"autogenerated": false,
"ratio": 4.419614147909968,
"config_te... |
"""Abstract tests for container implementations."""
# This file is part of geneparse.
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Pharmacogenomics Centre
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal... | {
"repo_name": "pgxcentre/geneparse",
"path": "geneparse/tests/test_bgen.py",
"copies": "1",
"size": "11429",
"license": "mit",
"hash": 6143405496058140000,
"line_mean": 36.2280130293,
"line_max": 79,
"alpha_frac": 0.5850030624,
"autogenerated": false,
"ratio": 4.137943519188993,
"config_test": ... |
"""Abstract Transport class."""
__all__ = (
'BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
)
class BaseTransport:
"""Base class for transports."""
def __init__(self, extra=None):
if extra is None:
extra = {}
se... | {
"repo_name": "huguesv/PTVS",
"path": "Python/Product/Miniconda/Miniconda3-x64/Lib/asyncio/transports.py",
"copies": "11",
"size": "10122",
"license": "apache-2.0",
"hash": 7722921255069662000,
"line_mean": 31.5466237942,
"line_max": 79,
"alpha_frac": 0.6256668643,
"autogenerated": false,
"ratio"... |
"""Abstract Transport class."""
__all__ = ['ReadTransport', 'WriteTransport', 'Transport']
class BaseTransport:
"""Base ABC for transports."""
def __init__(self, extra=None):
if extra is None:
extra = {}
self._extra = extra
def get_extra_info(self, name, default=None):
... | {
"repo_name": "mikhtonyuk/rxpython",
"path": "asyncio/transports.py",
"copies": "1",
"size": "6767",
"license": "mit",
"hash": -3519612496910996000,
"line_mean": 31.0710900474,
"line_max": 79,
"alpha_frac": 0.6544997783,
"autogenerated": false,
"ratio": 4.854375896700144,
"config_test": false,
... |
"""Abstract Transport class."""
from ActualVim.lib.asyncio_inc import compat
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
class BaseTransport:
"""Base class for transports."""
def __init__(self, extra=None):
... | {
"repo_name": "lunixbochs/actualvim",
"path": "lib/asyncio/transports.py",
"copies": "1",
"size": "10084",
"license": "mit",
"hash": 6707273321003111000,
"line_mean": 31.954248366,
"line_max": 79,
"alpha_frac": 0.6259420865,
"autogenerated": false,
"ratio": 4.7033582089552235,
"config_test": fa... |
"""Abstract Transport class."""
from asyncio import compat
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
class BaseTransport:
"""Base class for transports."""
def __init__(self, extra=None):
if extra i... | {
"repo_name": "gvanrossum/asyncio",
"path": "asyncio/transports.py",
"copies": "7",
"size": "9726",
"license": "apache-2.0",
"hash": 2617741477909142500,
"line_mean": 32.0816326531,
"line_max": 79,
"alpha_frac": 0.6255397903,
"autogenerated": false,
"ratio": 4.689488910318226,
"config_test": fa... |
"""Abstract Transport class."""
from trollius import compat
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
class BaseTransport(object):
"""Base class for transports."""
def __init__(self, extra=None):
i... | {
"repo_name": "haypo/trollius",
"path": "trollius/transports.py",
"copies": "1",
"size": "9769",
"license": "apache-2.0",
"hash": -8925508420162894000,
"line_mean": 32.2278911565,
"line_max": 80,
"alpha_frac": 0.6264714915,
"autogenerated": false,
"ratio": 4.676400191479177,
"config_test": fals... |
"""Abstract Transport class."""
import sys
from .compat import flatten_bytes
_PY34 = sys.version_info >= (3, 4)
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
class BaseTransport(object):
"""Base class for transpor... | {
"repo_name": "overcastcloud/trollius",
"path": "trollius/transports.py",
"copies": "1",
"size": "9825",
"license": "apache-2.0",
"hash": 8985140314209577000,
"line_mean": 32.0808080808,
"line_max": 80,
"alpha_frac": 0.6260559796,
"autogenerated": false,
"ratio": 4.6541923259118905,
"config_tes... |
"""Abstract Transport class."""
import sys
_PY34 = sys.version_info >= (3, 4)
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
class BaseTransport:
"""Base class for transports."""
def __init__(self, extra=None)... | {
"repo_name": "gsb-eng/asyncio",
"path": "asyncio/transports.py",
"copies": "16",
"size": "9941",
"license": "apache-2.0",
"hash": 4151774146633109000,
"line_mean": 32.1366666667,
"line_max": 79,
"alpha_frac": 0.6223719948,
"autogenerated": false,
"ratio": 4.6540262172284645,
"config_test": fal... |
""" abstract vpp object and object registry """
import abc
import six
from six import moves
@six.add_metaclass(abc.ABCMeta)
class VppObject(object):
""" Abstract vpp object """
@abc.abstractmethod
def add_vpp_config(self):
""" Add the configuration for this object to vpp. """
pass
... | {
"repo_name": "vpp-dev/vpp",
"path": "test/vpp_object.py",
"copies": "1",
"size": "3546",
"license": "apache-2.0",
"hash": -3162753444662757000,
"line_mean": 31.8333333333,
"line_max": 79,
"alpha_frac": 0.5699379583,
"autogenerated": false,
"ratio": 4.329670329670329,
"config_test": true,
"ha... |
""" abstract vpp object and object registry """
import abc
class VppObject(metaclass=abc.ABCMeta):
""" Abstract vpp object """
@abc.abstractmethod
def add_vpp_config(self) -> None:
""" Add the configuration for this object to vpp. """
pass
@abc.abstractmethod
def query_vpp_confi... | {
"repo_name": "chrisy/vpp",
"path": "test/vpp_object.py",
"copies": "2",
"size": "3590",
"license": "apache-2.0",
"hash": -5150089499043791000,
"line_mean": 33.5192307692,
"line_max": 79,
"alpha_frac": 0.5651810585,
"autogenerated": false,
"ratio": 4.273809523809524,
"config_test": true,
"has... |
"""Abstract Workflow Engine."""
import os
import pkgutil
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
class InvalidEngineError(Exception):
"""Raised when an invalid engine is requested."""
class BaseEngine:
"""Base class for all engines in Resolwe workflow."""... | {
"repo_name": "genialis/resolwe",
"path": "resolwe/flow/engine.py",
"copies": "1",
"size": "3670",
"license": "apache-2.0",
"hash": 8600617544381650000,
"line_mean": 32.9814814815,
"line_max": 91,
"alpha_frac": 0.5046321526,
"autogenerated": false,
"ratio": 5.020519835841314,
"config_test": tru... |
# Abstrys Command Line Utility library
#
# Provides classes and functions useful for writing command-line scripts.
import sys
def print_error(string):
"""Print an error message."""
sys.stderr.write("*** Error: %s\n" % (string))
return
def confirm(query):
"""Asks the user a y/n question, and returns T... | {
"repo_name": "Abstrys/abstrys-toolkit",
"path": "abstrys/cmd_utils.py",
"copies": "1",
"size": "5365",
"license": "bsd-3-clause",
"hash": -7903589806643099000,
"line_mean": 30.1918604651,
"line_max": 97,
"alpha_frac": 0.5602982293,
"autogenerated": false,
"ratio": 3.728283530229326,
"config_te... |
# abstrys text utility functions and classes.
import re
def camel2snake(text, sep=r'_'):
"""Convert *text* from CamelCase (or camelCase) into snake_case."""
rebounds = [r'([a-z])([A-Z])', r'([A-Z])([A-Z])']
# make a copy, don't operate on original.
ophic_text = str(text)
for b in rebounds:
... | {
"repo_name": "Abstrys/abstrys-toolkit",
"path": "abstrys/txt_utils.py",
"copies": "1",
"size": "1415",
"license": "bsd-3-clause",
"hash": -5801663547049893000,
"line_mean": 34.375,
"line_max": 75,
"alpha_frac": 0.606360424,
"autogenerated": false,
"ratio": 3.0042462845010616,
"config_test": fa... |
# abs(x)
# If the argument is a complex number, its magnitude is returned.
"""
In [2]: abs(10)
Out[2]: 10
In [4]: abs(-10.4)
Out[4]: 10.4
"""
# all(iterable)
"""
In [7]: all([1, 2, 3])
Out[7]: True
In [8]: all([1, 2, True, {'a': 'a'}])
Out[8]: True
In [9]: all([1, 2, True, {'a': 'a'}, None])
Out[9]: False
"""
# an... | {
"repo_name": "Chyroc/study-code",
"path": "Language/Python/BuildInFunctions.py",
"copies": "1",
"size": "19012",
"license": "mit",
"hash": 8457115140151026000,
"line_mean": 18.2836484983,
"line_max": 155,
"alpha_frac": 0.5492616521,
"autogenerated": false,
"ratio": 2.401773344416736,
"config_t... |
# A Bug in the ADC perhaps? This is an incompletely-explored specimin.
# simple
import array
from machine import Pin
from pyb import Timer, rng, ADC, DAC, LED, Switch
from time import sleep, ticks_ms, ticks_diff
import micropython
def hv(signal, harmonic):
length = len(signal)
return sum(signal[i]*signal[(ha... | {
"repo_name": "pramasoul/pyboard-music-detector",
"path": "bug.py",
"copies": "1",
"size": "7426",
"license": "mit",
"hash": 2067080835494769200,
"line_mean": 28.8232931727,
"line_max": 88,
"alpha_frac": 0.5324535416,
"autogenerated": false,
"ratio": 3.5244423350735645,
"config_test": false,
... |
"""A building is a saved set of locations on a board and has a color and
possibly an owner. A building also includes the locations of attached
stables.
A building can only have building pieces added to it if it does not have an
owner. A stable can be added to a building at any time. When adding to a
building, a... | {
"repo_name": "nicholas-maltbie/Medina",
"path": "Building.py",
"copies": "1",
"size": "5906",
"license": "mit",
"hash": 1145090060936310300,
"line_mean": 39.3006993007,
"line_max": 101,
"alpha_frac": 0.6884524213,
"autogenerated": false,
"ratio": 4.182719546742209,
"config_test": false,
"has... |
# A bunch of CONVERTERS for the Fit part of Alphabet.
import os
import math
from array import array
import optparse
import ROOT
from ROOT import *
import scipy
#### LINEAR ####
class LinearFit:
def __init__(self, init_var, range_min, range_max, name, Opt):
self.Opt = Opt
self.rm = range_min
self.rp = range_max... | {
"repo_name": "anovak10/plots",
"path": "DDTmethod/Converters.py",
"copies": "1",
"size": "9313",
"license": "mit",
"hash": 3396949255843328500,
"line_mean": 65.0496453901,
"line_max": 517,
"alpha_frac": 0.647696768,
"autogenerated": false,
"ratio": 2.1794991809033464,
"config_test": false,
"... |
'''a bunch of examples of how to get a list of urls in parallel
each of them uses a different greenhouse api to retrieve a list of urls in
parallel and return a dictionary mapping urls to response bodies
'''
import greenhouse
# urllib2 obviously doesn't explicitly use greenhouse sockets, but we can
# import it with ... | {
"repo_name": "teepark/greenhouse",
"path": "examples/parallel_client.py",
"copies": "1",
"size": "3256",
"license": "bsd-3-clause",
"hash": 1437722325059562800,
"line_mean": 23.8549618321,
"line_max": 79,
"alpha_frac": 0.6652334152,
"autogenerated": false,
"ratio": 3.597790055248619,
"config_t... |
"""A bunch of extractors go here"""
import os
import six
import rarfile
import tarfile
import zipfile
class ExtractorError(Exception):
pass
class ExtractorRegistry(type):
registry = {}
def __new__(cls, name, bases, attrs):
new_cls = type.__new__(cls, name, bases, attrs)
cls.register_ex... | {
"repo_name": "brian-bates/kai",
"path": "kai/extractors.py",
"copies": "1",
"size": "2693",
"license": "bsd-3-clause",
"hash": 1876480067077729000,
"line_mean": 27.0520833333,
"line_max": 74,
"alpha_frac": 0.6201262532,
"autogenerated": false,
"ratio": 4.3088,
"config_test": false,
"has_no_k... |
"""A bunch of functions that are used by multiple threads.
"""
import pt, hashlib, re, subprocess, time, copy, networking, custom, logging, random
from json import dumps as package, loads as unpackage
from urllib import urlopen
import re
#print(json.dumps(x, indent=3, sort_keys=True)) for pretty printing
def getPublic... | {
"repo_name": "jtremback/FlyingFox",
"path": "docs/python/tools.py",
"copies": "2",
"size": "12058",
"license": "unlicense",
"hash": 6177991626753372000,
"line_mean": 37.1582278481,
"line_max": 192,
"alpha_frac": 0.6047437386,
"autogenerated": false,
"ratio": 3.2043582248206217,
"config_test": ... |
""" A bunch of helper functions that, when fixed up, will return the things we
need to make this website work! These functions use the weather and twitter APIs!!!
"""
###############################################
### Problem One! ###
###############################################
def ge... | {
"repo_name": "samanehsan/learn-git",
"path": "helpers.py",
"copies": "2",
"size": "1413",
"license": "apache-2.0",
"hash": -1229171534897610800,
"line_mean": 27.26,
"line_max": 83,
"alpha_frac": 0.423920736,
"autogenerated": false,
"ratio": 5.272388059701493,
"config_test": false,
"has_no_ke... |
# A bunch of nifty utility functions to use in python
import netifaces
import requests
import datetime
import json
import sys
import pymongo
import pprint
import os
import glob
import logging
import time
import math
import subprocess
import re
import ConfigParser
import socket
import shutil
import random
import code... | {
"repo_name": "trohit/automatic-broccoli",
"path": "pyutils.py",
"copies": "1",
"size": "12498",
"license": "mit",
"hash": -1983809346630828500,
"line_mean": 28.8995215311,
"line_max": 92,
"alpha_frac": 0.5886541847,
"autogenerated": false,
"ratio": 3.291545957334738,
"config_test": false,
"h... |
""" Abundances and condensation temperatures.
This contains the following datasets:
Asolar:
An ordered dictionary of abundances from `Lodders 2003, ApJ, 591,
1220 <http://adsabs.harvard.edu/abs/2003ApJ...591.1220L>`_. It
contains a value A for each element `el`, where A is defined::
A(el) = log10 n(el)/n(H... | {
"repo_name": "nhmc/Barak",
"path": "barak/abundances.py",
"copies": "1",
"size": "3322",
"license": "bsd-3-clause",
"hash": -913906225741362400,
"line_mean": 31.568627451,
"line_max": 74,
"alpha_frac": 0.6520168573,
"autogenerated": false,
"ratio": 3.0787766450417053,
"config_test": false,
"... |
# abundanceToolkit.py
"""
This toolkit has several functions that help compare RNA seq runs.
"""
import csv
import os
import json
import numpy as np
####
def abundance_read(infile):
readline, lineNum = [], -1
with open(infile, 'r') as fIn:
for line in fIn:
if line:
lineNum = lineNum + 1
... | {
"repo_name": "DCGenomics/rnaseq_comparison_hackathon_v002",
"path": "collapseGene.py",
"copies": "3",
"size": "6503",
"license": "cc0-1.0",
"hash": 8421708464145993000,
"line_mean": 25.4349593496,
"line_max": 80,
"alpha_frac": 0.5752729509,
"autogenerated": false,
"ratio": 3.2145328719723185,
... |
''' A bundle of ElasticSearch functions used throughout the pipelines
'''
import logging
import os
import types
from os.path import join, dirname
import elasticsearch
import simplejson as json
METADATA_INDEX = 'openfdametadata'
METADATA_TYPE = 'last_run'
RUN_DIR = dirname(dirname(os.path.abspath(__file__)))
INDEX_SE... | {
"repo_name": "HiTechIronMan/openfda",
"path": "openfda/elasticsearch_requests.py",
"copies": "1",
"size": "2227",
"license": "cc0-1.0",
"hash": 5301331187861956000,
"line_mean": 29.5068493151,
"line_max": 82,
"alpha_frac": 0.652896273,
"autogenerated": false,
"ratio": 3.5746388443017656,
"conf... |
"""ab URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based vi... | {
"repo_name": "szymanskirafal/ab",
"path": "ab/urls.py",
"copies": "1",
"size": "1210",
"license": "mit",
"hash": 1874570066930117400,
"line_mean": 33.5714285714,
"line_max": 100,
"alpha_frac": 0.6809917355,
"autogenerated": false,
"ratio": 3.3333333333333335,
"config_test": false,
"has_no_ke... |
"""AbzuGames URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | {
"repo_name": "PachaTechnology/Abzugames",
"path": "AbzuGames/urls.py",
"copies": "2",
"size": "1080",
"license": "apache-2.0",
"hash": 7877839921741770000,
"line_mean": 37.5714285714,
"line_max": 82,
"alpha_frac": 0.7138888889,
"autogenerated": false,
"ratio": 3.495145631067961,
"config_test":... |
# AC2DC.py
#
# This is a demo to show the power of the audio hardware under the
# influence of standard text mode Python.
#
# (C)2010, B.Walker, G0LCU. Now issued as Public Domain; you may do
# with this code as you please.
#
# Tested on PCLinuxOS 2009 and Debian 6.0.0 using Python 2.5.2, 2.6.6
# and 2.7.2; (it may wel... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/577924_Now_Something_COMPLETELY_Different_Using_Text/recipe-577924.py",
"copies": "1",
"size": "2947",
"license": "mit",
"hash": -8052637446363649000,
"line_mean": 34.5060240964,
"line_max": 79,
"alpha_frac": 0.5564981337,
"autogenerated": f... |
"""A C4.5 Decision Tree learner for classification problems"""
import math
def increment_counter(dictionary, key):
"""Increments the counter for a given key in the given dictionary or
sets the counter to 1 if it does not yet exist."""
if key in dictionary:
dictionary[key] += 1
else:
d... | {
"repo_name": "FelixOpolka/Statistical-Learning-Algorithms",
"path": "decision tree/DecisionTree.py",
"copies": "1",
"size": "20040",
"license": "mit",
"hash": 4157810443159869000,
"line_mean": 45.2817551963,
"line_max": 89,
"alpha_frac": 0.6579341317,
"autogenerated": false,
"ratio": 4.424817840... |
"""A cache for immutable values (functions, constants, and classes).
These are immutable for a given interpreter, but may possibly change
if we run multiple Interpreters in sequence. This logic allows the
JIT-compiled machine code to quickly check if we're in the common
case of seeing the same value as previously.
"""... | {
"repo_name": "hippyvm/hippyvm",
"path": "hippy/immut_cache.py",
"copies": "2",
"size": "3884",
"license": "mit",
"hash": 5445372691081891000,
"line_mean": 33.990990991,
"line_max": 75,
"alpha_frac": 0.6207518023,
"autogenerated": false,
"ratio": 4.012396694214876,
"config_test": false,
"has_... |
"""A cache for storing small matrices in multiple formats."""
from __future__ import print_function, division
from sympy import Matrix, I, Pow, Rational, exp, pi
from sympy.physics.quantum.matrixutils import (
to_sympy, to_numpy, to_scipy_sparse
)
class MatrixCache(object):
"""A cache for small matrices in... | {
"repo_name": "Vishluck/sympy",
"path": "sympy/physics/quantum/matrixcache.py",
"copies": "124",
"size": "3519",
"license": "bsd-3-clause",
"hash": 6685193551654197000,
"line_mean": 33.5,
"line_max": 77,
"alpha_frac": 0.5745950554,
"autogenerated": false,
"ratio": 3.3836538461538463,
"config_te... |
"""A cache for storing small matrices in multiple formats."""
from sympy import Matrix, I, Pow, Rational, exp, pi
from sympy.physics.quantum.matrixutils import (
to_sympy, to_numpy, to_scipy_sparse
)
class MatrixCache(object):
"""A cache for small matrices in different formats.
This class takes small m... | {
"repo_name": "flacjacket/sympy",
"path": "sympy/physics/quantum/matrixcache.py",
"copies": "2",
"size": "3425",
"license": "bsd-3-clause",
"hash": 6827747135500982000,
"line_mean": 33.25,
"line_max": 83,
"alpha_frac": 0.5795620438,
"autogenerated": false,
"ratio": 3.387734915924827,
"config_te... |
"""A cache for thumbnailed images."""
from __future__ import unicode_literals
import collections
import sys
import os.path
try:
from io import BytesIO as StringIO
except Exception as e:
from cStringIO import StringIO
from PIL import Image
from django.core.files.base import File
from optimizations.assetcach... | {
"repo_name": "etianen/django-optimizations",
"path": "src/optimizations/thumbnailcache.py",
"copies": "1",
"size": "11169",
"license": "bsd-3-clause",
"hash": -1075283016190675100,
"line_mean": 33.3661538462,
"line_max": 118,
"alpha_frac": 0.6034559943,
"autogenerated": false,
"ratio": 4.1198819... |
"""A cache of javascipt files, optionally compressed."""
from __future__ import unicode_literals
from contextlib import closing
import os.path
import re
import subprocess
try:
from django.utils.six.moves.urllib.parse import urlparse
except ImportError:
from six.moves.urllib.parse import urlparse
from django.... | {
"repo_name": "etianen/django-optimizations",
"path": "src/optimizations/stylesheetcache.py",
"copies": "1",
"size": "5414",
"license": "bsd-3-clause",
"hash": -3155842452696273400,
"line_mean": 36.0821917808,
"line_max": 134,
"alpha_frac": 0.6067602512,
"autogenerated": false,
"ratio": 4.1646153... |
"""A cache of javascipt files, optionally compressed."""
from __future__ import unicode_literals
from django.conf import settings
from django.core.files.base import ContentFile
from optimizations.assetcache import default_asset_cache, GroupedAsset, AdaptiveAsset
from optimizations.assetcompiler import default_asset_c... | {
"repo_name": "etianen/django-optimizations",
"path": "src/optimizations/javascriptcache.py",
"copies": "1",
"size": "3107",
"license": "bsd-3-clause",
"hash": -5335608348478830000,
"line_mean": 35.5647058824,
"line_max": 136,
"alpha_frac": 0.6462825877,
"autogenerated": false,
"ratio": 4.4963820... |
# A caching engine using S3, requires an AWS account
# David Arthur, 2009
# http://cloudcached.com
import boto
from cPickle import loads, dumps
import datetime,hashlib
class Client:
"Client interface to CloudCache"
_STR = 0
_INT = 1
_LONG = 2
_COMPLEX = 4
_FLOAT = 5
_PICKLE =... | {
"repo_name": "mumrah/cloudcache",
"path": "cloudcache/__init__.py",
"copies": "1",
"size": "4035",
"license": "mit",
"hash": 769447558758554400,
"line_mean": 32.347107438,
"line_max": 85,
"alpha_frac": 0.5491945477,
"autogenerated": false,
"ratio": 3.75,
"config_test": false,
"has_no_keyword... |
"""acad_search URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | {
"repo_name": "Vipul999ujawane/acad-search",
"path": "acad_search/urls.py",
"copies": "1",
"size": "1270",
"license": "mit",
"hash": 2513077968553827300,
"line_mean": 39.9677419355,
"line_max": 79,
"alpha_frac": 0.6952755906,
"autogenerated": false,
"ratio": 3.2564102564102564,
"config_test": f... |
"""A calculator based on the OpenKIM project."""
from ase.calculators.calculator import Calculator
from asap3 import _asap
from asap3.Internal.ListOfElements import ListOfElements
from asap3.Internal.BuiltinPotentials import get_cell_heights, smallest_pbc_direction
from ase.data import atomic_numbers, chemical_symbols... | {
"repo_name": "auag92/n2dm",
"path": "Asap-3.8.4/Python/asap3/Internal/OpenKIMcalculator.py",
"copies": "1",
"size": "12767",
"license": "mit",
"hash": 7320069747889538000,
"line_mean": 43.6433566434,
"line_max": 115,
"alpha_frac": 0.5863554476,
"autogenerated": false,
"ratio": 4.02363693665301,
... |
'''A Calculator Implemented With A Top-Down, Recursive-Descent Parser'''
# Author: Erez Shinan, Dec 2012
import re, collections
from operator import add,sub,mul,div
import numpy as np
import nltk_helper
Token = collections.namedtuple('Token', ['name', 'value'])
RuleMatch = collections.namedtuple('RuleMatch', ['name'... | {
"repo_name": "erccarls/vectorsearch",
"path": "vectorsearch/calculator.py",
"copies": "1",
"size": "3152",
"license": "apache-2.0",
"hash": 3688270940453472000,
"line_mean": 35.6627906977,
"line_max": 83,
"alpha_frac": 0.5494923858,
"autogenerated": false,
"ratio": 3.4260869565217393,
"config_... |
"""A Calendar to display editorial content."""
# FIXME: wtf is this and why is it all commented out?
# TODO cleanup with removing this
from calendar import HTMLCalendar
from datetime import date
from itertools import groupby
from django.utils.html import conditional_escape as esc
# class EditorialCalen... | {
"repo_name": "ProjectFacet/facet",
"path": "project/editorial/editorialcalendar.py",
"copies": "1",
"size": "1958",
"license": "mit",
"hash": 489347101347664060,
"line_mean": 34.9433962264,
"line_max": 80,
"alpha_frac": 0.5352400409,
"autogenerated": false,
"ratio": 3.3934142114384747,
"config... |
# A callable is anything that can be called.
# EXAMPLE 1:
# ==============================================================================
class Foo:
def __call__(self):
print 'called'
foo = Foo()
foo()
# EXAMPLE 2:
# ==============================================================================
# Have y... | {
"repo_name": "rolandovillca/python_basic_concepts",
"path": "others/callable.py",
"copies": "4",
"size": "1819",
"license": "mit",
"hash": 7041688077134034000,
"line_mean": 26.5757575758,
"line_max": 80,
"alpha_frac": 0.5057724024,
"autogenerated": false,
"ratio": 3.9287257019438444,
"config_t... |
"""A callback manager that is copyable/picklable."""
import collections
class Transaction(object):
"""A context manager to prevent new events from firing."""
def __init__(self, manager):
self.manager = manager
self._original_state = self.manager.is_queueing()
def __enter__(self):
self.manager.set... | {
"repo_name": "mrroach/CentralServer",
"path": "csrv/model/callback_manager.py",
"copies": "1",
"size": "2020",
"license": "apache-2.0",
"hash": 2343953004957653500,
"line_mean": 27.0555555556,
"line_max": 71,
"alpha_frac": 0.6831683168,
"autogenerated": false,
"ratio": 3.8996138996139,
"config... |
"""A CallTip window class for Tkinter/IDLE.
After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension.
"""
from Tkinter import Toplevel, Label, LEFT, SOLID, TclError
HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
CHECKHIDE_VIRTUAL_EVE... | {
"repo_name": "gameduell/duell",
"path": "bin/win/python2.7.9/Lib/idlelib/CallTipWindow.py",
"copies": "25",
"size": "5968",
"license": "bsd-2-clause",
"hash": -311513745418954240,
"line_mean": 36.3,
"line_max": 79,
"alpha_frac": 0.5872989276,
"autogenerated": false,
"ratio": 3.656862745098039,
... |
"""A CallTip window class for Tkinter/IDLE.
After tooltip.py, which uses ideas gleaned from PySol
Used by the calltips IDLE extension.
"""
from tkinter import Toplevel, Label, LEFT, SOLID, TclError
HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
CHECKHIDE_VIRTUAL_EVE... | {
"repo_name": "Microsoft/PTVS",
"path": "Python/Product/Miniconda/Miniconda3-x64/Lib/idlelib/calltip_w.py",
"copies": "3",
"size": "6117",
"license": "apache-2.0",
"hash": 7641397037113488000,
"line_mean": 36.2987804878,
"line_max": 79,
"alpha_frac": 0.5854176884,
"autogenerated": false,
"ratio":... |
"""A CallTip window class for Tkinter/IDLE.
After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension.
"""
from Tkinter import *
class CallTip:
def __init__(self, widget):
self.widget = widget
self.tipwindow = None
self.id = None
self.x = self.y = ... | {
"repo_name": "MalloyPower/parsing-python",
"path": "front-end/testsuite-python-lib/Python-2.4/Lib/idlelib/CallTipWindow.py",
"copies": "11",
"size": "2716",
"license": "mit",
"hash": -6321301134527625000,
"line_mean": 29.8636363636,
"line_max": 79,
"alpha_frac": 0.5530191458,
"autogenerated": fals... |
"""A CallTip window class for Tkinter/IDLE.
After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension.
"""
from tkinter import *
HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
CHECKHIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-checkhide... | {
"repo_name": "denisff/python-for-android",
"path": "python3-alpha/python3-src/Lib/idlelib/CallTipWindow.py",
"copies": "49",
"size": "5924",
"license": "apache-2.0",
"hash": -3896513594138543000,
"line_mean": 33.6432748538,
"line_max": 79,
"alpha_frac": 0.5697164078,
"autogenerated": false,
"rat... |
"""A CallTip window class for Tkinter/IDLE.
After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension.
"""
from Tkinter import *
HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
CHECKHIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-checkhide... | {
"repo_name": "patrioticcow/MessagesForSkype",
"path": "packages/win32/bundle/MessagesForSkype/modules/python/1.3.1-beta/Lib/idlelib/CallTipWindow.py",
"copies": "96",
"size": "5924",
"license": "mit",
"hash": -5301654483153786000,
"line_mean": 33.6432748538,
"line_max": 79,
"alpha_frac": 0.569716407... |
"""A CallTip window class for Tkinter/IDLE.
After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension.
"""
from tkinter import *
HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
CHECKHIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-checkhide... | {
"repo_name": "MalloyPower/parsing-python",
"path": "front-end/testsuite-python-lib/Python-3.3.0/Lib/idlelib/CallTipWindow.py",
"copies": "6",
"size": "6125",
"license": "mit",
"hash": -587619604425742300,
"line_mean": 34,
"line_max": 79,
"alpha_frac": 0.5699591837,
"autogenerated": false,
"ratio... |
"""A CallTip window class for Tkinter/IDLE.
After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension.
"""
from Tkinter import Toplevel, Label, LEFT, SOLID, TclError
HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
CHECKHIDE_VI... | {
"repo_name": "Jeff-Tian/mybnb",
"path": "Python27/Lib/idlelib/CallTipWindow.py",
"copies": "1",
"size": "6195",
"license": "apache-2.0",
"hash": 6354900288663753000,
"line_mean": 36.4782608696,
"line_max": 79,
"alpha_frac": 0.5717514124,
"autogenerated": false,
"ratio": 3.7118034751348112,
"co... |
"""A CallTip window class for Tkinter/IDLE.
After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension.
"""
from Tkinter import *
HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
CHECKHIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow... | {
"repo_name": "ericlink/adms-server",
"path": "playframework-dist/1.1-src/python/Lib/idlelib/CallTipWindow.py",
"copies": "7",
"size": "6095",
"license": "mit",
"hash": 3236687461239166000,
"line_mean": 33.6432748538,
"line_max": 79,
"alpha_frac": 0.5537325677,
"autogenerated": false,
"ratio": 3.... |
# A call tracer decorator for both functions and methods
def tracer(func): # Use function, not class with __call__
calls = 0 # Else "self" is decorator instance only!
def onCall(*args, **kwargs): # Or in 2.X+3.X: use [onCall.calls += 1]
nonlocal... | {
"repo_name": "dreadrel/UWF_2014_spring_COP3990C-2507",
"path": "notebooks/scripts/book_code/code/calltracer.py",
"copies": "1",
"size": "1602",
"license": "apache-2.0",
"hash": -6866787486013216000,
"line_mean": 32.375,
"line_max": 83,
"alpha_frac": 0.5056179775,
"autogenerated": false,
"ratio":... |
"""A camera device."""
import time
from pathlib import Path
from sb_vision import Camera as VisionCamera
from sb_vision import Token, Vision
from .devices_base import Board
class Camera(Board):
"""A camera."""
lookup_keys = {
'subsystem': 'video4linux',
}
DISTANCE_MODEL = 'c270'
IMAGE... | {
"repo_name": "sourcebots/robotd",
"path": "robotd/camera.py",
"copies": "1",
"size": "1711",
"license": "mit",
"hash": -7538196464957318000,
"line_mean": 23.7971014493,
"line_max": 77,
"alpha_frac": 0.5429573349,
"autogenerated": false,
"ratio": 4.112980769230769,
"config_test": false,
"has_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.