repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
icyyy/information_value
[ "8d71ab742e285f452e1dc0dc7952a924a27167ec" ]
[ "src/information_value.py" ]
[ "import numpy as np\nimport math\nfrom scipy import stats\nfrom sklearn.utils.multiclass import type_of_target\n\nclass WOE:\n def __init__(self):\n self._WOE_MIN = -20\n self._WOE_MAX = 20\n\n def woe(self, X, y, event=1):\n '''\n Calculate woe of each feature category and informa...
[ [ "numpy.in1d", "numpy.copy", "scipy.stats.scoreatpercentile", "numpy.array", "numpy.where", "numpy.unique", "sklearn.utils.multiclass.type_of_target" ] ]
kylejn27/dask
[ "3327b2e158dbadf2057685fdb51b74ce3129416e" ]
[ "dask/array/core.py" ]
[ "import math\nimport operator\nimport os\nimport pickle\nimport re\nimport sys\nimport traceback\nimport uuid\nimport warnings\nfrom bisect import bisect\nfrom collections.abc import Iterable, Iterator, Mapping\nfrom functools import partial, wraps, reduce\nfrom itertools import product, zip_longest\nfrom numbers i...
[ [ "numpy.ones", "numpy.empty", "numpy.searchsorted", "numpy.dtype", "numpy.asarray", "numpy.median", "numpy.errstate", "numpy.asanyarray", "numpy.can_cast", "numpy.prod", "numpy.max", "numpy.isnan", "numpy.array", "numpy.isscalar" ] ]
ShamimSuf/AI_FlappyBird_GeneticAlgo
[ "438da76b1327ef3167dea42706dce4aaeccc8136" ]
[ "AI_Flappy.py" ]
[ "#This flappy will have 6 inputs (i1 to i6) : up, down, bird top-right to up-block-low-right, bird top-left to up-block-low-left, so on. \n\nimport numpy as np\nimport pygame\nimport time\nimport random\nfrom random import randint\n\npygame.init()\n\n#6 input nodes\ni_ROW = 1\ni_COL = 6\n\n#3 hidden layer nodes\n#...
[ [ "numpy.random.uniform", "numpy.sum", "numpy.exp", "numpy.random.rand", "numpy.array", "numpy.dot", "numpy.square" ] ]
Tesla2fox/MPDA-DE
[ "0a27d59ceba16d292fade01d95b1c1f336e5f604" ]
[ "MPDA_decode/instance.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Sep 21 15:49:17 2018\n\n@author: robot\n\"\"\"\nfrom readCfg import *\nimport numpy as np\nfrom enum import Enum\n\nclass TaskModelType(Enum):\n ExpModel = 1\n LineModel = 2\n\n\n\n\nclass Instance(object):\n def __init__(self, insFileName = 'wtf'):\n ...
[ [ "numpy.zeros" ] ]
TianjieZhang1993/PINNs
[ "9034ba7f4fef81c24954fa3cbf08a2d4a7fee85a" ]
[ "appendix/discrete_time_identification (Burgers)/Burgers_systematic.py" ]
[ "\"\"\"\n@author: Maziar Raissi\n\"\"\"\n\nimport sys\nsys.path.insert(0, '../../Utilities/')\n\nimport tensorflow as tf\nimport numpy as np\nimport time\nimport scipy.io\n\nnp.random.seed(1234)\ntf.set_random_seed(1234)\n\n\nclass PhysicsInformedNN:\n # Initialize the class\n def __init__(self, x0, u0, x1, u...
[ [ "numpy.ones", "numpy.savetxt", "numpy.random.seed", "tensorflow.matmul", "numpy.log", "tensorflow.Variable", "tensorflow.global_variables_initializer", "numpy.asscalar", "numpy.reshape", "numpy.random.choice", "numpy.abs", "tensorflow.gradients", "tensorflow.set...
justusschock/tensorboardX
[ "1c16e127f9a737c0b45d0447c20499dec666130c" ]
[ "tensorboardX/summary.py" ]
[ "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.cumsum", "numpy.empty", "numpy.ceil", "numpy.searchsorted", "numpy.histogram", "numpy.maximum", "numpy.greater", "numpy.floor", "numpy.pad", "numpy.stack", "numpy.concatenate" ] ]
v-morello/iqrm
[ "9f90e43c003af5d248d08b65d52fc88a73e12bbd", "9f90e43c003af5d248d08b65d52fc88a73e12bbd" ]
[ "iqrm/core.py", "iqrm/tests/test_iqrm.py" ]
[ "import itertools\nimport numpy as np\n\nfrom collections import defaultdict\n\n\ndef lagged_diff(x, k):\n \"\"\"\n Returns the sequence of x[i] - x[i - k], as an array with the same size as x.\n Boundary conditions are handled as follows:\n x[i] = x[0] if i < 0\n x[i] = x[n-1] if i >= n,...
[ [ "numpy.zeros_like", "numpy.roll", "numpy.asarray", "numpy.clip", "numpy.where", "numpy.percentile" ], [ "numpy.random.normal", "numpy.random.seed", "numpy.alltrue", "numpy.zeros" ] ]
giacomov/pyggop
[ "81f0307281d00e367ab632fa52de41a56877b048" ]
[ "pyggop/Tau.py" ]
[ "import numpy as np\nfrom multiprocessing import Pool\n\nfrom grbod import *\n\nimport os, sys\nimport pickle\n\nimport scipy.interpolate\nfrom math import log10\n\nimport matplotlib.pyplot as plt\n\nfrom pyggop.ParallelPool import ParallelPool\n\n#This is the actual computation\ndef func(DRbar, R_0, b, m, a, xx, y...
[ [ "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.ndenumerate", "numpy.arange", "numpy.log10", "matplotlib.pyplot.colorbar", "numpy.meshgrid", "numpy.linspace", "numpy.isfinite" ] ]
schlevik/EGG
[ "428d5aed3eb6fb0296f6856fb77b0a1cdceb33f1" ]
[ "egg/zoo/basic_games/play.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\n\nimpo...
[ [ "torch.sum", "torch.utils.data.DataLoader", "torch.nn.functional.cross_entropy" ] ]
kasimte/Pytorch-pensieve
[ "e550d9c36ed35b49592955fefbc17d1424d37b3b" ]
[ "test/model.py" ]
[ "from __future__ import division\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom utils import norm_col_init, weights_init\n\n# class agentNET(torch.nn.Module):\n# def __init__(self, num_inputs = 1, num_outputs = 6):\n# super(agentNET, self).__init__()\n#\n# self.conv1...
[ [ "torch.nn.LSTMCell", "torch.nn.Conv2d", "torch.nn.Linear" ] ]
nla-group/classix
[ "8584162e4c89ba05a62faf1e20104768cf5bb43c" ]
[ "exp/run_scale_lx.py" ]
[ "import sklearn.datasets as data\nfrom classix import CLASSIX\nimport matplotlib.pyplot as plt\n\ndef rn_scale_explore():\n plt.style.use('bmh')\n\n TOL = 0.1 \n random_state = 1\n moons, _ = data.make_moons(n_samples=1000, noise=0.05, random_state=random_state)\n blobs, _ = data.make_blobs(n_samples...
[ [ "matplotlib.pyplot.style.use", "sklearn.datasets.make_moons", "sklearn.datasets.make_blobs" ] ]
RSLancs/Extracting_plant_names_and_collocates_from_historical_texts
[ "c8d6746978786ca4b83dc550114700530077c543" ]
[ "merge_geo_with collocates.py" ]
[ "##python27\r\n\r\nfrom pprint import pprint\r\nimport pandas as pd\r\n\r\n\r\n##..............open manually merged geoparsed results\r\ngeo = pd.read_csv('./data/merger_xml_extracted_geoparsed_collocates.csv')\r\ngeo = [tuple(x) for x in geo.values] # df to list\r\nprint(geo[1])\r\n\r\n\r\n##..........open colloca...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
ishine/tf-kaldi-speaker-master
[ "4b93110c4aa54f4764c58d9ffef3aec2efce39db" ]
[ "egs/voxceleb/sre/backend/tools/s-norm-get-enroll.py" ]
[ "import os\r\nimport numpy as np\r\nimport logging\r\nimport argparse\r\nimport sys\r\n\r\nlogger = logging.getLogger('s-norm score.')\r\nlogger.setLevel(logging.INFO)\r\nhandler = logging.StreamHandler(sys.stdout)\r\nhandler.setLevel(logging.INFO)\r\nformatter = logging.Formatter(\"%(asctime)s [%(pathname)s:%(line...
[ [ "numpy.zeros", "numpy.delete", "numpy.array", "numpy.std", "numpy.mean" ] ]
QB3/sparse-ho-qbe
[ "73358caeff2ff08ca4e88af419e7dae753d43ea9" ]
[ "sparse_ho/implicit_forward.py" ]
[ "import numpy as np\nfrom scipy.sparse import issparse\nfrom sparse_ho.forward import get_beta_jac_iterdiff\n\n\nclass ImplicitForward():\n def __init__(\n self, criterion, tol_jac=1e-3, n_iter=100, n_iter_jac=100,\n use_sk=False, verbose=False):\n self.criterion = criterion\n ...
[ [ "scipy.sparse.issparse", "numpy.abs", "numpy.exp" ] ]
saethlin/yt
[ "992ae71974dca933346e91008c5a50f43a0a350e" ]
[ "yt/geometry/oct_geometry_handler.py" ]
[ "\"\"\"\nOctree geometry handler\n\n\n\n\n\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2013, yt Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this softw...
[ [ "numpy.ones", "numpy.log2", "numpy.zeros", "numpy.isnan", "numpy.array" ] ]
stiphyMT/plantcv
[ "b51b545f3aef0742a2d250c75cc998ba6c9e57b2" ]
[ "plantcv/plantcv/auto_crop.py" ]
[ "# Resize image\n\nimport os\nimport cv2\nimport numpy as np\nfrom plantcv.plantcv._debug import _debug\nfrom plantcv.plantcv import params\nfrom plantcv.plantcv import fatal_error\n\n\ndef auto_crop(img, obj, padding_x=0, padding_y=0, color='black'):\n \"\"\"\n Resize image.\n\n Inputs:\n img = R...
[ [ "numpy.rint", "numpy.shape", "numpy.copy" ] ]
Yurlungur/FLRW
[ "15424d2304e44d0e38110b655c5c28a6aeb34147" ]
[ "plot_all_variables_big_a.py" ]
[ "#!/usr/bin/env python2\n\n# Author: Jonah Miller (jonah.maxwell.miller@gmail.com)\n# Time-stamp: <2013-12-14 16:50:20 (jonah)>\n\n# This is a companion program to my FLRW simulator. It takes a data\n# file and generates a plot of the scale factor, its derivative, the\n# density, and the pressure of the matter.\n# ...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.rcParams.update", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.loadtxt" ] ]
MaxXSoft/ZexGP
[ "c01d68d134990c0d18f30f12d93855ba5ffcbe29" ]
[ "examples/funcfit/__main__.py" ]
[ "'''\nAn example of fitting a function with ZexGP.\n'''\n\nfrom zexgp.kernel import Kernel\nfrom os import path\nfrom sys import float_info as fi\nfrom matplotlib import pyplot as plt\n\n\n# some necessary global variables\nfunc_val = []\ndomain = []\n\n\ndef init_func_val():\n '''\n Initialize function value.\n ...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.plot" ] ]
algebra2k/terrier
[ "8b6f4b0b0c30dc94411f197e610f634ce0ab5b0b" ]
[ "script/model/model.py" ]
[ "#!/usr/bin/env python3\n\nimport numpy as np\n\nimport lightgbm as lgb\n\nfrom sklearn import linear_model\nfrom sklearn import kernel_ridge\nfrom sklearn import ensemble\nfrom sklearn import preprocessing\nfrom sklearn import neural_network\nfrom sklearn import multioutput\n\n# import warnings filter\nfrom warnin...
[ [ "sklearn.kernel_ridge.KernelRidge", "sklearn.linear_model.LinearRegression", "numpy.exp", "sklearn.multioutput.MultiOutputRegressor", "sklearn.ensemble.RandomForestRegressor", "numpy.log", "numpy.clip", "sklearn.linear_model.HuberRegressor", "sklearn.preprocessing.StandardScale...
shivammaniharsahu/django_api
[ "6ffb3d9f70f30f5fd3ae06ec00a6dd7c7783a797", "6ffb3d9f70f30f5fd3ae06ec00a6dd7c7783a797" ]
[ "Lib/site-packages/tensorflow_core/python/ops/gen_functional_ops.py", "Lib/site-packages/tensorflow_core/_api/v1/compat/v1/experimental/__init__.py" ]
[ "\"\"\"Python wrappers around TensorFlow ops.\n\nThis file is MACHINE GENERATED! Do not edit.\n\"\"\"\n\nimport collections as _collections\nimport six as _six\n\nfrom tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow\nfrom tensorflow.python.eager import context as _context\nfrom tensorflow.python.ea...
[ [ "tensorflow.python.eager.execute.args_to_matching_eager", "tensorflow.python.eager.execute.make_type", "tensorflow.python.eager.execute.record_gradient", "tensorflow.python.util.tf_export.tf_export", "tensorflow.python.eager.execute.make_int", "tensorflow.python.pywrap_tensorflow.TFE_Py_Fa...
linusidom/rl-workshop
[ "dbb2ca8b9a5330042a30655ee64c3a4be241d692" ]
[ "solutions/networks.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch import optim\nfrom torch.autograd.variable import Variable\n\nclass QNetwork(nn.Module):\n def __init__(self, state_size, action_size, nb_hidden, seed=1412):\n super(QNetwork, self).__init__()\n self.seed = torch.manu...
[ [ "torch.FloatTensor", "torch.autograd.variable.Variable", "torch.nn.Linear", "torch.nn.functional.linear", "torch.randn", "torch.manual_seed", "torch.nn.ReLU" ] ]
ky-zhang/utils
[ "f1c9d2580db5ef0f0291ae77312b3d538f292a12" ]
[ "plot/plot_folder.py" ]
[ "import os\nimport numpy\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport argparse\nfrom PIL import Image\n\nparser = argparse.ArgumentParser()\n\nparser.add_argument('-input', default = '', help = 'input file folder')\nparser.add_argument('-label', default = '', help = 'label file...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.axis", "matplotlib.pyplot.xlim", "matplotlib.pyplot.close", "matplotlib.pyplot.ylim", "matplotlib.use", "matplotlib.pyplot.plot" ] ]
algteam/spacy_zh_model
[ "0b0cba1a3964aa426e5f96087849c90e69e2a89d" ]
[ "examples/keras_parikh_entailment/spacy_hook.py" ]
[ "import numpy as np\r\nfrom keras.models import model_from_json\r\n\r\ntry:\r\n import cPickle as pickle\r\nexcept ImportError:\r\n import pickle\r\n\r\n\r\nclass KerasSimilarityShim(object):\r\n entailment_types = [\"entailment\", \"contradiction\", \"neutral\"]\r\n\r\n @classmethod\r\n def load(cls...
[ [ "numpy.random.normal", "numpy.zeros" ] ]
nabeelyousfi/MyoEmg
[ "c819712d93bfb58828b36669e55cd4d77453c1cf" ]
[ "train.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Aug 29 13:39:13 2018\n\n@author: Hassan Yousuf & Nabeel Hussain\n\"\"\"\nfrom __future__ import print_function\nimport sklearn.ensemble\nfrom sklearn import metrics\nfrom myo import init, Hub, DeviceListener, StreamEmg\nfrom time import sleep\nimport numpy as np\nimp...
[ [ "sklearn.metrics.accuracy_score", "numpy.abs", "numpy.asarray" ] ]
mcstro/natural-neighbor-interpolation
[ "76ba7bb50c84aef35e993902c46824e5991df45d" ]
[ "tests/test_api.py" ]
[ "import scipy.interpolate\nimport numpy as np\nimport pytest\n\nimport naturalneighbor\n\n\n@pytest.mark.parametrize(\"grid_ranges\", [\n [[0, 4, 0.6], [-3, 3, 1.0], [0, 1, 3]],\n [[0, 2, 1], [0, 2, 1j], [0, 2, 2j]],\n [[0, 2, 1 + 1j], [0, 2, -10j], [0, 2, 2j]],\n [[0, 2, 1 + 1j], [0, 2, -0.9j], [0, 2, ...
[ [ "numpy.random.rand" ] ]
Ahtkom/hello-world
[ "3a81bd25713513836c9242fe943b171ff731cfce" ]
[ "2021_1/sql_principle/prac_1/src/upload_geodata.py" ]
[ "import numpy as np\nimport pandas as pd\nimport psycopg2, sys\n\nhostname, user, dbname, passward = sys.argv[1:5]\n\n\ndef load_data():\n lon0, lat0 = 115.8, 29.4\n x = pd.read_excel('../data/x.xlsx', header=0, index_col=0).values\n y = pd.read_excel('../data/y.xlsx', header=0, index_col=0).values\n \n...
[ [ "pandas.read_excel", "numpy.isnan" ] ]
rli596/manim
[ "e147a9fc6c117332221e42437481f3efba76499a" ]
[ "manim/scene/scene.py" ]
[ "\"\"\"Basic canvas for animations.\"\"\"\n\nfrom __future__ import annotations\n\n__all__ = [\"Scene\"]\n\nimport copy\nimport datetime\nimport inspect\nimport platform\nimport random\nimport threading\nimport time\nimport types\nfrom queue import Queue\nfrom typing import Callable\n\nimport srt\n\nfrom manim.scen...
[ [ "numpy.sign", "numpy.transpose", "numpy.arctan", "numpy.random.seed", "numpy.cross", "numpy.arange", "numpy.max", "numpy.array", "numpy.linalg.norm" ] ]
MichaelAquilina/numpy
[ "6e8b869d52ec5a1242df69bcd9323a4b0947933b" ]
[ "numpy/distutils/exec_command.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nexec_command\n\nImplements exec_command function that is (almost) equivalent to\ncommands.getstatusoutput function but on NT, DOS systems the\nreturned status is actually correct (though, the returned status\nvalues may be different by a factor). In addition, exec_command\ntakes keyw...
[ [ "numpy.distutils.compat.get_exception", "numpy.distutils.misc_util.is_sequence", "numpy.distutils.log.debug", "numpy.distutils.misc_util.make_temp_file", "numpy.distutils.log.warn", "numpy.distutils.log.info", "numpy.compat.open_latin1" ] ]
yihui8776/TensorRT-DETR
[ "1f32e9a2f98e26ec5b2376f9a2695193887430fb" ]
[ "trt_int8_quant.py" ]
[ "\n#\n# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unles...
[ [ "numpy.array", "numpy.ascontiguousarray", "numpy.zeros" ] ]
robrkerr/tensorflow-models
[ "3656a07e89be134c2bc333c60a6c709e475024a6" ]
[ "differential_privacy/dp_sgd/dp_optimizer/utils.py" ]
[ "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.reshape", "tensorflow.matmul", "tensorflow.abs", "tensorflow.diag", "tensorflow.convert_to_tensor", "tensorflow.slice", "tensorflow.concat", "tensorflow.reduce_sum", "tensorflow.minimum", "tensorflow.nn.max_pool", "tensorflow.sign", "tensorflow.constant"...
jtpils/compression
[ "b758903c6df5eeafb5d444e8cec85d1b2bc132d3" ]
[ "tensorflow_compression/__init__.py" ]
[ "# Copyright 2018 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.version.VERSION.split" ] ]
Kali-Hac/SPC-MGR
[ "3eccceeba97e0dca62132187c6645b98620f3bd1" ]
[ "SPC-MGR.py" ]
[ "\"\"\"\r\nThe SPC-MGR is built based in part on graph attention mechanism (https://arxiv.org/abs/1710.10903),\r\npart on MG-SCR (https://www.ijcai.org/proceedings/2021/0135),\r\nand includes open-source codes provided by\r\nthe project of Graph Attention Network (GAT) at https://github.com/PetarV-/GAT,\r\nand the ...
[ [ "numpy.sum", "numpy.ones", "torch.stack", "tensorflow.app.flags.DEFINE_string", "tensorflow.reshape", "numpy.any", "numpy.argsort", "tensorflow.variable_scope", "numpy.asarray", "tensorflow.matmul", "tensorflow.name_scope", "tensorflow.concat", "tensorflow.nn.sp...
EnjoyLifeFund/py36pkgs
[ "0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2" ]
[ "chainer/functions/pooling/pooling_2d.py" ]
[ "import collections\n\nimport numpy\n\nfrom chainer import cuda\nfrom chainer import function\nfrom chainer.utils import conv\nfrom chainer.utils import type_check\n\n\nif cuda.cudnn_enabled:\n cudnn = cuda.cudnn\n libcudnn = cudnn.cudnn\n _cudnn_version = libcudnn.getVersion()\n\n\ndef _check_cudnn_accept...
[ [ "numpy.array" ] ]
dhb2128/scanpy
[ "78649a991197af4685a8fe2f7a0d24064e3056bd" ]
[ "scanpy/preprocessing/_normalization.py" ]
[ "import numpy as np\nfrom scipy.sparse import issparse\nfrom sklearn.utils import sparsefuncs\nfrom .. import logging as logg\nfrom ..utils import doc_params\nfrom ._docs import doc_norm_descr, doc_quant_descr, doc_params_bulk, doc_norm_quant, doc_norm_return, doc_ex_quant, doc_ex_total\n\ndef _normalize_data(X, co...
[ [ "sklearn.utils.sparsefuncs.inplace_row_scale", "scipy.sparse.issparse", "numpy.median", "numpy.ravel", "numpy.all" ] ]
vahndi/probability
[ "6ddf88e6f3d947c96b879e426030f60eb5cb2d59" ]
[ "tests/test_calculations/base_test.py" ]
[ "from unittest.case import TestCase\n\nfrom pandas import Series, DataFrame\n\nfrom probability.distributions import Beta, Dirichlet\n\n\nclass BaseTest(TestCase):\n\n def setUp(self) -> None:\n\n self.b1 = Beta(700, 300)\n self.b2 = Beta(600, 400)\n self.b3 = Beta(500, 500)\n self.d1...
[ [ "pandas.Series", "pandas.DataFrame" ] ]
trainorpj/probability
[ "944272707d352b12b91c419082fb3ec34b83b494" ]
[ "tensorflow_probability/python/bijectors/affine_scalar_test.py" ]
[ "# Copyright 2018 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "tensorflow.compat.v2.exp", "tensorflow.compat.v2.test.main", "tensorflow.compat.v2.GradientTape", "numpy.log", "numpy.array", "tensorflow.compat.v1.placeholder_with_default", "tensorflow.compat.v2.cast", "tensorflow.compat.v2.Variable" ] ]
yuanqingsunny/recommenders-addons
[ "7fe0e213ff59fe3528e7c1877a3885cc7ca355d4" ]
[ "tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_feature_filter.py" ]
[ "# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.math_ops.maximum", "tensorflow.python.framework.constant_op.constant", "tensorflow.python.util.tf_export.tf_export", "tensorflow.python.ops.math_ops.greater", "tensorflow.python.ops.array_ops.slice", "tensorflow.python.framework.sparse_tensor.SparseTensor", "tens...
sstsai-adl/d2go
[ "6cff773797b14698043589afe57ea67cd76286f9" ]
[ "tests/modeling/test_optimizer.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\n\nimport random\nimport unittest\n\nimport d2go.runner.default_runner as default_runner\nimport torch\nfrom d2go.optimizer import (\n build_optimizer_mapper,\n)\nfrom d2go.utils.testing import helper\n\n\nclass Tes...
[ [ "torch.empty", "torch.nn.BatchNorm2d", "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d", "torch.rand", "torch.nn.parallel.DistributedDataParallel", "torch.nn.Conv2d", "torch.nn.BCEWithLogitsLoss", "torch.nn.ReLU", "torch.transpose" ] ]
oliviernocent/AEROLAB
[ "4fd1077c5799b6c6a6b885e7baccf16925d3a36e" ]
[ "scripts/python/exposure.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n'''\nThis script computes the max mean mass concentration of several pollutants\nfrom a CSV file containing the following columns:\n - 'DateTime' : ISO 8601 date and time \n - 'Timestamp': seconds elapsed since 01/01/1970\n - 'PM10 (µg/m3)' (optional)\n ...
[ [ "pandas.read_csv" ] ]
Vinicius-Tanigawa/Undergraduate-Research-Project
[ "e92372f07882484b127d7affe305eeec2238b8a9" ]
[ "SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Aerodynamics/Common/Fidelity_Zero/Lift/generate_wing_wake_grid.py" ]
[ "## @ingroup Methods-Aerodynamics-Common-Fidelity_Zero-Lift\n# generate_wing_wake_grid.py\n# \n# Created: April 2021, R. Erhard\n# Modified: \n\n# ----------------------------------------------------------------------\n# Imports\n# ----------------------------------------------------------------------\nimport nu...
[ [ "numpy.append", "numpy.flipud", "numpy.ones_like", "numpy.cos", "numpy.array", "numpy.sin", "numpy.concatenate", "numpy.linspace" ] ]
pitchdarkdata/InfluxDays2021_Demo
[ "d5625566cefd983203983e158f3325cfb2c16029" ]
[ "API/gerrit_api.py" ]
[ "\"\"\"\nThis Module interacts with Gerrit and retrieves Data from Gerrit\n\"\"\"\n\nimport os\nimport json\nimport logging\nimport argparse\nimport pandas as pd\nfrom datetime import datetime, timedelta\nfrom json.decoder import JSONDecodeError\nfrom urllib.parse import urlunsplit, urlencode\nfrom typing import Tu...
[ [ "pandas.DataFrame" ] ]
cenyk1230/cogdl
[ "fa1f74d5c3a15b5a52abfc7cd3f04dce4b7dbcce" ]
[ "cogdl/models/nn/lightgcn.py" ]
[ "\"\"\"\nfrom from https://github.com/huangtinglin/MixGCF\n\nCreated on October 1, 2020\n\n@author: Tinglin Huang (huangtinglin@outlook.com)\n\"\"\"\nimport torch\nimport torch.nn as nn\n\nfrom cogdl.models import BaseModel, register_model\n\n\nclass GraphConv(nn.Module):\n \"\"\"\n Graph Convolutional Networ...
[ [ "torch.empty", "torch.stack", "torch.rand", "torch.nn.Parameter", "torch.norm", "torch.mul", "torch.sparse.FloatTensor", "torch.from_numpy", "torch.max", "torch.sparse.mm", "torch.LongTensor", "torch.cat", "torch.nn.Dropout", "torch.floor" ] ]
raven-computing/pydf
[ "70b14ad11aa629da6d1abb993a2a4c567db73ca9" ]
[ "raven/struct/dataframe/_dataframeutils.py" ]
[ "# Copyright (C) 2021 Raven Computing\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agr...
[ [ "numpy.array", "numpy.isnan" ] ]
amitsou/cloud_services
[ "22a2381227ecab8d1626e3dfa961821954188327" ]
[ "Functions/sensing_utils.py" ]
[ "import os\nimport cv2\nimport sys\nimport json\nimport time\nimport codecs\nimport argparse\nimport logging\nimport numpy as np\nimport warnings\n\ntry:\n with warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\",category=FutureWarning)\n from keras.models import load_model\n fro...
[ [ "numpy.array" ] ]
svaiter/sparse-ho
[ "8c04ca533e44ecd128dc26b6830a556babf8416f" ]
[ "examples/plot_held_out_lasso.py" ]
[ "\"\"\"\n============================\nLasso with held-out test set\n============================\n\nThis example shows how to perform hyperparameter optimization\nfor a Lasso using a held-out validation set.\n\n\"\"\"\n\n# Authors: Quentin Bertrand <quentin.bertrand@inria.fr>\n# Quentin Klopfenstein <quen...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.semilogx", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "numpy.geomspace", "sklearn.datasets.make_regression", "numpy.log", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show",...
kindsenior/nngen
[ "cba265b1a140f2aef7208926703782b6dac9e8be" ]
[ "tests/matrix_conv2d/matrix_conv2d.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport functools\nimport math\nimport numpy as np\n\n# the next line can be removed after installation\nsys.path.insert(0, os.path.dirname(os.path.dirname(\n os.path.dirname(os.path.abspath(__file__)))))\n\ni...
[ [ "numpy.arange", "numpy.zeros" ] ]
grantseiter/Tax-Benefits-Of-Parenthood
[ "5350e832e8b877b46c2a3cab070fc8262b914a52" ]
[ "Tax-Calculator-3.0.0/taxcalc/tests/test_data.py" ]
[ "# CODING-STYLE CHECKS:\r\n# pycodestyle test_data.py\r\n\r\nimport os\r\nimport tempfile\r\nimport pytest\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom taxcalc import Data, GrowFactors\r\n\r\n\r\n# Test specification and use of simple Data-derived class.\r\n# This derived class is called Recs and it contain...
[ [ "pandas.read_csv", "numpy.allclose", "numpy.all" ] ]
michi7x7/pm-mos-model
[ "394d752b1165f5afd96520f1b6e2dbecc27fdc4b" ]
[ "CryMOS/QV.py" ]
[ "import numpy as np\n\nfrom .constants import *\nfrom .Bulk import BulkModel, BulkModelFD, BulkModelTails\nfrom .base import MosModelBase, writeable_property\n\nfrom math import sqrt\nfrom scipy.integrate import quad\n\n__all__ = ['DefaultQV', 'BeckersQVpy',\n 'DiracQVpy', 'TailsQVpy',\n 'Gilden...
[ [ "numpy.full_like", "scipy.integrate.quad", "numpy.sign", "numpy.vectorize", "numpy.isclose", "numpy.abs", "numpy.exp", "numpy.atleast_1d", "numpy.log", "numpy.sqrt", "numpy.linspace", "numpy.array", "scipy.optimize.root_scalar" ] ]
K2OKOH/da-faster-RCNN-ChineseComment
[ "b88d1821779b9edc3f0f4a595e1f41c3bfdd7cab" ]
[ "lib/model/utils/blob.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\n\"\"\"Blob helper functions.\"\"\"\n\nimport numpy as np\n#...
[ [ "numpy.array", "numpy.max", "numpy.min", "numpy.zeros" ] ]
johnnyapol/RPICovidScraper
[ "84a97847c80c320e2eed3fd161e9f175f83d14a5" ]
[ "main.py" ]
[ "#!/usr/bin/env python3\n# Usage: ./main.py\n\"\"\"\nCopyright (C) 2020-2021 John C. Allwein 'johnnyapol' (admin@johnnyapol.me)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without rest...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.bar" ] ]
nerminsamet/HoughNet-VID
[ "670405e002e1c4d60596434db4790783eaf62846" ]
[ "src/lib/datasets/dataset/vid_eval.py" ]
[ "import numpy as np\nimport scipy.io as sio\nfrom collections import defaultdict\n\nBIG_NUM = 1000000\n\ndef area(box, mode=\"xyxy\"):\n\n if mode == \"xyxy\":\n TO_REMOVE = 1\n area = (box[:, 2] - box[:, 0] + TO_REMOVE) * (box[:, 3] - box[:, 1] + TO_REMOVE)\n elif mode == \"xywh\":\n are...
[ [ "numpy.sum", "numpy.spacing", "numpy.maximum.accumulate", "numpy.argsort", "numpy.nan_to_num", "numpy.nanmean", "numpy.logical_not", "numpy.expand_dims", "numpy.where", "scipy.io.loadmat", "numpy.zeros", "numpy.argmax", "numpy.arange", "numpy.max", "nump...
ebolyen/q2-treetime
[ "162ebfca9a120391840ed30ddef18fb2b780165e" ]
[ "q2_treetime/methods.py" ]
[ "import hashlib\n\nimport skbio\nimport numpy as np\n\n\ndef add_node_names(tree: skbio.TreeNode, scheme: str = 'md5-xor') \\\n -> skbio.TreeNode:\n HASH_SIZE = 128 // 8\n\n for node in tree.postorder(include_self=True):\n if not node.children or node.name is not None:\n continue\n\n ...
[ [ "numpy.frombuffer", "numpy.zeros" ] ]
SJTMusicTeam/MusicGeneration
[ "2918e151a1b9448e5452179bab70bf565d1eaaf7" ]
[ "mg/utils/midi2note.py" ]
[ "from music21 import converter, instrument, note, chord, stream, midi\nimport numpy as np\nimport pandas as pd\n\n\n# Melody-RNN Format is a sequence of 8-bit integers indicating the following:\n# MELODY_NOTE_ON = [0, 127] # (note on at that MIDI pitch)\nMELODY_NOTE_OFF = 128 # (stop playing all previous notes)\nME...
[ [ "numpy.zeros", "pandas.DataFrame", "numpy.array", "numpy.int16", "numpy.round" ] ]
Ben3940/scikit-learn
[ "adb47e7c142ce6d699cc5927925d448cb2c1ab91" ]
[ "examples/inspection/plot_partial_dependence.py" ]
[ "\"\"\"\n===============================================================\nPartial Dependence and Individual Conditional Expectation Plots\n===============================================================\n\nPartial dependence plots show the dependence between the target function [2]_\nand a set of features of intere...
[ [ "sklearn.inspection.PartialDependenceDisplay.from_estimator", "sklearn.preprocessing.QuantileTransformer", "matplotlib.pyplot.figure", "sklearn.inspection.partial_dependence", "pandas.DataFrame", "matplotlib.pyplot.subplots", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot....
i2mint/examples
[ "1dd52935f6f6175a17af9b8e5ee9e2b10b08cb7f" ]
[ "synthetic_sounds/classification_problems.py" ]
[ "from typing import Iterable, Callable\nimport numpy as np\nfrom examples.synthetic_sounds.util import (\n seeds_to_wfs,\n seed_to_wf_chk,\n DFLT_SEEDS,\n DFLT_CHUNKER,\n chk_tag_gen,\n frame_annots_to_chk_annots,\n)\nfrom sklearn.decomposition import PCA\nfrom sklearn.svm import SVC\n\n\ndef make...
[ [ "numpy.array", "numpy.hstack" ] ]
not-a-hot-dog/parallelized-disease-modeling
[ "e82d052b4841f1c545f4f5c65ce509f1a3418754" ]
[ "generate_data.py" ]
[ "import numpy as np\n\n##Read in data matrix\ndata = np.load(\"data/matrix.npy\")\n\nprint('Creating data...')\n##Generate individual CSVs\nS_init_data = data[:, :, 2]\nI_init_data = data[:, :, 3]\nR_init_data = data[:, :, 4]\nisUS_data = data[:, :, 5]\n#Use fixed beta and gamma for stable simulation\nbeta_data = 0...
[ [ "numpy.load", "numpy.ones", "numpy.savetxt" ] ]
awardblvr/pv_mppt_test
[ "366015fd418448791b8470baf82e6ecb3686b17d" ]
[ "Graph_MPPT.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\n Import MPPT CSV data and plot it.\n\n CSV format:\n Volts,volts,amps,watts,state,mode_str,panelSN,resistance,timestamp\n 29.646,29.646,0.0,0.0,0,CR,B41J00052893,100000,20210913_120014.79\n 14.267,14.267,0.354,5.05,1,CR,B41J00052893,40.0,20210913_120016.16\n\n\"\"\"\n\nfrom __futur...
[ [ "matplotlib.ticker.MaxNLocator", "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.show" ] ]
jberkman/pyxfoil
[ "511cb0e2cdc7e2967bc53fa0276351ebf57a90bf" ]
[ "pyxfoil.py" ]
[ "\"\"\"PYXFOIL: XFOIL AUTOMATION USING PYTHON\nLogan Halstrom\nEAE 127\nUCD\nCREATED: 15 SEP 2015\nMODIFIED: 17 OCT 2018\n\nDESCRIPTION: Provides functions for automating XFOIL runs.\nEach function will iteratively build a list of inputs. When you are ready,\nuse the RunXfoil command to run the input list\n\nNOTE:...
[ [ "pandas.read_csv" ] ]
michael-kuhlmann/padertorch
[ "3925fa693299ffb166d82dd81deed997237e85c7" ]
[ "padertorch/contrib/je/data/mixup.py" ]
[ "from lazy_dataset import Dataset, FilterException\nimport numpy as np\nimport numbers\n\n\nclass MixUpDataset(Dataset):\n \"\"\"\n >>> ds = MixUpDataset(range(10), SampleMixupComponents((.0,1.)), (lambda x: x), buffer_size=2)\n >>> list(ds)\n \"\"\"\n def __init__(self, input_dataset, sample_fn, mix...
[ [ "numpy.sum", "numpy.ceil", "numpy.zeros", "numpy.random.rand", "numpy.array" ] ]
achinta/CategoricalNF
[ "d8717a037e8f13641e9d9a89abf66fba38e23f91" ]
[ "experiments/graph_coloring/datasets/graph_coloring_generation.py" ]
[ "import random\nimport numpy as np\nimport networkx as nx\nimport sys, os, json, argparse, itertools\nimport grinpy as gp\nimport time\nfrom glob import glob\nfrom multiprocessing import Pool\nfrom ortools.sat.python import cp_model\n\n\"\"\"\nThis code is based on https://github.com/machine-reasoning-ufrgs/GNN-GCP...
[ [ "numpy.load", "numpy.eye", "numpy.ones", "numpy.zeros", "numpy.any", "numpy.tril_indices", "numpy.random.seed", "numpy.random.choice", "numpy.where", "numpy.fill_diagonal", "numpy.concatenate", "numpy.random.randint", "numpy.savez_compressed" ] ]
ARKseal/crawlingathome-gpu-hcloud
[ "73f185df36eb5e420e6513bcf1b518dd21499b76" ]
[ "helpers/bloom.py" ]
[ "# use this file inside every minute cron in order to recalculate bloom filters. location: staging server\n# folder structure\n# /home/archiveteam/CAH/\n# |_bloom archiveteam@IP::bloom contains bloom filters\n# |_clipped contains clipped li...
[ [ "pandas.read_csv", "pandas.to_timedelta", "pandas.set_option" ] ]
ikingye/scikit-learn
[ "3254e98a79e5c1172c794ad38f222dc45f0fb65c" ]
[ "examples/applications/plot_tomography_l1_reconstruction.py" ]
[ "\"\"\"\n======================================================================\nCompressive sensing: tomography reconstruction with L1 prior (Lasso)\n======================================================================\n\nThis example shows the reconstruction of an image from a set of parallel\nprojections, acqu...
[ [ "sklearn.linear_model.Ridge", "numpy.random.RandomState", "matplotlib.pyplot.imshow", "matplotlib.pyplot.subplots_adjust", "sklearn.linear_model.Lasso", "matplotlib.pyplot.figure", "numpy.logical_and", "numpy.cos", "matplotlib.pyplot.title", "numpy.linspace", "numpy.zer...
physycom/slides
[ "ff73de94997e39673d6d5c82b1bb4d9d0069fee6" ]
[ "tools/dubrovnik/router_map.py" ]
[ "#! /usr/bin/env python3\n\nimport os\nimport json\nimport folium\nimport argparse\nimport pandas as pd\nimport mysql.connector\nfrom matplotlib import cm\nfrom matplotlib.colors import to_hex\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser()\n parser.add_argument('-c', '--cfg', type=str, require...
[ [ "pandas.DataFrame", "matplotlib.colors.to_hex" ] ]
applejenny66/snoopy
[ "916700661976aef121c16c3cf1418f395eff54a6" ]
[ "test.py" ]
[ "import numpy\nimport argparse\nimport cv2\n\nimage = cv2.imread('pikachu.jpg')\ncv2.imshow(\"Original\", image)\ngray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)\ncv2.imshow(\"Gray\", gray)\n\neq = cv2.equalizeHist(gray)\n##cv2.imshow(\"Gray EQ\", eq)\n\n#display two images in a figure\ncv2.imshow(\"Histogram Equali...
[ [ "numpy.hstack" ] ]
tehcoderer/GamestonkTerminal
[ "54a1b6f545a0016c576e9e00eef5c003d229dacf", "54a1b6f545a0016c576e9e00eef5c003d229dacf" ]
[ "openbb_terminal/cryptocurrency/discovery/coinmarketcap_model.py", "bots/stocks/government/lastcontracts.py" ]
[ "\"\"\"CoinMarketCap model\"\"\"\n__docformat__ = \"numpy\"\n\nimport logging\n\nimport pandas as pd\nfrom coinmarketcapapi import CoinMarketCapAPI, CoinMarketCapAPIError\n\nimport openbb_terminal.config_terminal as cfg\nfrom openbb_terminal.decorators import log_start_end\nfrom openbb_terminal.rich_config import c...
[ [ "pandas.DataFrame" ], [ "pandas.to_datetime" ] ]
techkang/mmcv
[ "333eb6a8f964f005d4c0f34c3214ac2036bb228c" ]
[ "mmcv/parallel/collate.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nfrom collections.abc import Mapping, Sequence\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data.dataloader import default_collate\n\nfrom .data_container import DataContainer\n\n\ndef collate(batch, samples_per_gpu=1):\n \"\"\"Puts each data...
[ [ "torch.utils.data.dataloader.default_collate", "torch.nn.functional.pad" ] ]
Tejas-Nanaware/Learning-OpenCV
[ "4956db7f7f90d9d4a44327aebc2f809e4d9b2ca3" ]
[ "corner detection.py" ]
[ "import cv2\nimport numpy as np\n\nimg = cv2.imread('corner detection.jpg')\ngray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\ngray = np.float32(gray)\n\ncorners = cv2.goodFeaturesToTrack(gray, 100, 0.01, 10)\ncorners = np.int0(corners)\n\nfor corner in corners:\n\tx, y = corner.ravel()\n\tcv2.circle(img, (x,y), 3, 255...
[ [ "numpy.int0", "numpy.float32" ] ]
Irme/MONAI
[ "49e693c4e7df83dc1f8ab87349373de9263188a9" ]
[ "tests/test_mask_intensityd.py" ]
[ "# Copyright 2020 MONAI Consortium\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to i...
[ [ "numpy.array", "numpy.testing.assert_allclose" ] ]
Ditwoo/catalyst
[ "3126390f9f679ebcfedbe01707b416678a2732ac" ]
[ "catalyst/metrics/accuracy.py" ]
[ "\"\"\"\nVarious accuracy metrics:\n * :func:`accuracy`\n * :func:`multi_label_accuracy`\n\"\"\"\nfrom typing import Optional, Sequence, Union\n\nimport numpy as np\n\nimport torch\n\nfrom catalyst.metrics.functional import process_multilabel_components\nfrom catalyst.utils.torch import get_activation_fn\n\n\...
[ [ "numpy.prod" ] ]
ackness/GazeFlow
[ "ca6b7d548571f85af84bdec77292758ab5d36449" ]
[ "layers/spadebn.py" ]
[ "#!/usr/bin/env python3\n\nimport tensorflow as tf\n\nfrom layers.spectral_normalization import SpectralNormalization\n\n\nclass SpadeBN(tf.keras.layers.Layer):\n \"\"\"SPADE BatchNormalization\n\n Sources:\n\n https://towardsdatascience.com/implementing-spade-using-fastai-6ad86b94030a\n \"\"\"\n\n ...
[ [ "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.experimental.SyncBatchNormalization" ] ]
woojinsong/PyTorch-tutorials-kr
[ "36fefd556f45c2b1f5db912793172c0369430fd4" ]
[ "docs/_downloads/295945daa9a2749eebb39cf0af107ee2/polynomial_custom_function.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nPyTorch: 새 autograd Function 정의하기\n----------------------------------------\n\n:math:`y=\\sin(x)` 을 예측할 수 있도록, :math:`-\\pi` 부터 :math:`pi` 까지\n유클리드 거리(Euclidean distance)를 최소화하도록 3차 다항식을 학습합니다.\n다항식을 :math:`y=a+bx+cx^2+dx^3` 라고 쓰는 대신 :math:`y=a+b P_3(c+dx)` 로 다항식을 적겠습니다.\n여기서 :math...
[ [ "torch.linspace", "torch.no_grad", "torch.full", "torch.sin", "torch.device" ] ]
sarnthil/emotion-classification-roles
[ "1fdd3a8cbdac5ab2ad9598a101b763882df78280" ]
[ "scripts/indicator_experiment/calculate-fscores-from-aggregations.py" ]
[ "import json\nfrom pathlib import Path\nfrom collections import defaultdict, Counter\n\nfrom sklearn.metrics import precision_recall_fscore_support\n\nPRECISION_FALLBACK = RECALL_FALLBACK = 1\n\n# dataset -> setting -> emotion -> measure -> score\nresults = {}\n\nfor dataset_path in Path(\"workdata/indicator-experi...
[ [ "sklearn.metrics.precision_recall_fscore_support" ] ]
RikPi/bluerov2
[ "811dcca43241221b918425cf8351219d183f4c03" ]
[ "bluerov2_hmi/src/bluerov2_hmi/__init__.py" ]
[ "import rospy\nimport cv2\nfrom cv_bridge import CvBridge, CvBridgeError\nfrom sensor_msgs.msg import Range, BatteryState, CameraInfo, Temperature, NavSatFix, Image\nfrom geometry_msgs.msg import PoseWithCovarianceStamped, PointStamped\nfrom std_msgs.msg import Float64, Header\nfrom mavros_msgs.msg import State\nim...
[ [ "numpy.sqrt" ] ]
neptune-ml/pytorch-lightning
[ "3bcaed52454f3e6c3bce5513032e34302e5b1bb6" ]
[ "tests/strategies/test_deepspeed_strategy.py" ]
[ "import contextlib\nimport json\nimport logging\nimport os\nfrom typing import Any, Dict, Optional\nfrom unittest import mock\n\nimport pytest\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn, Tensor\nfrom torch.optim import Optimizer\nfrom torch.utils.data import DataLoader\nfrom torchmetrics i...
[ [ "torch.optim.lr_scheduler.ExponentialLR", "torch.nn.Linear", "torch.load", "torch.randn", "torch.nn.functional.softmax", "torch.equal", "torch.nn.GRU", "torch.nn.ReLU", "torch.nn.functional.cross_entropy", "torch.optim.lr_scheduler.StepLR", "torch.device" ] ]
groussea/custom_colormap
[ "e92f88d1b5be18509fa6e6204387b10c74b4c8ad" ]
[ "custom_colormaps.py" ]
[ "\"\"\"\nNAME\n Custom Colormaps for Matplotlib\nPURPOSE\n This program shows how to implement make_cmap which is a function that\n generates a colorbar\nPROGRAMMER(S)\n Chris Slocum\n Gauthier Rousseau\nREVISION HISTORY\n 20130411 -- Initial version created\n 20140313 -- Small changes made and...
[ [ "matplotlib.colors.LinearSegmentedColormap", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.isclose", "matplotlib.pyplot.show", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.text", "numpy.random.rand", "numpy.array", "matplotlib.pyplot.plot", "numpy....
fedesigno/solar-panel-segmentation
[ "75856be3361bb4904387e6abc986627d1cc98ebb" ]
[ "solarnet/models/segmenter.py" ]
[ "import torch\nfrom torch import nn\n\nfrom typing import List\n\nfrom .base import ResnetBase\n\n\nclass Segmenter(ResnetBase):\n \"\"\"A ResNet34 U-Net model, as described in\n https://github.com/fastai/fastai/blob/master/courses/dl2/carvana-unet-lrg.ipynb\n\n Attributes:\n imagenet_base: boolean,...
[ [ "torch.nn.BatchNorm2d", "torch.nn.Upsample", "torch.nn.Conv2d", "torch.nn.Sigmoid", "torch.nn.ReLU", "torch.cat", "torch.nn.ConvTranspose2d" ] ]
rajat315315/pandas
[ "2eec4f7cfa1c45671b9875062343521a53ae8b28" ]
[ "pandas/core/series.py" ]
[ "\"\"\"\nData structure for 1-dimensional cross-sectional and time series data\n\"\"\"\nfrom __future__ import annotations\n\nfrom io import StringIO\nfrom shutil import get_terminal_size\nfrom textwrap import dedent\nfrom typing import (\n IO,\n TYPE_CHECKING,\n Any,\n Callable,\n Hashable,\n Ite...
[ [ "pandas.core.reshape.concat.concat", "numpy.asarray", "pandas.core.nanops.nancorr", "numpy.transpose", "pandas.core.dtypes.missing.na_value_for_dtype", "pandas.core.generic.NDFrame.isna", "pandas._libs.lib.infer_dtype", "pandas.core.indexing.check_bool_indexer", "pandas.core.dt...
krodyush/nncf
[ "476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a" ]
[ "nncf/quantization/metrics.py" ]
[ "import numpy as np\nimport networkx as nx\nfrom copy import deepcopy\nfrom texttable import Texttable\nfrom collections import deque\n\nfrom nncf.quantization.layers import SymmetricQuantizer\nfrom nncf.nncf_network import NNCFNetwork, NNCFGraph\nfrom nncf.dynamic_graph.transform_graph import is_nncf_module\nfrom ...
[ [ "numpy.prod" ] ]
nyw-pathfinder/Deep-Learning-Bootcamp-with-PyTorch
[ "5bf2efd3f921dc95461026df8f105ff7a5822fb5" ]
[ "generation/DCGAN/train.py" ]
[ "if __name__ == '__main__':\n import os\n from torchvision.transforms import Compose, Normalize, Resize, ToTensor\n from torch.utils.data import DataLoader\n from models import Discriminator, Generator, weights_init\n import torch\n import torch.nn as nn\n import matplotlib.pyplot as plt\n f...
[ [ "torch.ones_like", "torch.utils.data.DataLoader", "matplotlib.pyplot.legend", "torch.randn", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "torch.zeros_like", "torch.cuda.is_available", "matplotlib.pyplot.ylabel", "torch.nn.BCELoss", "matplotlib.pyplot.xlabel...
rioyokotalab/RAFT
[ "d718fe86d11f8ab0d4d6d0b0b5c45fa029104444" ]
[ "core/utils/flow_viz.py" ]
[ "# Flow visualization code\n# used from https://github.com/tomrunia/OpticalFlow_Visualization\n\n# MIT License\n#\n# Copyright (c) 2018 Tom Runia\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# i...
[ [ "numpy.arctan2", "numpy.zeros", "numpy.floor", "numpy.arange", "numpy.max", "numpy.clip", "numpy.square" ] ]
magreiner/TractSeg
[ "5ac5278fc3a6d3262f9f06924dbdde01b399ccf6" ]
[ "tractseg/models/UNet_Pytorch_DeepSup.py" ]
[ "# Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/...
[ [ "torch.nn.MaxPool2d", "torch.nn.functional.sigmoid", "torch.nn.Upsample", "torch.nn.Conv2d", "torch.cat", "torch.nn.Dropout" ] ]
ruinunca/data_tooling
[ "297e1f8c2898d00b523ccafb7bdd19c6d6aac9ff" ]
[ "kenlm_training/cc_net/flat_hash_set.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nimport sys\nimport time\nimport warnings\nfrom typing import Iterable, Iterator, Sequence, Sized, Tuple, Type\n\nimport numpy as ...
[ [ "numpy.array", "numpy.dtype", "numpy.save", "numpy.load" ] ]
wdkwyf/mars
[ "3f750e360e64380eab779301a5103994d4886b6a" ]
[ "mars/tensor/merge/concatenate.py" ]
[ "# Copyright 1999-2018 Alibaba Group Holding Ltd.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "numpy.result_type", "numpy.cumsum", "numpy.searchsorted", "numpy.isnan" ] ]
ash-vs/tensorflow
[ "303dc341a6300a4a2eee820679bca30547426aa6" ]
[ "tensorflow/contrib/learn/python/learn/estimators/estimator.py" ]
[ "# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "tensorflow.python.platform.tf_logging.info", "tensorflow.python.training.device_setter.replica_device_setter", "tensorflow.python.framework.ops.Graph", "tensorflow.contrib.learn.python.learn.estimators.tensor_signature.create_placeholders_from_signatures", "tensorflow.contrib.learn.python.lea...
ThomsonTan/nnvm
[ "dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38" ]
[ "tests/python/compiler/test_top_level2.py" ]
[ "import numpy as np\n\nimport tvm\nfrom tvm.contrib import graph_runtime\nimport topi\nimport topi.testing\nimport nnvm.symbol as sym\nimport nnvm.compiler\nfrom nnvm.testing.config import ctx_list\n\n\ndef test_conv2d():\n x = sym.Variable(\"x\")\n y = sym.conv2d(x, channels=10, kernel_size=(3,3),\n ...
[ [ "numpy.random.uniform", "numpy.ix_", "numpy.sum", "numpy.zeros", "numpy.maximum" ] ]
weidan-wd/numpy
[ "b7c27bd2a3817f59c84b004b87bba5db57d9a9b0" ]
[ "numpy/testing/tests/test_utils.py" ]
[ "import warnings\nimport sys\nimport os\nimport itertools\nimport textwrap\nimport pytest\nimport weakref\n\nimport numpy as np\nfrom numpy.testing import (\n assert_equal, assert_array_equal, assert_almost_equal,\n assert_array_almost_equal, assert_array_less, build_err_msg, raises,\n assert_raises, asser...
[ [ "numpy.ones", "numpy.testing.assert_equal", "numpy.testing.assert_no_warnings", "numpy.testing.assert_warns", "numpy.datetime64", "numpy.apply_along_axis", "numpy.testing.tempdir", "numpy.testing.clear_and_catch_warnings", "numpy.testing.build_err_msg", "numpy.timedelta64",...
ISTE-NITK/istesleep
[ "caff596dfc02c67fc4fc11f4d386ba04b6e1a0d7" ]
[ "sleepAnalytics/Sleep Analysis.py" ]
[ "\n# coding: utf-8\n\n# In[1]:\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib\nfrom matplotlib.dates import date2num\nimport datetime\nimport matplotlib.dates as mdates\nimport time\nimport numpy as np\nfrom datetime import date\nimport matplotlib.lines as mlines\nfrom mpl_toolkits.mplot...
[ [ "pandas.read_csv", "matplotlib.pyplot.axis", "pandas.DataFrame", "pandas.to_datetime", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "pandas.concat", "numpy.mean", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.scatter" ] ]
entrepreneur-interet-general/predisauvetage
[ "4d985ee79355652709da322db48daffb3e5a895a" ]
[ "collecte/postes_plage_snsm/convert.py" ]
[ "# -*- coding: utf-8 -*-\nfrom bs4 import BeautifulSoup\nimport pandas as pd\n\n# Likely coming from\n# https://www.google.com/maps/d/viewer?mid=151Itl_57S7UlpC7P-TdfvT2Pz7Y\n\n\nclass KMLConverter(object):\n def __init__(self, filepath):\n self.filepath = filepath\n self.postes = []\n self....
[ [ "pandas.DataFrame" ] ]
padmec-reservoir/PRESTO
[ "71525a8dece2bcc4f16ff4a2120d7627e9ecd776" ]
[ "presto/Preprocessors/Upscale/Structured/StructuredUpscalingMethods.py" ]
[ "import numpy as np\nimport collections\nimport time\nfrom pymoab import types\nfrom pymoab import topo_util\nfrom PyTrilinos import Epetra, AztecOO, ML\n\n\nclass StructuredUpscalingMethods:\n \"\"\"Defines a structured upscaling mesh representation\n Parameters\n ----------\n coarse_ratio: List or arr...
[ [ "numpy.sqrt", "numpy.asarray", "numpy.arange", "numpy.array", "numpy.dot", "numpy.linalg.norm", "numpy.mean" ] ]
satsumas/tensorflow
[ "3fe3f2b1984aab6f159b89aa3ab0069988925689" ]
[ "tensorflow/python/module/module.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.util.tf_export.tf_export", "tensorflow.python.util.tf_decorator.make_decorator", "tensorflow.python.ops.resource_variable_ops.is_resource_variable", "tensorflow.python.framework.ops.name_scope", "tensorflow.python.util.nest.flatten_with_tuple_paths" ] ]
pikerbright/DeblurGAN
[ "39e8a4b408b90d0ef98608c5c4562eae3e184251" ]
[ "motion_blur/blur_image.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport cv2\nimport os\nfrom scipy import signal\nfrom scipy import misc\nfrom motion_blur.generate_PSF import PSF\nfrom motion_blur.generate_trajectory import Trajectory\n\n\nclass BlurImage(object):\n\n def __init__(self, image_path, PSFs=None, part=None, pa...
[ [ "scipy.signal.fftconvolve", "matplotlib.pyplot.axis", "numpy.abs", "numpy.random.choice", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "matplotlib.pyplot.close", "numpy.pad", "scipy.misc.imread" ] ]
vibhatha/PSGDSVMPY
[ "69ed88f5db8d9a250ee944f44b88e54351f8696f" ]
[ "examples/SvmSgd.py" ]
[ "import numpy as np\n\nX = np.array([\n [-2,4,-1],\n [4,1,-1],\n [1, 6, -1],\n [2, 4, -1],\n [6, 2, -1],\n\n])\n\ny = np.array([-1,-1,1,1,1])\n\ndef svm_sgd(X, Y):\n\n w = np.zeros(len(X[0]))\n eta = 1\n epochs = 100000\n\n for epoch in range(1,epochs):\n for i, x in enumerate(X):\...
[ [ "numpy.array", "numpy.dot" ] ]
SudeepSarkar/equilibrium-propagation
[ "ba6d9ee5426445e9ad91c96c816fa5287ff97258" ]
[ "run_energy_model_mnist.py" ]
[ "# MIT License\n\n# Copyright (c) 2020 Simon Schug, João Sacramento\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# ...
[ [ "torch.manual_seed" ] ]
rgsl888prabhu/cugraph
[ "e030a2fe22ad308fba05d6146765a3c9aa865e5b" ]
[ "python/cugraph/tests/test_triangle_count.py" ]
[ "# Copyright (c) 2019, NVIDIA CORPORATION.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law ...
[ [ "scipy.io.mmread" ] ]
tobias-liaudat/wf-psf
[ "0ff1a12d06c46bd8599061d227785393fb528d76" ]
[ "wf_psf/SimPSFToolkit.py" ]
[ "import numpy as np\nimport scipy.signal as spsig\nimport scipy.interpolate as sinterp\nimport PIL\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nfrom matplotlib.colors import ListedColormap, LinearSegmentedColormap\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\ntry:\n from cv2 import res...
[ [ "numpy.ones", "numpy.sum", "scipy.interpolate.interp1d", "numpy.random.seed", "numpy.copy", "matplotlib.pyplot.figure", "numpy.logical_and", "matplotlib.pyplot.savefig", "numpy.abs", "numpy.random.rand", "numpy.isnan", "numpy.linspace", "numpy.mean", "numpy....
binfen/FBDD
[ "26c859a2dbe3d308711898ef1d149a5f8c49055f" ]
[ "utils/postprocess.py" ]
[ "import time\nimport numpy as np\nimport pandas as pd\n\nfrom molecules import mol_from_smiles\nfrom molecules import add_property\nfrom molecules import (\n add_atom_counts, add_bond_counts, add_ring_counts)\n\nfrom .config import get_dataset_info\nfrom .filesystem import load_dataset\n\nSCORES = [\"validity\",...
[ [ "numpy.array", "pandas.DataFrame", "pandas.concat", "pandas.read_csv" ] ]
Jappenn/CCL
[ "a37cad61f060f3928fa5d47b1e2670db3e9bce6f" ]
[ "pyccl/tests/test_power.py" ]
[ "import numpy as np\nimport pytest\n\nimport pyccl as ccl\nfrom pyccl import CCLError, CCLWarning\n\n\nCOSMO = ccl.Cosmology(\n Omega_c=0.27, Omega_b=0.045, h=0.67, sigma8=0.8, n_s=0.96,\n transfer_function='bbks', matter_power_spectrum='halofit')\nCOSMO_HM = ccl.Cosmology(\n Omega_c=0.27, Omega_b=0.045, h...
[ [ "numpy.allclose", "numpy.shape", "numpy.log10", "numpy.logspace", "numpy.array", "numpy.linspace", "numpy.isfinite" ] ]
vinzdef/rorrim
[ "7a3fd4a212420b6fbe6590005300ea095938bf66" ]
[ "python/frame_convert2.py" ]
[ "import numpy as np\nimport matplotlib\n\ndef to_hsv(numb):\n hue = np.interp(numb, [0, 1024], [0, 1])\n rgb = matplotlib.colors.hsv_to_rgb(np.array([hue, 0.5, 1]))\n bgr = rgb[:, :, ::-1] # RGB -> BGR\n return np.array(bgr)\n\ndef hsv_depth(depth):\n depth = to_hsv(depth)\n return depth\n\ndef p...
[ [ "numpy.array", "numpy.clip", "numpy.interp" ] ]
guillefix/mt-lightning
[ "56e93a569d85a768c178b15461e5362c25fdc3e3" ]
[ "analysis/pymo/preprocessing.py" ]
[ "'''\nPreprocessing Tranformers Based on sci-kit's API\n\nBy Omid Alemi\nCreated on June 12, 2017\n'''\nimport copy\nimport pandas as pd\nimport numpy as np\nimport transforms3d as t3d\nimport scipy.ndimage.filters as filters\n\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\nfrom analysis.pymo.rotation...
[ [ "numpy.vstack", "numpy.matmul", "pandas.Series", "numpy.sin", "numpy.zeros", "numpy.diff", "pandas.DataFrame", "numpy.cos", "numpy.asarray", "scipy.ndimage.filters.gaussian_filter1d", "numpy.max", "numpy.min", "numpy.nonzero", "numpy.array", "numpy.std",...
techthiyanes/openspeech
[ "10307587f08615224df5a868fb5249c68c70b12d" ]
[ "openspeech/search/beam_search_rnn_transducer.py" ]
[ "# MIT License\n#\n# Copyright (c) 2021 Soohwan Kim and Sangchun Ha and Soyoung Cho\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitati...
[ [ "torch.ones", "torch.LongTensor" ] ]