text stringlengths 0 1.05M | meta dict |
|---|---|
"""Auto correlation function."""
import numpy
from .pearson import Corr
def Acf(poly, dist, n_steps=None, **kws):
"""
Auto-correlation function.
Args:
poly (numpoly.ndpoly):
Polynomial of interest. Must have ``len(poly) > n_steps``.
dist (Distribution):
Defines th... | {
"repo_name": "jonathf/chaospy",
"path": "chaospy/descriptives/correlation/auto_correlation.py",
"copies": "1",
"size": "1072",
"license": "mit",
"hash": -829764258417253000,
"line_mean": 29.6285714286,
"line_max": 77,
"alpha_frac": 0.5606343284,
"autogenerated": false,
"ratio": 3.561461794019933... |
# Autodesk DXF 2018 Reference
link_tpl = 'https://help.autodesk.com/view/OARX/2018/ENU/?guid={guid}'
# Autodesk DXF 2014 Reference
# link_tpl = 'https://docs.autodesk.com/ACD/2014/ENU/files/{guid}.htm'
main_index_guid = 'GUID-235B22E0-A567-4CF6-92D3-38A2306D73F3' # main index
reference_guids = {
"HEADER": "GUID-E... | {
"repo_name": "mozman/ezdxf",
"path": "src/ezdxf/pp/reflinks.py",
"copies": "1",
"size": "6779",
"license": "mit",
"hash": -2565059092821307000,
"line_mean": 56.9401709402,
"line_max": 75,
"alpha_frac": 0.718985101,
"autogenerated": false,
"ratio": 1.8237826203927898,
"config_test": false,
"h... |
""" Auto Encoder Example.
Using an Stacked auto encoder on MNIST handwritten digits, and evaluating its performance with different scores
References:
Tflearn.org/examples
Tensorflow.org
Links:
[MNIST Dataset] http://yann.lecun.com/exdb/mnist/
Method and Examples Used:
[1] An simple example from Tflean,... | {
"repo_name": "jdvala/ProjectTF",
"path": "Auto_encoder_evaluation/stacked_autoencoder.py",
"copies": "1",
"size": "4424",
"license": "mit",
"hash": -2229620147926744600,
"line_mean": 39.962962963,
"line_max": 144,
"alpha_frac": 0.7613019892,
"autogenerated": false,
"ratio": 3.7491525423728813,
... |
# AutoEncoders
# Importing the libraries
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable
# Importing the dataset
movies = pd.read_csv('ml-1m/movies.dat', sep = '::', header = None... | {
"repo_name": "balazssimon/ml-playground",
"path": "udemy/Deep Learning A-Z/Volume 2 - Unsupervised Deep Learning/Part 6 - AutoEncoders (AE)/ae.py",
"copies": "1",
"size": "5375",
"license": "apache-2.0",
"hash": 2993012245673109500,
"line_mean": 53.8571428571,
"line_max": 237,
"alpha_frac": 0.677767... |
# Auto Encoders
"""
TODO:
* Need a validation and testing thats better than just measuring rmse. Can't find something
great.
* Loss increases after 3 epochs.
"""
from yann.network import network
def autoencoder ( dataset= None, verbose = 1 ):
"""
This function is a demo exampl... | {
"repo_name": "anuraGit19/Deep-Learning-projects",
"path": "Auto Encoders and Generative Adversarial Networks (GAN) /Auto_Encoders_yann.py",
"copies": "1",
"size": "13964",
"license": "mit",
"hash": -1799902453879875000,
"line_mean": 37.2602739726,
"line_max": 111,
"alpha_frac": 0.4192208536,
"auto... |
# Autoencoder transceiver
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.layers import Dense, Layer, BatchNormalization
from tensorflow.keras import Sequential
import numpy as np
from sklearn.model_selection import train_test_split
import matplotlib.pyplo... | {
"repo_name": "jskDr/jamespy_py3",
"path": "wireless/ae_r5.py",
"copies": "1",
"size": "13114",
"license": "mit",
"hash": -2146753723094127400,
"line_mean": 40.3848920863,
"line_max": 107,
"alpha_frac": 0.5826668985,
"autogenerated": false,
"ratio": 2.1458683081514645,
"config_test": true,
"h... |
# Autoencoder transceiver
"""
[๋ณ์กฐ ๋ฐฉ์]
- ๋ณ์กฐ ๋ฐฉ์์ BPSK๋ฅผ ๊ฐ์ ํจ
- QAM ๊ณ์ด์ด ๋ ๋ ค๋ฉด I,Q ์ฑ๋์ด ๋ฐ๋ก ์กด์ฌํด์ผ ํจ. ๊ทธ๋ฆฌ๊ณ ์ฑ๋์ ๊ณ ๋ คํด์ผ ํจ.
- ์ฑ๋์ ๊ณ ๋ คํ์ง ์์ผ๋ฉด ์ด์งํผ BPSK์ ๋์ผํ๊ฒ ๋์ํ์ฌ ์๋ ์ฝ๋๊ฐ ์ ๋นํจ.
[ํ์ด๋ฉ ์ฑ๋ ๊ณ ๋ ค]
- ์ฑ๋์ด ์๊ฒ ๋๋ฉด, ์์ ๋จ์์๋ ์ฑ๋์ ์์์ผ ์ฑ๋ฅ์ด ์ ๋๋ก ๋์ฌ ์ ์์. ์์ ์ฑ๋์ ์ด๋ป๊ฒ ์ฌ์ฉํ ์ง ๊ณ ๋ฏผํด์ผ ํจ.
์์ ์ฑ๋์ ์ญ์ด ์
๋ ฅ ์ ํธ์ ๊ณฑํด์ง๋ ํํ๊ฐ ๋์ด์ผ ํจ. y * (1/h) ๋๋ MMSE ๋ฐฉ์์ ์ฌ์ฉํ ์ ์์.
- ์์ ์ฑ๋์ด ๊ณ ์ ๋๋ฉด A... | {
"repo_name": "jskDr/jamespy_py3",
"path": "wireless/ae.py",
"copies": "1",
"size": "17632",
"license": "mit",
"hash": -6358180776621540000,
"line_mean": 44.2329192547,
"line_max": 136,
"alpha_frac": 0.584592145,
"autogenerated": false,
"ratio": 1.8705368610326227,
"config_test": true,
"has_n... |
# auto generate code, LiuTaoTao
from lib import *
class LiuD_string_def:
def __init__(self, n1, n2, s):
self.n1 = n1
self.n2 = n2
self.s = s
def walkabout(self, visitor):
return visitor.visit_string_def(self)
class LiuD_opt2:
def __init__(self, s, vlst):
self.s =... | {
"repo_name": "Bookaa/LiuD",
"path": "Ast_LiuD.py",
"copies": "1",
"size": "57884",
"license": "mit",
"hash": 8711160204175620000,
"line_mean": 25.5766758494,
"line_max": 76,
"alpha_frac": 0.51103932,
"autogenerated": false,
"ratio": 3.3524846519170626,
"config_test": false,
"has_no_keywords"... |
# Auto generated by Edalize
def load_module_from_file(name, python_file):
import importlib.util
spec = importlib.util.spec_from_file_location(name, python_file)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
def load_runner_hooks(python_file =... | {
"repo_name": "lowRISC/edalize",
"path": "tests/test_vunit/run.py",
"copies": "1",
"size": "1480",
"license": "bsd-2-clause",
"hash": 3431572838409874000,
"line_mean": 35,
"line_max": 105,
"alpha_frac": 0.7128378378,
"autogenerated": false,
"ratio": 3.148936170212766,
"config_test": false,
"h... |
# Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: Pyquen_ZeemumuJets_pt10_2760GeV_cfi.py --conditions MCHI2_75_V2 -s GEN,SIM --pileup_input das:/Hydjet_Quenched_MinBias_5020GeV/HiFall14-ST... | {
"repo_name": "mverwe/diall",
"path": "test/PYQUEN_2760GeV_GEN_SIM_PU_cfg.py",
"copies": "2",
"size": "13846",
"license": "cc0-1.0",
"hash": -7374012672498809000,
"line_mean": 40.9575757576,
"line_max": 411,
"alpha_frac": 0.5454282825,
"autogenerated": false,
"ratio": 2.8113705583756343,
"confi... |
# Auto generated configuration file
# using:
# Revision: 1.168
# Source: /cvs_server/repositories/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v
# with command line options: GeneratorInterface/AMPTInterface/amptDefault_cfi.py -s GEN --conditions auto:mc --datatier GEN --eventcontent RAWSIM -... | {
"repo_name": "tuos/FlowAndCorrelations",
"path": "model/ampt/production/v2/run0pAuv2x10more/ampt_StringMelting_pAu200GeV_cfg.py",
"copies": "1",
"size": "5887",
"license": "mit",
"hash": -1301357850993969400,
"line_mean": 47.652892562,
"line_max": 181,
"alpha_frac": 0.5768642772,
"autogenerated": ... |
# Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: Configuration/Generator/python/MinBias_8TeV_pythia8_TuneCUETP8M1_cff --condition 75X_mcRun2_asymptotic_v1 -n 10 --eventcontent RAWSIM --rel... | {
"repo_name": "tuos/RpPb2015Analysis",
"path": "omegaXi/genSim/crab2_v03/production/MinBias_8TeV_pythia8_TuneCUETP8M1_cff_GEN_SIM.py",
"copies": "1",
"size": "5256",
"license": "mit",
"hash": -8200064700048477000,
"line_mean": 41.3870967742,
"line_max": 283,
"alpha_frac": 0.7412480974,
"autogenerat... |
# Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: Configuration/GenProduction/python/HI/2015/ReggeGribovPartonMC_EposLHC_5020GeV_PbPb_cfi.py --mc --eventcontent RAWSIM --customise SLHCUpgra... | {
"repo_name": "tuos/FlowAndCorrelations",
"path": "mc/production/src/crab/ReggeGribovPartonMC_EposLHC_5020GeV_PbPb_cfi_py_GEN_SIM.py",
"copies": "2",
"size": "4800",
"license": "mit",
"hash": 2759541290229886000,
"line_mean": 43.0366972477,
"line_max": 419,
"alpha_frac": 0.800625,
"autogenerated": ... |
# Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: step2 --conditions auto:run1_data -s RAW2DIGI,L1Reco,RECO --process AOD -n 10 --data --eventcontent AOD --scenario HeavyIons --datatier AOD... | {
"repo_name": "tuos/RECO2AOD",
"path": "timingSpaceStudy/v1/step2_RAW2DIGI_L1Reco_DIMUONskim_AOD.py",
"copies": "2",
"size": "4533",
"license": "mit",
"hash": -419687830232724160,
"line_mean": 45.2551020408,
"line_max": 189,
"alpha_frac": 0.7954996691,
"autogenerated": false,
"ratio": 2.820784069... |
# AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Table(Component):
"""A Table component.
This is a description of the component.
It's multiple lines long.
Keyword arguments:
- children (a list of or a singular dash component, string or number; o... | {
"repo_name": "plotly/dash",
"path": "tests/unit/development/metadata_test.py",
"copies": "1",
"size": "4448",
"license": "mit",
"hash": 2201075009642935800,
"line_mean": 41.3619047619,
"line_max": 803,
"alpha_frac": 0.7129046763,
"autogenerated": false,
"ratio": 4.084481175390266,
"config_test... |
# AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Webglviewer(Component):
"""A Webglviewer component.
ExampleComponent is an example component.
It takes a property, `label`, and
displays it.
It renders an input with the property `value`
which is ed... | {
"repo_name": "tum-pbs/PhiFlow",
"path": "webglviewer/Webglviewer.py",
"copies": "1",
"size": "2232",
"license": "mit",
"hash": -5414755144803960000,
"line_mean": 47.5217391304,
"line_max": 235,
"alpha_frac": 0.689516129,
"autogenerated": false,
"ratio": 3.783050847457627,
"config_test": false,... |
# Auto generate HTML forms with validators
from flask.ext.wtf import Form
from wtforms import (StringField, SubmitField, TextAreaField, BooleanField,
SelectField, ValidationError)
from wtforms.validators import Required, Length, Email, Regexp
from ..models import Role, User
# WTF form definition
... | {
"repo_name": "Ketouem/flask-web-development",
"path": "src/chapter-10-user-profiles/flasky/app/main/forms.py",
"copies": "1",
"size": "2480",
"license": "mit",
"hash": 2498025084243589600,
"line_mean": 39.6557377049,
"line_max": 78,
"alpha_frac": 0.6346774194,
"autogenerated": false,
"ratio": 4.... |
"""Autogenerate Python files based on a `.tree` definition file.
This module generates the Python files from the custom domain-specific-language
used to declare the nodes that we use during the translation. This way of
describing nodes, allows DRY-ness in the same.
"""
import os
import re
import collections
from text... | {
"repo_name": "pradyunsg/Py2C",
"path": "py2c/tree/node_gen.py",
"copies": "1",
"size": "9944",
"license": "bsd-3-clause",
"hash": -6426635794315890000,
"line_mean": 30.2704402516,
"line_max": 83,
"alpha_frac": 0.4390587289,
"autogenerated": false,
"ratio": 4.386413762681959,
"config_test": fal... |
# auto generates _interface.py
import os
this_dir = os.path.realpath(os.path.split(__file__)[0])
interface_loc = this_dir + os.sep + "_interface.py"
axes_loc = this_dir + os.sep + "axes_bpl.py"
figure_loc = this_dir + os.sep + "figure_bpl.py"
interface = open(interface_loc, "w")
# write a header
interface.write("fro... | {
"repo_name": "gillenbrown/betterplotlib",
"path": "betterplotlib/_generate_interface.py",
"copies": "1",
"size": "3681",
"license": "mit",
"hash": 7907583045896985000,
"line_mean": 37.7578947368,
"line_max": 82,
"alpha_frac": 0.5672371638,
"autogenerated": false,
"ratio": 3.662686567164179,
"c... |
"""Auto-generate the Config class for the processing tool"""
import os
from collections import namedtuple
ConfigItem = namedtuple('ConfigItem', ['typename', 'default', 'description', 'domain'])
ConfigType = namedtuple('ConfigType', ['reader', 'writer', 'typehint'])
configtypes = {'str': ConfigType('str', 'str', 'str'... | {
"repo_name": "awacha/cct",
"path": "codegenerator/cpt2config.py",
"copies": "1",
"size": "15886",
"license": "bsd-3-clause",
"hash": 6080447391335920000,
"line_mean": 59.6335877863,
"line_max": 120,
"alpha_frac": 0.4782827647,
"autogenerated": false,
"ratio": 4.047388535031847,
"config_test": ... |
"""autograder.py: An interface to the autograder infrastructure (named autopy)
This module interfaces the OK Server with Autopy. The actual autograding happens
in a sandboxed environment.
"""
import collections
import datetime
import enum
import json
import logging
import time
import oauthlib.common
import requests
... | {
"repo_name": "Cal-CS-61A-Staff/ok",
"path": "server/autograder.py",
"copies": "1",
"size": "10736",
"license": "apache-2.0",
"hash": 5110375808927019000,
"line_mean": 39.6666666667,
"line_max": 119,
"alpha_frac": 0.6149403875,
"autogenerated": false,
"ratio": 4.03003003003003,
"config_test": f... |
# autograder.py
# -------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to
# http://inst.eecs... | {
"repo_name": "naderm/cs188",
"path": "p4/tracking/autograder.py",
"copies": "1",
"size": "14227",
"license": "bsd-3-clause",
"hash": 3483207499274062300,
"line_mean": 39.3031161473,
"line_max": 138,
"alpha_frac": 0.620721164,
"autogenerated": false,
"ratio": 4.061375963459891,
"config_test": t... |
"""Autograde the iclicker remote submission."""
import os
import sys
import json
GLOBAL_INPUT_JSON_PATH = 'custom_validator_input.json'
def get_tc_json():
"""Get the json for this testcase."""
try:
with open(GLOBAL_INPUT_JSON_PATH) as json_file:
tc = json.load(json_file)
except Excep... | {
"repo_name": "RCOS-Grading-Server/HWserver",
"path": "more_autograding_examples/iclicker_upload/config/custom_validation_code/grader.py",
"copies": "2",
"size": "3702",
"license": "bsd-3-clause",
"hash": -7683175716644254000,
"line_mean": 30.641025641,
"line_max": 85,
"alpha_frac": 0.5559157212,
"... |
"""
Generic Parcellation class:
Contains all the items that define a multi-subject parcellation
Author : Bertrand Thirion, 2005-2008
TODO : add a method 'global field', i.e. non-subject-specific info
"""
import numpy as np
class Parcellation(object):
"""
This is the basic Parcellation class:
It is defined discr... | {
"repo_name": "yarikoptic/NiPy-OLD",
"path": "nipy/neurospin/spatial_models/parcellation.py",
"copies": "1",
"size": "16157",
"license": "bsd-3-clause",
"hash": 3437780936240248300,
"line_mean": 26.3384094755,
"line_max": 81,
"alpha_frac": 0.6124899424,
"autogenerated": false,
"ratio": 3.00595348... |
# AutoIt wrapper generator
from soloud_codegen import *
fo = open("soloud.au3", "w")
"""
Global $dll = DllOpen(@ScriptDir & "\soloud.dll")
Const $CONSTANT = 1234567890
Func _SoLoud_method($param1, $param2, $paramN)
Local $ret = DllCall($dll, "return type e.g. int", "function", "type1 if necessary", "param1 if ... | {
"repo_name": "stievie/Tiny3D",
"path": "ThirdParty/soloud/scripts/gen_autoit.py",
"copies": "2",
"size": "1513",
"license": "mit",
"hash": -8665633762456298000,
"line_mean": 24.6440677966,
"line_max": 156,
"alpha_frac": 0.5684071381,
"autogenerated": false,
"ratio": 2.663732394366197,
"config_... |
"""autolavadox URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | {
"repo_name": "exildev/AutoLavadox",
"path": "autolavadox/urls.py",
"copies": "1",
"size": "1494",
"license": "mit",
"hash": -6255768190452370000,
"line_mean": 41.6857142857,
"line_max": 82,
"alpha_frac": 0.7041499331,
"autogenerated": false,
"ratio": 3.4503464203233256,
"config_test": false,
... |
"""Automabot bot for Discord."""
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), 'r', encoding='utf-8') as f:
long_description = f.read()
setup(
name='automabot',
version='0.0.1.dev20170604', # see PEP... | {
"repo_name": "WyllVern/AutomaBot",
"path": "setup.py",
"copies": "1",
"size": "1602",
"license": "mit",
"hash": -7296568010902015000,
"line_mean": 33.0638297872,
"line_max": 75,
"alpha_frac": 0.5958775765,
"autogenerated": false,
"ratio": 3.356394129979036,
"config_test": false,
"has_no_keyw... |
#automate a log grabber script with telnetlib and ftplib
# LOG_GRABBER is a shell script which will grab the logs from the production logs.
# It may invoke other shell script, perl, shell, python etc to get its job done.
# A generic example: getAccountBalance, 500
# this means getAccountBalance function takes about 5... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/498210_Automate_performance_monitoring_vitelnet_ftp/recipe-498210.py",
"copies": "1",
"size": "1053",
"license": "mit",
"hash": -1634020552321995300,
"line_mean": 22.9318181818,
"line_max": 87,
"alpha_frac": 0.7312440646,
"autogenerated": fa... |
""" Automate Commands """
from paver.easy import *
import paver.doctools
from paver.tasks import task
from pip.req import parse_requirements
from paver.setuputils import (
install_distutils_tasks
)
# -- REQUIRED-FOR: setup, sdist, ...
# NOTE: Adds a lot more python-project related tasks.
install_distutils_tasks()
... | {
"repo_name": "grierson/memsim",
"path": "pavement.py",
"copies": "1",
"size": "2883",
"license": "isc",
"hash": 1441707317306109000,
"line_mean": 23.2268907563,
"line_max": 111,
"alpha_frac": 0.5612209504,
"autogenerated": false,
"ratio": 3.9118046132971505,
"config_test": true,
"has_no_keyw... |
"""Automate creation of AWS resources for Cromwell.
Sets up the AWS batch environment needed to run Cromwell using CloudFormation
templates:
https://docs.opendata.aws/genomics-workflows
CloudFormation suggestions:
- Avoid nodejs4 vs 8 errors when creating AMI
- Check for S3 bucket when creating AWS batch environme... | {
"repo_name": "chapmanb/bcbio-nextgen-vm",
"path": "bcbiovm/aws/cromwell.py",
"copies": "1",
"size": "5926",
"license": "mit",
"hash": -4180349457294497000,
"line_mean": 43.5563909774,
"line_max": 122,
"alpha_frac": 0.6417482281,
"autogenerated": false,
"ratio": 3.660284126003706,
"config_test"... |
"""Automated body part tests for the blender nif scripts."""
# ***** BEGIN LICENSE BLOCK *****
#
# BSD License
#
# Copyright (c) 2005-2011, NIF File Format Library and Tools
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the ... | {
"repo_name": "nightstrike/blender_nif_plugin",
"path": "todo/old_tests/runtest_fo3_bodypart.py",
"copies": "3",
"size": "7428",
"license": "bsd-3-clause",
"hash": -2422262926664332300,
"line_mean": 45.1366459627,
"line_max": 90,
"alpha_frac": 0.6440495423,
"autogenerated": false,
"ratio": 4.0501... |
"""Automated breaking of the Shift Cipher."""
import string
from typing import Callable, Iterable, List
from lantern import score
from lantern.structures import Decryption
ShiftOperator = Callable[[int, int], int]
ShiftFunction = Callable[[int, object], object]
subtract: ShiftOperator = lambda a, b: a - b
add: Shi... | {
"repo_name": "CameronLonsdale/lantern",
"path": "lantern/modules/shift.py",
"copies": "1",
"size": "4329",
"license": "mit",
"hash": 8685323097487562000,
"line_mean": 30.598540146,
"line_max": 116,
"alpha_frac": 0.6581196581,
"autogenerated": false,
"ratio": 4.045794392523365,
"config_test": f... |
"""Automated breaking of the Simple Substitution Cipher."""
import random
import string
from lantern import score
from lantern.analysis.search import hill_climb
from lantern.structures import Decryption
def crack(ciphertext, *fitness_functions, ntrials=30, nswaps=3000):
"""Break ``ciphertext`` using hill climbi... | {
"repo_name": "CameronLonsdale/lantern",
"path": "lantern/modules/simplesubstitution.py",
"copies": "1",
"size": "3626",
"license": "mit",
"hash": 8342910120712188000,
"line_mean": 34.900990099,
"line_max": 120,
"alpha_frac": 0.6729178158,
"autogenerated": false,
"ratio": 3.873931623931624,
"co... |
"""Automated breaking of the Vigenere Cipher."""
import string
from lantern import score
from lantern.modules import shift
from lantern.structures import Decryption
from lantern.analysis.frequency import index_of_coincidence, ENGLISH_IC
from lantern.util import split_columns, remove
# TODO: maybe add finding keype... | {
"repo_name": "CameronLonsdale/lantern",
"path": "lantern/modules/vigenere.py",
"copies": "1",
"size": "4384",
"license": "mit",
"hash": 1795945264985858800,
"line_mean": 34.6422764228,
"line_max": 120,
"alpha_frac": 0.6738138686,
"autogenerated": false,
"ratio": 3.9746146872166817,
"config_tes... |
"""Automated data download and IO."""
# Builtins
import glob
import os
import gzip
import bz2
import hashlib
import shutil
import zipfile
import sys
import math
import logging
from functools import partial, wraps
import time
import fnmatch
import urllib.request
import urllib.error
from urllib.parse import urlparse
imp... | {
"repo_name": "OGGM/oggm",
"path": "oggm/utils/_downloads.py",
"copies": "1",
"size": "75629",
"license": "bsd-3-clause",
"hash": 8808539357977788000,
"line_mean": 31.8393399913,
"line_max": 80,
"alpha_frac": 0.576974441,
"autogenerated": false,
"ratio": 3.464452588181402,
"config_test": false,... |
import boto3
import re
import datetime
import time
import base64
import os
import json
import collections
aws_sns_arn = os.getenv('aws_sns_arn', None)
def send_to_sns(subject, message):
if aws_sns_arn is None:
return
print "Sending notification to: %s" % aws_sns_arn
client = boto3.client('sns')
... | {
"repo_name": "rajeshkrish12/AWS-Lambda_EBS-snapshots",
"path": "lambda_ebs-cleanup.py",
"copies": "1",
"size": "2838",
"license": "mit",
"hash": 1912851715834571500,
"line_mean": 36.84,
"line_max": 108,
"alpha_frac": 0.6469344609,
"autogenerated": false,
"ratio": 3.763925729442971,
"config_tes... |
import boto3
import collections
import datetime
import os
import sys
import json
import itertools
ec = boto3.client('ec2')
aws_sns_arn = os.getenv('aws_sns_arn', None)
def send_to_sns(subject, message):
if aws_sns_arn is None:
return
print "Sending notification to: %s" % aws_sns_arn
client = bot... | {
"repo_name": "rajeshkrish12/AWS-Lambda_EBS-snapshots",
"path": "lambda_ebs-snaps.py",
"copies": "1",
"size": "4901",
"license": "mit",
"hash": -5133958386653117000,
"line_mean": 36.1287878788,
"line_max": 111,
"alpha_frac": 0.5372372985,
"autogenerated": false,
"ratio": 4.302897278314311,
"con... |
#automated error checking for RNAstructure python interface
from __future__ import print_function
import inspect
from functools import wraps
from collections import defaultdict
debug = False
class StructureError(Exception): pass
class RNAstructureInternalError(Exception):pass
lookup_exceptions = defaultdict(lambda:Runt... | {
"repo_name": "mayc2/PseudoKnot_research",
"path": "RNAstructure_Source/RNAstructure_python_interface/Error_handling.py",
"copies": "1",
"size": "2975",
"license": "mit",
"hash": -8086729154579902000,
"line_mean": 34.843373494,
"line_max": 110,
"alpha_frac": 0.5942857143,
"autogenerated": false,
... |
"""Automated rejection and repair of trials in M/EEG."""
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis A. Engemann <denis.engemann@gmail.com>
import os.path as op
from functools import partial
import numpy as np
from s... | {
"repo_name": "autoreject/autoreject",
"path": "autoreject/autoreject.py",
"copies": "1",
"size": "51986",
"license": "bsd-3-clause",
"hash": 7033280375984633000,
"line_mean": 37.3087693441,
"line_max": 79,
"alpha_frac": 0.5671058959,
"autogenerated": false,
"ratio": 3.9637819290888294,
"config... |
"""Discovery of Ubuntu package archive mirrors."""
# Standard library modules.
import logging
# External dependencies.
from bs4 import BeautifulSoup, UnicodeDammit
from humanfriendly import Timer
from humanfriendly.text import format, pluralize
# Modules included in our package.
from apt_mirror_updater import Candi... | {
"repo_name": "xolox/python-apt-mirror-updater",
"path": "apt_mirror_updater/backends/ubuntu.py",
"copies": "1",
"size": "9350",
"license": "mit",
"hash": -5215482179724790000,
"line_mean": 42.691588785,
"line_max": 103,
"alpha_frac": 0.6489839572,
"autogenerated": false,
"ratio": 3.8366844480919... |
"""
Discovery of Debian package archive mirrors.
Here are references to some of the material that I've needed to consult while
working on this module:
- `Notes about sources.list on the Debian wiki <https://wiki.debian.org/SourcesList>`_
- `The Debian backports webpages <https://backports.debian.org/Instructions/>`_... | {
"repo_name": "xolox/python-apt-mirror-updater",
"path": "apt_mirror_updater/backends/debian.py",
"copies": "1",
"size": "7083",
"license": "mit",
"hash": 9153425690774796000,
"line_mean": 41.9272727273,
"line_max": 113,
"alpha_frac": 0.6644077368,
"autogenerated": false,
"ratio": 3.7535771065182... |
"""
Usage: apt-mirror-updater [OPTIONS]
The apt-mirror-updater program automates robust apt-get mirror selection for
Debian and Ubuntu by enabling discovery of available mirrors, ranking of
available mirrors, automatic switching between mirrors and robust package list
updating.
Supported options:
-r, --remote-hos... | {
"repo_name": "xolox/python-apt-mirror-updater",
"path": "apt_mirror_updater/cli.py",
"copies": "1",
"size": "7752",
"license": "mit",
"hash": -939204433055768600,
"line_mean": 36.6310679612,
"line_max": 95,
"alpha_frac": 0.6403508772,
"autogenerated": false,
"ratio": 4.215334420880914,
"config... |
"""Simple, robust and concurrent HTTP requests (designed for one very narrow use case)."""
# Standard library modules.
import logging
import multiprocessing
import signal
# External dependencies.
from humanfriendly import Timer, format_size
from six.moves.urllib.request import urlopen
from stopit import SignalTimeou... | {
"repo_name": "xolox/python-apt-mirror-updater",
"path": "apt_mirror_updater/http.py",
"copies": "1",
"size": "5250",
"license": "mit",
"hash": 7371431026730660000,
"line_mean": 36.5,
"line_max": 110,
"alpha_frac": 0.6394285714,
"autogenerated": false,
"ratio": 4.2752442996742674,
"config_test"... |
"""Sphinx documentation configuration for the `apt-mirror-updater` package."""
import os
import sys
# Add the 'apt-mirror-updater' source distribution's root directory to the module path.
sys.path.insert(0, os.path.abspath(os.pardir))
# -- General configuration -----------------------------------------------------
... | {
"repo_name": "xolox/python-apt-mirror-updater",
"path": "docs/conf.py",
"copies": "1",
"size": "2682",
"license": "mit",
"hash": -7926294532083761000,
"line_mean": 30.9285714286,
"line_max": 87,
"alpha_frac": 0.7080536913,
"autogenerated": false,
"ratio": 3.804255319148936,
"config_test": fals... |
"""Test suite for the ``apt-mirror-updater`` package."""
# Standard library modules.
import decimal
import logging
import os
import time
# External dependencies.
from executor import execute
from executor.contexts import LocalContext
from humanfriendly.testing import TestCase, run_cli
from stopit import TimeoutExcep... | {
"repo_name": "xolox/python-apt-mirror-updater",
"path": "apt_mirror_updater/tests.py",
"copies": "1",
"size": "11477",
"license": "mit",
"hash": 8017068272273459000,
"line_mean": 43.1423076923,
"line_max": 104,
"alpha_frac": 0.636926026,
"autogenerated": false,
"ratio": 4.202489930428414,
"con... |
"""
Support for `Elementary OS`_ package archive mirror selection.
Elementary OS is based on Ubuntu LTS releases and as such this module is a very
thin wrapper for the :mod:`apt_mirror_updater.backends.ubuntu` module.
.. _Elementary OS: https://en.wikipedia.org/wiki/Elementary_OS
"""
# Standard library modules.
imp... | {
"repo_name": "xolox/python-apt-mirror-updater",
"path": "apt_mirror_updater/backends/elementary.py",
"copies": "1",
"size": "3636",
"license": "mit",
"hash": 5297731693977618000,
"line_mean": 30.0769230769,
"line_max": 81,
"alpha_frac": 0.648239824,
"autogenerated": false,
"ratio": 3.58933859822... |
"""
Automated, robust ``apt-get`` mirror selection for Debian and Ubuntu.
The main entry point for this module is the :class:`AptMirrorUpdater` class, so
if you don't know where to start that would be a good place :-). You can also
take a look at the source code of the :mod:`apt_mirror_updater.cli` module for
an exam... | {
"repo_name": "xolox/python-apt-mirror-updater",
"path": "apt_mirror_updater/__init__.py",
"copies": "1",
"size": "43510",
"license": "mit",
"hash": 7892001398760608000,
"line_mean": 44.0414078675,
"line_max": 119,
"alpha_frac": 0.619030108,
"autogenerated": false,
"ratio": 4.368912541419821,
"... |
"""Automated skinning tests for the blender nif scripts."""
# ***** BEGIN LICENSE BLOCK *****
#
# BSD License
#
# Copyright (c) 2005-2011, NIF File Format Library and Tools
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... | {
"repo_name": "amorilia/blender_nif_plugin",
"path": "todo/old_tests/runtest_fo3_skinning.py",
"copies": "5",
"size": "3545",
"license": "bsd-3-clause",
"hash": -3970294096419076000,
"line_mean": 41.7108433735,
"line_max": 82,
"alpha_frac": 0.6598025388,
"autogenerated": false,
"ratio": 3.8956043... |
# Automated Stock Market Trading Simulation
# FB - 20140515
import random
initialMoneyOwned = 1000.0
initialStocksOwned = 0.1
initialStockPrice = 10000.0
tradingDays = 1000
tp = 5.0 # buy/sell percentage threshold of the investor
maxVolatilityPercent = 5.0 # of the stock
numTrials = 1000
initialInvestment = initialMo... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578881_Automated_Stock_Market_Trading/recipe-578881.py",
"copies": "1",
"size": "2075",
"license": "mit",
"hash": -4550715647245774000,
"line_mean": 32.4677419355,
"line_max": 90,
"alpha_frac": 0.6501204819,
"autogenerated": false,
"ratio"... |
# automated tests for kuhn_munkres.py
# imports
## testing libraries
import unittest
import copy
from nose.tools import *
from mock import patch, MagicMock
## module under test
from pair.kuhn_munkres import *
# tests
## decorator tests
def test_check_type():
### dummy test class
class TestClass:
_ch... | {
"repo_name": "knyte/pair",
"path": "pair/test/kuhn_munkres_tests.py",
"copies": "1",
"size": "32043",
"license": "mit",
"hash": -7737824472780488000,
"line_mean": 41.6103723404,
"line_max": 78,
"alpha_frac": 0.5418968261,
"autogenerated": false,
"ratio": 2.9108829941860463,
"config_test": true... |
# automated tests for parser_core.py
from nose.tools import *
from mock import patch
from wl_parsers.parser_core import *
from datetime import *
# utility
class FakeRequest(object):
def __init__(self, text=""):
self.text = text
# decorator test
class PageDataTester(object):
def getData(self):
... | {
"repo_name": "knyte/wl_parsers",
"path": "wl_parsers/test/parser_core_tests.py",
"copies": "1",
"size": "5314",
"license": "mit",
"hash": -8695534182819511000,
"line_mean": 29.1988636364,
"line_max": 73,
"alpha_frac": 0.643206624,
"autogenerated": false,
"ratio": 3.2541334966319657,
"config_te... |
"""Automated tests for the blender nif scripts."""
# ***** BEGIN LICENSE BLOCK *****
#
# BSD License
#
# Copyright (c) 2005-2011, NIF File Format Library and Tools
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | {
"repo_name": "nightstrike/blender_nif_plugin",
"path": "todo/utilities/nif_test.py",
"copies": "3",
"size": "8250",
"license": "bsd-3-clause",
"hash": -5604858776431026000,
"line_mean": 38.8550724638,
"line_max": 81,
"alpha_frac": 0.6193939394,
"autogenerated": false,
"ratio": 4.219948849104859,... |
"""Automated tests for the blender nif scripts: text key import and export."""
# ***** BEGIN LICENSE BLOCK *****
#
# BSD License
#
# Copyright (c) 2005-2011, NIF File Format Library and Tools
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... | {
"repo_name": "amorilia/blender_nif_plugin",
"path": "todo/old_tests/runtest_textkeys.py",
"copies": "3",
"size": "3095",
"license": "bsd-3-clause",
"hash": 6085337008506819000,
"line_mean": 43.8550724638,
"line_max": 104,
"alpha_frac": 0.6949919225,
"autogenerated": false,
"ratio": 4.05635648754... |
"""
Automated tests for the `executor` package.
This test suite uses ``sudo`` in several tests. If you don't have passwordless
sudo configured you'll notice because you'll get interactive prompts when
running the test suite ...
Of course the idea behind a test suite is to run non-interactively, so in my
personal dev... | {
"repo_name": "xolox/python-executor",
"path": "executor/tests.py",
"copies": "1",
"size": "64354",
"license": "mit",
"hash": -8398476214683442000,
"line_mean": 46.8468401487,
"line_max": 119,
"alpha_frac": 0.6230226559,
"autogenerated": false,
"ratio": 4.336230712216158,
"config_test": true,
... |
'Automated Valuation Model'
import pdb
import numpy as np
import pandas as pd
from pprint import pprint
import sklearn
import sklearn.ensemble
import sklearn.linear_model
import sklearn.preprocessing
from columns_contain import columns_contain
import AVM_elastic_net
import AVM_gradient_boosting_regressor
import AVM_... | {
"repo_name": "rlowrance/re-avm",
"path": "AVM.py",
"copies": "1",
"size": "3934",
"license": "bsd-3-clause",
"hash": -575485114169951000,
"line_mean": 34.125,
"line_max": 104,
"alpha_frac": 0.6204880529,
"autogenerated": false,
"ratio": 4.119371727748691,
"config_test": false,
"has_no_keywor... |
'Automated Valuation Model version 2'
import pdb
import numpy as np
import pandas as pd
from pprint import pprint
import sklearn
import sklearn.ensemble
import sklearn.linear_model
import sklearn.preprocessing
from columns_contain import columns_contain
import AVM_elastic_net
import AVM_gradient_boosting_regressor
i... | {
"repo_name": "rlowrance/re-avm",
"path": "AVM2.py",
"copies": "1",
"size": "3760",
"license": "bsd-3-clause",
"hash": 2394988654218682400,
"line_mean": 33.8148148148,
"line_max": 104,
"alpha_frac": 0.6199468085,
"autogenerated": false,
"ratio": 4.051724137931035,
"config_test": true,
"has_no... |
# automate/server/config.py
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class BaseConfig(object):
"""Base configuration."""
SECRET_KEY = 'my_precious'
DEBUG = False
BCRYPT_LOG_ROUNDS = 13
WTF_CSRF_ENABLED = True
DEBUG_TB_ENABLED = False
DEBUG_TB_INTERCEPT_REDIRECTS = Fa... | {
"repo_name": "JeromeErasmus/browserstack_automate",
"path": "automate/server/config.py",
"copies": "1",
"size": "1170",
"license": "apache-2.0",
"hash": 616187643504659600,
"line_mean": 26.2093023256,
"line_max": 81,
"alpha_frac": 0.6709401709,
"autogenerated": false,
"ratio": 3.35243553008596,
... |
# automate/server/models.py
import datetime
#from automate.server import app, db, bcrypt
from automate.server import app, db
class Config(db.Model):
__tablename__ = "config"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
api_user = db.Column(db.String(255), nullable=True)
access_... | {
"repo_name": "JeromeErasmus/browserstack_automate",
"path": "automate/server/models.py",
"copies": "1",
"size": "3297",
"license": "apache-2.0",
"hash": 4516819756645380000,
"line_mean": 26.0245901639,
"line_max": 69,
"alpha_frac": 0.6226872915,
"autogenerated": false,
"ratio": 3.287138584247258... |
# automate/server/user/views.py
#################
#### imports ####
#################
#from flask import render_template, Blueprint, url_for, \
# redirect, flash, request
#from flask_login import login_user, logout_user, login_required
#from automate.server import bcrypt, db
#from automate.server import db
#from... | {
"repo_name": "JeromeErasmus/browserstack_automate",
"path": "automate/server/user/views.py",
"copies": "1",
"size": "2112",
"license": "apache-2.0",
"hash": -2270030834757056800,
"line_mean": 26.8026315789,
"line_max": 79,
"alpha_frac": 0.5946969697,
"autogenerated": false,
"ratio": 3.3523809523... |
"""Automate struct tests."""
import unittest
from pyof.v0x04.common.header import Header
from pyof.v0x04.common.utils import new_message_from_header
class TestStruct(unittest.TestCase):
"""Run tests related to struct packing and unpacking.
Test the lib with raw dump files from an OpenFlow switch. We assume ... | {
"repo_name": "cemsbr/python-openflow",
"path": "tests/v0x04/test_struct.py",
"copies": "1",
"size": "3927",
"license": "mit",
"hash": 3030464260804128300,
"line_mean": 33.4473684211,
"line_max": 79,
"alpha_frac": 0.5864527629,
"autogenerated": false,
"ratio": 4.277777777777778,
"config_test": ... |
""" Automate the manipulation of grid import and grid export data to a
useful state. E.g. consistent naming schema and values with other units.
"""
import pandas as pd
def convert_grid_values(filename):
# Load Data
raw_data = pd.read_csv(filename)
# Rename Columns, convert to upper case first as cases ... | {
"repo_name": "NigelCleland/lode",
"path": "lode/mungers/convertors.py",
"copies": "1",
"size": "1704",
"license": "mit",
"hash": -5532963908654523000,
"line_mean": 31.1509433962,
"line_max": 79,
"alpha_frac": 0.6179577465,
"autogenerated": false,
"ratio": 3.6488222698072805,
"config_test": fal... |
"""Automate the setup of pluggable views.
Specifically :class:`flask.views.MethodView` for use in creating JSON
REST APIs. Other response types could also be create from ApiResponse.
Unlike Flask-RESTful, this does not marshal values or validate input or
catch and process error messages. There are other existing too... | {
"repo_name": "jidn/flask-resteasy",
"path": "flask_resteasy.py",
"copies": "1",
"size": "15022",
"license": "apache-2.0",
"hash": 3960546900496122000,
"line_mean": 36.2754342432,
"line_max": 115,
"alpha_frac": 0.6083743842,
"autogenerated": false,
"ratio": 4.374490390215493,
"config_test": fal... |
"""Automatic addition of additional markup to the doc strings used by pygrametl,
which should allow them to be readable in the source code and in the
documentation after Sphinx has processed them.
"""
# Copyright (c) 2014-2020, Aalborg University (pygrametl@cs.aau.dk)
# All rights reserved.
# Redistribution and... | {
"repo_name": "chrthomsen/pygrametl",
"path": "docs/_exts/autoformat.py",
"copies": "1",
"size": "7508",
"license": "bsd-2-clause",
"hash": -3215456054471218000,
"line_mean": 41.418079096,
"line_max": 80,
"alpha_frac": 0.6885988279,
"autogenerated": false,
"ratio": 4.360046457607433,
"config_te... |
# Automatic AFL Tipping script
# Picks the team with the highest chosen percentage
# Yay for analysing terribly structured semantics!
import sys
import requests
from bs4 import BeautifulSoup
import configparser
def generateConfig():
config = configparser.ConfigParser()
config.read('config.cfg')
config['main'] = {'U... | {
"repo_name": "JakeLane/Scripts",
"path": "Tipping/tipping.py",
"copies": "1",
"size": "3682",
"license": "mit",
"hash": -7911886282540637000,
"line_mean": 39.0326086957,
"line_max": 369,
"alpha_frac": 0.6825095057,
"autogenerated": false,
"ratio": 2.9268680445151034,
"config_test": true,
"ha... |
## Automatically adapted for numpy Apr 14, 2006 by convertcode.py
class infodata:
def __init__(self, filenm):
self.breaks = 0
for line in open(filenm):
if line.startswith(" Data file name"):
self.basenm = line.split("=")[-1].strip()
continue
i... | {
"repo_name": "danielemichilli/SpS",
"path": "sps/src/waterfaller/infodata.py",
"copies": "3",
"size": "6909",
"license": "mit",
"hash": -3779717413025359000,
"line_mean": 47.3146853147,
"line_max": 98,
"alpha_frac": 0.4287161673,
"autogenerated": false,
"ratio": 4.29397141081417,
"config_test"... |
## Automatically adapted for numpy Jun 08, 2006 by convertcode.py
## ALSO CHECKED MANUALLY: from numpy import *
## CHANGED MANUALLY: inf -> Inf; nan -> NaN
"""Matlab(tm) compatibility functions.
This will hopefully become a complete set of the basic functions available in
matlab. The syntax is kept as close to the ma... | {
"repo_name": "boada/planckClusters",
"path": "MOSAICpipe/bpz-1.99.3/MLab_coe.py",
"copies": "1",
"size": "56219",
"license": "mit",
"hash": 5021755829125336000,
"line_mean": 24.4499773653,
"line_max": 105,
"alpha_frac": 0.5250893826,
"autogenerated": false,
"ratio": 2.728945196835105,
"config_... |
## Automatically adapted for numpy Jun 08, 2006 by convertcode.py
"""
Cubic spline approximation class.
Last Modified 9/9/97 by Johann Hibschman <johann@physics.berkeley.edu>
To create a default ("natural") spline, simply use sp = Spline(x,y).
To specify the slope of the function at either of the endpoints,
use the "... | {
"repo_name": "boada/planckClusters",
"path": "MOSAICpipe/bpz-1.99.3/spline.py",
"copies": "1",
"size": "5518",
"license": "mit",
"hash": -5410118785877367000,
"line_mean": 28.6666666667,
"line_max": 78,
"alpha_frac": 0.5197535339,
"autogenerated": false,
"ratio": 2.933545986177565,
"config_tes... |
#
# func.py: general function objects
# Author: Johann Hibschman <johann@physics.berkeley.edu>
#
# Copyright (C) Johann Hibschman 1997
#
# Enhanced for use with Numeric functions (ufuncs)
# All of the functions are combined with Numeric ufuncs; this loses
# some performance when the functions are used on scalar arg... | {
"repo_name": "boada/planckClusters",
"path": "MOSAICpipe/bpz-1.99.3/func.py",
"copies": "1",
"size": "8437",
"license": "mit",
"hash": 4703636507357100000,
"line_mean": 24.96,
"line_max": 78,
"alpha_frac": 0.5696337561,
"autogenerated": false,
"ratio": 3.1132841328413283,
"config_test": false,... |
## Automatically adapted for numpy.oldnumeric Apr 14, 2008 by -c
from builtins import range
def writeMeshMatlabFormat(mesh,meshFileBase):
"""
build array data structures for matlab finite element mesh representation
and write to a file to view and play with in matlatb
in matlab can then print mesh wi... | {
"repo_name": "erdc/proteus",
"path": "scripts/ppmatlab.py",
"copies": "1",
"size": "3523",
"license": "mit",
"hash": -65328787834016770,
"line_mean": 32.875,
"line_max": 111,
"alpha_frac": 0.6114107295,
"autogenerated": false,
"ratio": 3.2833178005591797,
"config_test": false,
"has_no_keywor... |
## Automatically adapted for numpy.oldnumeric Feb 01, 2008 by -c
import climt,numpy.oldnumeric as Numeric
# instantiate radiation module
r=climt.radiation(scheme='chou')
# initialise T,q to moist adiabat with 70% RH
ps = 1020. # surface pressure
q0 = 15. # surface moisture
T0 = 300. # surface temp
the0 = cl... | {
"repo_name": "jswanljung/CliMT",
"path": "src/radiation/chou/test.py",
"copies": "4",
"size": "1278",
"license": "bsd-3-clause",
"hash": 6726968834720002000,
"line_mean": 30.1707317073,
"line_max": 126,
"alpha_frac": 0.5367762128,
"autogenerated": false,
"ratio": 2.3110307414104883,
"config_te... |
## Automatically adapted for numpy.oldnumeric Feb 01, 2008 by -c
import climt,numpy.oldnumeric as Numeric
# instantiate radiation module
r=climt.radiation(scheme='gray')
# initialise T,q to moist adiabat with 70% RH
ps = 1020. # surface pressure
q0 = 15. # surface moisture
T0 = 300. # surface temp
the0 = cl... | {
"repo_name": "jswanljung/CliMT",
"path": "src/radiation/greygas/test.py",
"copies": "4",
"size": "1172",
"license": "bsd-3-clause",
"hash": 4695288847753781000,
"line_mean": 30.6756756757,
"line_max": 84,
"alpha_frac": 0.5435153584,
"autogenerated": false,
"ratio": 2.411522633744856,
"config_t... |
## Automatically adapted for numpy.oldnumeric Feb 01, 2008 by -c
#!/usr/bin/env python
import climt,numpy.oldnumeric as Numeric
# instantiate convection module
x=climt.convection(scheme='emanuel')
# initial condition taken from cold pool, year 80 of stp run Tc=14.05.nc
levs=30
ps = 1020. # surface pressure
p =... | {
"repo_name": "jsbj/climt",
"path": "src/convection/emanuel/test.py",
"copies": "4",
"size": "2102",
"license": "bsd-3-clause",
"hash": 1151841888454110000,
"line_mean": 29.9117647059,
"line_max": 89,
"alpha_frac": 0.5475737393,
"autogenerated": false,
"ratio": 2.0407766990291263,
"config_test"... |
# $Id$
#
# Copyright (C) 2000,2001,2002,2003 greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
""" tools for working with PIL images
"""
#try:
# from wxPython.wx import *
#except ImportError:
# hasWx=0
#else:
# hasWx=1
hasWx=0
try:
from qt import *
except ImportError:
hasQt = 0
else:
hasQ... | {
"repo_name": "rdkit/rdkit-orig",
"path": "rdkit/utils/PilTools.py",
"copies": "2",
"size": "5232",
"license": "bsd-3-clause",
"hash": -3020095578639113700,
"line_mean": 23.9142857143,
"line_max": 97,
"alpha_frac": 0.6483180428,
"autogenerated": false,
"ratio": 3.165154264972777,
"config_test":... |
# $Id$
#
# Copyright (C) 2000-2008 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" A module for mol... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/Chem/__init__.py",
"copies": "2",
"size": "3338",
"license": "bsd-3-clause",
"hash": 1990758780057192400,
"line_mean": 27.5299145299,
"line_max": 105,
"alpha_frac": 0.6650689035,
"autogenerated": false,
"ratio": 2.969750889679715,
"config_test": true... |
# $Id$
#
# Copyright (C) 2001-2008 greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
"""
"""
from __future__ import print_function
import numpy
import random
from rdkit.ML.DecTree import QuantTree, ID3
from rdkit.ML.InfoTheory import entropy
from rdkit.ML.Data import Quantize
from rdkit.six.moves im... | {
"repo_name": "strets123/rdkit",
"path": "rdkit/ML/DecTree/BuildQuantTree.py",
"copies": "4",
"size": "13153",
"license": "bsd-3-clause",
"hash": 7663848799299921000,
"line_mean": 31.9649122807,
"line_max": 84,
"alpha_frac": 0.5552345473,
"autogenerated": false,
"ratio": 3.5732138005976637,
"co... |
# $Id$
#
# Copyright (C) 2001-2008 greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
""" various statistical operations on data
"""
import numpy
def StandardizeMatrix(mat):
"""
This is the standard *subtract off the average and divide by the deviation*
standardization function.
**Argument... | {
"repo_name": "AlexanderSavelyev/rdkit",
"path": "rdkit/ML/Data/Stats.py",
"copies": "3",
"size": "7266",
"license": "bsd-3-clause",
"hash": 5747717397259621000,
"line_mean": 30.8684210526,
"line_max": 79,
"alpha_frac": 0.5195430773,
"autogenerated": false,
"ratio": 2.219981668194317,
"config_t... |
# $Id$
#
# Copyright (C) 2001-2008 greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
""" various statistical operations on data
"""
import numpy
def StandardizeMatrix(mat):
"""
This is the standard *subtract off the average and divide by the deviation*
standardization function.
**Argumen... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/ML/Data/Stats.py",
"copies": "1",
"size": "6770",
"license": "bsd-3-clause",
"hash": -6432881313511775000,
"line_mean": 28.4347826087,
"line_max": 79,
"alpha_frac": 0.5654357459,
"autogenerated": false,
"ratio": 2.2794612794612794,
"config_test": fal... |
# $Id$
#
# Copyright (C) 2002-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" EState fingerpr... | {
"repo_name": "adalke/rdkit",
"path": "rdkit/Chem/EState/Fingerprinter.py",
"copies": "4",
"size": "2033",
"license": "bsd-3-clause",
"hash": -2708013787543111000,
"line_mean": 30.2769230769,
"line_max": 83,
"alpha_frac": 0.6733890802,
"autogenerated": false,
"ratio": 2.989705882352941,
"config... |
# $Id$
#
# Copyright (C) 2003-2008 Greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
"""
"""
from __future__ import print_function
import numpy
from rdkit.ML.DecTree import SigTree
from rdkit.ML import InfoTheory
try:
from rdkit.ML.FeatureSelect import CMIM
except ImportError:
CMIM = None
from... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/ML/DecTree/BuildSigTree.py",
"copies": "1",
"size": "7649",
"license": "bsd-3-clause",
"hash": 3915472934549927000,
"line_mean": 32.1125541126,
"line_max": 100,
"alpha_frac": 0.6385148385,
"autogenerated": false,
"ratio": 3.686265060240964,
"config_t... |
# $Id$
#
# Copyright (C) 2003-2008 Greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
"""
"""
import numpy
from rdkit.ML.DecTree import SigTree
from rdkit.ML import InfoTheory
try:
from rdkit.ML.FeatureSelect import CMIM
except ImportError:
CMIM=None
from rdkit.DataStructs.VectCollection impor... | {
"repo_name": "rdkit/rdkit-orig",
"path": "rdkit/ML/DecTree/BuildSigTree.py",
"copies": "2",
"size": "7667",
"license": "bsd-3-clause",
"hash": 3541471991711084500,
"line_mean": 32.0474137931,
"line_max": 78,
"alpha_frac": 0.6320594757,
"autogenerated": false,
"ratio": 3.7309002433090024,
"conf... |
# $Id$
#
# Copyright (C) 2006 Greg Landrum
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
import copy
from rdkit.six.moves import range
from rdk... | {
"repo_name": "adalke/rdkit",
"path": "rdkit/Chem/FeatMaps/FeatMapUtils.py",
"copies": "4",
"size": "6883",
"license": "bsd-3-clause",
"hash": -2619844673980170000,
"line_mean": 27.9201680672,
"line_max": 80,
"alpha_frac": 0.6367862851,
"autogenerated": false,
"ratio": 3.5189161554192228,
"conf... |
# $Id$
#
# Copyright (C) 2007 by Greg Landrum
# All rights reserved
#
from __future__ import print_function
from rdkit import Geometry
from rdkit.Chem.Subshape import SubshapeObjects
import math
import numpy
#-----------------------------------------------------------------------------
def ComputeGridIndices(shap... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/Chem/Subshape/BuilderUtils.py",
"copies": "1",
"size": "11626",
"license": "bsd-3-clause",
"hash": -4766010332328989000,
"line_mean": 31.1160220994,
"line_max": 125,
"alpha_frac": 0.596249785,
"autogenerated": false,
"ratio": 3.190450054884742,
"conf... |
# $Id$
#
# Copyright (C) 2007 by Greg Landrum
# All rights reserved
#
from rdkit import Geometry
from rdkit.Chem.Subshape import SubshapeObjects
import math
import numpy
#-----------------------------------------------------------------------------
def ComputeGridIndices(shapeGrid,winRad):
if getattr(shapeGrid,'_... | {
"repo_name": "rdkit/rdkit-orig",
"path": "rdkit/Chem/Subshape/BuilderUtils.py",
"copies": "2",
"size": "11176",
"license": "bsd-3-clause",
"hash": -829148224526778200,
"line_mean": 30.8404558405,
"line_max": 125,
"alpha_frac": 0.6169470293,
"autogenerated": false,
"ratio": 3.1078976640711904,
... |
## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c
from rdkit import RDConfig
import unittest
from rdkit.ML.InfoTheory import rdInfoTheory
try:
from rdkit.ML.InfoTheory import BitClusterer
except ImportError:
BitClusterer=None
from rdkit.ML.Data import DataUtils
from rdkit import DataStructs
import r... | {
"repo_name": "rdkit/rdkit-orig",
"path": "rdkit/ML/InfoTheory/testCorrMatGen.py",
"copies": "2",
"size": "3376",
"license": "bsd-3-clause",
"hash": -8830880503974274000,
"line_mean": 30.5514018692,
"line_max": 91,
"alpha_frac": 0.5565758294,
"autogenerated": false,
"ratio": 3.2183031458531937,
... |
## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c
#
# $Id$
#
from rdkit import Chem
from rdkit.Chem import rdDepictor
from rdkit import Geometry
from rdkit import RDConfig
import unittest
import os,sys
import cPickle as pickle
from rdkit.Chem.ChemUtils import AlignDepict
import numpy.oldnumeric as Nume... | {
"repo_name": "rdkit/rdkit-orig",
"path": "Code/GraphMol/Depictor/Wrap/testDepictor.py",
"copies": "2",
"size": "7811",
"license": "bsd-3-clause",
"hash": 7933502831531983000,
"line_mean": 35.6713615023,
"line_max": 131,
"alpha_frac": 0.6120855204,
"autogenerated": false,
"ratio": 2.9677051671732... |
#
# Copyright (C) 2000-2008 greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
""" Utilities for data manipulation
**FILE FORMATS:**
- *.qdat files* contain quantized data suitable for
feeding to learning algorithms.
The .qdat file, written by _DecTreeGui_, is structured as follows:
1) An... | {
"repo_name": "adalke/rdkit",
"path": "rdkit/ML/Data/DataUtils.py",
"copies": "1",
"size": "17528",
"license": "bsd-3-clause",
"hash": 9025625771689468000,
"line_mean": 24.7008797654,
"line_max": 93,
"alpha_frac": 0.6317320858,
"autogenerated": false,
"ratio": 3.4826147426981917,
"config_test":... |
#
# Copyright (C) 2000-2008 greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
""" Utilities for data manipulation
**FILE FORMATS:**
- *.qdat files* contain quantized data suitable for
feeding to learning algorithms.
The .qdat file, written by _DecTreeGui_, is structured as follows:
1) Any... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/ML/Data/DataUtils.py",
"copies": "1",
"size": "17580",
"license": "bsd-3-clause",
"hash": 2005886256649287000,
"line_mean": 24.6268221574,
"line_max": 99,
"alpha_frac": 0.6298634812,
"autogenerated": false,
"ratio": 3.481188118811881,
"config_test": ... |
#
# Copyright (C) 2000-2008 greg Landrum
#
""" Contains the class _Network_ which is used to represent neural nets
**Network Architecture:**
A tacit assumption in all of this stuff is that we're dealing with
feedforward networks.
The network itself is stored as a list of _NetNode_ objects. The list
is or... | {
"repo_name": "adalke/rdkit",
"path": "rdkit/ML/Neural/Network.py",
"copies": "4",
"size": "7506",
"license": "bsd-3-clause",
"hash": 6884095235837258000,
"line_mean": 29.8888888889,
"line_max": 108,
"alpha_frac": 0.6600053291,
"autogenerated": false,
"ratio": 3.847257816504357,
"config_test": ... |
#
# Copyright (C) 2000 greg Landrum
#
""" functionality for generating an image showing the results of a composite model voting on a data set
Uses *Numeric* and *PIL*
"""
from __future__ import print_function
import numpy
from PIL import Image, ImageDraw
def CollectVotes(composite,data,badOnly):
""" collects... | {
"repo_name": "adalke/rdkit",
"path": "rdkit/ML/MLUtils/VoteImg.py",
"copies": "1",
"size": "6195",
"license": "bsd-3-clause",
"hash": 7293857081963131000,
"line_mean": 26.7802690583,
"line_max": 114,
"alpha_frac": 0.6376109766,
"autogenerated": false,
"ratio": 3.6291739894551847,
"config_test"... |
#
# Copyright (C) 2000 greg Landrum
#
""" functionality for generating an image showing the results of a composite model voting on a data set
Uses *Numeric* and *PIL*
"""
import numpy
from PIL import Image, ImageDraw
def CollectVotes(composite,data,badOnly):
""" collects the votes from _composite_ for the e... | {
"repo_name": "rdkit/rdkit-orig",
"path": "rdkit/ML/MLUtils/VoteImg.py",
"copies": "2",
"size": "6054",
"license": "bsd-3-clause",
"hash": -141281408839641940,
"line_mean": 26.2702702703,
"line_max": 103,
"alpha_frac": 0.6366038982,
"autogenerated": false,
"ratio": 3.6316736652669466,
"config_t... |
#
# Copyright (C) 2001,2003 greg Landrum and Rational Discovery LLC
#
""" unit tests for the QuantTree implementation """
from __future__ import print_function
import unittest
import io
from rdkit import RDConfig
from rdkit.ML.DecTree import BuildQuantTree
from rdkit.ML.DecTree.QuantTree import QuantTreeNode
from r... | {
"repo_name": "adalke/rdkit",
"path": "rdkit/ML/DecTree/UnitTestQuantTree.py",
"copies": "3",
"size": "7680",
"license": "bsd-3-clause",
"hash": -1270667071428813800,
"line_mean": 32.1034482759,
"line_max": 105,
"alpha_frac": 0.5807291667,
"autogenerated": false,
"ratio": 2.8731762065095396,
"c... |
#
# Copyright (C) 2001-2008 greg Landrum
#
""" unit testing code for the Stats module
"""
import unittest,sys
from rdkit import RDConfig
from rdkit.ML.Data import Stats
import numpy
FLOAT_TOL = 1e-4
def feq(x,y,tol=FLOAT_TOL):
return abs(x-y)<tol
class TestCase(unittest.TestCase):
def setUp(self):
#print... | {
"repo_name": "AlexanderSavelyev/rdkit",
"path": "rdkit/ML/Data/UnitTestStats.py",
"copies": "4",
"size": "5832",
"license": "bsd-3-clause",
"hash": 6336112740559476000,
"line_mean": 38.9452054795,
"line_max": 116,
"alpha_frac": 0.5802469136,
"autogenerated": false,
"ratio": 2.5008576329331045,
... |
#
# Copyright (C) 2002-2008 Greg Landrum and Rational Discovery LLC
# All rights are reserved.
#
class DescriptorCalculationError(Exception):
""" used to signal problems generating descriptor values """
pass
class ClassificationError(Exception):
""" used to signal problems generating predictions """
pass
... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/ML/ModelPackage/Packager.py",
"copies": "1",
"size": "2577",
"license": "bsd-3-clause",
"hash": 3344159950222765000,
"line_mean": 24.77,
"line_max": 86,
"alpha_frac": 0.69072565,
"autogenerated": false,
"ratio": 3.9104704097116842,
"config_test": fal... |
#
# Copyright (C) 2002-2008 Greg Landrum and Rational Discovery LLC
# All rights are reserved.
#
import exceptions
class DescriptorCalculationError(exceptions.Exception):
""" used to signal problems generating descriptor values """
pass
class ClassificationError(exceptions.Exception):
""" used to signal proble... | {
"repo_name": "rdkit/rdkit-orig",
"path": "rdkit/ML/ModelPackage/Packager.py",
"copies": "2",
"size": "2578",
"license": "bsd-3-clause",
"hash": -8837223328882959000,
"line_mean": 27.3296703297,
"line_max": 84,
"alpha_frac": 0.6974398759,
"autogenerated": false,
"ratio": 3.9001512859304084,
"co... |
#
# Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC
#
""" unit tests for the model and descriptor packager """
from rdkit import RDConfig
from rdkit.ML.Data import DataUtils
import unittest,os,sys
from rdkit.six.moves import cPickle
from rdkit.ML.ModelPackage import Packager
from rdkit import Chem
i... | {
"repo_name": "AlexanderSavelyev/rdkit",
"path": "rdkit/ML/ModelPackage/UnitTestPackage.py",
"copies": "1",
"size": "4279",
"license": "bsd-3-clause",
"hash": -6587525680299473000,
"line_mean": 33.7886178862,
"line_max": 81,
"alpha_frac": 0.5935966347,
"autogenerated": false,
"ratio": 3.076204169... |
#
# Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC
#
""" unit tests for the model and descriptor packager """
from rdkit import RDConfig
from rdkit.ML.Data import DataUtils
import unittest, os, sys
import io
from rdkit.six.moves import cPickle
from rdkit.ML.ModelPackage import Packager
from rdkit im... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/ML/ModelPackage/UnitTestPackage.py",
"copies": "1",
"size": "4745",
"license": "bsd-3-clause",
"hash": 3985734899219519000,
"line_mean": 34.6766917293,
"line_max": 94,
"alpha_frac": 0.6037934668,
"autogenerated": false,
"ratio": 2.9235982747997538,
"... |
#
# Copyright (C) 2003-2008 Greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
from __future__ import print_function
import random
import os.path, sys
from rdkit import RDConfig, RDRandom
from rdkit.six.moves import xrange
SeqTypes = (list, tuple)
def SplitIndices(nPts, frac, silent=1, legacy=0, r... | {
"repo_name": "jandom/rdkit",
"path": "rdkit/ML/Data/SplitData.py",
"copies": "1",
"size": "8824",
"license": "bsd-3-clause",
"hash": 7329972024520593000,
"line_mean": 27.7426710098,
"line_max": 93,
"alpha_frac": 0.6259066183,
"autogenerated": false,
"ratio": 3.314800901577761,
"config_test": t... |
#
# Copyright (C) 2003-2008 Greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
from rdkit import RDConfig,RDRandom
import random
import types,os.path,sys
SeqTypes=(types.ListType,types.TupleType)
def SplitIndices(nPts,frac,silent=1,legacy=0,replacement=0):
""" splits a set of indices into a data se... | {
"repo_name": "rdkit/rdkit-orig",
"path": "rdkit/ML/Data/SplitData.py",
"copies": "2",
"size": "8679",
"license": "bsd-3-clause",
"hash": -293212345930211300,
"line_mean": 27.93,
"line_max": 80,
"alpha_frac": 0.6295656182,
"autogenerated": false,
"ratio": 3.313860252004582,
"config_test": true,... |
## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c
#pdfgen.py
"""
PDFgen is a library to generate PDF files containing text and graphics. It is the
foundation for a complete reporting solution in Python. It is also the
foundation for piddlePDF, the PDF back end for PIDDLE.
Documentation is a little ... | {
"repo_name": "AlexanderSavelyev/rdkit",
"path": "rdkit/sping/PDF/pdfgen.py",
"copies": "3",
"size": "42134",
"license": "bsd-3-clause",
"hash": 8944338261963158000,
"line_mean": 38.5253283302,
"line_max": 103,
"alpha_frac": 0.5556794987,
"autogenerated": false,
"ratio": 3.5562120189061446,
"co... |
## Automatically adapted for numpy.oldnumeric May 17, 2011 by -c
import copy, math
import ViewCache
import POMDP.MarkovLoc_Antie
from Meanings import Back, Front, Left, Right, At, Side, Path, Flooring, Wall, Open, End, Unknown, opposite
from Utility import reprVisible, strVisible, uniq
# from HSSH/src/common/local_to... | {
"repo_name": "ronaldahmed/SLAM-for-ugv",
"path": "neural-navigation-with-lstm/MARCO/Robot/SmallScaleStar.py",
"copies": "2",
"size": "17745",
"license": "mit",
"hash": 7723133362804616000,
"line_mean": 48.985915493,
"line_max": 458,
"alpha_frac": 0.5956607495,
"autogenerated": false,
"ratio": 3.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.