text stringlengths 0 1.05M | meta dict |
|---|---|
"""Main executable."""
import os
import sys
import copy
import Common
from common import Log
from common import Config
from common import Resource
from common import Library
from common import Project
from common import OrderedDict
from common import Task
from common import Console
import Parser
import Generator
impo... | {
"repo_name": "skyostil/tracy",
"path": "src/generator/TracyGenerator.py",
"copies": "1",
"size": "7777",
"license": "mit",
"hash": 3364785744640759000,
"line_mean": 28.5703422053,
"line_max": 107,
"alpha_frac": 0.6781535296,
"autogenerated": false,
"ratio": 3.8047945205479454,
"config_test": t... |
"""bin_signal_maps_agave.py
This version of the script has hard-coding to facilitate
parallelization on Agave cluster.
"""
import os
import itertools
import argparse
from datetime import datetime
import numpy as np
import xarray as xr
import dask
from dask.distributed import Client, LocalCluster
FILTER_TRIM_PIX = ... | {
"repo_name": "piyanatk/sim",
"path": "scripts/fg1p/bin_signal_maps_agave.py",
"copies": "1",
"size": "5164",
"license": "mit",
"hash": -3063285399801807400,
"line_mean": 33.1986754967,
"line_max": 80,
"alpha_frac": 0.601859024,
"autogenerated": false,
"ratio": 3.3251770766258852,
"config_test"... |
# Copyright (c) 2012, Albert Zeyer, www.az2000.de
# All rights reserved.
# file created 2012-06-10
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyrigh... | {
"repo_name": "kingsj/music-player",
"path": "binstruct.py",
"copies": "1",
"size": "13260",
"license": "bsd-2-clause",
"hash": 4354104917508197400,
"line_mean": 29.2739726027,
"line_max": 85,
"alpha_frac": 0.6983408748,
"autogenerated": false,
"ratio": 2.9329794293297944,
"config_test": false,... |
#!/bin/tcsh
import os.path
import sys
from optparse import OptionParser
from itertools import *
def main():
global OPTIONS
usage = "usage: %prog [options] mode hg19Tohg18.chain"
parser = OptionParser(usage=usage)
# parser.add_option("-D", "--delete_while_archiving", dest="reallyDeleteInArchiveMode... | {
"repo_name": "iontorrent/Torrent-Variant-Caller-stable",
"path": "public/chainFiles/makeChains.py",
"copies": "2",
"size": "1510",
"license": "mit",
"hash": 4173096434361623000,
"line_mean": 29.2,
"line_max": 105,
"alpha_frac": 0.5860927152,
"autogenerated": false,
"ratio": 3.2264957264957266,
... |
"""bintovolume.py
"""
__license__ = "Apache License, Version 2.0"
__author__ = "Roland Kwitt, Kitware Inc., 2013"
__email__ = "E-Mail: roland.kwitt@kitware.com"
__status__ = "Development"
from optparse import OptionParser
import SimpleITK as sitk
import numpy as np
import sys
def usage():
"""Print usage i... | {
"repo_name": "KitwareMedical/TubeTK-pypbm",
"path": "bintovolume.py",
"copies": "1",
"size": "1641",
"license": "apache-2.0",
"hash": 3763917664651877400,
"line_mean": 21.1756756757,
"line_max": 78,
"alpha_frac": 0.6538695917,
"autogenerated": false,
"ratio": 3.262425447316103,
"config_test": ... |
#!/bin/true
import os, sys, imp
panda3d_modules = {
"core" :("libpandaexpress", "libpanda"),
"dtoolconfig" : "libp3dtoolconfig",
"physics" : "libpandaphysics",
"fx" : "libpandafx",
"direct" : "libp3direct",
"egg" : "libpandaegg",
"ode" : "libpandaode... | {
"repo_name": "sctigercat1/panda3d",
"path": "direct/src/ffi/panda3d.py",
"copies": "10",
"size": "9620",
"license": "bsd-3-clause",
"hash": 674533194328168300,
"line_mean": 33.9818181818,
"line_max": 78,
"alpha_frac": 0.5479209979,
"autogenerated": false,
"ratio": 4.060785141409878,
"config_te... |
"""Bin up Pandas DataFrames into histograms ready for Bokeh plotting."""
import numpy as np
import pandas as pd
def histogram(dfs, n_bins=50, log=False, mc=False, cum=False):
"""
Quick function to 'histogram' each column of each dataframe.
Args:
dfs (list): List of dataframes
n_bins (int)... | {
"repo_name": "davidgardenier/frbpoppy",
"path": "frbpoppy/do_hist.py",
"copies": "1",
"size": "2889",
"license": "mit",
"hash": 6823513293529142000,
"line_mean": 25.027027027,
"line_max": 76,
"alpha_frac": 0.4496365524,
"autogenerated": false,
"ratio": 3.562268803945746,
"config_test": false,
... |
__author__ = 'jinxizeng'
import os
import sys
import argparse
import mysql.connector
from mysql.connector import FieldType
# default database config
USER = 'root'
PASSWORD = '123456'
DB_NAME = 'demodb'
HOST = '127.0.0.1'
PORT = 3306
DIST_PATH = ''
# Language config
PY = 'python' # django model
CS = 'csharp'
CPP = '... | {
"repo_name": "gameman100/pywalker",
"path": "djmd.py",
"copies": "1",
"size": "4718",
"license": "apache-2.0",
"hash": 19215961573864650,
"line_mean": 25.96,
"line_max": 108,
"alpha_frac": 0.5222551929,
"autogenerated": false,
"ratio": 4.049785407725322,
"config_test": false,
"has_no_keyword... |
#!/bin/usr/env python3
# -*- coding: utf-8 -*-
#
# Credits:
# [1] Gaute Hope: gauteh/abunchoftags
# https://github.com/gauteh/abunchoftags/blob/master/keywsync.cc
#
# TODO:
# * Support case-insensitive tags merge
# (ref: http://stackoverflow.com/a/1480230)
# * Accept a specified mtime, and only deal with files wi... | {
"repo_name": "liweitianux/atoolbox",
"path": "python/xkeywordsync.py",
"copies": "1",
"size": "21115",
"license": "mit",
"hash": 7404586917534575000,
"line_mean": 38.6153846154,
"line_max": 79,
"alpha_frac": 0.5767463888,
"autogenerated": false,
"ratio": 3.8523991972267835,
"config_test": fals... |
'''
Models for Users, blogs, comment,
'''
__author__ = 'lip.W'
import time, uuid
from orm import Model, StringField, BooleanField, FloatField, TextField
def next_id():
return '%015d%s00' % (int(time.time() * 1000), uuid.uuid4().hex)
class User(Model):
__table__ = 'users'
id = StringField(primary_key=True, de... | {
"repo_name": "lzkkk/Python_blog",
"path": "www/models.py",
"copies": "1",
"size": "1388",
"license": "mit",
"hash": 5718185912787316000,
"line_mean": 25.7115384615,
"line_max": 71,
"alpha_frac": 0.6880403458,
"autogenerated": false,
"ratio": 2.9721627408993574,
"config_test": false,
"has_no_... |
#!/bin/usr/env python3
import getch
import os
import sys
import time
import argparse
import urllib2
import subprocess
import cv2
import numpy as np
from math import pi
# import threading
import select
from train import process_image, model
#Controls for wifi car v1
#pip3 install getch
#pip install https://pypi.python... | {
"repo_name": "LiuVII/Self-driving-RC-car",
"path": "versions/continuous v1/drive.py",
"copies": "1",
"size": "3966",
"license": "mit",
"hash": -3524073281514898400,
"line_mean": 20.9171270718,
"line_max": 87,
"alpha_frac": 0.6278366112,
"autogenerated": false,
"ratio": 2.588772845953003,
"conf... |
#!/bin/usr/env python3
import getch
import os
import sys
import time
import argparse
import urllib2
import subprocess
import cv2
import numpy as np
import pandas as pd
from math import pi
import shutil
from datetime import datetime
import select
import math
from PIL import ImageOps
from PIL import Image
# from train im... | {
"repo_name": "LiuVII/Self-driving-RC-car",
"path": "drive.py",
"copies": "1",
"size": "9889",
"license": "mit",
"hash": -2744409320311130600,
"line_mean": 23.5384615385,
"line_max": 112,
"alpha_frac": 0.6230154717,
"autogenerated": false,
"ratio": 2.4648554336989035,
"config_test": false,
"h... |
#!/bin/usr/env python3
import pygame
import os
import sys
import time
import argparse
import urllib2
import subprocess
import cv2
import numpy as np
import pandas as pd
from math import pi
import shutil
from datetime import datetime
import select
import math
from PIL import ImageOps
from PIL import Image
# from train i... | {
"repo_name": "LiuVII/Self-driving-RC-car",
"path": "drive2.py",
"copies": "1",
"size": "7365",
"license": "mit",
"hash": 8200460947245994000,
"line_mean": 23.7147651007,
"line_max": 112,
"alpha_frac": 0.6515953836,
"autogenerated": false,
"ratio": 2.5988002822865206,
"config_test": false,
"h... |
#!/bin/usr/env python3
import pygame
import os
import sys
import time
import argparse
import urllib2
import subprocess
import numpy as np
import pandas as pd
from math import pi
import shutil
from datetime import datetime
import select
import math
# from train import process_image, model
from train2 import process_imag... | {
"repo_name": "LiuVII/Self-driving-RC-car",
"path": "drive3.py",
"copies": "1",
"size": "7700",
"license": "mit",
"hash": -9043893370607358000,
"line_mean": 23.6794871795,
"line_max": 112,
"alpha_frac": 0.6490909091,
"autogenerated": false,
"ratio": 2.5943396226415096,
"config_test": false,
"... |
#!/bin/usr/env python3
import sys
import shutil, io, os, glob, subprocess
import csv
import types
import json
import xlrd # must install xlrd!
def excel2class( inpu_path='', namespace='', gameinfoclass='GameInfo', lang=LANG_CS ):
"""
export class files from excel sheet
:param inpu_path: relative excel... | {
"repo_name": "gameman100/pywalker",
"path": "datapacker/datapacker/datapacker.py",
"copies": "4",
"size": "19312",
"license": "apache-2.0",
"hash": -4069497834222880300,
"line_mean": 36.6452241715,
"line_max": 167,
"alpha_frac": 0.4943040597,
"autogenerated": false,
"ratio": 4.063118030717441,
... |
#!/bin/usr/env python3
import argparse
import logging
import time
import datetime
import json
import math
import os
import re
import shutil
import stat
from distutils.dir_util import copy_tree
from typing import Dict, List, Union
import requests
from bs4 import BeautifulSoup
from git import Repo
import util
class ... | {
"repo_name": "melkamar/fitanketa-miner",
"path": "minefit.py",
"copies": "1",
"size": "25588",
"license": "mit",
"hash": -4091028453413303300,
"line_mean": 37.8449848024,
"line_max": 172,
"alpha_frac": 0.5570422535,
"autogenerated": false,
"ratio": 3.98006851448147,
"config_test": false,
"ha... |
#!/bin/usr/env python
# -*- coding: utf-8 -*-
from PyQt4.QtGui import QMainWindow
from PyQt4.QtGui import QMessageBox
from PyQt4.QtGui import QApplication
from PyQt4.QtGui import QListWidget
from PyQt4.QtCore import Qt
from ViewCocktails import Ui_RecipesWindow
from SQLiteConnector import SQLiteConnector
import sys
... | {
"repo_name": "ambonilla/Cocktail-Recipes-PC",
"path": "ControlCocktails.py",
"copies": "1",
"size": "2925",
"license": "mit",
"hash": -3846899664251836000,
"line_mean": 29.7894736842,
"line_max": 89,
"alpha_frac": 0.6875213675,
"autogenerated": false,
"ratio": 3.638059701492537,
"config_test":... |
#!/bin/usr/env/ python
# -*- coding: utf-8 -*-
from PyQt4.QtSql import *
class SQLiteConnector:
def __init__(self, filename):
self.db = QSqlDatabase.addDatabase("QSQLITE")
self.dbName = filename
self.db.setDatabaseName(self.dbName)
self.openDB()
def openDB(self):
if not self.db.o... | {
"repo_name": "ambonilla/Cocktail-Recipes-PC",
"path": "SQLiteConnector.py",
"copies": "1",
"size": "3329",
"license": "mit",
"hash": -8538014870603306000,
"line_mean": 26.7416666667,
"line_max": 82,
"alpha_frac": 0.5398017423,
"autogenerated": false,
"ratio": 4.301033591731266,
"config_test": ... |
#!/bin/usr/env python
# -.- coding: utf-8 -.-
import sys
from btcode.btdecode import btDecode
from btcode.btencode import btEncode
if __name__ == '__main__':
'test ...'
argv = sys.argv
btName = ''
if len(sys.argv) >= 2:
btName = argv[1]
else:
print u'缺少btname'
sys.exit(0)... | {
"repo_name": "noname007/Bencode",
"path": "test.py",
"copies": "2",
"size": "2315",
"license": "apache-2.0",
"hash": 304871006687806700,
"line_mean": 35.95,
"line_max": 115,
"alpha_frac": 0.4578258908,
"autogenerated": false,
"ratio": 3.1225352112676057,
"config_test": false,
"has_no_keyword... |
#!/bin/usr/env python
# -*- coding: utf-8 -*-
"""
TODO:
Add Menu
Enhance TableView
Writer Handler
Update Option
"""
from PyQt4.QtGui import QMainWindow
from PyQt4.QtGui import QApplication
from PyQt4.QtGui import QInputDialog
from PyQt4.QtGui import QMessageBox
from PyQt4.QtGui import QFileDialog
from PyQ... | {
"repo_name": "ambonilla/SQLite-Handler",
"path": "ControlSQliteHandler.py",
"copies": "1",
"size": "3056",
"license": "mit",
"hash": -9183329222363476,
"line_mean": 25.3448275862,
"line_max": 103,
"alpha_frac": 0.6528141361,
"autogenerated": false,
"ratio": 4.047682119205298,
"config_test": fa... |
#! /bin/usr/env python
# D.J. Bennett
# 19/04/2015
"""
Build docs for a BES-QSIG website
Usage:
python build.py
jekyll build
Then, upload _site/ to gh-pages branch.
"""
# LIBS
import os
import re
import sys
import subprocess
import operator
# GLOBALS
front_matter = """---
layout: doc
authors: {0}
lastchange: {1}
ti... | {
"repo_name": "BES-QSIG/qge",
"path": "build.py",
"copies": "1",
"size": "4906",
"license": "unlicense",
"hash": -1985393676947755800,
"line_mean": 31.7066666667,
"line_max": 77,
"alpha_frac": 0.5701182226,
"autogenerated": false,
"ratio": 3.404580152671756,
"config_test": false,
"has_no_keyw... |
#!/bin/usr/env python
import argparse
parser = argparse.ArgumentParser(description = "Command line interface for the TwitterMySQL package")
mysql = parser.add_argument_group("Required MySQL parameters",
"Setting connection parameters for the MySQL side of the wrapper")
mysql.add_arg... | {
"repo_name": "maarten1709/TwitterMySQL",
"path": "TwitterMySQL/cli.py",
"copies": "1",
"size": "3518",
"license": "mit",
"hash": -1206246790247468300,
"line_mean": 49.9855072464,
"line_max": 154,
"alpha_frac": 0.6111426947,
"autogenerated": false,
"ratio": 4.392009987515605,
"config_test": fal... |
__author__ = 'cdigiovanni'
import urllib2
import pickle
import os
import sys
from subprocess import Popen, PIPE
from email.mime.text import MIMEText
from bs4 import BeautifulSoup
class FieldDayChecker(object):
def __init__(self):
self.url = "http://www.dnr.illinois.gov/safety/EducationCourses/fieldday.htm... | {
"repo_name": "digi691/ilfd-checker",
"path": "fdchecker.py",
"copies": "1",
"size": "1980",
"license": "mit",
"hash": -3329493137030718500,
"line_mean": 30.4285714286,
"line_max": 86,
"alpha_frac": 0.6191919192,
"autogenerated": false,
"ratio": 3.3846153846153846,
"config_test": false,
"has_... |
#!/bin/usr/env python
"""
Flash card quiz script based on https://openhatch.org/wiki/Flash_card_challenge.
"""
import random
import sys
def main(path):
""" Reads in cards from file and runs quiz. """
try:
with open(path.strip()) as file:
lines = file.read()[:-1]
except:
print "C... | {
"repo_name": "jwokaty/quizzer",
"path": "quizzer.py",
"copies": "1",
"size": "1382",
"license": "mit",
"hash": 2077733887344333800,
"line_mean": 26.64,
"line_max": 80,
"alpha_frac": 0.502894356,
"autogenerated": false,
"ratio": 3.6853333333333333,
"config_test": false,
"has_no_keywords": fal... |
#! /bin/usr/env python
from operator import add
from mpi4py import MPI
class Worker:
def __init__(self, comm, ClassOperator):
self.comm = comm
self.ClassOperator = ClassOperator
def run(self):
''' The worker spins on work farmed out to it until it is terminated.
'''
w... | {
"repo_name": "opesci/inversion",
"path": "python/TaskFarm.py",
"copies": "1",
"size": "1977",
"license": "bsd-3-clause",
"hash": -1773629783635651300,
"line_mean": 30.8870967742,
"line_max": 77,
"alpha_frac": 0.5563985837,
"autogenerated": false,
"ratio": 3.868884540117417,
"config_test": fals... |
#! /bin/usr/env python
import argparse
import numpy
import numpy.linalg
import random
from mpi4py import MPI
from VelocityModel import VelocityModel
from AcousticWave2D import AcousticWave2D
from ShotManager import ShotManager
from scipy.ndimage.filters import gaussian_filter
from TaskFarm import Master, Worker
imp... | {
"repo_name": "opesci/inversion",
"path": "python/fwi_mpi.py",
"copies": "1",
"size": "2353",
"license": "bsd-3-clause",
"hash": -8677673998446365,
"line_mean": 29.5584415584,
"line_max": 71,
"alpha_frac": 0.608159796,
"autogenerated": false,
"ratio": 3.5705614567526553,
"config_test": false,
... |
#!/bin/usr/env python
import praw
import pickle
import linecache
import time
import string
import threading
usercreds=open("users.txt",'r+')
creds = usercreds.readlines()
print "Loaded user credentials"
gem_data=open("gem.txt",'r+')
print "Opened data file"
already_done=pickle.load(gem_data)
print "Loaded data file"
... | {
"repo_name": "Sysmic/Random-Python-Work",
"path": "PyRedBot.py",
"copies": "1",
"size": "1499",
"license": "mit",
"hash": 4976061409778768000,
"line_mean": 26.2545454545,
"line_max": 71,
"alpha_frac": 0.7098065377,
"autogenerated": false,
"ratio": 2.7155797101449277,
"config_test": false,
"h... |
#!/bin/usr/env python
#modules
import getopt
import os
import sys
import syslog
import tt.data
import time
import datetime
#functions
def usage():
'''usage output'''
print "Usage: tt {--start|--stop|--list} [PROJECT]"
sys.exit(1) #return value 1 -> error in usage
def main():
'''arguments calling'''
#variables
... | {
"repo_name": "catinello/time-tracker",
"path": "tt/core.py",
"copies": "1",
"size": "3077",
"license": "mit",
"hash": 3438897386996753400,
"line_mean": 28.3047619048,
"line_max": 140,
"alpha_frac": 0.6100097498,
"autogenerated": false,
"ratio": 3.0048828125,
"config_test": false,
"has_no_key... |
#!/bin/usr/env python
#
# Mr. Bot command generator (for acdemic research)
#
# Date: Nov. 4, 2012
# All rights are reserved.
#
import sys, random, base64, getopt
from array import array
from crypto import rsa,slowaes
import ccpkt, encopt
_aes_key = [143,194,34,208,145,203,230,143,177,246,97,206,145,92,255,84]
_iv = ... | {
"repo_name": "sfluo/Mr.Bot",
"path": "cmd.py",
"copies": "2",
"size": "2745",
"license": "bsd-3-clause",
"hash": 6361729779923106000,
"line_mean": 24.1834862385,
"line_max": 114,
"alpha_frac": 0.6520947177,
"autogenerated": false,
"ratio": 2.621776504297994,
"config_test": false,
"has_no_key... |
#!/bin/usr/env python
#
# Mr. Bot: data encryption
#
# Date: Nov. 4, 2012
# All rights are reserved.
#
import sys, random, time, base64
import getopt
from array import array
from crypto import slowaes
from crypto import rsa
def _decrypt(data, pri):
""" Decrypt the encrypted data collected and sent from bot
Two b... | {
"repo_name": "sfluo/mrbot",
"path": "encopt.py",
"copies": "2",
"size": "4525",
"license": "bsd-3-clause",
"hash": -5095745623551285000,
"line_mean": 25.1560693642,
"line_max": 149,
"alpha_frac": 0.6510497238,
"autogenerated": false,
"ratio": 2.701492537313433,
"config_test": false,
"has_no_... |
#!/bin/usr/env python
"""
Created by orangeblock
https://github.com/orangeblock
A handy scraping tool for wallbase.cc.
Uses multithreading and only core python libraries.
See the changelog section in the README for a list of changes.
"""
import re
import os
import sys
import time
import urllib
i... | {
"repo_name": "orangeblock/wallscrap",
"path": "wallscrap.py",
"copies": "1",
"size": "12384",
"license": "bsd-2-clause",
"hash": -497887187461970200,
"line_mean": 32.8387978142,
"line_max": 137,
"alpha_frac": 0.5460271318,
"autogenerated": false,
"ratio": 3.83405572755418,
"config_test": false... |
#!/bin/usr/env python
www = 'www.'
http = 'http'
def findLink(content):
"""
findLink(content):
parms:
content: a string to be scanned
returns:
start_end: a list with two indexes indicating
the start and end indexes of the first found link.
If no link is found then, an empty list is returned
"""
... | {
"repo_name": "umutgultepe/IdLogDjango",
"path": "IdLogDjango/logs/LinkScanner.py",
"copies": "1",
"size": "4245",
"license": "mit",
"hash": -2105313575544823600,
"line_mean": 28.6923076923,
"line_max": 97,
"alpha_frac": 0.6690223793,
"autogenerated": false,
"ratio": 3.0671965317919074,
"config... |
#!/bin/usr/env python
# Post Activity 8_2_1 Main : This program uses functions to calculate series and parallel values in Ohms.
# File :PA_8_2_1_main_sjubaer.py
# By : Shadman Jubaer
# Login : sjubaer
# Section : 3Whalen
# Team : Team 51
#
# ELECTRONIC SIGNATURE
# Shadman Jubaer
#
# The electronic signature above indic... | {
"repo_name": "shadmanj/college-code",
"path": "ENGR195H-Honors Creativity-and-Innovation/PYTHON/find_resistance.py",
"copies": "1",
"size": "1398",
"license": "mit",
"hash": 1031484887398389400,
"line_mean": 40.1176470588,
"line_max": 138,
"alpha_frac": 0.7374821173,
"autogenerated": false,
"rat... |
#! /bin/usr/python2
import os, shutil, sys
import time
VERBOSE=False
def vprint(something):
if VERBOSE:
print("run4v:: --> %s"%something)
def clean():
dirs = os.listdir(os.path.abspath(os.curdir))
prefixs = [".run4v_pid_"]
for prefix in prefixs:
vprint("Removing files with prefix '%... | {
"repo_name": "alejandrogallo/run4v",
"path": "run4v/run4v.py",
"copies": "1",
"size": "17035",
"license": "mit",
"hash": -886841180706927600,
"line_mean": 34.1237113402,
"line_max": 163,
"alpha_frac": 0.5662459642,
"autogenerated": false,
"ratio": 4.356777493606138,
"config_test": false,
"ha... |
#!/bin/usr/python3
# -*- coding: utf-8 -*-
import sys
from struct import *
class DisplayPacket:
def __init__(self, user=None, message=None):
self._user = user
self._message = message
def unpack(self, binaryData):
spaces = ' \t\r\n\x00'
u, m = unpack('@20s160s', binaryData)
... | {
"repo_name": "prisme60/LCD-RGB-Keypad-For-RPi",
"path": "displayPacket.py",
"copies": "1",
"size": "1285",
"license": "bsd-2-clause",
"hash": -8508615246898897000,
"line_mean": 28.8837209302,
"line_max": 106,
"alpha_frac": 0.5750972763,
"autogenerated": false,
"ratio": 3.261421319796954,
"conf... |
__author__ = "Alena Lifar"
__email__ = "alenaslifar@gmail.com"
__date__ = "05/08/2017"
private_view_functions = list()
private_blueprints = list()
def add_private_link(func):
"""
Appends func to private collection
:param func: decorated function
:return: void
"""
global private_view_functio... | {
"repo_name": "UseTheApi/flask_url_discovery",
"path": "flask_url_discovery/urls_privation.py",
"copies": "1",
"size": "1562",
"license": "mit",
"hash": 5756803314922842000,
"line_mean": 20.6944444444,
"line_max": 82,
"alpha_frac": 0.5813060179,
"autogenerated": false,
"ratio": 3.905,
"config_t... |
from flask import current_app, jsonify
from flask_url_discovery import env, utils
__author__ = "Alena Lifar"
__email__ = "alenaslifar@gmail.com"
__date__ = "05/08/2017"
def expose_routes():
"""
Route for exposed URLs of a service
:return: dictionary of links
"""
with current_app.app_context():
... | {
"repo_name": "UseTheApi/flask_url_discovery",
"path": "flask_url_discovery/app_registry.py",
"copies": "1",
"size": "2951",
"license": "mit",
"hash": -5792592073156394000,
"line_mean": 27.375,
"line_max": 87,
"alpha_frac": 0.6540155879,
"autogenerated": false,
"ratio": 4.004070556309363,
"conf... |
#!/bin/usr/python3
# This will take in the path of the exploit we're going to copy and put into /usr/share/metasploit-framework
import os
import sys
import argparse
exploits_dir = "/root/.msf4/modules/exploits"
def parse_args():
''' Create the arguments '''
parser = argparse.ArgumentParser(description='Take... | {
"repo_name": "4Ri3D/Install_Metasploit_Exploits",
"path": "install_exploit.py",
"copies": "1",
"size": "3301",
"license": "mit",
"hash": -2520620075841670000,
"line_mean": 34.1170212766,
"line_max": 118,
"alpha_frac": 0.6176916086,
"autogenerated": false,
"ratio": 3.639470782800441,
"config_te... |
import os
import os.path
import re
__author__ = 'Francics'
'''
高效批量移动文件
'''
def movefile(suffix,inpath,outpath):
'''
suffix 文件后缀
inpath 源文件夹路径的根目录
outpath 输出文件夹目录
根据输入的源文件家路径遍历其子目录下所有符合后缀的文件移动到
输出文件夹目录
'''
if not os.path.exists(inpath):
raise IOError('输入文件夹[%s]不存在' % inpath)
if... | {
"repo_name": "wang2222qq/windowfunc",
"path": "batchmovefile.py",
"copies": "1",
"size": "1734",
"license": "mit",
"hash": 176418192218506370,
"line_mean": 22.606557377,
"line_max": 64,
"alpha_frac": 0.55,
"autogenerated": false,
"ratio": 2.5668449197860963,
"config_test": false,
"has_no_key... |
#!/bin/usr/python
# -*- coding: utf-8 -*-
import sqlite3
def ciudades(consulta):
db = sqlite3.connect('datosmeteo.db') # conectamos con la bd
b = db.cursor()
b.execute(consulta) # Obtenemos el resultado de la consulta
resp = ""
for r in b:
# Mandamos un string con un formato válido.
... | {
"repo_name": "dabrase/proyectoIV",
"path": "ElMeteo_bot/funciones_bd.py",
"copies": "2",
"size": "1366",
"license": "artistic-2.0",
"hash": -4611576644691755500,
"line_mean": 28,
"line_max": 135,
"alpha_frac": 0.6045487894,
"autogenerated": false,
"ratio": 2.906183368869936,
"config_test": fal... |
#!/bin/usr/python
# Created by Jose
# This file reads old-format DRM input files and translates them into new HDF5-based format.
#
# This file produces a rigid body input to the DRM layer. That is, all DRM nodes have same X-direction
# displacement and acceleration. In this case a sine wave is used. This is not reali... | {
"repo_name": "yuan-energy/Real-ESSI-Verification-Examples",
"path": "Script_to_Generate_DRM_input/python/generate_hdf5_drm_input.py",
"copies": "4",
"size": "2644",
"license": "cc0-1.0",
"hash": 1159596623667244800,
"line_mean": 32.05,
"line_max": 181,
"alpha_frac": 0.7204992436,
"autogenerated": ... |
#!/bin/usr/python
import os, time
from ai_classes import Task, TaskStatus, Strategy, Action, Order
import xml.etree.ElementTree as ET
from timer import *
class RobotAI():
def __init__(self, strategyname, communication):
self.xml_dirpath = os.path.dirname(__file__) + "/../Definitions/"
self.communication = communi... | {
"repo_name": "MadeInPierre/RobotOS",
"path": "src/robot_ai_scheduler/src/AI/ai.py",
"copies": "1",
"size": "1520",
"license": "mit",
"hash": -5687053131197514000,
"line_mean": 34.3488372093,
"line_max": 86,
"alpha_frac": 0.7184210526,
"autogenerated": false,
"ratio": 3.247863247863248,
"config... |
#! /bin/usr/python
#
# GREATERSURGEON
# this script decrypts and/or decompresses the log files that are generated by GREATERDOCTOR
# modified from the GreaterSurgeon parser
#
# usage:
# greatersurgeon.py [-i <FILE>] [-o <FILE>] [-d] [-x] [-e <DIRECTORY>] [-s] [-p <password>]
#
# options:
# -i
# path to the ... | {
"repo_name": "DarthMaulware/EquationGroupLeaks",
"path": "Leak #5 - Lost In Translation/windows/Resources/GRDO/Tools/i386/GreaterSurgeon_postProcess.py",
"copies": "1",
"size": "22521",
"license": "unlicense",
"hash": 3674004025019052500,
"line_mean": 37.6958762887,
"line_max": 202,
"alpha_frac": 0.... |
#!bin/usr/python
'''
Heterozygote Polarization Script
usage:
bcftools view -M 2 <filename> | python het_polarization.py | bcftools view -O b > <filename.het.polarized.bcf>
Tags variants 'pushed' to ref or alt as follows:
AA - Pushed towards reference
AB - Kept as het
BB - Pushed towards alternative
'''
import sys
... | {
"repo_name": "AndersenLab/variant-caller-analysis",
"path": "scripts/het_polarization.py",
"copies": "1",
"size": "3727",
"license": "mit",
"hash": 8387090613407044000,
"line_mean": 37.4226804124,
"line_max": 131,
"alpha_frac": 0.3772471156,
"autogenerated": false,
"ratio": 3.682806324110672,
... |
#! /bin/usr python
import matplotlib
import numpy as np
import pyfits as pf
import scipy as sp
import gc
import os
import time
from scipy.signal import cspline1d, cspline1d_eval
import pdb
t0 = time.time()
#set top directory
#topdir = '/astro/store/shared-scratch1/sdssspec/'
topdir = os.getenv('BOSS_SPECTR... | {
"repo_name": "excelly/xpy-ml",
"path": "sdss_iii/lauren/script_v1/makepcafits.py",
"copies": "2",
"size": "5586",
"license": "apache-2.0",
"hash": 3027777918857755000,
"line_mean": 30.0333333333,
"line_max": 386,
"alpha_frac": 0.6897601146,
"autogenerated": false,
"ratio": 2.670172084130019,
"... |
#! /bin/usr python
import numpy as np
import pyfits as pf
import scipy as sp
import gc
import os
import time
from scipy.signal import cspline1d, cspline1d_eval
import pdb
import esutil
t0 = time.time()
#set top directory
#topdir = '/astro/store/shared-scratch1/sdssspec/'
topdir = os.getenv('BOSS_SPECTRO_RED... | {
"repo_name": "excelly/xpy-ml",
"path": "sdss_iii/lauren/script_v3/makepcafits_ex.py",
"copies": "1",
"size": "8472",
"license": "apache-2.0",
"hash": 4833464981781964000,
"line_mean": 30.9698113208,
"line_max": 386,
"alpha_frac": 0.6815391879,
"autogenerated": false,
"ratio": 2.63350948088281,
... |
# -------------------------------------------------------------------------------------------------------------
# Copyright 2013 Oleksiy Voronin
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy of the License at
#... | {
"repo_name": "uaraven/qotd-img",
"path": "qotd-show-latest.py",
"copies": "1",
"size": "1510",
"license": "apache-2.0",
"hash": -1750260838722147000,
"line_mean": 34.9761904762,
"line_max": 111,
"alpha_frac": 0.5682119205,
"autogenerated": false,
"ratio": 4.070080862533692,
"config_test": fals... |
#!/bin/usr/python
import sys, getopt
from trace_gen import TraceGen
def main():
tracer = TraceGen(39, 28, 32)
filepath = sys.argv[1]
filename = filepath + "test_load.tr"
file = open(filename, "w")
file.write(tracer.print_header())
file.write(tracer.print_comment("Load from address -... | {
"repo_name": "litex-hub/pythondata-cpu-blackparrot",
"path": "pythondata_cpu_blackparrot/system_verilog/bp_fe/test/tb/bp_fe_icache/trace_script.py",
"copies": "1",
"size": "1103",
"license": "bsd-3-clause",
"hash": 1709599234293871900,
"line_mean": 23.0681818182,
"line_max": 117,
"alpha_frac": 0.598... |
#!/bin/usr/python
import sys
from trace_gen import TraceGen
def main():
tracer = TraceGen(28, 12, 4, 64)
filepath = sys.argv[1]
# Store/Load double word test
filename = filepath + "double_word_test.tr"
file = open(filename, "w")
file.write(tracer.print_header())
file.write(tracer.print... | {
"repo_name": "litex-hub/pythondata-cpu-blackparrot",
"path": "pythondata_cpu_blackparrot/system_verilog/bp_be/test/tb/bp_be_dcache/trace_script.py",
"copies": "1",
"size": "9814",
"license": "bsd-3-clause",
"hash": -3555753968915812400,
"line_mean": 35.4580152672,
"line_max": 110,
"alpha_frac": 0.66... |
# -------------------------------------------------------------------------------------------------------------
# Copyright 2013 Oleksiy Voronin
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy of the License ... | {
"repo_name": "uaraven/qotd-img",
"path": "qotd-server.py",
"copies": "1",
"size": "2820",
"license": "apache-2.0",
"hash": 2129886605153084700,
"line_mean": 33.6962025316,
"line_max": 120,
"alpha_frac": 0.5737588652,
"autogenerated": false,
"ratio": 3.9886845827439887,
"config_test": false,
... |
#!./bin/with-memcached python3
"""Run nosetests with build/lib.* in sys.path"""
import sys
def build_lib_dirname():
from distutils.dist import Distribution
from distutils.command.build import build
build_cmd = build(Distribution({"ext_modules": True}))
build_cmd.finalize_options()
return build_cmd... | {
"repo_name": "lericson/pylibmc",
"path": "bin/runtests.py",
"copies": "1",
"size": "1251",
"license": "bsd-3-clause",
"hash": -924872645017765100,
"line_mean": 26.1956521739,
"line_max": 66,
"alpha_frac": 0.6482813749,
"autogenerated": false,
"ratio": 3.514044943820225,
"config_test": false,
... |
# Created by Neil Francis Hipona on 22/12/2015.
# Copyright © 2015 NFerocious. All rights reserved.
# CSV was downloaded from:
# http://www.opengeocode.org/download.php#cities
# Phase 1 script
import csv
import os
import shutil
# Logging...
print "\nPhase 1: Starting phase 1 parsing ...\n\n\n"
currentDirectory = ... | {
"repo_name": "nferocious76/WorldCountryStatePythonCSVParser",
"path": "csvparser_phase1.py",
"copies": "1",
"size": "2261",
"license": "mit",
"hash": 8833103124457520000,
"line_mean": 24.9770114943,
"line_max": 98,
"alpha_frac": 0.7265486726,
"autogenerated": false,
"ratio": 3.3382570162481535,
... |
# Created by Neil Francis Hipona on 22/12/2015.
# Copyright (©) 2015 NFerocious. All rights reserved.
# CSV was downloaded from:
# http://www.opengeocode.org/download.php#cities
# Phase 2 script
import csv
import os
# Logging...
print "\nPhase 2: Starting phase 2 parsing ...\n\n\n"
# Set delimeter
delimiter = ","... | {
"repo_name": "nferocious76/WorldCountryStatePythonCSVParser",
"path": "csvparser_phase2.py",
"copies": "1",
"size": "2608",
"license": "mit",
"hash": 6935586094547934000,
"line_mean": 25.08,
"line_max": 76,
"alpha_frac": 0.7165324127,
"autogenerated": false,
"ratio": 3.542119565217391,
"config... |
"""Biobank DV order table
Revision ID: 8b20451a84df
Revises: 80d36c1e37e2
Create Date: 2019-03-07 08:41:20.962729
"""
import model.utils
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
from rdr_service.model.base import add_table_history_table, drop_table_history_table
from rdr_s... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/8b20451a84df_biobank_dv_order_table.py",
"copies": "1",
"size": "5229",
"license": "bsd-3-clause",
"hash": 5542166617266568000,
"line_mean": 45.6875,
"line_max": 156,
"alpha_frac": 0.6729776248,
"autogenerated": fa... |
"""biobank specimen
Revision ID: 9bde0801927b
Revises: e66a20e7af08
Create Date: 2020-04-06 14:48:34.437968
"""
from alembic import op
import sqlalchemy as sa
import model.utils
from sqlalchemy.dialects import mysql
# from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, OrderSt... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/9bde0801927b_biobank_specimen.py",
"copies": "1",
"size": "8130",
"license": "bsd-3-clause",
"hash": -9058766970639991000,
"line_mean": 50.1320754717,
"line_max": 127,
"alpha_frac": 0.7083640836,
"autogenerated": f... |
"""biobank stored sample status import temp table
Revision ID: 02f480642635
Revises: ebb897e84b1b
Create Date: 2020-12-07 12:51:12.215106
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
# revision identifiers, used by Alembic.
revision = '02f480642635'
down_revision = 'ebb897e84b1b'... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/02f480642635_biobank_stored_sample_status_import_.py",
"copies": "1",
"size": "3209",
"license": "bsd-3-clause",
"hash": -3598073622166148600,
"line_mean": 42.9589041096,
"line_max": 181,
"alpha_frac": 0.7070738548,
... |
"""biocloud URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/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": "torchmed/biocloud",
"path": "biocloud/urls.py",
"copies": "1",
"size": "1039",
"license": "mit",
"hash": -7191880744077145000,
"line_mean": 34.8275862069,
"line_max": 79,
"alpha_frac": 0.6852743022,
"autogenerated": false,
"ratio": 3.510135135135135,
"config_test": false,
"has_... |
# BioDB API
import hug
import math
import peewee
import falcon
from igloo.model.entities import Software
@hug.get('/')
def get_list(
page: hug.types.number=1,
q: hug.types.text=None):
if q is not None:
items = (Software
.select()
.where(Software.ftsearch.match(q)))
else:
items = S... | {
"repo_name": "PrashntS/BioDB",
"path": "igloo/api/software.py",
"copies": "1",
"size": "2136",
"license": "mit",
"hash": 5542056686886687000,
"line_mean": 21.7234042553,
"line_max": 52,
"alpha_frac": 0.638576779,
"autogenerated": false,
"ratio": 3.1597633136094676,
"config_test": false,
"has... |
""" Biodrop
"""
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.exportimport.instruments.resultsimport import \
InstrumentCSVResultsFileParser, AnalysisResultsImporter
from datetime import datetime
class BioDropCSVParser(InstrumentCSVResultsFileParser):
"""
curre... | {
"repo_name": "hocinebendou/bika.gsoc",
"path": "bika/lims/exportimport/instruments/biodrop/ulite/__init__.py",
"copies": "3",
"size": "2652",
"license": "mit",
"hash": -5857410180305475000,
"line_mean": 37.4347826087,
"line_max": 89,
"alpha_frac": 0.5769230769,
"autogenerated": false,
"ratio": 4... |
""" BioDrop uLite
"""
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from . import BioDropCSVParser, BioDropImporter
import json
import traceback
title = "BioDrop uLite"
def Import(context, request):
""" Read biodrop analysis results
"""
infile = request.form['filename']
f... | {
"repo_name": "hocinebendou/bika.gsoc",
"path": "bika/lims/exportimport/instruments/biodrop/ulite/ulite.py",
"copies": "3",
"size": "2800",
"license": "mit",
"hash": 3295881917651727000,
"line_mean": 31.5581395349,
"line_max": 76,
"alpha_frac": 0.5460714286,
"autogenerated": false,
"ratio": 4.395... |
"""Bio-inspired optimisation algorithms."""
from concurrent import futures
import datetime
import operator
import random
import warnings
import sys
from deap import base, creator, tools
import numpy
import matplotlib.pylab as plt
from external_programs.profit import run_profit
warning_string = """
optimizers.py is ... | {
"repo_name": "woolfson-group/isambard",
"path": "isambard/optimisation/optimizer.py",
"copies": "1",
"size": "51014",
"license": "mit",
"hash": -5579943269510304000,
"line_mean": 39.1369000787,
"line_max": 79,
"alpha_frac": 0.5527110205,
"autogenerated": false,
"ratio": 4.062594568766425,
"con... |
""" Biological attributes
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2017-05-10
:Copyright: 2017, Karr Lab
:License: MIT
"""
from . import core
import Bio
import Bio.Alphabet
import Bio.motifs.matrix
import Bio.Seq
import Bio.SeqFeature
import copy
import json
import six
class FeatureLocationAttribute(core.Liter... | {
"repo_name": "KarrLab/obj_model",
"path": "obj_model/bio.py",
"copies": "1",
"size": "21137",
"license": "mit",
"hash": -3746081216758118000,
"line_mean": 39.8839458414,
"line_max": 151,
"alpha_frac": 0.5704215357,
"autogenerated": false,
"ratio": 4.604007841428882,
"config_test": false,
"ha... |
import difflib
def assertMultiLineEqual(first, second, preserve_newline=True, msg=None):
"""Assert that two multi-line strings are equal."""
assert isinstance(first, str), 'First argument is not a string'
assert isinstance(second, str), 'Second argument is not a string'
if first != second:
m... | {
"repo_name": "rasbt/biopandas",
"path": "biopandas/testutils/testutils.py",
"copies": "1",
"size": "1745",
"license": "bsd-3-clause",
"hash": 2061881363744067000,
"line_mean": 36.1276595745,
"line_max": 77,
"alpha_frac": 0.6297994269,
"autogenerated": false,
"ratio": 4.319306930693069,
"config... |
import gzip
def split_multimol2(mol2_path):
r"""
Generator function that
splits a multi-mol2 file into individual Mol2 file contents.
Parameters
-----------
mol2_path : str
Path to the multi-mol2 file. Parses gzip files if the filepath
ends on .gz.
Returns
-----------
... | {
"repo_name": "rasbt/biopandas",
"path": "biopandas/mol2/mol2_io.py",
"copies": "1",
"size": "1837",
"license": "bsd-3-clause",
"hash": 7111460132956828000,
"line_mean": 30.1355932203,
"line_max": 79,
"alpha_frac": 0.5285792052,
"autogenerated": false,
"ratio": 3.674,
"config_test": false,
"h... |
import numpy as np
from biopandas.pdb import PandasPdb
import os
def test_defaults():
TESTDATA_1t48 = os.path.join(os.path.dirname(__file__), 'data',
'1t48_995.pdb')
p1t48 = PandasPdb()
p1t48.read_pdb(TESTDATA_1t48)
expect_res = ['M', 'E', '... | {
"repo_name": "rasbt/biopandas",
"path": "biopandas/pdb/tests/test_amino3to1.py",
"copies": "1",
"size": "5264",
"license": "bsd-3-clause",
"hash": 1369688565129158700,
"line_mean": 43.9914529915,
"line_max": 79,
"alpha_frac": 0.3446048632,
"autogenerated": false,
"ratio": 2.4959696538643907,
"... |
import os
from biopandas.mol2.mol2_io import split_multimol2
from biopandas.testutils import assert_raises
this_dir = os.path.dirname(os.path.realpath(__file__))
def test_split_multimol2():
all_mol2 = []
for i in split_multimol2(os.path.join(this_dir,
'data', '40_mo... | {
"repo_name": "rasbt/biopandas",
"path": "biopandas/mol2/tests/test_mol2_io.py",
"copies": "1",
"size": "1232",
"license": "bsd-3-clause",
"hash": 3951127388741135400,
"line_mean": 28.3333333333,
"line_max": 76,
"alpha_frac": 0.6022727273,
"autogenerated": false,
"ratio": 3.0419753086419754,
"c... |
from biopandas.pdb import PandasPdb
import os
import numpy as np
import pandas as pd
from nose.tools import raises
from biopandas.testutils import assert_raises
try:
from urllib.request import urlopen
from urllib.error import HTTPError, URLError
except ImportError:
from urllib2 import urlopen, HTTPError, ... | {
"repo_name": "rasbt/biopandas",
"path": "biopandas/pdb/tests/test_read_pdb.py",
"copies": "1",
"size": "6200",
"license": "bsd-3-clause",
"hash": 7167262713959827000,
"line_mean": 30.7948717949,
"line_max": 79,
"alpha_frac": 0.5551612903,
"autogenerated": false,
"ratio": 3.2943676939426143,
"c... |
from biopandas.pdb import PandasPdb
import os
import numpy as np
import pandas as pd
from nose.tools import raises
TESTDATA_FILENAME = os.path.join(os.path.dirname(__file__), 'data',
'3eiy_stripped_no_ele.pdb')
ppdb = PandasPdb()
ppdb.read_pdb(TESTDATA_FILENAME)
def test_impute_he... | {
"repo_name": "rasbt/biopandas",
"path": "biopandas/pdb/tests/test_impute.py",
"copies": "1",
"size": "1448",
"license": "bsd-3-clause",
"hash": -3221738763114572300,
"line_mean": 31.9090909091,
"line_max": 67,
"alpha_frac": 0.6263812155,
"autogenerated": false,
"ratio": 3.004149377593361,
"con... |
'''BioThings API ioloop start utilities.
This module contains functions to configure and start the `base event loop <http://www.tornadoweb.org/en/stable/ioloop.html>`_ from command line args. Command line processing is done using tornado.options, with the following arguments defined:
* ``port``: the port to star... | {
"repo_name": "SuLab/biothings.api",
"path": "biothings/www/index_base.py",
"copies": "1",
"size": "3046",
"license": "apache-2.0",
"hash": 1585143762626073300,
"line_mean": 39.6133333333,
"line_max": 244,
"alpha_frac": 0.7130663165,
"autogenerated": false,
"ratio": 3.7237163814180927,
"config_... |
"""Biot problem with the no-penetration BC on the Walls boundary region."""
# c: 10.03.2009
import os
import numpy as nm
from sfepy.mechanics.matcoefs import stiffness_tensor_lame
def define():
from sfepy import data_dir
filename = data_dir + '/meshes/3d/cylinder.mesh'
output_dir = 'output'
return def... | {
"repo_name": "olivierverdier/sfepy",
"path": "examples/biot/biot_npbc.py",
"copies": "1",
"size": "5614",
"license": "bsd-3-clause",
"hash": 5770814819193598000,
"line_mean": 27.9381443299,
"line_max": 75,
"alpha_frac": 0.4841467759,
"autogenerated": false,
"ratio": 3.049429657794677,
"config_... |
#BIP 0021 Bitcoin Payment URI Scheme
#https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki#ABNF_grammar
# A function that takes and bitcoin address, optional label, and optional amount.
# Returns BIP21 compliant URI that should work
import urllib
def isValidAddr(address):
return True
def is_number(num):
... | {
"repo_name": "rgho/bip21_py",
"path": "bip21.py",
"copies": "1",
"size": "1352",
"license": "unlicense",
"hash": 1501673895831979300,
"line_mean": 37.6285714286,
"line_max": 149,
"alpha_frac": 0.7270710059,
"autogenerated": false,
"ratio": 2.9845474613686536,
"config_test": false,
"has_no_ke... |
# Bipartite graph crosses minimization
import numpy as np
class CrossMinimizer:
def __init__(self, A):
self.N1, self.N2 = A.shape
self.A = np.zeros((self.N1, self.N2))
for i in range(self.N1):
for j in range(self.N2):
self.A[i][j] = 1 if A[i][j] else 0
... | {
"repo_name": "bigartm/visartm",
"path": "algo/arranging/crossmin.py",
"copies": "1",
"size": "5524",
"license": "bsd-3-clause",
"hash": 6576021703458575000,
"line_mean": 31.3040935673,
"line_max": 75,
"alpha_frac": 0.448769008,
"autogenerated": false,
"ratio": 3.262847017129356,
"config_test":... |
"""BipartiteMatching.py
Hopcroft-Karp bipartite maximum-cardinality matching and maximum
independent set for bipartite graphs.
D. Eppstein, April 2002.
"""
from .strong_connectivity import StronglyConnectedComponents
def matching(graph):
"""
Find maximum cardinality matching of a bipartite graph (U,V,E).
... | {
"repo_name": "jfinkels/PADS",
"path": "pads/bipartite_matching.py",
"copies": "1",
"size": "4443",
"license": "mit",
"hash": 367091681442023500,
"line_mean": 33.7109375,
"line_max": 78,
"alpha_frac": 0.547602971,
"autogenerated": false,
"ratio": 4.288610038610039,
"config_test": false,
"has_... |
"""BipartiteMatching.py
Hopcroft-Karp bipartite maximum-cardinality matching and maximum
independent set for bipartite graphs.
D. Eppstein, April 2002.
"""
from StrongConnectivity import StronglyConnectedComponents
try:
set
except NameError:
from sets import Set as set
def matching(graph):
"""
Find... | {
"repo_name": "ncbray/pystream",
"path": "lib/PADS/BipartiteMatching.py",
"copies": "1",
"size": "4519",
"license": "apache-2.0",
"hash": -1408576152299350000,
"line_mean": 33.7615384615,
"line_max": 83,
"alpha_frac": 0.5512281478,
"autogenerated": false,
"ratio": 4.287476280834914,
"config_tes... |
"""Bipartite.py
Two-color graphs and find related structures.
D. Eppstein, May 2004.
"""
from .biconnectivity import BiconnectedComponents
from .graphs import union
from .dfs import search as dfs_search
from .dfs import nontree as NONTREE
from .dfs import forward as FORWARD
class NonBipartite(Exception):
pass
... | {
"repo_name": "jfinkels/PADS",
"path": "pads/bipartite.py",
"copies": "1",
"size": "1815",
"license": "mit",
"hash": 5959163295356839000,
"line_mean": 24.2083333333,
"line_max": 75,
"alpha_frac": 0.6512396694,
"autogenerated": false,
"ratio": 3.6666666666666665,
"config_test": false,
"has_no_... |
"""biplist -- a library for reading and writing binary property list files.
Binary Property List (plist) files provide a faster and smaller serialization
format for property lists on OS X. This is a library for generating binary
plists which can be read by OS X, iOS, or other clients.
The API models the plistlib API, a... | {
"repo_name": "sdgdsffdsfff/ios-ipa-parser",
"path": "biplist/__init__.py",
"copies": "2",
"size": "30005",
"license": "mit",
"hash": 7428704343234547000,
"line_mean": 36.7909319899,
"line_max": 170,
"alpha_frac": 0.5783036161,
"autogenerated": false,
"ratio": 4.307349985644559,
"config_test": ... |
"""biplist -- a library for reading and writing binary property list files.
Binary Property List (plist) files provide a faster and smaller serialization
format for property lists on OS X. This is a library for generating binary
plists which can be read by OS X, iOS, or other clients.
The API models the plistlib API,... | {
"repo_name": "erdanieee/imagePicker",
"path": "node_modules/dmg-builder/vendor/biplist/__init__.py",
"copies": "7",
"size": "32655",
"license": "mit",
"hash": -4971261081663865000,
"line_mean": 36.4054982818,
"line_max": 170,
"alpha_frac": 0.5771551064,
"autogenerated": false,
"ratio": 4.3200158... |
"""Biplot and triplot for ordination results.
"""
from itertools import imap
import pylab; from pylab import xlim, ylim, plot, scatter
from matplotlib import cm
from matplotlib.colors import rgb2hex, Normalize, Colormap
from numpy import asarray, isscalar, concatenate, any
from pdb import set_trace
__author__ = "Zongz... | {
"repo_name": "sauloal/cnidaria",
"path": "scripts/venv/lib/python2.7/site-packages/cogent/draw/multivariate_plot.py",
"copies": "1",
"size": "9363",
"license": "mit",
"hash": -7431299452871852000,
"line_mean": 40.7991071429,
"line_max": 80,
"alpha_frac": 0.6054683328,
"autogenerated": false,
"ra... |
"""Bipolar cells."""
from math import exp
from collections import namedtuple
import numpy as np
from ..neuron import Neuron
# Simple structure to define ON- and OFF- Bipolar cell types (polarity = -1 means depolarizing/inhibitory/ON, and vice-versa)
BipolarType = namedtuple('BipolarType', ['name', 'polarity', 'occur... | {
"repo_name": "napratin/nap",
"path": "nap/vision/bipolar.py",
"copies": "1",
"size": "3188",
"license": "mit",
"hash": -943333595997613600,
"line_mean": 48.0461538462,
"line_max": 197,
"alpha_frac": 0.7054579674,
"autogenerated": false,
"ratio": 3.140886699507389,
"config_test": false,
"has_... |
""" Biquad calculator """
import math
class BiquadCalc:
"2nd order biquad filter coefficient calculator."
W = 0; W2 = 0; WQ = 0; N = 0;
#================================================
# shared for both lp, hp
#================================================
def __init__(self, Fs, Fc, Q = mat... | {
"repo_name": "gitstrah/cross5548pt",
"path": "biquad.py",
"copies": "1",
"size": "1358",
"license": "mit",
"hash": 2835733735529296400,
"line_mean": 32.95,
"line_max": 64,
"alpha_frac": 0.3497790869,
"autogenerated": false,
"ratio": 3.1508120649651974,
"config_test": false,
"has_no_keywords"... |
# birdcallbot dl
# download and store info from macalauy library from online and excel sheet
# find corresponding audio and photo to make a :35 sec video
import xl
import shutil
import os
import random
from lxml import html
from urllib.parse import urlencode
from pydub import AudioSegment
from requests import get #... | {
"repo_name": "codmart/birdcallbot",
"path": "dl.py",
"copies": "1",
"size": "4150",
"license": "mit",
"hash": 116116132985469800,
"line_mean": 32.184,
"line_max": 191,
"alpha_frac": 0.6352459016,
"autogenerated": false,
"ratio": 3.299920445505171,
"config_test": false,
"has_no_keywords": fal... |
# birdcallbot newbot
# twitter bot script to run on timed basis
import tweepy
import os
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from dl import main
# set up api
auth = tweepy.OAuthHandler(os.environ.get('CONSUMER_KEY'), os.environ.get('CONSUMER_SECRET'))
auth.set_access_token(os.env... | {
"repo_name": "codmart/birdcallbot",
"path": "newbot.py",
"copies": "1",
"size": "1053",
"license": "mit",
"hash": 3235740618176171000,
"line_mean": 25.325,
"line_max": 93,
"alpha_frac": 0.7312440646,
"autogenerated": false,
"ratio": 2.892857142857143,
"config_test": false,
"has_no_keywords":... |
# birdcallbot xl
# parse through excel sheet to make lists of the data
# then use the lists to create a bird class with its data as instance variables
from xlrd import open_workbook
wb = open_workbook('ML_Birds.xls') # name of current top 1000 results spreadsheet
catalog = [] # this holds all the catalog IDs (for... | {
"repo_name": "codmart/birdcallbot",
"path": "xl.py",
"copies": "1",
"size": "1593",
"license": "mit",
"hash": 676442732079592400,
"line_mean": 32.8936170213,
"line_max": 111,
"alpha_frac": 0.6497175141,
"autogenerated": false,
"ratio": 3.448051948051948,
"config_test": false,
"has_no_keyword... |
# birthday calculator
from datetime import date
class Birthday():
def __init__(self, year, month, day):
self._year = year
self._month = month
self._day = day
self._birthday = date(year, month, day)
def daysRemaining(self):
today = date.today()
if self._birthday < today:
self._birthday = self._birthda... | {
"repo_name": "joeryan/pytest-practice",
"path": "birthday.py",
"copies": "1",
"size": "1083",
"license": "mit",
"hash": -7112277374180719000,
"line_mean": 29.1111111111,
"line_max": 96,
"alpha_frac": 0.6611265005,
"autogenerated": false,
"ratio": 2.9917127071823204,
"config_test": false,
"ha... |
"""Birthday cog"""
import discord
import os
import datetime
import time
import asyncio
from __main__ import send_cmd_help
from .utils.chat_formatting import *
from .utils.dataIO import fileIO, dataIO
from .utils import checks
from discord.ext import commands
class Birthday:
def __init__(self, bot):
self.b... | {
"repo_name": "QingyuChai/RiceCogs",
"path": "birthday/birthday.py",
"copies": "1",
"size": "5127",
"license": "mit",
"hash": -4569055483183190500,
"line_mean": 33.8775510204,
"line_max": 112,
"alpha_frac": 0.5746050322,
"autogenerated": false,
"ratio": 3.5878236529041287,
"config_test": false,... |
# birthday.py
import datetime
from collections import namedtuple
Date = namedtuple('Date', ['year', 'month', 'day'])
def print_header():
""" Print the header for this app"""
print("--------------------------------------")
print(" BIRTHDAY COUNTDOWN APP")
print("--------------------------------... | {
"repo_name": "nitin-cherian/LifeLongLearning",
"path": "Python/Python_Jumpstart/03_BirthDay_Countdown_app/birthday.py",
"copies": "1",
"size": "1601",
"license": "mit",
"hash": 1921583922625945900,
"line_mean": 26.6034482759,
"line_max": 83,
"alpha_frac": 0.5846346034,
"autogenerated": false,
"r... |
# Birthday ranges 2 implemented with Binary Indexed Tree
class IndexedTree:
VALUES_LEVEL = 9
def __init__(self):
self.values = [0] * 1024
@staticmethod
def find_position(index, level=VALUES_LEVEL):
return 2 ** level + index - 1
def add(self, index, value):
position = Ind... | {
"repo_name": "pepincho/Python101-and-Algo1-Courses",
"path": "Algo-1/week3/6-Birthday-Ranges-2/birthday_ranges_2.py",
"copies": "2",
"size": "1868",
"license": "mit",
"hash": 50695592850534020,
"line_mean": 23.9066666667,
"line_max": 63,
"alpha_frac": 0.5128479657,
"autogenerated": false,
"ratio... |
"""Bisection algorithms."""
def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
"""
... | {
"repo_name": "Integral-Technology-Solutions/ConfigNOW",
"path": "Lib/bisect.py",
"copies": "4",
"size": "2174",
"license": "mit",
"hash": 333264682734898050,
"line_mean": 26.8717948718,
"line_max": 79,
"alpha_frac": 0.5841766329,
"autogenerated": false,
"ratio": 3.3089802130898023,
"config_tes... |
"""Bisection algorithms."""
def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
... | {
"repo_name": "ericlink/adms-server",
"path": "playframework-dist/play-1.1/python/Lib/bisect.py",
"copies": "2",
"size": "2478",
"license": "mit",
"hash": 3421009964349019600,
"line_mean": 27.5,
"line_max": 92,
"alpha_frac": 0.5786924939,
"autogenerated": false,
"ratio": 3.446453407510431,
"con... |
## Bisection Method.
## INPUT: This module takes in a function and an interval and the number of iterations
## OUTPUT: Function minimum in the interval and the x value associated
################################
####### IMPORTS ############
################################
from math import *
######... | {
"repo_name": "byronBarillas/NumericalAnalysis-Python",
"path": "CH2_1_BISECTIONAL_METHOD.py.py",
"copies": "1",
"size": "2010",
"license": "mit",
"hash": -3887956231727613000,
"line_mean": 19.847826087,
"line_max": 86,
"alpha_frac": 0.3746268657,
"autogenerated": false,
"ratio": 3.32231404958677... |
"""`bisect`"""
import numpy as np
import logging
def bisect(y_target, func, args=None, kwargs=None, x_lo=0, x_hi=1,
x_tol=1e-6, y_tol=1e-3, max_iter=100):
"""Binary search (bisection method) to find `x` value that gives `y_target`
For a function ``y = func(x, *args, **kwargs)``, returns ``x_opt`` ... | {
"repo_name": "uwescience/pulse2percept",
"path": "pulse2percept/utils/optimize.py",
"copies": "2",
"size": "2564",
"license": "bsd-3-clause",
"hash": -2873506633629899300,
"line_mean": 30.6543209877,
"line_max": 79,
"alpha_frac": 0.5491419657,
"autogenerated": false,
"ratio": 3.427807486631016,
... |
# Bishop.py (Laeufer)
from __future__ import division
from OpenGL.GL import *
from OpenGL.GLU import *
from defines import *
from objloader import *
from openGLFunctions import set_color
import Piece
# noinspection PyPep8Naming
class Bishop(Piece.Piece):
def __init__(self, c, x, y, useobj):
if c == obj... | {
"repo_name": "alexus37/AugmentedRealityChess",
"path": "pythonAnimations/pyOpenGLChess/Bishop.py",
"copies": "1",
"size": "2568",
"license": "mit",
"hash": -8714900076429629000,
"line_mean": 29.5714285714,
"line_max": 91,
"alpha_frac": 0.5319314642,
"autogenerated": false,
"ratio": 3.70028818443... |
BISMARK_METH_CODE_TYPE_MAP = {
"H": "CHH",
"h": "CHH",
"X": "CHG",
"x": "CHG",
"Z": "CpG",
"z": "CpG",
}
def meth_call_for_read(read, overlap=True, min_qual=20):
''' Do methyltaion calling per read.
Parameters
----------
read : pysam.AlignedSegment
The read from fetch()... | {
"repo_name": "Zymo-Research/mirror-seq",
"path": "mirror_seq/hmc_calling.py",
"copies": "1",
"size": "13672",
"license": "apache-2.0",
"hash": -2580957581182111000,
"line_mean": 30.0727272727,
"line_max": 122,
"alpha_frac": 0.5635605617,
"autogenerated": false,
"ratio": 3.7091698317959847,
"co... |
## Bissecção
import math
def f(x):
return x**2 - 3
def iniciar(precisao, intervalo):
print("Precisao: {0:e}".format(precisao))
print("Intervalo:", intervalo)
print("Total estimado de interacoes:", k(precisao, intervalo))
print("")
iteracao = 0
diferenca = 1
a, b = intervalo[0], ... | {
"repo_name": "SrMouraSilva/Academic-Projects",
"path": "Superior/S4/Cálculo Numerico/raizes de funcoes/bisseccao.py",
"copies": "1",
"size": "1119",
"license": "mit",
"hash": 5819683104748891000,
"line_mean": 24.3863636364,
"line_max": 121,
"alpha_frac": 0.5138764548,
"autogenerated": false,
"ra... |
''' Bit Array - Bit array computing with long integers.
Good for around 1,000,000 bit arrays but gets slow with a billion bits...
Mike Sweeney. June 2013.
Positives:
Works even with old versions of Python.
Only pure Python needed - no third party modules.
Binary operations such as & | ^ << and >> are fast.
Store and l... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578777_Easy_Bit_Arrays_using_Long/recipe-578777.py",
"copies": "1",
"size": "2183",
"license": "mit",
"hash": -4473672751852814000,
"line_mean": 28.1066666667,
"line_max": 80,
"alpha_frac": 0.6610169492,
"autogenerated": false,
"ratio": 3.... |
#BitArray
#Yu.Yang
#
class bitarray():
def __init__(self,length,defaultValue=False):
if (length < 0):
raise Exception("Length param error")
self.array=[]
self.length=length
fillValue=defaultValue
for i in range(self.length):
self.array.append(defaultV... | {
"repo_name": "NiuXWolf/Introduction-to-Algorithms",
"path": "B/BitArray/BitArray.py",
"copies": "1",
"size": "2972",
"license": "mit",
"hash": -98980733240282660,
"line_mean": 32.393258427,
"line_max": 97,
"alpha_frac": 0.5689771198,
"autogenerated": false,
"ratio": 4.005390835579515,
"config_... |
"""bitbucket-sync synchronize repositories of a bitbucket account to a local
directory. The OAuth key and secret must already be activated in bitbucket.
Usage:
bitbucket-sync [--processes=processes] [--owner=<owner>] --key=<key> --secret=<secret> --directory=<directory>
bitbucket-sync --help
Options:
--help ... | {
"repo_name": "Gautier/bitbucket-sync",
"path": "bitbucket_sync/main.py",
"copies": "1",
"size": "6721",
"license": "mit",
"hash": 7198365840362657000,
"line_mean": 32.4378109453,
"line_max": 113,
"alpha_frac": 0.6180627883,
"autogenerated": false,
"ratio": 3.9982153480071387,
"config_test": fa... |
# BitcasaFS - A FUSE Filesystem Driver for BitcasaFS
# Michael Thomas, 2013
# Imports
import os
import errno
import fuse
import stat
import time
from bitcasa import Bitcasa
fuse.fuse_python_api = (0, 2)
# Since Bitcasa API doesn't have real "permissions", lie.
class BitcasaStat(fuse.Stat):
def __init__(self, item =... | {
"repo_name": "biscuitehh/bitcasa-fs-fuse",
"path": "bitcasafs.py",
"copies": "1",
"size": "4496",
"license": "mit",
"hash": 8808821939252554000,
"line_mean": 31.1214285714,
"line_max": 194,
"alpha_frac": 0.6221085409,
"autogenerated": false,
"ratio": 2.7839009287925696,
"config_test": false,
... |
# Bitcasa Uploader Class
class BitcasaUploader(object):
def __init__(self, filename, chunksize=1 << 13):
self.filename = filename
self.chunksize = chunksize
self.totalsize = os.path.getsize(filename)
self.readsofar = 0
# Form Multipart
self.encoder = codecs.getencoder('utf-8')
self.boundary = uuid.uuid4(... | {
"repo_name": "2xyo/Bitcasa-Python-SDK",
"path": "Bitcasa/Upload.py",
"copies": "1",
"size": "1628",
"license": "mit",
"hash": 997143930150208500,
"line_mean": 35.2,
"line_max": 192,
"alpha_frac": 0.6676904177,
"autogenerated": false,
"ratio": 3.020408163265306,
"config_test": false,
"has_no_... |
#BitcaskDB python ctypes wrapper
import os
from ctypes import *
file_path = os.path.split(os.path.realpath(__file__))[0]+"/"
lib = cdll.LoadLibrary(file_path+'../output/libtoydb.so')
class BitcaskDB(object):
def __init__(self, db_path):
self.obj = lib.BitcaskDB_new(db_path)
def open(self, trunc=False):
return l... | {
"repo_name": "interma/toy_db",
"path": "py-binding/bt_wrapper.py",
"copies": "1",
"size": "1355",
"license": "apache-2.0",
"hash": -1863260295651175700,
"line_mean": 27.2291666667,
"line_max": 60,
"alpha_frac": 0.6590405904,
"autogenerated": false,
"ratio": 2.3241852487135506,
"config_test": f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.