text stringlengths 0 1.05M | meta dict |
|---|---|
from doublex import Spy, Mock
from expects import expect, equal
from doublex_expects import have_been_called
from pysellus import registrar
from pysellus.registrar import expect as expect_
with description('the registrar module'):
with it('should call every function passed to it'):
function_list = [
... | {
"repo_name": "ergl/pysellus",
"path": "spec/registrar_spec.py",
"copies": "4",
"size": "1547",
"license": "mit",
"hash": 6292954526465424000,
"line_mean": 28.1886792453,
"line_max": 84,
"alpha_frac": 0.603749192,
"autogenerated": false,
"ratio": 4.169811320754717,
"config_test": false,
"has_... |
from doubly_linked_list import DoublyLinkedList
class LruCacher(object):
def __init__(self, max_size, plan_b_func):
"max_size: the largest number of items the cache can have."
"plan_b_func: the function that will be called with the query as its"
" argument if a query isn't cached. The result will th... | {
"repo_name": "AWNystrom/lru_cache",
"path": "lru_cacher/lru_cacher.py",
"copies": "1",
"size": "2201",
"license": "apache-2.0",
"hash": 425039795888011260,
"line_mean": 31.3823529412,
"line_max": 73,
"alpha_frac": 0.6696955929,
"autogenerated": false,
"ratio": 3.130867709815078,
"config_test":... |
from DownloadData import Download
from RemoteMiner import Miner
from argparse import ArgumentParser
from os import path, makedirs, chdir
status = ['open', 'merged', 'abandoned']
def download_data(args):
print("Gerrit domains to download data:")
for arg in args:
print('\t' + arg)
print()
fo... | {
"repo_name": "intelligentagents/gerrit-miner",
"path": "src/GerritMiner.py",
"copies": "1",
"size": "1315",
"license": "apache-2.0",
"hash": -8029256294693967000,
"line_mean": 24.2884615385,
"line_max": 112,
"alpha_frac": 0.6205323194,
"autogenerated": false,
"ratio": 3.845029239766082,
"confi... |
from .downloader_base import DownloaderBase
from ... import logger
log = logger.get(__name__)
import traceback
import json
from urllib import request, error
try:
import ssl
SSL = True
except ImportError:
SSL = False
def is_available():
return SSL
class UrllibDownloader(DownloaderBase):
"""Down... | {
"repo_name": "blopker/Color-Switch",
"path": "colorswitch/http/downloaders/urllib.py",
"copies": "1",
"size": "1149",
"license": "mit",
"hash": 5869735272685647000,
"line_mean": 23.9782608696,
"line_max": 70,
"alpha_frac": 0.5752828547,
"autogenerated": false,
"ratio": 4.118279569892473,
"conf... |
from .downloader_base import DownloaderBase
from ... import logger
log = logger.get(__name__)
import traceback
import subprocess
import json
import shutil
def is_available():
if shutil.which('curl'):
return True
return False
class CurlDownloader(DownloaderBase):
"""Downloader that uses the comma... | {
"repo_name": "blopker/Color-Switch",
"path": "colorswitch/http/downloaders/curl.py",
"copies": "1",
"size": "1035",
"license": "mit",
"hash": -3131251278023931000,
"line_mean": 25.5384615385,
"line_max": 70,
"alpha_frac": 0.5826086957,
"autogenerated": false,
"ratio": 4.2946058091286305,
"conf... |
from .downloader_base import DownloaderBase
from ... import logger
log = logger.get(__name__)
import traceback
import subprocess
import json
import shutil
def is_available():
if shutil.which('wget'):
return True
return False
class WgetDownloader(DownloaderBase):
"""Downloader that uses the comma... | {
"repo_name": "blopker/Color-Switch",
"path": "colorswitch/http/downloaders/wget.py",
"copies": "1",
"size": "1033",
"license": "mit",
"hash": -7571073630319777000,
"line_mean": 25.4871794872,
"line_max": 70,
"alpha_frac": 0.5818005808,
"autogenerated": false,
"ratio": 4.216326530612245,
"confi... |
from Downloader.DataOperations import *
def StatisticsSegments(Segments, additionalStatistics=False):
'''
Provide statistics for loaded dataset
:param Segments: input list of Segments
'''
'''
# Examples of usage
Segments = LoadDataFile('../'+DATASTRUCTUREFILE)
StatisticsSegments(Segmen... | {
"repo_name": "previtus/MGR-Project-Code",
"path": "Downloader/PreprocessData/SegmentsManipulators.py",
"copies": "1",
"size": "3645",
"license": "mit",
"hash": -4491489590229948400,
"line_mean": 34.7352941176,
"line_max": 268,
"alpha_frac": 0.6299039781,
"autogenerated": false,
"ratio": 3.577036... |
from Downloader import Downloader
from config import URL_DOWNLOAD_LIST, URL_VISITED_FILE_LIST, DOWLOAD_THREAD_POOL_SIZE, ANAYLIZER_THREAD_POOL_SIZE
from BasicOperation import getBaseURL
from HTMLAnaylizer.LinkExtractor import LinkExtractor
from time import sleep
if __name__ == '__main__':
start_url = "https://www.... | {
"repo_name": "tinyHui/SearchEngine",
"path": "app/Crawler/main.py",
"copies": "1",
"size": "1237",
"license": "apache-2.0",
"hash": -8085454525909330000,
"line_mean": 37.65625,
"line_max": 113,
"alpha_frac": 0.5998383185,
"autogenerated": false,
"ratio": 3.782874617737003,
"config_test": false... |
from downloader import Downloader
from shutdown import shutdown_and_await_termination
from java.util.concurrent import Executors, ExecutorCompletionService
from com.hazelcast.core import Hazelcast
from com.hazelcast.config import Config, SerializerConfig
import os
import hashlib
MAX_CONCURRENT = 3
SITES = [
"http:... | {
"repo_name": "rcarmo/jython-hazelcast",
"path": "main.py",
"copies": "1",
"size": "1372",
"license": "mit",
"hash": -258784139660796100,
"line_mean": 27,
"line_max": 74,
"alpha_frac": 0.7135568513,
"autogenerated": false,
"ratio": 3.526992287917738,
"config_test": false,
"has_no_keywords": f... |
from ..downloader import Downloader
import os
import pytest
@pytest.fixture
def cwd_to_tmpdir(tmpdir):
os.chdir(str(tmpdir))
def test_audiobook_download(cwd_to_tmpdir, monkeypatch):
audiobook_url = "https://www.scribd.com/audiobook/237606860/100-Ways-to-Motivate-Yourself-Change-Your-Life-Forever"
audio... | {
"repo_name": "Ritiek/Scribd-Downloader",
"path": "scribdl/test/test_download.py",
"copies": "1",
"size": "1860",
"license": "mit",
"hash": 4283888589204503000,
"line_mean": 38.5744680851,
"line_max": 119,
"alpha_frac": 0.7306451613,
"autogenerated": false,
"ratio": 3.044189852700491,
"config_t... |
from downloader import Download
from util import Tools
from bs4 import BeautifulSoup
import urllib2,os
class PornHub:
'this module is only for Porn-Hub '
def __init__(self):
self.helper = Tools()
self.MAIN_FILE = "%s\MAIN_PH.list" %(os.getenv('APPDATA'))
self.TBD_FILE = "%s\TBD_PH.list" %(os.getenv(... | {
"repo_name": "backlights/pornhub-dl",
"path": "src/porn.py",
"copies": "1",
"size": "3019",
"license": "unlicense",
"hash": -8057790088790204000,
"line_mean": 34.3734939759,
"line_max": 96,
"alpha_frac": 0.6213978138,
"autogenerated": false,
"ratio": 2.9714566929133857,
"config_test": false,
... |
from downloader import search_dict
def test_that_nothing_is_yielded_from_empty_dict():
assert not list(search_dict({}, "test"))
def test_that_correct_value_is_yielded_for_simple_dictionaries():
assert list(search_dict({"test": "expected"}, "test")) == ["expected"]
def test_that_correct_value_is_yielded_wh... | {
"repo_name": "egbertbouman/youtube-comment-downloader",
"path": "tests/test_search_dict.py",
"copies": "1",
"size": "1040",
"license": "mit",
"hash": 3563396756807654000,
"line_mean": 29.5882352941,
"line_max": 87,
"alpha_frac": 0.6240384615,
"autogenerated": false,
"ratio": 3.260188087774295,
... |
from downloaders import NetworkDownloader, MultisourceDownloader
from datetime import datetime
import os
def fetchBlocksFromServers(currency, hostsAndPorts, sleepBetweenRequests, countPerJob, storage, stopSignal=None):
blockStorageAccess = storage.getBlockStorageAccess(currency)
downloaders = []
for host, port in h... | {
"repo_name": "whateverpal/coinmetrics-tools",
"path": "coincrawler/blocks/__init__.py",
"copies": "1",
"size": "1333",
"license": "mit",
"hash": -4348650330564089000,
"line_mean": 39.3939393939,
"line_max": 127,
"alpha_frac": 0.776444111,
"autogenerated": false,
"ratio": 3.7338935574229692,
"c... |
from download import Download:
# TODO -> Exception handling for JSON serialization and de-serialization
# -> Better JSON decoder
class Item:
""" """
def __init__(self, title, link, publicationDate, showId, showName,
enclosure, quality):
self.title = title
self.link = link
... | {
"repo_name": "jorshua/ShowTime",
"path": "src/libs/rss/item.py",
"copies": "1",
"size": "2142",
"license": "mit",
"hash": 5374423554979895000,
"line_mean": 37.25,
"line_max": 72,
"alpha_frac": 0.5158730159,
"autogenerated": false,
"ratio": 4.241584158415842,
"config_test": false,
"has_no_key... |
from ..download_manager import update_url
def platforms_to_releases(info, debug):
"""
Accepts a dict from a schema version 1.0, 1.1 or 1.2 package containing
a "platforms" key and converts it to a list of releases compatible with'
schema version 2.0.
:param info:
The dict of package info
... | {
"repo_name": "koery/win-sublime",
"path": "Data/Packages/Package Control/package_control/providers/schema_compat.py",
"copies": "2",
"size": "1463",
"license": "mit",
"hash": -9091226523582768000,
"line_mean": 30.1276595745,
"line_max": 77,
"alpha_frac": 0.5317840055,
"autogenerated": false,
"ra... |
from .downloadMessages import DownloadGmaneData
import mailbox, os, percolation as P
c=P.check
class LoadMessages:
"""Class that loads Gmane messages saved locally
Usage
=====
After downloading messages from Gmane lists with the
DownloadGmaneData class, see chosen basedir,
or DownloadGman... | {
"repo_name": "ttm/gmaneLegacy",
"path": "gmaneLegacy/loadMessages.py",
"copies": "1",
"size": "2267",
"license": "unlicense",
"hash": -7652593977443411000,
"line_mean": 34.9841269841,
"line_max": 104,
"alpha_frac": 0.6091751213,
"autogenerated": false,
"ratio": 3.6623586429725363,
"config_test... |
from download_radar import download_images
from transform.palette import change_palette
from transform.projection import change_projection
from transform.basemap import add_basemap
from image_manipulation import crop, resize, resize_and_save
from libs.images2gif import writeGif
from PIL import Image
from config import ... | {
"repo_name": "mattparrilla/wxGIF",
"path": "radar2gif.py",
"copies": "1",
"size": "3870",
"license": "apache-2.0",
"hash": -6660152929440521000,
"line_mean": 34.8333333333,
"line_max": 85,
"alpha_frac": 0.6617571059,
"autogenerated": false,
"ratio": 3.424778761061947,
"config_test": false,
"... |
from download_single_item import LesionImageDownloader as ImgDownloader, SegmentationDownloader as SegDownloader
import argparse
import os
import sys
import requests
from os.path import join
from multiprocessing.pool import Pool, ThreadPool
from itertools import repeat
from tqdm import tqdm
def download_archive(num_... | {
"repo_name": "GalAvineri/ISIC-Archive-Downloader",
"path": "download_archive.py",
"copies": "1",
"size": "10159",
"license": "apache-2.0",
"hash": -6026607482029526000,
"line_mean": 38.6875,
"line_max": 182,
"alpha_frac": 0.6434688454,
"autogenerated": false,
"ratio": 3.963714397190792,
"confi... |
from downscale import DeltaDownscale
class DeltaDownscaleMM( DeltaDownscale ):
def _calc_anomalies( self ):
print('calculating anomalies')
def downscale( self, *args, **kwargs ):
print( 'downscaling...' )
# FOR RUN OF THE MIN / MAX TAS DATA:
# 1. COMPUTE DELTAS FIRST ANND WRITE TO NETCDF
# 2. USE `DeltaDownsc... | {
"repo_name": "ua-snap/downscale",
"path": "snap_scripts/old_scripts/tem_iem_older_scripts_april2018/tem_inputs_iem/min_max_deltas_tem_iem.py",
"copies": "1",
"size": "1279",
"license": "mit",
"hash": -7787636916066832000,
"line_mean": 33.5675675676,
"line_max": 145,
"alpha_frac": 0.7294761532,
"au... |
from doxhooks.errors import (
DoxhooksError, DoxhooksForbiddenLookupError, DoxhooksLookupError,
DoxhooksTypeError, DoxhooksValueError)
from pytest import mark
class BaseTestError:
def given_an_internal_error(self, error):
self.error = error
def when_reading_the_error_message(self):
se... | {
"repo_name": "nre/Doxhooks",
"path": "tests/unit_tests/test_errors.py",
"copies": "1",
"size": "4654",
"license": "mit",
"hash": -8317915484599340000,
"line_mean": 35.359375,
"line_max": 78,
"alpha_frac": 0.6207563386,
"autogenerated": false,
"ratio": 3.768421052631579,
"config_test": true,
... |
from doxygen import DoxygenNode
from sphinx.util.compat import Directive
class concept(DoxygenNode):
def __init__(self, name, inherits, **kwargs):
super(concept,self).__init__(**kwargs)
self.inherits = inherits
self.name = name
def render(self):
# template = self.environment.ge... | {
"repo_name": "troelsfr/Gasp",
"path": "gasp/concept.py",
"copies": "1",
"size": "1904",
"license": "mit",
"hash": -6601083894539976000,
"line_mean": 27.8484848485,
"line_max": 81,
"alpha_frac": 0.5955882353,
"autogenerated": false,
"ratio": 4.231111111111111,
"config_test": false,
"has_no_ke... |
from dpa import perform_dpa
from aes import testKey, testCardKey, testTestKey
import scipy.io
import numpy as np
import sys
import time
def hexVector2number(row):
result = 0x00
for bytenum in range(16):
result = result | (int(row[bytenum]) << (15 - bytenum) * 8)
return result
if len(sys.argv) > 1:... | {
"repo_name": "jdsika/TUM_SmartCardLab",
"path": "DPA/run.py",
"copies": "1",
"size": "1567",
"license": "mit",
"hash": -4142954595381081600,
"line_mean": 26.0172413793,
"line_max": 85,
"alpha_frac": 0.6936821953,
"autogenerated": false,
"ratio": 3.05458089668616,
"config_test": true,
"has_no... |
from dpa.ptask.area import PTaskArea
from dpa.ptask import PTask
from dpa.product.representation import ProductRepresentation
from dpa.maya.session import MayaSession
class ImportRef():
choices = {}
# -------------------------------------------------------------------------
def __init__(self):
s... | {
"repo_name": "Clemson-DPA/dpa-pipe",
"path": "dpa/ui/maya/importref.py",
"copies": "1",
"size": "2482",
"license": "mit",
"hash": -4284153408665772500,
"line_mean": 36.6060606061,
"line_max": 120,
"alpha_frac": 0.5680902498,
"autogenerated": false,
"ratio": 3.732330827067669,
"config_test": fa... |
from dparse.parser import setuptools_parse_requirements_backport as _parse_requirements
from collections import namedtuple
from packaging.version import parse as parse_version
import click
import sys
import json
import os
Package = namedtuple("Package", ["key", "version"])
RequirementFile = namedtuple("RequirementFile"... | {
"repo_name": "pyupio/safety",
"path": "safety/util.py",
"copies": "1",
"size": "6571",
"license": "mit",
"hash": -62962081933385940,
"line_mean": 37.4269005848,
"line_max": 112,
"alpha_frac": 0.5489271039,
"autogenerated": false,
"ratio": 4.569541029207232,
"config_test": false,
"has_no_keyw... |
from dparse.parser import setuptools_parse_requirements_backport as _parse_requirements
from collections import namedtuple
import click
import sys
import json
import os
Package = namedtuple("Package", ["key", "version"])
RequirementFile = namedtuple("RequirementFile", ["path"])
def read_vulnerabilities(fh):
retur... | {
"repo_name": "kennethreitz/pipenv",
"path": "pipenv/patched/safety/util.py",
"copies": "1",
"size": "3905",
"license": "mit",
"hash": 5214463607655789000,
"line_mean": 38.8469387755,
"line_max": 98,
"alpha_frac": 0.5106274008,
"autogenerated": false,
"ratio": 4.687875150060024,
"config_test": ... |
from d_parser.d_spider_common import DSpiderCommon
from d_parser.helpers.cookies_init import cookies_init
from d_parser.helpers.re_set import Ree
from helpers.config import Config
from helpers.url_generator import UrlGenerator
VERSION = 28
# Warn: Don't remove task argument even if not use it (it's break grab and s... | {
"repo_name": "Holovin/D_GrabDemo",
"path": "d_parser/v_28_6/d_spider_6ekc.py",
"copies": "1",
"size": "6764",
"license": "mit",
"hash": -9098901944705586000,
"line_mean": 35.8633879781,
"line_max": 125,
"alpha_frac": 0.5217906908,
"autogenerated": false,
"ratio": 4.184863523573201,
"config_tes... |
from d_parser.d_spider_common import DSpiderCommon
from d_parser.helpers.re_set import Ree
from helpers.url_generator import UrlGenerator
VERSION = 28
# Warn: Don't remove task argument even if not use it (it's break grab and spider crashed)
# Warn: noinspection PyUnusedLocal
class DSpider(DSpiderCommon):
def _... | {
"repo_name": "Holovin/D_GrabDemo",
"path": "d_parser/v_28_6/d_spider_6aca.py",
"copies": "1",
"size": "5941",
"license": "mit",
"hash": 1781999269008770300,
"line_mean": 34.9877300613,
"line_max": 121,
"alpha_frac": 0.5286396181,
"autogenerated": false,
"ratio": 4.02608098833219,
"config_test"... |
from d_parser.d_spider_common import DSpiderCommon
from helpers.config import Config
VERSION = 28
# Warn: Don't remove task argument even if not use it (it's break grab and spider crashed)
# Warn: noinspection PyUnusedLocal
class DSpider(DSpiderCommon):
def __init__(self, thread_number, try_limit=0):
su... | {
"repo_name": "Holovin/D_GrabDemo",
"path": "d_parser/d_spider_0name.py",
"copies": "1",
"size": "1068",
"license": "mit",
"hash": -816467279775966600,
"line_mean": 28.6666666667,
"line_max": 90,
"alpha_frac": 0.5814606742,
"autogenerated": false,
"ratio": 3.7872340425531914,
"config_test": fal... |
from dpconverge.data_set import DataSet
from dpconverge.data_collection import DataCollection
from sklearn.datasets.samples_generator import make_blobs
centers = [
[2, 1.35],
[2, 2],
[2, 3],
[2.5, 1.5],
[2.5, 2],
[2.5, 2.5],
[1, 1]
]
blob1, y1 = make_blobs(
n_samples=1000,
n_featu... | {
"repo_name": "whitews/dpconverge",
"path": "test_hdp_setting_initial_conditions.py",
"copies": "1",
"size": "3360",
"license": "bsd-3-clause",
"hash": -1139954119566463000,
"line_mean": 19.3636363636,
"line_max": 75,
"alpha_frac": 0.6348214286,
"autogenerated": false,
"ratio": 2.614785992217899,... |
from dpconverge.data_set import DataSet
from dpconverge.data_collection import DataCollection
import sys
import numpy as np
import flowio
import flowutils
fcs_files = [
sys.argv[1],
sys.argv[2]
]
spill_text = """4, Blue B-A, Blue A-A, Red C-A, Green E-A,
1, 6.751e-3, 0, 2.807e-3,
0, 1, 0.03, 0,
0, 5.559e-3, 1... | {
"repo_name": "whitews/dpconverge",
"path": "test_hdp_init_hdp_real_data.py",
"copies": "1",
"size": "5485",
"license": "bsd-3-clause",
"hash": 6783607849670056000,
"line_mean": 28.0211640212,
"line_max": 78,
"alpha_frac": 0.5436645397,
"autogenerated": false,
"ratio": 3.895596590909091,
"confi... |
from dpconverge.data_set import DataSet
from dpconverge.data_collection import DataCollection
from sklearn.datasets.samples_generator import make_blobs
dc = DataCollection()
centers = [[2, 1.35], [2, 2], [2, 3], [2.5, 1.5], [2.5, 2], [2.5, 2.5]]
# begin creating blobs for 1st data set
ds1_blob1, y1 = make_blobs(
... | {
"repo_name": "whitews/dpconverge",
"path": "test_hdp_medium_complex_2param.py",
"copies": "1",
"size": "2837",
"license": "bsd-3-clause",
"hash": -7713703254119812000,
"line_mean": 19.4100719424,
"line_max": 71,
"alpha_frac": 0.6309481847,
"autogenerated": false,
"ratio": 2.5489667565139262,
"... |
from dpconverge.data_set import DataSet
from matplotlib import pyplot
from sklearn.datasets.samples_generator import make_blobs
n_features = 2
points_per_feature = 100
centers = [[2, 1.35], [2, 2], [2, 3], [2.5, 1.5], [2.5, 2], [2.5, 2.5]]
blob1, y1 = make_blobs(
n_samples=1000,
n_features=1,
centers=cent... | {
"repo_name": "whitews/dpconverge",
"path": "test_dp_medium_complex_2param.py",
"copies": "1",
"size": "1710",
"license": "bsd-3-clause",
"hash": 6646859001448578000,
"line_mean": 19.3571428571,
"line_max": 71,
"alpha_frac": 0.6473684211,
"autogenerated": false,
"ratio": 2.6677067082683306,
"co... |
from dpconverge.data_set import DataSet
from matplotlib import pyplot
import numpy as np
from sklearn.datasets.samples_generator import make_blobs
from dpmix.utils import mvn_weighted_logged, sample_discrete
from dpmix.munkres import munkres, _get_cost
def update_labels(data, mus, sigmas, pis):
densities = mvn_we... | {
"repo_name": "whitews/dpconverge",
"path": "test_dp_multichain_cost_matrix.py",
"copies": "1",
"size": "2445",
"license": "bsd-3-clause",
"hash": -6144345276352860000,
"line_mean": 19.7203389831,
"line_max": 71,
"alpha_frac": 0.6449897751,
"autogenerated": false,
"ratio": 2.68976897689769,
"co... |
from dpconverge.data_set import DataSet
import numpy as np
from matplotlib import pyplot
from sklearn.datasets.samples_generator import make_blobs
n_features = 2
points_per_feature = 100
centers = [[2, 1.35], [2, 2], [2, 3], [2.5, 1.5], [2.5, 2], [2.5, 2.5]]
blob1, y1 = make_blobs(
n_samples=1000,
n_features=... | {
"repo_name": "whitews/dpconverge",
"path": "test_dp_setting_initial_conditions.py",
"copies": "1",
"size": "3029",
"license": "bsd-3-clause",
"hash": 4490170005475136500,
"line_mean": 19.8965517241,
"line_max": 71,
"alpha_frac": 0.6642456256,
"autogenerated": false,
"ratio": 2.7712717291857274,
... |
from dpconverge.data_set import DataSet
import numpy as np
import pandas as pd
from matplotlib import pyplot
from sklearn.datasets.samples_generator import make_blobs
n_features = 2
points_per_feature = 100
centers = [[2, 1.35], [2, 2], [2, 3], [2.5, 1.5], [2.5, 2], [2.5, 2.5]]
blob1, y1 = make_blobs(
n_samples=1... | {
"repo_name": "whitews/dpconverge",
"path": "test_dp_setting_initial_conditions_bem.py",
"copies": "1",
"size": "4107",
"license": "bsd-3-clause",
"hash": 4282535943685368300,
"line_mean": 22.0730337079,
"line_max": 76,
"alpha_frac": 0.601412223,
"autogenerated": false,
"ratio": 3.053531598513011... |
from dpconverge.data_set import DataSet
import numpy as np
from sklearn.datasets.samples_generator import make_blobs
n_features = 3
points_per_feature = 100
centers = [[2, 2, 1], [2, 4, 2], [4, 2, 3], [4, 4, 4]]
ds = DataSet(parameter_count=n_features)
rnd_state = np.random.RandomState()
rnd_state.seed(3)
for i, ce... | {
"repo_name": "whitews/dpconverge",
"path": "test_dp_3params.py",
"copies": "1",
"size": "1245",
"license": "bsd-3-clause",
"hash": 2338472534678225400,
"line_mean": 23.9,
"line_max": 71,
"alpha_frac": 0.6570281124,
"autogenerated": false,
"ratio": 2.8686635944700463,
"config_test": false,
"h... |
from dpconverge.data_set import DataSet
import numpy as np
n_features = 2
points_per_feature = 100
centers = [[2, 2], [4, 4]]
ds = DataSet(parameter_count=2)
n_samples = 500
outer_circ_x = 1.0 + np.cos(np.linspace(0, np.pi, n_samples)) / 2
outer_circ_y = 0.5 + np.sin(np.linspace(0, np.pi, n_samples))
X = np.vstack... | {
"repo_name": "whitews/dpconverge",
"path": "test_dp_banana_cluster.py",
"copies": "1",
"size": "1148",
"license": "bsd-3-clause",
"hash": 922207008468195800,
"line_mean": 22.4285714286,
"line_max": 65,
"alpha_frac": 0.6480836237,
"autogenerated": false,
"ratio": 2.609090909090909,
"config_test... |
from dpkt.ethernet import Ethernet
from dpkt.ip import IP
import dpkt.tcp
import pcap
import struct
import sys
from matplotlib import pyplot
#TODO: Proper argument parsing
def usage():
print "python plotpcap.py [filename] [x_axis] [y_axis] [tcpdump filter]"
print "filename: pcap file to plot"
print... | {
"repo_name": "arkem/plotpcap",
"path": "plotpcap.py",
"copies": "1",
"size": "3718",
"license": "bsd-2-clause",
"hash": -6178539323665264000,
"line_mean": 33.7476635514,
"line_max": 130,
"alpha_frac": 0.5984400215,
"autogenerated": false,
"ratio": 3.4047619047619047,
"config_test": false,
"h... |
from dpl.core.things import Thing, ThingFactory
class ThingRegistry(object):
"""
Класс (Singleton по задумке), который хранит список фабрик
для всех импортированных соединений
"""
__reg = dict() # type: dict[str, dict[type, ThingFactory]]
@classmethod
def register_factory(cls, type_alias... | {
"repo_name": "dot-cat/dotcat_platform",
"path": "dpl/core/things/thing_registry.py",
"copies": "2",
"size": "2876",
"license": "mit",
"hash": 4165311391104250400,
"line_mean": 35.3548387097,
"line_max": 94,
"alpha_frac": 0.6468500444,
"autogenerated": false,
"ratio": 2.1466666666666665,
"confi... |
from dpll import *
from sudoku import *
def resitev(rezult):
"""Iz slovarja spremenljivk, ki jih uporablja pretvorba na SAT,
ta funkcija izlusci slovar vrednosti zasedenih polj. """
polja = {}
for spr in rezult:
if rezult[spr]==T():
trojica = tuple(int(i) for i in spr.split(","))
polja[(trojica[0],troj... | {
"repo_name": "EvaBr/LVRSAT",
"path": "resljivostSudoku.py",
"copies": "1",
"size": "2048",
"license": "bsd-3-clause",
"hash": -8408067597873192000,
"line_mean": 21.4175824176,
"line_max": 116,
"alpha_frac": 0.5838235294,
"autogenerated": false,
"ratio": 2.203023758099352,
"config_test": false,... |
from dqn_agent import DQN
import numpy as np
import torch.optim as optim
import torch.nn as nn
import torch
from torch.autograd import Variable
FloatTensor = torch.FloatTensor
LongTensor = torch.LongTensor
def train(X_batch, Y_batch):
optimizer.zero_grad()
preds = model(X_batch)
loss = criterion(preds, Y... | {
"repo_name": "jaybutera/tetrisRL",
"path": "supervised_agent.py",
"copies": "1",
"size": "1744",
"license": "mit",
"hash": -2278441960077813000,
"line_mean": 27.1290322581,
"line_max": 77,
"alpha_frac": 0.5877293578,
"autogenerated": false,
"ratio": 3.439842209072978,
"config_test": false,
"... |
from DQN import DeepQNetwork
from env import Env
import numpy as np
EPS = 300000
STEP = 600
action_space = ['f', 'b', 'l', 'r', 'fl', 'fr', 'bl', 'br']
DIST = 0.025
R = 0.4
B = 0.2
MEMORYCAPACITY = 100000
PENALTY = -0.2
def compute_reward(state, state_):
"""
if distance is decreasing, reward +1; if distance ... | {
"repo_name": "ZhiangChen/soft_arm",
"path": "example_nets/DQN_path_planning2.py",
"copies": "1",
"size": "2865",
"license": "mit",
"hash": -7768329235451662000,
"line_mean": 25.0454545455,
"line_max": 79,
"alpha_frac": 0.4872600349,
"autogenerated": false,
"ratio": 3.6037735849056602,
"config_... |
from DQN import DeepQNetwork
from map_env import Map
import numpy as np
EPS = 300000
STEP = 400
action_space = ['f','b','l','r']
DIST = 0.01
R = 0.5
MEMORYCAPACITY = 400000
def compute_reward(state, state_):
"""
if distance is decreasing, reward +1; if distance is increasing, reward -1;
if reach the goal... | {
"repo_name": "ZhiangChen/soft_arm",
"path": "example_nets/DQN_path_planning.py",
"copies": "1",
"size": "2536",
"license": "mit",
"hash": 6250922813762559000,
"line_mean": 24.6262626263,
"line_max": 111,
"alpha_frac": 0.5043375394,
"autogenerated": false,
"ratio": 3.6806966618287373,
"config_t... |
from DQN import Estimator
import tensorflow as tf
import os
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import spline
from stock_env import Stock
env = Stock()
VALID_ACTIONS = env.VALID_ACTIONS
experiment_dir = os.path.abspath("./experiments/{}".format(env.spec.id))
estimator = Estimator... | {
"repo_name": "JoshGlue/RU-CCN",
"path": "Test.py",
"copies": "1",
"size": "2773",
"license": "apache-2.0",
"hash": -3042109186737665000,
"line_mean": 29.1413043478,
"line_max": 124,
"alpha_frac": 0.5885322755,
"autogenerated": false,
"ratio": 3.3329326923076925,
"config_test": false,
"has_no... |
from DQN import *
tf.reset_default_graph()
# Where we save our checkpoints and graphs
experiment_dir = os.path.abspath("./experiments/{}".format(env.spec.id))
# Create a glboal step variable
global_step = tf.Variable(0, name='global_step', trainable=False)
# Create estimators
q_estimator = Estimator(scope="q", sum... | {
"repo_name": "JoshGlue/RU-CCN",
"path": "Train.py",
"copies": "1",
"size": "1482",
"license": "apache-2.0",
"hash": 4593477261344922000,
"line_mean": 40.1944444444,
"line_max": 72,
"alpha_frac": 0.4966261808,
"autogenerated": false,
"ratio": 4.780645161290322,
"config_test": false,
"has_no_k... |
from DQN_J2 import *
from utils.Pipe import *
import gym
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
import numpy as np
import cv2,re,random,time,sys
STEPS= 100000000000
ENVIRONMENT = 'Breakout-v0'
SAVE_NETWORK = True
LOAD_NETWORK = False
BACKUP_RATE = 500
UPDATE_TIME = 100
NUM_CHANNELS = ... | {
"repo_name": "AlwaysLearningDeeper/Project",
"path": "src/dqn/main.py",
"copies": "2",
"size": "8012",
"license": "mit",
"hash": -9134646459641059000,
"line_mean": 33.0936170213,
"line_max": 139,
"alpha_frac": 0.5777583625,
"autogenerated": false,
"ratio": 3.524857017157941,
"config_test": fal... |
from DQN_J2 import *
from utils.Stack import *
import gym
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
import numpy as np
import cv2,re,random,time
STEPS= 100000000000
ENVIRONMENT = 'Breakout-v0'
SAVE_NETWORK = True
LOAD_NETWORK = True
BACKUP_RATE = 500
UPDATE_TIME = 100
NUM_CHANNELS = 4 #... | {
"repo_name": "AlwaysLearningDeeper/OpenAI_Challenges",
"path": "src/dqn/replayMemoryTester.py",
"copies": "2",
"size": "2411",
"license": "mit",
"hash": -2713443132028012000,
"line_mean": 25.7888888889,
"line_max": 108,
"alpha_frac": 0.6204894235,
"autogenerated": false,
"ratio": 3.1311688311688... |
from draalcore.app_config import BaseAppConfig
class AuthConfig(BaseAppConfig):
name = 'draalcore.auth'
label = 'draalcore.auth'
display_name = 'auth'
def ready(self):
from .sites.actions import (GoogleExtAuthAction, FacebookExtAuthAction,
TwitterExtAuthAct... | {
"repo_name": "jojanper/draalcore",
"path": "draalcore/auth/apps.py",
"copies": "1",
"size": "1617",
"license": "mit",
"hash": -8395928177089428000,
"line_mean": 52.9,
"line_max": 96,
"alpha_frac": 0.6252319109,
"autogenerated": false,
"ratio": 5.693661971830986,
"config_test": false,
"has_no... |
from draco.core.containers import GainData
from caput import mpiarray, mpiutil
import pytest
import glob
import numpy as np
import os
# Run these tests under MPI
pytestmark = pytest.mark.mpi
comm = mpiutil.world
rank, size = mpiutil.rank, mpiutil.size
len_axis = 8
dset1 = np.arange(len_axis * len_axis * len_axis)... | {
"repo_name": "radiocosmology/draco",
"path": "test/test_selections.py",
"copies": "1",
"size": "6135",
"license": "mit",
"hash": 7190203381156008000,
"line_mean": 32.1621621622,
"line_max": 88,
"alpha_frac": 0.6417277914,
"autogenerated": false,
"ratio": 3.0644355644355645,
"config_test": true... |
from draftHost import models
PLAYER_DATA = "/tmp/player_data.txt"
class PlayerImporter(object):
DATA_FORMAT = ['id', 'first_name', 'last_name',
'position_id', 'school_id', 'draft_year']
def add_players(self):
self.fetch_support_data()
try:
data = open(PLAYER_DAT... | {
"repo_name": "gnmerritt/autodraft",
"path": "autodraft/draftHost/importers/players.py",
"copies": "1",
"size": "2044",
"license": "mit",
"hash": 2576927105841474000,
"line_mean": 34.2413793103,
"line_max": 89,
"alpha_frac": 0.5704500978,
"autogenerated": false,
"ratio": 3.663082437275986,
"con... |
from draftHost.models import NflPosition, FantasyPosition
# path relative to manage.py
NFL_DATA_FILE = "draftHost/data/nfl_positions.txt"
FANTASY_DATA_FILE = "draftHost/data/fantasy_positions.txt"
class PositionImporter(object):
def add_positions(self):
try:
data = open(NFL_DATA_FILE, 'r')
... | {
"repo_name": "gnmerritt/autodraft",
"path": "autodraft/draftHost/importers/positions.py",
"copies": "1",
"size": "1447",
"license": "mit",
"hash": -1685249741477392600,
"line_mean": 33.4523809524,
"line_max": 73,
"alpha_frac": 0.5279889426,
"autogenerated": false,
"ratio": 4.030640668523677,
"... |
from .draft import salary_constrained_team, doubly_constrained_team
def test_salary_constrained_team():
names = ['bill','fred','barney']
salaries = [100., 200., 300.]
forecasts = [ 2.5, 2.5, 5.0 ]
cap = 400.
chosen, team = salary_constrained_team( names=names, salaries=salari... | {
"repo_name": "notbanker/pysport",
"path": "pysport/fantasy/test_draft.py",
"copies": "1",
"size": "1269",
"license": "mit",
"hash": 9133099335503579000,
"line_mean": 38.65625,
"line_max": 84,
"alpha_frac": 0.4743892829,
"autogenerated": false,
"ratio": 3.7994011976047903,
"config_test": false,... |
from draftjs_exporter.dom import DOM
from wagtail.admin.rich_text.converters.html_to_contentstate import LinkElementHandler
from wagtail.documents import get_document_model
# draft.js / contentstate conversion
def document_link_entity(props):
"""
Helper to construct elements of the form
<a id="1" linktyp... | {
"repo_name": "timorieber/wagtail",
"path": "wagtail/documents/rich_text/contentstate.py",
"copies": "7",
"size": "1417",
"license": "bsd-3-clause",
"hash": -8244187359394284000,
"line_mean": 26.25,
"line_max": 102,
"alpha_frac": 0.623853211,
"autogenerated": false,
"ratio": 4.1923076923076925,
... |
from draftjs_exporter.dom import DOM
from wagtail.admin.rich_text.converters.contentstate_models import Entity
from wagtail.admin.rich_text.converters.html_to_contentstate import AtomicBlockEntityElementHandler
from wagtail.embeds import embeds
from wagtail.embeds.exceptions import EmbedException
# draft.js / conten... | {
"repo_name": "mixxorz/wagtail",
"path": "wagtail/embeds/rich_text/contentstate.py",
"copies": "17",
"size": "1681",
"license": "bsd-3-clause",
"hash": -7109099000377615000,
"line_mean": 31.9607843137,
"line_max": 99,
"alpha_frac": 0.6448542534,
"autogenerated": false,
"ratio": 4.002380952380952,... |
from draftjs_exporter.dom import DOM
from wagtail.admin.rich_text.converters.html_to_contentstate import LinkElementHandler
from wagtail.documents import get_document_model
# draft.js / contentstate conversion
def document_link_entity(props):
"""
Helper to construct elements of the form
<a id="1" linkt... | {
"repo_name": "FlipperPA/wagtail",
"path": "wagtail/documents/rich_text/contentstate.py",
"copies": "7",
"size": "1419",
"license": "bsd-3-clause",
"hash": 5236633007898841000,
"line_mean": 25.2777777778,
"line_max": 102,
"alpha_frac": 0.6229739253,
"autogenerated": false,
"ratio": 4.185840707964... |
from draftjs_exporter.dom import DOM
from wagtail.admin.rich_text.converters.html_to_contentstate import LinkElementHandler
from wagtail.documents.models import get_document_model
# draft.js / contentstate conversion
def document_link_entity(props):
"""
Helper to construct elements of the form
<a id="1"... | {
"repo_name": "nealtodd/wagtail",
"path": "wagtail/documents/rich_text/contentstate.py",
"copies": "3",
"size": "1425",
"license": "bsd-3-clause",
"hash": 4223178435549282000,
"line_mean": 25.8867924528,
"line_max": 102,
"alpha_frac": 0.6245614035,
"autogenerated": false,
"ratio": 4.1788856304985... |
from draftlog import ansi
import sys
"""
A single line object that saves its relative position
in the terminal. It's responsible for updating itself.
"""
class LogDraft:
def __init__(self, drafter, text="\n"):
self.stream = sys.stdout
self.drafter = drafter
self.valid = True
self.te... | {
"repo_name": "kepoorhampond/python-draftlog",
"path": "draftlog/logdraft.py",
"copies": "1",
"size": "1986",
"license": "mit",
"hash": -4157460205520597500,
"line_mean": 26.2054794521,
"line_max": 81,
"alpha_frac": 0.6032225579,
"autogenerated": false,
"ratio": 3.8265895953757227,
"config_test... |
from draftlog.logdraft import LogDraft
from draftlog import ansi
import draftlog
import time
import sys
import threading
# Imports the correct module according to
# Python version.
if sys.version_info[0] <= 2:
import Queue as queue
else:
import queue
"""
A background process to coordinate all the intervals
wi... | {
"repo_name": "kepoorhampond/python-draftlog",
"path": "draftlog/drafter.py",
"copies": "1",
"size": "3478",
"license": "mit",
"hash": 2539455364944371000,
"line_mean": 28.9827586207,
"line_max": 88,
"alpha_frac": 0.6072455434,
"autogenerated": false,
"ratio": 4.082159624413146,
"config_test": ... |
from draft.upload_draft_to_manager import Uploader
from room import Room
from draft.draft import Draft
import json
def get_map_by_name(name, pool):
return [x for x in pool if x.slug == name][0]
if __name__ == '__main__':
from draft.map import Map
from draft.drafttype import DraftType
# (self, room_id... | {
"repo_name": "LtHummus/SpyPartyDraft",
"path": "test.py",
"copies": "1",
"size": "3025",
"license": "mit",
"hash": -665545879834448900,
"line_mean": 55.0185185185,
"line_max": 278,
"alpha_frac": 0.6320661157,
"autogenerated": false,
"ratio": 2.8218283582089554,
"config_test": false,
"has_no_... |
from dragonfly.grammar.grammar import Grammar
from dragonfly.grammar.context import AppContext
from dragonfly.grammar.rule_mapping import MappingRule
from dragonfly.grammar.elements import Dictation
from dragonfly.actions.actions import Key, Text
from dragonfly import (Grammar, AppContext, CompoundRule, ... | {
"repo_name": "bcgrendel/Speechcoder",
"path": "speechcoder_ext/grammar/notepad++.py",
"copies": "1",
"size": "15810",
"license": "mit",
"hash": -5797315515979681000,
"line_mean": 21.8468208092,
"line_max": 163,
"alpha_frac": 0.5219481341,
"autogenerated": false,
"ratio": 2.415953545232274,
"co... |
from dragonfly.grammar.grammar import Grammar
from dragonfly.grammar.context import AppContext
from dragonfly.grammar.rule_mapping import MappingRule
from dragonfly.grammar.elements import Dictation
from dragonfly.actions.actions import Key, Text
from dragonfly import (Grammar, AppContext, CompoundR... | {
"repo_name": "bcgrendel/Speechcoder",
"path": "notepad++.py",
"copies": "1",
"size": "25498",
"license": "mit",
"hash": 2953628910998909000,
"line_mean": 23.2956349206,
"line_max": 199,
"alpha_frac": 0.4912149973,
"autogenerated": false,
"ratio": 2.501029916625797,
"config_test": false,
"has... |
from dragonfly import (Grammar, AppContext, MappingRule, CompoundRule, Choice, Dictation,
Key, Text, Function)
#---------------------------------------------------------------------------
# Create this module's grammar and the context under which it'll be active.
grammar_context = AppContext(e... | {
"repo_name": "danzel/NatlinkVisualStudioMacros",
"path": "devenv.py",
"copies": "1",
"size": "5010",
"license": "unlicense",
"hash": 5540076885139469000,
"line_mean": 31.3225806452,
"line_max": 112,
"alpha_frac": 0.5814371257,
"autogenerated": false,
"ratio": 3.5406360424028267,
"config_test":... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation, Key, Text, Integer, Mimic)
context = AppContext(title="nerdtree")
grammar = Grammar("nerdtree", context=context)
noSpaceNoCaps = Mimic("\\no-caps-on") + Mimic("\\no-space-on")
rules = MappingRule(
name = "nerdtree",
mapping = {
"split": K... | {
"repo_name": "medhasharma/code-by-voice",
"path": "macros/_nerdtree.py",
"copies": "2",
"size": "1088",
"license": "mit",
"hash": 5321652198323181000,
"line_mean": 26.8974358974,
"line_max": 94,
"alpha_frac": 0.5505514706,
"autogenerated": false,
"ratio": 3.056179775280899,
"config_test": fals... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation, Key, Text, Integer, Mimic)
javascript = AppContext(title="javascript")
grammar = Grammar("javascript", context=(javascript))
noSpaceNoCaps = Mimic("\\no-caps-on") + Mimic("\\no-space-on")
rules = MappingRule(
name = "javascript",
mapping = {
... | {
"repo_name": "simianhacker/code-by-voice",
"path": "macros/_javascript.py",
"copies": "2",
"size": "2534",
"license": "mit",
"hash": 1827576552174040600,
"line_mean": 45.0727272727,
"line_max": 94,
"alpha_frac": 0.5228887135,
"autogenerated": false,
"ratio": 3.3342105263157893,
"config_test": ... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation, Key, Text, Integer, Mimic)
context = AppContext(title = "jade")
grammar = Grammar("jade", context=context)
noSpaceNoCaps = Mimic("\\no-caps-on") + Mimic("\\no-space-on")
rules = MappingRule(
name = "jade",
mapping = {
"heading [<n>]": T... | {
"repo_name": "simianhacker/code-by-voice",
"path": "macros/_jade.py",
"copies": "2",
"size": "1227",
"license": "mit",
"hash": -3362800972884132400,
"line_mean": 28.9268292683,
"line_max": 94,
"alpha_frac": 0.5753871231,
"autogenerated": false,
"ratio": 3.0675,
"config_test": false,
"has_no_... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation, Key, Text, Integer, Mimic, Playback)
vi = AppContext(title="vi")
gvim = AppContext(title="GVIM")
grammar = Grammar("vim", context=(vi | gvim))
noSpaceNoCaps = Mimic("\\no-caps-on") + Mimic("\\no-space-on")
rules = MappingRule(
name = "vim... | {
"repo_name": "simianhacker/code-by-voice",
"path": "macros/_vim.py",
"copies": "2",
"size": "10006",
"license": "mit",
"hash": 4563232134861190000,
"line_mean": 53.5888888889,
"line_max": 284,
"alpha_frac": 0.4153507895,
"autogenerated": false,
"ratio": 3.571020699500357,
"config_test": false,... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation, Key, Text, Integer, Mimic)
putty_context = AppContext(executable="putty")
bash_context = AppContext(title="bash")
grammar = Grammar("bash", context=(putty_context | bash_context))
noSpaceNoCaps = Mimic("\\no-caps-on") + Mimic("\\no-space-on")
... | {
"repo_name": "medhasharma/code-by-voice",
"path": "macros/_bash.py",
"copies": "2",
"size": "2766",
"license": "mit",
"hash": -2046792840671958000,
"line_mean": 37.5142857143,
"line_max": 109,
"alpha_frac": 0.5169920463,
"autogenerated": false,
"ratio": 3.143181818181818,
"config_test": false,... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation,
Key, Text, FocusWindow, IntegerRef, Choice, Function)
from dragonglue import LinuxAppContext
context = LinuxAppContext(executable='xfce_terminal')
grammar = Grammar('terminal commands', context=context)
a_n = Key('a-%(n)d/5')... | {
"repo_name": "drocco007/vox_commands",
"path": "xfce_terminal.py",
"copies": "1",
"size": "3827",
"license": "mit",
"hash": 5127104167320161000,
"line_mean": 27.1397058824,
"line_max": 76,
"alpha_frac": 0.5296576953,
"autogenerated": false,
"ratio": 3.3897254207263066,
"config_test": false,
... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation,
Key, Text, FocusWindow, IntegerRef, Choice)
from dragonglue import LinuxAppContext
from dragonglue.command import Command
#---------------------------------------------------------------------------
# Create this module's gramm... | {
"repo_name": "drocco007/vox_commands",
"path": "sublime_text.py",
"copies": "1",
"size": "3331",
"license": "mit",
"hash": 8588188180162253000,
"line_mean": 32.31,
"line_max": 84,
"alpha_frac": 0.5211648154,
"autogenerated": false,
"ratio": 3.4952780692549843,
"config_test": false,
"has_no_k... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation,
Key, Text, FocusWindow, IntegerRef, Choice)
context = AppContext(executable='cmd')
grammar = Grammar('cmd.exe commands', context=context)
example_rule = MappingRule(
name='cmd.exe commands',
mapping={
# 'Work ... | {
"repo_name": "drocco007/vox_commands",
"path": "archive/cmd.py",
"copies": "1",
"size": "1581",
"license": "mit",
"hash": -2738961935502525400,
"line_mean": 27.2321428571,
"line_max": 76,
"alpha_frac": 0.5623023403,
"autogenerated": false,
"ratio": 3.7464454976303316,
"config_test": false,
"... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation,
Key, Text, FocusWindow, IntegerRef, Choice)
context = AppContext(executable='console')
grammar = Grammar('Console2 commands', context=context)
#---------------------------------------------------------------------------
# Cre... | {
"repo_name": "drocco007/vox_commands",
"path": "archive/console.py",
"copies": "1",
"size": "1752",
"license": "mit",
"hash": -5468968235859868000,
"line_mean": 32.6923076923,
"line_max": 76,
"alpha_frac": 0.5856164384,
"autogenerated": false,
"ratio": 4.027586206896552,
"config_test": false,
... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation,
Key, Text, FocusWindow, IntegerRef, Choice)
#---------------------------------------------------------------------------
# Create this module's grammar and the context under which it'll be active.
context = AppContext(executab... | {
"repo_name": "drocco007/vox_commands",
"path": "archive/virtualbox.py",
"copies": "1",
"size": "2043",
"license": "mit",
"hash": -3975741276968158000,
"line_mean": 33.05,
"line_max": 76,
"alpha_frac": 0.5609397944,
"autogenerated": false,
"ratio": 4.045544554455446,
"config_test": false,
"ha... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation,
Key, Text, FocusWindow, IntegerRef, Function)
from dragonglue import LinuxAppContext
#---------------------------------------------------------------------------
# Create this module's grammar and the context under which it'll ... | {
"repo_name": "drocco007/vox_commands",
"path": "google_chrome.py",
"copies": "1",
"size": "3622",
"license": "mit",
"hash": 6195030522978662000,
"line_mean": 33.1698113208,
"line_max": 79,
"alpha_frac": 0.5173937051,
"autogenerated": false,
"ratio": 3.385046728971963,
"config_test": false,
"... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation,
Key, Text, FocusWindow, IntegerRef, Function)
#---------------------------------------------------------------------------
# Create this module's grammar and the context under which it'll be active.
context = AppContext(execut... | {
"repo_name": "drocco007/vox_commands",
"path": "archive/java_python.py",
"copies": "1",
"size": "1953",
"license": "mit",
"hash": 5275517119165565000,
"line_mean": 35.8490566038,
"line_max": 89,
"alpha_frac": 0.5704045059,
"autogenerated": false,
"ratio": 4.120253164556962,
"config_test": fals... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation,
Key, Text, FocusWindow, IntegerRef)
#---------------------------------------------------------------------------
# Create this module's grammar and the context under which it'll be active.
context = AppContext(executable='subl... | {
"repo_name": "drocco007/vox_commands",
"path": "sublime_text_js.py",
"copies": "1",
"size": "1401",
"license": "mit",
"hash": -9220575123049135000,
"line_mean": 31.5813953488,
"line_max": 83,
"alpha_frac": 0.5631691649,
"autogenerated": false,
"ratio": 4.060869565217391,
"config_test": false,
... |
from dragonfly import (Grammar, FocusWindow, MappingRule, Key, Config, Section, Item, Playback, Mimic)
rules = MappingRule(
name = "general",
mapping = {
"slap": Key("enter"),
"Max when": Key("w-up"),
"left when": Key("w-left"),
"right when": Key("w-right"),
"min win": Key("w-down"),
"switch apps": Ke... | {
"repo_name": "medhasharma/code-by-voice",
"path": "macros/_globals.py",
"copies": "2",
"size": "1064",
"license": "mit",
"hash": -1649604957950346500,
"line_mean": 32.25,
"line_max": 102,
"alpha_frac": 0.5921052632,
"autogenerated": false,
"ratio": 2.485981308411215,
"config_test": false,
"h... |
from dragonfly import (Grammar, MappingRule, Choice, Text, Key, Function)
from dragonglue.command import send_command, Command
grammar = Grammar("launch")
applications = {
'sublime': 'w-s',
'pycharm': 'w-d',
'chrome': 'w-f',
'logs': 'w-j',
'SQL': 'w-k',
'IPython': 'w-l',
'shell': 'w-semicolo... | {
"repo_name": "drocco007/vox_commands",
"path": "_launch.py",
"copies": "1",
"size": "1067",
"license": "mit",
"hash": -3815184609850926600,
"line_mean": 21.7021276596,
"line_max": 114,
"alpha_frac": 0.6082474227,
"autogenerated": false,
"ratio": 3.2235649546827796,
"config_test": false,
"has... |
from dragon import Dragon
from dragon import short_dragon_names as short_names
class MatchData:
def __init__(self, match_name, blue_team, red_team, dragons=None):
self.match_name = match_name
self.blue_team = blue_team
self.red_team = red_team
if dragons:
self.dragons = ... | {
"repo_name": "space-oiler/league-dragon-stats",
"path": "match_data.py",
"copies": "1",
"size": "1384",
"license": "mit",
"hash": 7806442505766008000,
"line_mean": 29.1086956522,
"line_max": 71,
"alpha_frac": 0.5476878613,
"autogenerated": false,
"ratio": 3.4088669950738915,
"config_test": fal... |
from .dragon_test_case import DragonTestCase
from ..route_handler import BaseRouter, LOGIN_REQUIRED, SUCCESS, ERROR
from ..permissions import login_required, LoginRequired, RoutePermission
class TestRouterDecorated(BaseRouter):
"""
A router with a function decorated
"""
valid_verbs = ['do_something']
... | {
"repo_name": "h-hirokawa/swampdragon",
"path": "swampdragon/tests/test_permissions.py",
"copies": "1",
"size": "4453",
"license": "bsd-3-clause",
"hash": 2356544346156271000,
"line_mean": 30.8071428571,
"line_max": 90,
"alpha_frac": 0.6692117673,
"autogenerated": false,
"ratio": 4.13079777365491... |
from .dragon_test_case import DragonTestCase
from ..serializers.model_serializer import ModelSerializer
from ..serializers import serializer_tools
from django.db import models
from swampdragon.tests.models import SDModel
class ReverseM2M(SDModel):
number = models.IntegerField()
class M2M(SDModel):
name = mo... | {
"repo_name": "h-hirokawa/swampdragon",
"path": "swampdragon/tests/test_serializer_tools.py",
"copies": "1",
"size": "3469",
"license": "bsd-3-clause",
"hash": -2531740457972185600,
"line_mean": 28.3983050847,
"line_max": 94,
"alpha_frac": 0.6860766792,
"autogenerated": false,
"ratio": 3.27882797... |
from drain.step import *
from drain import step
import numpy as np
import tempfile
class Scalar(Step):
def __init__(self, value):
Step.__init__(self, value=value)
def run(self):
return self.value
class Add(Step):
def run(self, *values):
return sum(values)
class Divide(Step):
... | {
"repo_name": "potash/drain",
"path": "tests/test_step.py",
"copies": "1",
"size": "3399",
"license": "mit",
"hash": -3889651651756723000,
"line_mean": 19.9814814815,
"line_max": 73,
"alpha_frac": 0.5436893204,
"autogenerated": false,
"ratio": 2.960801393728223,
"config_test": true,
"has_no_k... |
from drakefly import DrakeFly
import matlab.engine
import random
import os
class StateControlStep:
yaw_index = 5
pitch_index = 4
roll_index = 3
thrust_index = -1
def __init__(self, state_at_time, controls_at_time):
"""
Stores the information concerning the controls being
... | {
"repo_name": "leohentschker/database-crazie",
"path": "python_interface/crazyflie_control/trajectorySimulator.py",
"copies": "1",
"size": "3909",
"license": "mit",
"hash": -3562051334457414700,
"line_mean": 28.6136363636,
"line_max": 85,
"alpha_frac": 0.6055257099,
"autogenerated": false,
"ratio... |
from draughtcraft.lib.units import InvalidUnitException
import math
class Calculations(object):
def __init__(self, recipe):
self.recipe = recipe
#
# Gravity and alcohol content calculations
#
@property
def og(self):
"""
Original gravity of the recipe.
"""
... | {
"repo_name": "ryanpetrello/draughtcraft",
"path": "draughtcraft/lib/calculations.py",
"copies": "1",
"size": "8383",
"license": "bsd-3-clause",
"hash": -6744722761745840000,
"line_mean": 28.6219081272,
"line_max": 79,
"alpha_frac": 0.482404867,
"autogenerated": false,
"ratio": 4.176880916791231,... |
from draughtcraft.lib.units import (
UnitConvert, InvalidUnitException, PoundOunceMerge,
OunceMerge, GramMerge, KilogramMerge, PoundExpansion,
to_us, to_metric, to_kg, to_l, UNIT_MAP)
import unittest
class TestMergeImplementations(unittest.TestCase):
def test_pound_ounce_merge(self):
assert ... | {
"repo_name": "ryanpetrello/draughtcraft",
"path": "draughtcraft/tests/lib/test_unit.py",
"copies": "1",
"size": "15477",
"license": "bsd-3-clause",
"hash": 2534821122948455400,
"line_mean": 39.6220472441,
"line_max": 79,
"alpha_frac": 0.5615429347,
"autogenerated": false,
"ratio": 3.110954773869... |
from draughtcraft.model.deepcopy import DeepCopyMixin
from elixir import Entity, Field, Unicode, ManyToOne
import re
class RecipeSlug(Entity, DeepCopyMixin):
slug = Field(Unicode(256))
recipe = ManyToOne('Recipe', inverse='slugs')
def __init__(self, *args, **kwargs):
super(RecipeSlug, self).__... | {
"repo_name": "ryanpetrello/draughtcraft",
"path": "draughtcraft/model/slugs.py",
"copies": "1",
"size": "1092",
"license": "bsd-3-clause",
"hash": -7676558074300423000,
"line_mean": 25,
"line_max": 74,
"alpha_frac": 0.5924908425,
"autogenerated": false,
"ratio": 3.9565217391304346,
"config_tes... |
from draughtcraft.tests import TestApp
from draughtcraft import model
from fudge.inspector import arg
import fudge
class TestForgotPassword(TestApp):
def test_missing(self):
assert self.get('/forgot/missing').status_int == 200
def test_forgot_get(self):
assert self.get('/forgot/').status_in... | {
"repo_name": "ryanpetrello/draughtcraft",
"path": "draughtcraft/tests/controllers/test_forgot.py",
"copies": "1",
"size": "4994",
"license": "bsd-3-clause",
"hash": -3648851449530144300,
"line_mean": 27.5371428571,
"line_max": 77,
"alpha_frac": 0.5414497397,
"autogenerated": false,
"ratio": 3.97... |
from drawable import drawable
from PIL import Image, ImageDraw
import time
class slideLeft(drawable):
"""
slides text in from left
"""
def __init__(self, feed, font):
self.image = Image.new('RGB', (128, 32))
self.drw = ImageDraw.Draw(self.image)
self.done = False
self.... | {
"repo_name": "cujomalainey/git-matrix-stats",
"path": "slideLeft.py",
"copies": "1",
"size": "1502",
"license": "mit",
"hash": -1138861893781105500,
"line_mean": 27.8846153846,
"line_max": 79,
"alpha_frac": 0.4713715047,
"autogenerated": false,
"ratio": 3.645631067961165,
"config_test": false,... |
from drawable import Drawable
import ezdxf
from utils import btu
class Symbol(Drawable):
def __init__(self):
super().__init__()
def draw_no_contact(self):
self.add_line((0, 0), (5, 0))
self.add_line((15, 0), (20, 0))
self.add_line((5, 10), (5, -10))
self.add_line(... | {
"repo_name": "kozbot/kecb",
"path": "symbol.py",
"copies": "1",
"size": "11122",
"license": "mit",
"hash": -1359544346918962400,
"line_mean": 19.520295203,
"line_max": 78,
"alpha_frac": 0.4126955584,
"autogenerated": false,
"ratio": 3.337935174069628,
"config_test": false,
"has_no_keywords":... |
from drawBot import *
from robofab.world import RGlyph
from defconAppKit.tools.textSplitter import splitText
from fontTools.pens.cocoaPen import CocoaPen
from time import time
import datetime
now = datetime.datetime.now().strftime('%d %B %Y - %H:%M')
_UI = False
if _UI:
pSizes = ['8','10','12','14','16','18','20... | {
"repo_name": "loicsander/Font2PDF",
"path": "Robofont/RF-makeProof.py",
"copies": "1",
"size": "19311",
"license": "mit",
"hash": -2482115420732561400,
"line_mean": 34.9366852886,
"line_max": 143,
"alpha_frac": 0.5174897652,
"autogenerated": false,
"ratio": 4.021884118382659,
"config_test": fa... |
from drawBot import *
from vanilla import FloatingWindow, TextBox
import datetime
def _drawGlyph(glyph):
path = glyph.naked().getRepresentation("defconAppKit.NSBezierPath")
drawPath(path)
def getGlyphOrder(fonts):
gO_lengths = []
gO = []
for aFont in fonts:
glyphOrder = []
if hasat... | {
"repo_name": "loicsander/Font2PDF",
"path": "Robofont/RF-compare-glyphs.py",
"copies": "1",
"size": "5743",
"license": "mit",
"hash": -1727874386503872300,
"line_mean": 27.5771144279,
"line_max": 151,
"alpha_frac": 0.6278948285,
"autogenerated": false,
"ratio": 3.310086455331412,
"config_test"... |
from drawBot import *
def roundedRect(x, y, w, h, r=None, curvature=.6):
"""
Draw a rounded rectangle.
Acts like drawbot rect() but takes optional
radius and curvature arguments.
r is measured in units.
Curvature is a value between 0 and 1.
"""
# if no radius is defined, set it t... | {
"repo_name": "djrrb/drawbotlab",
"path": "shape.py",
"copies": "1",
"size": "2187",
"license": "mit",
"hash": 2224638034913903000,
"line_mean": 25.3493975904,
"line_max": 94,
"alpha_frac": 0.5221764975,
"autogenerated": false,
"ratio": 2.9714673913043477,
"config_test": false,
"has_no_keywor... |
from drawBot import *
"""
I find dealing with color tuples in drawbot to be cumbersome.
Usually, I'd rather deal with colors as a single object, rather than
tuples or individual r/g/b/a elements that I have to pass individually
to the fill() or stroke() function.
fillColor() and fillStroke() will accept a unified tup... | {
"repo_name": "davelab6/drawbotlab",
"path": "color.py",
"copies": "2",
"size": "3168",
"license": "mit",
"hash": 7236744215622971000,
"line_mean": 26.0854700855,
"line_max": 82,
"alpha_frac": 0.59375,
"autogenerated": false,
"ratio": 2.8361683079677706,
"config_test": false,
"has_no_keywords... |
from .draw_commands import *
from .geometry import *
FACE_RIGHT = 1
FACE_LEFT = 2
FACE_UP = 3
FACE_DOWN = 4
def set_vbo(vbo_id, points):
data2 = (GL.GLfloat*len(points))(*points)
GL.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo_id)
GL.glBufferData(GL.GL_ARRAY_BUFFER, ctypes.sizeof(data2), data2,
... | {
"repo_name": "mwreuter/arcade",
"path": "arcade/sprite.py",
"copies": "1",
"size": "24844",
"license": "mit",
"hash": -1153207643293967000,
"line_mean": 30.6484076433,
"line_max": 79,
"alpha_frac": 0.5367895669,
"autogenerated": false,
"ratio": 3.6589101620029454,
"config_test": false,
"has_... |
from .draw_commands import *
#### OBJECTS ####
import arcade.color
class Shape():
def __init__(self, center_x, center_y, color = arcade.color.GREEN, tilt_angle = 0):
self.color = color
self.center_x = center_x
self.center_y = center_y
self.tilt_angle = tilt_angle
sel... | {
"repo_name": "mwreuter/arcade",
"path": "arcade/shape_objects.py",
"copies": "1",
"size": "8113",
"license": "mit",
"hash": 6044153885125722000,
"line_mean": 31.7137096774,
"line_max": 154,
"alpha_frac": 0.5937384445,
"autogenerated": false,
"ratio": 3.2439024390243905,
"config_test": false,
... |
from .drawers import HTMLDrawer
class Point:
def __init__(self, lat, lng, title, description, color='#FF0000'):
self.lat = lat
self.lng = lng
self.title = title
self.description = description
self.color = color
def __unicode__(self):
return self.title + ': ' ... | {
"repo_name": "Poccio/rPyGMaps",
"path": "rpygmaps/pygmaps.py",
"copies": "1",
"size": "1630",
"license": "apache-2.0",
"hash": -1376234566973076200,
"line_mean": 29.7547169811,
"line_max": 164,
"alpha_frac": 0.6116564417,
"autogenerated": false,
"ratio": 3.5281385281385282,
"config_test": fals... |
from drawille.graphics_utils import get_pos, CH_HEIGHT, CH_WIDTH, frange
from arena import *
__author__ = 'ericmuxagata'
BASE_SIZE = 5
DIR_W = 0
DIR_S = 1
DIR_E = 2
DIR_N = 3
class SnakeNode(object):
def __init__(self,x,y,c,dir, next=None,prev=None):
self.x, self.y = x,y
self.color, self.dir = c... | {
"repo_name": "marcioapaiva/baphomet",
"path": "snake.py",
"copies": "1",
"size": "3430",
"license": "mit",
"hash": -2360723355974187000,
"line_mean": 29.0877192982,
"line_max": 97,
"alpha_frac": 0.5189504373,
"autogenerated": false,
"ratio": 3.065236818588025,
"config_test": false,
"has_no_k... |
from drawille import Canvas, line
import curses
import math
from time import sleep
import locale
locale.setlocale(locale.LC_ALL,"")
stdscr = curses.initscr()
stdscr.refresh()
class Point3D:
def __init__(self, x = 0, y = 0, z = 0):
self.x, self.y, self.z = float(x), float(y), float(z)
def rotateX(sel... | {
"repo_name": "marcioapaiva/baphomet",
"path": "drawille/examples/rotating_cube.py",
"copies": "4",
"size": "3377",
"license": "mit",
"hash": -9152895814025097000,
"line_mean": 30.2685185185,
"line_max": 92,
"alpha_frac": 0.5273911756,
"autogenerated": false,
"ratio": 2.962280701754386,
"config... |
from draw import clear
from draw import print_status
from draw import print_title
from draw import redraw
from human import get_ai_func
from human import get_human_move
from human import get_move_first
from human import get_two_player
from human import play_another
from utils import apply_move
from utils import get_win... | {
"repo_name": "thisisdhaas/tictactoe",
"path": "tictactoe/tictactoe.py",
"copies": "1",
"size": "2362",
"license": "apache-2.0",
"hash": -3005660930971442700,
"line_mean": 27.4578313253,
"line_max": 65,
"alpha_frac": 0.5783234547,
"autogenerated": false,
"ratio": 3.369472182596291,
"config_test... |
from draw import *
from math import ceil
class BoxVertices:
def __init__(self, x, y, z, width, height, depth):
self.i = 0
# (x, y, z) is the top left front corner (point 6)
self.x0 = x
self.y0 = y - height
self.z0 = z - depth
self.x1 = x + width
self.y1 = y
... | {
"repo_name": "aidan-fitz/line-eyes",
"path": "draw3d.py",
"copies": "2",
"size": "7801",
"license": "bsd-3-clause",
"hash": 3981064205997850600,
"line_mean": 29.8339920949,
"line_max": 106,
"alpha_frac": 0.5263427766,
"autogenerated": false,
"ratio": 2.9195359281437128,
"config_test": false,
... |
from draw import *
class Light:
channels = [RED, GREEN, BLUE]
refl_types = ['ambient', 'diffuse', 'specular']
FLAT = 0
GOURAUD = 1
PHONG = 2
def __init__(self):
self.constants = {
'ambient': [0, 0, 0],
'diffuse': [0, 0, 0],
'specular': [0, 0, 0]
... | {
"repo_name": "aidan-fitz/turban-potoo",
"path": "shading.py",
"copies": "1",
"size": "2869",
"license": "mit",
"hash": 6396852317082064000,
"line_mean": 33.5662650602,
"line_max": 100,
"alpha_frac": 0.5433949111,
"autogenerated": false,
"ratio": 3.654777070063694,
"config_test": false,
"has_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.