text stringlengths 0 1.05M | meta dict |
|---|---|
#!/bin/bash
"""
makenpz.py DIRECTORY
Build a npz containing all data files in the directory.
"""
from __future__ import division, print_function, absolute_import
import os
from optparse import OptionParser
import numpy as np
def main():
p = OptionParser()
options, args = p.parse_args()
if len(args) ... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scipy-master/scipy/special/utils/makenpz.py",
"copies": "1",
"size": "2221",
"license": "mit",
"hash": -6214431012763365000,
"line_mean": 24.2386363636,
"line_max": 82,
"alpha_frac": 0.5511031067,
"autogenerated": false,
"ratio": 3.896... |
#!/bin/bash
"""
makenpz.py DIRECTORY
Build a npz containing all data files in the directory.
"""
from __future__ import division, print_function, absolute_import
import os
import numpy as np
from optparse import OptionParser
def main():
p = OptionParser()
options, args = p.parse_args()
if len(args) !... | {
"repo_name": "FRidh/scipy",
"path": "scipy/special/utils/makenpz.py",
"copies": "85",
"size": "2218",
"license": "bsd-3-clause",
"hash": 7538041163895069000,
"line_mean": 24.4942528736,
"line_max": 82,
"alpha_frac": 0.5518485122,
"autogenerated": false,
"ratio": 3.9049295774647885,
"config_tes... |
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
''''set -e
cd "$(dirname $0)"
exec ../../python/_virtualenv/bin/python "$(basename $0)"
'''
try:
impo... | {
"repo_name": "nnethercote/servo",
"path": "etc/taskcluster/simulate_github_events.py",
"copies": "18",
"size": "1879",
"license": "mpl-2.0",
"hash": -7445897880933429000,
"line_mean": 25.0972222222,
"line_max": 79,
"alpha_frac": 0.5433741352,
"autogenerated": false,
"ratio": 3.5722433460076046,
... |
#!/bin/bash
#PBS -l walltime=40:00:00
#PBS -o ebossdr14_kroupa.o.$PBS_JOBID
#PBS -e ebossdr14_kroupa.e$PBS_JOBID
#PBS -M comparat@mpe.mpg.de
module load apps/anaconda/2.4.1
module load apps/python/2.7.8/gcc-4.4.7
cd /users/comparat/batch_spFly_perPlate
python createPlSpAll.py
from os.path import join
import os
import... | {
"repo_name": "JohanComparat/pySU",
"path": "spm/bin/create_perPlate_tables.py",
"copies": "1",
"size": "1409",
"license": "cc0-1.0",
"hash": 6361066920529464000,
"line_mean": 27.7551020408,
"line_max": 102,
"alpha_frac": 0.6990773598,
"autogenerated": false,
"ratio": 2.344425956738769,
"config... |
'''Python rewrite of the accept module'''
__author__ = 'Sean McLaughlin'
__email__ = 'swmclau2@stanford.edu'
import numpy as np
def acceptance(C, Cnew, Cbest, ibold, accepted, dtd, v, vold):
if Cnew <= C: #accept all downhill steps
accepted = max(accepted+1, 1)
else:
#calculate beta
i... | {
"repo_name": "mclaughlin6464/SloppyJoes",
"path": "SloppyJoes/accept.py",
"copies": "1",
"size": "1624",
"license": "mit",
"hash": -5593720824867777000,
"line_mean": 28.0178571429,
"line_max": 89,
"alpha_frac": 0.4704433498,
"autogenerated": false,
"ratio": 3.553610503282276,
"config_test": fa... |
'''Python rewrite of the aconverge module'''
__author__ = 'Sean McLaughlin'
__email__ = 'swmclau2@stanford.edu'
from itertools import izip
import numpy as np
#TODO get the num of arguments down
def convergence_check(converged, accepted, counter, C, Cnew, x, fvec, fjac, lam, xnew,
nfev, maxfev, n... | {
"repo_name": "mclaughlin6464/SloppyJoes",
"path": "SloppyJoes/converge.py",
"copies": "1",
"size": "2553",
"license": "mit",
"hash": 4844757183533749000,
"line_mean": 27.3666666667,
"line_max": 91,
"alpha_frac": 0.5887191539,
"autogenerated": false,
"ratio": 3.5311203319502074,
"config_test": ... |
''' Python rewrite of the geodesicLM main module. '''
__author__ = 'Sean McLaughlin'
__email__ = 'swmclau2@stanford.edu'
import numpy as np
from scipy import linalg, optimize
from .fdjac import fdjac
from .fdavv import fdavv
from .lambdaFuncs import TrustRegion, Updatedelta_factor, Updatedelta_more, Updatelam_factor,... | {
"repo_name": "mclaughlin6464/SloppyJoes",
"path": "SloppyJoes/geodesiclm.py",
"copies": "1",
"size": "24091",
"license": "mit",
"hash": 4831788446170436000,
"line_mean": 32.3670360111,
"line_max": 185,
"alpha_frac": 0.5409073928,
"autogenerated": false,
"ratio": 3.445016445016445,
"config_test... |
'''Python rewrite of the lambda module.
Routiens for updating lam'''
__author__ = 'Sean McLaughlin'
__email__ = 'swmclau2@stanford.edu'
import numpy as np
from numpy.linalg import norm
from scipy.optimize import minimize
def TrustRegion(fvec, fjac, dtd, delta):
'''Calls dgqt supplied by minpack to calculate the s... | {
"repo_name": "mclaughlin6464/SloppyJoes",
"path": "SloppyJoes/lambdaFuncs.py",
"copies": "1",
"size": "2030",
"license": "mit",
"hash": 1449779565944356400,
"line_mean": 28.4347826087,
"line_max": 103,
"alpha_frac": 0.6354679803,
"autogenerated": false,
"ratio": 3.0711043872919817,
"config_tes... |
#!/bin/bash
PYTHON=`which python`
echo $PYTHON
for f in $(find . -name \*.csv -print); do
echo "File -> $f"
$PYTHON csv_etl.py $f
done
[hadoop@pc-hadoop1:/data2/workspace/etc]$ more csv_etl.py
# -*- coding: utf-8 -*-
import csv
import mysql.connector
#import time
import sys
from datetime import date, datetime, timed... | {
"repo_name": "justin2061/etc-data-lab",
"path": "src/main/resources/csv_etl.py",
"copies": "1",
"size": "1281",
"license": "apache-2.0",
"hash": -3707263512441714000,
"line_mean": 27.4888888889,
"line_max": 167,
"alpha_frac": 0.6346604215,
"autogenerated": false,
"ratio": 2.5467196819085487,
"... |
#!/bin/bash
"""The Emu object esentially wraps the GPy gaussian process code. It handles building, training, and predicting."""
import warnings
from itertools import izip
from collections import OrderedDict
from os import path
import sys
from time import time
import cPickle as pickle
from abc import ABCMeta, abstractm... | {
"repo_name": "mclaughlin6464/pearce",
"path": "pearce/emulator/emu.py",
"copies": "1",
"size": "140229",
"license": "mit",
"hash": 770454943611223700,
"line_mean": 40.9596050269,
"line_max": 172,
"alpha_frac": 0.5541934978,
"autogenerated": false,
"ratio": 3.582754215636178,
"config_test": fal... |
#!/bin/bash
# This module contains custom HODModels, which are subclasses of Halotools implementations.
import numpy as np
from scipy.special import erf
from scipy.interpolate import interp1d
import warnings
from halotools.empirical_models import Zheng07Cens, Zheng07Sats, OccupationComponent, model_defaults
#from hal... | {
"repo_name": "mclaughlin6464/pearce",
"path": "pearce/mocks/customHODModels.py",
"copies": "1",
"size": "81185",
"license": "mit",
"hash": -5793697924843234000,
"line_mean": 42.7891046386,
"line_max": 156,
"alpha_frac": 0.593077539,
"autogenerated": false,
"ratio": 3.698801767734293,
"config_t... |
#!/bin/bash
# This module contains my modification of Hearin's decorated HOD, that is a continuous extension of the idea.
from time import time
from itertools import izip
from functools import wraps
import inspect
from warnings import warn
from math import ceil
import numpy as np
from halotools.empirical_models impor... | {
"repo_name": "mclaughlin6464/pearce",
"path": "pearce/mocks/assembias_models/old_continuousAssembias.py",
"copies": "1",
"size": "24645",
"license": "mit",
"hash": -7673213731564082000,
"line_mean": 46.3942307692,
"line_max": 153,
"alpha_frac": 0.6294177318,
"autogenerated": false,
"ratio": 3.86... |
#!/bin/bash
# TODO better docstring
'''Module containing the main Cat object, which implements caching, loading, populating, and calculating observables
on catalogs. '''
from os import path
from itertools import izip
from functools import wraps
from multiprocessing import cpu_count
import inspect
from time import time... | {
"repo_name": "mclaughlin6464/pearce",
"path": "pearce/mocks/cat.py",
"copies": "1",
"size": "70135",
"license": "mit",
"hash": 4386683242156746000,
"line_mean": 45.2022397892,
"line_max": 183,
"alpha_frac": 0.5716261496,
"autogenerated": false,
"ratio": 3.6096242923314463,
"config_test": false... |
#!/bin/bash
# Use getopt instead of getopts for long options
set -e
OPTS=`getopt -o o: --long out-dir:,bam:,genome-reference:,extra-arguments:,action:,MEM:,threads:,out-script:,standalone -n 'manta.sh' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
#echo "$OPTS"
eval set -- "$OPTS"... | {
"repo_name": "bioinform/somaticseq",
"path": "somaticseq/utilities/dockered_pipelines/germline_variants/Manta.py",
"copies": "1",
"size": "2592",
"license": "bsd-2-clause",
"hash": -1176549800170359600,
"line_mean": 22.5636363636,
"line_max": 143,
"alpha_frac": 0.4861111111,
"autogenerated": false... |
#!/bin/bash
# Use getopt instead of getopts for long options
set -e
OPTS=`getopt -o o: --long out-dir:,bam:,in-vcf:,sample-name:,canvas-reference:,extra-arguments:,action:,MEM:,threads:,out-script:,standalone -n 'canvas.sh' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
#echo "$OPT... | {
"repo_name": "bioinform/somaticseq",
"path": "somaticseq/utilities/dockered_pipelines/germline_variants/Canvas.py",
"copies": "1",
"size": "3716",
"license": "bsd-2-clause",
"hash": 8416339390945938000,
"line_mean": 26.1240875912,
"line_max": 341,
"alpha_frac": 0.5088805167,
"autogenerated": false... |
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory that is passed as an
argument:
nodes_main.txt
nodes_test.txt
These files must consist of lines in the format
<ip>
<ip>:<port>
[<ipv6>]
[<ipv6>]:<port>
<onion>.onion
0xDD... | {
"repo_name": "TeamBitBean/bitbean-core",
"path": "share/seeds/generate-seeds.py",
"copies": "1",
"size": "4311",
"license": "mit",
"hash": -5986378227953584000,
"line_mean": 30.4671532847,
"line_max": 91,
"alpha_frac": 0.5757364881,
"autogenerated": false,
"ratio": 3.1536210680321872,
"config_... |
#!/bin/bash/python2
import urllib2
import json
import csv
'''dw = open("DW.DAT", "r")
codes = {}
whoops = open("whoops.txt", "w")
for l in dw:
congress = int(l[0:4])
district = int(l[13:16])
if not congress==114 or district==0:
pass
else:
icpsr = int(l[5:11])
d2 = float(l[48:55])
#print l
#... | {
"repo_name": "electoralstats/articles",
"path": "dii-dw/ICPSRtoBioGuide.py",
"copies": "1",
"size": "1373",
"license": "mit",
"hash": -6675339550717427000,
"line_mean": 27.0204081633,
"line_max": 156,
"alpha_frac": 0.6686088857,
"autogenerated": false,
"ratio": 2.547309833024119,
"config_test"... |
#!/bin/bash/python2
#
# Gobbles a file on stdin containing chunked sentences of 1 difficulty level
# Takes, as an argument, 1 OR 2 OR 3, an integer corresponding to
# (easy, medium, hard) -- the difficulty level of descrambling the sentences
# Hard-coded in are 3 payment levels.
# Output, on stdout, is 9 CSV lines (co... | {
"repo_name": "john-hewitt/scrambled",
"path": "hit_maker.py",
"copies": "1",
"size": "1585",
"license": "mit",
"hash": 8618695465879832000,
"line_mean": 26.3275862069,
"line_max": 76,
"alpha_frac": 0.676340694,
"autogenerated": false,
"ratio": 3.2952182952182953,
"config_test": false,
"has_n... |
#!/bin/bash/python2
#
# Takes a well-formed Stanford sentence dependency parse file on stdin, as well
# as an integer difficulty level (level of granularity of chunks to spit out)
# On stdout, prints sentences, |||-split
#
# I will arrive at five thirty at the airport
# I will ||| arrive at five thirty ||| at the air... | {
"repo_name": "john-hewitt/scrambled",
"path": "parse_parser.py",
"copies": "1",
"size": "3221",
"license": "mit",
"hash": -3388225102450445300,
"line_mean": 30.8910891089,
"line_max": 143,
"alpha_frac": 0.5942253958,
"autogenerated": false,
"ratio": 3.928048780487805,
"config_test": false,
"... |
#!/bin/bash/python3
import time
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst
GObject.threads_init()
Gst.init(None)
class CapsReader:
def __init__(self, filename):
start = time.time()
self.pipeline = Gst.Pipeline()
# The full pipeline is: decod... | {
"repo_name": "biogeo/gst-tests",
"path": "read_caps.py",
"copies": "1",
"size": "3416",
"license": "mit",
"hash": 6356146979574347000,
"line_mean": 33.8571428571,
"line_max": 86,
"alpha_frac": 0.6004098361,
"autogenerated": false,
"ratio": 3.5920084121976865,
"config_test": false,
"has_no_ke... |
#!/bin/bash python3
"""
"""
from bacpypes.primitivedata import Enumerated
from bacpypes.constructeddata import Any, Choice, Element, Sequence, SequenceOf
import bacpypes.basetypes
vendor_types = set()
# look for all of the enumerated types that have a vendor range
print('')
print("Enumerated Types with a vendor ra... | {
"repo_name": "JoelBender/bacpypes",
"path": "sandbox/explore_types.py",
"copies": "1",
"size": "2140",
"license": "mit",
"hash": 3777301697993322000,
"line_mean": 27.9189189189,
"line_max": 79,
"alpha_frac": 0.6425233645,
"autogenerated": false,
"ratio": 3.4076433121019107,
"config_test": fals... |
#!/bin/bash python
# -*- coding:utf-8 -*-
import os
import shutil
import subprocess
from supervisor.xmlrpc import RPCError
from supervisor.xmlrpc import Faults as SupervisorFaults
class SysexecNamespaceRPCInterface:
"""
"""
def __init__(self, supervisord):
self.supervisord = supervisord
de... | {
"repo_name": "froest2012/sysexec",
"path": "xiuc/rpcinterface.py",
"copies": "1",
"size": "1775",
"license": "mit",
"hash": -1541153878302411500,
"line_mean": 25.4925373134,
"line_max": 82,
"alpha_frac": 0.5543661972,
"autogenerated": false,
"ratio": 4.176470588235294,
"config_test": false,
... |
#!/bin/bash/python
import re
import numpy as np
import argparse
def parse_equation(equation_string):
"""Parse a string representing an equation of the form y=mx+c"""
float_regex = "[-+]?(?:\d*\.\d+|\d+)"
equation_regex = "y=(%s)?x(%s)?" % (float_regex, float_regex)
re.compile(equation_regex)
match... | {
"repo_name": "samueljackson92/dailyprogrammer",
"path": "easy/no181_basic_equations.py",
"copies": "1",
"size": "1722",
"license": "mit",
"hash": 8052639990939022000,
"line_mean": 33.44,
"line_max": 87,
"alpha_frac": 0.662601626,
"autogenerated": false,
"ratio": 3.54320987654321,
"config_test"... |
#!/bin/bash python
# loads metadata from a CSV file and matches this with the metadata fields of the EUDAT community schema in B2SHARE
import requests
# based on the type of the field and its substuctures, add the value to the right key in the exiting output structure
def setKey(out, definition, key, value, subkey = ... | {
"repo_name": "EUDAT-Training/B2SHARE-Training",
"path": "api/metadata/load.py",
"copies": "1",
"size": "2257",
"license": "mit",
"hash": 8374015045691279000,
"line_mean": 37.9137931034,
"line_max": 117,
"alpha_frac": 0.5808595481,
"autogenerated": false,
"ratio": 3.7996632996632997,
"config_te... |
#!/bin/bash/python
from __future__ import print_function
from collections import deque
from copy import deepcopy
import json
import os
import sys
# Define a class to store information about a pipeline phase.
class pipelinePhase():
def __init__(self):
# Store a list of tasks associated with each phase.
sel... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/executionStructure.py",
"copies": "1",
"size": "3496",
"license": "mit",
"hash": -3697417692371396000,
"line_mean": 37.8444444444,
"line_max": 107,
"alpha_frac": 0.727402746,
"autogenerated": false,
"ratio": 4.3213844252163165,
"config_test"... |
#!/bin/bash/python
from __future__ import print_function
from collections import deque
from copy import deepcopy
import networkx as nx
import commandLineErrors as cle
import constructFilenames as construct
import constructFilenameErrors as cfe
import fileHandling as fh
import fileErrors as fe
import graphErrors
impo... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/graph.py",
"copies": "1",
"size": "124658",
"license": "mit",
"hash": -1899297786468911000,
"line_mean": 48.9231077293,
"line_max": 181,
"alpha_frac": 0.6949574035,
"autogenerated": false,
"ratio": 4.387512318738561,
"config_test": true,
"... |
#!/bin/bash/python
from __future__ import print_function
from collections import OrderedDict
import fileHandling as fh
import generalConfigurationFileMethods as methods
import parameterSetErrors as er
import json
import os
import shutil
import sys
# Define a structure to hold information on parameter sets.
class pa... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/parameterSets.py",
"copies": "1",
"size": "13444",
"license": "mit",
"hash": 1661253630516869600,
"line_mean": 37.8554913295,
"line_max": 133,
"alpha_frac": 0.6726420708,
"autogenerated": false,
"ratio": 4.55574381565571,
"config_test": true... |
#!/bin/bash/python
from __future__ import print_function
from copy import deepcopy
import collections
import fileHandling as fh
import makefileErrors
import pipelineConfigurationErrors as pce
import stringOperations as stringOps
import json
import os
import sys
# Define a class to hold information about the command... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/makefiles.py",
"copies": "1",
"size": "65963",
"license": "mit",
"hash": 3406353240718484000,
"line_mean": 51.6861022364,
"line_max": 160,
"alpha_frac": 0.686991192,
"autogenerated": false,
"ratio": 4.133538037348039,
"config_test": false,
... |
#!/bin/bash/python
from __future__ import print_function
from copy import deepcopy
import dataConsistencyErrors as er
import superpipeline
import json
import os
import sys
# Loop over all of the nodes in a graph and check that the values associated with it
# are of the correct type and have extensions consistent wi... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/dataConsistency.py",
"copies": "1",
"size": "24599",
"license": "mit",
"hash": -5816593742844045000,
"line_mean": 49.9296066253,
"line_max": 152,
"alpha_frac": 0.6814504655,
"autogenerated": false,
"ratio": 4.580819366852887,
"config_test": ... |
#!/bin/bash/python
from __future__ import print_function
from copy import deepcopy
import json
import os
import stat
import sys
def main():
# Get input arguments.
try: sequencesFile = sys.argv[1]
except: print('Usage: python convert-bedtools-coverage.py <sequences.txt> <filename.cov> <max coverage> <percent> ... | {
"repo_name": "gkno/gkno_launcher",
"path": "tools/scripts/convert-bedtools-coverage.py",
"copies": "1",
"size": "7876",
"license": "mit",
"hash": 1466454022513672200,
"line_mean": 35.128440367,
"line_max": 149,
"alpha_frac": 0.6471559167,
"autogenerated": false,
"ratio": 3.702867889045604,
"co... |
#!/bin/bash/python
from __future__ import print_function
from difflib import SequenceMatcher
import json
import os
import random
import string
import sys
# Given a list of values and a string, return a reordered list, ranked by similarity
# the string.
def rankListByString(inputList, queryString):
# Loop over the... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/stringOperations.py",
"copies": "1",
"size": "1322",
"license": "mit",
"hash": -5385092997834662000,
"line_mean": 30.4761904762,
"line_max": 143,
"alpha_frac": 0.7420574887,
"autogenerated": false,
"ratio": 3.9345238095238093,
"config_test":... |
#!/bin/bash/python
from __future__ import print_function
from subprocess import Popen, PIPE
import json
import os
import subprocess
import sys
import errors as er
import adminErrors as ae
import fileHandling as fh
# Define a class for handling executable files.
class executables:
def __init__(self):
# Define... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/executables.py",
"copies": "1",
"size": "6831",
"license": "mit",
"hash": -4064282405055444500,
"line_mean": 46.7692307692,
"line_max": 132,
"alpha_frac": 0.6817449861,
"autogenerated": false,
"ratio": 4.304347826086956,
"config_test": false... |
#!/bin/bash/python
from __future__ import print_function
import graph as gr
import networkx as nx
import superpipeline
import stringOperations as strOps
import constructFilenameErrors as errors
import json
import os
import sys
# Determine the order in which the input files should be processed.
def determineInputFile... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/constructFilenames.py",
"copies": "1",
"size": "23594",
"license": "mit",
"hash": -376984992433774340,
"line_mean": 45.9065606362,
"line_max": 153,
"alpha_frac": 0.7369670255,
"autogenerated": false,
"ratio": 4.325206232813932,
"config_test"... |
#!/bin/bash/python
from __future__ import print_function
import networkx as nx
import graph as gr
import plotErrors as er
import os
import subprocess
import sys
# Define the plotting class.
class plotGraph():
def __init__(self):
# Define the errors.
self.errors = er.plotErrors()
# Keep track of the ... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/plotGraph.py",
"copies": "1",
"size": "12689",
"license": "mit",
"hash": -2172570862937470000,
"line_mean": 43.5228070175,
"line_max": 147,
"alpha_frac": 0.6891796044,
"autogenerated": false,
"ratio": 3.8509863429438544,
"config_test": false... |
#!/bin/bash/python
from __future__ import print_function
import fileHandling
import generalConfigurationFileMethods as methods
import parameterSets
import pipelineConfigurationErrors as errors
import json
import os
import sys
# Define a class to store task attribtues.
class taskAttributes:
def __init__(self):
... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/pipelineConfiguration.py",
"copies": "1",
"size": "39825",
"license": "mit",
"hash": 3066560790137806000,
"line_mean": 42.4296619411,
"line_max": 190,
"alpha_frac": 0.7114375392,
"autogenerated": false,
"ratio": 4.477737800764561,
"config_te... |
#!/bin/bash/python
from __future__ import print_function
import fileHandling
import generalConfigurationFileMethods as methods
import parameterSets
import toolConfigurationErrors as errors
import json
import os
import sys
# Define a class to hold information on the arguments.
class argumentAttributes:
def __init_... | {
"repo_name": "gkno/gkno_launcher",
"path": "src/gkno/toolConfiguration.py",
"copies": "1",
"size": "34416",
"license": "mit",
"hash": 5400887204938849000,
"line_mean": 44.5841059603,
"line_max": 148,
"alpha_frac": 0.6890690377,
"autogenerated": false,
"ratio": 4.565061679267807,
"config_test":... |
#!/bin/bash/python
from __future__ import print_function
import json
import os
import stat
import sys
# Determine if the input is a file or a stream.
mode = os.fstat(0).st_mode
isPipe = True if stat.S_ISFIFO(mode) else False
# Open the file.
if isPipe: jsonData = sys.stdin
else:
filename = sys.argv[1]
try: js... | {
"repo_name": "gkno/gkno_launcher",
"path": "tools/scripts/tangram-hist.py",
"copies": "1",
"size": "1154",
"license": "mit",
"hash": -1925053095257049600,
"line_mean": 25.8372093023,
"line_max": 125,
"alpha_frac": 0.6750433276,
"autogenerated": false,
"ratio": 3.2324929971988796,
"config_test"... |
#!bin/bash/python
import boto3
import ConfigParser
import json
import requests
def lambda_handler(event, context):
print "Event JSON: \n" + json.dumps(event) # Dump Event Data for troubleshooting
responseStatus = 'SUCCESS'
targetResponse = {}
# If the CloudFormation Stack is being deleted, delete... | {
"repo_name": "leadingzero/LimitMonkeyEE",
"path": "configuration.py",
"copies": "1",
"size": "6202",
"license": "apache-2.0",
"hash": 6692142336469853000,
"line_mean": 58.6346153846,
"line_max": 431,
"alpha_frac": 0.6713963238,
"autogenerated": false,
"ratio": 4.474747474747475,
"config_test":... |
#!/bin/bash
# AAIMI EMAIL OUT
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# Dedicated email account for AAIMI to send and receive email
system_email = ""
# Password for AAIMI's dedicated Gmail account
system_pass = ""
# User email address
user_email =... | {
"repo_name": "Anthony-Hartup/aaimi_gpio",
"path": "aaimi_email_out.py",
"copies": "1",
"size": "2524",
"license": "mit",
"hash": -2082232881088206300,
"line_mean": 30.358974359,
"line_max": 99,
"alpha_frac": 0.485340729,
"autogenerated": false,
"ratio": 4.0384,
"config_test": false,
"has_no_... |
# AAIMI GPIO 0.4
# Configure and use Raspberry Pi GPIO pins and Arduino pins from a web interface
###############
# Copyright (C) 2017 Anthony Hartup
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal... | {
"repo_name": "Anthony-Hartup/aaimi_gpio",
"path": "aaimi_gpio.py",
"copies": "1",
"size": "97384",
"license": "mit",
"hash": 7206290289843932000,
"line_mean": 48.8267223382,
"line_max": 235,
"alpha_frac": 0.5164811468,
"autogenerated": false,
"ratio": 4.138716532086698,
"config_test": false,
... |
#!/bin/bin/env python
"""Test each of the "success" language implementations
Each implementation needs a file called "run.sh" that
is called by ``sh`` with ``TERM`` equal
different values, which are then tested by this programs.
"""
from __future__ import print_function
import glob
import os
import os.path
import subp... | {
"repo_name": "respectmyterm/respectmyterm.github.io",
"path": "_includes/test.py",
"copies": "1",
"size": "1379",
"license": "apache-2.0",
"hash": 1910011017852336400,
"line_mean": 24.0727272727,
"line_max": 64,
"alpha_frac": 0.5467730239,
"autogenerated": false,
"ratio": 3.517857142857143,
"c... |
#!/bin/bin/python
#!/usr/bin/python
import os
import sys
import time
import select
import socket
import hashlib
import requests
import tempfile
import threading
stats = set()
def start (consul):
global stats
signal = threading.Condition()
def go ():
while (True):
try:
... | {
"repo_name": "dgvncsz0f/pong",
"path": "bin/resolver.py",
"copies": "1",
"size": "1243",
"license": "unlicense",
"hash": 729685967026124300,
"line_mean": 22.9038461538,
"line_max": 99,
"alpha_frac": 0.494770716,
"autogenerated": false,
"ratio": 4.376760563380282,
"config_test": false,
"has_n... |
bind = '0.0.0.0:8000'
backlog = 2048
daemon = False
pidfile = None
umask = 0
user = None
group = None
tmp_upload_dir = None
proc_name = None
# Logging
errorlog = '-'
loglevel = 'info'
accesslog = '-'
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
#
# Worker processes
#
# workers -... | {
"repo_name": "goodes/fit4school",
"path": "etc/gunicorn.py",
"copies": "1",
"size": "3883",
"license": "apache-2.0",
"hash": -5246365077441382000,
"line_mean": 30.5691056911,
"line_max": 81,
"alpha_frac": 0.6523306722,
"autogenerated": false,
"ratio": 3.542883211678832,
"config_test": false,
... |
bind = '0.0.0.0:8000'
backlog = 2048
workers = 1
worker_class = 'sync'
worker_connections = 1000
timeout = 30
keepalive = 2
daemon = False
pidfile = None
umask = 0
user = None
group = None
tmp_upload_dir = None
errorlog = '-'
loglevel = 'info'
accesslog = '-'
proc_name = None
def post_fork(server, worker):
ser... | {
"repo_name": "tonnie17/Bookmarker",
"path": "gunicorn_conf.py",
"copies": "1",
"size": "1320",
"license": "mit",
"hash": -6271575289953908000,
"line_mean": 23.9245283019,
"line_max": 75,
"alpha_frac": 0.628030303,
"autogenerated": false,
"ratio": 3.3165829145728645,
"config_test": false,
"ha... |
"""Bin data for ocean water mass analysis."""
import sys
script_dir = sys.path[0]
import os
import pdb
import argparse
import logging
import numpy as np
import iris
import iris.coord_categorisation
import iris.util
import cmdline_provenance as cmdprov
from statsmodels.stats.weightstats import DescrStatsW
repo_dir = ... | {
"repo_name": "DamienIrving/ocean-analysis",
"path": "data_processing/water_mass_binning.py",
"copies": "1",
"size": "23626",
"license": "mit",
"hash": 8615798410082474000,
"line_mean": 43.4934086629,
"line_max": 133,
"alpha_frac": 0.5669178024,
"autogenerated": false,
"ratio": 3.264161370544349,... |
# ./_binding_.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:883188f134433f2b45c3f67c1d97547fce4cacc0
# Generated 2015-02-11 21:35:49.976794 by PyXB version 1.2.4 using Python 2.6.9.final.0
# Namespace http://uri.etsi.org/01903/v1.4.1#
from __future__ import unicode_literals
import pyxb
import pyxb.binding
import p... | {
"repo_name": "getodacu/eSENS-eDocument",
"path": "profiles/e_confirmation/xb_request/_binding_.py",
"copies": "1",
"size": "10346",
"license": "mit",
"hash": -1256207897146021400,
"line_mean": 57.4519774011,
"line_max": 394,
"alpha_frac": 0.754687802,
"autogenerated": false,
"ratio": 3.361273554... |
# ./_binding.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:96626a27fd68cdb8d894ac246dd093c230124d50
# Generated 2015-02-11 21:35:49.976388 by PyXB version 1.2.4 using Python 2.6.9.final.0
# Namespace urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2
from __future__ import unicode_literals
im... | {
"repo_name": "getodacu/eSENS-eDocument",
"path": "profiles/e_confirmation/xb_request/_binding.py",
"copies": "1",
"size": "6779",
"license": "mit",
"hash": -8262288786434068000,
"line_mean": 49.969924812,
"line_max": 507,
"alpha_frac": 0.7715002213,
"autogenerated": false,
"ratio": 3.74530386740... |
"""Bindings for the Barnes Hut TSNE algorithm with fast nearest neighbors
Refs:
References
[1] van der Maaten, L.J.P.; Hinton, G.E. Visualizing High-Dimensional Data
Using t-SNE. Journal of Machine Learning Research 9:2579-2605, 2008.
[2] van der Maaten, L.J.P. t-Distributed Stochastic Neighbor Embedding
http://homepa... | {
"repo_name": "CannyLab/tsne-cuda",
"path": "src/python/tsnecuda/TSNE.py",
"copies": "1",
"size": "9626",
"license": "bsd-3-clause",
"hash": 8710321811905319000,
"line_mean": 40.670995671,
"line_max": 103,
"alpha_frac": 0.5937045502,
"autogenerated": false,
"ratio": 3.686710072769054,
"config_t... |
"""Bindings plugin for Connectome Viewer
"""
# Copyright (C) 2009-2010, Ecole Polytechnique Federale de Lausanne (EPFL) and
# University Hospital Center and University of Lausanne (UNIL-CHUV)
#
# Modified BSD License
# Enthought library imports
from envisage.api import Plugin
from traits.api import List
from envisage... | {
"repo_name": "LTS5/connectomeviewer",
"path": "cviewer/plugins/bindings/bindings_plugin.py",
"copies": "1",
"size": "1324",
"license": "bsd-3-clause",
"hash": 3913589448413448700,
"line_mean": 27.8043478261,
"line_max": 83,
"alpha_frac": 0.670694864,
"autogenerated": false,
"ratio": 3.7936962750... |
BINDIR = '/usr/local/bin'
BLOCK_MESSAGE_KEYS = []
BUILD_TYPE = 'app'
BUNDLE_NAME = 'ActivityLogV2.pbw'
DEFINES = ['RELEASE']
LIBDIR = '/usr/local/lib'
LIB_DIR = 'node_modules'
MESSAGE_KEYS = {}
MESSAGE_KEYS_HEADER = '/Users/gwena/dev/pebble/ActivityLogV2/build/include/message_keys.auto.h'
NODE_PATH = '/Users/gwena/Libr... | {
"repo_name": "gwena56/ActivLog",
"path": "build/c4che/_cache.py",
"copies": "1",
"size": "2163",
"license": "mit",
"hash": -3122274758577529300,
"line_mean": 93.0434782609,
"line_max": 788,
"alpha_frac": 0.696717522,
"autogenerated": false,
"ratio": 2.5034722222222223,
"config_test": false,
... |
# bind.py
#
# Bind LLVM functions to ctypes
from llvm.core import Module
import llvm.core
import llvm.ee
import ctypes
import io
import os
import sys
PY3 = sys.version_info[0] >= 3
def map_llvm_to_ctypes(llvm_type, py_module=None):
'''
Map an LLVM type to an equivalent ctypes type. py_module is an
option... | {
"repo_name": "seibert/blaze-core",
"path": "blaze/blir/bind.py",
"copies": "1",
"size": "5080",
"license": "bsd-2-clause",
"hash": 7895419924442677000,
"line_mean": 33.5578231293,
"line_max": 89,
"alpha_frac": 0.6253937008,
"autogenerated": false,
"ratio": 3.796711509715994,
"config_test": fal... |
# binds mp3 audiobooks into more manageable m4b audiobooks
# this software looks for audiobooks, each in its own folder, in the input folder
# for each book:
# it creates a scratch folder in the working directory for this book, where it encodes each mp3 input
# files into an aac file (in parallel)
# - the qua... | {
"repo_name": "brightmeme/audiobinder",
"path": "main.py",
"copies": "1",
"size": "4737",
"license": "mit",
"hash": 535390121219426240,
"line_mean": 39.4871794872,
"line_max": 128,
"alpha_frac": 0.7057209204,
"autogenerated": false,
"ratio": 3.6692486444616574,
"config_test": false,
"has_no_k... |
# Bind TCP Payload - Completely ported from Metasploit Framework
# https://github.com/rapid7/metasploit-framework/blob/master/modules/payloads/stagers/windows/bind_tcp.rb
from .xor import *
class PayloadModule:
def __init__(self, port):
self.name = "Bind TCP Stager (Stage 1)"
self.description = "... | {
"repo_name": "m3pt0r/l0l",
"path": "core/database/Windows/bind_tcp.py",
"copies": "2",
"size": "3852",
"license": "mit",
"hash": -6549459193526205000,
"line_mean": 51.7671232877,
"line_max": 151,
"alpha_frac": 0.5846313603,
"autogenerated": false,
"ratio": 2.286053412462908,
"config_test": fal... |
#!/bin/echo Don't run me directly
trackpad = 'SynPS/2 Synaptics TouchPad' # HACK HACK HACK
trackpoint = 'TPPS/2 IBM TrackPoint'
enabled_prop = 'Device Enabled' # XXX Is this a standard name?
from pluginmanager import notify
import re
xinput_prop_spec = re.compile(r'''\s*(?P<prop_name>.+)\s\(\d+\):\s*(?P<val>\S)$''')... | {
"repo_name": "DarkStarSword/junk",
"path": "config/home/.i3/i3companion/trackpad.py",
"copies": "1",
"size": "1634",
"license": "mit",
"hash": 6073428416857908000,
"line_mean": 30.4230769231,
"line_max": 143,
"alpha_frac": 0.7105263158,
"autogenerated": false,
"ratio": 3.037174721189591,
"conf... |
#!/bin/echo tac is a python source file, but should be started via twistd
import sys
try:
sys.setappdefaultencoding('utf-8')
except:
sys = reload(sys)
sys.setdefaultencoding('utf-8')
import tornado.platform.twisted
tornado.platform.twisted.install()
from twisted.application import service, internet
from ... | {
"repo_name": "stiletto/bnw",
"path": "bnw/scripts/instance.py",
"copies": "1",
"size": "3401",
"license": "bsd-2-clause",
"hash": -4427874831856666600,
"line_mean": 29.9181818182,
"line_max": 89,
"alpha_frac": 0.7265510144,
"autogenerated": false,
"ratio": 3.337585868498528,
"config_test": tru... |
#!/bin/en python
import os
from Bio import SeqIO
class Seqs:
def __init__(self, base, window=0):
self.base=base
self.window=window
self.half_window=window/2
self.seqs={}
def get_sequence(self, name, start=None, end=None):
if name not in self.seqs:
if os.path.isdir(self.base):
self.seqs[name] = par... | {
"repo_name": "bioinform/breakseq2",
"path": "breakseq2/biopy/io/Fasta.py",
"copies": "1",
"size": "1192",
"license": "bsd-2-clause",
"hash": -4164007494885271000,
"line_mean": 26.0909090909,
"line_max": 102,
"alpha_frac": 0.6166107383,
"autogenerated": false,
"ratio": 2.5147679324894514,
"conf... |
#!/bin/env dls-python2.4
# Import the motorhome PLC generation library
from motorhome import *
# find the plc number, component name and filename
num, name, filename = parse_args()
# set some defaults
plc = PLC(num, post = "i", ctype=GEOBRICK)
# configure the axes according to name
if name == "M1":
for axis in ... | {
"repo_name": "dls-controls/pmacUtil",
"path": "iocs/pmc_builder/configure/generate_homing_plcs.py",
"copies": "2",
"size": "1500",
"license": "apache-2.0",
"hash": -2573195405854661600,
"line_mean": 29.612244898,
"line_max": 81,
"alpha_frac": 0.58,
"autogenerated": false,
"ratio": 2.590673575129... |
#!/bin/env dls-python2.6
from pkg_resources import require
require("cothread")
import cothread
import time
from random import random
from cothread.catools import *
autoincr=20
# set m510=autoincr on 172.23.88.172
# set m510=autoincr*2 with old method
start = 23.0
steps = 7000
new = True
while True:
mres = caget(... | {
"repo_name": "dls-controls/pmacUtil",
"path": "etc/test/test_B18.py",
"copies": "1",
"size": "1461",
"license": "apache-2.0",
"hash": -4980641459968883000,
"line_mean": 32.976744186,
"line_max": 83,
"alpha_frac": 0.6235455168,
"autogenerated": false,
"ratio": 2.549738219895288,
"config_test": ... |
#!/bin/env dls-python2.6
import sys
from pkg_resources import require
require('cothread')
import cothread
from cothread.catools import *
from optparse import OptionParser
class PositionCompare:
OUTPUT = {'off': 0, 'on': 1, 'auto': 2}
def __init__(self, basepv):
self.pv_base = basepv
s... | {
"repo_name": "dls-controls/pmacUtil",
"path": "etc/test/poscomp.py",
"copies": "1",
"size": "7791",
"license": "apache-2.0",
"hash": -8530432174430540000,
"line_mean": 44.2965116279,
"line_max": 174,
"alpha_frac": 0.6027467591,
"autogenerated": false,
"ratio": 3.5870165745856353,
"config_test"... |
#!/bin/env dls-python
from pkg_resources import require
from collections import OrderedDict
require("mock")
require("pyzmq")
import unittest
import sys
import os
import cothread
import logging
# logging.basicConfig()
#logging.basicConfig(level=logging.DEBUG)
from mock import MagicMock
# Module import
sys.path.append(o... | {
"repo_name": "ulrikpedersen/malcolm",
"path": "test/zmqComms/test_zmqClientSocket.py",
"copies": "1",
"size": "2928",
"license": "apache-2.0",
"hash": -2169617435636316700,
"line_mean": 30.1489361702,
"line_max": 134,
"alpha_frac": 0.6321721311,
"autogenerated": false,
"ratio": 3.55771567436209,... |
#!/bin/env dls-python
from pkg_resources import require
import weakref
require("mock")
require("cothread")
from enum import Enum
import unittest
import sys
import os
import cothread
import logging
#logging.basicConfig(level=logging.DEBUG)
import time
from mock import patch, MagicMock
# Module import
sys.path.append(os.... | {
"repo_name": "ulrikpedersen/malcolm",
"path": "test/core/test_stateMachine.py",
"copies": "1",
"size": "8125",
"license": "apache-2.0",
"hash": 7567784586894508000,
"line_mean": 34.9513274336,
"line_max": 100,
"alpha_frac": 0.6068923077,
"autogenerated": false,
"ratio": 3.543392935019625,
"con... |
#!/bin/env dls-python
from pkg_resources import require
require('numpy')
require('matplotlib')
import sys, os
import matplotlib as mpl
from pylab import *
if len(sys.argv) < 1:
print "### ERROR: not enough arguments. Please supply an input file ###"
fptr = open(sys.argv[1])
datafile=fptr.readline().strip()
data... | {
"repo_name": "ulrikpedersen/benchpress",
"path": "plot-result.py",
"copies": "1",
"size": "2254",
"license": "mit",
"hash": -7400927804582363000,
"line_mean": 26.156626506,
"line_max": 113,
"alpha_frac": 0.6166814552,
"autogenerated": false,
"ratio": 3.1881188118811883,
"config_test": false,
... |
#!/bin/env dls-python
if __name__ == "__main__":
# Test
from pkg_resources import require
require("pyzmq==13.1.0")
require("cothread==2.12")
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))
from malcolm.core.directoryService import DirectoryService, ... | {
"repo_name": "ulrikpedersen/malcolm",
"path": "malcolm/iMalcolm/iMalcolmServer.py",
"copies": "1",
"size": "1908",
"license": "apache-2.0",
"hash": -4519689415356177400,
"line_mean": 33.6909090909,
"line_max": 75,
"alpha_frac": 0.6142557652,
"autogenerated": false,
"ratio": 3.846774193548387,
... |
#!/bin/env dls-python
import sys, os
import subprocess # For calling Xvfb
import atexit
# add the following for debugging
# --log_level=DEBUG
# run from gui_builder/dls_epicsparser source
# ===========================================
#sys.path.append("/dls_sw/work/common/python/dls_guibuilder")
#sys.path.append("/dls... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/cookiecutter_templates/CSS_IOC/{{cookiecutter.project_name}}/{{cookiecutter.domain}}App/op/opi/create_gui.py",
"copies": "1",
"size": "8095",
"license": "apache-2.0",
"hash": -4131156110379684000,
"line_mean": 39.8838383838,
"line_max": 130,
"alp... |
#!/bin/env dls-python
import unittest
import sys
import os
import logging
import cothread
from mock import MagicMock
from malcolm.core.serialize import SType
from malcolm.core.method import wrap_method
logging.basicConfig()
#logging.basicConfig(level=logging.DEBUG)
# Module import
sys.path.append(os.path.join(os.path.d... | {
"repo_name": "ulrikpedersen/malcolm",
"path": "test/core/test_process.py",
"copies": "1",
"size": "4582",
"license": "apache-2.0",
"hash": 8822037284388156000,
"line_mean": 31.041958042,
"line_max": 124,
"alpha_frac": 0.6154517678,
"autogenerated": false,
"ratio": 3.7805280528052805,
"config_t... |
#!/bin/env dls-python
from sys import version_info
if version_info.major == 2:
import __builtin__ as builtins # Allows for Python 2/3 compatibility, 'builtins' is namespace for inbuilt functions
else:
import builtins
import unittest
from mock import patch, ANY, MagicMock
p = patch('dls_ade.Server')
server_... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_list_modules_test.py",
"copies": "1",
"size": "1836",
"license": "apache-2.0",
"hash": -4500880537503379500,
"line_mean": 27.2461538462,
"line_max": 120,
"alpha_frac": 0.6693899782,
"autogenerated": false,
"ratio": 3.4971428571428573,
"... |
#!/bin/env dls-python
import unittest
import dls_ade.dls_start_new_module
from argparse import _StoreTrueAction
from mock import patch
class MakeParserTest(unittest.TestCase):
def setUp(self):
self.parser = dls_ade.dls_start_new_module.make_parser()
@patch('dls_ade.dls_changes_since_release.ArgPars... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_start_new_module_test.py",
"copies": "1",
"size": "1192",
"license": "apache-2.0",
"hash": -2435019783703284000,
"line_mean": 31.2162162162,
"line_max": 77,
"alpha_frac": 0.6963087248,
"autogenerated": false,
"ratio": 3.5903614457831323,
... |
#!/bin/env dls-python
"""
Release a module with a specified release version from the repository.
This script will do a test build of the module, and if it succeeds, will create
the release in git. It will then write a build request file to the build
server, causing it to schedule a checkout and build of the git releas... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_release.py",
"copies": "1",
"size": "19728",
"license": "apache-2.0",
"hash": -6580962852584251000,
"line_mean": 33.4895104895,
"line_max": 113,
"alpha_frac": 0.6231244931,
"autogenerated": false,
"ratio": 4.116002503651158,
"config_tes... |
#!/bin/env dls-python
# Set the QT API to PyQt4
import os
os.environ['QT_API'] = 'pyqt'
import sip
sip.setapi("QString", 2)
sip.setapi("QVariant", 2)
from PyQt4.QtGui import *
# Import the console machinery from ipython
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.qt.inprocess impo... | {
"repo_name": "dls-controls/qt_python_dock",
"path": "qtconsoletest.py",
"copies": "1",
"size": "2856",
"license": "apache-2.0",
"hash": 2456538415117582300,
"line_mean": 41,
"line_max": 168,
"alpha_frac": 0.6642156863,
"autogenerated": false,
"ratio": 4.068376068376068,
"config_test": false,
... |
#!/bin/env dls-python
# This script comes from the dls_scripts python module
"""
Clone a module, an ioc domain or an entire area of the repository.
When cloning a single module, the branch argument will automatically checkout
the given branch.
"""
import sys
import logging
import json
from dls_ade import vcs_git
from... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_checkout_module.py",
"copies": "1",
"size": "4257",
"license": "apache-2.0",
"hash": -1767771580513923800,
"line_mean": 28.3586206897,
"line_max": 83,
"alpha_frac": 0.5917312661,
"autogenerated": false,
"ratio": 4.185840707964601,
"conf... |
#!/bin/env dls-python
# This script comes from the dls_scripts python module
"""
Creates a new module and (unless otherwise indicated) imports it to the server.
Can currently create modules in the following areas:
- python
- tools
- support
- ioc (including BL gui)
"""
import sys
import json
import logging
from dls_a... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_start_new_module.py",
"copies": "1",
"size": "3402",
"license": "apache-2.0",
"hash": 432982982684310700,
"line_mean": 30.2110091743,
"line_max": 113,
"alpha_frac": 0.646090535,
"autogenerated": false,
"ratio": 3.7018498367791075,
"conf... |
#!/bin/env dls-python
# This script comes from the dls_scripts python module
import sys
import json
import shutil
import logging
from dls_ade.argument_parser import ArgParser
from dls_ade.dls_utilities import check_technical_area
from dls_ade import vcs_git
from dls_ade import Server
from dls_ade import logconfig
us... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_changes_since_release.py",
"copies": "1",
"size": "2645",
"license": "apache-2.0",
"hash": -5131179167827059000,
"line_mean": 28.0659340659,
"line_max": 113,
"alpha_frac": 0.6487712665,
"autogenerated": false,
"ratio": 3.9011799410029497,... |
#!/bin/env dls-python
# This script comes from the dls_scripts python module
"""
List the branches of a module on the repository.
"""
import sys
import json
import shutil
import logging
from dls_ade.argument_parser import ArgParser
from dls_ade.dls_utilities import check_technical_area
from dls_ade import vcs_git, Se... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_list_branches.py",
"copies": "1",
"size": "1818",
"license": "apache-2.0",
"hash": -5957925821902857000,
"line_mean": 23.24,
"line_max": 113,
"alpha_frac": 0.6705170517,
"autogenerated": false,
"ratio": 3.672727272727273,
"config_test":... |
#!/bin/env dls-python
# This script comes from the dls_scripts python module
"""
List the modules of an area or ioc domain on the repository
"""
import os
import sys
import json
import logging
from dls_ade.argument_parser import ArgParser
from dls_ade.dls_utilities import remove_git_at_end
from dls_ade import Server
... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_list_modules.py",
"copies": "1",
"size": "2882",
"license": "apache-2.0",
"hash": -6270949770362194000,
"line_mean": 27.5346534653,
"line_max": 113,
"alpha_frac": 0.6328938237,
"autogenerated": false,
"ratio": 3.4681107099879664,
"confi... |
#!/bin/env dls-python
# This script comes from the dls_scripts python module
"""
List the releases that have been made for a module in prod or on the repository.
Default epics version and rhel version are the set from you environment,
to specify different versions the epics version or rhel version flags can be used.
Th... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_list_releases.py",
"copies": "1",
"size": "5193",
"license": "apache-2.0",
"hash": 3208340503778080000,
"line_mean": 30.4727272727,
"line_max": 128,
"alpha_frac": 0.6281532833,
"autogenerated": false,
"ratio": 3.8409763313609466,
"confi... |
#!/bin/env dls-python
# This script comes from the dls_scripts python module
"""
Check or set the contact information for a module on the repository. By default
the contacts of the module are printed in a basic format. The CSV flag will
print the contacts in CSV format. To set a contact and/or cc, the contact and
cc f... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_module_contacts.py",
"copies": "1",
"size": "13715",
"license": "apache-2.0",
"hash": -7839372674767864000,
"line_mean": 31.3466981132,
"line_max": 115,
"alpha_frac": 0.6005103901,
"autogenerated": false,
"ratio": 3.8568616422947133,
"c... |
#!/bin/env dls-python
# This script comes from the dls_scripts python module
"""
Print out the commit logs for a module on the repository. A range can be
specified with the 'releases' argument, a start or an end point can be
specified with the relevant flag, otherwise the entire history will be printed.
These 3 option... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_logs_since_release.py",
"copies": "1",
"size": "20898",
"license": "apache-2.0",
"hash": 3106411205569302000,
"line_mean": 31.6021840874,
"line_max": 113,
"alpha_frac": 0.5774236769,
"autogenerated": false,
"ratio": 4.097647058823529,
"... |
#!/bin/env dls-python
# This script comes from the dls_scripts python module
"""
This script removes all O.* directories from a release of a module and tars it
up before deleting the release directory.
<module_name>/<module_release> will be stored as
<module_name>/<module_release>.tar.gz. Running the script with the -... | {
"repo_name": "dls-controls/dls_ade",
"path": "dls_ade/dls_tar_module.py",
"copies": "1",
"size": "4942",
"license": "apache-2.0",
"hash": -9105822710181977000,
"line_mean": 29.3190184049,
"line_max": 113,
"alpha_frac": 0.6545932821,
"autogenerated": false,
"ratio": 3.7213855421686746,
"config_... |
#! /bin/env dls-python
"""To be run at the end of setup_testing_environment.sh"""
import os
from dls_ade import Server
import tarfile
import shutil
NECESSARY_REPOS_DIR = "necessary_server_repos"
SERVER_REPOS_BASE = os.path.join(NECESSARY_REPOS_DIR, "controlstest")
TAR_LOCATION = SERVER_REPOS_BASE + ".tar.gz"
def p... | {
"repo_name": "dls-controls/dls_ade",
"path": "system_testing/push_required_repos.py",
"copies": "1",
"size": "1467",
"license": "apache-2.0",
"hash": 3477635730123890700,
"line_mean": 26.679245283,
"line_max": 70,
"alpha_frac": 0.657123381,
"autogenerated": false,
"ratio": 3.23841059602649,
"c... |
#/bin/env ipython -i --matplotlib
"""
pyspeckit command line startup script
"""
from __future__ import print_function
import sys
# remove script file's parent directory from path
# (otherwise, can't import pyspeckit)
#sys.path.pop(0)
from pyspeckit.spectrum.classes import Spectrum, Spectra
from pyspeckit.cubes.Spectral... | {
"repo_name": "pyspeckit/pyspeckit",
"path": "scripts/pyspeckit_script.py",
"copies": "7",
"size": "4227",
"license": "mit",
"hash": -1957183870603081000,
"line_mean": 35.7565217391,
"line_max": 144,
"alpha_frac": 0.6068133428,
"autogenerated": false,
"ratio": 3.7539964476021312,
"config_test":... |
#!/bin/env jython
import gc
import json
import math
import sys
import traceback
import java
import org.gavrog.joss.pgraphs as pgraphs
import org.gavrog.joss.geometry as geometry
def run():
def writeln(s=""):
print(s)
for source_path in sys.argv[1:]:
index_in_source = 0
for net in p... | {
"repo_name": "odf/gavrog",
"path": "jython/analyzeNetsForEpinet.py",
"copies": "1",
"size": "9531",
"license": "apache-2.0",
"hash": -3149495769979353600,
"line_mean": 30.4554455446,
"line_max": 79,
"alpha_frac": 0.5462176057,
"autogenerated": false,
"ratio": 3.4395525081198124,
"config_test":... |
#!/bin/env jython
import optparse
import os.path
import re
import sys
import traceback
import java.io
import java.util
import org.gavrog
class OrderedDict:
def __init__(self):
self.__dict = {}
self.__keys = []
def __iter__(self):
return self.__keys.__iter__()
def __getitem__(s... | {
"repo_name": "odf/gavrog",
"path": "jython/systreCmd.py",
"copies": "1",
"size": "18726",
"license": "apache-2.0",
"hash": -5330762748706913000,
"line_mean": 30.8469387755,
"line_max": 80,
"alpha_frac": 0.5822385987,
"autogenerated": false,
"ratio": 4.069100391134289,
"config_test": false,
"... |
#!/bin/env jython
import sys
import java.io
import org.gavrog
def dsymbolFromCyclicAdjacencies(adjs):
vertexToChamber = {}
edgeToChamber = {}
chamberToVertex = {}
size = 0
for v in adjs:
vertexToChamber[v] = size
for w in adjs[v]:
if w == v:
raise Run... | {
"repo_name": "odf/gavrog",
"path": "jython/surfaceMapToDs.py",
"copies": "1",
"size": "1595",
"license": "apache-2.0",
"hash": 8976492106677289000,
"line_mean": 24.7258064516,
"line_max": 74,
"alpha_frac": 0.529153605,
"autogenerated": false,
"ratio": 2.828014184397163,
"config_test": false,
... |
#!/bin/env jython
# ============================================================
# Global imports
# ============================================================
import sys
from org.gavrog.joss.pgraphs.io import Net
from org.gavrog.joss.pgraphs.io import Archive
# =================================================... | {
"repo_name": "BackupTheBerlios/gavrog",
"path": "jython/identify.py",
"copies": "2",
"size": "1592",
"license": "apache-2.0",
"hash": 6195197214552598000,
"line_mean": 30.84,
"line_max": 62,
"alpha_frac": 0.4685929648,
"autogenerated": false,
"ratio": 4.409972299168975,
"config_test": false,
... |
#!/bin/env jython
# ============================================================
# Imports
# ============================================================
# --- Jython stuff
import sys
# --- Java stuff
from java.lang import ClassLoader
from java.io import InputStreamReader, BufferedReader
# --- Gavrog stuff
from o... | {
"repo_name": "odf/gavrog",
"path": "jython/unique_nets.py",
"copies": "1",
"size": "5713",
"license": "apache-2.0",
"hash": 5211596666027291000,
"line_mean": 27.1428571429,
"line_max": 77,
"alpha_frac": 0.4946612988,
"autogenerated": false,
"ratio": 3.834228187919463,
"config_test": false,
"... |
#!/bin/env
# -*- coding: utf-8 -*-
import MySQLdb
import json
import time
import traceback
def connect_db():
try:
conn=MySQLdb.connect(host='localhost',user='root',passwd='',port=3306,charset="utf8" )
cur=conn.cursor()
conn.select_db('gogobar')
except MySQLdb.Error,e:
print "Mysql Error %d: %s" % (e.args[0]... | {
"repo_name": "willdonetang/taisi360",
"path": "tools/parse/import_db.py",
"copies": "1",
"size": "1806",
"license": "apache-2.0",
"hash": 5366523634393395000,
"line_mean": 28.6229508197,
"line_max": 184,
"alpha_frac": 0.6417497231,
"autogenerated": false,
"ratio": 2.558073654390935,
"config_te... |
#!/bin/env
# -*- coding: utf-8 -*-
import MySQLdb
import json
import time
import traceback
def connect_db():
try:
conn = MySQLdb.connect(host='localhost', user='root', passwd='', port=3306, charset="utf8")
cur = conn.cursor()
conn.select_db('gogobar')
except MySQLdb.Error, e:
p... | {
"repo_name": "willdonetang/taisi360",
"path": "tools/crawl_page/import_db.py",
"copies": "1",
"size": "2270",
"license": "apache-2.0",
"hash": -8651520010876972000,
"line_mean": 29.6486486486,
"line_max": 187,
"alpha_frac": 0.5529100529,
"autogenerated": false,
"ratio": 3.132596685082873,
"con... |
#!/bin/env
# -*- coding: utf-8 -*-
import re
import os
import json
from langconv import *
# 输入Unicode编辑,输出Unicode
def big2simple(line):
# 转换繁体到简体
line = Converter('zh-hans').convert(line)
return line
urm_name_map = None
def load_url(path):
ret = {}
dir = "./Uploads/Article/crawl_images"
fo... | {
"repo_name": "willdonetang/taisi360",
"path": "tools/crawl_page/fix_img_url.py",
"copies": "1",
"size": "1484",
"license": "apache-2.0",
"hash": 3051399723733100500,
"line_mean": 21.0606060606,
"line_max": 57,
"alpha_frac": 0.5782967033,
"autogenerated": false,
"ratio": 3.033333333333333,
"con... |
#!/bin/env
# -*- coding: utf-8 -*-
import re
import os
import json
from langconv import *
#输入Unicode编辑,输出Unicode
def big2simple(line):
#转换繁体到简体
line = Converter('zh-hans').convert(line)
return line
urm_name_map = None
def load_url(path):
ret = {}
dir = "./Uploads/Article/crawl_images"
for line in open(path):
... | {
"repo_name": "willdonetang/taisi360",
"path": "tools/parse/fix_img_url.py",
"copies": "1",
"size": "1304",
"license": "apache-2.0",
"hash": -847486760596568000,
"line_mean": 20.6440677966,
"line_max": 50,
"alpha_frac": 0.6598746082,
"autogenerated": false,
"ratio": 2.516765285996055,
"config_t... |
#!/bin/env
# -*- coding: utf-8 -*-
import re
import os
import json
from snownlp import SnowNLP
from bs4 import BeautifulSoup
def save_new_json(str):
out_file = open("ret_summary.txt", 'a')
out_file.write(str)
out_file.write("\n")
out_file.close()
def get_summary(content):
soup = BeautifulSoup(co... | {
"repo_name": "willdonetang/taisi360",
"path": "tools/crawl_page/get_summary.py",
"copies": "1",
"size": "1479",
"license": "apache-2.0",
"hash": -2467207886877037000,
"line_mean": 21.0447761194,
"line_max": 68,
"alpha_frac": 0.5991875423,
"autogenerated": false,
"ratio": 3.253303964757709,
"co... |
#!/bin/env
# -*- coding: utf-8 -*-
import urllib
from snownlp import SnowNLP
from langconv import *
import sys
import os
import socket
import urllib2
import datetime
import time
from bs4 import BeautifulSoup
from db import *
def get_url_list(url):
article = []
url_list = []
try:
response = urll... | {
"repo_name": "willdonetang/taisi360",
"path": "tools/crawl_page/download_360se_mainpage.py",
"copies": "1",
"size": "8504",
"license": "apache-2.0",
"hash": -1660255247431406600,
"line_mean": 27.6413793103,
"line_max": 191,
"alpha_frac": 0.5587527089,
"autogenerated": false,
"ratio": 3.169019458... |
#!/bin/env
# -*- coding: utf-8 -*-
from langconv import *
from bs4 import BeautifulSoup
import re
import os
import json
# 输入Unicode编辑,输出Unicode
def big2simple(line):
# 转换繁体到简体
line = Converter('zh-hans').convert(line)
return line
def save_img_url(img_url, num):
img_url_file = open("img_url.txt", "a... | {
"repo_name": "willdonetang/taisi360",
"path": "tools/crawl_page/parse.py",
"copies": "1",
"size": "2762",
"license": "apache-2.0",
"hash": -5105590398521907000,
"line_mean": 23.752293578,
"line_max": 67,
"alpha_frac": 0.5518902891,
"autogenerated": false,
"ratio": 3.1741176470588237,
"config_t... |
#!/bin/env
# -*- coding: utf-8 -*-
from langconv import *
from bs4 import BeautifulSoup
import re
import os
import json
#输入Unicode编辑,输出Unicode
def big2simple(line):
#转换繁体到简体
line = Converter('zh-hans').convert(line)
return line
def save_img_url(img_url,num):
img_url_file = open("img_url.txt","a")
line = num+"... | {
"repo_name": "willdonetang/taisi360",
"path": "tools/parse/parse.py",
"copies": "1",
"size": "2303",
"license": "apache-2.0",
"hash": -1982061156409271300,
"line_mean": 20.7475728155,
"line_max": 56,
"alpha_frac": 0.6529700759,
"autogenerated": false,
"ratio": 2.51290684624018,
"config_test": ... |
#!/bin/env
# -*- coding: utf-8 -*-
import datetime
import requests
from . import models
from django.conf import settings
from django.utils import timezone
class SC2PlayerException(Exception):
"""Exception thrown on failure to get SC2Player details from battle.net API"""
# List of possible types for the exce... | {
"repo_name": "pundurs/sc2cm",
"path": "sc2clanman/sc2player.py",
"copies": "1",
"size": "9415",
"license": "mit",
"hash": 3335080968755176000,
"line_mean": 39.9347826087,
"line_max": 120,
"alpha_frac": 0.5772703133,
"autogenerated": false,
"ratio": 4.190031152647975,
"config_test": false,
"h... |
#!/bin/env
"""Help new users configure the database for use with social networks.
"""
import os
from datetime import datetime
# Fix Python 2.x.
try: input = raw_input
except NameError: pass
import django
from django.conf import settings
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
settings.configure(DEBUG=... | {
"repo_name": "infoclock/OlympicTracker",
"path": "configure.py",
"copies": "4",
"size": "5097",
"license": "mit",
"hash": -1095985090185022700,
"line_mean": 29.5209580838,
"line_max": 130,
"alpha_frac": 0.6470472827,
"autogenerated": false,
"ratio": 3.5175983436853,
"config_test": true,
"has... |
# Copyright (c) 2001-2009 Rincon Research Corporation, Richard T. Saunders
# All rights reserved.
#
# 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 copyri... | {
"repo_name": "jmcabandara/imagefactory",
"path": "imgfac/picklingtools/simplearray.py",
"copies": "4",
"size": "6927",
"license": "apache-2.0",
"hash": -3502402372216289300,
"line_mean": 35.6507936508,
"line_max": 106,
"alpha_frac": 0.5806265339,
"autogenerated": false,
"ratio": 3.69243070362473... |
#! /bin/env
"""Simple array wrapper: Looks like the Numeric array (with same constructors
and the like), but implemented as a Python array"""
import array
import pretty
import struct
# Array is very pickly about what fits inside, so we have to
# manually stomp the ranges
TypeRanges = {
'b': (1, [-128,127,0xff,'... | {
"repo_name": "RichIsMyName/PicklingToolsRepo",
"path": "PythonModule/ptools/simplearray.py",
"copies": "3",
"size": "5425",
"license": "bsd-3-clause",
"hash": -5382281509507511000,
"line_mean": 32.282208589,
"line_max": 106,
"alpha_frac": 0.5281105991,
"autogenerated": false,
"ratio": 3.52730819... |
#!/bin/env pyhton
"""
Asynchronous Ping
(c)2013 Mladen Vasic, mladen.vasic0@gmail.com
- requires root/administrator privileges
"""
import gevent
import time, struct
from gevent import socket, Timeout
from gevent.queue import Queue
from gevent.event import AsyncResult
from gevent.pool import Pool
import logging... | {
"repo_name": "inkvizitor/asyncping",
"path": "asyncping.py",
"copies": "1",
"size": "5026",
"license": "isc",
"hash": -3667074381633390600,
"line_mean": 23.04784689,
"line_max": 89,
"alpha_frac": 0.6502188619,
"autogenerated": false,
"ratio": 3.0240673886883274,
"config_test": false,
"has_no... |
#!/bin/env python2.6
#encoding=UTF-8
import sys, ldap, os
import urllib, urllib2, re, cookielib
import simplejson as json
import ldap
import ldap.modlist
import logging
import time
from time import strftime, localtime
from ad import Client, Creds, Locator, activate
from ad import AD_USERCTRL_NORMAL_ACCOUNT, AD_USERCTR... | {
"repo_name": "nkysg/Asenal",
"path": "script/python/orgtoad.py",
"copies": "1",
"size": "11887",
"license": "apache-2.0",
"hash": -3679546421335664000,
"line_mean": 38.8547297297,
"line_max": 192,
"alpha_frac": 0.5514961431,
"autogenerated": false,
"ratio": 3.3400339750849377,
"config_test": f... |
#!/bin/env python2.6
import socket
import plugins
import imp
from datetime import datetime
server = raw_input("Server address? ") #Server
channel = raw_input("What channel? ") #Channel
nickname = raw_input("Nickname? ") or "Linx" #Bot nickname
password = raw_input("What is your password? ") #Password Input
port = raw_... | {
"repo_name": "ryanmavilia/Linx",
"path": "linx.py",
"copies": "1",
"size": "1484",
"license": "mit",
"hash": 5636584235686114000,
"line_mean": 40.2222222222,
"line_max": 129,
"alpha_frac": 0.7129380054,
"autogenerated": false,
"ratio": 3.4114942528735632,
"config_test": false,
"has_no_keywor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.