text
stringlengths
0
1.05M
meta
dict
def nodes(t): if t == None: return 0 return t.n_nodes def depth(t): if t == None: return 0 return t.n_depth class SearchTree(object): def __init__(self, label, left, right): self.label = label self.left = left self.right = right self.n_nodes = 1 + n...
{ "repo_name": "BartMassey/nb-misc", "path": "search_tree.py", "copies": "1", "size": "7520", "license": "mit", "hash": 591349682033102000, "line_mean": 28.8373015873, "line_max": 71, "alpha_frac": 0.4972735736, "autogenerated": false, "ratio": 3.908004158004158, "config_test": false, "has_no_...
# balanced Splay tree # for reuse of left & right rotates, inherit from AVL trees from avl import * class SplayTree(AVLTree): """ Splay trees have the following features: 1. _No_ metadata needed (compare to colors in RB and heights in AVL) 2. Each operation, even find, moves (splays) node up ...
{ "repo_name": "dimakuv/python-algos", "path": "tree/splay.py", "copies": "1", "size": "3330", "license": "mit", "hash": -5630012014635681000, "line_mean": 29.8425925926, "line_max": 93, "alpha_frac": 0.5771771772, "autogenerated": false, "ratio": 3.8947368421052633, "config_test": false, "has...
"""Balance.py Implements balance sheet class. """ from settings import * class BalanceSheet(object): """ Implements the balance sheet of a bank as in [2], according to empirical data from [1] and [3]. """ def __init__(self, sheet_size): """ All fractions are floats between 0 and 1. ...
{ "repo_name": "1Reinier/CapstoneThesis", "path": "balance.py", "copies": "1", "size": "2409", "license": "mit", "hash": 8345816007611636000, "line_mean": 33.4142857143, "line_max": 99, "alpha_frac": 0.6704026567, "autogenerated": false, "ratio": 3.65, "config_test": false, "has_no_keywords": ...
"""balarco 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-ba...
{ "repo_name": "fernandolobato/balarco", "path": "balarco/urls.py", "copies": "1", "size": "1047", "license": "mit", "hash": 6632741788316349000, "line_mean": 40.88, "line_max": 83, "alpha_frac": 0.6857688634, "autogenerated": false, "ratio": 3.49, "config_test": false, "has_no_keywords": fals...
""" Definition of the Baleen Utility app and commands http://bbengfort.github.io/tutorials/2016/01/23/console-utility-commis.html """ ########################################################################## ## Imports ########################################################################## from commis import col...
{ "repo_name": "janetriley/baleen", "path": "baleen/console/app.py", "copies": "1", "size": "1742", "license": "mit", "hash": 6994321094002810000, "line_mean": 29.5614035088, "line_max": 75, "alpha_frac": 0.53673938, "autogenerated": false, "ratio": 4.410126582278481, "config_test": false, "ha...
""" Export utility to dump an HTML corpus to disk from the database. """ ########################################################################## ## Imports ########################################################################## import os import baleen.models as db from commis import Command from baleen.consol...
{ "repo_name": "DistrictDataLabs/baleen", "path": "baleen/console/commands/export.py", "copies": "2", "size": "2654", "license": "mit", "hash": -2595944246241328000, "line_mean": 28.8202247191, "line_max": 74, "alpha_frac": 0.5037678975, "autogenerated": false, "ratio": 4.394039735099338, "confi...
""" Handles the ingestion utility both for OPML and feeds. """ ########################################################################## ## Imports ########################################################################## import baleen.models as db from commis import Command from commis.exceptions import ConsoleE...
{ "repo_name": "janetriley/baleen", "path": "baleen/console/commands/ingest.py", "copies": "1", "size": "1984", "license": "mit", "hash": 6809314975009748000, "line_mean": 28.1764705882, "line_max": 86, "alpha_frac": 0.5070564516, "autogenerated": false, "ratio": 4.099173553719008, "config_test"...
""" Runs the ingestor in the background every hour. """ ########################################################################## ## Imports ########################################################################## import time import baleen import schedule import baleen.models as db from commis import Command fro...
{ "repo_name": "janetriley/baleen", "path": "baleen/console/commands/run.py", "copies": "1", "size": "1735", "license": "mit", "hash": 9185178700805376000, "line_mean": 26.9838709677, "line_max": 92, "alpha_frac": 0.5233429395, "autogenerated": false, "ratio": 4.283950617283951, "config_test": f...
""" A utility to print out information about the Baleen state. """ ########################################################################## ## Imports ########################################################################## import baleen import baleen.models as db from commis import Command from baleen.config i...
{ "repo_name": "janetriley/baleen", "path": "baleen/console/commands/summary.py", "copies": "1", "size": "3641", "license": "mit", "hash": -8725110374980684000, "line_mean": 34.0096153846, "line_max": 120, "alpha_frac": 0.4927217797, "autogenerated": false, "ratio": 4.045555555555556, "config_te...
""" Export an HTML corpus for analyses with NLTK """ ########################################################################## ## Imports ########################################################################## import codecs import os from collections import Counter from datetime import datetime from enum import ...
{ "repo_name": "janetriley/baleen", "path": "baleen/export.py", "copies": "1", "size": "8190", "license": "mit", "hash": 8641295983034191000, "line_mean": 34.1502145923, "line_max": 90, "alpha_frac": 0.573015873, "autogenerated": false, "ratio": 4.482758620689655, "config_test": false, "has_no...
""" Handles the synchronization of documents from an RSS feeds. """ ########################################################################## ## Imports ########################################################################## import feedparser import json from baleen.config import settings from baleen.models imp...
{ "repo_name": "janetriley/baleen", "path": "baleen/feed.py", "copies": "1", "size": "8008", "license": "mit", "hash": 7247711817063198000, "line_mean": 33.8173913043, "line_max": 94, "alpha_frac": 0.5756743257, "autogenerated": false, "ratio": 4.486274509803922, "config_test": false, "has_no_...
""" The ingestion runner that implements ingestion for a collection of feeds. """ ########################################################################## ## Imports ########################################################################## import uuid from baleen.opml import OPML from baleen.exceptions import * ...
{ "repo_name": "janetriley/baleen", "path": "baleen/ingest.py", "copies": "1", "size": "9739", "license": "mit", "hash": -1696574864327852000, "line_mean": 31.6812080537, "line_max": 100, "alpha_frac": 0.5275695657, "autogenerated": false, "ratio": 4.572300469483568, "config_test": false, "has...
""" Object Document Models for use with Mongo and mongoengine """ ########################################################################## ## Imports ########################################################################## import baleen import hashlib import mongoengine as me from datetime import datetime,timed...
{ "repo_name": "bbengfort/baleen", "path": "baleen/models.py", "copies": "2", "size": "7577", "license": "mit", "hash": 4069249794580210700, "line_mean": 28.030651341, "line_max": 90, "alpha_frac": 0.5469183054, "autogenerated": false, "ratio": 4.242441209406495, "config_test": false, "has_no_...
""" Reads opml files and gives back outline data """ ########################################################################## ## Imports ########################################################################## import baleen.models as db from bs4 import BeautifulSoup from collections import Counter from mongoengi...
{ "repo_name": "janetriley/baleen", "path": "baleen/opml.py", "copies": "1", "size": "3182", "license": "mit", "hash": 3842899956369768400, "line_mean": 28.462962963, "line_max": 74, "alpha_frac": 0.4802011314, "autogenerated": false, "ratio": 4.545714285714285, "config_test": false, "has_no_k...
""" Decorators and function utilities for Baleen. """ ########################################################################## ## Imports ########################################################################## import signal from functools import wraps from baleen.utils.timez import Timer from baleen.exceptions ...
{ "repo_name": "janetriley/baleen", "path": "baleen/utils/decorators.py", "copies": "1", "size": "3648", "license": "mit", "hash": 4071541326798817000, "line_mean": 27.9523809524, "line_max": 76, "alpha_frac": 0.5243969298, "autogenerated": false, "ratio": 4.877005347593583, "config_test": false...
""" Logging utility for Baleen """ ########################################################################## ## Imports ########################################################################## import logging import getpass import warnings import logging.config from baleen.config import settings from baleen.utils...
{ "repo_name": "DistrictDataLabs/baleen", "path": "baleen/utils/logger.py", "copies": "2", "size": "5996", "license": "mit", "hash": -6317190101372500000, "line_mean": 28.3921568627, "line_max": 77, "alpha_frac": 0.5133422282, "autogenerated": false, "ratio": 4.535552193645991, "config_test": tr...
""" Handlers and formatters for logging to Mongo """ ########################################################################## ## Imports ########################################################################## import getpass import logging import logging.config from baleen.utils.timez import * from baleen.config...
{ "repo_name": "bbengfort/baleen", "path": "baleen/utils/mongolog.py", "copies": "2", "size": "4641", "license": "mit", "hash": 2156091980079506200, "line_mean": 30.7876712329, "line_max": 107, "alpha_frac": 0.5291962939, "autogenerated": false, "ratio": 4.424213536701621, "config_test": false, ...
""" Text-related Utility functions for Baleenc """ ########################################################################## ## Imports ########################################################################## import bleach from readability.readability import Document #############################################...
{ "repo_name": "janetriley/baleen", "path": "baleen/utils/text.py", "copies": "1", "size": "2290", "license": "mit", "hash": -5574443329287901000, "line_mean": 24.4444444444, "line_max": 81, "alpha_frac": 0.5558951965, "autogenerated": false, "ratio": 4.03169014084507, "config_test": false, "h...
""" Utility functions for Baleenc """ ########################################################################## ## Imports ########################################################################## import re import time from dateutil.tz import tzlocal, tzutc from datetime import datetime, timedelta from dateutil.r...
{ "repo_name": "bbengfort/baleen", "path": "baleen/utils/timez.py", "copies": "2", "size": "3828", "license": "mit", "hash": 2854681451922932700, "line_mean": 28.90625, "line_max": 88, "alpha_frac": 0.5148902821, "autogenerated": false, "ratio": 3.8165503489531405, "config_test": false, "has_n...
""" Stores version information such that it can be read by setuptools. """ ########################################################################## ## Imports ########################################################################## __version_info__ = { 'major': 0, 'minor': 3, 'micro': 3, 'release...
{ "repo_name": "janetriley/baleen", "path": "baleen/version.py", "copies": "1", "size": "1233", "license": "mit", "hash": 2129839921344600000, "line_mean": 29.825, "line_max": 74, "alpha_frac": 0.5474452555, "autogenerated": false, "ratio": 3.680597014925373, "config_test": false, "has_no_keyw...
""" Wrangles the post objects from a synchronized feed. Feed objects don't require a lot of wrangling, and are handled primarily by the FeedSync object. However Posts do require some hoop jumping, which this module provides. """ ########################################################################## ## Imports ##...
{ "repo_name": "janetriley/baleen", "path": "baleen/wrangle.py", "copies": "1", "size": "6066", "license": "mit", "hash": -779273093729282200, "line_mean": 32.8882681564, "line_max": 96, "alpha_frac": 0.5715463238, "autogenerated": false, "ratio": 4.526865671641791, "config_test": false, "has_...
# Baller Monokai styling # search-ms:displayname=Search%20Results%20in%20Python35-32&crumb=location:C%3A%5CUsers%5CScott%5CAppData%5CLocal%5CPrograms%5CPython%5CPython35-32\styles from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, Text, \ Number, Operator, Generic, ...
{ "repo_name": "ScottDay/FRC-Cpp-Course", "path": "draft/scott.py", "copies": "1", "size": "4954", "license": "mit", "hash": -9093689783904447000, "line_mean": 50.6041666667, "line_max": 154, "alpha_frac": 0.4083568833, "autogenerated": false, "ratio": 3.767300380228137, "config_test": false, ...
# Ballistic calculator for ArmA III (1.62.137494), tested with Python 3.5.1 # Muzzle velocities by SMPCrafter and SirJanzelot # todo: Crosswind, MRSI, testing # Bugs: M5 MLRS not working properly | low angular # Suggestions: GUI, calibration, range and diff, 6digits # version: 0.05 # lchange: 2016-07-25 1441h impor...
{ "repo_name": "SirJanzelot/ballistic_arma3", "path": "ballistic.py", "copies": "1", "size": "4708", "license": "mit", "hash": -9054220834314686000, "line_mean": 30.7972972973, "line_max": 132, "alpha_frac": 0.6028474288, "autogenerated": false, "ratio": 2.621727019498607, "config_test": false, ...
# Ball movement in 2D space: An example of elastic collision and position tracking. import random as rnd import matplotlib.pyplot as plt import numpy as np import matplotlib.animation as animation class ball: 'Ball class, store ball position and velocities' count=0 def __init__(self,**arg): ...
{ "repo_name": "ParthaAcharjee/Ball-Movement-in-2D", "path": "maincode.py", "copies": "1", "size": "3012", "license": "mit", "hash": 9002199113400058000, "line_mean": 24.7435897436, "line_max": 84, "alpha_frac": 0.4976759628, "autogenerated": false, "ratio": 2.740673339399454, "config_test": fal...
# ballot/controllers.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from .models import BallotItemListManager, BallotItemManager, BallotReturnedListManager, BallotReturnedManager, \ CANDIDATE, find_best_previously_stored_ballot_returned, OFFICE, MEASURE, \ VoterBallotSaved, VoterBallotSavedMa...
{ "repo_name": "wevote/WeVoteServer", "path": "ballot/controllers.py", "copies": "1", "size": "159770", "license": "mit", "hash": 5547335948645944000, "line_mean": 52.5242881072, "line_max": 129, "alpha_frac": 0.5804281154, "autogenerated": false, "ratio": 3.873399922420481, "config_test": true,...
# ballot management (voting, commenting, writeups, ...) for Area # Directors and Secretariat import datetime, json from django.http import HttpResponseForbidden, HttpResponseRedirect, Http404 from django.shortcuts import render_to_response, get_object_or_404, redirect from django.core.urlresolvers import reverse as u...
{ "repo_name": "wpjesus/codematch", "path": "ietf/doc/views_ballot.py", "copies": "1", "size": "35763", "license": "bsd-3-clause", "hash": -1288391845104937200, "line_mean": 41.778708134, "line_max": 192, "alpha_frac": 0.5674020636, "autogenerated": false, "ratio": 3.8434175174637293, "config_te...
# ballot management (voting, commenting, writeups, ...) for Area # Directors and Secretariat import re, os from datetime import datetime, date, time, timedelta from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, Http404 from django.shortcuts import render_to_response, get_object_or_404 f...
{ "repo_name": "mcr/ietfdb", "path": "ietf/idrfc/views_ballot.py", "copies": "1", "size": "49670", "license": "bsd-3-clause", "hash": 3709731355645041700, "line_mean": 40.704450042, "line_max": 212, "alpha_frac": 0.5690960338, "autogenerated": false, "ratio": 3.847405112316034, "config_test": fa...
# ballot/views_admin.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from .controllers import ballot_items_import_from_master_server, ballot_returned_import_from_master_server from .models import BallotItem, BallotItemListManager, BallotItemManager, BallotReturned, BallotReturnedManager from .serializ...
{ "repo_name": "wevote/WebAppPublic", "path": "ballot/views_admin.py", "copies": "1", "size": "20630", "license": "bsd-3-clause", "hash": 6649146216636751000, "line_mean": 52.4455958549, "line_max": 113, "alpha_frac": 0.6147358216, "autogenerated": false, "ratio": 4.182039326981553, "config_test...
"""Bamber et al 2013 """ import os import numpy as np import netCDF4 as nc from icedata.common import ncload as _ncload, get_datafile as _get_datafile, get_slices_xy #ncfile = datadir+'bamber_2013_1km/Greenland_bedrock_topography_V2.nc' NCFILE = os.path.join('greenland','bamber_2013_1km','Greenland_bedrock_topography_...
{ "repo_name": "perrette/icedata", "path": "icedata/greenland/bamber2013.py", "copies": "1", "size": "1914", "license": "mit", "hash": -1423979751956662800, "line_mean": 34.4444444444, "line_max": 116, "alpha_frac": 0.6504702194, "autogenerated": false, "ratio": 3.369718309859155, "config_test":...
"""bamboo 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-bas...
{ "repo_name": "MarsBighead/bamboo", "path": "bamboo/urls.py", "copies": "1", "size": "1164", "license": "mit", "hash": 7666624642685166000, "line_mean": 36.5483870968, "line_max": 79, "alpha_frac": 0.7216494845, "autogenerated": false, "ratio": 3.5596330275229358, "config_test": false, "has_n...
"""bamindex class describes a custom index format used by AlignQC""" import gzip, sys, random, os from seqtools.range import GenomicRange from seqtools.format.sam.bam.files import BAMFile class BAMIndex: """Index file is a gzipped TSV file with these fields: 1. qname 2. target range 3. bgzf file block start ...
{ "repo_name": "jason-weirather/py-seq-tools", "path": "seqtools/format/sam/bam/bamindex.py", "copies": "1", "size": "11054", "license": "apache-2.0", "hash": -1795653747630924300, "line_mean": 30.855907781, "line_max": 154, "alpha_frac": 0.6237561064, "autogenerated": false, "ratio": 3.3588574901...
from utils import * import string ''' The MIT License (MIT) Copyright (c) 2013 Charles Lin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the r...
{ "repo_name": "kamink/RAPCASEC", "path": "bamPlot.py", "copies": "3", "size": "16358", "license": "mit", "hash": -2063067183923211500, "line_mean": 35.5133928571, "line_max": 145, "alpha_frac": 0.6021518523, "autogenerated": false, "ratio": 3.550683742131539, "config_test": false, "has_no_key...
symbols=[] variantFile = None if len(sys.argv[1:])<=1: ### Indicates that there are insufficient number of command-line arguments print "Warning! Please designate a BAM file as input in the command-line" print "Example: python BAMtoExonBED.py --i /Users/me/sample1.bam --r /Users/me/Hs_exon-...
{ "repo_name": "wuxue/altanalyze", "path": "BAMtoGeneVariants.py", "copies": "1", "size": "11327", "license": "apache-2.0", "hash": 3816946820155016700, "line_mean": 43.7707509881, "line_max": 139, "alpha_frac": 0.5677584533, "autogenerated": false, "ratio": 3.943941504178273, "config_test": fal...
if len(sys.argv[1:])<=1: ### Indicates that there are insufficient number of command-line arguments print "Warning! Please designate a BAM file as input in the command-line" print "Example: python BAMtoExonBED.py --i /Users/me/sample1.bam --r /Users/me/Hs_exon-cancer_hg19.bed" sys.exit() ...
{ "repo_name": "wuxue/altanalyze", "path": "BAMtoExonBED.py", "copies": "1", "size": "5636", "license": "apache-2.0", "hash": 5537282614937969000, "line_mean": 53.7184466019, "line_max": 145, "alpha_frac": 0.5997161107, "autogenerated": false, "ratio": 3.767379679144385, "config_test": false, ...
#Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ...
{ "repo_name": "nsalomonis/BAM-to-Junction-BED", "path": "BAMtoExonBED.py", "copies": "1", "size": "10712", "license": "apache-2.0", "hash": -8700827107934576000, "line_mean": 56.8571428571, "line_max": 191, "alpha_frac": 0.519884242, "autogenerated": false, "ratio": 4.030097817908202, "config_t...
if len(sys.argv[1:])<=1: ### Indicates that there are insufficient number of command-line arguments print "Warning! Please designate a BAM file as input in the command-line" print "Example: python BAMtoJunctionBED.py --i /Users/me/sample1.bam" sys.exit() else: Species = None ...
{ "repo_name": "wuxue/altanalyze", "path": "BAMtoJunctionBED.py", "copies": "1", "size": "12661", "license": "apache-2.0", "hash": -4985390302050956000, "line_mean": 43.4245614035, "line_max": 204, "alpha_frac": 0.6017692125, "autogenerated": false, "ratio": 3.5705019740552735, "config_test": fa...
#Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ...
{ "repo_name": "kdaily/altanalyze", "path": "BAMtoJunctionBED.py", "copies": "1", "size": "10339", "license": "apache-2.0", "hash": 3743124276615798000, "line_mean": 44.3632286996, "line_max": 204, "alpha_frac": 0.5967695135, "autogenerated": false, "ratio": 3.560261707988981, "config_test": fal...
# bananaLABS 06/04/17 DEBUG = False import os import sys import struct import pexpect import uuid import threading import subprocess import time import bluetooth._bluetooth as bluez __version__ = '1.0' LE_META_EVENT = 0x3e OGF_LE_CTL=0x08 OCF_LE_SET_SCAN_ENABLE=0x000C EVT_LE_CONN_COMPLETE=0x01 EVT_LE_ADVERTISING_R...
{ "repo_name": "gatoDev/beaconscan", "path": "beacon.py", "copies": "1", "size": "9728", "license": "mit", "hash": -8604049266420774000, "line_mean": 26.5580736544, "line_max": 199, "alpha_frac": 0.5234375, "autogenerated": false, "ratio": 3.38600765750087, "config_test": false, "has_no_keywor...
""" Banan """ from collections import deque from .bricks import FunctionNode, ValueNode from .blueprints import NodeBlueprint from .mappers import TangledMapper class TreeBuilder(object): def __init__(self, function_node_factory=FunctionNode, value_node_factory=ValueNode, ...
{ "repo_name": "ltron/tangle", "path": "tangle/builder.py", "copies": "1", "size": "2411", "license": "mit", "hash": -1314830004851916300, "line_mean": 40.5689655172, "line_max": 87, "alpha_frac": 0.5802571547, "autogenerated": false, "ratio": 4.415750915750916, "config_test": false, "has_no_k...
"""bandcamp-dl Usage: bandcamp-dl [options] [URL ...] Arguments: URL Bandcamp album/track URL Options: -h --help Show this screen. -v --version Show version. -d --debug Verbose logging. --artist=<artist> The artist's slug (from the URL, --tr...
{ "repo_name": "iheanyi/bandcamp-dl", "path": "bandcamp_dl/__main__.py", "copies": "1", "size": "5207", "license": "unlicense", "hash": 114518228025917440, "line_mean": 39.6484375, "line_max": 123, "alpha_frac": 0.5846626946, "autogenerated": false, "ratio": 4.023975251353441, "config_test": fal...
"""band_dashboard URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cl...
{ "repo_name": "KonichiwaKen/band-dashboard", "path": "band_dashboard/urls.py", "copies": "1", "size": "3619", "license": "mit", "hash": -6333554474263203000, "line_mean": 40.5977011494, "line_max": 96, "alpha_frac": 0.7391544626, "autogenerated": false, "ratio": 3.7425025853154086, "config_test...
"""bandhunter 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...
{ "repo_name": "perna/bandhunter", "path": "bandhunter/urls.py", "copies": "1", "size": "1146", "license": "mit", "hash": -1330473367124005400, "line_mean": 41.4444444444, "line_max": 79, "alpha_frac": 0.705061082, "autogenerated": false, "ratio": 3.5045871559633026, "config_test": false, "has...
### Bandit algorithms """Bandit algorithms An algorithm receives a list of lists of pull outcomes and returns the index of the next arm to pull.""" from math import sqrt from random import random, randrange, betavariate # def mean(a): # return (float(a.count(1)) / len(a)) if len(a) > 0 else 0.0 def maxIndex(a)...
{ "repo_name": "aijunbai/bandit", "path": "python/algorithms.py", "copies": "1", "size": "1980", "license": "bsd-2-clause", "hash": -2303123702005325300, "line_mean": 26.1232876712, "line_max": 104, "alpha_frac": 0.5626262626, "autogenerated": false, "ratio": 3.272727272727273, "config_test": fa...
# Bandit complains about security issues with lxml. # These issues have been addressed in the past and do not apply to parsing HTML. from lxml.html import html5parser, tostring # nosec B410 from lxml.html.clean import Cleaner # nosec B410 from lxml.html.defs import safe_attrs # nosec B410 cleaner = Cleaner( com...
{ "repo_name": "isislab/CTFd", "path": "CTFd/utils/security/sanitize.py", "copies": "2", "size": "1661", "license": "apache-2.0", "hash": 2155273447481610800, "line_mean": 27.6379310345, "line_max": 80, "alpha_frac": 0.4882600843, "autogenerated": false, "ratio": 4.382585751978892, "config_test"...
''' BanditMDPClass.py: Contains the BanditMDPClass class. ''' # Python imports. from __future__ import print_function from collections import defaultdict import numpy as np # Other imports. from simple_rl.mdp.MDPClass import MDP from simple_rl.mdp.StateClass import State class BanditMDP(MDP): ''' Imeplementation...
{ "repo_name": "david-abel/simple_rl", "path": "simple_rl/tasks/bandit/BanditMDPClass.py", "copies": "1", "size": "3038", "license": "apache-2.0", "hash": -49023773976975680, "line_mean": 30.6458333333, "line_max": 119, "alpha_frac": 0.5806451613, "autogenerated": false, "ratio": 3.826196473551637...
"""Bandit security warnings collector.""" from base_collectors import JSONFileSourceCollector from source_model import Entities, Entity, SourceResponses class BanditSecurityWarnings(JSONFileSourceCollector): """Bandit collector for security warnings.""" async def _parse_entities(self, responses: SourceRespo...
{ "repo_name": "ICTU/quality-time", "path": "components/collector/src/source_collectors/bandit/security_warnings.py", "copies": "1", "size": "1435", "license": "apache-2.0", "hash": -3563236181421759000, "line_mean": 45.2903225806, "line_max": 99, "alpha_frac": 0.5728222997, "autogenerated": false, ...
"""Bandit testing plugin""" from __future__ import absolute_import, division, print_function, with_statement, unicode_literals from tornado import escape, util from .actions import * from .middleware import * import re ACTIVE_EXPERIMENTS_REDIS_KEY = "bandit:listing:active:v2" ARCHIVED_EXPERIMENTS_REDIS_KEY = "bandi...
{ "repo_name": "dailymuse/oz", "path": "oz/bandit/__init__.py", "copies": "1", "size": "11291", "license": "bsd-3-clause", "hash": -8122884087049931000, "line_mean": 36.3874172185, "line_max": 119, "alpha_frac": 0.6676113719, "autogenerated": false, "ratio": 3.774991641591441, "config_test": fal...
"""Bandpass filter the positions, then snap to as few shots as possible.""" from typing import Any, List, Optional, Tuple import funcy as fn import numpy as np import pandas as pd import scipy.signal as sig import scipy.stats as stats from mvz import const from mvz.methods import shared from mvz.methods.shared import...
{ "repo_name": "cjfuller/mobile_video_zoom", "path": "mvz/methods/bandpass_and_snapping.py", "copies": "2", "size": "7180", "license": "mit", "hash": -6525877632338033000, "line_mean": 34.5445544554, "line_max": 84, "alpha_frac": 0.572005571, "autogenerated": false, "ratio": 3.493917274939173, "...
__author__ = "Taylor Oshan" import numpy as np from scipy import linalg from copy import deepcopy import copy from collections import namedtuple def golden_section(a, c, delta, function, tol, max_iter, int_score=False): """ Golden section search routine Method: p212, 9.6.4 Fotheringham, A. S., Brunsd...
{ "repo_name": "lixun910/pysal", "path": "pysal/model/mgwr/search.py", "copies": "1", "size": "7203", "license": "bsd-3-clause", "hash": 5759693059071178000, "line_mean": 28.0443548387, "line_max": 88, "alpha_frac": 0.4847980008, "autogenerated": false, "ratio": 3.6843989769820973, "config_test"...
__author__ = "Taylor Oshan" import numpy as np def golden_section(a, c, delta, function, tol, max_iter, int_score=False): """ Golden section search routine Method: p212, 9.6.4 Fotheringham, A. S., Brunsdon, C., & Charlton, M. (2002). Geographically weighted regression: the analysis of spatially v...
{ "repo_name": "ljwolf/pysal", "path": "pysal/contrib/gwr/search.py", "copies": "1", "size": "3944", "license": "bsd-3-clause", "hash": -1280159909838231800, "line_mean": 26.5804195804, "line_max": 88, "alpha_frac": 0.4830121704, "autogenerated": false, "ratio": 4.209178228388474, "config_test":...
""" Banjo game loop. A game loop may be seen as a function ``f: W_i -> W_i+1`` that updates the World (W_i) from time t_i to time t_i+1. The World at t_i may be broken down into: * a screen to display images on (D_i) * speakers to play music via (M_i) * the game state (G_i) * the current scene within the gam...
{ "repo_name": "hodgestar/banjo", "path": "ngn/engine.py", "copies": "1", "size": "2273", "license": "mit", "hash": -643572013079223800, "line_mean": 26.0595238095, "line_max": 76, "alpha_frac": 0.5763308403, "autogenerated": false, "ratio": 3.251788268955651, "config_test": false, "has_no_key...
# Bankheist.py was created by Redjumpman for Redbot # This will create a system.JSON file and a data folder # This will modify values your bank.json from economy.py import os import asyncio import random import time import discord from operator import itemgetter from discord.ext import commands from .utils...
{ "repo_name": "GitAcrown/IssouSystem", "path": "IssouBot/cogs/payday.py", "copies": "1", "size": "47114", "license": "mit", "hash": 1826452195768289500, "line_mean": 55.25, "line_max": 184, "alpha_frac": 0.4880604963, "autogenerated": false, "ratio": 3.8432255423659436, "config_test": true, "...
# Banking Simulator - Johnathon Kwisses (Kwistech) from account import Account from general_functions import menu_help, save def main(): """Runs program with account.py and general_functions.py. When the program starts, it asks the user for a username and a password. This will be the account the user will us...
{ "repo_name": "Kwistech/BankingSimulator", "path": "main.py", "copies": "1", "size": "1413", "license": "mit", "hash": -8419638703098866000, "line_mean": 29.7173913043, "line_max": 119, "alpha_frac": 0.5626326964, "autogenerated": false, "ratio": 4.060344827586207, "config_test": false, "has_...
# bank/models.py from django.db import models from django.db.models import Q from django.core.urlresolvers import reverse class Account(models.Model): name = models.CharField('Account Name', max_length=127) slug = models.SlugField(max_length=50, unique=True, blank=True) balance = models.IntegerField('Balan...
{ "repo_name": "SteveWaweru/djangocon2013-otwcbv", "path": "bank/models.py", "copies": "2", "size": "1437", "license": "bsd-2-clause", "hash": 6469481678854971000, "line_mean": 35.8461538462, "line_max": 78, "alpha_frac": 0.6026443981, "autogenerated": false, "ratio": 4.129310344827586, "config_...
'''Bank module contains bank class and pre-made Bank-object for Osuuspankki.''' class Bank(): """ Bank class contains urls and BIC for the banks Web service.""" def __init__(self, BIC, url, test_url=None, id_url=None, id_test_url=None): """ Initializes Bank class. @type BIC: string @...
{ "repo_name": "luojus/bankws", "path": "bankws/bank.py", "copies": "1", "size": "1240", "license": "mit", "hash": -3190261900349369000, "line_mean": 39, "line_max": 79, "alpha_frac": 0.6266129032, "autogenerated": false, "ratio": 3.3604336043360434, "config_test": true, "has_no_keywords": fal...
# Bank of Kekisan Transaction System v2.2.3 # Made by @Georgegreece #This bank is fictional if it wasn't obvious. #Return Codes: #0 = Success #1 = Not a Number #2 = Number Bellow Zero #3 = Not Enough Money #4 = Account Not Found #5 = Account Equals Current Account #6 = Account number not a number #7 ...
{ "repo_name": "georgegreece/banking-system", "path": "Bank.py", "copies": "1", "size": "6582", "license": "mit", "hash": 4574048000434621000, "line_mean": 27.3706896552, "line_max": 141, "alpha_frac": 0.597234883, "autogenerated": false, "ratio": 3.687394957983193, "config_test": false, "has_...
"""Bank.py Defines the bank class. """ import math from balance import BalanceSheet from settings import * from statistics import Statistics class Bank(object): """ Defines a bank. bank_size specifies the balance sheet size of the bank in dollars. """ def __init__(self, bank_size): self.b...
{ "repo_name": "1Reinier/CapstoneThesis", "path": "bank.py", "copies": "1", "size": "1414", "license": "mit", "hash": 1482719228794450000, "line_mean": 31.1590909091, "line_max": 108, "alpha_frac": 0.6499292786, "autogenerated": false, "ratio": 3.811320754716981, "config_test": false, "has_no_...
""" Banks' header configurations. Stored in a dictionary where the keys are bank names in lowercase and only alpha-characters. A bank's header should include "date" and "amount", otherwise it cannot be parsed since YNAB requires these two fields. """ from collections import namedtuple Bank = namedtuple('Bank', ['name'...
{ "repo_name": "adnilsson/Bank2YNAB", "path": "banks.py", "copies": "1", "size": "1210", "license": "mit", "hash": 6959957199656392000, "line_mean": 39.3666666667, "line_max": 96, "alpha_frac": 0.7, "autogenerated": false, "ratio": 3.1758530183727034, "config_test": false, "has_no_keywords": f...
"""bankstatements.py Contains metadata for parsing input files """ from time import strftime, strptime import hashlib #2017-04-21 13:21 Market # Assets:Bitstamp 10 BTC @@ $5000.00 # Assets:Bitstamp #2017-04-21 14:21 Deposit # Assets:Bitstamp 10 BTC # Equity:Unspecified def bits...
{ "repo_name": "bartbroere/toledger", "path": "toledger/bankstatements.py", "copies": "1", "size": "4555", "license": "mit", "hash": -4242930965549582300, "line_mean": 40.036036036, "line_max": 75, "alpha_frac": 0.4381997805, "autogenerated": false, "ratio": 4.114724480578139, "config_test": fal...
# bank/views.py from django.shortcuts import get_object_or_404 from django.views.generic import ListView, CreateView from .models import Account, Transaction from .forms import TransferFormFrom, TransferFormTo class AccountList(ListView): model = Account def get_context_data(self, **kwargs): context =...
{ "repo_name": "SteveWaweru/djangocon2013-otwcbv", "path": "bank/views.py", "copies": "2", "size": "2599", "license": "bsd-2-clause", "hash": 4709157515286356000, "line_mean": 39.609375, "line_max": 76, "alpha_frac": 0.5909965371, "autogenerated": false, "ratio": 4.171749598715891, "config_test"...
"""Ban logic for HTTP component.""" from collections import defaultdict from datetime import datetime from ipaddress import ip_address import logging from aiohttp.web import middleware from aiohttp.web_exceptions import HTTPForbidden, HTTPUnauthorized import voluptuous as vol from homeassistant.config import load_yam...
{ "repo_name": "aequitas/home-assistant", "path": "homeassistant/components/http/ban.py", "copies": "2", "size": "5938", "license": "apache-2.0", "hash": 4337503908409876000, "line_mean": 31.4480874317, "line_max": 78, "alpha_frac": 0.6588076794, "autogenerated": false, "ratio": 3.5987878787878786...
"""Ban logic for HTTP component.""" import asyncio from collections import defaultdict from datetime import datetime from ipaddress import ip_address import logging import os from aiohttp.web_exceptions import HTTPForbidden, HTTPUnauthorized import voluptuous as vol from homeassistant.components import persistent_not...
{ "repo_name": "stefan-jonasson/home-assistant", "path": "homeassistant/components/http/ban.py", "copies": "8", "size": "4392", "license": "mit", "hash": -4363496550693396000, "line_mean": 29.2896551724, "line_max": 75, "alpha_frac": 0.6393442623, "autogenerated": false, "ratio": 3.505187549880287...
"""Ban logic for HTTP component.""" import asyncio from collections import defaultdict from datetime import datetime from ipaddress import ip_address import logging import os from aiohttp.web import middleware from aiohttp.web_exceptions import HTTPForbidden, HTTPUnauthorized import voluptuous as vol from homeassista...
{ "repo_name": "ewandor/home-assistant", "path": "homeassistant/components/http/ban.py", "copies": "5", "size": "4349", "license": "apache-2.0", "hash": -1031625896510536700, "line_mean": 29.4125874126, "line_max": 75, "alpha_frac": 0.6493446769, "autogenerated": false, "ratio": 3.4681020733652312...
"""Ban logic for HTTP component.""" import asyncio from collections import defaultdict from datetime import datetime from ipaddress import ip_address import logging from aiohttp.web_exceptions import HTTPForbidden import voluptuous as vol from homeassistant.components import persistent_notification from homeassistant...
{ "repo_name": "florianholzapfel/home-assistant", "path": "homeassistant/components/http/ban.py", "copies": "11", "size": "3968", "license": "mit", "hash": 580426526682275100, "line_mean": 29.0606060606, "line_max": 74, "alpha_frac": 0.6368447581, "autogenerated": false, "ratio": 3.459459459459459...
""" Ban model """ import datetime from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, Boolean from sqlalchemy import or_ from sqlalchemy.orm import relationship from smserver.models import schema __all__ = ['Ban'] class Ban(schema.Base): __tablename__ = 'bans' id = Column(Integer...
{ "repo_name": "ningirsu/stepmania-server", "path": "smserver/models/ban.py", "copies": "1", "size": "2787", "license": "mit", "hash": 5580927466037094000, "line_mean": 30.3146067416, "line_max": 91, "alpha_frac": 0.5905992106, "autogenerated": false, "ratio": 3.536802030456853, "config_test": f...
"""banned_users table Revision ID: 1c8ee76214e4 Revises: 2dff97787d0d Create Date: 2015-04-10 17:15:55.345467 """ # revision identifiers, used by Alembic. revision = '1c8ee76214e4' down_revision = '2dff97787d0d' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa import sqlalchemy_...
{ "repo_name": "universalcore/unicore.comments", "path": "unicore/comments/service/alembic/versions/1c8ee76214e4_banned_users_table.py", "copies": "1", "size": "1377", "license": "bsd-2-clause", "hash": -2847007946371652000, "line_mean": 33.425, "line_max": 102, "alpha_frac": 0.7000726216, "autogene...
"""Banneret main entry point.""" import logging import sys import click from banneret import Banneret from banneret.main import docker_api, PWD, DESKTOP from banneret.version import __version__ LINUX = {'linux', 'linux2'} MACOS = {'darwin'} PLATFORMS = LINUX | MACOS @click.group() @click.version_option(version=__...
{ "repo_name": "lancelote/banneret", "path": "banneret/cli.py", "copies": "1", "size": "3998", "license": "mit", "hash": -1095338105382719600, "line_mean": 32.3166666667, "line_max": 77, "alpha_frac": 0.6408204102, "autogenerated": false, "ratio": 3.657822506861848, "config_test": false, "has_...
# Banner to display to user which program they are using print('------------------------------------------------') print('Mount Everest Motor Racing Circuit (MEMRC)') print('------------------------------------------------') # Variables containing the price for each category of ticket general_admission = 90 reserved_g...
{ "repo_name": "delbs/scripts", "path": "Uni_python/assA1.py", "copies": "1", "size": "2014", "license": "apache-2.0", "hash": 9049328107499793000, "line_mean": 36.3148148148, "line_max": 115, "alpha_frac": 0.7179741807, "autogenerated": false, "ratio": 3.6618181818181816, "config_test": false, ...
"""baraja.card this module contains classes and functions for working with individual cards """ import copy from baraja import exceptions as ex class Card(object): """a single immutable card""" def __init__(self, name, value=None): """ Keyword arguments: name -- name of the ...
{ "repo_name": "elmiko/baraja", "path": "baraja/card.py", "copies": "1", "size": "2690", "license": "mit", "hash": -179831027900183700, "line_mean": 26.1717171717, "line_max": 78, "alpha_frac": 0.5513011152, "autogenerated": false, "ratio": 3.6155913978494625, "config_test": false, "has_no_key...
"""baraja.deck the deck module contains classes and functions for representing card decks. """ from copy import copy import random from baraja import card class Deck(object): """a deck of cards This object is a stateful representation of a deck of cards. In all card sequences returned from a Deck, it...
{ "repo_name": "elmiko/baraja", "path": "baraja/deck.py", "copies": "1", "size": "1999", "license": "mit", "hash": -1772348070069130500, "line_mean": 24.961038961, "line_max": 78, "alpha_frac": 0.6028014007, "autogenerated": false, "ratio": 3.866537717601547, "config_test": false, "has_no_keyw...
""" barbell_capilar script. """ from common import info import dolfin as df import mshr import os from generate_mesh import MESHES_DIR, store_mesh_HDF5 import matplotlib.pyplot as plt def description(**kwargs): info("Generates mesh for a barbell capillary.") def method(res=50, diameter=1., length=5., show=False...
{ "repo_name": "gautelinga/BERNAISE", "path": "utilities/mesh_scripts/barbell_capillary.py", "copies": "1", "size": "1501", "license": "mit", "hash": -8366969984766050000, "line_mean": 30.2708333333, "line_max": 77, "alpha_frac": 0.6415722851, "autogenerated": false, "ratio": 3.082135523613963, ...
''' Barbs Class ''' import sharppy.sharptab as tab __all__ = ['Barb'] class Barb(object): def __init__(self, canvas, x, y, dir, spd, **kwargs): self.gCanvas = canvas # Canvas to draw upon self.centerx = x # Location to draw self.c...
{ "repo_name": "okjohn/SHARPpy", "path": "sharppy/drawing/barbs.py", "copies": "2", "size": "2795", "license": "bsd-3-clause", "hash": -3848904498412854000, "line_mean": 33.5061728395, "line_max": 92, "alpha_frac": 0.4636851521, "autogenerated": false, "ratio": 3.2651869158878504, "config_test":...
"""Barc - a command-line client to complement 'arcyd'. Essentially a prescriptive tool for supporting arcyd's branch-based workflow. """ # ============================================================================= # CONTENTS # ----------------------------------------------------------------------------- # barcmd_b...
{ "repo_name": "aevri/phabricator-tools", "path": "py/bar/barcmd_barc.py", "copies": "4", "size": "2252", "license": "apache-2.0", "hash": -6582961375133508000, "line_mean": 29.0266666667, "line_max": 79, "alpha_frac": 0.5661634103, "autogenerated": false, "ratio": 4.504, "config_test": false, ...
""" Bar Chart Legend test This tests plots a simple bar chart. Bar charts are plotted as rectangle patches witch are difficult to tell from other rectangle patches that should not be plotted in PGFPlots (e.g. axis, legend) This also tests legends on barcharts. Which are difficult because in PGFPlots, they have no \\a...
{ "repo_name": "m-rossi/matplotlib2tikz", "path": "test/test_barchart_legend.py", "copies": "1", "size": "1061", "license": "mit", "hash": -2914820857313239600, "line_mean": 24.2619047619, "line_max": 67, "alpha_frac": 0.6465598492, "autogenerated": false, "ratio": 3.148367952522255, "config_tes...
# barcode can be used to connect images with their IDs import numpy as np import cv2 # barcode setting BIT_SIZE_BARCODE = 32 BIT_SIZE_SCENE_ID = 14 BIT_SIZE_FRAME_ID = 18 CELL_SIZE = 4 OFFSET_X = 10 OFFSET_Y = 10 # read barcode def read_barcode(infile): img = cv2.imread(infile, cv2.IMREAD_COLOR) w = img.shap...
{ "repo_name": "WeihanSun/python_sample", "path": "work/barcode/barcode.py", "copies": "1", "size": "1768", "license": "apache-2.0", "hash": 8899095855659136000, "line_mean": 28.9661016949, "line_max": 72, "alpha_frac": 0.5588235294, "autogenerated": false, "ratio": 2.7075038284839206, "config_t...
# Barcode Example # # This example shows off how easy it is to detect bar codes using the # OpenMV Cam M7. Barcode detection does not work on the M4 Camera. import sensor, image, time, math sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) # High Res! sensor.set_windowing((640, 80...
{ "repo_name": "openmv/openmv", "path": "scripts/examples/Arduino/Portenta-H7/16-Codes/find_barcodes.py", "copies": "2", "size": "2234", "license": "mit", "hash": 968300272234345700, "line_mean": 33.90625, "line_max": 121, "alpha_frac": 0.6266786034, "autogenerated": false, "ratio": 3.177809388335...
# barcodes.py # # barcode lookup file should look like # #Barcode_name P7_barcode P5_barcode # Alpha1 TAAGGCGA TAGATCGC # Alpha2 TAAGGCGA CTCTCTAT # Alpha3 TAAGGCGA TATCCTCT # Alpha4 TAAGGCGA AGAGTAGA # """ barcodes.py parses and stores barcode information associated with a double barcoded illumina amplicon proje...
{ "repo_name": "msettles/genAmplicons", "path": "genAmplicons/barcodes.py", "copies": "1", "size": "3180", "license": "apache-2.0", "hash": -9195598957147287000, "line_mean": 30.8, "line_max": 135, "alpha_frac": 0.5308176101, "autogenerated": false, "ratio": 3.835946924004825, "config_test": fal...
"""Bardemir World API implemented using Google Cloud Endpoints. Defined here are the ProtoRPC messages needed to define Schemas for methods as well as those methods defined in an API. """ import pprint import endpoints from properties.properties import Properties from bardemir_producer import BardemirProducer from ...
{ "repo_name": "ademirao/bardemir", "path": "api.py", "copies": "1", "size": "5231", "license": "apache-2.0", "hash": 7518489604731626000, "line_mean": 37.4632352941, "line_max": 98, "alpha_frac": 0.6815140509, "autogenerated": false, "ratio": 3.8519882179675995, "config_test": false, "has_no_...
"""Barebones Python API Wrapper implementation around RCSB Search API. This file contains Python dataclasses that formalize the API within native Python objects. This aims to completely implement the Search API in Python. For RCSB API docs, see: https://search.rcsb.org/index.html """ # TODO(lacoperon): Implement req...
{ "repo_name": "williamgilpin/pypdb", "path": "pypdb/clients/search/search_client.py", "copies": "1", "size": "12221", "license": "mit", "hash": -6811133682238775000, "line_mean": 36.4877300613, "line_max": 80, "alpha_frac": 0.6749856804, "autogenerated": false, "ratio": 4.096882333221589, "conf...
# Barebones timer, mouse, and keyboard events from tkinter import * import random from tkinter import font import numpy as np from PIL import * import copy import math import pickle # Organize into different Modes # add animations for bug splat # add animations for bug hit # add randomized bug generation # add t...
{ "repo_name": "cinnamonli/15-112-Term-Project", "path": "Drawer_component.py", "copies": "1", "size": "10356", "license": "mit", "hash": -1175085105962406400, "line_mean": 27.6077348066, "line_max": 83, "alpha_frac": 0.5905755118, "autogenerated": false, "ratio": 3.2648171500630516, "config_tes...
# Barebones timer, mouse, and keyboard events from tkinter import * import random from tkinter import font import numpy as np from PIL import * import copy import math import tkinter import time from sklearn import * import pickle # Organize into different Modes # add animations for bug splat # add animations for ...
{ "repo_name": "cinnamonli/15-112-Term-Project", "path": "ML_component.py", "copies": "1", "size": "11873", "license": "mit", "hash": -1186348215200712200, "line_mean": 28.5348258706, "line_max": 96, "alpha_frac": 0.5980796766, "autogenerated": false, "ratio": 3.2880088618111327, "config_test": ...
"""Bare bones utility script to take an input file or list of input files and plot ROC curves for each one on a single figure. Usage: cat roc_file | plot_roc_curves.py OR plot_roc_curves.py *_roc_file Right now the input files are assumed to be CSV data, with the first column the correctness on an exercise, a...
{ "repo_name": "bkimo/guacamole", "path": "train_util/roc_curve_util.py", "copies": "1", "size": "3693", "license": "mit", "hash": 3544583056133050000, "line_mean": 29.775, "line_max": 78, "alpha_frac": 0.6257784999, "autogenerated": false, "ratio": 3.6709741550695827, "config_test": false, "h...
BARECTF_CTX = """struct {prefix}{sid}_ctx {{ /* output buffer (will contain a CTF binary packet) */ uint8_t* buf; /* buffer size in bits */ uint32_t packet_size; /* current position from beginning of buffer in bits */ uint32_t at; /* clock value callback */ {clock_cb} /* packet header + context size */ uin...
{ "repo_name": "jgalar/barectf", "path": "barectf/templates.py", "copies": "1", "size": "10379", "license": "mit", "hash": 5524439116940650000, "line_mean": 30.8374233129, "line_max": 80, "alpha_frac": 0.5518836111, "autogenerated": false, "ratio": 2.65651394932173, "config_test": false, "has_...
""" Bare metal example for open risc. Run the result with qemu-system-or1k: $ qemu-system-or1k -kernel baremetal.bin -M or1k-sim -serial stdio """ import logging import io from ppci import api from ppci.utils.reporting import HtmlReportGenerator from ppci.utils.uboot_image import write_uboot_image logging.basicCon...
{ "repo_name": "windelbouwman/ppci-mirror", "path": "examples/or1k/baremetal/makebare.py", "copies": "1", "size": "1762", "license": "bsd-2-clause", "hash": 5869395745400364000, "line_mean": 14.8738738739, "line_max": 66, "alpha_frac": 0.6713961407, "autogenerated": false, "ratio": 2.4005449591280...
""" Bare minimum workflow to test a classifier architecture """ from __future__ import print_function, division import numpy as np import tensorflow as tf # TODO: Use argument scoping tf_graph = tf.Graph() with tf_graph.as_default(): n_classes = 2 input_rows,input_cols = [128,128] n_channels = 3 # Init...
{ "repo_name": "ronrest/convenience_py", "path": "ml/tf/workflow_basic_image_classifier.py", "copies": "1", "size": "3687", "license": "apache-2.0", "hash": -7679189168539354000, "line_mean": 40.8977272727, "line_max": 139, "alpha_frac": 0.6300515324, "autogenerated": false, "ratio": 3.41705282669...
# Bare ``settings.py`` for running tests for mezzanine_api from __future__ import absolute_import, unicode_literals import os from django import VERSION as DJANGO_VERSION from django.utils.translation import ugettext_lazy as _ DEBUG = True ROOT_URLCONF = 'tests.urls' SECRET_KEY = '12345' USE_SOUTH = True ADMINS ...
{ "repo_name": "gcushen/mezzanine-api", "path": "tests/settings.py", "copies": "1", "size": "5094", "license": "mit", "hash": -9111453598502017000, "line_mean": 25.8105263158, "line_max": 76, "alpha_frac": 0.6474283471, "autogenerated": false, "ratio": 3.597457627118644, "config_test": false, ...
# bar graph plotted from dict rows; color-coded bars; multi-line legend entries import svgdatashapes as s def example1(): dataset = [] # create a data set for this self-contained example... dataset.append( { 'state':'Ohio', 'avg':12, 'sem':3.4 , 'new':True} ) dataset.append( { 'state':...
{ "repo_name": "grubbcode/minplot", "path": "examples/e1.py", "copies": "2", "size": "2504", "license": "mit", "hash": -2622280811327086600, "line_mean": 46.2452830189, "line_max": 95, "alpha_frac": 0.6018370607, "autogenerated": false, "ratio": 2.977407847800238, "config_test": false, "has_no...
"""Baristas (a worker) serve coffee""" from __future__ import absolute_import # standard library # import time # local library import lib import peer # import service def divide(x, y): return x / y def take_order(order): print "Taking order" # order = service.order_coffee(order) # # Store order ...
{ "repo_name": "abstractfactory/labs", "path": "python/messaging/chat/cli/barista.py", "copies": "1", "size": "1451", "license": "mit", "hash": -8645172847423440000, "line_mean": 17.6025641026, "line_max": 56, "alpha_frac": 0.5713301172, "autogenerated": false, "ratio": 3.710997442455243, "confi...
"""Bark Usage: bark new <name> bark make [<settings>] Options: -h --help Show this screen. --version Show version. """ __author__ = 'Casey Weed' __version__ = '1.3.4' from docopt import docopt import json import errno import shutil from hoedown import Markdown, HtmlRenderer, SmartyPants from dateti...
{ "repo_name": "Battleroid/bark", "path": "bark/bark.py", "copies": "1", "size": "8904", "license": "mit", "hash": 7803623060923923000, "line_mean": 30.6868327402, "line_max": 150, "alpha_frac": 0.570754717, "autogenerated": false, "ratio": 3.7986348122866893, "config_test": false, "has_no_key...
#Barnaby Skinner #2016/05/25 #Homework 2 #LISTS #1) Make a list of the following numbers: 22, 90, 0, -10, 3, 22, and 48 #1) Display the number of elements in the list random_numbers = [22, 90, 0, -10, 3, 22, 48] print(len(random_numbers)) #2) Display the 4th element of this list. print(random_numbers[3]) #3) Displa...
{ "repo_name": "barjacks/foundations-homework", "path": "02/homework-2-skinner.py", "copies": "1", "size": "3230", "license": "mit", "hash": -1972040365557025500, "line_mean": 36.1264367816, "line_max": 80, "alpha_frac": 0.6978328173, "autogenerated": false, "ratio": 3.061611374407583, "config_t...
#Barnaby Skinner #2016-05-30 #Homework 3 #LISTS #1) Make a list called "countries" - it should contain seven different #countries and NOT be in alphabetical order countries = ["Switzerland", "Germany", "United Kingdom", "France", "Italy", "Liechstenstein"] #2) Using a for loop, print each element of the list for cou...
{ "repo_name": "barjacks/foundations-homework", "path": "03/homework-3-skinner.py", "copies": "1", "size": "4520", "license": "mit", "hash": -7904604007834051000, "line_mean": 40.8333333333, "line_max": 115, "alpha_frac": 0.6733067729, "autogenerated": false, "ratio": 3.079754601226994, "config_...
"""Barnapy package definition and install configuration""" # Copyright (c) 2017, 2019 Aubrey Barnard. # # This is free software released under the MIT license. See `LICENSE` # for details. import setuptools import barnapy # Extract the short and long descriptions from the documentation _desc_paragraphs = barnapy...
{ "repo_name": "afbarnard/barnapy", "path": "setup.py", "copies": "1", "size": "1739", "license": "mit", "hash": -6854514317185945000, "line_mean": 27.0483870968, "line_max": 71, "alpha_frac": 0.6578493387, "autogenerated": false, "ratio": 4.053613053613054, "config_test": false, "has_no_keywo...
#Barney Skinner #05/23/2016 #"Homework 1" year_of_birth = input("Which year were you born in, if I may ask? ") if int(year_of_birth) > 2016: print("That was in the future, you can do better than that.") year_of_birth = input("Try again. Which year were you born in?") age = 2016 - int(year_of_birth) heartbeat_pe...
{ "repo_name": "barjacks/foundations-homework", "path": "01/homework-1-skinner.py", "copies": "1", "size": "4000", "license": "mit", "hash": 9139064372718513000, "line_mean": 34.7142857143, "line_max": 136, "alpha_frac": 0.71625, "autogenerated": false, "ratio": 2.8368794326241136, "config_test"...
# bar - provides Bar for visually displaying percentages and loads from math import modf # alternate bar progressions # bars = [" ", " ", " ", "|", "|", "|", "|", "█", "█"] # bars = [" ", " ", " ", " ", "|", "|", "|", "|", "|"] bars = [" ", " ", " ", " ", "█", "█", "█", "█", "█"] class Bar: def __init__(self,...
{ "repo_name": "mmoran0032/WienFilter", "path": "include/bar.py", "copies": "1", "size": "1341", "license": "mit", "hash": -4123691500846579700, "line_mean": 26.6458333333, "line_max": 79, "alpha_frac": 0.4913338357, "autogenerated": false, "ratio": 3.6059782608695654, "config_test": false, "h...
"""bar.py test script for drawing a bar readout """ __author__ = "Robert Jennings rcj@linux.vnet.ibm.com" __copyright__ = "Copyright (c) 2008 IBM Corporation" __license__ = "Common Public License v1.0" import gtk import cairo import math class AMSWidget(gtk.DrawingArea): """Memory metrics widget based on a gtk....
{ "repo_name": "nfont/powerpc-utils-python", "path": "scripts/amsvis/powerpcAMS/amswidget.py", "copies": "1", "size": "33358", "license": "epl-1.0", "hash": -5320349979196026000, "line_mean": 37.3425287356, "line_max": 80, "alpha_frac": 0.5039570718, "autogenerated": false, "ratio": 3.881996974281...
# Barrett Sonntag # 2011 import urllib2 import csv import time import sys from BeautifulSoup import BeautifulSoup csvFile = csv.writer(open('ckdata-'+str(time.time()).replace('.','')+'.csv', 'wb'), delimiter=',') csvCategory0 = '' csvCategory1 = '' csvCategory2 = '' csvBrand = '' mainPage = urllib2.urlopen('url') m...
{ "repo_name": "barretts/CKData", "path": "ckdata.py", "copies": "1", "size": "5074", "license": "mit", "hash": 8628075119370658000, "line_mean": 42.7413793103, "line_max": 254, "alpha_frac": 0.5364603863, "autogenerated": false, "ratio": 3.849772382397572, "config_test": false, "has_no_keywor...
# Now uses Event rather than polling. try: import uasyncio as asyncio except ImportError: import asyncio from . import launch # A Barrier synchronises N coros. Each issues await barrier. # Execution pauses until all other participant coros are waiting on it. # At that point the callback is executed. Then th...
{ "repo_name": "peterhinch/micropython-async", "path": "v3/primitives/barrier.py", "copies": "1", "size": "1588", "license": "mit", "hash": 1589832730699341000, "line_mean": 28.9622641509, "line_max": 74, "alpha_frac": 0.6246851385, "autogenerated": false, "ratio": 4.189973614775726, "config_tes...
# barrowed from pyre import random import zmq import threading import binascii import os import sys from . import zsocket if sys.version.startswith('3'): u = str else: u = unicode # -------------------------------------------------------------------------- # Create a pipe, which consists of two PAIR sockets...
{ "repo_name": "csirtgadgets/bearded-avenger-sdk-py", "path": "cifsdk/utils/zhelper.py", "copies": "1", "size": "2088", "license": "mpl-2.0", "hash": -4686685245804887000, "line_mean": 28.8428571429, "line_max": 81, "alpha_frac": 0.6326628352, "autogenerated": false, "ratio": 3.378640776699029, ...
'''Barst FTDI Wrapper ===================== ''' from pybarst.ftdi import FTDIChannel from pybarst.ftdi.switch import SerializerSettings, PinSettings from pybarst.ftdi.adc import ADCSettings from kivy.properties import NumericProperty, DictProperty, StringProperty, \ ListProperty, ObjectProperty, BooleanPro...
{ "repo_name": "matham/cplcom", "path": "cplcom/moa/device/ftdi.py", "copies": "1", "size": "21337", "license": "mit", "hash": -8673868181048496000, "line_mean": 34.5986277873, "line_max": 79, "alpha_frac": 0.6122697661, "autogenerated": false, "ratio": 3.875227025063567, "config_test": false, ...
"""`BarStimulus`, `GratingStimulus`""" import numpy as np from .videos import VideoStimulus from ..utils import radial_mask class GratingStimulus(VideoStimulus): """Drifting sinusoidal grating A drifting sinusoidal grating of a given spatial and temporal frequency. .. versionadded:: 0.7 Parameter...
{ "repo_name": "mbeyeler/pulse2percept", "path": "pulse2percept/stimuli/psychophysics.py", "copies": "1", "size": "8942", "license": "bsd-3-clause", "hash": 5948278300848093000, "line_mean": 39.0986547085, "line_max": 79, "alpha_frac": 0.5691120555, "autogenerated": false, "ratio": 4.0682438580527...