repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
valerioda/pygama
[ "a3923df02a864747b0da1904e1bfc9f0ae8839ee" ]
[ "pygama/io/digitizers.py" ]
[ "import sys\nimport array\nimport itertools\nimport numpy as np\nimport pandas as pd\nfrom scipy import signal\nimport matplotlib.pyplot as plt\nfrom pprint import pprint\n\nfrom .io_base import DataTaker\nfrom .waveform import Waveform\n\n\"\"\"\nFIXME:\nthese variables should be set by config if digitizer:\nself....
[ [ "numpy.concatenate", "numpy.zeros", "pandas.DataFrame", "numpy.std", "numpy.amax", "numpy.frombuffer", "numpy.fromstring" ] ]
tripods-xai/isit-2022
[ "024a0ccb59f7d4b2c9e88ef96d4a9c57712d6dfd" ]
[ "turbo-codes/archive/src/channels.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras import layers\nimport tensorflow.keras.backend as K\n\nfrom .utils import assert_binary_array\n\n\"\"\"TF Channels\"\"\"\nclass TFChannel(layers.Layer):\n \n def call(self, input_signal):\n NotImplemented\n\nclass TFAWGN(TFChannel):\n def __init__(self...
[ [ "tensorflow.shape" ] ]
burnpiro/wod-bike-temporal-network
[ "f84195cc2b76b4775ad6be505631a414e1627914" ]
[ "processing_helper.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom sklearn.preprocessing import StandardScaler, MinMaxScaler\nfrom datetime import datetime\n\nCOLUMNS = [\n 'uid',\n 'rental_place',\n 'return_place'\n]\n\nnodes_to_remove = [\n '.GOTOWE DO REZERWACJI',\n 'Poza stacją',\n '.RELOKACYJNA',\n '.RELOKACY...
[ [ "pandas.read_csv" ] ]
palmhjell/ninetysix
[ "86fcbf9740ac84e93067a9e3a4eca92aec057ff5" ]
[ "tests/test_plate_inputs.py" ]
[ "import numpy as np\nimport pandas as pd\nimport os\n\nimport ninetysix as ns\n\nimport pytest\n\n\n# General set up\ndef test_value_name():\n df = pd.DataFrame({\n 'well': ['A1'],\n 'test': [1],\n })\n\n value_name = ns.Plate(data=df, value_name='test').value_name\n assert value_name == '...
[ [ "pandas.DataFrame" ] ]
venthur/immoscrapy
[ "b472ff5bdaec86118cbc552d6417f3756e0ff7ac" ]
[ "immoscrapy/cli.py" ]
[ "import argparse\nimport logging\n\nimport pandas\n\nfrom immoscrapy.immoscrapy import query\n\nlogger = logging.getLogger(__name__)\nlogging.basicConfig(\n level=logging.DEBUG,\n format='%(asctime)s %(levelname)s %(name)s %(message)s',\n)\n\n\ndef main(args=None):\n \"\"\"Main entry point of the C...
[ [ "pandas.DataFrame" ] ]
munkm/yt
[ "9c92deaa53459762cb35025bdc8b9048a9faac31", "9c92deaa53459762cb35025bdc8b9048a9faac31" ]
[ "yt/frontends/enzo/simulation_handling.py", "yt/data_objects/derived_quantities.py" ]
[ "import glob\nimport os\n\nimport numpy as np\nfrom unyt import dimensions, unyt_array\nfrom unyt.unit_registry import UnitRegistry\n\nfrom yt.data_objects.time_series import DatasetSeries, SimulationTimeSeries\nfrom yt.funcs import only_on_root\nfrom yt.loaders import load\nfrom yt.utilities.cosmology import Cosmo...
[ [ "numpy.array", "numpy.zeros", "numpy.ones", "numpy.digitize", "numpy.abs" ], [ "numpy.array", "numpy.abs", "numpy.argmax", "numpy.argmin" ] ]
veras222/cs231n-assignment
[ "c94bf669011b1dc3f237b867a90b071ac16f8ce5" ]
[ "assignments/assignment1/metrics.py" ]
[ "import numpy as np\ndef binary_classification_metrics(prediction, ground_truth):\n '''\n Computes metrics for binary classification\n\n Arguments:\n prediction, np array of bool (num_samples) - model predictions\n ground_truth, np array of bool (num_samples) - true labels\n\n Returns:\n precis...
[ [ "numpy.logical_not", "numpy.logical_and", "numpy.mean" ] ]
weiqiao/trajopt
[ "11f75be747a02de3b45baf3e9c8db6aa7ba789f2" ]
[ "trajopt/algos/mppi.py" ]
[ "\"\"\"\nThis implements a shooting trajectory optimization algorithm.\nThe closest known algorithm is perhaps MPPI and hence we stick to that terminology.\nUses a filtered action sequence to generate smooth motions.\n\"\"\"\n\nimport numpy as np\nfrom trajopt.algos.trajopt_base import Trajectory\nfrom trajopt.util...
[ [ "numpy.max", "numpy.sum", "numpy.ones", "numpy.zeros" ] ]
Alex-W-16/ElecSus-AW
[ "dba476fe45df57fb838b773aaf5bab191d40af16" ]
[ "elecsus/libs/solve_dielectric_NEW.py" ]
[ "# Copyright 2017 J. Keaveney\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#\t http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in...
[ [ "numpy.sin", "numpy.array", "numpy.angle", "numpy.matrix", "scipy.compress", "scipy.linalg.svd", "numpy.tan", "numpy.exp", "scipy.transpose", "scipy.linalg.eig", "numpy.sqrt", "numpy.abs", "numpy.cos", "numpy.linspace", "numpy.mod" ] ]
qiaozhijian/FCGF
[ "6c3f0dbaa918e6622f637a26ffa7b9912726a7a8" ]
[ "lib/trainer.py" ]
[ "# -*- coding: future_fstrings -*-\n#\n# Written by Chris Choy <chrischoy@ai.stanford.edu>\n# Distributed under MIT License\nimport gc\nimport json\nimport logging\nimport os\nimport os.path as osp\n\nimport MinkowskiEngine as ME\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.optim...
[ [ "numpy.logical_not", "numpy.array", "numpy.linalg.norm", "numpy.random.choice", "numpy.isnan", "torch.cat", "torch.save", "torch.no_grad", "torch.optim.lr_scheduler.ExponentialLR", "torch.from_numpy", "torch.cuda.empty_cache", "torch.cuda.is_available", "numpy.s...
fullbat/scilpy
[ "8f5b95a0b298ac95268c94d04a162b14fe2773ad", "8f5b95a0b298ac95268c94d04a162b14fe2773ad", "8f5b95a0b298ac95268c94d04a162b14fe2773ad", "8f5b95a0b298ac95268c94d04a162b14fe2773ad", "8f5b95a0b298ac95268c94d04a162b14fe2773ad" ]
[ "scripts/scil_outlier_rejection.py", "scripts/scil_compute_ssst_frf.py", "scripts/scil_compute_fodf_metrics.py", "scilpy/tractanalysis/todi_util.py", "scilpy/tracking/tools.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\nimport logging\n\nimport nibabel as nib\nfrom nibabel.streamlines.tractogram import Tractogram\nimport numpy as np\n\nfrom scilpy.io.utils import (add_overwrite_arg,\n assert_inputs_exist,\n a...
[ [ "numpy.eye" ], [ "numpy.array", "numpy.ones_like", "numpy.savetxt" ], [ "numpy.array", "numpy.dot", "numpy.isnan", "numpy.zeros", "numpy.ones" ], [ "numpy.dot", "numpy.linalg.norm", "numpy.zeros", "scipy.spatial.ckdtree.cKDTree", "numpy.vstack" ...
rfdj/eynollah
[ "efc146feb8dd6715c1f85f4fff5f333ea26548e4" ]
[ "qurator/eynollah/eynollah.py" ]
[ "# pylint: disable=no-member,invalid-name,line-too-long,missing-function-docstring,missing-class-docstring,too-many-branches\n# pylint: disable=too-many-locals,wrong-import-position,too-many-lines,too-many-statements,chained-comparison,fixme,broad-except,c-extension-no-member\n# pylint: disable=too-many-public-meth...
[ [ "numpy.array", "numpy.dot", "numpy.zeros", "numpy.argmin", "numpy.copy", "numpy.ones", "tensorflow.compat.v1.ConfigProto", "numpy.random.randn", "tensorflow.ConfigProto", "numpy.where", "numpy.argmax", "tensorflow.compat.v1.GPUOptions", "numpy.abs", "numpy.r...
sanggggg/incubator-nemo
[ "1f75e778313c6da06401a9c12850a557891c373e" ]
[ "bin/metric-parser.py" ]
[ "#!/usr/bin/env python3\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version ...
[ [ "numpy.max", "numpy.median", "numpy.sum", "numpy.min", "numpy.mean" ] ]
liangsheng02/Locating-Language-Specific-Information-in-Contextualized-Embeddings
[ "1209a50eefde8545f8c26c063c3080bbcd97edc7" ]
[ "LI_figure_appendix.py" ]
[ "import random\r\nimport os\r\nimport numpy as np\r\nimport argparse\r\nimport pickle\r\nimport itertools\r\nimport torch\r\nfrom sklearn.linear_model import LogisticRegression\r\nfrom sklearn.model_selection import train_test_split\r\nfrom densray import *\r\nimport warnings\r\nwarnings.filterwarnings('ignore')\r\...
[ [ "matplotlib.use", "numpy.concatenate", "numpy.array", "torch.cat", "torch.mm", "sklearn.linear_model.LogisticRegression", "torch.load", "sklearn.model_selection.train_test_split", "torch.Tensor", "numpy.vstack" ] ]
mad-lab-fau/tpcp
[ "ef906afec4c58338dd286f37d62996fc83964404" ]
[ "examples/algorithms/_01_algorithms_qrs_detection.py" ]
[ "r\"\"\"\n\n.. _custom_algorithms_qrs_detection:\n\nAlgorithms - A real world example: QRS-Detection\n================================================\n\nIn this example we will implement a custom algorithm and discuss, when you might want to use an algorithm class over\njust pipelines.\n\nSpecifically we will impl...
[ [ "scipy.signal.sosfiltfilt", "numpy.zeros", "matplotlib.pyplot.plot", "scipy.signal.butter", "numpy.hstack", "matplotlib.pyplot.figure", "numpy.argmax", "pandas.Series", "matplotlib.pyplot.show", "scipy.signal.find_peaks", "sklearn.metrics.roc_curve" ] ]
mdornseif/fastface
[ "72772db1fae4af17e829cd5479c4848fe5eb8948" ]
[ "fastface/utils/cluster.py" ]
[ "import math\nimport random\n\nimport torch\n\n\nclass KMeans:\n \"\"\"Test\"\"\"\n\n def __init__(self, k: int, distance_fn=None, dim_size: int = 2, nstart: int = 2):\n # TODO use nstart\n assert distance_fn is not None, \"please provide a distance function\"\n\n self._params = torch.emp...
[ [ "torch.zeros", "torch.empty", "torch.argmin" ] ]
arita37/pic-recon
[ "703f80eb6d191f68441ce71bc0f388556cb3e1bc" ]
[ "pic_recon/src/recon_picgm_extended.py" ]
[ "\"\"\" Copyright (c) 2021, Varun A. Kelkar, Computational Imaging Science Lab @ UIUC.\n\nThis work is made available under the MIT License.\nContact: vak2@illinois.edu\n\"\"\"\n\nimport sys\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--data_type\", type=str, default='brain', \n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.random.RandomState", "tensorflow.Session", "numpy.load", "numpy.save", "numpy.linspace", "tensorflow.ConfigProto", "numpy.prod", "numpy.clip", "numpy.log10", "scipy.linalg.norm", "numpy.squeeze" ] ]
heitor57/poi-rss
[ "12990af118f19595be01bf80e26a7ee93f9d05d8", "12990af118f19595be01bf80e26a7ee93f9d05d8", "12990af118f19595be01bf80e26a7ee93f9d05d8" ]
[ "algorithms/library/areamanager.py", "algorithms/library/methods/Pm2.py", "algorithms/library/methods/pgc/GeoDivPropensity.py" ]
[ "import math\nimport numpy as np\ndef delimiter_area(case):\n if case == \"lasvegas\":\n print('Area selected: Las Vegas')\n city = \"LasVegas\"\n area = {}\n area['city'] = city.lower()\n area['final_latitude'] = 36.389326\n area['initial_latitude'] = 36.123935\n ...
[ [ "numpy.ceil" ], [ "numpy.nonzero", "numpy.sum", "numpy.argmax", "numpy.zeros" ], [ "numpy.max", "numpy.array", "numpy.median", "matplotlib.pyplot.subplots", "numpy.diff", "numpy.mean", "numpy.nonzero", "matplotlib.pyplot.hist", "numpy.append", "n...
GOAL-Robots/real_robots
[ "6dd5b70bad14426483e2d3ee29b3d8708d34e1ba" ]
[ "tests/test_actions.py" ]
[ "import real_robots\nimport numpy as np\nimport gym\nimport matplotlib.pyplot as plt\nimport types\nimport pybullet\nimport sys\nimport os\nfrom mpl_toolkits.mplot3d import Axes3D\n\n\ndef generate_plan(point_1, point_2):\n\n n_timesteps = 100\n home = np.zeros(9)\n home2 = np.zeros(9)\n home2[5] = np.p...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.random.rand", "matplotlib.pyplot.annotate", "numpy.zeros", "numpy.sin", "matplotlib.pyplot.plot", "numpy.tile", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "numpy.cos", "numpy.hstack...
gordon-frost-hwu/autonomous-learning-library
[ "42f25149277a13d325587f1f7d579da8392fcc38" ]
[ "all/policies/gaussian_test.py" ]
[ "import unittest\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom gym.spaces import Box\nfrom all.environments import State\nfrom all.policies import GaussianPolicy\n\nSTATE_DIM = 2\nACTION_DIM = 3\n\nclass TestGaussian(unittest.TestCase):\n def setUp(self):\n\n torch.manual_seed(2)\n ...
[ [ "torch.nn.Linear", "numpy.array", "torch.manual_seed", "torch.tensor", "torch.randn" ] ]
chao1224/pria_lifechem
[ "1fd892505a45695c6197f8d711a8a37589cd7097" ]
[ "pria_lifechem/analysis/prospective_screening_analysis_support.py" ]
[ "from __future__ import print_function\n\nimport pandas as pd\nimport numpy as np\nimport os\nfrom collections import OrderedDict\nfrom pria_lifechem.function import *\nfrom prospective_screening_model_names import *\nfrom prospective_screening_metric_names import *\n\n\ndef clean_excel():\n dataframe = pd.read_...
[ [ "numpy.array", "numpy.zeros", "pandas.DataFrame", "pandas.read_excel", "numpy.load", "numpy.min", "pandas.read_csv", "numpy.vstack" ] ]
AaltoML/trieste
[ "6b2bb0e73649debaac81157f0f9fdb8d3fdfef5b" ]
[ "tests/unit/acquisition/test_rule.py" ]
[ "# Copyright 2020 The Trieste Contributors\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 l...
[ [ "numpy.testing.assert_allclose", "tensorflow.zeros", "tensorflow.linspace", "tensorflow.concat", "tensorflow.expand_dims", "numpy.testing.assert_array_equal", "numpy.testing.assert_array_almost_equal", "numpy.testing.assert_array_less", "tensorflow.constant", "tensorflow.sq...
slowy07/tensorflow-model-research
[ "48ba4ba6240452eb3e3350fe7099f2b045acc530" ]
[ "advesarial_text/gen_vocab.py" ]
[ "\"\"\"Generates vocabulary and term frequency files for datasets.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom six import iteritems\n\nfrom collections import defaultdict\n\n# Dependency imports\n\nimport tensorflow as tf\n\nfrom data i...
[ [ "tensorflow.app.run", "tensorflow.logging.set_verbosity", "tensorflow.gfile.MakeDirs" ] ]
hamiz-ahmed/Wasserstein-GAN
[ "f8f813569715229954b5dced12b830c07c547ce1" ]
[ "wgan.py" ]
[ "import os\nimport time\nimport argparse\nimport importlib\nimport tensorflow as tf\nimport tensorflow.contrib as tc\n\nfrom visualize import *\nfrom scipy.misc import imsave\n\n\nclass WassersteinGAN(object):\n def __init__(self, g_net, d_net, x_sampler, z_sampler, data, model):\n self.model = model\n ...
[ [ "tensorflow.GPUOptions", "tensorflow.train.RMSPropOptimizer", "tensorflow.ConfigProto", "tensorflow.placeholder", "tensorflow.clip_by_value", "tensorflow.reduce_mean", "tensorflow.global_variables_initializer", "tensorflow.get_collection" ] ]
visionshao/exp_translation
[ "55b8699c323e8618de38a71ec646b011275186d0" ]
[ "fairseq/models/transformer/transformer_decoder.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 math\nfrom typing import Any, Dict, List, Optional\n\nimport torch\nimport torch.nn as nn\nfrom fairseq import utils\nfrom fa...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.ones", "torch.nn.init.normal_", "torch.log", "torch.Tensor", "torch.empty", "torch.matmul" ] ]
adiojha629/JIRP_LRM
[ "a06e3725a8f4f406a100d2a4c2c69d4e9450a2d3" ]
[ "active16/src/baselines/feature_proxy.py" ]
[ "import numpy as np\n\nclass FeatureProxy:\n def __init__(self, num_features, num_states, is_tabular):\n self.num_features = num_features\n self.num_states = num_states\n self.is_tabular = is_tabular\n\n def get_num_features(self):\n if self.is_tabular:\n return self.n...
[ [ "numpy.zeros" ] ]
mwunderl/aws-panorama-samples
[ "0dd246bb0b02f6cd11a60d2a1b5e9ca614d7cd8e" ]
[ "FallDetection/Lambda/fall_detector.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\n\nimport panoramasdk\nimport numpy as np\nimport time\nfrom utils import update_x, update_y, update_ids, crop_resize_normalize, preprocess, upscale_bbox_fn, \\\n detector_to_simple_pose, get_max_pred, heatmap_to_coord, reset_counts, reset_t...
[ [ "numpy.round", "numpy.float" ] ]
rebecca-palmer/pandas
[ "7c94949dc89c62cae1bc647acd87266d6c3a0468" ]
[ "pandas/core/window/rolling.py" ]
[ "\"\"\"\nProvide a generic structure to support window functions,\nsimilar to how we have a Groupby object.\n\"\"\"\nfrom datetime import timedelta\nfrom functools import partial\nimport inspect\nfrom textwrap import dedent\nfrom typing import Callable, Dict, List, Optional, Set, Tuple, Union\n\nimport numpy as np\...
[ [ "pandas.core.window.indexers.FixedWindowIndexer", "pandas.core.common.asarray_tuplesafe", "pandas.core.indexes.api.ensure_index", "numpy.where", "numpy.apply_along_axis", "pandas.core.dtypes.common.is_float_dtype", "pandas.core.window.common.calculate_center_offset", "pandas.concat...
LSchultebraucks/support-vector-machines-blog-post
[ "090694340579cbf0a74f339ad19b853c022fadd4" ]
[ "iris_svc.py" ]
[ "#\n# iris data set\n# 150 total entries\n# features are: sepal length in cm, sepal width in cm, petal length in cm, petal width in cm\\n\n# labels names: setosa, versicolor, virginica\n#\n# used algorithm: SVC (C-Support Vector Classifiction)\n#\n# accuracy ~100%\n#\nfrom time import time\nimport numpy as np\nfrom...
[ [ "numpy.random.seed", "sklearn.datasets.load_iris", "sklearn.svm.SVC" ] ]
tufts-ml/fNIRS-mental-workload-classifiers
[ "b5199d6184e659152d1fe650db48eba53a221186" ]
[ "synthesizing_results/domain_adaptation/synthesize_all_subjects.py" ]
[ "import os\nimport numpy as np\nimport csv\nimport argparse\nimport pandas as pd\n\ndef main(experiment_dir, summary_save_dir):\n \n AllSubject_summary_filename = os.path.join(summary_save_dir, 'AllSubjects_summary.csv')\n \n with open(AllSubject_summary_filename, mode='w') as csv_file:\n \n ...
[ [ "pandas.read_csv" ] ]
JohannesBuchner/gammapy
[ "48769519f04b7df7b3e4580ebb61396445790bc3", "015206d2418b1d254f1c9d3ea819ab0c5ece99e9", "48769519f04b7df7b3e4580ebb61396445790bc3" ]
[ "gammapy/modeling/models/spatial.py", "gammapy/stats/tests/test_variability.py", "gammapy/makers/background/reflected.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"Spatial models.\"\"\"\nimport logging\nimport numpy as np\nimport scipy.integrate\nimport scipy.special\nimport astropy.units as u\nfrom astropy.coordinates import Angle, SkyCoord\nfrom astropy.coordinates.angle_utilities import angular_separat...
[ [ "numpy.max", "numpy.sin", "numpy.errstate", "numpy.exp", "numpy.where", "numpy.linalg.eig", "numpy.sort", "numpy.abs", "numpy.sqrt", "numpy.cos", "numpy.all", "matplotlib.pyplot.gca", "numpy.arctan2" ], [ "numpy.testing.assert_allclose" ], [ "num...
manhhv87/densenet_bottleneck
[ "fd08eb88514dacaff1bcec8bc52a77ea56ab72c7" ]
[ "finetuning/trainer_old.py" ]
[ "import argparse\nimport os\nfrom pathlib import Path\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom sklearn.model_selection import StratifiedKFold\n\nfrom finetuning.utils import ecg_feature_extractor, train_test_split\nfrom transplant.evaluation import auc, f1, multi_f1, CustomCheckpoint\nfrom transplant....
[ [ "tensorflow.distribute.MirroredStrategy", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.keras.layers.Input", "numpy.random.seed", "tensorflow.keras.layers.Dense", "tensorflow.keras.metrics.BinaryAccuracy", "numpy.random.randint", "tensorflow.keras.losses.CategoricalCros...
loftwah/MONAI
[ "37fb3e779121e6dc74127993df102fc91d9065f8", "37fb3e779121e6dc74127993df102fc91d9065f8" ]
[ "examples/classification_3d_ignite/densenet_training_dict.py", "tests/test_as_channel_firstd.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...
[ [ "torch.device", "numpy.array", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss" ], [ "numpy.random.randint" ] ]
erwinvanthiel/numpy
[ "4a14a3526abf616ab469c83d8adcc2f2f1d5de9c" ]
[ "numpy/random/tests/test_extending.py" ]
[ "import os\nimport pytest\nimport shutil\nimport subprocess\nimport sys\nimport warnings\nimport numpy as np\n\ntry:\n import cffi\nexcept ImportError:\n cffi = None\n\nif sys.flags.optimize > 1:\n # no docstrings present to inspect when PYTHONOPTIMIZE/Py_OptimizeFlag > 1\n # cffi cannot succeed\n cf...
[ [ "numpy.random.PCG64" ] ]
amal029/eha
[ "7df60a663030d1265f212c64e86eb9a07f9d5dbc", "7df60a663030d1265f212c64e86eb9a07f9d5dbc" ]
[ "new_techniques/final.py", "src/solver.py" ]
[ "#!/usr/bin/env python3\nimport sympy as S\nimport numpy as N\nimport simpy\nfrom src.solver import Solver\n\n\nstep = 0 # The number of integration steps\n\n\ndef example1(env, solver, cstate=0):\n \"\"\"Example of a ha being solved using the new technique.\n\n \"\"\"\n # TODO: Need...
[ [ "numpy.where", "numpy.isreal", "numpy.min" ], [ "scipy.optimize.minimize" ] ]
franciscojavierarceo/DQN-Event-Summarization
[ "6e651dc511affc8883d656a5b9e909f10266f41d" ]
[ "Code/Utils/make_density_gif.py" ]
[ "import os\nimport sys\nimport imageio\nimport numpy as np\nimport pandas as pd\nfrom matplotlib import pyplot as plt\nimport matplotlib.colors as mcolors\n\n\ndef make_colormap(seq):\n \"\"\"Return a LinearSegmentedColormap\n seq: a sequence of floats and RGB-tuples. The floats should be increasing\n and ...
[ [ "matplotlib.colors.ColorConverter", "matplotlib.colors.LinearSegmentedColormap", "pandas.read_csv", "matplotlib.pyplot.subplots" ] ]
zhutchens1/g3groups
[ "105b991f64975763e78ca3f990648c980baa3ecb" ]
[ "create_ecoresolve_stellarmassselgroups.py" ]
[ "\"\"\"\nZackary Hutchens - November 2020\n\nThis program creates stellar mass-selected group catalogs for ECO/RESOLVE-G3 using the new algorithm, described in the readme markdown.\n\nThe outline of this code is:\n(1) Read in observational data from RESOLVE-B and ECO (the latter includes RESOLVE-A).\n(2) Prepare a...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.errorbar", "numpy.copy", "numpy.where", "numpy.sort", "pandas.read_csv", "numpy.max", "numpy.full", "numpy.logical_and", "numpy.arange", "numpy.log10", "matplotlib.pyplot.yscale", "numpy.logical_or", "numpy.array"...
wmvanvliet/psychic
[ "4ab75fb655795df0272c1bb0eb0dfeb232ffe143", "4ab75fb655795df0272c1bb0eb0dfeb232ffe143" ]
[ "psychic/markers.py", "psychic/layouts.py" ]
[ "import numpy as np\n\ndef markers_to_events(marker_array):\n '''\n Extract events from the array with markers.\n Events are encoded as TTL pulses, no event is indicated with the value 0.\n Returns (events, indices).\n '''\n markers = np.asarray(marker_array, int)\n assert markers.ndim == 1, 'Expected flat a...
[ [ "numpy.ceil", "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.nonzero", "numpy.diff", "numpy.argmax", "numpy.abs", "numpy.hstack" ], [ "numpy.max", "matplotlib.pyplot.xlim", "numpy.asarray", "matplotlib.pyplot.ylim", "numpy.min", "matplotlib.py...
analysiscenter/dataset
[ "50a0607442bd2eb675c8f6a8d7bc5e9dbabe36c0" ]
[ "batchflow/models/torch/base.py" ]
[ "\"\"\" Eager version of TorchModel. \"\"\"\nimport os\nimport re\nfrom threading import Lock\nfrom functools import partial\n\nimport dill\nimport numpy as np\nimport pandas as pd\n\nimport torch\nfrom torch import nn\nfrom torch.optim.swa_utils import AveragedModel, SWALR\n\ntry:\n import cupy as cp\n CUPY_...
[ [ "torch.cuda.amp.autocast", "numpy.mean", "torch.cuda.is_available", "torch.load", "numpy.random.random", "torch.nn.DataParallel", "numpy.concatenate", "torch.sigmoid", "pandas.DataFrame", "torch.optim.swa_utils.AveragedModel", "torch.device", "torch.nn.functional.so...
KonstantinUshenin/biofusion
[ "89c73aa8fdb76f10c7264959e0813f89f0c77765" ]
[ "test/shift_elimination.py" ]
[ "import unittest\nfrom pandas.testing import *\n\nimport pandas as pd\nimport numpy as np\nfrom biofusion.eliminators import *\n\nclass MyTestCase(unittest.TestCase):\n\n def setUp(self):\n self.data1 = pd.DataFrame({\"col1\": [1., 1., 1, 1],\n \"col2\": [1., 3., 3, 1],\n ...
[ [ "pandas.DataFrame", "pandas.read_json", "pandas.concat" ] ]
haesleinhuepf/dexp
[ "2ea84f3db323724588fac565fae56f0d522bc5ca", "2ea84f3db323724588fac565fae56f0d522bc5ca" ]
[ "dexp/processing/fusion/demo/demo_fusion.py", "dexp/datasets/operations/deconv.py" ]
[ "import numpy\nfrom arbol import asection\n\nfrom dexp.datasets.synthetic_datasets import generate_fusion_test_data\nfrom dexp.processing.fusion.dct_fusion import fuse_dct_nd\nfrom dexp.processing.fusion.dft_fusion import fuse_dft_nd\nfrom dexp.processing.fusion.tg_fusion import fuse_tg_nd\nfrom dexp.utils.backends...
[ [ "numpy.zeros_like", "numpy.abs" ], [ "scipy.ndimage.interpolation.zoom", "numpy.load", "numpy.asarray" ] ]
partnernetsoftware/openlab
[ "faa4e58486a7bc4140ad3d56545bfb736cb86696" ]
[ "experiments/torch/torch_eg5.py" ]
[ "# https://blog.csdn.net/rizero/article/details/104244454\n# 股票成交量预测(Pytorch基础练习)\n\n## depends\n\nimport pandas as pd\n\nimport torch\nimport torch.nn\nimport torch.optim\n\nfrom debug import ptf_tensor\n\n## raw data\n\nurl = 'C:/Users/HUAWEI/Desktop/深度学习/Blog附带代码/FB.csv'\ndf = pd.read_csv(url, index_col=0) #读取全部...
[ [ "torch.nn.Linear", "pandas.read_csv", "torch.tensor", "torch.nn.BCEWithLogitsLoss" ] ]
ark0015/GWDetectorDesignToolkit
[ "6ee2f7a633c973ea10b450257b1ad4dbd0323738" ]
[ "gwent/vendor/pygwinc_clone/gwinc/nb.py" ]
[ "import os\nimport logging\nimport itertools\nimport importlib\nimport importlib.util\nimport collections\nimport numpy as np\nimport scipy.interpolate\n\n\ndef quadsum(data):\n \"\"\"Calculate quadrature sum of list of data arrays.\n\n Provided data are assumed to be power-referred, so this is a\n simple ...
[ [ "numpy.nansum", "numpy.ones_like" ] ]
lihongqiang/Image2Text
[ "2c8d60a857a63ce516f33263e61313a3bad0695f" ]
[ "im2txt/inference_utils/vocabulary.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.logging.fatal", "tensorflow.gfile.Exists", "tensorflow.logging.info", "tensorflow.gfile.GFile" ] ]
yvan674/CurbNet
[ "1bcbfc830a7be9615a51749e2ac691f2e2eb827d" ]
[ "src/network/mce_loss.py" ]
[ "\"\"\"Masked Cross Entropy Loss.\n\nThis custom loss function uses cross entropy loss as well as ground truth\ndata to calculate a loss specific to this use case scenario. It calculates a\nregular cross entropy loss, but additionally heavily penalizes any curb\nclassification that is not around the perimeter of kn...
[ [ "torch.zeros", "numpy.zeros", "scipy.ndimage.morphology.binary_dilation", "numpy.ones", "torch.from_numpy", "torch.nn.functional.cross_entropy", "torch.where" ] ]
980044579/ctpn.pytorch
[ "7049241f7c94242271c63eb96cbc29a8ad42d11b" ]
[ "ctpn_predict.py" ]
[ "import os\n#os.environ['CUDA_VISIBLE_DEVICES'] = '0'\nimport cv2\nimport numpy as np\n\nimport torch\nimport torch.nn.functional as F\nfrom ctpn_model import CTPN_Model\nfrom ctpn_utils import gen_anchor, bbox_transfor_inv, clip_box, filter_bbox,nms, TextProposalConnectorOriented\nfrom ctpn_utils import resize\nim...
[ [ "torch.device", "numpy.reshape", "torch.no_grad", "numpy.where", "torch.load", "torch.nn.functional.softmax", "numpy.hstack" ] ]
annsilje/midgard
[ "ffa81f6704f36dd86aea745fb24b7f7da4233828", "ffa81f6704f36dd86aea745fb24b7f7da4233828" ]
[ "midgard/parsers/ure_control_tool_csv.py", "midgard/parsers/gipsyx_series.py" ]
[ "\"\"\"A parser for reading URE Control Tool CSV output files\n\nExample:\n--------\n\n from midgard import parsers\n p = parsers.parse_file(parser_name='ure_control_tool_csv', file_path='G_GAL258_E1E5a_URE-AllPRN_190301.csv')\n data = p.as_dict()\n\nDescription:\n------------\n\nReads data from files in U...
[ [ "numpy.vstack" ], [ "numpy.array", "numpy.stack" ] ]
llguo95/gpytorch
[ "1fa69935104565c377ce95d2c581c9eedfb55817", "1fa69935104565c377ce95d2c581c9eedfb55817" ]
[ "gpytorch/utils/toeplitz.py", "gpytorch/lazy/sum_batch_lazy_tensor.py" ]
[ "#!/usr/bin/env python3\n\nimport torch\nfrom torch.fft import fft, ifft\n\nfrom ..utils import broadcasting\n\n\ndef toeplitz(toeplitz_column, toeplitz_row):\n \"\"\"\n Constructs tensor version of toeplitz matrix from column vector\n Args:\n - toeplitz_column (vector n) - column of toeplitz matrix...
[ [ "torch.zeros", "torch.fft.ifft", "torch.fft.fft", "torch.zeros_like", "torch.equal", "torch.flip" ], [ "torch.Size" ] ]
dendisuhubdy/representation_mixing
[ "146ddc7a2cc34544bb4516149ccfcbe72eedd102" ]
[ "code/lib/examples/unaligned_ljspeech_chars/rnn_unaligned_speech_ljspeech_chars.py" ]
[ "from __future__ import print_function\nimport os\nimport argparse\nimport numpy as np\nimport tensorflow as tf\nfrom collections import namedtuple\n\nimport logging\nimport shutil\nfrom tfbldr.datasets import rsync_fetch, fetch_ljspeech\nfrom tfbldr.datasets import wavfile_caching_mel_tbptt_iterator\nfrom tfbldr.u...
[ [ "tensorflow.set_random_seed", "tensorflow.zeros", "tensorflow.train.AdamOptimizer", "numpy.zeros", "numpy.random.RandomState", "tensorflow.Graph", "tensorflow.Session", "tensorflow.ones", "tensorflow.placeholder", "tensorflow.reduce_sum", "tensorflow.clip_by_global_norm...
lgarrison/asdf
[ "8d1dd589d1fb1d9c286ade7ba787bd95c7e5e88f" ]
[ "asdf/tests/test_compression.py" ]
[ "import io\nimport os\n\nimport numpy as np\n\nimport pytest\n\nimport asdf\nfrom asdf import compression\nfrom asdf import generic_io\n\nfrom ..tests import helpers\n\n\ndef _get_large_tree():\n np.random.seed(0)\n x = np.random.rand(128, 128)\n tree = {\n 'science_data': x,\n }\n return ...
[ [ "numpy.random.seed", "numpy.random.rand", "numpy.zeros" ] ]
huy-ha/frustum-pointnets
[ "0c5b8040707e4497ee2fe7bc3445462cf31ac9e0" ]
[ "models/tf_util.py" ]
[ "\"\"\" Wrapper functions for TensorFlow layers.\n\nAuthor: Charles R. Qi\nDate: November 2017\n\"\"\"\n\nimport numpy as np\nimport tensorflow.compat.v1 as tf\nimport tensorflow as tf2\n\ndef _variable_on_cpu(name, shape, initializer, use_fp16=False):\n \"\"\"Helper to create a Variable stored on CPU memory.\n A...
[ [ "tensorflow.compat.v1.nn.avg_pool", "tensorflow.compat.v1.nn.moments", "tensorflow.compat.v1.nn.bias_add", "tensorflow.compat.v1.identity", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1.get_variable_scope", "tensorflow.compat.v1.nn.conv1d", "tensorflow.compat.v1.device", ...
drodeur/spam
[ "d7063cee3878f695cf6efa414cfcaa3812d3956f" ]
[ "classifiers/strategies/bagOfWords.py" ]
[ "from sklearn.feature_extraction.text import CountVectorizer;\n\nclass BagOfWords(object):\n def __init__(self, data, options):\n self.data = data;\n self.options = options;\n\n try:\n self.options['vector'];\n except KeyError:\n self.options['vector'] = count_vector = CountVectorizer(token_p...
[ [ "sklearn.feature_extraction.text.CountVectorizer" ] ]
oriolfornes/JASPAR-motif-discovery
[ "4c3fe91e9345df0aa06a52e94a9bb02ff2748965" ]
[ "explainn/predict-danq.py" ]
[ "#!/usr/bin/env python\n\nfrom Bio import SeqIO\nimport click\nfrom io import StringIO\nimport numpy as np\nimport pandas as pd\nimport sys\nimport torch\nfrom torch.utils.data import DataLoader, TensorDataset\nfrom tqdm import tqdm\nbar_format = \"{percentage:3.0f}%|{bar:20}{r_bar}\"\n\n# Local imports\nfrom archi...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "pandas.DataFrame", "torch.no_grad", "numpy.mean", "torch.cuda.is_available", "torch.load", "pandas.concat", "torch.Tensor" ] ]
hanbingyan/collusion
[ "c6cb9e39b24f9d77c25d0d2a9df3f90721f830a8" ]
[ "classic_random.py" ]
[ "import random\nfrom collections import namedtuple\nimport numpy as np\nimport pickle\n\nrandom.seed(12345)\nnp.random.seed(12345)\n\nTransition = namedtuple('Transition', ('state', 'action', 'next_state', 'reward'))\nMEM_SIZE = 2250\nBATCH_SIZE = 1\nDELTA = 0.95\n\neps = 1e-5\nalpha = 0.15\n\nactions_space = np.ar...
[ [ "numpy.array", "numpy.zeros", "numpy.random.seed", "numpy.sum", "numpy.ones", "numpy.exp", "numpy.multiply", "numpy.arange", "numpy.random.randint", "numpy.abs" ] ]
jasperol/MLinPractice
[ "b4a8eaee88c8da1550c8c66931951c82f5cb9250", "b4a8eaee88c8da1550c8c66931951c82f5cb9250" ]
[ "scripts/preprocessing/create_labels.py", "scripts/feature_extraction/words_most_common.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nReads in the original csv files and creates labels for the data points.\nStores the result as a single pandas DataFrame in a pickle file.\n\nCreated on Tue Sep 28 15:55:44 2021\n\n@author: lbechberger\n\"\"\"\n\nimport os, argparse, csv\nimport pandas as pd\...
[ [ "pandas.read_csv", "pandas.concat" ], [ "numpy.array" ] ]
grahamrow/Auspex
[ "f12d4d8d5e8abc4d5fa54415090d62000db49e8d" ]
[ "src/auspex/instruments/interface.py" ]
[ "import os\nimport visa\nimport numpy as np\nfrom auspex.log import logger\nfrom .prologix import PrologixSocketResource\n\nclass Interface(object):\n \"\"\"Currently just a dummy interface for testing.\"\"\"\n def __init__(self):\n super(Interface, self).__init__()\n def write(self, value):\n ...
[ [ "numpy.random.random" ] ]
adfoucart/deephisto
[ "f70fbaad9f95a9b9f2e420c9c33d46bdfab5bdf9" ]
[ "model/F1Metric.py" ]
[ "import tensorflow as tf\n\nclass F1Metric(tf.keras.metrics.Metric):\n def __init__(self, name=None, dtype=None):\n super(F1Metric, self).__init__(name=name, dtype=dtype)\n self.tp_ = tf.keras.metrics.TruePositives()\n self.fp_ = tf.keras.metrics.FalsePositives()\n self.fn_ = tf.keras...
[ [ "tensorflow.keras.metrics.FalseNegatives", "tensorflow.keras.metrics.TruePositives", "tensorflow.keras.metrics.FalsePositives" ] ]
thinhnguyenuit/sombra
[ "5176d264508dd5cce780dc63f1dd948d66b189e8", "5176d264508dd5cce780dc63f1dd948d66b189e8" ]
[ "shaders.py", "examples/flat_sphere.py" ]
[ "import numpy as np\n# Local modules\nfrom ray import Ray\n\nTYPE_FLAT = \"flat\"\nTYPE_DIFFUSE_LIGHT = \"diffuse_light\"\nTYPE_DIFFUSE_COLORS = \"diffuse_colors\"\nTYPE_DIFF_SPECULAR = \"diffuse_with_specular\"\nTYPE_DIFF_SPEC_BORDER = \"diffuse_specular_border\"\nTYPE_LIGHT_MAP = \"light_map\"\nCOLOR_FOR_LIGHT = ...
[ [ "numpy.array", "numpy.dot", "numpy.zeros", "numpy.maximum" ], [ "numpy.array", "numpy.zeros" ] ]
renato2099/ibis-bigquery
[ "58d624abaaa9db4106241128559e28b5c2a2e715" ]
[ "ibis_bigquery/client.py" ]
[ "\"\"\"BigQuery ibis client implementation.\"\"\"\n\nimport datetime\nfrom collections import OrderedDict\nfrom typing import Optional, Tuple\n\nimport google.cloud.bigquery as bq\nimport ibis\nimport ibis.common.exceptions as com\nimport ibis.expr.datatypes as dt\nimport ibis.expr.lineage as lin\nimport ibis.expr....
[ [ "pandas.Timestamp" ] ]
preethamvishy/ml
[ "2aa155cd50b6995f4641da2b864caff202a870e1" ]
[ "sourced/ml/tests/test_merge_coocc_entry.py" ]
[ "import logging\nimport os\nimport shutil\nimport sys\nimport tempfile\nimport unittest\n\nimport numpy\n\nfrom sourced.ml.cmd.merge_coocc import merge_coocc, load_and_check, MAX_INT32\nfrom sourced.ml.models import Cooccurrences\nfrom sourced.ml.tests import models\n\nCOPIES_NUMBER = 3\n\n\ndef get_args(_input_dir...
[ [ "numpy.all", "numpy.uint32" ] ]
sechaparroc/LeapMotion
[ "c72cf5dc6cc40dd73edcd9a30b461ebbe475158d" ]
[ "recognizer/recognizer.py" ]
[ "import os\nimport numpy as np\nimport sys\n\n################################################\n######### GLOBAL VARIABLES ##########\n################################################\nlocation = \"\"\nmy_data_location = \"../visualize/\"\nfinger_names = [\"TYPE_THUMB\", \"TYPE_INDEX\", \"TYPE_MIDDLE\", ...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.ones", "numpy.min", "numpy.nonzero", "scipy.ndimage.grey_dilation", "numpy.swapaxes", "numpy.argmax" ] ]
congchan/nnnlp
[ "9a2026a2577817d485d139bf442de7fd602418e6" ]
[ "tf/train_glue_baseline.py" ]
[ "# coding=utf-8\n\"\"\"GLUE tasks.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport time\nimport six\nimport json\nimport copy\nimport glue_utils as classifier_utils\nimport modeling\nimport optimization\nimport tokenization...
[ [ "tensorflow.contrib.tpu.TPUEstimatorSpec", "tensorflow.contrib.metrics.streaming_pearson_correlation", "tensorflow.contrib.tpu.TPUEstimator", "tensorflow.group", "tensorflow.matmul", "tensorflow.metrics.mean", "tensorflow.contrib.metrics.streaming_concat", "tensorflow.nn.softmax", ...
sangdon/intern2020_cocal
[ "2f434b76fbf3426c6685fb92c5bbc2d32fcba7ba" ]
[ "uncertainty/plots/plot_prec_cov_twoparams.py" ]
[ "import os, sys\nimport argparse\nimport types\nimport numpy as np\nimport pickle\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_pdf import PdfPages\n\nimport tensorflow as tf\n\nimport data\nimport model \nfrom util import *\nfrom learning import Lear...
[ [ "matplotlib.use", "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.savefig", "tensorflow.Variable", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clf", "tensorflow.config.exper...
cubetastic33/stanford-dogs
[ "26cd9043aa8ae894e44e57aa0b3b7cbcdae75bd9" ]
[ "test.py" ]
[ "import math\nimport os\n\nfrom torch.utils.data import DataLoader\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.transforms as T\nfrom torchvision import models\n\nfrom dataloader import StanfordDogsDataset\n\n\ndef preprocess(image):\n width, height = image.size\n ...
[ [ "torch.nn.Linear", "torch.device", "torch.no_grad", "torch.utils.data.DataLoader", "torch.load" ] ]
DianaTaukin/DSD-SATN
[ "5a4ab5e3cfcb00e72ca27cf5ec10a8d8e29ef312" ]
[ "src/utils/util.py" ]
[ "#encoding=utf-8\nimport h5py\nimport torch\nimport numpy as np\nimport os\nimport sys\nsys.path.append(os.path.abspath(__file__).replace(os.path.basename(__file__),'').replace('utils/',''))\nfrom config import args\nimport json\nimport torch.nn.functional as F\nimport cv2\nimport math\nfrom scipy import interpolat...
[ [ "torch.cat", "numpy.dot", "torch.stack", "numpy.tile", "numpy.min", "numpy.mean", "torch.ones", "torch.eye", "torch.nn.functional.pad", "numpy.max", "numpy.linalg.norm", "torch.norm", "matplotlib.pyplot.savefig", "numpy.eye", "torch.unsqueeze", "scip...
allengrr/deadlock_project
[ "933878077c45a7df04daa087407bb2620c064617" ]
[ "4algo/manual/algo_six.py" ]
[ "from functools import reduce\nimport numpy as np\nimport random as r\nimport socket\nimport struct\nimport subprocess as sp\nimport threading\nfrom threading import Thread\nimport ast\nimport time\nimport datetime as dt\nimport os\nimport psutil\nfrom netifaces import interfaces, ifaddresses, AF_INET\nimport paho....
[ [ "numpy.greater_equal", "numpy.array", "numpy.add" ] ]
Geonhee-LEE/PythonLinearNonlinearControl
[ "2a2467098108641483778c09ceb7906cb49f6cee" ]
[ "PythonLinearNonlinearControl/envs/first_order_lag.py" ]
[ "import numpy as np\nimport scipy\nfrom scipy import integrate\nfrom .env import Env\n\n\nclass FirstOrderLagEnv(Env):\n \"\"\" First Order Lag System Env\n \"\"\"\n\n def __init__(self, tau=0.63):\n \"\"\"\n \"\"\"\n self.config = {\"state_size\": 4,\n \"input_si...
[ [ "scipy.linalg.expm", "numpy.zeros_like", "numpy.array", "numpy.matmul", "numpy.zeros", "numpy.sum", "numpy.clip", "scipy.integrate.quad" ] ]
mbsariyildiz/autoencoder-pytorch
[ "986ad3f84bfd7671a350ba0d2edd72ded5154142" ]
[ "src/config.py" ]
[ "import torch\nimport dataset\nimport encoder\nimport decoder\nimport torchvision\nimport torchvision.transforms as transforms\n\ndef load_dataset(args):\n\n if args.dataset == 'celebA':\n train_transform = transforms.Compose([\n transforms.Resize([64, 64]),\n transforms.RandomHorizontalFlip(),\n ...
[ [ "torch.nn.DataParallel" ] ]
accessnash/pandas
[ "366241386282272328333256b6e267a68f8133a4", "366241386282272328333256b6e267a68f8133a4" ]
[ "pandas/tests/indexes/test_numeric.py", "pandas/tests/types/test_inference.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom datetime import datetime\nfrom pandas import compat\nfrom pandas.compat import range, lrange, u, PY3\n\nimport numpy as np\n\nfrom pandas import (date_range, Series, DataFrame,\n Index, Float64Index, Int64Index, RangeIndex)\nfrom pandas.util.testing import assertR...
[ [ "pandas.lib.Timestamp", "pandas.core.config.option_context", "pandas.util.testing.assertIsInstance", "pandas.compat.u", "pandas.compat.range", "pandas.util.testing.assert_numpy_array_equal", "numpy.divide", "numpy.sin", "numpy.concatenate", "pandas.util.testing.assertRaises...
gourie/AE
[ "5e094b5874aadccafa7ad4160e6f9dd273d2654c" ]
[ "Bayes_VAE.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import norm\n\nfrom keras.layers import Input, Dense, Lambda, Layer, Conv2D, MaxPooling2D, UpSampling2D\nfrom keras.models import Model\nfrom keras import backend as K\nfrom keras import metrics\nfrom keras.callbacks import TensorBoard\n\nclass ...
[ [ "matplotlib.pyplot.colorbar", "numpy.array", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.prod", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "numpy.linspace", "matplotlib.pyplot.imshow" ] ]
nichollskc/biclust_comp
[ "1b01d44e8a4ab4f40cf015e60bd39afb8616f89d" ]
[ "biclust_comp/analysis/enrichment.py" ]
[ "import logging\nfrom pathlib import Path\nimport re\n\nimport scipy.stats as ss\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport statsmodels.stats.multitest as multitest\nimport sklearn.metrics\n\nfrom intermine.webservice import Service\n\nimport biclust_comp.utils as utils\n\ndef...
[ [ "matplotlib.pyplot.colorbar", "matplotlib.pyplot.axhline", "pandas.DataFrame", "matplotlib.pyplot.subplots", "numpy.where", "pandas.get_dummies", "scipy.stats.hypergeom.sf", "matplotlib.pyplot.show", "numpy.arange", "numpy.log10", "matplotlib.pyplot.axvline", "panda...
yongma/keras-yolo3
[ "7ea23719a054ac116ac36b182fba3fd5186c1652" ]
[ "yolo3/utils.py" ]
[ "\"\"\"Miscellaneous utility functions.\"\"\"\n\nfrom functools import reduce\n\nfrom PIL import Image\nimport numpy as np\nfrom matplotlib.colors import rgb_to_hsv, hsv_to_rgb\n\ndef compose(*funcs):\n \"\"\"Compose arbitrarily many functions, evaluated left to right.\n\n Reference: https://mathieularose.com...
[ [ "numpy.array", "numpy.random.rand", "numpy.zeros", "matplotlib.colors.hsv_to_rgb", "numpy.random.shuffle", "numpy.logical_and" ] ]
YutouTaro/poselstm-pytorch
[ "640af6667fb28d4e0bc47a54a33f28662dfc63aa" ]
[ "data/unaligned_posenet_dataset.py" ]
[ "import os.path\nimport torchvision.transforms as transforms\nfrom data.base_dataset import BaseDataset, get_posenet_transform\nfrom data.image_folder import make_dataset\nfrom PIL import Image\nimport PIL\nimport random\nimport numpy\n# from util.util import scale\n\nclass UnalignedPoseNetDataset(BaseDataset):\n ...
[ [ "numpy.loadtxt" ] ]
oori/OrganizedPointFilters
[ "9030badec776e4bb4d98a397767630efb9dc078f" ]
[ "examples/python/example-laplacian.py" ]
[ "\"\"\"\nDemonstrates Laplacian Smoothing using CPU and GPU acceleration\n\"\"\"\nfrom os import path\nimport numpy as np\nimport logging\n\nimport organizedpointfilters as opf\nfrom organizedpointfilters import Matrix3f, Matrix3fRef\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(\"PPB\")\nl...
[ [ "numpy.ascontiguousarray" ] ]
nakazono1011/pj_horidasimono
[ "5dcbd804b29066954b62b35c78fb324a53fdf493" ]
[ "code/model_ridge.py" ]
[ "from util import Util\nimport numpy as np\nfrom sklearn.linear_model import Ridge\nfrom sklearn.preprocessing import StandardScaler\n\nclass ModelRidge():\n \n def __init__(self, run_name=\"Ridge\"):\n self.run_name = run_name\n self.params = {\n }\n self.model = Non...
[ [ "sklearn.linear_model.Ridge", "sklearn.preprocessing.StandardScaler" ] ]
byewokko/opengl-snippets
[ "d6b8439298b45197b2e204df80f1c632f0266348" ]
[ "glittercurtain.py" ]
[ "import numpy as np\nfrom OpenGL.GL import *\nfrom OpenGL.GLU import *\n\n\nclass Grid:\n def __init__(self):\n self.size = (30, 20, 3)\n self.grid = np.random.random(self.size)\n self.xspacing = 8\n self.yspacing = 8\n self.width_ratio = 1\n self.height_ratio = 1\n ...
[ [ "numpy.random.random", "numpy.array", "numpy.ndindex" ] ]
AaronLeong/cvlib
[ "5afe9804df2c162d8132f18ad0d9c9f7c2220dd0" ]
[ "cvlib/nn/instconv2d.py" ]
[ "# coding=utf-8\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.parameter import Parameter\nfrom torch.nn.modules import conv\nfrom torch.nn.modules.utils import _pair\n\n\nclass InstConv2d(conv._ConvNd):\n\n r\"\"\"Applies a 2D convolution over an input signal composed of se...
[ [ "torch.nn.modules.utils._pair", "torch.autograd.Variable", "torch.ones", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.Tensor", "torch.nn.functional.conv2d", "torch.dot" ] ]
TomWagg/gala
[ "1d207b746aba93cbdd26733e38ec312d7e9310bf" ]
[ "gala/potential/scf/tests/test_computecoeff_discrete.py" ]
[ "# coding: utf-8\n\nimport os\n\n# Third-party\nimport numpy as np\nfrom astropy.utils.data import get_pkg_data_filename\nfrom astropy.constants import G\nimport pytest\n\n# Project\nimport gala.potential as gp\nfrom gala.units import galactic\nfrom gala._cconfig import GSL_ENABLED\nfrom ..core import compute_coeff...
[ [ "numpy.allclose", "numpy.loadtxt", "numpy.logspace" ] ]
watsonjj/CHECLabPySB
[ "91330d3a6f510a392f635bd7f4abd2f77871322c", "91330d3a6f510a392f635bd7f4abd2f77871322c", "91330d3a6f510a392f635bd7f4abd2f77871322c" ]
[ "sstcam_sandbox/old/mc_config/fadc_noise.py", "sstcam_sandbox/d190209_spectra/spe_c.py", "sstcam_sandbox/d190506_astri_publicity/create_gifs.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\nfrom CHECLabPy.plotting.setup import Plotter\nfrom CHECLabPy.spectrum_fitters.gentile import pedestal_signal, K\nfrom CHECLabPy.waveform_reducers.cross_correlation import CrossCorrelation\nfrom target_calib import CameraConfiguration\n\n\nclass SPEHist(Plotter):\...
[ [ "pandas.HDFStore", "numpy.linspace" ], [ "numpy.ctypeslib.ndpointer", "numpy.zeros" ], [ "numpy.max", "matplotlib.animation.FuncAnimation", "numpy.min", "matplotlib.pyplot.figure", "numpy.arange", "numpy.ma.masked_array", "pandas.read_csv" ] ]
toniklenk/pyins
[ "db18a6083dbd7397315095d9a5096cd515f7e248" ]
[ "pyins/integrate.py" ]
[ "\"\"\"Compute a navigation solution by integration of inertial readings.\"\"\"\nimport numpy as np\nimport pandas as pd\nfrom . import earth\nfrom . import dcm\nfrom ._integrate import integrate_fast, integrate_fast_stationary\n\n\ndef coning_sculling(gyro, accel, order=1):\n \"\"\"Apply coning and sculling cor...
[ [ "numpy.sin", "pandas.Index", "numpy.empty", "numpy.asarray", "numpy.zeros", "pandas.DataFrame", "numpy.rad2deg", "numpy.arange", "numpy.cos", "numpy.deg2rad", "numpy.cross" ] ]
ConnectedSystems/pyapprox
[ "4f405654c707cba83d211f327c0f0fdbc95efa29", "4f405654c707cba83d211f327c0f0fdbc95efa29" ]
[ "pyapprox/tests/test_utilities.py", "pyapprox/sparse_grid.py" ]
[ "import unittest\nimport numpy as np\nfrom scipy.linalg import lu_factor, lu as scipy_lu, qr as qr_factorization\n\nfrom pyapprox.utilities import *\nfrom pyapprox.univariate_quadrature import gauss_jacobi_pts_wts_1D\n\n\nclass TestUtilities(unittest.TestCase):\n\n def setUp(self):\n np.random.seed(1)\n\n...
[ [ "numpy.dot", "numpy.array_equal", "numpy.block", "numpy.exp", "numpy.linalg.lstsq", "numpy.tril_indices", "scipy.stats.beta", "numpy.random.normal", "scipy.linalg.lu_factor", "numpy.count_nonzero", "numpy.linalg.norm", "numpy.triu", "numpy.eye", "numpy.arang...
VladimirGl/CLIP
[ "539a1e5b05defc1139f0e52105d5ed29ce94960b" ]
[ "clip.py" ]
[ "import hashlib\nimport os\nimport urllib\nimport warnings\nfrom typing import Union, List\n\nimport torch\nfrom PIL import Image\nfrom torchvision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize\nfrom tqdm import tqdm\n\nfrom .model import build_model\nfrom .simple_tokenizer import SimpleTokeniz...
[ [ "torch.device", "torch.ones", "torch.jit.load", "torch.cuda.is_available", "torch.tensor" ] ]
gabrielmbmb/intry4.0-backend
[ "1ac28ad333c93ed6069dc2db4d9fe3a12b8a1b24" ]
[ "backend/apps/datamodel/models.py" ]
[ "import io\nimport uuid\nimport pytz\nimport json\nimport logging\nimport pandas as pd\nfrom constance import config\nfrom django.db import models\nfrom django.contrib.postgres.fields import ArrayField, JSONField\nfrom django.core.validators import (\n int_list_validator,\n MinValueValidator,\n)\nfrom django....
[ [ "pandas.DataFrame", "pandas.concat" ] ]
rosivagyok/Attention
[ "a4cd90dc5f992ae2fe5a7874628d04f531d4aebc" ]
[ "json_parser_train.py" ]
[ "import json\nimport os\nimport numpy as np, h5py\nimport scipy.io as sp\nimport pandas as pd\nfrom depth import depthlist\nfrom feature_smooth import feature_smooth\nfrom utils import angle_between, cross_validation\n\ndef parse_feats(f_in,f_out,f_in_d,depth,oversample):\n\n \"\"\" Load \"\"\"\n json_files =...
[ [ "numpy.array", "numpy.count_nonzero", "numpy.linalg.norm", "numpy.zeros", "pandas.read_excel", "numpy.load", "numpy.any", "numpy.append" ] ]
HeJinHub/text-rank
[ "0829ba6e8a05264f80144435c595c7233cfce103" ]
[ "textrank4zh/util.py" ]
[ "#-*- encoding:utf-8 -*-\n\"\"\"\n@author: letian\n@homepage: http://www.letiantian.me\n@github: https://github.com/someus/\n\"\"\"\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nimport os\nimport math\nimport networkx as nx\nimport numpy as np\...
[ [ "numpy.zeros" ] ]
Joejiong/mindspore
[ "083fd6565cab1aa1d3114feeacccf1cba0d55e80", "083fd6565cab1aa1d3114feeacccf1cba0d55e80" ]
[ "model_zoo/official/cv/resnet/eval.py", "mindspore/nn/layer/lstm.py" ]
[ "# Copyright 2020 Huawei Technologies Co., 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 applicable l...
[ [ "numpy.random.seed" ], [ "numpy.random.uniform" ] ]
alessandrocuda/Iiwa_vision_reaching_object
[ "63c42109f8aaff56734ba2071121e97cc45d0b84" ]
[ "src/kuka_iiwa/kuka_iiwa_utilities/scripts/iiwa_joint_ee_data_collection.py" ]
[ "#!/usr/bin/python3\nimport rospy\nimport rospkg\nimport random\nimport numpy as np\nimport pickle\n\nfrom itertools import product\n\nfrom gazebo_msgs.srv import GetLinkState\nfrom gazebo_msgs.msg import LinkState\n\nfrom std_msgs.msg import Float64MultiArray\nfrom sensor_msgs.msg import JointState\n\ndef save_obj...
[ [ "numpy.array", "numpy.linspace", "numpy.sin", "numpy.cos" ] ]
TaskeHAMANO/SPHERE
[ "22a6b7f18fa1a9cb2d50d9ce210b2d9a21f7541c" ]
[ "sphere/sphere_symtest.py" ]
[ "#!/usr/bin/env python\n# vim:fileencoding=utf-8\n# Author: Shinya Suzuki\n# Created: 2018-04-26\n\nfrom collections import namedtuple\nfrom sphere.sphere_utils import load_depth_file\nfrom sphere.sphere_cstats import (mean_resultant_length,\n mean_direction,\n ...
[ [ "numpy.sin", "numpy.sum", "pandas.DataFrame", "numpy.min", "numpy.arange", "numpy.sqrt", "numpy.cos" ] ]
Lpallett4/coach
[ "801cf573cc4033940dce64651ffcddf391e6ded9" ]
[ "rl_coach/architectures/tensorflow_components/heads/rainbow_q_head.py" ]
[ "#\n# Copyright (c) 2017 Intel Corporation\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 ...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.shape", "tensorflow.expand_dims", "numpy.linspace", "tensorflow.cast", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorflow.nn.softmax", "tensorflow.add", "tensorflow.reduce_mean", "tensorflow....
Swissler5/astr-119
[ "2af96862bb6560cbfab74178936e13c794a91eda" ]
[ "astr-119-hw-2/data_types.py" ]
[ "#Shea Wissler\nimport numpy as np\n\n#integers\ni = 10\t\t#integer\nprint(type(i)) #print the data type of i\n\na_i = np.zeros(i,dtype=int) #declare an array of integers\nprint(type(a_i)) \t\t#returns ndarray\nprint(type(a_i[0])) \t#returns int64\n\n#floats\n\nx = 119.0 \t\t#floating point number\nprint(type(x)) \...
[ [ "numpy.zeros" ] ]
CogComNeuroSci/parallel_computing
[ "cd995f783169f4df4753cb35bac49bb805903d83" ]
[ "HPC/parameter_sweep/generate_parameters.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\n@author: Pieter Huycke\nemail: pieter.huycke@ugent.be\nGitHub: phuycke\n\"\"\"\n\n#%%\n\nfrom itertools import product\n\nimport csv\nimport numpy as np\nimport os\n\n#%%\n\n# some parameter values\np1 = np.arange(.2, .7, .1).round(2)\np2 = [0, 1]\np3 =...
[ [ "numpy.arange" ] ]
PhotoLabDevelopment/tensorflow
[ "735642ee1cd8d7f21ddd94f851ee753c17c23019" ]
[ "tensorflow/python/autograph/core/converter.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.python.autograph.pyct.static_analysis.liveness.resolve", "tensorflow.python.autograph.pyct.parser.parse_expression", "tensorflow.python.autograph.pyct.qual_names.resolve", "tensorflow.python.autograph.pyct.compiler.ast_to_source", "tensorflow.python.autograph.pyct.ast_util.matches"...
soxofaan/openeo-processes
[ "12565abd810c4cac84c9fccaf00d0fd873b88af0" ]
[ "examples/phenology-uc2/udf/smooth_savitzky_golay.py" ]
[ "# -*- coding: utf-8 -*-\n# Uncomment the import only for coding support\n#from openeo_udf.api.base import SpatialExtent, RasterCollectionTile, FeatureCollectionTile, UdfData\n\n__license__ = \"Apache License, Version 2.0\"\n\n\ndef rct_savitzky_golay(udf_data):\n from scipy.signal import savgol_filter\n impo...
[ [ "pandas.DataFrame", "scipy.signal.savgol_filter" ] ]
YiqingZhouKelly/pyqmc
[ "ec14c7b3cceb01d287cb09ebc5d2af37014c1c8e", "ec14c7b3cceb01d287cb09ebc5d2af37014c1c8e" ]
[ "pyqmc/dasktools.py", "pyqmc/slaterpbc.py" ]
[ "import os\nimport pyqmc\nimport numpy as np\nimport pandas as pd\nimport h5py\nimport pyqmc\nimport pyqmc.optimize_orthogonal\nos.environ[\"MKL_NUM_THREADS\"] = \"1\"\nos.environ[\"NUMEXPR_NUM_THREADS\"] = \"1\"\nos.environ[\"OMP_NUM_THREADS\"] = \"1\"\n\n\ndef distvmc(\n wf,\n coords,\n accumulators=None...
[ [ "numpy.concatenate", "numpy.array", "numpy.sum", "pandas.DataFrame", "numpy.mean", "numpy.split", "numpy.vstack" ], [ "numpy.dot", "numpy.real_if_close", "numpy.exp", "numpy.concatenate", "numpy.linalg.norm", "numpy.angle", "numpy.eye", "numpy.arange...
zj-liu/PaddleHelix
[ "6a4bf9835aebf31c8c7ee0f1005ecaa132b916bb" ]
[ "apps/paddlefold/alphafold_paddle/data/templates.py" ]
[ "# Copyright (c) 2022 PaddlePaddle 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 ...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.sum", "numpy.split", "numpy.stack" ] ]
InzamamRahaman/PoincareDiskEmbedding
[ "89261bcf544e9d6c144ace2697400e2ffb489f94" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nimport util\n\nclass Model(nn.Module):\n\n def __init__(self, vocab_size, embedding_dim=10):\n super(Model, self).__init__()\n self.embedding_dim = embedding_dim\n self.embeddings = nn.Embedding(vocab_size, embedding_dim)\n self.embeddings.weight....
[ [ "torch.nn.Embedding", "torch.sum" ] ]
snakeice/fklearn
[ "80497dd403c582bda0e796c62219f0636d15d074" ]
[ "src/fklearn/training/transformation.py" ]
[ "from typing import Any, Callable, Dict, List, Union, Optional\n\nimport numpy as np\nimport pandas as pd\nfrom numpy import nan\nimport swifter # NOQA\nfrom sklearn.preprocessing import StandardScaler\nfrom statsmodels.distributions import empirical_distribution as ed\nfrom toolz import curry, merge, compose, map...
[ [ "numpy.random.binomial", "numpy.isnan", "numpy.empty", "sklearn.preprocessing.StandardScaler", "numpy.random.seed", "pandas.DataFrame", "pandas.qcut", "numpy.digitize", "pandas.Series", "numpy.searchsorted" ] ]
shinianzhihou/change_detection.pytorch
[ "e365eb1d97ebbce400ffc4230ac0fa063638fe05" ]
[ "cd_core/runners/hooks/optimizer.py" ]
[ "from torch.nn.utils import clip_grad\n\nfrom cd_core.runners import Hook,HOOKS\n\n@HOOKS.register_module()\nclass OptimizerHook(Hook):\n def __init__(self, grad_clip=None):\n self.grad_clip = grad_clip\n\n def clip_grads(self, params):\n params = list(\n filter(lambda p: p.requires_g...
[ [ "torch.nn.utils.clip_grad.clip_grad_norm_" ] ]
hpcaitech/FastFold
[ "a65d5009279ef84c1518081344db5c02213c387a" ]
[ "fastfold/distributed/core.py" ]
[ "import os\n\nimport torch\nimport colossalai\n\n\ndef ensure_divisibility(numerator, denominator):\n \"\"\"Ensure that numerator is divisible by the denominator.\"\"\"\n assert numerator % denominator == 0, '{} is not divisible by {}'.format(numerator, denominator)\n\n\ndef set_missing_distributed_environ(ke...
[ [ "torch.distributed.is_initialized" ] ]
confiwent/Comyco_linear_QoE
[ "087834ce4abfb203041de39d92f72e9adb9b976c" ]
[ "env_oracle.py" ]
[ "import numpy as np\n\nMILLISECONDS_IN_SECOND = 1000.0\nB_IN_MB = 1000000.0\nBITS_IN_BYTE = 8.0\nRANDOM_SEED = 42\nVIDEO_CHUNCK_LEN = 4000.0 # millisec, every time add this amount to buffer\nBITRATE_LEVELS = 6\nTOTAL_VIDEO_CHUNCK = 48\nBUFFER_THRESH = 60.0 * MILLISECONDS_IN_SECOND # millisec, max buffer limit\nDR...
[ [ "numpy.random.seed", "numpy.ceil", "numpy.maximum" ] ]