text stringlengths 0 1.05M | meta dict |
|---|---|
#A place for code to be called from C-code
# that implements more complicated stuff.
import re
import sys
#from _mx_datetime_parser import *
if (sys.byteorder == 'little'):
_nbo = '<'
else:
_nbo = '>'
def _makenames_list(adict):
from multiarray import dtype
allfields = []
fnames = adict.keys()
... | {
"repo_name": "chadnetzer/numpy-gaurdro",
"path": "numpy/core/_internal.py",
"copies": "3",
"size": "10368",
"license": "bsd-3-clause",
"hash": -2971847423534166500,
"line_mean": 28.7077363897,
"line_max": 122,
"alpha_frac": 0.5529513889,
"autogenerated": false,
"ratio": 3.8033749082905355,
"co... |
#A place for code to be called from C-code
# that implements more complicated stuff.
import re
import sys
from _mx_datetime_parser import *
if (sys.byteorder == 'little'):
_nbo = '<'
else:
_nbo = '>'
def _makenames_list(adict):
from multiarray import dtype
allfields = []
fnames = adict.keys()
... | {
"repo_name": "illume/numpy3k",
"path": "numpy/core/_internal.py",
"copies": "1",
"size": "10367",
"license": "bsd-3-clause",
"hash": 9003052224486059000,
"line_mean": 28.7048710602,
"line_max": 122,
"alpha_frac": 0.5530047265,
"autogenerated": false,
"ratio": 3.8044036697247705,
"config_test":... |
#A place for code to be called from C-code
# that implements more complicated stuff.
import re
import sys
import warnings
from numpy.compat import asbytes, bytes
if (sys.byteorder == 'little'):
_nbo = asbytes('<')
else:
_nbo = asbytes('>')
def _makenames_list(adict, align):
from multiarray import dtype... | {
"repo_name": "pelson/numpy",
"path": "numpy/core/_internal.py",
"copies": "1",
"size": "16554",
"license": "bsd-3-clause",
"hash": 7702190861246649000,
"line_mean": 28.4555160142,
"line_max": 102,
"alpha_frac": 0.521444968,
"autogenerated": false,
"ratio": 3.7872340425531914,
"config_test": fa... |
#A place for code to be called from C-code
# that implements more complicated stuff.
import re
import sys
from numpy.compat import asbytes, bytes
if (sys.byteorder == 'little'):
_nbo = asbytes('<')
else:
_nbo = asbytes('>')
def _makenames_list(adict):
from multiarray import dtype
allfields = []
... | {
"repo_name": "dagss/numpy_svn",
"path": "numpy/core/_internal.py",
"copies": "2",
"size": "17690",
"license": "bsd-3-clause",
"hash": 3303125416066148400,
"line_mean": 28,
"line_max": 131,
"alpha_frac": 0.5335217637,
"autogenerated": false,
"ratio": 3.765432098765432,
"config_test": false,
"... |
#A place for code to be called from C-code
# that implements more complicated stuff.
import re
import sys
if (sys.byteorder == 'little'):
_nbo = '<'
else:
_nbo = '>'
def _makenames_list(adict):
from multiarray import dtype
allfields = []
fnames = adict.keys()
for fname in fnames:
obj... | {
"repo_name": "houseind/robothon",
"path": "GlyphProofer/dist/GlyphProofer.app/Contents/Resources/lib/python2.6/numpy/core/_internal.py",
"copies": "1",
"size": "8420",
"license": "mit",
"hash": -771053260792686000,
"line_mean": 27.6394557823,
"line_max": 122,
"alpha_frac": 0.5573634204,
"autogener... |
"""A place for useful functions and classes that don't have a home."""
import json
import yaml
import logging
import os
import csv
from datapackage import DataPackage
from os.path import isfile, join
from petl import fromdicts, look, fromcsv, dicts
from slugify import slugify
from .config import (
CODELISTS_DIR,... | {
"repo_name": "Victordeleon/os-data-importers",
"path": "eu-structural-funds/common/utilities.py",
"copies": "1",
"size": "5651",
"license": "mit",
"hash": 5958126724003183000,
"line_mean": 26.9752475248,
"line_max": 76,
"alpha_frac": 0.6308617944,
"autogenerated": false,
"ratio": 3.9134349030470... |
"""A Platform controller
Files & Folder, DateTime classes
"""
import os
import argparse
import datetime
import platform
from pprint import pprint
import shutil
import re
from subprocess import call, check_call, check_output, Popen, PIPE, STDOUT
from sys import platform as _platform
try:
import win32com.client as ... | {
"repo_name": "kubow/HAC",
"path": "System/OS74.py",
"copies": "1",
"size": "14638",
"license": "unlicense",
"hash": -8456782645580089000,
"line_mean": 37.1197916667,
"line_max": 126,
"alpha_frac": 0.5403060527,
"autogenerated": false,
"ratio": 3.88688263409453,
"config_test": false,
"has_no_... |
#A platform neutral detection mechanism for the platform
#this will spit out the search and install functions for any given platform
import platform
import sys
import os
from camio_deps import *
#Uname examples
# Fedora 14:
# uname() = ('Linux', 'nf-test109.cl.cam.ac.uk', '2.6.35.14-106.fc14.x86_64', '#1 SMP Wed No... | {
"repo_name": "mgrosvenor/camio2",
"path": "old/scripts/camio_prepare_arch.py",
"copies": "2",
"size": "2916",
"license": "bsd-3-clause",
"hash": -8923015168130724000,
"line_mean": 36.8701298701,
"line_max": 185,
"alpha_frac": 0.621399177,
"autogenerated": false,
"ratio": 2.951417004048583,
"co... |
"""A platform that to monitor Uptime Robot monitors."""
import logging
from pyuptimerobot import UptimeRobot
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
PLATFORM_SCHEMA,
BinarySensorEntity,
)
from homeassistant.const import ATTR_ATTRIBUTION, CON... | {
"repo_name": "tchellomello/home-assistant",
"path": "homeassistant/components/uptimerobot/binary_sensor.py",
"copies": "10",
"size": "2667",
"license": "apache-2.0",
"hash": -3709408380411471400,
"line_mean": 28.9662921348,
"line_max": 81,
"alpha_frac": 0.6295463067,
"autogenerated": false,
"rat... |
"""A platform that to monitor Uptime Robot monitors."""
import logging
from pyuptimerobot import UptimeRobot
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY
import homeassistant.helpers.confi... | {
"repo_name": "postlund/home-assistant",
"path": "homeassistant/components/uptimerobot/binary_sensor.py",
"copies": "4",
"size": "2612",
"license": "apache-2.0",
"hash": 8699783346436395000,
"line_mean": 29.7294117647,
"line_max": 86,
"alpha_frac": 0.6297856049,
"autogenerated": false,
"ratio": 4... |
"""A platform that to monitor Uptime Robot monitors."""
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA, BinarySensorDevice)
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY
import homeassistant.helpers.config_validation as cv
_LOGGER = l... | {
"repo_name": "MartinHjelmare/home-assistant",
"path": "homeassistant/components/uptimerobot/binary_sensor.py",
"copies": "7",
"size": "2573",
"license": "apache-2.0",
"hash": 2132857675665406000,
"line_mean": 29.2705882353,
"line_max": 77,
"alpha_frac": 0.6393315196,
"autogenerated": false,
"rat... |
"""A platform that to monitor Uptime Robot monitors."""
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.... | {
"repo_name": "Cinntax/home-assistant",
"path": "homeassistant/components/uptimerobot/binary_sensor.py",
"copies": "3",
"size": "2616",
"license": "apache-2.0",
"hash": -817632635388466600,
"line_mean": 29.7764705882,
"line_max": 86,
"alpha_frac": 0.62882263,
"autogenerated": false,
"ratio": 4.13... |
"""A platform which allows you to get information from Tautulli."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_API_KEY, CONF_HOST, CONF_MONITORED_CONDITIONS, CONF_NAME, CONF_PORT,
CON... | {
"repo_name": "MartinHjelmare/home-assistant",
"path": "homeassistant/components/tautulli/sensor.py",
"copies": "5",
"size": "4982",
"license": "apache-2.0",
"hash": -7034662715303056000,
"line_mean": 33.5972222222,
"line_max": 79,
"alpha_frac": 0.6493376154,
"autogenerated": false,
"ratio": 3.84... |
"""A platform which allows you to get information from Tautulli."""
from datetime import timedelta
from pytautulli import Tautulli
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
CONF_API_KEY,
CONF_HOST,
CONF_MONITORED_CO... | {
"repo_name": "home-assistant/home-assistant",
"path": "homeassistant/components/tautulli/sensor.py",
"copies": "5",
"size": "5085",
"license": "apache-2.0",
"hash": -8394826887668499000,
"line_mean": 32.2352941176,
"line_max": 86,
"alpha_frac": 0.6389380531,
"autogenerated": false,
"ratio": 3.85... |
""" A playful implementation of the famous "German Tank Problem" in statistics.
First, the random number generator populates a list of "tanks", represented
by sequential serial numbers. The numbers are added to the list in random
order until they run out.
We then choose the sample size, representi... | {
"repo_name": "doolanshire/Combat-Models",
"path": "germantank/germantankproblem.py",
"copies": "1",
"size": "2069",
"license": "mit",
"hash": 6782802843258085000,
"line_mean": 34.6896551724,
"line_max": 79,
"alpha_frac": 0.6964717255,
"autogenerated": false,
"ratio": 4.231083844580777,
"config... |
"""A play local music files example
To use the script:
* Make sure soco is installed
* Drop this script into a folder that, besides python files, contains
nothing but music files
* Adjust the settings on the first three lines of the main function
* Run the script
"""
from __future__ import print_function, unic... | {
"repo_name": "bwhaley/SoCo",
"path": "examples/play_local_files/play_local_files.py",
"copies": "12",
"size": "3285",
"license": "mit",
"hash": -5350110950678847000,
"line_mean": 29.9905660377,
"line_max": 78,
"alpha_frac": 0.6566210046,
"autogenerated": false,
"ratio": 3.967391304347826,
"con... |
"""A play local music files example
To use the script:
* Make sure soco is installed
* Drop this script into a folder that, besides python files, contains
nothing but music files
* Choose which player to use and run the script at the command line as such:
play_local_files.py "Living Room"
NOTE: The script has be... | {
"repo_name": "KennethNielsen/SoCo",
"path": "examples/play_local_files/play_local_files.py",
"copies": "1",
"size": "5396",
"license": "mit",
"hash": 3533822638462514700,
"line_mean": 30.0114942529,
"line_max": 85,
"alpha_frac": 0.647516679,
"autogenerated": false,
"ratio": 3.9473299195318217,
... |
"""aplicaciones_informaticas URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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, nam... | {
"repo_name": "awainer/7539",
"path": "aplicaciones_informaticas/aplicaciones_informaticas/urls.py",
"copies": "1",
"size": "3216",
"license": "unlicense",
"hash": 4899393259536788000,
"line_mean": 50.8709677419,
"line_max": 104,
"alpha_frac": 0.6486318408,
"autogenerated": false,
"ratio": 3.0952... |
#Aplicación para construir coches mediante
#el ensamblado de sus partes (motor, chasis, etc.)
class AbstractFactory(object):
def crearCoche(self, **args):
raise NotImplementedError("Requires derived factory class for implementation.")
def crearMotor(self, **args):
raise NotImplementedError("Requ... | {
"repo_name": "AnhellO/DAS_Sistemas",
"path": "Ago-Dic-2018/David Perez/Practica3_y_exposicion/AbstractFactory1.py",
"copies": "1",
"size": "1521",
"license": "mit",
"hash": 1206751590669739300,
"line_mean": 32.7777777778,
"line_max": 87,
"alpha_frac": 0.65,
"autogenerated": false,
"ratio": 3.610... |
"""A PLOT3D file reader. This reader does not support a timeseries of
files.
"""
# Author: Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
# Copyright (c) 2007-2015, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from os.path import basename, isfile, exists, splitext
# Enthought library imports.
fr... | {
"repo_name": "dmsurti/mayavi",
"path": "mayavi/sources/plot3d_reader.py",
"copies": "1",
"size": "10421",
"license": "bsd-3-clause",
"hash": 2697921063207734000,
"line_mean": 34.9344827586,
"line_max": 83,
"alpha_frac": 0.4981287784,
"autogenerated": false,
"ratio": 4.428814279643009,
"config_... |
"""A PLOT3D file reader. This reader does not support a timeseries of
files.
"""
# Author: Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
# Copyright (c) 2007, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from os.path import basename, isfile, exists, splitext
# Enthought library imports.
from tr... | {
"repo_name": "alexandreleroux/mayavi",
"path": "mayavi/sources/plot3d_reader.py",
"copies": "2",
"size": "10417",
"license": "bsd-3-clause",
"hash": -2603234849827698000,
"line_mean": 34.7972508591,
"line_max": 83,
"alpha_frac": 0.497936066,
"autogenerated": false,
"ratio": 4.432765957446809,
... |
"""A plot of the deltas for erosion between scenarios."""
import datetime
import sys
from pyiem.dep import read_crop
from pyiem.plot.use_agg import plt
import matplotlib.dates as mdates
def main(argv):
"""Go Main Go."""
huc12 = argv[1]
fpath = argv[2]
year = int(argv[3])
prop_cycle = plt.rcParams... | {
"repo_name": "akrherz/idep",
"path": "scripts/tillage_timing/plot_crop.py",
"copies": "2",
"size": "2113",
"license": "mit",
"hash": -1889929092373244400,
"line_mean": 32.5396825397,
"line_max": 72,
"alpha_frac": 0.5802177,
"autogenerated": false,
"ratio": 2.967696629213483,
"config_test": fal... |
"""A plot of the deltas for erosion between scenarios."""
import datetime
import sys
from pyiem.dep import read_env
from pyiem.plot.use_agg import plt
import matplotlib.dates as mdates
def main(argv):
"""Go Main Go."""
huc12 = argv[1]
fpath = argv[2]
year = int(argv[3])
prop_cycle = plt.rcParams[... | {
"repo_name": "akrherz/dep",
"path": "scripts/tillage_timing/plot_dailydeltas.py",
"copies": "2",
"size": "2278",
"license": "mit",
"hash": 7817540743329571000,
"line_mean": 31.5428571429,
"line_max": 77,
"alpha_frac": 0.5359964881,
"autogenerated": false,
"ratio": 3.2129760225669957,
"config_t... |
"""A plot of the deltas for erosion between scenarios."""
import datetime
import sys
from pyiem.plot.use_agg import plt
from pyiem.util import get_dbconn
import pandas as pd
from pandas.io.sql import read_sql
import matplotlib.dates as mdates
def main(argv):
"""Go Main Go."""
huc12 = argv[1]
year = int(a... | {
"repo_name": "akrherz/idep",
"path": "scripts/tillage_timing/plot_dailydeltas_huc12.py",
"copies": "2",
"size": "2417",
"license": "mit",
"hash": 3561513481146395600,
"line_mean": 31.6621621622,
"line_max": 77,
"alpha_frac": 0.5519238726,
"autogenerated": false,
"ratio": 3.266216216216216,
"co... |
"""A plot of the deltas for erosion between scenarios."""
import os
from pyiem.dep import read_env
from pyiem.plot.use_agg import plt
from tqdm import tqdm
import numpy as np
def plot():
"""Plot."""
y = [...]
y = np.array(y)
fig, ax = plt.subplots(1, 1)
ax.set_title(
"DEP Additional Sprin... | {
"repo_name": "akrherz/dep",
"path": "scripts/climatechange/plot_yearly.py",
"copies": "2",
"size": "1548",
"license": "mit",
"hash": -9023072279120573000,
"line_mean": 27.6666666667,
"line_max": 75,
"alpha_frac": 0.5562015504,
"autogenerated": false,
"ratio": 3.120967741935484,
"config_test": ... |
""" A Plot which uses ScaleSystems for its ticks.
"""
from traits.api import Any
from chaco.api import (DataRange2D, LinearMapper, LogMapper,
PlotGrid, Plot, PlotAxis)
from chaco.scales_tick_generator import ScalesTickGenerator
from chaco.scales.api import DefaultScale, LogScale, ScaleSystem
def add_default_axe... | {
"repo_name": "burnpanck/chaco",
"path": "chaco/shell/scaly_plot.py",
"copies": "3",
"size": "4448",
"license": "bsd-3-clause",
"hash": 1441726591063034400,
"line_mean": 34.584,
"line_max": 88,
"alpha_frac": 0.5915017986,
"autogenerated": false,
"ratio": 3.9051799824407376,
"config_test": false... |
"""A plugin-able framework for the static analysis of Scratch projects."""
from __future__ import print_function
import appdirs
import cPickle
import errno
import importlib
import kurt
import os
import sys
import traceback
from hashlib import sha1
from imp import load_source
from optparse import OptionParser
from .plu... | {
"repo_name": "thsunmy/hairball",
"path": "hairball/__init__.py",
"copies": "2",
"size": "10925",
"license": "bsd-2-clause",
"hash": -2392027369944029000,
"line_mean": 37.8790035587,
"line_max": 79,
"alpha_frac": 0.5393135011,
"autogenerated": false,
"ratio": 4.644982993197279,
"config_test": f... |
"""A plugin-able framework for the static analysis of Scratch projects."""
import kurt
import os
import sys
from imp import load_source
from optparse import OptionParser
from .plugins import HairballPlugin
__version__ = '0.1rc3'
class Hairball(object):
"""The Hairball exeuction class.
This class is respo... | {
"repo_name": "jemole/hairball",
"path": "hairball/__init__.py",
"copies": "1",
"size": "6081",
"license": "bsd-2-clause",
"hash": 7289362801204921000,
"line_mean": 39.54,
"line_max": 79,
"alpha_frac": 0.5318204243,
"autogenerated": false,
"ratio": 4.8223632038065025,
"config_test": false,
"h... |
# A plugin for allowing people who are not daytraders to spam the channel with bitcoin prices.
import includes.helpers as helpers
import datetime
import logging
import json
import urllib.request
import time
import threading # Stopgap solution
class BTC(helpers.Plugin):
def __init__(self, parent):
super().__ini... | {
"repo_name": "Sulter/MASTERlinker",
"path": "plugins/BTC.py",
"copies": "1",
"size": "4628",
"license": "mit",
"hash": 4822214217128051000,
"line_mean": 43,
"line_max": 188,
"alpha_frac": 0.6374458874,
"autogenerated": false,
"ratio": 3.1665524331734063,
"config_test": true,
"has_no_keywords... |
"""A plugins that implements epheremal addresses"""
import sys
from socket import AF_INET6
from subprocess import Popen, PIPE
from contextlib import nested
from threading import RLock
import NDprotector
from NDprotector.Plugin import Plugin
from NDprotector.Log import warn
from NDprotector.Address import Address
from... | {
"repo_name": "tcheneau/NDprotector",
"path": "NDprotector/plugins/ephemeraladdress.py",
"copies": "2",
"size": "14989",
"license": "bsd-3-clause",
"hash": -6006806601095283000,
"line_mean": 33.299771167,
"line_max": 107,
"alpha_frac": 0.5605443992,
"autogenerated": false,
"ratio": 3.994936034115... |
# A plugin that gives when the bot last saw the user
import includes.helpers as helpers
import sqlite3
import time
import datetime
import logging
class seen(helpers.Plugin):
def __init__(self, parent):
super().__init__(parent)
default_config = {
'name_replacements': {}
}
self.config = helpers.... | {
"repo_name": "Sulter/MASTERlinker",
"path": "plugins/seen.py",
"copies": "1",
"size": "2452",
"license": "mit",
"hash": -7790782952050977000,
"line_mean": 35.5970149254,
"line_max": 108,
"alpha_frac": 0.6378466558,
"autogenerated": false,
"ratio": 3.7378048780487805,
"config_test": true,
"ha... |
# A plugin that tracks number of lines and words written by users
import includes.helpers as helpers
import sqlite3
import time
import re
import random
class stats(helpers.Plugin):
def __init__(self, parent):
super().__init__(parent)
db_path = "database/stats.db"
self.connection = sqlite3.connect(db_pat... | {
"repo_name": "Sulter/MASTERlinker",
"path": "plugins/stats.py",
"copies": "1",
"size": "2134",
"license": "mit",
"hash": 5622441777195780000,
"line_mean": 34.5666666667,
"line_max": 170,
"alpha_frac": 0.6569821931,
"autogenerated": false,
"ratio": 3.7373029772329245,
"config_test": false,
"h... |
"""A plugin to allow us to issue jira queries over slack"""
from jira import JIRA
import os
import re
import datetime
JIRA_USER = os.environ['JIRA_USER']
JIRA_AUTH = os.environ['JIRA_AUTH']
OPTIONS = {
'server': 'https://trifacta.atlassian.net'
}
def preprocess(issue):
"""Takes a single issue pulled from a ... | {
"repo_name": "michaelMinar/limbo",
"path": "limbo/plugins/scrum.py",
"copies": "1",
"size": "2934",
"license": "mit",
"hash": 3669781432600255500,
"line_mean": 32.3409090909,
"line_max": 88,
"alpha_frac": 0.6376959782,
"autogenerated": false,
"ratio": 3.345496009122007,
"config_test": false,
... |
"""A plugin to allow us to issue jira queries over slack"""
from jira import JIRA
import os
import re
JIRA_USER = os.environ['JIRA_USER']
JIRA_AUTH = os.environ['JIRA_AUTH']
OPTIONS = {
'server': 'https://trifacta.atlassian.net'
}
def preprocess(issue):
"""Takes a single issue pulled from a JIRA query and
... | {
"repo_name": "michaelMinar/limbo",
"path": "limbo/plugins/jira_query.py",
"copies": "1",
"size": "1519",
"license": "mit",
"hash": -3063349528694045000,
"line_mean": 28.2115384615,
"line_max": 85,
"alpha_frac": 0.6333113891,
"autogenerated": false,
"ratio": 3.2319148936170214,
"config_test": f... |
"""A plugin to disable django database migrations (saves a lot of time)
Use --no-migrations to disable django database migrations.
"""
from nose.plugins import Plugin
class DjangoMigrationsPlugin(Plugin):
"""Run tests without Django database migrations."""
# Inspired by https://gist.github.com/NotSqrt/5f3c7... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/tests/noseplugins/djangomigrations.py",
"copies": "2",
"size": "1270",
"license": "bsd-3-clause",
"hash": 9155848240782301000,
"line_mean": 33.3243243243,
"line_max": 79,
"alpha_frac": 0.6385826772,
"autogenerated": false,
"ratio": 4.261744... |
# A plugin to enable link helpers for Astronomical coordinate conversions.
# This requires Astropy >= 0.4.
# Coordinate transforms (requires Astropy>)
from ...config import link_function, link_helper
from ...core.link_helpers import MultiLink
from astropy import units as u
from astropy.coordinates import ICRS, FK5, ... | {
"repo_name": "JudoWill/glue",
"path": "glue/plugins/coordinate_helpers/link_helpers.py",
"copies": "1",
"size": "2969",
"license": "bsd-3-clause",
"hash": -5370298065205755000,
"line_mean": 34.7710843373,
"line_max": 79,
"alpha_frac": 0.6308521388,
"autogenerated": false,
"ratio": 2.865830115830... |
# A plugin to enable link helpers for Astronomical coordinate conversions.
# This requires Astropy >= 0.4.
# Coordinate transforms (requires Astropy>)
from __future__ import absolute_import, division, print_function
from astropy import units as u
from astropy.coordinates import ICRS, FK5, FK4, Galactic, Galactocentr... | {
"repo_name": "saimn/glue",
"path": "glue/plugins/coordinate_helpers/link_helpers.py",
"copies": "4",
"size": "4198",
"license": "bsd-3-clause",
"hash": 9062943850291271000,
"line_mean": 35.8245614035,
"line_max": 109,
"alpha_frac": 0.6176750834,
"autogenerated": false,
"ratio": 2.758212877792378... |
""" A plugin to incorporate work-item creation in VSTS
easily out of issues detected from Sentry.io """
from __future__ import absolute_import
from mistune import markdown
from sentry.plugins.bases.issue2 import IssueTrackingPlugin2
from sentry.utils.http import absolute_uri
from sentry.integrations import FeatureDes... | {
"repo_name": "beeftornado/sentry",
"path": "src/sentry_plugins/vsts/plugin.py",
"copies": "1",
"size": "6480",
"license": "bsd-3-clause",
"hash": 1505127334814132700,
"line_mean": 37.1176470588,
"line_max": 111,
"alpha_frac": 0.5512345679,
"autogenerated": false,
"ratio": 4.42019099590723,
"co... |
"""A plugin to interact with Plex Media Servers."""
###############################################################################
#
# Until version 1.0.0:
# TODO: [X] Discover Servers
# TODO: [ ] Access Libraries
# TODO: [ ] - Notify about new shows/Movies
# TODO: [ ] - Check for new episodes that ar... | {
"repo_name": "Sirs0ri/PersonalAssistant",
"path": "samantha/plugins/plex_plugin.py",
"copies": "1",
"size": "9594",
"license": "mit",
"hash": 232339813623651620,
"line_mean": 38.1422594142,
"line_max": 79,
"alpha_frac": 0.544819679,
"autogenerated": false,
"ratio": 4.319675821701936,
"config_t... |
"""A plugin to react to new pokes from Facebook.
It hijacks an authentication-cookie which the user has to enter manually.
Nomnomnom, Cookies!
Problem: This cookie is only alive for about a week, after that it would have
to be renewed. I'm too lazy to do that right now which is why I deactivated the
plugin for now.
... | {
"repo_name": "Sirs0ri/PersonalAssistant",
"path": "samantha/plugins/facebook_plugin.py",
"copies": "1",
"size": "7599",
"license": "mit",
"hash": 271982397648361500,
"line_mean": 35.0142180095,
"line_max": 79,
"alpha_frac": 0.5729701276,
"autogenerated": false,
"ratio": 3.9973698053655973,
"co... |
"""A plugin to test loading devices. It doesn't do anything."""
###############################################################################
#
# TODO: [ ] Add a receiver to intercept commands from the remote
#
###############################################################################
# standard library impor... | {
"repo_name": "Sirs0ri/PersonalAssistant",
"path": "samantha/plugins/433_plugin.py",
"copies": "1",
"size": "6600",
"license": "mit",
"hash": 4163711639678434300,
"line_mean": 26.3858921162,
"line_max": 79,
"alpha_frac": 0.5703030303,
"autogenerated": false,
"ratio": 3.3933161953727504,
"config... |
"""A plugin to test loading devices. It doesn't do anything."""
###############################################################################
#
# TODO: [ ]
#
###############################################################################
# standard library imports
import logging
# related third party imports
# a... | {
"repo_name": "Sirs0ri/PersonalAssistant",
"path": "samantha/plugins/mediacenter_plugin.py",
"copies": "1",
"size": "3484",
"license": "mit",
"hash": -3644449815534917600,
"line_mean": 38.1460674157,
"line_max": 79,
"alpha_frac": 0.5559701493,
"autogenerated": false,
"ratio": 4.274846625766871,
... |
"""A plugin to test loading plugins. It doesn't do anything."""
###############################################################################
#
# TODO: [ ]
#
###############################################################################
# standard library imports
import configparser
import logging
# related thir... | {
"repo_name": "Sirs0ri/PersonalAssistant",
"path": "samantha/plugins/fritzbox_plugin.py",
"copies": "1",
"size": "5776",
"license": "mit",
"hash": -5830945738432336000,
"line_mean": 33.380952381,
"line_max": 79,
"alpha_frac": 0.5631925208,
"autogenerated": false,
"ratio": 4.222222222222222,
"co... |
#A Ply parser for the dimacs file format.
#importing lex and yacc
import ply.lex as lex
import ply.yacc as yacc
import sys
import copy
import pdb
#Tokens for the ply
tokens = ["VARIABLE",
"TERMCHAR",
"P_LINE" ,
"CNF" ]
#Tokens defined with regular expressions
t_VARIABLE = ... | {
"repo_name": "KingsleyZ/PyBool",
"path": "python/PyBool/include/PyBool_dimacs_parse.py",
"copies": "2",
"size": "2324",
"license": "bsd-2-clause",
"hash": -8167084784108311000,
"line_mean": 23.2083333333,
"line_max": 83,
"alpha_frac": 0.5856282272,
"autogenerated": false,
"ratio": 3.542682926829... |
"""apman URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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-base... | {
"repo_name": "saanobhaai/apman",
"path": "apman/urls.py",
"copies": "1",
"size": "1793",
"license": "mit",
"hash": -5404255959223195000,
"line_mean": 51.7352941176,
"line_max": 115,
"alpha_frac": 0.6358059119,
"autogenerated": false,
"ratio": 3.6893004115226335,
"config_test": false,
"has_no... |
"""apns_demo.py : Example app which uses the APNS service to send
push notifications. """
import sys
from twisted.internet import reactor
from twisted.python import log
from pushpy import apns, apns_feedback, blackberry, gcm
USE_SANDBOX = True
CERTIFICATE_FILE = "apple_cert.pem"
KEY_FILE = "apple_key.pem"
APNS_QUEUE_... | {
"repo_name": "trulabs/pushpy",
"path": "apns_demo.py",
"copies": "1",
"size": "1767",
"license": "bsd-3-clause",
"hash": -111601016887598180,
"line_mean": 34.34,
"line_max": 71,
"alpha_frac": 0.6344086022,
"autogenerated": false,
"ratio": 3.6889352818371606,
"config_test": false,
"has_no_key... |
"""apns_feedback.py: Module which contains functionality which polls
the APNS feedback service for expired/invalid tokens. """
import base64
import struct
import common
from twisted.internet.protocol import ReconnectingClientFactory
from twisted.internet import defer, reactor
from twisted.protocols.basic import LineRe... | {
"repo_name": "trulabs/pushpy",
"path": "pushpy/apns_feedback.py",
"copies": "1",
"size": "5213",
"license": "bsd-3-clause",
"hash": 5236653419254084000,
"line_mean": 34.9517241379,
"line_max": 80,
"alpha_frac": 0.6385958181,
"autogenerated": false,
"ratio": 4.588908450704225,
"config_test": fa... |
"""APNS Notification platform."""
import logging
from apns2.client import APNsClient
from apns2.errors import Unregistered
from apns2.payload import Payload
import voluptuous as vol
from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER_DOMAIN
from homeassistant.components.notify import (
AT... | {
"repo_name": "robbiet480/home-assistant",
"path": "homeassistant/components/apns/notify.py",
"copies": "9",
"size": "8136",
"license": "apache-2.0",
"hash": -9062621551540081000,
"line_mean": 29.8181818182,
"line_max": 83,
"alpha_frac": 0.6027531957,
"autogenerated": false,
"ratio": 4.1278538812... |
"""APNS Notification platform."""
import logging
import voluptuous as vol
from homeassistant.config import load_yaml_config_file
from homeassistant.const import ATTR_NAME, CONF_NAME, CONF_PLATFORM
from homeassistant.helpers import template as template_helper
import homeassistant.helpers.config_validation as cv
from h... | {
"repo_name": "Cinntax/home-assistant",
"path": "homeassistant/components/apns/notify.py",
"copies": "1",
"size": "8154",
"license": "apache-2.0",
"hash": 5324043680316840000,
"line_mean": 29.7698113208,
"line_max": 82,
"alpha_frac": 0.59909247,
"autogenerated": false,
"ratio": 4.1119515885022695... |
"""apns.py: Module which contains functionality enabling push notification
messages to be sent to the APNS. """
import time
import common
import base64
import struct
import datetime
import collections
import Queue
import binascii
from twisted.internet.protocol import Protocol, ReconnectingClientFactory
from twisted.py... | {
"repo_name": "trulabs/pushpy",
"path": "pushpy/apns.py",
"copies": "1",
"size": "18061",
"license": "bsd-3-clause",
"hash": 5171642258946634000,
"line_mean": 40.6152073733,
"line_max": 80,
"alpha_frac": 0.5715630364,
"autogenerated": false,
"ratio": 4.639352684305163,
"config_test": false,
"... |
"""APNS Router"""
import socket
import uuid
from typing import Any # noqa
from hyper.http20.exceptions import ConnectionError, HTTP20Error
from twisted.internet.threads import deferToThread
from twisted.logger import Logger
from autopush.exceptions import RouterException
from autopush.metrics import make_tags
from a... | {
"repo_name": "mozilla-services/autopush",
"path": "autopush/router/apnsrouter.py",
"copies": "1",
"size": "8491",
"license": "mpl-2.0",
"hash": 4763950799466837000,
"line_mean": 40.8275862069,
"line_max": 79,
"alpha_frac": 0.5677776469,
"autogenerated": false,
"ratio": 4.579827400215749,
"conf... |
bl_info = {
"name": "Apocalypse Model (APM) format",
"author": "Madd Games",
"blender": (2, 69, 0),
"location": "File > Import-Export",
"description": "Export models for use with the Apocalypse Engine.",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"support": 'OFFICIAL', # un... | {
"repo_name": "madd-games/apocalypse",
"path": "SDK/apoc_blender.py",
"copies": "1",
"size": "6515",
"license": "bsd-2-clause",
"hash": 1056802498718785400,
"line_mean": 30.9362745098,
"line_max": 196,
"alpha_frac": 0.6353031466,
"autogenerated": false,
"ratio": 2.9573309123921923,
"config_test... |
"""A Pointer is the main handler when interacting with remote data.
A Pointer object represents an API for interacting with data (of any type)
at a specific location. The pointer should never be instantiated, only subclassed.
The relation between pointers and data is many to one,
there can be multiple pointers pointin... | {
"repo_name": "OpenMined/PySyft",
"path": "packages/syft/src/syft/core/pointer/pointer.py",
"copies": "1",
"size": "21445",
"license": "apache-2.0",
"hash": -4318425704001569000,
"line_mean": 35.5332197615,
"line_max": 99,
"alpha_frac": 0.6073210539,
"autogenerated": false,
"ratio": 4.52712687354... |
""" A pointmass maze env."""
from gym.envs.mujoco import mujoco_env
from gym import utils
from d4rl import offline_env
from d4rl.pointmaze.dynamic_mjc import MJCModel
import numpy as np
import random
WALL = 10
EMPTY = 11
GOAL = 12
def parse_maze(maze_str):
lines = maze_str.strip().split('\\')
width, height ... | {
"repo_name": "rail-berkeley/d4rl",
"path": "d4rl/pointmaze/maze_model.py",
"copies": "1",
"size": "8509",
"license": "apache-2.0",
"hash": 1773687547745133800,
"line_mean": 33.7306122449,
"line_max": 126,
"alpha_frac": 0.5296744623,
"autogenerated": false,
"ratio": 2.9908611599297013,
"config_... |
""" A point-to-point drawn polygon. """
# Enthought library imports.
from enable.primitives.api import Polygon
from traits.api import Int, Instance
from drawing_tool import DrawingTool
class PointPolygon(DrawingTool):
""" A point-to-point drawn polygon. """
# The actual polygon primitive we are editing.
... | {
"repo_name": "tommy-u/enable",
"path": "enable/drawing/point_polygon.py",
"copies": "1",
"size": "7595",
"license": "bsd-3-clause",
"hash": 8934173843412647000,
"line_mean": 34.9952606635,
"line_max": 82,
"alpha_frac": 0.5249506254,
"autogenerated": false,
"ratio": 4.4182664339732405,
"config_... |
""" A point-to-point drawn polygon. """
from __future__ import with_statement
from enable.api import cursor_style_trait, Line
from traits.api import Event, Int, Instance
from drawing_tool import DrawingTool
class PointLine(DrawingTool):
""" A point-to-point drawn line. """
# Our contained "Line" instance;... | {
"repo_name": "tommy-u/enable",
"path": "enable/drawing/point_line.py",
"copies": "1",
"size": "8384",
"license": "bsd-3-clause",
"hash": 7033445797198004000,
"line_mean": 34.5254237288,
"line_max": 80,
"alpha_frac": 0.5213501908,
"autogenerated": false,
"ratio": 4.428948758584258,
"config_test... |
# A political problem
# Suppose that you are a politician trying to win an election. Your district has three
# different types of areas - urban, suburban, and rural. These areas have, respectively,
# 100,000, 200,000, and 50,000 registered voters. Although not all the registered voters
# actually go to the polls, you ... | {
"repo_name": "nathanielbaxter/libminizinc",
"path": "interfaces/python/policy.py",
"copies": "2",
"size": "2168",
"license": "mpl-2.0",
"hash": -8221732782836870000,
"line_mean": 39.9056603774,
"line_max": 94,
"alpha_frac": 0.667896679,
"autogenerated": false,
"ratio": 2.8229166666666665,
"con... |
'''
Created on Jul 22, 2014
@author: galena
This code implements proximal stochastic gradient descent with AdaGrad for very large, sparse, multilabel problems.
The weights are stored in a sparse matrix structure that permits changing of the sparsity pattern on the fly, via lazy computation of the iterated proximal ... | {
"repo_name": "zackchase/sparse-multilabel-sgd",
"path": "src/sgd2.py",
"copies": "1",
"size": "29756",
"license": "mit",
"hash": -1235638635385683500,
"line_mean": 28.9356136821,
"line_max": 165,
"alpha_frac": 0.5569969082,
"autogenerated": false,
"ratio": 3.320611538890749,
"config_test": tru... |
# Apollonius Problem:
# Finde einen Kreis, der drei vorgegebene Kreise von innen berührt
# rekursive Erweiterung
from tkinter import *
import random
MAX_ITERATIONS = 3000
class Apollonius:
def __init__(self):
self.root = Tk()
self.root.title("HIB - Apollonius Problem")
SIZE = 600
... | {
"repo_name": "kantel/Virtuelle-Wunderkammer",
"path": "sources/apollonius/apollonius.py",
"copies": "1",
"size": "2559",
"license": "mit",
"hash": 7869500383131071000,
"line_mean": 29.8313253012,
"line_max": 94,
"alpha_frac": 0.5129007037,
"autogenerated": false,
"ratio": 2.3382084095063984,
"... |
"""A PolyData file reader object.
"""
# Author: R.Sreekanth <sreekanth [at] aero.iitb.ac.in>
# Suyog Dutt Jain <suyog.jain [at] aero.iitb.ac.in>
# Copyright (c) 2009-2015, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from os.path import basename
# Enthought imports.
from traits.ap... | {
"repo_name": "dmsurti/mayavi",
"path": "mayavi/sources/poly_data_reader.py",
"copies": "1",
"size": "5872",
"license": "bsd-3-clause",
"hash": 7157303271701450000,
"line_mean": 32.5542857143,
"line_max": 74,
"alpha_frac": 0.5027247956,
"autogenerated": false,
"ratio": 4.462006079027356,
"confi... |
"""A PolyData file reader object.
"""
# Author: R.Sreekanth <sreekanth [at] aero.iitb.ac.in>
# Suyog Dutt Jain <suyog.jain [at] aero.iitb.ac.in>
# Copyright (c) 2009, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from os.path import basename
# Enthought imports.
from traits.api imp... | {
"repo_name": "liulion/mayavi",
"path": "mayavi/sources/poly_data_reader.py",
"copies": "2",
"size": "5877",
"license": "bsd-3-clause",
"hash": -2997594761834467000,
"line_mean": 32.5828571429,
"line_max": 74,
"alpha_frac": 0.5022970904,
"autogenerated": false,
"ratio": 4.459028831562974,
"conf... |
#aponxi v0.6.0
import sublime
import sys
from os import path
import os
from subprocess import Popen, PIPE
from sublime_plugin import TextCommand
from sublime_plugin import WindowCommand
import sublime_plugin
import time
import functools
settings = sublime.load_settings('CoffeeScript.sublime-settings')
def run(cmd, a... | {
"repo_name": "michaelray/Iristyle-ChocolateyPackages",
"path": "EthanBrown.SublimeText2.WebPackages/tools/PackageCache/sublime-better-coffeescript/CoffeeScript.py",
"copies": "2",
"size": "14536",
"license": "mit",
"hash": 6779400021826224000,
"line_mean": 30.4632034632,
"line_max": 123,
"alpha_frac... |
"""A pooled converter that behaves in very similar ways to convert_sub_dirs.py. Lower logging and stat print outs than
convert_sub_dirs.py. Useful for batch converting lower resolution video files that can't fully use all cores. """
import os
import sys
import time
from os import path
from .. import makeMedia... | {
"repo_name": "taishengy/tympeg",
"path": "tympeg/scripts/pooled_converter.py",
"copies": "1",
"size": "6821",
"license": "mit",
"hash": -970495494036562700,
"line_mean": 35.8944444444,
"line_max": 119,
"alpha_frac": 0.6100278552,
"autogenerated": false,
"ratio": 3.6339904102290888,
"config_tes... |
"""A pool for sqlite connections."""
import threading
from sqlalchemy.pool import NullPool, StaticPool
class RecorderPool(StaticPool, NullPool):
"""A hybird of NullPool and StaticPool.
When called from the creating thread acts like StaticPool
When called from any other thread, acts like NullPool
"""... | {
"repo_name": "kennedyshead/home-assistant",
"path": "homeassistant/components/recorder/pool.py",
"copies": "2",
"size": "1090",
"license": "apache-2.0",
"hash": 5566731144021901000,
"line_mean": 31.0588235294,
"line_max": 77,
"alpha_frac": 0.6165137615,
"autogenerated": false,
"ratio": 4.0823970... |
"A pool of Chromosomes a simulation can draw from"
from itertools import chain
import numpy as np
from pydigree.recombination import recombine
def richards(A, C, M, B, T):
'''
Generates a population growth model function
A: Lower Asymptope
C: Upper Asymptope
M: Maximum growth time
B: Growt... | {
"repo_name": "jameshicks/pydigree",
"path": "pydigree/simulation/chromosomepool.py",
"copies": "1",
"size": "4925",
"license": "apache-2.0",
"hash": 5105893126295137000,
"line_mean": 31.6158940397,
"line_max": 78,
"alpha_frac": 0.5906598985,
"autogenerated": false,
"ratio": 4.033579033579033,
... |
"""A poor substitute for PHP's strtotime function."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# phlsys_strtotime
#
# Public Functions:
# describe_duration_string_to_time_delta
# duratio... | {
"repo_name": "cs-shadow/phabricator-tools",
"path": "py/phl/phlsys_strtotime.py",
"copies": "4",
"size": "2951",
"license": "apache-2.0",
"hash": 1204266037822501400,
"line_mean": 34.5542168675,
"line_max": 79,
"alpha_frac": 0.5438834293,
"autogenerated": false,
"ratio": 4.121508379888268,
"co... |
"""A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
"""
# Author: David Ascher <david_ascher@brown.edu>
# [heavily stealing from nntplib.py]
# Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
# String method conversion and test jig improvements by ESR, February 2001.
# Added the POP3_SSL clas... | {
"repo_name": "batermj/algorithm-challenger",
"path": "code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/poplib.py",
"copies": "10",
"size": "15077",
"license": "apache-2.0",
"hash": -2364380986518093000,
"line_mean": 30.3451143451,
"line_max": 107,
"alpha_frac": 0.55... |
"""A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
"""
# Author: David Ascher <david_ascher@brown.edu>
# [heavily stealing from nntplib.py]
# Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
# String method conversion and test jig improvements by ESR, February 2001.
# Added the POP3... | {
"repo_name": "ericlink/adms-server",
"path": "playframework-dist/play-1.1/python/Lib/poplib.py",
"copies": "2",
"size": "12869",
"license": "mit",
"hash": -5850198948915104000,
"line_mean": 28.4231678487,
"line_max": 107,
"alpha_frac": 0.5314321237,
"autogenerated": false,
"ratio": 4.13130016051... |
"""A POP3 server class.
Author: Konstantin Volkov <kozzztik@mail.ru>
Based on aiosmtpd
Implements:
RFC 1939 Post Office Protocol - Version 3
https://tools.ietf.org/html/rfc1939
RFC 2449 POP3 Extension Mechanism
https://tools.ietf.org/html/rfc2449
RFC 2595 Using TLS with IMAP, POP3 and ACAP
https://tools.ietf.org/h... | {
"repo_name": "kozzztik/aiopop3",
"path": "aiopop3/server.py",
"copies": "1",
"size": "19834",
"license": "mit",
"hash": 5524269180360024000,
"line_mean": 35.5267034991,
"line_max": 79,
"alpha_frac": 0.5649894121,
"autogenerated": false,
"ratio": 4.182623365668494,
"config_test": false,
"has_... |
""" A Port graph defines a graph whose edges connect
to identified ports on vertices instead of directly to
a given vertex.
"""
from openalea.container.id_generator import IdGenerator
from openalea.container.property_graph import (PropertyGraph,
InvalidVertex,
... | {
"repo_name": "revesansparole/oaworkflow",
"path": "src/openalea/workflow/port_graph.py",
"copies": "1",
"size": "14371",
"license": "mit",
"hash": -1720437441624226000,
"line_mean": 28.2688391039,
"line_max": 78,
"alpha_frac": 0.5000347923,
"autogenerated": false,
"ratio": 4.356168535919975,
"... |
# A port of https://github.com/phoboslab/jsmpeg-vnc/blob/master/source/grabber.c to python
# License information (GPLv3) is here https://github.com/phoboslab/jsmpeg-vnc/blob/master/README.md
from ctypes import Structure, c_int, POINTER, WINFUNCTYPE, windll, WinError, sizeof, c_wchar_p
from ctypes.wintypes import BOOL, ... | {
"repo_name": "ThisIsSoSteve/Project-Tensorflow-Cars",
"path": "common/grabber.py",
"copies": "1",
"size": "6439",
"license": "mit",
"hash": -5624067041611167000,
"line_mean": 35.1797752809,
"line_max": 121,
"alpha_frac": 0.6115856499,
"autogenerated": false,
"ratio": 3.184470820969337,
"config... |
# A port of https://github.com/python/cpython/blob/e42b7051/Lib/heapq.py
from __future__ import print_function, absolute_import, division
import heapq as hq
from numba import types
from numba.errors import TypingError
from numba.extending import overload, register_jitable
@register_jitable
def _siftdown(heap, star... | {
"repo_name": "jriehl/numba",
"path": "numba/targets/heapq.py",
"copies": "1",
"size": "6201",
"license": "bsd-2-clause",
"hash": 2174175737967230500,
"line_mean": 22.2247191011,
"line_max": 72,
"alpha_frac": 0.5786163522,
"autogenerated": false,
"ratio": 3.3338709677419356,
"config_test": fals... |
# A port of https://github.com/python/cpython/blob/e42b7051/Lib/heapq.py
import heapq as hq
from numba.core import types
from numba.core.errors import TypingError
from numba.core.extending import overload, register_jitable
@register_jitable
def _siftdown(heap, startpos, pos):
newitem = heap[pos]
while pos... | {
"repo_name": "gmarkall/numba",
"path": "numba/cpython/heapq.py",
"copies": "7",
"size": "6151",
"license": "bsd-2-clause",
"hash": -4939198295316169000,
"line_mean": 22.1240601504,
"line_max": 72,
"alpha_frac": 0.576979353,
"autogenerated": false,
"ratio": 3.324864864864865,
"config_test": fal... |
# A port of SeeedStudio's Library for the 96x96 OLED Display
# http://www.seeedstudio.com/depot/Grove-OLED-Display-096-p-824.html
# http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_96*96
# https://github.com/Seeed-Studio/OLED_Display_96X96
import pyb
import time
from pyb import I2C
i2c = I2C(1, I2C.MASTER)
i2c.in... | {
"repo_name": "dda/MicroPython",
"path": "Grove_OLED.py",
"copies": "1",
"size": "12083",
"license": "apache-2.0",
"hash": -5577602106220910000,
"line_mean": 30.7973684211,
"line_max": 102,
"alpha_frac": 0.6835223041,
"autogenerated": false,
"ratio": 2.014169028171362,
"config_test": false,
"... |
"""A port of the `JSON-minify` utility to the Python language.
Based on JSON.minify.js: https://github.com/getify/JSON.minify
Contributers:
- Gerald Storer
- Contributed original version
- Felipe Machado
- Performance optimization
- Pradyun S. Gedam
- Conditions and variable names changed
- Reform... | {
"repo_name": "skuroda/FindKeyConflicts",
"path": "lib/minify_json.py",
"copies": "1",
"size": "1994",
"license": "mit",
"hash": 6911015467290846000,
"line_mean": 32.2333333333,
"line_max": 91,
"alpha_frac": 0.5631895687,
"autogenerated": false,
"ratio": 3.6654411764705883,
"config_test": false... |
"""A port of the `JSON-minify` utility to the Python language.
Based on JSON.minify.js: https://github.com/getify/JSON.minify
Contributers:
- Gerald Storer
- Contributed original version
- Felipe Machado
- Performance optimization
- Pradyun S. Gedam
- Conditions and variable names changed
- Refo... | {
"repo_name": "tobeycarman/dvm-dos-tem",
"path": "calibration/json_minify/__init__.py",
"copies": "3",
"size": "1996",
"license": "mit",
"hash": 7310224312630944000,
"line_mean": 31.1935483871,
"line_max": 91,
"alpha_frac": 0.5626252505,
"autogenerated": false,
"ratio": 3.6556776556776556,
"con... |
""" A port of the node.js EventEmitter functionality
Classes:
:py:class:`EventEmitter`
implements the event emitter functionality
"""
import collections
import sys
class EventEmitter(object):
""" Handles event emitting and listening
Public Methods:
:py:meth:`~EventEmitter.add_listener`... | {
"repo_name": "gsmcwhirter/simulations",
"path": "src/simulations/utils/eventemitter.py",
"copies": "1",
"size": "4501",
"license": "mit",
"hash": -2382081677220791000,
"line_mean": 22.2010309278,
"line_max": 79,
"alpha_frac": 0.5625416574,
"autogenerated": false,
"ratio": 4.839784946236559,
"c... |
# A port of VSML
# http://www.lighthouse3d.com/very-simple-libs/vsml/vsml-in-action/
# to support matrix operations
# Singleton class from
# http://code.activestate.com/recipes/52558/
# also see http://sourceforge.net/projects/libmymath/files/libmymath%20v1.3.1/
from pyglet.gl import *
class MatrixTypes(object):
... | {
"repo_name": "fos/fos-legacy",
"path": "fos/shader/vsml.py",
"copies": "1",
"size": "11294",
"license": "bsd-3-clause",
"hash": 6815067313300630000,
"line_mean": 31.0852272727,
"line_max": 109,
"alpha_frac": 0.5025677351,
"autogenerated": false,
"ratio": 4.563232323232323,
"config_test": false... |
# A port of VSML
# http://www.lighthouse3d.com/very-simple-libs/vsml/vsml-in-action/
# to support matrix operations
# Singleton class from
# http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern
# also see http://sourceforge.net/projects/libmymath/files/libmymath%20v1.3.1/
from pyglet.gl import *... | {
"repo_name": "fos/fos",
"path": "fos/vsml.py",
"copies": "1",
"size": "14937",
"license": "bsd-3-clause",
"hash": 7284859720823624000,
"line_mean": 30.9166666667,
"line_max": 105,
"alpha_frac": 0.5510477338,
"autogenerated": false,
"ratio": 3.6062288749396427,
"config_test": false,
"has_no_k... |
import sys
import json
import base64
PY3 = sys.version_info[0] == 3
try:
from http.client import HTTPConnection
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTP as HTTPConnection # NOQA
from httplib import HTTPS as HTTPSConnection # NOQA
try:
from urllib.par... | {
"repo_name": "treemo/circuits",
"path": "tests/web/jsonrpclib.py",
"copies": "3",
"size": "12764",
"license": "mit",
"hash": 4777233249552195000,
"line_mean": 26.8082788671,
"line_max": 72,
"alpha_frac": 0.5980883736,
"autogenerated": false,
"ratio": 4.167156382631407,
"config_test": false,
... |
"""A port scanning script from the Violent Python cookbook."""
import nmap
import optparse
from socket import *
from threading import *
screen_lock = Semaphore(value=1)
def connscan(tgt_host, tgt_port):
"""Attempt to create a connection to the target host and port."""
try:
connsckt = socket(AF_INET,... | {
"repo_name": "Copenbacon/ViolentPython",
"path": "src/TCPScanner.py",
"copies": "1",
"size": "2317",
"license": "mit",
"hash": -3540592773456457000,
"line_mean": 30.7534246575,
"line_max": 101,
"alpha_frac": 0.5886922745,
"autogenerated": false,
"ratio": 3.348265895953757,
"config_test": false... |
#A PostgreSQL driver for Akara Dendrite, a Web semi-structured metadata tool
'''
[
(origin, rel, target, {attrname1: attrval1, attrname2: attrval2}),
]
The optional attributes are metadata bound to the statement itself
'''
#Note: for PyPy support port to pg8000 <http://pybrary.net/pg8000/>
#Reportedly PyPy/pg80... | {
"repo_name": "uogbuji/versa",
"path": "tools/py/driver/postgres.py",
"copies": "1",
"size": "10538",
"license": "apache-2.0",
"hash": -5028046276827242000,
"line_mean": 41.837398374,
"line_max": 619,
"alpha_frac": 0.642721579,
"autogenerated": false,
"ratio": 4.152088258471237,
"config_test": ... |
# A post is considered to be extracted from an existing file, and always
# consists in a title, followed by a line of '------------', followed
# immediatly by the tags with a leading #. It is a list of strings, where empty
# ones were removed.
# If it is a valid post, it has at minima 4 lines (title, line of -, tags,
#... | {
"repo_name": "egolus/NoteOrganiser",
"path": "noteorganiser/text_processing.py",
"copies": "2",
"size": "9534",
"license": "mit",
"hash": -1631932977266638000,
"line_mean": 30.8862876254,
"line_max": 81,
"alpha_frac": 0.5855884204,
"autogenerated": false,
"ratio": 3.8412570507655115,
"config_t... |
"""A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
"""
__version__ = "1.5.3"
__all__ = ['Option',
'make_o... | {
"repo_name": "windyuuy/opera",
"path": "chromium/src/third_party/python_26/Lib/optparse.py",
"copies": "49",
"size": "60418",
"license": "bsd-3-clause",
"hash": -4510293462547418600,
"line_mean": 34.856379822,
"line_max": 81,
"alpha_frac": 0.5655433811,
"autogenerated": false,
"ratio": 4.3279369... |
"""A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
"""
__version__ = "1.5.3"
__all__ = ['Option',
... | {
"repo_name": "deanhiller/databus",
"path": "webapp/play1.3.x/python/Lib/optparse.py",
"copies": "3",
"size": "62075",
"license": "mpl-2.0",
"hash": 1931958193797048300,
"line_mean": 34.8616389549,
"line_max": 81,
"alpha_frac": 0.5502698349,
"autogenerated": false,
"ratio": 4.431712715071036,
"... |
"""A Power Supply Unit (PSU) in a pinball machine."""
from mpf.core.system_wide_device import SystemWideDevice
class PowerSupplyUnit(SystemWideDevice):
"""Represents a power supply in a pinball machine."""
config_section = 'psus'
collection = 'psus'
class_label = 'psu'
__slots__ = ["_busy_until... | {
"repo_name": "missionpinball/mpf",
"path": "mpf/devices/power_supply_unit.py",
"copies": "1",
"size": "1821",
"license": "mit",
"hash": -4630764051201434000,
"line_mean": 35.42,
"line_max": 117,
"alpha_frac": 0.5859417902,
"autogenerated": false,
"ratio": 3.5988142292490117,
"config_test": fal... |
## APP13 segment Contents Description
## 0xFF 0xED APP13 marker
## Segment size (2 bytes) excl. marker
## Photoshop 3.0\x00 Photoshop identification string
## ... | {
"repo_name": "straup/parallel-flickr",
"path": "filtr/utils/jpeg/iptc.py",
"copies": "1",
"size": "9666",
"license": "bsd-2-clause",
"hash": 7150772338196714000,
"line_mean": 31.9931740614,
"line_max": 163,
"alpha_frac": 0.5645561763,
"autogenerated": false,
"ratio": 3.594644849386389,
"config... |
"""APP2APP protocol.
"""
__docformat__ = 'restructuredtext en'
import threading
from .utils import *
from .user import *
class Application(Cached):
"""Represents an application in APP2APP protocol. Use `skype.Skype.Application` to instantiate.
"""
_ValidateHandle = staticmethod(tounicode)
def __re... | {
"repo_name": "FloatingGhost/skype4py",
"path": "Skype4Py/application.py",
"copies": "1",
"size": "7170",
"license": "bsd-3-clause",
"hash": -7345869745425918000,
"line_mean": 27.4523809524,
"line_max": 110,
"alpha_frac": 0.6139470014,
"autogenerated": false,
"ratio": 4.358662613981763,
"config... |
"""APP2APP protocol.
"""
__docformat__ = 'restructuredtext en'
import threading
from utils import *
from user import *
class Application(Cached):
"""Represents an application in APP2APP protocol. Use `skype.Skype.Application` to instantiate.
"""
_ValidateHandle = staticmethod(tounicode)
def __repr... | {
"repo_name": "james-huang/sk_skype_bot",
"path": "Skype4Py/application.py",
"copies": "21",
"size": "7168",
"license": "mit",
"hash": -6327978058089401000,
"line_mean": 27.4444444444,
"line_max": 110,
"alpha_frac": 0.6141183036,
"autogenerated": false,
"ratio": 4.362751065124772,
"config_test"... |
'''APP2APP protocol.
'''
from utils import *
from user import *
import threading
class IApplication(Cached):
'''Represents an application in APP2APP protocol. Use L{ISkype.Application<skype.ISkype.Application>} to instatinate.
'''
def __repr__(self):
return '<%s with Name=%s>' % (Cached.__repr__... | {
"repo_name": "mambelli/osg-bosco-marco",
"path": "src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/application.py",
"copies": "9",
"size": "7292",
"license": "apache-2.0",
"hash": -5506238162120580000,
"line_mean": 29.132231405,
"line_max": 127,
"alpha_frac": 0.61... |
""" app - application interface """
import os
import tornado.web
from json import dumps
from tornado.escape import to_unicode
class Handler(tornado.web.RequestHandler):
@property
def cfg(self):
return self.application.cfg
def head(self, *args, **kwargs):
self.get(*args, **kwargs)
... | {
"repo_name": "sarahjanesllc-labs/brutus",
"path": "brutus/app.py",
"copies": "1",
"size": "2488",
"license": "mit",
"hash": -9098208473153865000,
"line_mean": 31.3116883117,
"line_max": 71,
"alpha_frac": 0.5562700965,
"autogenerated": false,
"ratio": 4.078688524590164,
"config_test": false,
... |
"""
Builds classifier models and saves them as pickles
"""
##########################################################################
## Imports
##########################################################################
import os
import time
import json
import pickle
import random
import apparel
import unicodecsv as... | {
"repo_name": "DistrictDataLabs/product-classifier",
"path": "apparel/build.py",
"copies": "2",
"size": "7297",
"license": "mit",
"hash": -2975127261031258600,
"line_mean": 31.2876106195,
"line_max": 88,
"alpha_frac": 0.5547485268,
"autogenerated": false,
"ratio": 4.512677798392084,
"config_tes... |
"""
Classifier package - utilize built model to perform classifications
"""
##########################################################################
## Imports
##########################################################################
import pickle
from operator import itemgetter
from apparel.config import settin... | {
"repo_name": "georgetown-analytics/product-classifier",
"path": "apparel/classify.py",
"copies": "2",
"size": "2806",
"license": "mit",
"hash": 5626399216245243000,
"line_mean": 33.6419753086,
"line_max": 74,
"alpha_frac": 0.5923022096,
"autogenerated": false,
"ratio": 4.622734761120263,
"conf... |
"""
Uses confire to get meaningful configurations from a yaml file
"""
##########################################################################
## Imports
##########################################################################
import os
import confire
###########################################################... | {
"repo_name": "georgetown-analytics/product-classifier",
"path": "apparel/config.py",
"copies": "2",
"size": "1528",
"license": "mit",
"hash": 207544591067363500,
"line_mean": 27.8301886792,
"line_max": 74,
"alpha_frac": 0.539921466,
"autogenerated": false,
"ratio": 4.672782874617737,
"config_t... |
"""
Extracts the features from text for classification and building
"""
##########################################################################
## Imports
##########################################################################
import string
from nltk.corpus import stopwords
from nltk import wordpunct_tokenize... | {
"repo_name": "georgetown-analytics/product-classifier",
"path": "apparel/features.py",
"copies": "2",
"size": "3837",
"license": "mit",
"hash": 3831595678463831000,
"line_mean": 36.9900990099,
"line_max": 243,
"alpha_frac": 0.5913474068,
"autogenerated": false,
"ratio": 4.595209580838324,
"con... |
# app/asistencias/forms.py
# coding: utf-8
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, HiddenField
from wtforms import DateField
from wtforms.validators import DataRequired
from wtforms.widgets import TextArea
class ReunionForm(FlaskForm):
"""
Formulario para reunion
"""... | {
"repo_name": "originaltebas/chmembers",
"path": "app/asistencias/forms.py",
"copies": "1",
"size": "1132",
"license": "mit",
"hash": 2747870004886938000,
"line_mean": 23.5652173913,
"line_max": 64,
"alpha_frac": 0.6690265487,
"autogenerated": false,
"ratio": 3.3333333333333335,
"config_test": ... |
# app/asistencias/views.py
# coding: utf-8
from flask import flash, jsonify
from flask import redirect, render_template, url_for, request
from flask_login import current_user, login_required
from app.asistencias import asistencias
from app.asistencias.forms import ReunionForm
from app.asistencias.forms import Asisten... | {
"repo_name": "originaltebas/chmembers",
"path": "app/asistencias/views.py",
"copies": "1",
"size": "10216",
"license": "mit",
"hash": -4341834828530445300,
"line_mean": 31.9548387097,
"line_max": 79,
"alpha_frac": 0.5275058731,
"autogenerated": false,
"ratio": 3.6472688325598,
"config_test": f... |
"""AppAssure 5 Core API"""
from appassure.api import AppAssureAPI
class IBackgroundJobManagement(AppAssureAPI):
"""Full documentation online at
http://docs.appassure.com/display/AA50D/IBackgroundJobManagement
"""
def getJobsForAgentByPage(self, agentId, page):
"""Gets the current list of jobs... | {
"repo_name": "rshipp/python-appassure",
"path": "appassure/core/IBackgroundJobManagement.py",
"copies": "1",
"size": "2117",
"license": "bsd-3-clause",
"hash": 668345675394163800,
"line_mean": 35.5,
"line_max": 90,
"alpha_frac": 0.6032120926,
"autogenerated": false,
"ratio": 3.8421052631578947,
... |
"""AppAssure 5 Core API"""
from appassure.api import AppAssureAPI
class IEventsManagement(AppAssureAPI):
"""Full documentation online at
http://docs.appassure.com/display/AA50D/IEventsManagement
"""
def getAllAgentAlerts(self, agentId):
"""Gets the summary information for all alerts
a... | {
"repo_name": "rshipp/python-appassure",
"path": "appassure/core/IEventsManagement.py",
"copies": "1",
"size": "6319",
"license": "bsd-3-clause",
"hash": 7273730901732545000,
"line_mean": 36.6130952381,
"line_max": 82,
"alpha_frac": 0.6235163792,
"autogenerated": false,
"ratio": 4.388194444444444... |
"""AppAssure 5 Core API"""
from appassure.api import AppAssureAPI
class IRecoveryPointsManagement(AppAssureAPI):
"""Full documentation online at
http://docs.appassure.com/display/AA50D/IRecoveryPointsManagement
"""
def deleteRecoveryPointsForAgent(self, agentId):
"""Deletes all recovery point... | {
"repo_name": "rshipp/python-appassure",
"path": "appassure/core/IRecoveryPointsManagement.py",
"copies": "1",
"size": "5610",
"license": "bsd-3-clause",
"hash": -1513177283983803400,
"line_mean": 41.8244274809,
"line_max": 108,
"alpha_frac": 0.6531194296,
"autogenerated": false,
"ratio": 4.44180... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.