repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
mcarilli/apex
[ "766e36c9e10fe4efd847c3f77c3b38974c89eab1", "766e36c9e10fe4efd847c3f77c3b38974c89eab1" ]
[ "apex/amp/scaler.py", "tests/raw_ops/test_forward.py" ]
[ "import torch\n\nfrom apex_C import scale_check_overflow\n\nclass LossScaler(object):\n def __init__(self):\n self._loss_scale = 2.**16\n self._max_loss_scale = 2.**24\n self._scale_seq_len = 2000\n self._unskipped = 0\n self._overflow_buf = torch.cuda.ByteTensor(1024,)\n\n ...
[ [ "torch.cuda.ByteTensor" ], [ "torch.cuda.synchronize", "torch.cuda.manual_seed", "torch.set_printoptions", "torch.manual_seed", "torch.cuda.FloatTensor" ] ]
matbun/malware_rl
[ "b9c221603a2ae61a1c8066ff5c916e54222a5be9" ]
[ "malware_rl/envs/utils/malconv.py" ]
[ "#!/usr/bin/python\n\"\"\"\nDefines the MalConv architecture.\nAdapted from https://arxiv.org/pdf/1710.09435.pdf\nThings different about our implementation and that of the original paper:\n * The paper uses batch_size = 256 and\n SGD(lr=0.01, momentum=0.9, decay=UNDISCLOSED, nesterov=True )\n * The paper didn't h...
[ [ "numpy.frombuffer", "numpy.ones", "tensorflow.compat.v1.logging.set_verbosity" ] ]
michael-amat/fit1d
[ "0cd42874e3eba4353c564809c317510b626dee25" ]
[ "tests/common/test_fit_data.py" ]
[ "import unittest\nimport numpy as np\nfrom fit1d.common.model import ModelMock\nfrom fit1d.common.fit1d import FitData\n\n\nclass TestFitData(unittest.TestCase):\n def setUp(self):\n self.x = np.array([1,2, 3, 4])\n self.y = np.array([10,20, 30, 40])\n self.model = ModelMock({\"param1\": 5.5...
[ [ "numpy.array" ] ]
ady95/yolov4-deepsort
[ "cb694d69312550b975df905cff738a8e2d80ddb6" ]
[ "object_tracker_darklabel.py" ]
[ "import os\n# comment out below line to enable tensorflow logging outputs\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nimport time\nimport tensorflow as tf\nphysical_devices = tf.config.experimental.list_physical_devices('GPU')\nif len(physical_devices) > 0:\n tf.config.experimental.set_memory_growth(physical_devi...
[ [ "tensorflow.compat.v1.ConfigProto", "tensorflow.constant", "tensorflow.saved_model.load", "numpy.linspace", "tensorflow.config.experimental.set_memory_growth", "tensorflow.shape", "tensorflow.lite.Interpreter", "tensorflow.config.experimental.list_physical_devices", "matplotlib...
xavysp/BDCN
[ "f0952fdf24b901c12709ade3b76b76db6b9c32ee" ]
[ "datasets/utls.py" ]
[ "import numpy as np\nimport cv2 as cv\n\n\ndef cv_imshow(title='Res',img=None):\n print(img.shape)\n cv.imshow(title,img)\n cv.waitKey(0)\n cv.destroyAllWindows()\n\ndef image_normalization(img, img_min=0, img_max=255):\n \"\"\"This is a typical image normalization function\n where the minimum and...
[ [ "numpy.min", "numpy.uint8", "numpy.squeeze", "numpy.max", "numpy.float32", "numpy.array", "numpy.zeros" ] ]
xu6148152/Binea_Python_Project
[ "d943eb5f4685d08f080b372dcf1a7cbd5d63efed" ]
[ "DataAnalysis/intro/names_test.py" ]
[ "#!/usr/bin/env python3\n# -*- encoding: utf-8 -*-\n\nimport pandas as pd\n\nyears = range(1880, 2011)\n\npieces = []\ncolumns = ['name', 'sex', 'births']\n\nfor year in years:\n path = 'names/yob%d.txt' % year\n frame = pd.read_csv(path, names=columns)\n\n frame['year'] = year\n pieces.append(frame)\n\...
[ [ "pandas.concat", "pandas.read_csv" ] ]
andyjost/Sprite
[ "7ecd6fc7d48d7f62da644e48c12c7b882e1a2929" ]
[ "tests/obsolete/unit_llvm_values.py" ]
[ "import cytest # from ./lib; must be first\nfrom curry.llvm import *\nimport curry.llvm as ll\nfrom curry.llvm.types import *\nimport itertools\nimport numpy as np\nimport re\nimport sys\n\nclass TestLLVMValues(cytest.TestCase):\n def test_literalValueTypes(self):\n '''Literal value coercion'''\n # All integ...
[ [ "numpy.bool", "numpy.int32", "numpy.int8", "numpy.int16", "numpy.finfo", "numpy.int64", "numpy.float64", "numpy.float32" ] ]
Piyush1416/libra
[ "5192d1bd74f1aaecd17f83b672774005c35c6022" ]
[ "libra/preprocessing/data_reader.py" ]
[ "import os\nimport pandas as pd\nimport tensorflow as tf\nfrom sklearn.model_selection import train_test_split\nfrom tensorflow.python.client import device_lib\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\n\nclass DataReader():\n def __init__(\n self,\n filepath,\n trim=False,\n ...
[ [ "pandas.read_excel", "pandas.read_csv", "tensorflow.python.client.device_lib.list_local_devices", "tensorflow.test.gpu_device_name", "pandas.read_json" ] ]
Twizwei/SMOKE
[ "4f27538f04b0b88684a12fc688ca72965e28554a", "4f27538f04b0b88684a12fc688ca72965e28554a" ]
[ "smoke/data/datasets/evaluation/kitti/nms_gpu.py", "smoke/data/datasets/evaluation/kitti/evaluate.py" ]
[ "import math\nfrom pathlib import Path\n\nimport numba\nimport numpy as np\nfrom numba import cuda\n\n# from spconv.utils import non_max_suppression\n\ndef nms_gpu_cc(dets, nms_overlap_thresh, device_id=0):\n boxes_num = dets.shape[0]\n keep = np.zeros(boxes_num, dtype=np.int32)\n scores = dets[:, 4]\n ...
[ [ "numpy.array", "numpy.zeros" ], [ "numpy.array" ] ]
geem-lab/overreact
[ "eede50a45df5bfae942b3251f04b80ca8cd8f9c0" ]
[ "tests/test_misc.py" ]
[ "#!/usr/bin/env python3\n\n\"\"\"Tests for misc module.\"\"\"\n\nimport numpy as np\nimport pytest\n\nimport overreact as rx\n\n\ndef test_broaden_spectrum_works():\n \"\"\"Ensure we can broad a simple spectrum.\"\"\"\n x = np.linspace(50, 200, num=15)\n s = rx._misc.broaden_spectrum(x, [150, 100], [2, 1],...
[ [ "numpy.linspace" ] ]
jkamalu/trashbots-RL
[ "22983749bc69ef958121101ce59702d3766b9145" ]
[ "environment_test.py" ]
[ "\"\"\"\nScript to test the environment\n\"\"\"\n\nimport Environment\nimport numpy as np\ndef simulated_get_actions(seed_value=0, number_created_agents=1):\n \"\"\" Simulates the function which\n\n \"\"\"\n #Returns a random actions list for each robot\n np.random.seed(seed_value)\n action_list = li...
[ [ "numpy.random.seed", "numpy.random.randint" ] ]
4ntongC/Scientific-Computing-MATH-GA-2043
[ "a0042d5f0a967376777a6e3c34113711f2fd6a30" ]
[ "Scientific Computing Projects (Code Parts)/1/Problem_2/Binomial_Catastrophic_Cancellation.py" ]
[ "import numpy as np\r\nfrom scipy import special\r\n\r\nx = 1.1\r\nn = 20\r\nexpansion = 0\r\n\r\nfor i in range(1, n+2):\r\n term = special.comb(n, i-1)*(x**(n+1-i))*((-1)**(i-1))\r\n print(term)\r\n expansion += term\r\nprint(\"Final polynomial result: \", expansion)\r\nprint(\"Direct computation: \", (x...
[ [ "scipy.special.comb" ] ]
kuruonur1/cwi
[ "2f47ffdcd02895bf7803535602893c90aa423e6f" ]
[ "src/cwi.py" ]
[ "from __future__ import division\n\nimport random\nimport logging\nimport argparse\nimport numpy as np\n\nfrom itertools import *\nfrom tabulate import tabulate\nfrom collections import Counter, OrderedDict\n\nfrom sklearn.naive_bayes import GaussianNB, BernoulliNB, MultinomialNB\nfrom sklearn.svm import SVC, Linea...
[ [ "numpy.hstack", "sklearn.feature_selection.SelectPercentile", "sklearn.svm.SVC", "sklearn.svm.LinearSVC", "sklearn.feature_extraction.DictVectorizer", "numpy.array", "numpy.random.RandomState" ] ]
adz6/scripts
[ "5f22d6dfadaeaae0d5cbbb05611a6f142c3a5fe2" ]
[ "RGA_analysis/test.py" ]
[ "import RGA\nimport numpy\nimport math\nimport matplotlib.pyplot as plt\n\nmass_2 = RGA.data(\"/Users/ziegler/scripts/RGA_analysis/RGA_spectrum_files/2019-07-17_gas_comp\",2)\nmass_3 = RGA.data(\"/Users/ziegler/scripts/RGA_analysis/RGA_spectrum_files/2019-07-17_gas_comp\",3)\nmass_4 = RGA.data(\"/Users/ziegler/scri...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
felixmusil/nequip
[ "9424adac3438d7ee4f96c53cd1e634e407b9b2dc" ]
[ "nequip/nn/_grad_output.py" ]
[ "from typing import List, Union, Optional\nimport warnings\n\nimport torch\n\nfrom e3nn.o3 import Irreps\nfrom e3nn.util.jit import compile_mode\n\nfrom nequip.data import AtomicDataDict\nfrom nequip.nn import GraphModuleMixin\n\n\n@compile_mode(\"script\")\nclass GradientOutput(GraphModuleMixin, torch.nn.Module):\...
[ [ "torch.Tensor", "torch.zeros", "torch.autograd.functional.jacobian", "torch.neg", "torch.bmm", "torch._C._debug_only_display_vmap_fallback_warnings", "torch.cross" ] ]
akathpal/RoboND-Rover-Project
[ "2e3231ec3dbd5824ee27fd70093beb55135ac2db" ]
[ "code/perception.py" ]
[ "import numpy as np\nimport cv2\n\n# Identify pixels above the threshold\n# Threshold of RGB > 160 does a nice job of identifying ground pixels only\ndef color_thresh(img, rgb_thresh=(150, 150, 150),text = 'terrain'):\n # Create an array of zeros same xy size as img, but single channel\n color_select = np.zer...
[ [ "numpy.absolute", "numpy.sqrt", "numpy.cos", "numpy.int_", "numpy.arctan2", "numpy.sin", "numpy.zeros_like", "numpy.float32" ] ]
ansunsujoe/distil
[ "cf6cae2b88ef129d09c159aae0569978190e9f98", "cf6cae2b88ef129d09c159aae0569978190e9f98" ]
[ "test/active_learning_strategies/test_adversarial_bim.py", "distil/active_learning_strategies/strategy.py" ]
[ "from distil.utils.models.simple_net import TwoLayerNet\nfrom distil.active_learning_strategies.adversarial_bim import AdversarialBIM\nfrom test.utils import MyLabeledDataset, MyUnlabeledDataset\n\nimport unittest\nimport torch\n\nclass TestAdversarialBIM(unittest.TestCase):\n \n def setUp(self):\n \n ...
[ [ "torch.randn", "torch.randint", "torch.cuda.is_available" ], [ "torch.nn.functional.softmax", "torch.cat", "torch.utils.data.DataLoader", "torch.cuda.empty_cache", "torch.vstack", "torch.repeat_interleave", "torch.no_grad", "torch.cuda.is_available", "torch.auto...
VPetras/mobile-test-app
[ "e149f1bc2e50046c8810f83dae7739a8dea939ee" ]
[ ".buildozer/android/platform/build-armeabi-v7a/build/other_builds/numpy-python3/armeabi-v7a__ndk_target_21/numpy/benchmarks/benchmarks/bench_reduce.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nfrom .common import Benchmark, TYPES1, get_squares\n\nimport numpy as np\n\n\nclass AddReduce(Benchmark):\n def setup(self):\n self.squares = get_squares().values()\n\n def time_axis_0(self):\n [np.add.reduce(a, axis=0) for a i...
[ [ "numpy.min", "numpy.add.reduce", "numpy.ones", "numpy.full", "numpy.max", "numpy.sum" ] ]
ajalexei/seaborn
[ "1baf172e8969391beab108a700a11fa2334212cf" ]
[ "seaborn/basic.py" ]
[ "from __future__ import division\nfrom itertools import product\nfrom textwrap import dedent\nfrom distutils.version import LooseVersion\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\n\nfrom .external.six import string_types\n\nfrom . import utils\nfrom .utils...
[ [ "numpy.square", "matplotlib.pyplot.gca", "pandas.concat", "matplotlib.markers.MarkerStyle", "pandas.Series", "numpy.asarray", "matplotlib.colors.Normalize", "pandas.DataFrame", "matplotlib.ticker.MaxNLocator", "matplotlib.cm.get_cmap", "pandas.melt" ] ]
NickVolynkin/DeepPavlov
[ "f10b9485c118cdec69e73c89833a1a5a164404de" ]
[ "deeppavlov/models/morpho_tagger/common_tagger.py" ]
[ "\"\"\"\nFile containing common operation with keras.backend objects\n\"\"\"\n\nimport keras.backend as kb\nimport numpy as np\n\nEPS = 1e-15\n\n# AUXILIARY = ['PAD', 'BEGIN', 'END', 'UNKNOWN']\n# AUXILIARY_CODES = PAD, BEGIN, END, UNKNOWN = 0, 1, 2, 3\n\n\ndef to_one_hot(x, k):\n \"\"\"\n Takes an array of i...
[ [ "numpy.eye" ] ]
underflow101/torch-utils
[ "2c36a36c42400c402dceedd87957050faeeb052a" ]
[ "dataLoader.py" ]
[ "#####################################################################\n# dataLoader.py\n#\n# Dev. Dongwon Paek\n# Description: Dataloader util source\n#####################################################################\n\nimport h5py\nimport torch\nfrom torch.utils.data import Dataset\nfrom torch.utils.data impo...
[ [ "torch.utils.data.DataLoader", "torch.from_numpy" ] ]
BubblyYi/SSL4MIS
[ "bd046c97cbbb29e286d993528b87c4718ec3dbdb" ]
[ "code/networks/efficient_encoder.py" ]
[ "import re\nimport torch\nimport torch.nn as nn\nfrom typing import List\nfrom efficientnet_pytorch import EfficientNet\nfrom efficientnet_pytorch.utils import url_map, get_model_params\nimport torch.utils.model_zoo as model_zoo\nimport torch.nn as nn\n\nfrom torchvision.models.resnet import ResNet\nfrom torchvisio...
[ [ "torch.utils.model_zoo.load_url", "torch.Tensor", "torch.nn.parameter.Parameter" ] ]
crnbaker/MONAI
[ "a4b1144efdc27b197410033ae08bd587c8a1634a", "a4b1144efdc27b197410033ae08bd587c8a1634a" ]
[ "tests/test_to_numpy.py", "monai/metrics/utils.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.rot90", "numpy.asarray", "torch.tensor", "numpy.testing.assert_allclose", "numpy.array" ], [ "numpy.expand_dims", "numpy.ones_like", "torch.isnan", "torch.zeros", "torch.sum", "torch.is_tensor", "numpy.zeros_like", "numpy.any" ] ]
vanyalzr/mmdetection
[ "2fcac9660cd40c374bf713dcf333d4b7a51bea06", "7fc2e1a20cd4b4dda82027659363be2b15e4adf9" ]
[ "mmdet/core/utils/dist_utils.py", "mmdet/core/anchor/anchor_generator.py" ]
[ "import warnings\nfrom collections import OrderedDict\n\nimport torch.distributed as dist\nfrom mmcv.runner import OptimizerHook\nfrom torch._utils import (_flatten_dense_tensors, _take_tensors,\n _unflatten_dense_tensors)\n\n\ndef _allreduce_coalesced(tensors, world_size, bucket_size_mb=-1...
[ [ "torch._utils._flatten_dense_tensors", "torch._utils._unflatten_dense_tensors", "torch.distributed.get_world_size", "torch.distributed.all_reduce", "torch._utils._take_tensors" ], [ "torch.LongTensor", "numpy.sqrt", "torch.Tensor", "torch.zeros", "torch.sqrt", "torc...
Ben-Jamin-Griff/AmputeePostureClassification
[ "0f5b59c6844d90d9452dc6814c7de72485ddf8c5" ]
[ "src/ProsNet/dataset/feature_set.py" ]
[ "from ProsNet.dataset.dataset import Dataset\nfrom ProsNet.plotter import Plotter\n\nimport pandas as pd\nimport numpy as np\nimport math\nfrom scipy import signal, misc, stats\nimport datetime\nimport random as r\n\nfrom uos_activpal.io.raw import load_activpal_data\n\nimport warnings\nwarnings.filterwarnings(\"ig...
[ [ "numpy.array", "scipy.signal.filtfilt", "numpy.sqrt", "numpy.sum", "numpy.min", "scipy.stats.median_absolute_deviation", "pandas.DataFrame", "numpy.max", "scipy.signal.butter", "numpy.append", "numpy.mean", "numpy.std", "scipy.stats.iqr", "numpy.argsort", ...
grimmlab/HorticulturalSalesPredictions
[ "92d582623a278c938d1674b154e370ed43482248", "92d582623a278c938d1674b154e370ed43482248" ]
[ "RunESOptim.py", "preparation/PreparationHelper.py" ]
[ "import os\nimport sys\nimport warnings\nimport configparser\n\nimport numpy as np\nimport pandas as pd\nimport sklearn\nfrom tqdm import tqdm\n\nfrom training import TrainHelper, ModelsES\nfrom utils import MixedHelper\n\n\ndef run_es_optim(target_column: str, split_perc: float, imputation: str):\n \"\"\"\n ...
[ [ "numpy.random.RandomState" ], [ "numpy.mean", "numpy.sum", "pandas.date_range", "pandas.get_dummies" ] ]
izeki/Autoware
[ "d5b2ed9dc309193c8a2a7c77a2b6c88104c28328" ]
[ "ros/src/sensing/drivers/imu/packages/xsens/src/xsens_driver/src/mtnode.py" ]
[ "#!/usr/bin/env python\nimport roslib; roslib.load_manifest('xsens_driver')\nimport rospy\nimport select\nimport mtdevice\nimport math\nimport pdb\n\nfrom std_msgs.msg import Header, Float32, Float64\nfrom sensor_msgs.msg import Imu\nfrom geometry_msgs.msg import TwistStamped, Vector3Stamped, QuaternionStamped\nfro...
[ [ "numpy.array", "numpy.identity" ] ]
jfoster17/astroquery
[ "807eade21e63f773cf7df8833799afa5eac8b79d" ]
[ "astroquery/sha/core.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport re\nimport os\nimport io\nimport requests\nimport numpy as np\nfrom astropy.table import Table\nimport astropy.io.fits as fits\n\n\n__all__ = ['query', 'save_file', 'get_file']\nid_parse = re.compile('ID\\=(\\d+)')\n\n# should skip only if rem...
[ [ "numpy.cumsum" ] ]
kemingy/taichi
[ "28c450fd445cc44ecfdcc8be9f873cd8cb5476f8" ]
[ "tests/python/test_ast_refactor.py" ]
[ "import numpy as np\nimport pytest\n\nimport taichi as ti\nfrom taichi import approx\n\n\n@ti.test(experimental_ast_refactor=True)\ndef test_binop():\n @ti.kernel\n def foo(x: ti.i32, y: ti.i32, a: ti.template()):\n a[0] = x + y\n a[1] = x - y\n a[2] = x * y\n a[3] = ti.ti_float(x)...
[ [ "numpy.ones" ] ]
OpenSUTD/ISTD
[ "d8bf1f446b65434021c6a4f0993e1f225214d0c5" ]
[ "misc/resources/parse_voting_data.py" ]
[ "from collections import Counter\n\nimport pandas as pd\n\n\ndef read_csv(filename: str) -> list:\n \"\"\"\n Reads an Excel file and returns a list of rows.\n \"\"\"\n df = pd.read_csv(filename)\n header = df.columns.tolist()\n data = df.values.tolist()\n data.insert(0, header)\n return data...
[ [ "pandas.read_csv" ] ]
PiotrekGa/shap
[ "4fd2608f4e4c0abb0410df6bd7d63fd806748af1" ]
[ "shap_domino/explainers/_deep/deep_pytorch.py" ]
[ "import numpy as np\nimport warnings\nfrom shap_domino.explainers._explainer import Explainer\nfrom distutils.version import LooseVersion\ntorch = None\n\n\nclass PyTorchDeep(Explainer):\n\n def __init__(self, model, data):\n # try and import pytorch\n global torch\n if torch is None:\n ...
[ [ "torch.abs", "numpy.split", "torch.ones", "torch.max", "torch.cat", "torch.zeros_like", "torch.from_numpy", "torch.no_grad", "torch.sort", "torch.arange", "torch.chunk", "numpy.zeros" ] ]
undertherain/nlp_cooc
[ "e316740c469e4ade6ba064e6756057fee10466ed" ]
[ "python/vocabulary.py" ]
[ "import numpy as np\nimport sys\nimport os\n\nsys.path.append(\"swig\")\n\nfrom ternary_tree import TernaryTree\n\nclass Vocabulary(TernaryTree):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tpass\n\t\t#tree=TernaryTree()\n\tdef read_from_precomputed(self,path):\n\t\tself.l_frequencies = np.fromfile(open(os.p...
[ [ "numpy.int64" ] ]
smurf-1119/knowledge-engeneering-experiment
[ "7fd3647bfc5b05e5fd6f93fea324e7ec0d55d4a1", "7fd3647bfc5b05e5fd6f93fea324e7ec0d55d4a1", "7fd3647bfc5b05e5fd6f93fea324e7ec0d55d4a1" ]
[ "6/master/src/openea/approaches/kdcoe.py", "6/master/src/openea/approaches/gcn_align.py", "6/master/src/openea/modules/base/mapping.py" ]
[ "import math\nimport multiprocessing as mp\nimport random\nimport string\nimport time\n\nimport gc\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\n\nfrom openea.models.basic_model import BasicModel\nfrom openea.modules.base.initializers import init_embeddings\nfrom openea.modules.base.losses impo...
[ [ "pandas.Series", "tensorflow.reduce_sum", "tensorflow.contrib.keras.layers.Conv1D", "pandas.DataFrame", "numpy.fill_diagonal", "tensorflow.contrib.keras.layers.GRU", "numpy.matmul", "numpy.stack", "tensorflow.contrib.keras.layers.Dense", "tensorflow.name_scope", "numpy....
RAS-2018-grp-4/Perception
[ "45a5b12e23d87b7ecdef681c5c2621ef3b793a9d" ]
[ "DL_training/KERAS_model/svm_color.py" ]
[ "import cv2 \nimport numpy as np \nimport matplotlib.pyplot as plt\nimport os\nimport ast\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import datasets, svm, metrics\nfrom sklearn.neural_network import MLPRegressor\n'''\nCOLOR CODE: \n0: Yellow\n1: Green\n2: Orange\n3: Red\n4: Blue\n5: P...
[ [ "sklearn.model_selection.train_test_split", "numpy.std", "numpy.mean", "numpy.array", "sklearn.neural_network.MLPRegressor" ] ]
jpra2/impress
[ "26cace0ab17ec5fb19121a55adc48e125a090983" ]
[ "mesh_preprocessor.py" ]
[ "\"\"\"Universidade Federal de Pernambuco.\"\"\"\nimport numpy as np\nfrom preprocessor.meshHandle.finescaleMesh import FineScaleMesh as load_mesh\nfrom scipy.spatial import ConvexHull\n\n\n\"\"\"PRESTO - Python REservoir Simulation TOolbox\n ***********************************************************************...
[ [ "numpy.cross", "numpy.sum", "scipy.spatial.ConvexHull", "numpy.flatnonzero" ] ]
xcmyz/FastVocoder
[ "a9af370be896b1096e746ce6489fb16fef8ca585" ]
[ "bin/train.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport argparse\nimport random\nimport os\nimport time\nimport logging\nimport tensorboardX\nimport yaml\nimport hparams as hp\nimport numpy as np\n\nfrom torch.optim import Adam, AdamW\nfrom torch.optim.lr_scheduler import CosineAnnealingLR\n...
[ [ "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.from_numpy", "numpy.append", "torch.no_grad", "numpy.mean", "torch.cuda.is_available", "torch.nn.L1Loss", "torch.device", "numpy.array", "torch.nn.MSELoss" ] ]
rmbeard/clustervision
[ "409390dd02ec36c8cd25acd20e971b670628d8a9" ]
[ "tests/data_covid.py" ]
[ "import pandas as pd\nimport geopandas as gpd\n\n\n\n#read in data and display basics\ndef display (input):\n df = input\n # Basic info\n print(\"Shape: /n\", df.shape) \n print('Total unique states:',len(df.STUSPS.unique()))\n print('Date span:',df.date.min(),df.date.max())\n print(df.head(5))\n ...
[ [ "pandas.concat", "pandas.read_csv" ] ]
abgibbs/psisim
[ "9b0a6ac4f134cabcd2b10a03e20b2fcb58c8afe7" ]
[ "Tutorials/Example_HISPEC_ETC.py" ]
[ "from psisim import telescope,instrument,observation,spectrum,universe,plots\nimport time\nimport numpy as np\nimport astropy.units as u\nimport matplotlib.pyplot as plt\nfrom importlib import reload\n\nSMALL_SIZE = 32\nMEDIUM_SIZE = 40\nBIGGER_SIZE = 48\n\nplt.rc('font', size=SMALL_SIZE) # controls defaul...
[ [ "matplotlib.pyplot.semilogy", "matplotlib.pyplot.legend", "matplotlib.pyplot.rc", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
Glairly/introduction_to_tensorflow
[ "aa0a44d9c428a6eb86d1f79d73f54c0861b6358d", "aa0a44d9c428a6eb86d1f79d73f54c0861b6358d", "aa0a44d9c428a6eb86d1f79d73f54c0861b6358d", "aa0a44d9c428a6eb86d1f79d73f54c0861b6358d", "aa0a44d9c428a6eb86d1f79d73f54c0861b6358d" ]
[ "blogs/babyweight/babyweight/trainer/model.py", "quests/rl/dqn/trainer/model.py", "courses/machine_learning/deepdive/08_image/flowersmodeltpu/model.py", "self-paced-labs/vertex-ai/vertex-pipelines/tfx/tfx_taxifare_tips/model_training/model_trainer.py", "self-paced-labs/tfx/tfx-ai-platform/labs/pipeline/prep...
[ "#!/usr/bin/env python\r\n\r\n# Copyright 2017 Google Inc. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses...
[ [ "tensorflow.feature_column.embedding_column", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.feature_column.categorical_column_with_vocabulary_list", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "numpy.arange", "tensorflow.feature_column.crossed_column",...
0one2/CVAHMR
[ "b262b618c3058db15de11cc938dca111c5887081" ]
[ "train/trainer.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\nfrom torchgeometry import angle_axis_to_rotation_matrix, rotation_matrix_to_angle_axis\nimport cv2\nimport pdb\nfrom matplotlib import pyplot as plt\nfrom matplotlib.lines import Line2D\nimport csv\n\nfrom datasets import MixedDataset\nfrom models import hmr...
[ [ "torch.normal", "torch.mean", "torch.nn.MSELoss", "torch.abs", "torch.ones", "torch.cos", "torch.zeros", "torch.sin", "torch.eye", "torch.tensor", "torch.matmul", "torch.nn.BCEWithLogitsLoss", "torch.square", "torch.where", "torch.stack", "torch.flip...
TathyaEarth/pycococreator
[ "0b6f35bee7cd342a6ae1de1056a69492ef1e88be" ]
[ "pycococreatortools/pycococreatortools.py" ]
[ "#!/usr/bin/env python3\n\nimport os\nimport re\nimport datetime\nimport numpy as np\nfrom itertools import groupby\nfrom skimage import measure\nfrom PIL import Image\nfrom pycocotools import mask\n\nconvert = lambda text: int(text) if text.isdigit() else text.lower()\nnatrual_key = lambda key: [ convert(c) for c ...
[ [ "numpy.pad", "numpy.array_equal", "numpy.asarray", "numpy.subtract", "numpy.zeros_like", "numpy.flip", "numpy.vstack" ] ]
imackerracher/NewsSimilarity
[ "2e6a85dc9e95ef94bec2339987950f4e88f5d909" ]
[ "newssimilarity/ml_classifiers/feature_selector.py" ]
[ "import numpy as np\nfrom scipy import spatial\nfrom sklearn.model_selection import train_test_split\n\n\n\ndef reshape_single_dimension(X):\n reshaped = np.array(X).reshape(-1, 1)\n return reshaped\n\n\n\n\"\"\"def transform_labels(labels):\n l = lambda label: 1 if label == [1,0] else 0\n return list(m...
[ [ "numpy.array", "sklearn.model_selection.train_test_split" ] ]
RLOpensource/IMPALA-Distributed-Tensorflow
[ "6e9ff2c5bfa4bebea5183f60eab6751020832761" ]
[ "trainer_gunner.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\nimport tensorboardX\nimport buffer_queue\nimport collections\nimport py_process\nimport wrappers\nimport config\nimport model\nimport time\nimport gym\n\nflags = tf.app.flags\nFLAGS = tf.app.flags.FLAGS\n\n\n\nflags.DEFINE_integer('num_actors', 4, 'Number of actors.')...
[ [ "tensorflow.device", "tensorflow.train.Server", "numpy.stack", "tensorflow.Session", "numpy.zeros", "tensorflow.app.run" ] ]
ParikhKadam/pycorrector
[ "771115538256126711888a48f8b359757500d345" ]
[ "pycorrector/transformers/modeling_flax_utils.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google Flax Team Authors and The HuggingFace Inc. team.\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/license...
[ [ "torch.load" ] ]
BELWAL8955/Python-for-Mechanical-Engineers
[ "c995e486e0fbc63eb8fb3cbffdd3e37b9af9e051" ]
[ "Dashboard/TDE.py" ]
[ "import numpy as np\nfrom scipy.integrate import odeint\nimport matplotlib.pyplot as plt\nimport math\n\n# a funtion that returns dz/dt\ndef mode1(theta, t, b, g, l, m):\n theta1 = theta[0]\n theta2 = theta[1]\n dtheta1_dt = theta2\n dtheta2_dt = -(b/m)*theta2 - (g/l)*math.sin(theta1)\n dtheta_dt = [...
[ [ "matplotlib.pyplot.legend", "numpy.linspace", "scipy.integrate.odeint", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
delldu/StyleGAN2
[ "4bcba4673d3dc32ac3a67f6b5d5e24b490cdfbb3" ]
[ "project/model.py" ]
[ "\"\"\"Create model.\"\"\" # coding=utf-8\n#\n# /************************************************************************************\n# ***\n# *** Copyright Dell 2021, All Rights Reserved.\n# ***\n# *** File Author: Dell, 2021年 03月 02日 星期二 12:48:05 CST\n# ***\n# *********************************************...
[ [ "torch.manual_seed", "torch.no_grad", "torch.cuda.is_available", "torch.device", "torch.nn.L1Loss" ] ]
kostogls/Python
[ "4866b1330bc7c77c0ed0e050e6b99efdeb026448" ]
[ "ciphers/hill_cipher.py" ]
[ "\"\"\"\n\nHill Cipher:\nThe below defined class 'HillCipher' implements the Hill Cipher algorithm.\nThe Hill Cipher is an algorithm that implements modern linear algebra techniques\nIn this algorithm, you have an encryption key matrix. This is what will be used\nin encoding and decoding your text.\n\nAlgorithm:\nL...
[ [ "numpy.matrix", "numpy.linalg.det", "numpy.vectorize", "numpy.linalg.inv" ] ]
amonszpart/iMapper
[ "f8a1f7972548fc3759fdb67bcd186aaf7ac3ce49" ]
[ "imapper/logic/skeleton.py" ]
[ "import codecs\nimport copy\nimport json\nimport sys\nimport bisect\n\nimport numpy as np\nfrom builtins import range\nif not sys.version_info[0] < 3:\n from functools import lru_cache\n from typing import Dict\nelse:\n from repoze.lru import lru_cache\n\nimport imapper.logic.geometry as gm\nfrom imapper.l...
[ [ "numpy.dot", "numpy.expand_dims", "numpy.sqrt", "numpy.asarray", "numpy.arctan2", "numpy.max", "numpy.mean", "numpy.cross", "numpy.eye", "numpy.matmul", "numpy.sin", "numpy.insert", "numpy.float32", "numpy.interp", "numpy.zeros", "numpy.min", "nu...
shasure/nmt-dist
[ "20dff79d0bd0e7a286a8063d0194fbc7903bbee3" ]
[ "nmt/attention_model.py" ]
[ "# Copyright 2017 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 appl...
[ [ "tensorflow.transpose", "tensorflow.contrib.seq2seq.LuongAttention", "tensorflow.summary.image", "tensorflow.contrib.seq2seq.BahdanauAttention", "tensorflow.contrib.seq2seq.tile_batch", "tensorflow.no_op", "tensorflow.contrib.seq2seq.AttentionWrapper" ] ]
adomaatobrah/simplewebpage
[ "41b3d78d03d15d7aaac5dda1a592c7e850bb70d2" ]
[ "April/alternative_wordings/models.py" ]
[ "import torch\nfrom transformers import MarianMTModel, MarianTokenizer\nimport string\nimport pandas as pd\nimport spacy\nfrom spacy import displacy\nimport difflib\nfrom difflib import Differ, SequenceMatcher\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\nen_ROMANCE_model_name = 'Hel...
[ [ "torch.LongTensor", "torch.no_grad", "torch.cuda.is_available" ] ]
nodtem66/pybdm
[ "71461aa08396034e7cf81cddc11c4dcfad97296e" ]
[ "tests/test_bdm.py" ]
[ "\"\"\"Tests for `bdm` module.\"\"\"\n# pylint: disable=W0621\nimport os\nimport warnings\nimport pytest\nfrom pytest import approx\nimport numpy as np\nfrom joblib import Parallel, delayed\nfrom pybdm.bdm import BDM\nfrom pybdm.partitions import PartitionRecursive\nfrom pybdm.encoding import array_from_string\nfro...
[ [ "numpy.array", "numpy.zeros", "numpy.ones" ] ]
charnley/no-place-like-tilde
[ "b4daf1c12807aa3d41e6d36fe7d38df8767d4724" ]
[ "overview.py" ]
[ "import numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\n\nimport csv\n\nimport models\nfrom models import ApartmentModel\nfrom sqlalchemy.orm import sessionmaker\n\nimport location\nimport wingo_fiber\n\nengine = models.db_connect()\nSession = sessionmaker(bind=engine)\n\ndef main():\n\n ...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ] ]
SreeHarshaNelaturu/EnlightenGAN
[ "7ce1a6ca1463791dba3ac43bf9fb30876a779c2a" ]
[ "models/networks.py" ]
[ "import torch\nimport os\nimport math\nimport torch.nn as nn\nfrom torch.nn import init\nimport functools\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport numpy as np\nfrom torch.utils.serialization import load_lua\nfrom lib.nn import SynchronizedBatchNorm2d as SynBN2d\n################...
[ [ "torch.nn.functional.upsample", "torch.mean", "torch.abs", "torch.nn.Dropout2d", "torch.max", "torch.cat", "torch.load", "torch.cuda.is_available", "torch.autograd.Variable", "torch.nn.ReplicationPad2d", "torch.nn.Dropout", "torch.nn.Sigmoid", "numpy.ceil", ...
siyliepfl/pytorch-CycleGAN-and-pix2pix
[ "294b04067659e5b463cd80b7a975ef81e987490c" ]
[ "models/networks.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport functools\nfrom torch.optim import lr_scheduler\n\n\n###############################################################################\n# Helper Functions\n###############################################################################\n\n\nclass...
[ [ "torch.optim.lr_scheduler.LambdaLR", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.sum", "torch.nn.BCEWithLogitsLoss", "torch.cuda.is_available", "torch.nn.ReplicationPad2d", "torch.nn.Dropout", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.tensor", "torch.ran...
lidongyv/RSDEN
[ "75da87c4981c772dcf4c2a25c8b02bef504ec369" ]
[ "region.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: yulidong\n# @Date: 2018-04-26 10:28:48\n# @Last Modified by: yulidong\n# @Last Modified time: 2018-07-30 15:28:42\nimport os\nimport numpy as np\nimport cv2\nimport copy\ndef seg2instance(seg):\n region=seg\n label=-1\n while(np.max(seg)>0):\n category=np.max...
[ [ "numpy.abs", "numpy.min", "numpy.reshape", "numpy.concatenate", "numpy.max", "numpy.mean", "numpy.logical_and", "numpy.zeros", "numpy.where" ] ]
ritwikraha/SPACH
[ "21d2d0a4eddab6f7e17c602d39cb419014363234", "21d2d0a4eddab6f7e17c602d39cb419014363234" ]
[ "utils.py", "models/spach/layers/spatial_func.py" ]
[ "# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\n\"\"\"\nMisc functions, including distributed helpers.\n\nMostly copy-paste from torchvision references.\n\"\"\"\nimport io\nimport os\nimport time\nfrom collections import defaultdict, deque\nimport datetime\nimport logging\n\nimport torch\nimp...
[ [ "torch.distributed.init_process_group", "torch.cuda.set_device", "torch.cuda.device_count", "torch.distributed.is_initialized", "torch.distributed.barrier", "torch.tensor", "torch.cuda.max_memory_allocated", "torch.distributed.is_available", "torch.cuda.is_available", "torc...
musslick/DARTS-Cognitive-Modeling
[ "f38e7e34f6f20c1626458de62503e8670e06be7c" ]
[ "AER_theorist/darts/plot_utils.py" ]
[ "import AER_config as aer_config\nimport AER_theorist.darts.darts_config as darts_config\nimport matplotlib.pyplot as plt\nfrom matplotlib import pyplot\nimport matplotlib\nimport pylab\nimport seaborn as sns\nfrom matplotlib.gridspec import GridSpec\nfrom mpl_toolkits import mplot3d\nimport imageio\nimport time\ni...
[ [ "numpy.linspace", "torch.load", "numpy.asarray", "pandas.DataFrame", "numpy.concatenate", "numpy.max", "numpy.argmin", "numpy.mean", "numpy.nanmean", "numpy.nanstd", "numpy.exp", "pandas.read_csv", "numpy.unique", "numpy.arange", "numpy.ceil", "numpy...
sm823zw/Natural-Language-Inference
[ "0cc89173f798478439d98377b2b540ea48b54cd8" ]
[ "model.py" ]
[ "import re\nimport tensorflow as tf\nfrom attention import *\n\ndef create_LSTM_model(premise, hypothesis, \n embed_matrix, l2, \n EMBEDDING_DIM, MAX_SEQ_LEN, \n attention=False, baseline=True):\n\n lam = tf.keras.regularizers.l2(l2=l2)\n \n...
[ [ "tensorflow.keras.layers.ReLU", "tensorflow.keras.layers.Subtract", "tensorflow.keras.layers.Embedding", "tensorflow.keras.layers.Dense", "tensorflow.keras.regularizers.l2", "tensorflow.keras.layers.concatenate", "tensorflow.keras.layers.GRU", "tensorflow.keras.layers.LSTM", "t...
manhhabui/personalized-breath
[ "1627476ce94b81d1daa1da3f71f80b7274031afd" ]
[ "src/training/dataloader.py" ]
[ "import numpy as np\nfrom torch.utils.data import Dataset\n\nclass Audio_Dataset(Dataset):\n def __init__(self,root_dir,filenamelist,old_new_name_map, object_id = None):\n self.filenamelist = filenamelist\n self.root_dir=root_dir\n self.old_new_name_map=old_new_name_map\n self.type_na...
[ [ "numpy.load" ] ]
thesuhas/MI-Lab-CS305
[ "ddc94d13a007f566aca1d852776cc72e7350715b" ]
[ "Week8/SampleTest.py" ]
[ "import sys\nimport importlib\nimport argparse\nimport numpy as np\n\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--SRN', required=True)\n\nargs = parser.parse_args()\nsubname = args.SRN\n\n\ntry:\n mymodule = importlib.import_module(subname)\nexcept Exception as e:\n print(e)\n print(\"Rena...
[ [ "numpy.array" ] ]
cptanalatriste/bayesian-game-builder
[ "d2c8a6b4f41e7e4583a92554dfcde89475491ae2" ]
[ "numpy_auctions/auctionsnp_test.py" ]
[ "import unittest\nfrom fractions import Fraction\n\nimport numpy as np\n\nfrom numpy_auctions.auctionsnp import FirstPriceAuction\nfrom gamebuildernp import Strategy\n\n\nclass FirstPriceAuctionTest(unittest.TestCase):\n\n def __init__(self, *args, **kwargs):\n super(FirstPriceAuctionTest, self).__init__(...
[ [ "numpy.array", "numpy.array_equal" ] ]
JingwenWang95/svox2
[ "6301dea3e55fe174d7192af0310b9cbd99eb1a2c" ]
[ "opt/opt.py" ]
[ "# Copyright 2021 Alex Yu\n\n# First, install svox2\n# Then, python opt.py <path_to>/nerf_synthetic/<scene> -t ckpt/<some_name>\n# or use launching script: sh launch.sh <EXP_NAME> <GPU> <DATA_DIR>\nimport torch\nimport torch.cuda\nimport torch.optim\nimport torch.nn.functional as F\nimport svox2\nimport json\nimp...
[ [ "numpy.random.seed", "torch.manual_seed", "torch.from_numpy", "numpy.concatenate", "torch.nn.functional.mse_loss", "torch.no_grad", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.is_available" ] ]
story645/siphon
[ "d2d4584f953cc4034e2b60bcb0ced8bc7ec4fee5" ]
[ "siphon/cdmr/ncstream.py" ]
[ "# Copyright (c) 2014-2016 Siphon Contributors.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n\"\"\"Handle binary stream returns in NCStream format.\"\"\"\n\nfrom __future__ import print_function\n\nfrom collections import OrderedDict\nimport itertools\nimport...
[ [ "numpy.frombuffer", "numpy.empty", "numpy.array", "numpy.dtype" ] ]
pdav-sfi/python-skyfield
[ "cad5d36721184beea621ae795160a8cef6dc8b1f" ]
[ "skyfield/tests/test_earth_satellites.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom numpy import array\nfrom skyfield import api\nfrom skyfield.api import EarthSatellite\nfrom skyfield.constants import AU_KM, AU_M\nfrom skyfield.sgp4lib import TEME_to_ITRF\n\niss_tle0 = \"\"\"\\\n1 25544U 98067A 18184.80969102 .00001614 00000-0 31745-4 0 9993\n2 25544 51.641...
[ [ "numpy.array" ] ]
IanYangChina/UOF-paper-code
[ "c6e0259167a86996183d45d450e62d9dd1529d5a", "c6e0259167a86996183d45d450e62d9dd1529d5a" ]
[ "agent/utils/plot.py", "multigoal_env/multigoal_fetch_base_env.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom copy import deepcopy as dcp\n\n\ndef smoothed_plot(file, data, x_label=\"Timesteps\", y_label=\"Success rate\", window=5):\n N = len(data)\n running_avg = np.empty(N)\n for t in range(N):\n running_avg[t] = np.mean(data[max(0, t - window):(t...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.ioff", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "numpy.empty", "matplotlib.pyplot.ylabel" ], [ "numpy.round", "numpy.clip" ] ]
rcrvano/rembg
[ "aa79c3e047e3dc61ebe5f8ab5a80ea8aa7fb6e0c" ]
[ "src/rembg/u2net/detect.py" ]
[ "import errno\nimport os\nimport sys\nimport urllib.request\n\nimport numpy as np\nimport requests\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nfrom PIL import Image\nfrom skimage import transform\nfrom torchvision import transforms\nfrom tqdm import tqdm\n\nfrom . impo...
[ [ "torch.max", "torch.load", "torch.min", "torch.no_grad", "torch.cuda.is_available", "torch.device", "numpy.array", "numpy.zeros" ] ]
thond-tsdv/pyexample
[ "33fbb1786e840f55b5e1415fad9c705d979beff5" ]
[ "thond/module_numpy_2.py" ]
[ "\"\"\"Test numpy AoS v SoA for H layout\"\"\"\n\n#todo: Clean this up - very quickly knocked up.\n\nimport numpy as np\nimport time\n\ndef numpy_SoA_v_AoS(L=10000):\n \"\"\"\n Compare reading and writing from/to numpy dataset using Array of Structures v Strucure of Arrays\n \"\"\"\n\n libE_fields = [('sim_id',...
[ [ "numpy.zeros" ] ]
oananovac/Speaker_Recognition_System
[ "526eb2467190efeeeb2256849f53cde648b3a294" ]
[ "code/training/universal_background_model.py" ]
[ "import numpy as np\nfrom sklearn.mixture import GaussianMixture\n\n\nclass GaussianMixtureModel(object):\n def __init__(self, weights, means, covariances, components_number):\n self.weights = weights\n self.means = means\n self.covariances = covariances\n self.components_number = com...
[ [ "sklearn.mixture.GaussianMixture", "numpy.load", "numpy.save" ] ]
atahmasb/transformers
[ "d9e848c1d646a47e4cff50555f7bff3ad8e4033c" ]
[ "src/transformers/models/prophetnet/modeling_prophetnet.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Microsoft Authors and The HuggingFace Inc. team.\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/LICEN...
[ [ "torch.all", "torch.abs", "torch.nn.functional.softmax", "torch.ones", "torch.nn.functional.dropout", "torch.cat", "torch.einsum", "torch.lt", "torch.zeros_like", "torch.nn.Embedding", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.bmm", "torch.arange", ...
rtx-travis-tester/RTX
[ "4936eb0d368e3b40d9cdc988cc546a1eb73d0104" ]
[ "code/kg2/misc-tools/drugbank_get_approved_drugs_and_ids.py" ]
[ "#!/usr/bin/env python3\n''' drugbank_get_approved_drugs_and_ids.py: Extracts a comma delimited csv file of\n approved drugbank drugs and a comma delimited csv file of drugbank and eternal\n drug idsfrom DrugBank database in XML format\n\n Usage: drugbank_get_approved_drugs_and_ids.py <inputFile.xml>\n ...
[ [ "pandas.DataFrame" ] ]
kavyadevd/ARTagDetection
[ "75230448c238e569f2ea755d4d9d9e73b967c064" ]
[ "CubeAR.py" ]
[ "\nimport numpy as np\nimport cv2\nimport scipy.fftpack as fp\nfrom matplotlib import pyplot as plt\nfrom copy import deepcopy\n\n\nvideo = \"1tagvideo.mp4\"\n\n# create video capture object\nvideo_ = cv2.VideoCapture(video)\n\nlast_projection = None\n# cube top coordinates\ntopx1, topy1, topz1 = 0, 0, 0\ntopx2, to...
[ [ "numpy.linalg.svd", "numpy.ones_like", "numpy.linalg.inv", "numpy.matmul", "numpy.ones", "numpy.linalg.det", "numpy.zeros", "numpy.cross", "scipy.fftpack.ifftshift", "numpy.array", "numpy.where", "numpy.column_stack", "numpy.empty", "scipy.fftpack.fftshift" ...
abrahamwilliam/TensorFlow
[ "382261952391abea73884374fb8abbc294a53596" ]
[ "tensorflow/python/keras/mixed_precision/experimental/keras_test.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.keras.testing_utils.get_model_from_layers", "tensorflow.python.keras.backend.variable", "tensorflow.python.keras.layers.core.Lambda", "tensorflow.python.keras.optimizers.SGD", "tensorflow.python.eager.backprop.GradientTape", "tensorflow.python.ops.array_ops.identity", ...
johnrest/mode_trans
[ "045be46c8a2f424a6bb6c7123a53e61d4464cf3a" ]
[ "process_video.py" ]
[ "# Script to process a video and recenter the spot\n\ndef compute_centroid(array):\n \"\"\"\"Compute centroid of the array\"\"\"\n X, Y = np.meshgrid(np.linspace(0,array.shape[1]-1, array.shape[1]), np.linspace(0,array.shape[0]-1, array.shape[0]))\n X += 0.5\n Y += 0.5\n centroid_x = np.sum(array * X...
[ [ "numpy.pad", "numpy.linspace", "numpy.arange", "numpy.array", "numpy.sum" ] ]
gmatteo/awesome-panel
[ "7eb6965f4b3a7eca08c07561e631e5beb189ffd3", "7eb6965f4b3a7eca08c07561e631e5beb189ffd3" ]
[ "application/pages/tabulator_app/tabulator_app.py", "application/pages/dashboard/dashboard.py" ]
[ "\"\"\"[Tabulator](http://tabulator.info/) is a very powerful interactive javascript Table.\r\n\r\nPanel provides the [`Tabulator`](https://panel.holoviz.org/reference/layouts/Tabs.html) widget.\r\nThe widget was first implemented and contributed by `awesome-panel.org`. Later Philipp did massive\r\nimprovements. It...
[ [ "pandas.read_csv" ], [ "pandas.read_csv" ] ]
pypm/covid19-scenario-modeling-hub
[ "f72f0eda7e0766eccc89a193fcc6b689a0161fe0" ]
[ "code/validation/validation_functions/metadata.py" ]
[ "\nimport dateutil\nimport os\nimport glob\nfrom dateutil.parser import parse\nimport re\nimport yaml\nimport pandas as pd\n\nfrom pykwalify.core import Core\n\nSCHEMA_FILE = 'schema.yml'\nDESIGNATED_MODEL_CACHE_KEY = 'designated_model_cache'\n\ndef validate_metadata_contents(metadata, filepath, cache):\n # Init...
[ [ "pandas.read_csv" ] ]
heixialeeLeon/segment_piwise
[ "4eaeeb4aa36298c1140c9fb8a6adef7a3bcfb03f" ]
[ "test.py" ]
[ "import numpy as np\nimport torch\n\nfrom PIL import Image\nfrom argparse import ArgumentParser\n\nfrom torch.optim import SGD, Adam\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\nfrom torchvision.transforms import Compose, CenterCrop, Normalize\nfrom torchvision.transforms import To...
[ [ "torch.autograd.Variable", "torch.load" ] ]
Build-Week-Med-Cabinet-4/Datascience
[ "8d4485f804f4f138814f8fcb327f6a09e5bb6a7a" ]
[ "strain_api/models.py" ]
[ "import os\nimport sys\n\n# Path restructure for imports\nscript_dir = os.path.dirname( __file__ )\nmain_dir = os.path.join( script_dir, '..' )\nsys.path.append( main_dir )\n\nimport json\nimport pickle\nimport pandas as pd\n\nclass Predictor():\n ''' Class for recommending medical marijuana strains given \"user...
[ [ "pandas.read_csv" ] ]
hvardhan20/pandas
[ "700be617eb567fb4ab82aa8151d5c4ee02c22b95" ]
[ "pandas/tests/tseries/offsets/test_business_day.py" ]
[ "\"\"\"\nTests for offsets.BDay\n\"\"\"\nfrom datetime import (\n date,\n datetime,\n timedelta,\n)\n\nimport numpy as np\nimport pytest\n\nfrom pandas._libs.tslibs.offsets import (\n ApplyTypeError,\n BDay,\n BMonthEnd,\n)\n\nfrom pandas import (\n DatetimeIndex,\n Timedelta,\n _testing ...
[ [ "pandas.tseries.offsets.Day", "pandas._testing.assert_produces_warning", "pandas.tests.tseries.offsets.common.assert_is_on_offset", "pandas._libs.tslibs.offsets.BMonthEnd", "pandas.Timedelta", "pandas.DatetimeIndex", "pandas.tests.tseries.offsets.common.assert_offset_equal", "panda...
tomatenbrei/pomcpp
[ "55522748369bc167420f3ca5b0ecde314ca2fee3" ]
[ "py/pypomcpp/util.py" ]
[ "import pommerman\nfrom pommerman.envs.v0 import Pomme\nimport time\nimport numpy as np\n\ndef ffa_evaluate(env: Pomme, episodes, verbose, visualize, stop=False):\n \"\"\"\n Evaluates the given pommerman environment (already includes the agents).\n\n :param episodes: The number of episodes\n :param verb...
[ [ "numpy.sum", "numpy.empty" ] ]
zhiminch/libvineyard
[ "798b5bbbc26228280ab5585c45d0226bada86be1" ]
[ "python/vineyard/data/dataframe.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2020-2021 Alibaba Group Holding Limited.\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...
[ [ "numpy.expand_dims", "pandas.arrays.SparseArray", "pandas.RangeIndex", "pandas.core.internals.blocks.Block", "pandas.Index", "pandas.DataFrame" ] ]
Anjum48/word-rnn-tensorflow
[ "533c699f20e8b4c6cb6e853af13b271f1249817f" ]
[ "utils.py" ]
[ "# -*- coding: utf-8 -*-\nimport os\nimport codecs\nimport collections\nfrom six.moves import cPickle\nimport numpy as np\nimport re\n\n\nclass TextLoader:\n def __init__(self, data_dir, batch_size, seq_length, encoding=None):\n self.data_dir = data_dir\n self.batch_size = batch_size\n self....
[ [ "numpy.load", "numpy.copy", "numpy.save" ] ]
miaoli-psy/Psychophysics_exps
[ "f27ab7027bb4890624fe003bb9459fd74d0bdb9c", "f27ab7027bb4890624fe003bb9459fd74d0bdb9c" ]
[ "src/ms2_uniform_mix_3_main.py", "src/ms2_uniform_prolific_1_main.py" ]
[ "import pandas as pd\n\nfrom src.commons.process_dataframe import insert_new_col, insert_new_col_from_two_cols\nfrom src.commons.process_number import cal_SEM\n\n\ndef get_percent_triplets(percentpairs):\n if percentpairs == 1:\n return 0\n elif percentpairs == 0.5:\n return 0.5\n elif percen...
[ [ "pandas.read_excel" ], [ "pandas.read_excel" ] ]
vuillaut/agnpy
[ "b3c9c09ca59c067f0739510e26e43e2693b42c99" ]
[ "docs/snippets/absorption_snippet.py" ]
[ "import numpy as np\nimport astropy.units as u\nimport astropy.constants as const\nfrom agnpy.targets import SSDisk, SphericalShellBLR, RingDustTorus\nfrom agnpy.absorption import Absorption\nimport matplotlib.pyplot as plt\nfrom agnpy.utils.plot import load_mpl_rc\n\n\n# matplotlib adjustments\nload_mpl_rc()\n\n\n...
[ [ "matplotlib.pyplot.legend", "numpy.logspace", "matplotlib.pyplot.ylim", "matplotlib.pyplot.loglog", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
mssm-labmmol/pypolybuilder
[ "0b6cc8d7c67492e5cbcbc6e6999d7546eb133190" ]
[ "pypolybuilder/OptimizeGeometry.py" ]
[ "'''\nCreated on Apr 20, 2015\n\n@author: vitor\n'''\n\nfrom __future__ import division\nimport sys\nimport time\nimport numpy as np\nimport math\nfrom Polymer import Polymer\nfrom Dendrimer import Dendrimer\nfrom Utils import unit_vector\nfrom Utils import vectorFromAtoms\nfrom Utils import nsteps, nskipLJ, stepLe...
[ [ "numpy.dot", "numpy.multiply", "numpy.linalg.norm", "numpy.cos", "numpy.array" ] ]
spencerkclark/xpartition
[ "7a8bee593637de7c14649c2aab227df213b16ebc" ]
[ "xpartition.py" ]
[ "import functools\nimport math\n\nimport dask.array\nimport numpy as np\nimport xarray as xr\nimport dataclasses\nimport logging\n\nfrom typing import Callable, Dict, Hashable, Sequence, Tuple, Mapping\n\n\n__version__ = \"0.2.0\"\n\n\nRegion = Sequence[Mapping[Hashable, slice]]\nPartition = Sequence[Region]\n\n\nd...
[ [ "numpy.product", "numpy.unravel_index" ] ]
ManuelBuenAbad/snr_ghosts
[ "c7230d4be9b9fe71d342b0929b88f614829ef5e7" ]
[ "routines.py" ]
[ "from __future__ import division\n\nimport numpy as np\n\nfrom numpy import pi, sqrt, log, log10, power, exp\nfrom scipy.integrate import trapz\n\nimport constants as ct\nimport particle as pt\nimport ska as sk\nimport astro as ap\nimport echo as ec\n\n\n# Default Quantities\ndef_D = 1. # [kpc]\ndef_A = 4.*pi*(def...
[ [ "numpy.ones_like", "numpy.abs", "numpy.reshape", "numpy.squeeze", "numpy.log10", "numpy.array" ] ]
wataruhashimoto52/probability
[ "12e3f256544eadea6e863868da825614f4423eb0", "12e3f256544eadea6e863868da825614f4423eb0" ]
[ "tensorflow_probability/python/experimental/nn/variational_base.py", "tensorflow_probability/python/experimental/inference_gym/internal/test_util_test.py" ]
[ "# Copyright 2019 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.nest.assert_same_structure", "tensorflow.compat.v2.convert_to_tensor", "tensorflow.compat.v2.cast", "tensorflow.compat.v2.nest.flatten" ], [ "numpy.array", "numpy.exp", "tensorflow.compat.v2.test.main" ] ]
usamakh20/label-studio
[ "3239a3d04e65c2cd0091568aa0439d103be2970c" ]
[ "label_studio/core/label_config.py" ]
[ "\"\"\"This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.\n\"\"\"\nimport logging\nimport json\nimport pandas as pd\nimport numpy as np\nimport os\nimport xmljson\nimport jsonschema\nimport re\n\nfrom ...
[ [ "numpy.arange", "numpy.random.randn", "pandas.date_range" ] ]
Shakshi3104/tfmars
[ "f34d3fff49d9eabf130cd7c5fb8f7c6d0f12b5e8" ]
[ "src/tfmars/applications/marnasnet/marnasnet_c.py" ]
[ "import tensorflow as tf\nimport math\n\nfrom .blocks import ConvBlock, SkipOperation, RegularConvBlock, MBConvBlock\nfrom ..mobile_inverted_bottleneck import Top, Stem\n\n\n# MarNASNet-C\ndef MarNASNetC(width_coefficient=1.0, depth_coefficient=1.0, depth_divisor=8,\n include_top=True, input_shape=(25...
[ [ "tensorflow.keras.layers.GlobalMaxPooling1D", "tensorflow.keras.layers.GlobalAveragePooling1D", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Input" ] ]
vallsv/pyFAI
[ "64143652c2b219978ec370bf2fa215af01f937c2" ]
[ "pyFAI/units.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Project: Azimuthal integration\n# https://github.com/silx-kit/pyFAI\n#\n# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France\n#\n# Principal author: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>\n#\n# Permission ...
[ [ "numpy.sqrt" ] ]
YIN95/Human-Data-Utils
[ "ed61244a634cb4261f5d055fab1f9f61859304fc" ]
[ "example/generate_stgcn_imu_data.py" ]
[ "import os\nimport sys\nimport pickle\nimport argparse\nimport numpy as np\n\nfrom hmdata import TotalCapture\n\n\ndef action2label(action):\n action = action[:-1]\n if action == 'acting':\n return 0\n elif action == 'freestyle':\n return 1\n elif action == 'rom':\n return 2\n el...
[ [ "numpy.concatenate", "numpy.array" ] ]
pmglab/eDESE
[ "68fbbe429f23011f544cdd34ce09c98a2540f68b" ]
[ "WGCNA/make_gmt_file_for_gprofiler_analysis.py" ]
[ "from sys import argv\nscript,folder=argv\n\nimport pandas as pd\nimport os\nfilename = os.listdir(folder)\nprint(filename)\n#filename.remove(\".gmt.gmt\")\nall_gene = []\nfor item in filename:\n if \"grey\" not in item:\n print(item)\n genes = pd.read_table(folder+item)\n genes = genes.iloc...
[ [ "pandas.read_table" ] ]
SBCV/SatelliteSurfaceReconstruction
[ "24aa67ace67e69568cbc7e01a9e8b407463366f4" ]
[ "ssr/ext/plyfile.py" ]
[ "# Copyright 2014 Darsh Ranjan\n#\n# This file is part of python-plyfile.\n#\n# python-plyfile is free software: you can redistribute it and/or\n# modify it under the terms of the GNU General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your ...
[ [ "numpy.fromfile", "numpy.asarray", "numpy.memmap", "numpy.dtype", "numpy.savetxt", "numpy.array" ] ]
Hitoshi-Nakanishi/ec2
[ "b65905cdfb1a2451ad553fd15b937a7fc48fa9cf" ]
[ "prototypical-networks/protonets/data/geometry.py" ]
[ "import os\nimport glob\nfrom functools import partial\nimport numpy as np\nfrom PIL import Image, ImageOps\nimport torch\nfrom torchnet.dataset import ListDataset, TransformDataset\nfrom torchnet.transform import compose\nfrom protonets.data.base import convert_dict, CudaTransform, EpisodicBatchSampler, Sequential...
[ [ "torch.randperm", "numpy.array", "torch.utils.data.DataLoader" ] ]
chibby0ne/pandas
[ "4c9fa96328f479c60b51337fafacbc4aa844e893" ]
[ "pandas/core/aggregation.py" ]
[ "\"\"\"\naggregation.py contains utility functions to handle multiple named and lambda\nkwarg aggregations in groupby and DataFrame/Series aggregation\n\"\"\"\n\nfrom collections import defaultdict\nfrom functools import partial\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n DefaultDict,\n ...
[ [ "pandas.core.dtypes.common.is_list_like", "pandas.core.common.get_callable_name", "pandas.core.base.SpecificationError", "pandas.Series", "pandas.core.indexes.api.Index", "pandas.core.reshape.concat.concat", "pandas.core.dtypes.common.is_dict_like", "pandas.core.dtypes.cast.is_nest...
Alias-Alan/pypsy
[ "f055fe1f4901b654d99d9a776152e8192e014f5f", "f055fe1f4901b654d99d9a776152e8192e014f5f", "f055fe1f4901b654d99d9a776152e8192e014f5f" ]
[ "tests/test_em_dina.py", "demo/demo_sem.py", "psy/cat/tirt.py" ]
[ "# coding=utf-8\nfrom __future__ import print_function, division, unicode_literals\nimport numpy as np\nfrom psy import EmDina, MlDina\nfrom psy.utils import r4beta\n\n\ndef test_em_dina():\n attrs = np.random.binomial(1, 0.5, (5, 60))\n skills = np.random.binomial(1, 0.7, (1000, 5))\n\n g = r4beta(1, 2, 0...
[ [ "numpy.random.binomial" ], [ "numpy.diag", "numpy.array" ], [ "numpy.dot", "numpy.abs", "numpy.linalg.inv", "numpy.concatenate", "numpy.linalg.det", "numpy.round", "numpy.zeros_like", "numpy.identity", "numpy.exp", "numpy.zeros", "numpy.sum" ] ]
AIBrainOrganization/DialoGPT
[ "d7826657ebf629800ad116195521d68bde58bbd0" ]
[ "data/to_tsv.py" ]
[ "from openpyxl import load_workbook\nfrom tqdm import tqdm\n\nimport pandas as pd\n\nimport argparse\n\nimport sys\nsys.path.append('/home/calee/git/dcinside')\nfrom filter import Comment\nfrom filter import filter_rows\nfrom filter import add_tags\nfrom clean import clean_str\n\n\ndef create_rows(xlsxes):\n train...
[ [ "pandas.DataFrame" ] ]
lukaselflein/smamp
[ "2a0a8ce36b16aedd4c6a2bb576ba959061ec4e7e", "2a0a8ce36b16aedd4c6a2bb576ba959061ec4e7e" ]
[ "smamp/extract_bader_charges.py", "smamp/tools.py" ]
[ "\"\"\" Extract atomic charges from Bader Charge Analysis output.\nCopyright 2019 Simulation Lab\nUniversity of Freiburg\nAuthor:\nModified: Lukas Elflein <elfleinl@cs.uni-freiburg.de>\n\"\"\"\n\nimport ase\nfrom parmed import gromacs\nimport numpy as np\nfrom smamp.insertHbyList import insertHbyList\nimport warnin...
[ [ "numpy.array", "numpy.where", "numpy.unique", "numpy.genfromtxt" ], [ "pandas.read_csv" ] ]
highlando/krypy
[ "28db03c8b305d8f907a17dc7dbddfdb79b33e362" ]
[ "example.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy\nfrom krypy.linsys import LinearSystem, Gmres\n\nlinear_system = LinearSystem(A=numpy.diag([1e-3]+range(2, 101)),\n b=numpy.ones((100, 1)))\nsol = Gmres(linear_system)\n\n# plot residuals\nfrom matplotlib import pyplot\n\n# use tex\nfrom matplotli...
[ [ "matplotlib.pyplot.semilogy", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.ones", "matplotlib.pyplot.xlabel", "matplotlib.rc", "matplotlib.pyplot.ylabel" ] ]
l8orre/nxtPwt
[ "8b775da8223f1afe1ed4ba3e3ca911876a424ce9" ]
[ "nxtPwt/nxtModels.py" ]
[ "\n\nfrom PyQt4.QtCore import QObject ,QAbstractTableModel, pyqtSignal, pyqtSlot, SIGNAL, QModelIndex , Qt\nfrom PyQt4.Qt import *\nfrom PyQt4.QtGui import QColor, QPixmap, QIcon\n\nimport time\nfrom PyQt4.QtCore import QObject , pyqtSignal, pyqtSlot, SIGNAL\nfrom copy import copy\nimport numpy as np\nfrom nxt...
[ [ "numpy.int64", "numpy.uint64", "numpy.searchsorted", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.vstack" ] ]