text stringlengths 0 1.05M | meta dict |
|---|---|
#!/bin/env python
import COPASI
import sys
dm = COPASI.CRootContainer.addDatamodel()
assert (isinstance(dm, COPASI.CDataModel))
def setup_sensitivities(report_name):
# activate sensitivity task
task = dm.getTask('Sensitivities')
task.setScheduled(True)
problem = task.getProblem()
assert (isinst... | {
"repo_name": "copasi/COPASI",
"path": "copasi/bindings/python/examples/setup_sensitivities.py",
"copies": "2",
"size": "1749",
"license": "artistic-2.0",
"hash": -3544877287892239400,
"line_mean": 30.2321428571,
"line_max": 87,
"alpha_frac": 0.6901086335,
"autogenerated": false,
"ratio": 3.44970... |
#!/bin/env python
#import evaluate_pp
import os
import subprocess
import eval_pp
import sys
import dakota_interfacing_2.interfacing.parallel as di
# # EXAMPLE FROM DAKOTA DOCS (share/dakota/Python/dakota/interfacing/__init__.py)
# import dakota.interfacing as di
# # Read and parse the parameters file and construct Par... | {
"repo_name": "caseynbrock/opal2",
"path": "analysis_driver.py",
"copies": "1",
"size": "5909",
"license": "mit",
"hash": 5142717358929000000,
"line_mean": 32.7657142857,
"line_max": 94,
"alpha_frac": 0.6397021493,
"autogenerated": false,
"ratio": 3.7733077905491696,
"config_test": false,
"ha... |
#!/bin/env python
import inspect
import os
from collections import OrderedDict
"""
# shell
aws s3 ls s3://grizli-v1/Pipeline/j000200m5558/Prep/j000200m5558_visits.npy --request-payer requester
# Python
import boto3
s3 = boto3.resource('s3')
bkt = s3.Bucket('grizli-v1')
field = 'j000200m5558'
s3_file = '{0}_visits.np... | {
"repo_name": "gbrammer/grizli",
"path": "grizli/aws/aws_drizzler.py",
"copies": "1",
"size": "42817",
"license": "mit",
"hash": 1071666849611592700,
"line_mean": 35.1324894515,
"line_max": 764,
"alpha_frac": 0.5291589789,
"autogenerated": false,
"ratio": 3.212319003676195,
"config_test": false... |
#!/bin/env python
import json
from os.path import abspath
import os
from uuid import uuid4
import cPickle
import fcntl # for locking
class FileCollection:
"""Implements a poor man's schema-free database with an interface similar to
that of PyMongo. Supports only a tiny subset of the PyMongo interface and is
inte... | {
"repo_name": "jgasthaus/antaresia",
"path": "filecollection.py",
"copies": "1",
"size": "4864",
"license": "mit",
"hash": -625146870218064300,
"line_mean": 25.2918918919,
"line_max": 78,
"alpha_frac": 0.5768914474,
"autogenerated": false,
"ratio": 3.3567977915804,
"config_test": false,
"has_... |
#!/bin/env python
import json
import os
from collections import defaultdict, Counter
from itertools import chain
# jurisdiction -> year -> [gazettes]
gazettes = {}
jurisdictions = json.load(open('_data/jurisdictions.json'))
def write_year(juri, year, gazettes):
provincial = juri != "ZA"
juri_info = jurisdic... | {
"repo_name": "Code4SA/opengazettes",
"path": "bin/build-index.py",
"copies": "1",
"size": "4522",
"license": "mit",
"hash": 8701053630757308000,
"line_mean": 30.6223776224,
"line_max": 122,
"alpha_frac": 0.5519681557,
"autogenerated": false,
"ratio": 3.2532374100719426,
"config_test": false,
... |
#!/bin/env python
import json
import os
import re
import os.path
import tarfile
import fnmatch
import sys
from pprint import pprint
from pandaharvester.harvestercore.queue_config_mapper import QueueConfigMapper
from pandaharvester.harvestercore.plugin_factory import PluginFactory
from pandaharvester.harvestercore.plug... | {
"repo_name": "PanDAWMS/panda-harvester",
"path": "pandaharvester/harvestertest/read_shared_file_messenger_files.py",
"copies": "2",
"size": "2886",
"license": "apache-2.0",
"hash": -3561476124490086400,
"line_mean": 35.075,
"line_max": 84,
"alpha_frac": 0.7920997921,
"autogenerated": false,
"rat... |
#!/bin/env python
import logging
import falcon
import config
import model
import json
import jwt
class RequireJSON(object):
@classmethod
def process_request(cls, req, resp):
if not req.client_accepts_json:
raise falcon.HTTPNotAcceptable(
'This API only supports responses en... | {
"repo_name": "arksega/peregrino",
"path": "hunterprice.py",
"copies": "1",
"size": "6338",
"license": "apache-2.0",
"hash": 5982248447091689000,
"line_mean": 31.5025641026,
"line_max": 80,
"alpha_frac": 0.5722625434,
"autogenerated": false,
"ratio": 4.042091836734694,
"config_test": false,
"... |
#!/bin/env python
import logging
import os
from common.utils import Util
from kafka import KafkaProducer
from kafka import KafkaConsumer as KC
from kafka.partitioner.roundrobin import RoundRobinPartitioner
from kafka.common import TopicPartition
class KafkaTopic(object):
def __init__(self,topic,server,port,zk_s... | {
"repo_name": "kpeiruza/incubator-spot",
"path": "spot-ingest/common/kafka_client.py",
"copies": "1",
"size": "3935",
"license": "apache-2.0",
"hash": 4487495061344345000,
"line_mean": 32.0672268908,
"line_max": 161,
"alpha_frac": 0.6439644219,
"autogenerated": false,
"ratio": 3.7872954764196343,... |
#!/bin/env python
import logging
import os
import random
import click
import delegator
import yaml
KEY_PATH = "gcloud_elastic_ansible"
KEYS_PATH = 'elastic-keys'
YAML_PATH = "vars/common.yml"
HOSTS_PATH = 'elastic-hosts'
class GCloudError(Exception):
def __init__(self, message):
super().__init__(message... | {
"repo_name": "godatadriven/provision-training-environment",
"path": "elastic/deploy-elastic.py",
"copies": "1",
"size": "4794",
"license": "mit",
"hash": 7833115256965035000,
"line_mean": 29.7307692308,
"line_max": 106,
"alpha_frac": 0.6115978306,
"autogenerated": false,
"ratio": 3.3879858657243... |
#!/bin/env python
import math
#import simtk.openmm.app as soa
#import simtk.unit as su
import sys,os
import numpy as np
from .fhet import hetnames,cofactors
import copy
MASS = {'O':15.999, 'N':14.010,
'C':12.010, 'H': 1.008,
'F':19.000,
'Na':22.99, 'NA':22.99,
'P':30.9... | {
"repo_name": "yangjincai/fpdb",
"path": "build/lib/fpdb/fpdb.py",
"copies": "2",
"size": "42133",
"license": "mit",
"hash": 7109993376877580000,
"line_mean": 33.3382233089,
"line_max": 158,
"alpha_frac": 0.4939121354,
"autogenerated": false,
"ratio": 3.276537833424061,
"config_test": false,
... |
#!/bin/env python
import math
import sympy
from sympy.integrals import intpoly
import numpy as np
from sympy.abc import I, J, K, N
from sympy import Sum
from sympy.geometry import Triangle, Point
from sympy.matrices import Matrix
from sympy.printing.cxxcode import cxxcode
x,y,z = sympy.symbols('x,y,z')
n01_x,n01_y,n01_... | {
"repo_name": "erdc/proteus",
"path": "scripts/gen_eqp_quad.py",
"copies": "1",
"size": "4663",
"license": "mit",
"hash": 8963980240564464000,
"line_mean": 35.1472868217,
"line_max": 153,
"alpha_frac": 0.5389234398,
"autogenerated": false,
"ratio": 2.610862262038074,
"config_test": false,
"ha... |
#!/bin/env python
import mysql.connector
import sys, getopt
import yaml
import openpyxl
USERNAME = 'root'
PASSWORD = 'bismillah'
HOST = 'localhost'
DATABASE = 'analytics'
PORT = 3306
def query_mysql(query_string):
print "Try to open sql..."
cnx = mysql.connector.connect(user=USERNAME, password=PASSWORD, data... | {
"repo_name": "sidthrive/dho",
"path": "assets/reports/reporting1.py",
"copies": "1",
"size": "3655",
"license": "mit",
"hash": -3817504276781939700,
"line_mean": 25.875,
"line_max": 108,
"alpha_frac": 0.5343365253,
"autogenerated": false,
"ratio": 3.622398414271556,
"config_test": false,
"ha... |
#/bin/env python
import numpy as N
def gcd(a,b):
"""Return greatest common divisor using Euclid's Algorithm."""
while b:
a, b = b, a % b
return a
class Frac(object):
def __init__(self, num, denom):
self.num = num
self.denom = denom
self.reduce()
return
... | {
"repo_name": "rupertnash/subgrid",
"path": "libd3q15/eigenvectors.py",
"copies": "2",
"size": "8712",
"license": "mit",
"hash": 8077268294684511000,
"line_mean": 27.4705882353,
"line_max": 209,
"alpha_frac": 0.4679752066,
"autogenerated": false,
"ratio": 2.936299292214358,
"config_test": false... |
#!/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import sys, os
import argparse
def uqi(x,y):
"""A Universal Image Quality Index, named Q."""
x = np.array([float(i) for i in x])
y = np.array([float(i) for i in y])
cov = np.cov(x,y)
a_var = cov[0][0]
b_var = cov[1][1]
ab_... | {
"repo_name": "yangjincai/Xq2EFT",
"path": "oldScriptResult/amoeba_vs_QEM_1765264/Q.py",
"copies": "1",
"size": "3957",
"license": "apache-2.0",
"hash": 2770450520009120000,
"line_mean": 31.7024793388,
"line_max": 92,
"alpha_frac": 0.5476370988,
"autogenerated": false,
"ratio": 2.9398216939078754... |
#! /bin/env python
import numpy as np
import yaml
class ConstantScalars(object):
"""Service component that returns scalars.
"""
def initialize(self, filename):
"""Initialize the component from a file.
Parameters
----------
filename : str
Name of initialization... | {
"repo_name": "csdms/coupling",
"path": "pymt/services/constant/constant.py",
"copies": "1",
"size": "3507",
"license": "mit",
"hash": 8885352902498938000,
"line_mean": 20.2545454545,
"line_max": 62,
"alpha_frac": 0.4750499002,
"autogenerated": false,
"ratio": 4.554545454545455,
"config_test": ... |
#! /bin/env python
import numpy as np
from .igrid import IGrid
from .utils import (
args_as_numpy_arrays,
coordinates_to_numpy_matrix,
get_default_coordinate_names,
get_default_coordinate_units,
)
MAXSIZE = np.iinfo(int).max
class UnstructuredPoints(IGrid):
def __init__(self, *args, **kwds):
... | {
"repo_name": "csdms/pymt",
"path": "pymt/grids/unstructured.py",
"copies": "1",
"size": "8082",
"license": "mit",
"hash": -64158463460125020,
"line_mean": 27.4577464789,
"line_max": 92,
"alpha_frac": 0.5456570156,
"autogenerated": false,
"ratio": 3.6405405405405404,
"config_test": false,
"ha... |
#!/bin/env python
import numpy
##import pylab
from math import *
def Mean (myArray):
return sum(myArray)/len(myArray)
def Var (myArray):
mean = Mean(myArray)
mean2 = Mean(myArray**2)
N = len(myArray)+0.0
return N/(N-1) * (mean2 - mean**2)
def NaiveStandardError(myArray):
# calculate the standar... | {
"repo_name": "b3sigma/fourd",
"path": "pyvis/PIMCPy/CalcStatistics.py",
"copies": "1",
"size": "1466",
"license": "mit",
"hash": 7321186055867784000,
"line_mean": 22.6451612903,
"line_max": 75,
"alpha_frac": 0.587994543,
"autogenerated": false,
"ratio": 2.9087301587301586,
"config_test": false... |
#!//bin/env python
import numpy
import unittest
import openravepy
import subprocess
import os
import sys
# Find the bh_280 URDF file
from catkin.find_in_workspaces import find_in_workspaces
share_directories = find_in_workspaces(search_dirs=['share'],
project='or_urdf',
path='test_data/'
)
if... | {
"repo_name": "personalrobotics/or_urdf",
"path": "tests/test_urdf_loader.py",
"copies": "1",
"size": "2858",
"license": "bsd-3-clause",
"hash": 8836952657177671000,
"line_mean": 33.0238095238,
"line_max": 74,
"alpha_frac": 0.621763471,
"autogenerated": false,
"ratio": 3.4684466019417477,
"conf... |
#!/bin/env python
import numpy
import theano
import theano.tensor as T
from hidden import HiddenLayer
# start-snippet-2
class MLP(object):
"""Multi-Layer Perceptron Class
A multilayer perceptron is a feedforward artificial neural network model
that has one layer or more of hidden units and nonlinear acti... | {
"repo_name": "Sentimentron/Dracula",
"path": "mlp.py",
"copies": "1",
"size": "3146",
"license": "bsd-3-clause",
"hash": 474864321680346750,
"line_mean": 35.5813953488,
"line_max": 92,
"alpha_frac": 0.6176096631,
"autogenerated": false,
"ratio": 4.1286089238845145,
"config_test": false,
"has... |
#! /bin/env python
import numpy, operator, os, sys
import mvpa.datasets
import mvpa.measures.noiseperturbation
import mvpa.clfs.lars
import PEATSA.Core as Core
class StructureClassifier(object):
"""Classification algorithm for analysis of structural mutations"""
def __init__(self):
return
... | {
"repo_name": "dmnfarrell/peat",
"path": "PEATSA/Core/Classify.py",
"copies": "1",
"size": "16427",
"license": "mit",
"hash": -7856518060546381000,
"line_mean": 43.6385869565,
"line_max": 144,
"alpha_frac": 0.5920740245,
"autogenerated": false,
"ratio": 4.554200166343222,
"config_test": false,
... |
#! /bin/env python
import os, math, operator
import optparse, sys
import PEAT_SA.Core as Core
#In KJ per mol kelvin
GasConstant = 8.314472E-3
def VitalitiesForDrug(drugData, substrateData, combination='Average', verbose=True):
print '\nCalculating vitalities for %s' % drugData
print '\nUsing %s of substrate val... | {
"repo_name": "dmnfarrell/peat",
"path": "PEATSA/Tools/HIVTools/Vitality.py",
"copies": "1",
"size": "5426",
"license": "mit",
"hash": -338058257350458700,
"line_mean": 35.4161073826,
"line_max": 144,
"alpha_frac": 0.7316623664,
"autogenerated": false,
"ratio": 3.239402985074627,
"config_test":... |
#! /bin/env python
import os
from textwrap import dedent
from typing import Any, Dict, Generator, Iterable, Optional, Type
from isort._future import dataclass
from isort.main import _build_arg_parser
from isort.settings import _DEFAULT_SETTINGS as config
OUTPUT_FILE = os.path.abspath(
os.path.join(os.path.dirname... | {
"repo_name": "timothycrosley/isort",
"path": "scripts/build_config_option_docs.py",
"copies": "1",
"size": "6495",
"license": "mit",
"hash": 2236439956731546600,
"line_mean": 29.4929577465,
"line_max": 188,
"alpha_frac": 0.5393379523,
"autogenerated": false,
"ratio": 3.9652014652014653,
"confi... |
#! /bin/env python
import os
from typing import Any, Dict, Generator, Iterable, Type
from isort.profiles import profiles
OUTPUT_FILE = os.path.abspath(
os.path.join(os.path.dirname(os.path.abspath(__file__)), "../docs/configuration/profiles.md")
)
HEADER = """Built-in Profile for isort
========
The following pr... | {
"repo_name": "timothycrosley/isort",
"path": "scripts/build_profile_docs.py",
"copies": "2",
"size": "1130",
"license": "mit",
"hash": 3282473908977725000,
"line_mean": 25.9047619048,
"line_max": 146,
"alpha_frac": 0.6805309735,
"autogenerated": false,
"ratio": 3.4138972809667676,
"config_test... |
#!/bin/env python
import os
import logging
import json
from common.utils import Util
class Worker(object):
def __init__(self,db_name,hdfs_app_path,kafka_consumer,conf_type,processes):
self._initialize_members(db_name,hdfs_app_path,kafka_consumer,conf_type,processes)
def _initialize_members(self,db... | {
"repo_name": "kpeiruza/incubator-spot",
"path": "spot-ingest/pipelines/proxy/worker.py",
"copies": "1",
"size": "2534",
"license": "apache-2.0",
"hash": -5305900533751125000,
"line_mean": 37.9846153846,
"line_max": 234,
"alpha_frac": 0.5524861878,
"autogenerated": false,
"ratio": 3.7374631268436... |
#!/bin/env python
import os
import os.path
import subprocess
import sys
DJANGO_BASE = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../'))
PROJECT_BASE = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../..'))
# if there's no venv, create a virtualenv
VENV_DIR = ... | {
"repo_name": "boosh/pwlocker",
"path": "pwlocker/build/build.py",
"copies": "2",
"size": "1475",
"license": "mit",
"hash": -5255737863429634000,
"line_mean": 30.4042553191,
"line_max": 97,
"alpha_frac": 0.6922033898,
"autogenerated": false,
"ratio": 3.3146067415730336,
"config_test": false,
... |
#!/bin/env python
import os
import re
import datetime
import shelve
SLOT_TOTAL = 3200
LOWEST_SLOT = 80
SLOT_NOT_IN_WHITE_LIST = 200
SCALE_DOWN_RATIO = 0.85
VIP_SCALE_DOWN_RATIO = 0.7
USER_LIST = {
'online': 3000,
'offline': 700,
'nobody': 3000,
}
VIP_LIST = ['robin']
def GetCPURatio():
r... | {
"repo_name": "fxsjy/shuttle",
"path": "sandbox/sch.py",
"copies": "2",
"size": "10795",
"license": "bsd-3-clause",
"hash": 6336772569139820000,
"line_mean": 33.1613924051,
"line_max": 154,
"alpha_frac": 0.5480314961,
"autogenerated": false,
"ratio": 3.195677915926584,
"config_test": false,
"... |
#!/bin/env python
import os
import sys
import datetime
import dateutil.tz
import jinja2
DEFAULT_POSTS_PATH = './_posts'
POST_TEMPLATE = 'post.template'
def get_title():
try:
return sys.argv[1]
except IndexError:
raise RuntimeError("You need to add the title as a parameter")
def format_titl... | {
"repo_name": "JAORMX/JAORMX.github.io",
"path": "create_post.py",
"copies": "1",
"size": "1572",
"license": "mit",
"hash": -4323045087244550000,
"line_mean": 23.1846153846,
"line_max": 75,
"alpha_frac": 0.6348600509,
"autogenerated": false,
"ratio": 3.5089285714285716,
"config_test": false,
... |
#!/bin/env python
import os
import sys
import random
import logging
import delegator
import yaml
import click
KEY_PATH = "gcloud_ansible"
KEYS_PATH = 'keys'
YAML_PATH = "vars/common.yml"
HOSTS_PATH = 'hosts'
class GCloudError(Exception):
def __init__(self, message):
super().__init__(message)
def create_... | {
"repo_name": "godatadriven/provision-training-environment",
"path": "deploy.py",
"copies": "1",
"size": "4316",
"license": "mit",
"hash": 4516167022171280000,
"line_mean": 29.609929078,
"line_max": 108,
"alpha_frac": 0.6179332715,
"autogenerated": false,
"ratio": 3.264750378214826,
"config_tes... |
#!/bin/env python
import os
import sys
import random
import logging
import delegator
import yaml
import click
KEY_PATH = "gcloud_nlp_ansible"
KEYS_PATH = 'nlp-keys'
YAML_PATH = "vars/common.yml"
HOSTS_PATH = 'nlp-hosts'
class GCloudError(Exception):
def __init__(self, message):
super().__init__(message)
... | {
"repo_name": "godatadriven/provision-training-environment",
"path": "nlp/deploy-nlp.py",
"copies": "1",
"size": "5594",
"license": "mit",
"hash": -2154561295437197300,
"line_mean": 33.5308641975,
"line_max": 315,
"alpha_frac": 0.6331784054,
"autogenerated": false,
"ratio": 3.2656158785755984,
... |
#!/bin/env python
import os
import sys
import random
import logging
import delegator
import yaml
import click
KEY_PATH= "gcloud_nlp_ansible"
KEYS_PATH = 'nlp-with-dl-keys'
YAML_PATH = "vars/common.yml"
HOSTS_PATH = 'nlp-with-dl-hosts'
class GCloudError(Exception):
def __init__(self, message):
super().__i... | {
"repo_name": "godatadriven/provision-training-environment",
"path": "nlp-with-dl/deploy-nlp-with-dl.py",
"copies": "1",
"size": "5581",
"license": "mit",
"hash": -2473711505155430000,
"line_mean": 33.450617284,
"line_max": 315,
"alpha_frac": 0.6328614944,
"autogenerated": false,
"ratio": 3.26183... |
#!/bin/env python
import os
import sys
import stat
def set_executable(top):
error_count=0
def set_exec(name):
mode = os.stat(name).st_mode
new_mode = mode
if new_mode & stat.S_IRUSR:
new_mode = new_mode | stat.S_IXUSR
if new_mode & stat.S_IRGRP:
new_mode =... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/577848_Set_executable_mode_where_needed_directories/recipe-577848.py",
"copies": "1",
"size": "1885",
"license": "mit",
"hash": 8035760985748879000,
"line_mean": 33.9074074074,
"line_max": 84,
"alpha_frac": 0.5055702918,
"autogenerated": fal... |
#!/bin/env python
import os
import sys
import time
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
if len(sys.argv) < 3:
print "python plot_job_chart.py [jobid] [imgdir]"
sys.exit(-1)
jobid = sys.argv[1]
img_dir = sys.argv[2]
map_stat = {}
reduce_stat = {}
order_by_t... | {
"repo_name": "baidu/shuttle",
"path": "sandbox/plot_job_chart.py",
"copies": "2",
"size": "2900",
"license": "bsd-3-clause",
"hash": -4917036773764654000,
"line_mean": 26.8846153846,
"line_max": 150,
"alpha_frac": 0.6486206897,
"autogenerated": false,
"ratio": 2.539404553415061,
"config_test":... |
#!/bin/env python
import os
import sys
import time
import socket
from kubernetes import client, config
PADDLE_JOB_NAME = os.getenv("PADDLE_JOB_NAME")
NAMESPACE = os.getenv("NAMESPACE")
PORT = os.getenv("PSERVER_PORT")
if os.getenv("KUBERNETES_SERVICE_HOST", None):
config.load_incluster_config()
else:
config.loa... | {
"repo_name": "Yancey1989/cloud",
"path": "docker/k8s_tools.py",
"copies": "1",
"size": "2330",
"license": "apache-2.0",
"hash": 6118942372122756000,
"line_mean": 30.9178082192,
"line_max": 72,
"alpha_frac": 0.6450643777,
"autogenerated": false,
"ratio": 3.1529093369418133,
"config_test": false... |
#!/bin/env python
import os
import sys
import xml.etree.ElementTree as ET
__doc__ = '''\
mmg to flc:
Converts Metrics Machine group files (.mmg) to
FontLab-compatible class files (.flc).
usage:
python mmg2flc.py file.mmg
'''
class Group(object):
def __init__(self, name, keyglyph, side, glyphs):
self.n... | {
"repo_name": "adobe-type-tools/kern-dump",
"path": "UFOkerning/mmg2flc.py",
"copies": "1",
"size": "3562",
"license": "mit",
"hash": 7071547969353988000,
"line_mean": 24.6258992806,
"line_max": 152,
"alpha_frac": 0.4823133071,
"autogenerated": false,
"ratio": 3.616243654822335,
"config_test": ... |
#! /bin/env python
import os
import sys
import numpy as np
from ...grids import RasterField
class BovError(Exception):
pass
class MissingRequiredKeyError(BovError):
def __init__(self, opt):
self.opt = opt
def __str__(self):
return "%s: Missing required key" % self.opt
class BadKeyVa... | {
"repo_name": "csdms/coupling",
"path": "deprecated/printers/bov/bov_io.py",
"copies": "1",
"size": "7113",
"license": "mit",
"hash": 78591313097873020,
"line_mean": 24.7717391304,
"line_max": 83,
"alpha_frac": 0.5643188528,
"autogenerated": false,
"ratio": 3.481644640234949,
"config_test": fal... |
#! /bin/env python
import os
import xml.dom.minidom
from collections import namedtuple
from xml.etree.ElementTree import ElementTree
import numpy as np
from six.moves import xrange
from ...grids import UnstructuredField
from .vtk import (
InvalidEncodingError,
InvalidFormatError,
assemble_vtk_elements,
... | {
"repo_name": "csdms/coupling",
"path": "deprecated/printers/vtk/vtu.py",
"copies": "2",
"size": "8567",
"license": "mit",
"hash": 4040110255689636400,
"line_mean": 25.0395136778,
"line_max": 88,
"alpha_frac": 0.6061631843,
"autogenerated": false,
"ratio": 3.6799828178694156,
"config_test": fal... |
#! /bin/env python
import os
import xml.dom.minidom
_VALID_ENCODINGS = set(['ascii', 'base64', 'raw'])
_VALID_FORMATS = set(['ascii', 'base64', 'raw', 'appended'])
_VTK_POSSIBLE_PIECE_SECTIONS = [
'Points', 'Coordinates', 'PointData', 'Cells', 'CellData',
]
class VtkError(Exception):
pass
class InvalidFor... | {
"repo_name": "csherwood-usgs/landlab",
"path": "landlab/io/vtk/writer.py",
"copies": "6",
"size": "3569",
"license": "mit",
"hash": 8689600873493286000,
"line_mean": 22.1753246753,
"line_max": 75,
"alpha_frac": 0.6018492575,
"autogenerated": false,
"ratio": 3.74501573976915,
"config_test": fal... |
#!/bin/env python
import os,sys,binascii,re,time
version = "2.0.0.0"
class clean_wtmps:
def __init__(self):
self.original = ""
self.goodData = ""
def main(self):
print version
if not len(sys.argv) > 1 or str(sys.argv[1]) == "-h":
print "usage: clean_wtmps.py file [tty] [time]"
sys.exit(1)
if not o... | {
"repo_name": "DarthMaulware/EquationGroupLeaks",
"path": "Leak #4 - Don't Forget Your Base/EQGRP-Auction-File/Linux/bin/clean_wtmps.py",
"copies": "1",
"size": "3792",
"license": "unlicense",
"hash": -5921855902730190000,
"line_mean": 24.9726027397,
"line_max": 77,
"alpha_frac": 0.6173523207,
"aut... |
#!/bin/env python
import os,sys
def plotPolicyGraph(file):
pgfile = open(file,'r')
basename = '.'.join(file.split('.')[:-1])
graphfile = open(basename+'.dot','w')
pomdpfile = open('-'.join(file.split('-')[:-1])+'.pomdp','r')
POMDP = {}
actions = []
observations = []
while actions == [] ... | {
"repo_name": "ronaldahmed/robot-navigation",
"path": "neural-navigation-with-lstm/MARCO/POMDP/plotPolicyGraph.py",
"copies": "2",
"size": "1225",
"license": "mit",
"hash": 3264830702471352300,
"line_mean": 38.5161290323,
"line_max": 95,
"alpha_frac": 0.5502040816,
"autogenerated": false,
"ratio"... |
#!/bin/env python
import os, sys, re
from datetime import datetime, timedelta
import urllib
import_uri = 'http://vss-s-db01.sth.basefarm.net:8082/solr3/xplaycms/dataimport?command=full-import&clean=false&wt=json'
clean_uri = 'http://vss-s-db01.sth.basefarm.net:8082/solr3/xplaycms/update?commit=true&wt=json'
status_uri... | {
"repo_name": "bundgaard/toolbox",
"path": "python_date.py",
"copies": "1",
"size": "3779",
"license": "artistic-2.0",
"hash": -7969164468911876000,
"line_mean": 58.046875,
"line_max": 256,
"alpha_frac": 0.7112992855,
"autogenerated": false,
"ratio": 3.616267942583732,
"config_test": false,
"... |
#!/bin/env python
import os, sys, traceback
def _genAll(d=None,verbose=1):
if not d: d = '.'
if not os.path.isabs(d):
d = os.path.normpath(os.path.join(os.getcwd(),d))
L = ['reference/genreference.py',
'userguide/genuserguide.py',
'graphguide/gengraphguide.py',
'../tools/docc... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/deps/reportlab/docs/genAll.py",
"copies": "2",
"size": "1308",
"license": "bsd-3-clause",
"hash": -8539081445512829000,
"line_mean": 34.3513513514,
"line_max": 95,
"alpha_frac": 0.5435779817,
"autogenerated": false,
"ratio": 3.22167487... |
#!/bin/env python
import os, sys, traceback
def _genAll(verbose=1):
from reportlab.lib.testutils import setOutDir
setOutDir(__name__)
from reportlab.lib.testutils import testsFolder
topDir=os.path.dirname(testsFolder)
L = [os.path.join(topDir,f) for f in (
'docs/reference/genreference.py... | {
"repo_name": "nakagami/reportlab",
"path": "docs/genAll.py",
"copies": "1",
"size": "1499",
"license": "bsd-3-clause",
"hash": 4889906131832950000,
"line_mean": 31.5869565217,
"line_max": 97,
"alpha_frac": 0.5436957972,
"autogenerated": false,
"ratio": 3.316371681415929,
"config_test": false,
... |
#!/bin/env/python
import os,time,json,shutil,sys
AGGREGATED_UPDATE='update'
MIRRORED_UPDATE='archive'
SCRIPT_HOME=os.getcwd()
sites = {}
def compute_repository_content(name,urls,timestamp):
compositeArtifacts = "<?xml version='1.0' encoding='UTF-8'?>\n\
<?compositeArtifactRepository version='1.0.0'?>\n\
... | {
"repo_name": "diverse-project/diverse-studio",
"path": "composite_updatesite/diverse.platform.composite.updatesite/redirects.py",
"copies": "3",
"size": "4812",
"license": "epl-1.0",
"hash": 7287494430833187000,
"line_mean": 32.6573426573,
"line_max": 132,
"alpha_frac": 0.6228179551,
"autogenerate... |
#!/bin/env python
import pygame
import socket
import sys
import os
PORTNUM = 7777
UPDATE = .0001
DEAD = .005
if(len(sys.argv) < 2):
print "IP Address to connect to? "
ipaddr = raw_input()
else:
ipaddr = sys.argv[1]
pygame.init()
pygame.joystick.init()
joysticks = [pygame.joystick.Joystick(x) for x in range(pygam... | {
"repo_name": "gdcolella/BotBallRemote",
"path": "util/joystickClient.py",
"copies": "1",
"size": "2268",
"license": "mit",
"hash": -719942218116751000,
"line_mean": 18.7217391304,
"line_max": 85,
"alpha_frac": 0.6706349206,
"autogenerated": false,
"ratio": 2.5033112582781456,
"config_test": fa... |
#! /bin/env python
import pymedia
import threading
class Sound(object):
def __init__(self, filename):
self.name = filename
self.snd=None
self.playing=False
def load(self, filename):
self.stop()
self.name = filename
def play(self, loops=0):
self.thread=threa... | {
"repo_name": "flyher/pymo",
"path": "pc/pymedia_mixer.py",
"copies": "1",
"size": "1895",
"license": "mit",
"hash": 3356746979507018000,
"line_mean": 26.8676470588,
"line_max": 132,
"alpha_frac": 0.507651715,
"autogenerated": false,
"ratio": 3.6095238095238096,
"config_test": false,
"has_no_... |
#!/bin/env python
import random
import string
import argparse
import os
import os.path
import sys
import re
args = None
MAGIC = '8888'
PREFIX = 'f.'
def rand_str(size=1024 * 1024, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def parse_args():
pars... | {
"repo_name": "olcf/pcircle",
"path": "legacy/pcircle/genfiles.py",
"copies": "1",
"size": "1886",
"license": "apache-2.0",
"hash": -1160262454282553000,
"line_mean": 24.1466666667,
"line_max": 99,
"alpha_frac": 0.5827147402,
"autogenerated": false,
"ratio": 3.349911190053286,
"config_test": fa... |
#!/bin/env python
import re
import requests
from collections import OrderedDict, namedtuple
from datetime import datetime
from bs4 import BeautifulSoup
from flask import Flask, jsonify, render_template
app = Flask(__name__)
EVENT_LINK_HREF_RE = re.compile(r'^/events/view/(?P<id>\d+)$')
APP_URL = 'https://calendar.dall... | {
"repo_name": "cag/dms-calendar-viewer",
"path": "server.py",
"copies": "1",
"size": "2321",
"license": "mit",
"hash": -3198309510654585300,
"line_mean": 39.6842105263,
"line_max": 153,
"alpha_frac": 0.6140577835,
"autogenerated": false,
"ratio": 3.346320346320346,
"config_test": false,
"has_... |
#!/bin/env python
import re
import sys
regdelexp = re.compile('[-,.\/]')
regnumeric = re.compile('[0-9]+')
def split_line_by_delimiter(line,regex):
splitline = []
splititr = regex.finditer(line)
lstart = 0
for i in splititr:
(mstart,mend) = i.span()
if lstart != mstart:
spl... | {
"repo_name": "osynge/grid_version_sort",
"path": "grid_virt_sort_release/org_desy_grid_virt_sort_release.py",
"copies": "1",
"size": "2959",
"license": "mit",
"hash": -912788758119701500,
"line_mean": 25.185840708,
"line_max": 62,
"alpha_frac": 0.5488340656,
"autogenerated": false,
"ratio": 3.32... |
#!/bin/env python
import requests
import time
from datetime import date
from datetime import datetime, timedelta
import json, ast
from multiprocessing import Pool
import csv
# config
import os
import sys
import commands
import ConfigParser
config = ConfigParser.RawConfigParser()
configFile = os.path.dirname(os.path.a... | {
"repo_name": "irontarkus95/MET-Oracle-lstm-weather-prediction",
"path": "DarkSky-API to CSV/writeData.py",
"copies": "1",
"size": "4311",
"license": "mit",
"hash": -6184743181958307000,
"line_mean": 26.4585987261,
"line_max": 108,
"alpha_frac": 0.6230572953,
"autogenerated": false,
"ratio": 3.45... |
#!/bin/env python
import roslib;
from geometry_msgs.msg import *
import rospy
import tf2_ros
import time
from math import sqrt
from baris_utils import *
class TransformListener:
def __init__(self, useTf = False, withRobot=True, transform_root = 'base_link'):
self.online = withRobot
if self.online: #False?
... | {
"repo_name": "kirmani/hlpr_cadence",
"path": "third_party/hlpr_hello_world/scripts/modules/utilities/transform_listener.py",
"copies": "1",
"size": "3536",
"license": "mit",
"hash": 7687195910023371000,
"line_mean": 34.7171717172,
"line_max": 102,
"alpha_frac": 0.6742081448,
"autogenerated": false... |
#!/bin/env python
import roslib;
from std_msgs.msg import Float64
from dynamixel_msgs.msg import JointState
import rospy
from math import *
#returns the plausible root of sin(x)*c1+cos(x)*c2 = c3
def trigSolution(params):
y = atan(abs(params[1]/params[0]))
h = params[2]/sqrt(params[0]*params[0]+params[1]*params[1... | {
"repo_name": "kirmani/hlpr_cadence",
"path": "third_party/hlpr_hello_world/scripts/modules/utilities/kinect_pantilt.py",
"copies": "1",
"size": "3383",
"license": "mit",
"hash": -2934221934336758000,
"line_mean": 37.0112359551,
"line_max": 168,
"alpha_frac": 0.6240023648,
"autogenerated": false,
... |
#!/bin/env python
import shutil
import unittest
import os
from click.testing import CliRunner
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from alembic_migrate import migrations
Base = declarative_base()
class User(Base):
__tablename__ =... | {
"repo_name": "timmartin19/Flask-Migrate",
"path": "tests/explosion.py",
"copies": "1",
"size": "1467",
"license": "mit",
"hash": -5725406376747011000,
"line_mean": 28.9387755102,
"line_max": 91,
"alpha_frac": 0.6721199727,
"autogenerated": false,
"ratio": 4.008196721311475,
"config_test": true... |
#! /bin/env python
import socket
import numpy as np
import multiprocessing
import os
import time
import sys
mics = [
("mic0", 228, [("../../megno_grid/nbody_mic","nbody")]),
("mic1", 228, [("../../megno_grid/nbody_mic","nbody")]),
("localhost", 20, [("../../megno... | {
"repo_name": "hannorein/mic_offload_server",
"path": "client/offload.py",
"copies": "1",
"size": "2751",
"license": "mit",
"hash": 830998087249445400,
"line_mean": 26.51,
"line_max": 144,
"alpha_frac": 0.5517993457,
"autogenerated": false,
"ratio": 3.122587968217934,
"config_test": false,
"h... |
#!/bin/env python
import socket
import time
import re
import six
from commons import *
def sanitize(text):
return re.sub('[^0-9a-zA-Z]+', '_', text)
class GraphiteReporter:
def __init__(self, host='127.0.0.1', port=2003):
"""initialize reporter with graphite carbon connection information"""
self.host = host
... | {
"repo_name": "NoUsername/uptester",
"path": "graphite_reporter.py",
"copies": "1",
"size": "1024",
"license": "mit",
"hash": 7888947307040648000,
"line_mean": 28.2571428571,
"line_max": 97,
"alpha_frac": 0.67578125,
"autogenerated": false,
"ratio": 3.075075075075075,
"config_test": false,
"h... |
#!/bin/env python
import sqlite3
from collections import defaultdict
import matplotlib.pyplot as plt
def plot_climate(cond, rx, ext=""):
con = sqlite3.connect("data%s.db" % ext)
cur = con.cursor()
sql = """
SELECT climate, year, after_merch_bdft
FROM trees_fvsaggregate
WHERE co... | {
"repo_name": "Ecotrust/growth-yield-batch",
"path": "scripts/plot_climate.py",
"copies": "2",
"size": "2139",
"license": "bsd-3-clause",
"hash": 2787660842450412500,
"line_mean": 27.9189189189,
"line_max": 87,
"alpha_frac": 0.5511921459,
"autogenerated": false,
"ratio": 3.1363636363636362,
"co... |
#! /bin/env python
#import stacktracer
#stacktracer.trace_start("trace.html",interval=1,auto=True) # Set auto flag to always update file!
try:
from mpi4py import MPI
except ImportError:
pass
import models
import sys
from pypdevs.simulator import Simulator, loadCheckpoint
mn = sys.argv[1]
args = {}
args["setT... | {
"repo_name": "kdheepak89/pypdevs",
"path": "test/testmodels/experiment.py",
"copies": "1",
"size": "11519",
"license": "apache-2.0",
"hash": 4082866979946980000,
"line_mean": 32.9793510324,
"line_max": 151,
"alpha_frac": 0.6442399514,
"autogenerated": false,
"ratio": 3.222097902097902,
"config... |
#!/bin/env python
import subprocess
from i3pystatus import Status, get_module
from i3pystatus.weather import weathercom
from i3pystatus.updates import pacman, auracle
status = Status(standalone=True)
green="#1A8C01"
white="#FFFFFF"
purple="#D175FF"
red="#FF6600"
blue="#4581DD"
yellow="#DDDD11"
#Clock
status.register(... | {
"repo_name": "vectorman1/Config-Files",
"path": ".config/i3/i3pystatus/config.py",
"copies": "1",
"size": "3048",
"license": "apache-2.0",
"hash": -522180258672207000,
"line_mean": 22.8818897638,
"line_max": 98,
"alpha_frac": 0.6218265743,
"autogenerated": false,
"ratio": 2.970617042115573,
"c... |
#!/bin/env python
import subprocess
import os
import sys
LIBRARY = ""
DIRECTORY="."
MODES = ["thumb","arm"]
INTERWORKING = ["yes","no"]
MAKE_CMDLINE_FMT = "make %(what)s MODE=%(mode)s INTERWORK=%(interwork)s"
def print_banner(lib,mode,interwork):
print ""
print "=================================================... | {
"repo_name": "j0t4/espardino",
"path": "openlibs/build.py",
"copies": "1",
"size": "1232",
"license": "mit",
"hash": -7969567304010370000,
"line_mean": 19.1967213115,
"line_max": 91,
"alpha_frac": 0.5974025974,
"autogenerated": false,
"ratio": 3.1834625322997416,
"config_test": false,
"has_n... |
#!/bin/env python
import subprocess
import shutil
import glob
import argparse
import os
name = 'apex_cmz_h2co'
parser = argparse.ArgumentParser(description='Make latex files.')
parser.add_argument('--referee', default=False,
action='store_true', help='referee style?')
parser.add_argument('--texpat... | {
"repo_name": "adamginsburg/APEX_CMZ_H2CO",
"path": "tex/make.py",
"copies": "2",
"size": "2424",
"license": "bsd-3-clause",
"hash": -7060784545873937000,
"line_mean": 28.5609756098,
"line_max": 81,
"alpha_frac": 0.5952970297,
"autogenerated": false,
"ratio": 3.3713490959666204,
"config_test": ... |
#! /bin/env python
import sys
from harvester.couchdb_init import get_couchdb
from harvester.post_processing.couchdb_runner import CouchDBCollectionFilter
from harvester.sns_message import publish_to_harvesting
from harvester.sns_message import format_results_subject
PATH_DELIM = '/'
def setprop(obj, path, val, keyEr... | {
"repo_name": "barbarahui/harvester",
"path": "harvester/post_processing/batch_update_couchdb_by_collection.py",
"copies": "1",
"size": "2468",
"license": "bsd-3-clause",
"hash": -3417971395931810000,
"line_mean": 33.7605633803,
"line_max": 111,
"alpha_frac": 0.5984602917,
"autogenerated": false,
... |
#! /bin/env python
import sys
from optparse import OptionParser
import copy
import matplotlib as mpl
mpl.use('Agg')
import pylab
import scipy.optimize
import numpy
from numpy import array
import dadi
#import demographic models
import gillettii_models
def runModel(outFile, nuC_start, T_start):
# Parse the SNP... | {
"repo_name": "rmccoy7541/egillettii-rnaseq",
"path": "scripts/model_C.synonymous.py",
"copies": "1",
"size": "3607",
"license": "mit",
"hash": 7853020921858616000,
"line_mean": 30.9203539823,
"line_max": 186,
"alpha_frac": 0.6174105905,
"autogenerated": false,
"ratio": 3.47495183044316,
"confi... |
#! /bin/env python
import sys
from optparse import OptionParser
import copy
import matplotlib
matplotlib.use('Agg')
import pylab
import scipy.optimize
import numpy
from numpy import array
import dadi
import os
#call ms program from within dadi, using optimized parameters (converted to ms units)
core = "-n 1 0.922 -n 2... | {
"repo_name": "rmccoy7541/egillettii-rnaseq",
"path": "scripts/snp_performance_analysis.py",
"copies": "1",
"size": "3682",
"license": "mit",
"hash": -6656796103224141000,
"line_mean": 31.298245614,
"line_max": 157,
"alpha_frac": 0.6175991309,
"autogenerated": false,
"ratio": 3.399815327793167,
... |
#!/bin/env python
import sys
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim
import ssl
import subprocess
argvs = sys.argv
HV_NAME = argvs[1]
VSPHERE_HOST = argvs[2]
ZABBIX_SERVER = 'Zabbixサーバホスト名またはIPアドレス'
VSPHERE_ID = 'vSphereユーザ名'
VSPHERE_PASSWORD = 'vSphereパスワード'
ZABBIX_SENDER = 'zabbix_... | {
"repo_name": "tech-sketch/zabbix_book_sample",
"path": "2nd_edition/Chapter12/12-4_set_hv_hostname.py",
"copies": "1",
"size": "1204",
"license": "apache-2.0",
"hash": -5123071368613320000,
"line_mean": 28.5897435897,
"line_max": 130,
"alpha_frac": 0.6291161179,
"autogenerated": false,
"ratio": ... |
#!/bin/env python
import sys
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim
import ssl
argvs = sys.argv
HOSTNAME = argvs[1]
ADD_MEMORY_SIZE = argvs[2]
context = ssl._create_unverified_context()
si = SmartConnect(
host="ホスト名",
user="ユーザ名",
pwd="パスワード",
port=443,
sslCont... | {
"repo_name": "tech-sketch/zabbix_book_sample",
"path": "2nd_edition/Chapter11/11-2_add_memory.py",
"copies": "1",
"size": "1091",
"license": "apache-2.0",
"hash": 8503430475939829000,
"line_mean": 26.3076923077,
"line_max": 99,
"alpha_frac": 0.5971830986,
"autogenerated": false,
"ratio": 3.76325... |
#!/bin/env python
import sys
from zabbix_api import ZabbixAPI
from datetime import datetime
ZABBIX_URL = 'http://Zabbixサーバホスト名またはIPアドレス/zabbix'
ZABBIX_LOGIN = 'Zabbixサーバログイン名'
ZABBIX_PASSWORD = 'Zabbixサーバログインパスワード'
TRIGGER_NAME = 'トリガー名'
argvs = sys.argv
HV_NAME = argvs[1]
VM_NAME = argvs[2]
class ZbxOperation:
de... | {
"repo_name": "tech-sketch/zabbix_book_sample",
"path": "2nd_edition/Chapter12/12-5_change_dependency.py",
"copies": "1",
"size": "1368",
"license": "apache-2.0",
"hash": 7066944938628419000,
"line_mean": 34.8333333333,
"line_max": 103,
"alpha_frac": 0.684496124,
"autogenerated": false,
"ratio": ... |
#! /bin/env python
import sys
import argparse
from harvester.couchdb_sync_db_by_collection import delete_collection
def confirm_deletion(cid):
prompt = "Are you sure you want to delete all couchdb " + \
"documents for %s? yes to confirm\n" % cid
while True:
ans = raw_input(prompt).lower()... | {
"repo_name": "ucldc/harvester",
"path": "scripts/delete_couchdb_collection.py",
"copies": "3",
"size": "1071",
"license": "bsd-3-clause",
"hash": 7310985548791228000,
"line_mean": 32.46875,
"line_max": 79,
"alpha_frac": 0.6311858077,
"autogenerated": false,
"ratio": 3.952029520295203,
"config_... |
#! /bin/env python
import sys
import os
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.image_harvest import harvest_image_for_doc
EMAIL_RETURN_ADDRESS = os.environ.get('EMAIL_RETURN_ADDRESS',
'example@example.com')
# csv delim email addresses... | {
"repo_name": "ucldc/harvester",
"path": "scripts/queue_image_harvest_on_doc_id_list.py",
"copies": "3",
"size": "2421",
"license": "bsd-3-clause",
"hash": 1897223265144836900,
"line_mean": 38.0483870968,
"line_max": 124,
"alpha_frac": 0.6216439488,
"autogenerated": false,
"ratio": 3.613432835820... |
#! /bin/env python
import sys
import os
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.post_processing.couchdb_runner import CouchDBWorker
from harvester.image_harvest import harvest_image_for_doc
from harvester.couchdb_init import get_couchdb
import couchdb #couchdb-python
from ... | {
"repo_name": "mredar/harvester",
"path": "scripts/remove_object_and_harvest_image_26094.py",
"copies": "3",
"size": "1283",
"license": "bsd-3-clause",
"hash": -3901734387027005400,
"line_mean": 31.075,
"line_max": 70,
"alpha_frac": 0.6095089634,
"autogenerated": false,
"ratio": 3.614084507042253... |
#! /bin/env python
import sys
import os
from harvester.post_processing.couchdb_runner import CouchDBWorker
from harvester.image_harvest import harvest_image_for_doc
from harvester.couchdb_init import get_couchdb
import couchdb #couchdb-python
from dplaingestion.selector import delprop
EMAIL_RETURN_ADDRESS = os.enviro... | {
"repo_name": "mredar/harvester",
"path": "scripts/remove_field_list_from_collection_docs.py",
"copies": "3",
"size": "1844",
"license": "bsd-3-clause",
"hash": -2838084089191288000,
"line_mean": 30.2542372881,
"line_max": 77,
"alpha_frac": 0.6214750542,
"autogenerated": false,
"ratio": 3.5945419... |
#!/bin/env python
import sys
import os
import shutil
def main(args):
if not len(args)==3:
print "Not enough arguments."
return
source_path = args[1]
install_path = args[2]
print "Source:", source_path
print "Install:", install_path
lib_source_path = os.path.join(source_path, "DE... | {
"repo_name": "piratecrew/rez-ffmpeg",
"path": "dependencies/post_install.py",
"copies": "1",
"size": "1809",
"license": "mit",
"hash": 5654549715147947000,
"line_mean": 37.4893617021,
"line_max": 77,
"alpha_frac": 0.5174129353,
"autogenerated": false,
"ratio": 3.76875,
"config_test": true,
"... |
#!/bin/env python
import sys
import os
import postcodes
import gp_reader
import chem_reader
import progress
import csv
class pdata(object):
fields = [
"sha",
"pct",
"practice",
"bnfcode",
"bnfname",
"chemical_code",
"chemical_name",
"product",
... | {
"repo_name": "barryrowlingson/dispensr",
"path": "inst/python/prescriptions.py",
"copies": "1",
"size": "2850",
"license": "mit",
"hash": -2342556130361147000,
"line_mean": 26.9411764706,
"line_max": 103,
"alpha_frac": 0.5480701754,
"autogenerated": false,
"ratio": 3.4050179211469533,
"config_... |
#!/bin/env python
import sys
import re
import subprocess
def get_change_log(previous_sha):
args = ['git', '--no-pager', 'log', '--merges', '--grep', 'Merge pull request', '--pretty=format:"%h|%s|%b|%p"', 'master...{}'.format(previous_sha)]
log = subprocess.check_output(args)
changes = []
for line in l... | {
"repo_name": "moritz9/redash",
"path": "bin/get_changes.py",
"copies": "1",
"size": "1057",
"license": "bsd-2-clause",
"hash": 3676032167682647000,
"line_mean": 29.2285714286,
"line_max": 152,
"alpha_frac": 0.5553453169,
"autogenerated": false,
"ratio": 3.657439446366782,
"config_test": false,... |
#!/bin/env python
import sys
import snmp_helper
import time
import email_helper
import pickle
def delta(intList):
print "DELTA: intList=%s" %intList
retList=[]
for i in range(len(intList)-1):
retList.append(intList[i+1]-intList[i])
return retList
def addNone(alist,nmod):
rlist=[]
for n... | {
"repo_name": "patrebert/pynet_cert",
"path": "class3/ex1.py",
"copies": "1",
"size": "2237",
"license": "apache-2.0",
"hash": 8122399035152002000,
"line_mean": 26.6172839506,
"line_max": 82,
"alpha_frac": 0.6535538668,
"autogenerated": false,
"ratio": 2.8827319587628866,
"config_test": false,
... |
#!/bin/env python
import sys
import snmp_helper
import time
import pygal
def delta(intList):
print "DELTA: intList=%s" %intList
retList=[]
for i in range(len(intList)-1):
retList.append(intList[i+1]-intList[i])
return retList
def addNone(alist,nmod):
rlist=[]
for n in range(len(alist))... | {
"repo_name": "patrebert/pynet_cert",
"path": "class3/x2.py",
"copies": "1",
"size": "2001",
"license": "apache-2.0",
"hash": -4420126220751079000,
"line_mean": 26.4109589041,
"line_max": 85,
"alpha_frac": 0.6206896552,
"autogenerated": false,
"ratio": 2.516981132075472,
"config_test": false,
... |
#! /bin/env python
import sys
import xml.dom.minidom
import numpy as np
from six.moves import xrange
from .encoders import encode
from .vtktypes import np_to_vtk_type, sys_to_vtk_endian
class VtkExtent(object):
def __init__(self, shape):
if len(shape) > 3:
raise ValueError("number of dimensi... | {
"repo_name": "csdms/coupling",
"path": "deprecated/printers/vtk/vtkxml.py",
"copies": "2",
"size": "7023",
"license": "mit",
"hash": 6592295152612303000,
"line_mean": 30.2133333333,
"line_max": 83,
"alpha_frac": 0.5809483127,
"autogenerated": false,
"ratio": 3.7778375470683163,
"config_test": ... |
#!/bin/env python
import sys
sys.path.append('app/')
import app
import os, os.path
import gzip
import shutil
from jinja2 import Environment, FileSystemLoader
import time
import codecs
from optparse import OptionParser
TEMPLATE_DIR = "app/templates"
class FakeTime:
def time(self):
return 1261130520.0
# Ha... | {
"repo_name": "newsapps/flask-bakery",
"path": "render_templates.py",
"copies": "1",
"size": "2214",
"license": "mit",
"hash": 667360228347164800,
"line_mean": 34.1428571429,
"line_max": 110,
"alpha_frac": 0.6007226739,
"autogenerated": false,
"ratio": 3.69,
"config_test": false,
"has_no_keyw... |
#! /bin/env python
import time
start = time.clock()
print("Starting at time " + str(start))
from mpi4py import MPI
import models
import sys
from pypdevs.simulator import Simulator, loadCheckpoint
model = models.AutoDistChain(3, totalAtomics=500, iterations=1)
sim = Simulator(model)
sim.setAllowLocalReinit(True)
sim.... | {
"repo_name": "kdheepak89/pypdevs",
"path": "test/testmodels/reinit.py",
"copies": "1",
"size": "1093",
"license": "apache-2.0",
"hash": 5265834956931572000,
"line_mean": 27.7631578947,
"line_max": 63,
"alpha_frac": 0.7429094236,
"autogenerated": false,
"ratio": 2.9069148936170213,
"config_test... |
#!/bin/env python
import tornado.httpclient
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import re
import hashlib
import hmac
import base64
import random
from datetime import datetime
import os
import sys
import logging
class ProxyHandler(tornado.web.RequestHandler):
... | {
"repo_name": "majin-boo/njord",
"path": "resign/app.py",
"copies": "1",
"size": "1998",
"license": "bsd-3-clause",
"hash": 41426736786624136,
"line_mean": 30.21875,
"line_max": 147,
"alpha_frac": 0.6586586587,
"autogenerated": false,
"ratio": 3.659340659340659,
"config_test": false,
"has_no_... |
#! /bin/env python
import warnings
import yaml
from ...printers.nc.read import field_fromfile
from .interpolate import create_interpolators
from .time_series_names import get_time_series_names
class TimeInterpolator(object):
def __init__(self):
self._shape = ()
self._spacing = ()
self._o... | {
"repo_name": "csdms/pymt",
"path": "pymt/services/gridreader/gridreader.py",
"copies": "2",
"size": "3395",
"license": "mit",
"hash": -4844466786713254000,
"line_mean": 26.6016260163,
"line_max": 83,
"alpha_frac": 0.582916053,
"autogenerated": false,
"ratio": 3.8711516533637402,
"config_test":... |
#!/bin/env python
import yum
import rpm
import os
import sys
import subprocess
import string
import pprint
if len(sys.argv) == 1:
print "\nUsage: SarHelper.py [logfile] [start_time] [end_time]"
print "Example: SarHelper.py /var/log/sa/sa04 10:00:00 14:30:00\n"
else:
#get the required arguments [logfile] [st... | {
"repo_name": "FuriousRabbit/SarHelper",
"path": "SarHelper.py",
"copies": "1",
"size": "2788",
"license": "mit",
"hash": 5403922752967795000,
"line_mean": 36.6756756757,
"line_max": 173,
"alpha_frac": 0.5480631277,
"autogenerated": false,
"ratio": 3.1790193842645382,
"config_test": false,
"h... |
#! /bin/env python
# insert into traceroute values('2.2.2.',now(),'1.1.1.1 * 3.3.3.3 5.5.5.5','as1 * as3 as5');
# insert into trraw values('1.1.1.1',now(),' 1 * 2 * 3 * 4 * ')
#traceroute -An 166.111.132.1
#traceroute to 166.111.132.1 (166.111.132.1), 30 hops max, 60 byte packets
# 1 115.25.86.1 [AS4538] 0.667 ms 0... | {
"repo_name": "neoyk/search",
"path": "trace.py",
"copies": "1",
"size": "3669",
"license": "apache-2.0",
"hash": -8341522822157091000,
"line_mean": 40.6931818182,
"line_max": 118,
"alpha_frac": 0.6143363314,
"autogenerated": false,
"ratio": 2.4443704197201868,
"config_test": false,
"has_no_k... |
#!/bin/env python
"""latex.py
Character translation utilities for LaTeX-formatted text.
Usage:
- unicode(string,'latex')
- ustring.decode('latex')
are both available just by letting "import latex" find this file.
- unicode(string,'latex+latin1')
- ustring.decode('latex+latin1')
where latin1 can be replaced by any... | {
"repo_name": "katerina-k/katerina-k.github.io",
"path": "_site/bib/source/latex.py",
"copies": "2",
"size": "14855",
"license": "mit",
"hash": -2140419039659136500,
"line_mean": 26.9755178908,
"line_max": 100,
"alpha_frac": 0.4916863009,
"autogenerated": false,
"ratio": 2.858379834519915,
"con... |
#!/bin/env python
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | {
"repo_name": "TristanCacqueray/demo-code",
"path": "examples/underwater-fractal-creature.py",
"copies": "1",
"size": "11091",
"license": "apache-2.0",
"hash": -8088942718963699000,
"line_mean": 30.5085227273,
"line_max": 76,
"alpha_frac": 0.5292579569,
"autogenerated": false,
"ratio": 3.16614330... |
#! /bin/env python
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | {
"repo_name": "yv/bllip-parser",
"path": "second-stage/programs/wlle/gavper-bestfeatures.py",
"copies": "3",
"size": "2282",
"license": "apache-2.0",
"hash": -8133481034469399000,
"line_mean": 28.2564102564,
"line_max": 117,
"alpha_frac": 0.6213847502,
"autogenerated": false,
"ratio": 3.431578947... |
#!/bin/env python
# @lint-avoid-python-3-compatibility-imports
import os
import re
import sys
import optparse
def main(argv):
# args parser
parser = optparse.OptionParser()
parser.add_option("--install_dir", dest="install_dir", type="string",
default=None, help="Absolute path to gene... | {
"repo_name": "seem-sky/proxygen",
"path": "proxygen/lib/utils/gen_trace_event_constants.py",
"copies": "4",
"size": "6237",
"license": "bsd-3-clause",
"hash": 7629156881091790000,
"line_mean": 37.263803681,
"line_max": 80,
"alpha_frac": 0.5545935546,
"autogenerated": false,
"ratio": 3.7891859052... |
#!/bin/env python
"""./lucan.py [OPTIONS] SOURCE OUTPUT
Arguments:
SOURCE: Path to the source image file
OUTPUT: Path to the output image file
Options:
-v, --verbose Output everything to stdout
-V, --version Output version number
-g, --generations <n> Amount of generation... | {
"repo_name": "devoxel/lucan",
"path": "lucan.py",
"copies": "1",
"size": "1582",
"license": "mit",
"hash": 7662509176698443000,
"line_mean": 28.8490566038,
"line_max": 82,
"alpha_frac": 0.5840707965,
"autogenerated": false,
"ratio": 3.628440366972477,
"config_test": false,
"has_no_keywords":... |
""" Main file for uhc parser, run this from the commandline """
#Copyright 2017 Tobias Gustavsson <tobias at rackrymd.se>
#License - See LICENSE file
from sys import stdout
import json
import jsonpickle
import click
from logbook import Logger, StreamHandler
from parser import parse, score_count
#TODO: Games restarts w... | {
"repo_name": "gylle/uhc_parser",
"path": "main.py",
"copies": "1",
"size": "1923",
"license": "mit",
"hash": 7957217275138785000,
"line_mean": 33.3392857143,
"line_max": 89,
"alpha_frac": 0.631825273,
"autogenerated": false,
"ratio": 3.587686567164179,
"config_test": false,
"has_no_keywords"... |
#!/bin/env python
"""Monasca Agent wrapper for Nagios Event Broker module MK Livestatus
The main difference between this plugin and nagios_wrapper.py is that
instead of executing Nagios plugins directly, this will query them
from the Event Broker API using the MK Livestatus module. This
solution is faster ... | {
"repo_name": "sapcc/monasca-agent",
"path": "monasca_agent/collector/checks_d/mk_livestatus.py",
"copies": "1",
"size": "5027",
"license": "bsd-3-clause",
"hash": -3999429108300038700,
"line_mean": 38.5826771654,
"line_max": 101,
"alpha_frac": 0.5679331609,
"autogenerated": false,
"ratio": 4.452... |
#!/bin/env python
"""Monitoring Agent plugin for InfluxDB HTTP/API checks.
"""
import monasca_agent.collector.checks.services_checks as services_checks
import monasca_agent.common.util as util
import requests
GAUGE = 'gauge'
RATE = 'rate'
TYPE_KEY = 'type'
INFLUXDB_NAME_KEY = 'influxdb_name'
DIMENSIONS_KEY = '_dime... | {
"repo_name": "sapcc/monasca-agent",
"path": "monasca_agent/collector/checks_d/influxdb.py",
"copies": "1",
"size": "10977",
"license": "bsd-3-clause",
"hash": -4910874567524423000,
"line_mean": 49.5852534562,
"line_max": 119,
"alpha_frac": 0.5670948347,
"autogenerated": false,
"ratio": 3.8354297... |
#!/bin/env python
# mosaic geo-tiff Aster Global DEM
# create roi-pac and Gamma headers
# by Ran Novitsky Nof 2011
import Image,sys,os,glob,getopt,scipy.misc,time
from pylab import *
def usage():
sys.exit("""
A script for reading Aster Global DEM files and converting to ROI-PAC dem
or Gamma DEM.
usage:
"""+ s... | {
"repo_name": "peterwilletts24/Python-Scripts",
"path": "GDEM.py",
"copies": "1",
"size": "8511",
"license": "mit",
"hash": -964303143026617300,
"line_mean": 33.4574898785,
"line_max": 217,
"alpha_frac": 0.5752555516,
"autogenerated": false,
"ratio": 3.1371175820125323,
"config_test": false,
... |
################################################################################
## Python script to automate the creation of the field class hierarchy.
## WARNING: Execution of this script with resulting in overwriting exiting
## file with the same name in the output directory.
###########################... | {
"repo_name": "LimitPointSystems/SheafSystem",
"path": "fields/fields/generate_classes.py",
"copies": "1",
"size": "11836",
"license": "apache-2.0",
"hash": 1662045523269347800,
"line_mean": 30.8172043011,
"line_max": 82,
"alpha_frac": 0.4482933423,
"autogenerated": false,
"ratio": 3.807011900932... |
# upojflbcez
from copy import deepcopy
numberRow = 6
numberCol = 50
matrix = []
for i in range(0,numberRow):
row = []
for j in range(0,numberCol):
row.append(0)
matrix.append(row)
def printMatrix(matrix):
for row in matrix:
print str(row) + "\n"
def getOffset(initial, offset, to... | {
"repo_name": "gdorion/advent-of-code",
"path": "2016/python/day8.py",
"copies": "1",
"size": "1938",
"license": "mit",
"hash": 4575566914097577500,
"line_mean": 24.84,
"line_max": 61,
"alpha_frac": 0.5288957688,
"autogenerated": false,
"ratio": 3.485611510791367,
"config_test": false,
"has_n... |
import copy
def initDict():
dict = {}
for i in range(300):
dict[i] = [];
return dict
def process(instructs):
bots = initDict()
outputs = initDict()
for instruct in copy.deepcopy(instructs):
if 'goes to' in instruct:
val = int(instruct.split(' ')[1])
bot... | {
"repo_name": "gdorion/advent-of-code",
"path": "2016/python/day10.py",
"copies": "1",
"size": "1738",
"license": "mit",
"hash": 5071193479254460000,
"line_mean": 25.7384615385,
"line_max": 78,
"alpha_frac": 0.5155350978,
"autogenerated": false,
"ratio": 3.713675213675214,
"config_test": false,... |
import math
class Point(object):
X = 0
Y = 0
def __init__(self, x, y):
self.X = x
self.Y = y
def __repr__(self):
return str(self)
def __str__(self):
return "Point(%s,%s)" % (self.X, self.Y)
def __eq__(self, other):
return self.X == other.X and self.Y ==... | {
"repo_name": "gdorion/advent-of-code",
"path": "2015/python/Day3/houses2.py",
"copies": "1",
"size": "2868",
"license": "mit",
"hash": 8943055774232323000,
"line_mean": 22.9,
"line_max": 110,
"alpha_frac": 0.5327754533,
"autogenerated": false,
"ratio": 3.7392438070404173,
"config_test": false,... |
import re
# Could be done with regex i guess
def isSupportingTLS(input):
for i,c in enumerate(input):
if i < len(input) - 3:
if input[i + 1] == input[i + 2]:
if input[i] != input[i + 1]:
if input[i + 2] != input[i + 3]:
if input[i] ==... | {
"repo_name": "gdorion/advent-of-code",
"path": "2016/python/day7.py",
"copies": "1",
"size": "2353",
"license": "mit",
"hash": -5809226127524976000,
"line_mean": 28.7848101266,
"line_max": 80,
"alpha_frac": 0.536761581,
"autogenerated": false,
"ratio": 3.699685534591195,
"config_test": false,
... |
#Butterscotch: capacity -1, durability -2, flavor 6, texture 3, calories 8
#Cinnamon: capacity 2, durability 3, flavor -2, texture -1, calories 3
class Ingredients(object):
def __init__(self, name, capacity, durability, flavor, texture, calories):
self.name = name
self.capacity = int(capacity)
... | {
"repo_name": "gdorion/advent-of-code",
"path": "2015/python/Day15/cake2.py",
"copies": "1",
"size": "2206",
"license": "mit",
"hash": -2006126581174719700,
"line_mean": 36.3898305085,
"line_max": 169,
"alpha_frac": 0.5902085222,
"autogenerated": false,
"ratio": 2.6356033452807646,
"config_test... |
from operator import attrgetter
class Sue(object):
def __init__(self, number, attributes):
self.number = number
self.attributes = attributes
self.cluesMatchCount = 0
aunts = []
clues = {"children": 3, 'cats': 7, 'samoyeds': 2, 'pomeranians': 3, 'akitas': 0, 'vizslas': 0, 'goldfish': 5, 't... | {
"repo_name": "gdorion/advent-of-code",
"path": "2015/python/Day16/day16.py",
"copies": "1",
"size": "2551",
"license": "mit",
"hash": 5033535573441967000,
"line_mean": 31.7051282051,
"line_max": 147,
"alpha_frac": 0.588004704,
"autogenerated": false,
"ratio": 3.0153664302600474,
"config_test":... |
import copy
import random
buffs = ['Shield', 'Poison', 'Recharge']
class Effect(object):
def __init__(self, nbTurns, damage, healing, armor, manaRecharge):
self.nbTurns = int(nbTurns)
self.remainingTurns = 0
self.damage = int(damage)
self.healing = int(healing)
self.armor ... | {
"repo_name": "gdorion/advent-of-code",
"path": "2015/python/Day22/day22.py",
"copies": "1",
"size": "5879",
"license": "mit",
"hash": -2961870017473807400,
"line_mean": 29.6197916667,
"line_max": 240,
"alpha_frac": 0.577989454,
"autogenerated": false,
"ratio": 3.235553109521189,
"config_test":... |
import copy
col = 100
row = 100
grid = []
step = 100
initial = '.#.#.# '\
'...##. '\
'#....# '\
'..#... '\
'#.#..# '\
'####..'
charGrid = initial.split(' ')
initial = open('data.txt').read().splitlines()
charGrid = initial
def onMap(grid, x, y):
ret... | {
"repo_name": "gdorion/advent-of-code",
"path": "2015/python/Day18/day18.py",
"copies": "1",
"size": "2137",
"license": "mit",
"hash": -605907456986859600,
"line_mean": 20.37,
"line_max": 67,
"alpha_frac": 0.4520355639,
"autogenerated": false,
"ratio": 3.4523424878836835,
"config_test": false,
... |
import itertools
def permutations(people):
results = []
for i in range(len(people)):
row = []
for j in range(len(people)):
row.append(people[j])
results.append(row)
return results
def leftOf(person, people):
for i, p in enumerate(people):
if p == person:
... | {
"repo_name": "gdorion/advent-of-code",
"path": "2015/python/Day13/table.py",
"copies": "1",
"size": "2003",
"license": "mit",
"hash": 6886897308991451000,
"line_mean": 19.8645833333,
"line_max": 93,
"alpha_frac": 0.5726410384,
"autogenerated": false,
"ratio": 3.6551094890510947,
"config_test":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.