repo_name
stringlengths
6
112
path
stringlengths
4
204
copies
stringlengths
1
3
size
stringlengths
4
7
content
stringlengths
711
1.04M
license
stringclasses
15 values
hash
int64
-9,223,328,406,218,787,000
9,223,331,109B
line_mean
float64
5.74
99.7
line_max
int64
17
1k
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
OMS-NetZero/FAIR
fair/gas_cycle/gir.py
1
2430
from __future__ import division import numpy as np from ..constants.general import ppm_gtc """Gas cycle functions from Generalised Impulse Response Model v1.0.0. Much of this has been adapted from: Leach et al., 2020, Geoscientific Model Development https://www.geosci-model-dev-discuss.net/gmd-2019-379/ """ def c...
apache-2.0
-8,292,986,400,798,594,000
37.571429
104
0.680247
false
mathkann/hyperopt
hyperopt/tests/test_criteria.py
7
1917
import numpy as np import hyperopt.criteria as crit def test_ei(): rng = np.random.RandomState(123) for mean, var in [(0, 1), (-4, 9)]: thresholds = np.arange(-5, 5, .25) * np.sqrt(var) + mean v_n = [crit.EI_gaussian_empirical(mean, var, thresh, rng, 10000) for thresh in thresh...
bsd-3-clause
-1,589,826,703,282,367,200
29.919355
73
0.542514
false
cython-testbed/pandas
pandas/tests/scalar/timestamp/test_timezones.py
1
12514
# -*- coding: utf-8 -*- """ Tests for Timestamp timezone-related methods """ from datetime import datetime, date, timedelta from distutils.version import LooseVersion import pytest import pytz from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError import dateutil from dateutil.tz import gettz, tzoffset ...
bsd-3-clause
-6,155,344,485,097,374,000
39.498382
79
0.590698
false
zhuhuifeng/PyML
mla/neuralnet/layers/basic.py
1
4512
import autograd.numpy as np from autograd import elementwise_grad from mla.neuralnet.activations import get_activation from mla.neuralnet.parameters import Parameters np.random.seed(9999) class Layer(object): def setup(self, X_shape): """Allocates initial weights.""" pass def forward_pass(s...
apache-2.0
4,052,290,290,537,210,400
23.791209
77
0.586436
false
rykov8/ssd_keras
ssd_layers.py
3
6719
"""Some special pupropse layers for SSD.""" import keras.backend as K from keras.engine.topology import InputSpec from keras.engine.topology import Layer import numpy as np import tensorflow as tf class Normalize(Layer): """Normalization layer as described in ParseNet paper. # Arguments scale: Defau...
mit
9,192,958,743,215,568,000
36.121547
78
0.564072
false
OmnesRes/pan_cancer
paper/cox_regression/KIRC/patient_info.py
1
6241
## A script for extracting info about the patients used in the analysis ## Load necessary modules from rpy2 import robjects as ro import numpy as np import os ro.r('library(survival)') ##This call will only work if you are running python from the command line. ##If you are not running from the command line manually...
mit
3,009,862,005,212,880,400
28.300469
132
0.645089
false
l-althueser/NiMoNa_DCM16
DCM/programs/RK4.py
1
1088
# -*- coding: utf-8 -*- """ @author: Tobias Timo Beschreibung: Runge-Kutta-Verfahren vierter Ordnung zur Lösung von gewöhnlichen DGL 1. Ordnung. Ausgabe der Zeitentwicklung in Matrixform. Wichtig: Die Dimension des Eingabeparameters x_0 muss mit dem verwendetem Modell überinstimmen. Pythonversion:...
bsd-2-clause
-8,869,651,187,784,231,000
29.111111
105
0.553093
false
dingliu0305/Tree-Tensor-Networks-in-Machine-Learning
code/tsne_mnist.py
1
3214
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # import matplotlib as mpl # mpl.use('Agg') import matplotlib.pyplot as plt import numpy as np import pickle from matplotlib.backends.backend_pdf import PdfPages from sklearn.manifold import TSNE data_folder = "./data/mnist/" n_epochs = 3 bond_data = 2 bond_inner = 3 bo...
mit
9,021,563,037,263,550,000
22.289855
75
0.584941
false
ominux/scikit-learn
examples/manifold/plot_compare_methods.py
4
2211
""" ========================================= Comparison of Manifold Learning methods ========================================= An illustration of dimensionality reduction on the S-curve dataset with various manifold learning methods. For a discussion and comparison of these algorithms, see the :ref:`manifold module...
bsd-3-clause
-8,009,370,989,050,230,000
29.708333
71
0.620081
false
StongeEtienne/trimeshpy
trimeshpy/math/mesh_map.py
1
6095
# Etienne St-Onge from __future__ import division import numpy as np from scipy.sparse import csc_matrix from trimeshpy.math.util import square_length from trimeshpy.math.mesh_global import G_DTYPE # Mesh structure functions # Map ( Adjacency / Connectivity ) Functions # # number of vertices = n # number of ...
mit
-4,785,637,220,778,597,000
34.028736
78
0.474815
false
hosseinsadeghi/ultracold-ions
test/test_CoulombAcc.py
2
4459
import uci.CoulombAcc as uci import numpy as np import pyopencl as cl import pyopencl.array as cl_array testCtx = cl.create_some_context(interactive = True) testQueue = cl.CommandQueue(testCtx) def test_Constructor(): coulomb_acc = uci.CoulombAcc() def test_ForceOnSingleParticleIsZero(): coulomb_acc = uci.Co...
mit
-2,679,120,046,525,874,700
30.401408
73
0.578381
false
hughperkins/gpu-experiments
gpuexperiments/occupancy_dyn_graphs.py
1
2094
""" Try using dynamic shared memory, see if gets optimized away, or affects occupancy """ from __future__ import print_function, division import argparse import string import numpy as np import os import matplotlib.pyplot as plt plt.rcdefaults() import matplotlib.pyplot as plt from os.path import join parser = argpar...
bsd-2-clause
-6,801,072,646,690,389,000
26.552632
102
0.660936
false
ljschumacher/tierpsy-tracker
tierpsy/analysis/stage_aligment/findStageMovement.py
2
58507
import numpy as np import warnings import tables from tierpsy.helper.misc import TimeCounter, print_flush, get_base_name from tierpsy.helper.params import read_fps from tierpsy.analysis.stage_aligment.get_mask_diff_var import get_mask_diff_var def _matlab_std(x): if x.size <= 1: #in array of size 1 MAT...
mit
6,729,585,383,931,663,000
43.222222
116
0.551167
false
fsxfreak/esys-pbi
src/pupil/pupil_src/shared_modules/frame_publisher.py
2
2998
''' (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2017 Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. -----------------------------------...
mit
2,254,809,564,954,330,000
33.079545
150
0.543362
false
dmitru/pines
pines/trees.py
1
8172
# coding=utf-8 import numpy as np from copy import deepcopy class BinaryDecisionTreeSplit(object): def __init__(self, feature_id, value): self.feature_id = feature_id self.value = value class BinaryDecisionTree(object): """ Implements a binary decision tree with array-based representation...
mit
2,368,062,335,330,216,400
34.947137
103
0.55098
false
philouc/pyhrf
python/pyhrf/test/test_glm.py
1
3214
import unittest import pyhrf import os.path as op import shutil class NipyGLMTest(unittest.TestCase): def setUp(self): self.tmp_dir = pyhrf.get_tmp_path() def tearDown(self): shutil.rmtree(self.tmp_dir) # def _simulate_bold(self): # boldf, tr, paradigmf, maskf = simulate_bold(o...
gpl-3.0
-4,689,871,972,983,716,000
27.192982
78
0.589919
false
florian-f/sklearn
examples/svm/plot_svm_margin.py
4
2295
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM Margins Example ========================================================= The plots below illustrate the effect the parameter `C` has on the seperation line. A large value of `C` basically tells our model that w...
bsd-3-clause
-3,608,698,199,744,564,700
25.37931
76
0.582571
false
Marcello-Sega/pytim
setup.py
1
5678
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 """A python based tool for interfacial molecules analysis """ # To use a consistent encoding import codecs import os import sys # Always prefer setuptools over distutils try: from setupt...
gpl-3.0
2,636,920,363,843,867,600
34.710692
94
0.661853
false
Sravan2j/DIGITS
tools/test_create_db.py
1
4429
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. import os.path import tempfile import shutil from cStringIO import StringIO from nose.tools import raises, assert_raises import mock import unittest import PIL.Image import numpy as np from . import create_db as _ class TestInit(): @classmetho...
bsd-3-clause
7,553,932,435,437,362,000
29.972028
120
0.582298
false
arizona-phonological-imaging-lab/Autotrace
under-development/a3/roi.py
2
5643
#!/usr/bin/env python3 from __future__ import division import numpy as np import json class ROI(object): """ Region of Interest for a set of images Attributes: shape (tuple of numeric): the height and width of the ROI offset (tuple of numeric): the lower bounds of the ROI extent ...
mit
4,787,143,582,170,665,000
34.049689
72
0.550771
false
dirmeier/dataframe
tests/test_cases.py
1
2832
# dataframe: a data-frame implementation using method piping # # Copyright (C) 2016 Simon Dirmeier # # This file is part of dataframe. # # dataframe is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either versi...
gpl-3.0
-3,136,135,424,214,697,500
24.754545
77
0.647952
false
DavideCanton/Python3
pyIAprove/labyrinth.py
1
12404
from math import sqrt import numpy as np from collections import defaultdict, namedtuple from PIL import Image DIRS = U, L, D, R, UL, UR, DL, DR = [(0, -1), (-1, 0), (0, 1), (1, 0), (-1, -1), (1, -1), (-1, 1), (1, 1)] def dist_2(p1, p2): dx = p1[0] - p2[0] dy = p1[1] - p2...
gpl-3.0
-3,098,687,144,941,617,000
31.814815
80
0.484844
false
J4sp3r/damrobot
Project/lib/util.py
1
1474
#!/usr/local/bin/python import cv2,os import numpy as np import matplotlib.pyplot as plt from lib import log def imshow(img): cv2.namedWindow("preview") cv2.imshow("preview",img) rval = True while rval: key = cv2.waitKey(27) if key == 27: # exit on ESC break cv2.destroyWindow("preview") def imshow2(img): ...
mit
-8,841,574,868,602,686,000
24
235
0.656716
false
bccp/abopt
abopt/legacy/vmad2.py
1
32837
from __future__ import print_function import warnings import functools import logging logger = logging.getLogger("VMAD") _logging_handler = logging.StreamHandler() logger.addHandler(_logging_handler) # TODO: # Add visualization def ZeroType(): """ creates a special type of ZeroType; """ def self(self, *args)...
gpl-3.0
-5,166,341,015,161,290,000
33.063278
107
0.548588
false
rinatzakirov/vhdl
drivers/ddr_analyze.py
1
1995
import pyqtgraph as pg import numpy as np def drawFft(filename, side): data = np.fromfile("dump.dat", dtype="uint16").astype(float) data = data[side::2] #data = data[:-1] #data = data[:8192] #pg.plot(data) #return print "raw" print np.min(data) print np.max(data) data -= np.average(data) data = d...
lgpl-2.1
-8,487,399,865,354,513,000
28.352941
164
0.578947
false
petebachant/scipy
scipy/linalg/_interpolative_backend.py
143
44935
#****************************************************************************** # Copyright (C) 2013 Kenneth L. Ho # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain t...
bsd-3-clause
3,825,534,668,686,145,000
25.923307
79
0.532035
false
miso-belica/sumy
sumy/summarizers/text_rank.py
1
4579
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division, print_function, unicode_literals import math try: import numpy except ImportError: numpy = None from ._summarizer import AbstractSummarizer class TextRankSummarizer(AbstractSummarizer): """An implementation...
apache-2.0
-5,269,407,314,558,454,000
38.817391
117
0.652544
false
timothydmorton/isochrones
isochrones/priors.py
1
16204
from __future__ import print_function, division import numpy as np import pandas as pd import scipy.stats from scipy.stats import uniform, lognorm from scipy.integrate import quad from scipy.stats._continuous_distns import _norm_pdf, _norm_cdf, _norm_logpdf import matplotlib.pyplot as plt import numba as nb from math...
mit
-6,676,794,714,651,641,000
30.22158
130
0.522155
false
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/dygraph_to_static/ifelse_simple_func.py
2
10102
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # 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 app...
apache-2.0
5,161,546,916,633,578,000
28.538012
119
0.517323
false
zuphilip/ocropy
ocrolib/exceptions.py
5
2139
import inspect import numpy def summary(x): """Summarize a datatype as a string (for display and debugging).""" if type(x)==numpy.ndarray: return "<ndarray %s %s>"%(x.shape,x.dtype) if type(x)==str and len(x)>10: return '"%s..."'%x if type(x)==list and len(x)>10: return '%s...'%...
apache-2.0
-5,357,816,646,254,686,000
28.30137
71
0.570827
false
Milias/ModellingSimulation
Week7/python/lattice.py
1
3006
# -*- coding: utf8 -*- from numpy import * import json def RecursiveSC(level, N, count, points): if level: for i in range(N[level]): RecursiveSC(level - 1, N, count, points) count[level] += 1 count[level] = 0 else: for i in range(N[0]): points.append(count[:]) count[0] += 1 ...
mit
875,898,410,095,977,100
29.673469
133
0.617432
false
FedericoMuciaccia/SistemiComplessi
src/percolation.py
1
5670
# coding: utf-8 # # Percolation # In[2]: import numpy, networkx, pandas # import graph_tool # from graph_tool.all import * # from matplotlib import pyplot # %matplotlib inline # In[3]: # simple parallelization # import multiprocessing # cpus = multiprocessing.cpu_count() # pool = multiprocessing.Pool(proce...
mit
-4,597,681,802,934,022,000
32.526627
129
0.678433
false
pokornyv/SPEpy
parlib2.py
1
13136
########################################################### # SPEpy - simplified parquet equation solver for SIAM # # Copyright (C) 2019 Vladislav Pokorny; pokornyv@fzu.cz # # homepage: github.com/pokornyv/SPEpy # # parlib2.py - library of functions # ####################...
gpl-3.0
-2,502,053,832,222,385,000
39.294479
103
0.619062
false
uzgit/ardupilot
Tools/LogAnalyzer/tests/TestPitchRollCoupling.py
3
6116
from LogAnalyzer import Test,TestResult import DataflashLog from VehicleType import VehicleType import collections class TestPitchRollCoupling(Test): '''test for divergence between input and output pitch/roll, i.e. mechanical failure or bad PID tuning''' # TODO: currently we're only checking for roll/pitch o...
gpl-3.0
-7,586,790,118,497,596,000
45.687023
157
0.567528
false
relh/keras
examples/lstm_benchmark.py
9
3008
'''Compare LSTM implementations on the IMDB sentiment classification task. consume_less='cpu' preprocesses input to the LSTM which typically results in faster computations at the expense of increased peak memory usage as the preprocessed input must be kept in memory. consume_less='mem' does away with the preprocessin...
mit
3,519,658,746,247,531,500
35.240964
91
0.706782
false
cseed/hail
hail/python/test/hail/experimental/test_dnd_array.py
1
11934
import numpy as np import hail as hl from hail.utils import new_temp_file from ..helpers import startTestHailContext, stopTestHailContext, fails_local_backend setUpModule = startTestHailContext tearDownModule = stopTestHailContext def test_range_collect(): n_variants = 10 n_samples = 10 block_size = 3 ...
mit
8,407,039,667,649,245,000
31.606557
85
0.588906
false
bjornsturmberg/EMUstack
backend/materials.py
2
16446
""" materials.py is a subroutine of EMUstack that defines Material objects, these represent dispersive lossy refractive indices and possess methods to interpolate n from tabulated data. Copyright (C) 2015 Bjorn Sturmberg, Kokou Dossou, Felix Lawrence EMUstack is free software: you can redi...
gpl-3.0
5,210,394,253,854,883,000
48.140244
173
0.452937
false
habi/GlobalDiagnostiX
FocusPlotLine.py
1
5139
# -*- coding: utf-8 -*- """ Script to plot line on TIFF, useful for 'calculating' the best focus of the EssentialMed Setup. Since the objective doesn't really have the focal distance Edmund optics stated... Reads TIFF-Stack with images from focus shifting on the LINOS-rail. Plots a line (coordinates read from a txt-Fi...
unlicense
8,246,217,816,463,031,000
40.780488
112
0.557696
false
dmytroKarataiev/MachineLearning
smartcab/smartcab/simulator.py
1
9740
import os import time import random import importlib import numpy as np class Simulator(object): """Simulates agents in a dynamic smartcab environment. Uses PyGame to display GUI, if available. """ colors = { 'black' : ( 0, 0, 0), 'white' : (255, 255, 255), 'red' ...
mit
4,681,323,323,775,302,000
47.944724
220
0.54117
false
strets123/pyms
Gapfill/Function.py
7
9648
''' @summary: # Functions to fill missing peak objects @author: Jairus Bowne @author: Sean O'Callaghan ''' import csv import string import sys, os, errno, string, numpy sys.path.append("/x/PyMS") from pyms.GCMS.IO.ANDI.Function import ANDI_reader from pyms.GCMS.IO.MZML.Function import mzML_reader from pyms....
gpl-2.0
8,064,595,078,807,377,000
28.686154
93
0.565713
false
stephanie-wang/ray
python/ray/tune/suggest/hyperopt.py
1
9289
import numpy as np import copy import logging from functools import partial import pickle try: hyperopt_logger = logging.getLogger("hyperopt") hyperopt_logger.setLevel(logging.WARNING) import hyperopt as hpo except ImportError: hpo = None from ray.tune.error import TuneError from ray.tune.suggest.sugge...
apache-2.0
1,423,453,493,068,253,700
40.10177
79
0.590268
false
albertoferna/compmech
doc/source/conf_scipy.py
3
6677
# -*- coding: utf-8 -*- import sys, os, re # Check Sphinx version import sphinx if sphinx.__version__ < "1.1": raise RuntimeError("Sphinx 1.1 or newer required") needs_sphinx = '1.1' # ----------------------------------------------------------------------------- # General configuration # -----------------------...
bsd-3-clause
5,327,442,863,046,868,000
30.347418
93
0.606859
false
radioxoma/immunopy
immunopy/stain/cdeconvcl.py
1
6396
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from __future__ import division """ Created on Wed Aug 06 19:37:30 2014 @author: radioxoma """ import os import numpy as np from skimage import color import pyopencl as cl import pyopencl.array as cla from scipy import misc import matplotlib.pyplot as plt VERBOSE = Fal...
mit
6,577,647,387,119,431,000
42.510204
149
0.61601
false
shunsukeaihara/pysas
pysas/pyexcite.py
1
1172
# -*- coding: utf-8 -*- import numpy as np try: from numba import jit except ImportError: from pysas.decorators import do_nothing as jit @jit def gen_frame(cur_f0, prev_f0, frame, samplingrate, gen_samples, gauss): if cur_f0 == 0.0 or prev_f0 == 0.0: if gauss: return np.random.normal(0...
mit
3,515,681,140,772,425,000
27.585366
97
0.585324
false
QISKit/qiskit-sdk-py
qiskit/visualization/pulse/matplotlib.py
1
22579
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
apache-2.0
9,021,072,622,400,497,000
36.197694
96
0.529829
false
jungla/ICOM-fluidity-toolbox
2D/U/plot_W_t.py
1
3442
import os, sys import vtktools import fluidity_tools import numpy as np import matplotlib as mpl mpl.use('ps') import matplotlib.pyplot as plt #label = sys.argv[1] #basename = sys.argv[2] path0 = path1 = path2 = '../RST/stat_files/' path2b = '/scratch/jmensa/m_10_1/' # file0 = 'm_50_6f.stat' filepath0 = path0+file...
gpl-2.0
3,574,806,178,951,072,000
30.009009
96
0.665892
false
m4rx9/rna-pdb-tools
rna_tools/tools/rna_filter/rna_filter.py
2
11906
#!/usr/bin/env python """rna_filter.py - calculate distances based on given restrants on PDB files or SimRNA trajectories. Changes: weight is always 1 (at least for now). ,>,=,>=,<= . [PREVIOUS DOCUMENTATION - TO BE REMOVED] rna_filter.py -s 4gxy_rpr.pdb -r rp06_MohPairs.rfrestrs d:A5-A42 100.0 measured: 26...
mit
4,392,061,652,920,878,600
37.160256
446
0.529733
false
stefanseefeld/numba
numba/tests/test_array_iterators.py
1
14037
from __future__ import division import itertools import numpy as np from numba import unittest_support as unittest from numba import jit, typeof, types from numba.compiler import compile_isolated from .support import TestCase, CompilationCache, MemoryLeakMixin, tag def array_iter(arr): total = 0 for i, v i...
bsd-2-clause
-1,506,032,949,859,428,900
30.402685
79
0.568355
false
karllessard/tensorflow
tensorflow/python/autograph/impl/api_test.py
4
35611
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
apache-2.0
-160,551,979,138,421,540
27.128752
86
0.642526
false
djhshih/genomic
utils/genompy/genompy/plot/cn.py
1
6009
#!/usr/bin/env python3 import numpy as np import matplotlib import matplotlib.lines as lines import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib.ticker as ticker from .. import cn def plot_sample_profile(x, y, seg_x=None, seg_y=None, subplot_spec=None, ax=None, hide_xaxis=False,...
gpl-3.0
1,947,092,367,173,622,500
24.0375
122
0.668497
false
nan86150/ImageFusion
lib/python2.7/site-packages/scipy/_lib/_version.py
65
4792
"""Utility to compare (Numpy) version strings. The NumpyVersion class allows properly comparing numpy version strings. The LooseVersion and StrictVersion classes that distutils provides don't work; they don't recognize anything like alpha/beta/rc/dev versions. """ import re from scipy._lib.six import string_types ...
mit
985,191,422,128,744,100
29.916129
79
0.536728
false
rtrwalker/geotecha
geotecha/speccon/test/test_speccon1d_vrw.py
1
176841
# geotecha - A software suite for geotechncial engineering # Copyright (C) 2018 Rohan T. Walker (rtrwalker@gmail.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the L...
gpl-3.0
7,107,741,138,485,871,000
36.641975
162
0.514174
false
thekingofkings/embedding
python/crawl_zillow.py
1
6999
# -*- coding: utf-8 -*- """ Created on Sun Aug 28 15:18:12 2016 @author: gjz5038 """ import requests import numpy as np import time session = requests.Session() session.headers.update({'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', ...
mit
1,120,078,061,290,505,300
31.253456
175
0.519074
false
tosanai/wbai_hackathon_2017
agent/cognitive/module.py
1
5528
# coding: utf-8 import copy import os import brica1.gym import numpy as np import _pickle as pickle from ml.cnn_feature_extractor import CnnFeatureExtractor from ml.q_net import QNet from ml.experience import Experience from config.model import CNN_FEATURE_EXTRACTOR, CAFFE_MODEL, MODEL_TYPE from config.log import ...
apache-2.0
-2,209,802,420,271,121,200
37.657343
118
0.625181
false
MioGit/RobotSimFramework
robots.py
1
7491
# -*- coding: utf-8 -*- # Python 2.7.8 """ Author: Isaac Sanchez Ruiz appllgc@gmail.com Copyright (C) 2014 Isaac Sanchez Ruiz This file is part of RobotSimFramework. RobotSimFramework is free software: you can redistribute it and/or modify it under the terms of the Lesser GNU General Public License as ...
gpl-3.0
-5,374,866,057,185,673,000
52.12766
229
0.690696
false
Eric89GXL/vispy
vispy/glsl/build-spatial-filters.py
1
20537
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # glumpy is an OpenGL framework for the fast visualization of numpy arrays. # Copyright (C) 2009-2011 Nicolas P. Rougier. All rights reserved. # # Redistribution and use in source and binary fo...
bsd-3-clause
5,926,030,809,813,368,000
27.564067
125
0.511044
false
michaelaye/spexpy
guide_movie.py
1
1229
import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import matplotlib.animation as manimation import pyfits import glob import os from scipy.ndimage import median_filter os.chdir('/raid1/maye/irtf/140918/guidedog/scan1') def read_scan1(fname): data = pyfits.getdata(fname, 0)...
bsd-3-clause
-6,363,818,092,243,812,000
26.311111
62
0.676973
false
plotly/octogrid
setup.py
1
1811
from os.path import dirname, join from octogrid import __version__ from setuptools import setup def read(filename): """ Read content from utility files """ return open(join(dirname(__file__), filename)).read() setup( name='octogrid', version=__version__, author='Pravendra Singh', au...
mit
-7,434,494,033,731,529,000
29.694915
162
0.575373
false
valiantljk/graph-partition
drawing/nx_pylab.py
1
29867
""" ********** Matplotlib ********** Draw networks with matplotlib. See Also -------- matplotlib: http://matplotlib.org/ pygraphviz: http://pygraphviz.github.io/ """ # Copyright (C) 2004-2012 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov>...
gpl-2.0
8,915,198,073,067,984,000
29.199191
124
0.572639
false
AlchemicalChest/Gaussian-Process-with-Stochastic-Variational-Inference
GPSVI/test/test20newsgroups.py
1
1417
# -*- coding: utf-8 -*- """ Created on Thu Apr 30 11:24:55 2015 @author: Ziang """ import time import numpy as np import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn import datasets from sklearn.cross_validation import train_test_split from sklearn.decomposition impor...
mit
-1,960,622,932,607,665,700
25.259259
77
0.690191
false
xray/xray
xarray/plot/plot.py
1
33300
""" Use this module directly: import xarray.plot as xplt Or use the methods on a DataArray or Dataset: DataArray.plot._____ Dataset.plot._____ """ import functools import numpy as np import pandas as pd from .facetgrid import _easy_facetgrid from .utils import ( _add_colorbar, _assert_valid_xy, ...
apache-2.0
1,388,698,512,246,744,800
33.08393
106
0.593393
false
ECP-CANDLE/Benchmarks
Pilot3/P3B4/p3b4_baseline_keras2.py
1
4652
from __future__ import print_function import numpy as np import os, sys, gzip import time import keras from tf_mthcan import hcan import argparse import p3b4 as bmk import candle def initialize_parameters(default_model = 'p3b4_default_model.txt' ): # Build benchmark object p3b3Bmk = bmk.BenchmarkP3B3(bmk....
mit
-1,971,844,952,446,747,100
26.204678
143
0.567068
false
karla3jo/menpo-old
menpo/io/mesh/base.py
1
13479
import abc from collections import namedtuple import commands import os.path as path import tempfile from menpo.io.base import Importer, find_alternative_files, \ map_filepath_to_importer from menpo.io.mesh.assimp import AIImporter from menpo.io.exceptions import MeshImportError from menpo.shape import TexturedTriM...
bsd-3-clause
-1,672,173,169,141,588,000
35.928767
117
0.602196
false
phockett/ePSproc
epsproc/efield/efields.py
1
41523
""" ePSproc Efield class """ import numpy as np from scipy import constants as scipy_constants import pprint import xarray as xr # Additional imports for plotting import matplotlib.pyplot as plt import holoviews as hv from holoviews import opts # Use dictionary to create field defns intially? Gets confusing ot...
gpl-3.0
7,585,800,800,355,117,000
43.552575
219
0.525155
false
kamcpp/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/operator_pd_diag_test.py
19
3260
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
apache-2.0
6,146,617,093,454,137,000
30.650485
80
0.708589
false
hmenke/espresso
src/python/object_in_fluid/oif_classes.py
1
67795
# Copyright (C) 2010-2018 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
gpl-3.0
-7,041,708,817,716,287,000
46.409091
200
0.496069
false
bcongdon/Data-Science-Projects
election_tweets/tweet_tokenizer.py
1
1301
import re,json import numpy as np import scipy.stats as sp emoticons_str = r""" (?: [:=;] # Eyes [oO\-]? # Nose (optional) [D\)\]\(\]/\\OpP] # Mouth )""" regex_str = [ emoticons_str, r'<[^>]+>', # HTML tags r'(?:@[\w_]+)', # @-mentions r"(?:\#+[\w_]+[\w\'_\-]*[\w_]+)",...
gpl-3.0
-1,501,399,698,604,844,000
26.680851
92
0.500384
false
bikash/h2o-dev
py2/h2o_util.py
1
29314
import subprocess import gzip, shutil, random, time, re, copy import os, zipfile, json, csv import sys, math import errno from h2o_test import verboseprint, dump_json import h2o_print as h2p #************************************************************************ # stuff from ray # list or tuple is okay. so are dicts...
apache-2.0
7,380,870,850,780,625,000
38.613514
130
0.596268
false
JohnGriffiths/dipy
dipy/align/metrics.py
4
46496
""" Metrics for Symmetric Diffeomorphic Registration """ from __future__ import print_function import abc import numpy as np import scipy as sp from scipy import gradient, ndimage from ..utils.six import with_metaclass from . import vector_fields as vfu from . import sumsqdiff as ssd from . import crosscorr as cc fro...
bsd-3-clause
-8,108,721,500,854,902,000
42.292365
81
0.584287
false
mmaelicke/scikit-gstat
skgstat/Kriging.py
1
17552
""" The kriging module offers only an Ordinary Kriging routine (OK) that can be used together with the skgstat.Variogram class. The usage of the class is inspired by the scipy.interpolate classes. """ import time import numpy as np from scipy.spatial.distance import squareform from scipy.linalg import solve as scipy_s...
mit
-6,802,020,258,376,292,000
31.868914
155
0.582384
false
ghislainv/deforestprob
forestatrisk/niceplot.py
1
3199
#!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================== # author :Ghislain Vieilledent # email :ghislain.vieilledent@cirad.fr, ghislainv@gmail.com # web :https://ecology.ghislainv.fr # python_version :>=2.7 # license...
gpl-3.0
5,391,069,074,789,299,000
33.031915
80
0.563926
false
astrobayes/BMAD
chapter_5/code_5.28.py
1
1554
# From: Bayesian Models for Astrophysical Data, Cambridge Univ. Press # (c) 2017, Joseph M. Hilbe, Rafael S. de Souza and Emille E. O. Ishida # # you are kindly asked to include the complete citation if you used this # material in a publication # Code 5.28 - Binomial model in Python using Stan # 1 response (y) and...
gpl-3.0
-7,941,266,955,851,620,000
20.887324
73
0.618404
false
nortikin/sverchok
nodes/analyzer/path_length_2.py
2
6715
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
gpl-3.0
-5,332,234,326,293,690,000
35.693989
109
0.618317
false
seung-lab/neuroglancer
python/examples/flood_filling_simulation.py
1
7883
#!/usr/bin/env python """Example of display interactive flood-filling "inference" results. shift+mousedown0 triggers the simulated flood filling to start with an initial seed at the mouse position. The computed mask values are displayed as an image, while the seed points chosen are displayed as point annotations. k...
apache-2.0
-612,087,195,509,239,300
35.665116
96
0.554231
false
xfxf/veyepar
tests/upload_log_analyser.py
4
2988
#!/usr/bin/python import datetime import csv import StringIO import pprint # seconds from midnight, timestamp, bytes sent log="""56521.93324, 2011-06-24 15:42:01.933240, 0 56521.933569, 2011-06-24 15:42:01.933569, 1292 56521.933722, 2011-06-24 15:42:01.933722, 1488 56522.022575, 2011-06-24 15:42:02.022575, 16488 565...
mit
-1,260,176,071,623,473,000
31.129032
78
0.676372
false
WillArmentrout/galSims
plotting/ClusterAngular.py
1
8649
import matplotlib.pyplot as plt import math import csv import argparse '''parser = argparse.ArgumentParser() parser.add_argument("iterTotal", type=int, help="Number of Clustering Iterations") args = parser.parse_args() iterTot = args.iterTotal''' # Prompt User for number of iterations of clustering...
gpl-2.0
4,347,766,149,789,477,400
47.864407
152
0.530582
false
vascotenner/holoviews
holoviews/element/comparison.py
1
24350
""" Helper classes for comparing the equality of two HoloViews objects. These classes are designed to integrate with unittest.TestCase (see the tests directory) while making equality testing easily accessible to the user. For instance, to test if two Matrix objects are equal you can use: Comparison.assertEqual(matri...
bsd-3-clause
8,527,686,448,773,649,000
35.074074
98
0.604928
false
jostep/tensorflow
tensorflow/python/debug/cli/analyzer_cli.py
3
55928
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
apache-2.0
-3,123,995,718,131,566,000
34.285804
80
0.610338
false
joshmoore/openmicroscopy
components/tools/OmeroWeb/omeroweb/webclient/controller/container.py
1
57620
#!/usr/bin/env python # # # # Copyright (c) 2008-2011 University of Dundee. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) an...
gpl-2.0
360,977,168,249,794,500
46.191646
232
0.564596
false
Fougere87/unsec
hugo_test.py
1
7674
#!/usr/bin/python3 import os import logging import unsec from sklearn import cluster import matplotlib.pyplot as plt import matplotlib as mpl from sklearn import metrics from mpl_toolkits.mplot3d import Axes3D from sklearn import decomposition from sklearn.metrics import pairwise from sklearn import mixture import mat...
unlicense
-4,882,499,110,803,133,000
34.041096
144
0.6595
false
ishalyminov/memn2n
single.py
1
4686
"""Example running MemN2N on a single bAbI task. Download tasks from facebook.ai/babi """ from __future__ import absolute_import from __future__ import print_function from data_utils import load_task, vectorize_data from sklearn import cross_validation, metrics from memn2n import MemN2N from itertools import chain fro...
mit
3,172,476,606,770,828,000
40.105263
132
0.660478
false
JackKelly/neuralnilm_prototype
scripts/e487.py
2
6833
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectiona...
mit
5,616,429,882,336,762,000
31.538095
133
0.590517
false
DavidAce/PT
Data_Analysis/dataanaylysis.py
1
1536
import matplotlib.pyplot as plt import pandas as pd import numpy as np import os.path import h5py filename = '../output/data.h5' if(not os.path.exists(filename)): print("File does not exist.") exit(1) store = pd.HDFStore(filename,mode='r') #Use this to read hdf5 tables. Open in read mode. h5f = h5py.Fi...
gpl-3.0
5,602,338,793,825,159,000
44.205882
142
0.667318
false
wallinm1/kaggle-facebook-bot
hyperopt_xgb.py
1
2608
import pandas as pd from sklearn.cross_validation import cross_val_score, StratifiedKFold from sklearn.feature_selection import SelectPercentile, chi2 from sklearn.externals import joblib from sklearn.pipeline import Pipeline import xgboost as xgb from hyperopt import fmin, tpe, hp, STATUS_OK, Trials import os def sco...
mit
2,690,637,892,772,345,000
41.080645
80
0.593942
false
freedomtan/tensorflow
tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py
4
3895
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
apache-2.0
8,939,267,146,637,729,000
33.776786
80
0.661617
false
scivision/dmcutils
cam_intensity.py
1
6411
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Assumes observing from 66.986330° N, 50.943941° W. I did not take into account slight ground distance between camera and radar. E-region magnetic zenith at 79.7213° el, 150.11° az clockwise from geographic north. But the beam was pointed at F-region magnetic zenith? S...
gpl-3.0
8,059,602,880,121,933,000
33.446237
134
0.568129
false
andreabedini/numexpr
bench/vml_timing.py
5
5869
################################################################### # Numexpr - Fast numerical array expression evaluator for NumPy. # # License: MIT # Author: See AUTHORS.txt # # See LICENSE.txt and LICENSES/*.txt for details about copyright and # rights to use. ##########################################...
mit
7,529,341,098,715,401,000
33.321637
81
0.613733
false
tuanvu216/udacity-course
intro_to_machine_learning/lesson/lesson_13_validation/KFold CV in sklearn.py
1
1245
# -*- coding: utf-8 -*- """ Created on Fri Jan 02 15:14:27 2015 @author: tvu """ from sklearn.cross_validation import KFold t0 = time() kf = KFold(len(authors), 2) for train_indices, test_indices in kf: #make training and testing datasets features_train = [word_data[ii] for ii in train_indices] features_...
mit
-1,931,519,531,409,667,300
35.647059
89
0.686747
false
0x7678/gr-gsm
docs/doxygen/doxyxml/generated/compoundsuper.py
2
360038
#!/usr/bin/env python3 # # Generated Thu Jun 11 18:44:25 2009 by generateDS.py. # from __future__ import print_function from __future__ import unicode_literals import sys from xml.dom import minidom from xml.dom import Node import six # # User methods # # Calls to the methods in these classes are generated by ge...
gpl-3.0
5,698,839,263,969,963,000
42.138989
641
0.59627
false
GUR9000/Deep_MRI_brain_extraction
NNet_Core/NN_Analyzer.py
1
4154
""" This software is an implementation of Deep MRI brain extraction: A 3D convolutional neural network for skull stripping You can download the paper at http://dx.doi.org/10.1016/j.neuroimage.2016.01.024 If you use this software for your projects please cite: Kleesiek and Urban et al, Deep MRI brain extraction: A 3...
mit
4,321,185,761,625,126,000
40.54
163
0.614107
false
mespe/SolRad
collection/compare_cimis_cfsr/compare_cimis_cfsr.py
1
2737
import pandas as pd import matplotlib.pyplot as plt from netCDF4 import Dataset import netCDF4 def load_CFSR_data(): my_example_nc_file = 'RES.nc' # latitude, longitude = (39.5, -122) fh = Dataset(my_example_nc_file, mode='r') print(fh.variables.keys()) print(help(fh.variables['time'...
mit
-8,473,513,301,691,959,000
26.938776
186
0.523201
false
samzhang111/scikit-learn
sklearn/grid_search.py
3
38126
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
bsd-3-clause
-8,075,441,600,595,167,000
37.433468
87
0.608168
false
Monika319/EWEF-1
Cw2Rezonans/Karolina/Oscyloskop/OscyloskopZ5W2.py
1
1312
# -*- coding: utf-8 -*- """ Plot oscilloscope files from MultiSim """ import numpy as np import matplotlib.pyplot as plt import sys import os from matplotlib import rc rc('font',family="Consolas") files=["real_zad5_05f_p2.txt"] for NazwaPliku in files: print NazwaPliku Plik=open(NazwaPliku) #print DeltaT ...
gpl-2.0
-1,034,745,225,697,455,700
23.603774
72
0.578221
false
cBeaird/SemEval_Character-Identification-on-Multiparty-Dialogues
Classifiers/Random_Forest/Learning_Curve.py
1
2718
#!/usr/bin/env python """ File to plot the Learning Curve of a Random Forrest """ import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier import matplotlib as mpl from sklearn.model_selection import KFold from sklearn.model_selection import learning_curve mpl.use('TkAgg') import matp...
mit
-2,796,158,065,937,514,500
34.298701
120
0.649007
false
ciyer/stockscape
src/python/Stockscape/stockscape/dsr.py
1
6058
#!/usr/bin/env python # -*- coding: utf-8 -*- """ dsr.py Utilities for the DeLong-Shiller Redux (dsr). Created by Chandrasekhar Ramakrishnan on 2017-10-02. Copyright (c) 2017 Chandrasekhar Ramakrishnan. All rights reserved. """ import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import seabo...
bsd-3-clause
6,513,744,225,531,852,000
35.715152
109
0.643447
false
ryfeus/lambda-packs
Skimage_numpy/source/scipy/optimize/minpack.py
11
30534
from __future__ import division, print_function, absolute_import import warnings from . import _minpack import numpy as np from numpy import (atleast_1d, dot, take, triu, shape, eye, transpose, zeros, product, greater, array, all, where, isscalar, asarray, inf, abs, ...
mit
-4,117,547,933,951,803,400
36.100851
87
0.588917
false
robwarm/gpaw-symm
gpaw/test/pw/lfc.py
1
1771
import numpy as np from gpaw.test import equal from gpaw.grid_descriptor import GridDescriptor from gpaw.spline import Spline import gpaw.mpi as mpi from gpaw.lfc import LocalizedFunctionsCollection as LFC from gpaw.wavefunctions.pw import PWDescriptor, PWLFC from gpaw.kpt_descriptor import KPointDescriptor x = 2.0 ...
gpl-3.0
1,479,708,894,144,279,600
26.671875
82
0.568041
false
apatil/covariance-prior
cov_prior/givens_step.py
1
1366
# Author: Anand Patil # Date: 2 June 2009 # License: Creative Commons BY-NC-SA #################################### from fast_givens import fg import pymc as pm import numpy as np from ortho_basis import OrthogonalBasis __all__ = ['fast_givens', 'GivensStepper'] def fast_givens(o,i,j,t): "Givens rotates the matr...
mit
5,670,105,406,355,458,000
26.34
63
0.541728
false
ndingwall/scikit-learn
examples/linear_model/plot_poisson_regression_non_normal_loss.py
10
22927
""" ====================================== Poisson regression and non-normal loss ====================================== This example illustrates the use of log-linear Poisson regression on the `French Motor Third-Party Liability Claims dataset <https://www.openml.org/d/41214>`_ from [1]_ and compares it with a linear...
bsd-3-clause
8,887,515,850,015,059,000
39.012216
79
0.689973
false
ezekial4/atomic_neu
examples/profiles.py
1
3306
""" typical carbon content is n_c / n_e = 0.05 """ import numpy as np import matplotlib.pyplot as plt import atomic from ensemble_average import annotate_lines def parabolic_profile(y0): x = np.linspace(1., 0, 50) y = 1 - x**2 y *= y0 return x, y r, temperature = parabolic_profile(3e3) r, density =...
mit
-6,893,652,996,516,458,000
22.784173
73
0.680278
false