repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
0xbadc0ffe/FedSimulate
[ "1dfa6554c341ea46c02986fca1b61148ea8cd1f3" ]
[ "FedSimulate.py" ]
[ "from __future__ import print_function, division\nfrom cProfile import label\nfrom logging import raiseExceptions\n\nfrom typing import Mapping, Union, Optional, Callable, Dict\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport os\nfrom tqd...
[ [ "matplotlib.pyplot.legend", "numpy.sum", "matplotlib.pyplot.title", "torch.zeros", "torch.argmax", "matplotlib.pyplot.plot", "numpy.random.uniform", "matplotlib.pyplot.ylabel", "numpy.round", "torch.arange", "torch.device", "matplotlib.pyplot.xlabel", "matplotli...
ygCoconut/volume2stl
[ "bd95fc39620afd21ce08c8c805ac213583d9daaa" ]
[ "1_benchmarking/spinecode/skel.py" ]
[ "import os\nimport collections\nfrom collections import namedtuple\n\nimport scipy.sparse as sp\nfrom scipy.sparse import csgraph\nfrom scipy.spatial import KDTree\nfrom scipy.ndimage.morphology import distance_transform_edt\nimport numpy as np\nimport h5py\nimport kimimaro\nimport cloudvolume as cv\n\nfrom . impor...
[ [ "numpy.hstack", "scipy.sparse.csgraph.depth_first_order", "numpy.nonzero", "scipy.sparse.csgraph.breadth_first_order", "numpy.ones", "numpy.all", "scipy.spatial.KDTree", "numpy.argmin", "numpy.argmax", "numpy.zeros", "numpy.isin", "scipy.ndimage.morphology.distance_...
zakharovas/RecSys2018
[ "f58ed6716213267ad2cde30d1ff677abc5da96ba" ]
[ "recsys/svd_pp/model.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\nfrom json import loads\nfrom json import dumps\n\nfrom tqdm import tqdm\nfrom itertools import count\nfrom functools import partial\n\n\n# Model params:\nuser_count = 17259\nitem_count = 2149247\n\nbatch_size = 10000\n\nfactor_dim = 32\n\n# Dataset initialization:\n\n...
[ [ "tensorflow.get_variable", "tensorflow.multiply", "tensorflow.zeros", "tensorflow.sigmoid", "tensorflow.placeholder", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.train.AdamOptimizer", "tensorflow.Session", "tensorflow.nn.embedding_lookup...
ndow33/DS-Unit-3-Sprint-2-SQL-and-Databases
[ "14cfe850e68e134057fe56c1fea99c32c4473859" ]
[ "module2-sql-for-analysis/titanic.py" ]
[ "import os\nimport psycopg2\nfrom psycopg2.extras import DictCursor\nfrom psycopg2.extras import execute_values\nfrom dotenv import load_dotenv\nimport pandas as pd\nimport json\nimport numpy as np\n\nload_dotenv() # reads the contents of the .env file and adds them to the environment\n\npsycopg2.extensions.registe...
[ [ "pandas.read_csv" ] ]
Noonewin/ML_scripts
[ "a7019a2c8f138f3622979afd05d435dbeb319f15" ]
[ "clustering/clustering.py" ]
[ "import os\nimport sys\nimport scipy as sp\nfrom matplotlib.mlab import dist\nfrom sklearn.feature_extraction.text import CountVectorizer\n\nvectorizer = CountVectorizer(min_df=1)\n\n# content = [\"How to format my hard disk\", \" Hard disk format problems \"]\n# X = vectorizer.fit_transform(content)\n# print(vecto...
[ [ "sklearn.feature_extraction.text.CountVectorizer", "matplotlib.mlab.dist" ] ]
milwaukee-city-data/budget
[ "1e07b72d0d58abf2e2dcef875d52e1a2af07b252" ]
[ "carceral/trend_with_rate.py" ]
[ "import csv\nimport os\n\nfrom scipy.signal import savgol_filter\n\nfrom gwpy.time import to_gps\nfrom gwpy.timeseries import TimeSeries\n\nfrom matplotlib import use\nuse(\"Agg\")\n\nfrom matplotlib import font_manager, pyplot, rcParams\n\n\n# set font properties\nfont_dir = os.path.join(os.environ[\"HOME\"], \"Do...
[ [ "matplotlib.font_manager.fontManager.addfont", "matplotlib.use", "matplotlib.pyplot.subplots", "scipy.signal.savgol_filter", "matplotlib.font_manager.findSystemFonts" ] ]
ogierpaul/suricate
[ "fd43627e5d2a92fe4bf7b562f65ab89ec07ee49c" ]
[ "tests/pipeindexer/test_pruningpipe.py" ]
[ "from suricate.pipeline.pruningpipe import PruningPipe\nfrom suricate.data.companies import getXst, getytrue\nfrom suricate.explore import Explorer, KBinsCluster\nfrom suricate.dftransformers import DfConnector, VectorizerConnector, ExactConnector\nfrom suricate.sbstransformers import SbsApplyComparator\nfrom sklea...
[ [ "sklearn.pipeline.FeatureUnion", "sklearn.linear_model.LogisticRegressionCV", "sklearn.metrics.balanced_accuracy_score", "sklearn.metrics.precision_score", "sklearn.impute.SimpleImputer", "pandas.datetime.now", "sklearn.metrics.recall_score" ] ]
Titousensei/pytext-1
[ "6ea5ce52f5070fc10ac20732f994296c4d445207" ]
[ "pytext/models/representations/pure_doc_attention.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nfrom typing import Any, Optional, Union\n\nimport torch\nimport torch.nn as nn\nfrom pytext.config import ConfigBase\nfrom pytext.models.decoders.mlp_decoder import MLPDecoder\nfrom pytext.models.module import create_mo...
[ [ "torch.nn.Dropout" ] ]
LeonOtis/pyscf
[ "98ba8106396ac4c90dc65207059773ce048b0ebf", "98ba8106396ac4c90dc65207059773ce048b0ebf" ]
[ "pyscf/scf/test/test_uhf.py", "pyscf/dft/r_numint.py" ]
[ "#!/usr/bin/env python\n# Copyright 2014-2019 The PySCF Developers. 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/LIC...
[ [ "numpy.random.random", "numpy.allclose", "numpy.random.seed", "numpy.einsum", "numpy.arange", "numpy.eye", "numpy.linalg.norm", "numpy.array", "numpy.zeros", "numpy.trace" ], [ "numpy.einsum", "numpy.asarray", "numpy.empty_like", "numpy.ndarray", "nu...
zouwenjiao/DSCI_522_Group304
[ "fe03bcff23cced5b9934e959355e3bb4e4af007d" ]
[ "src/add_subgroup_info.py" ]
[ "# author: Group 304 (Anny Chih)\n# date: 2020-02-04\n\n\"\"\"This script takes in a cleaned datafile and \nadds a column of values indicating if the school has BOTH Aboriginal and Non Aboriginal Students\n\nUsage: add_subgroup_info.py --clean_data=<clean_data> --new_data=<new_data> \n\nOptions:\n--clean_data=<clea...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
alphadadajuju/online_action_two_stream
[ "b6d717f89e5c36b3c7929b651b30fb1125fc5d42" ]
[ "train-ucf24.py" ]
[ "\n\"\"\" Adapted from:\n @longcw faster_rcnn_pytorch: https://github.com/longcw/faster_rcnn_pytorch\n @rbgirshick py-faster-rcnn https://github.com/rbgirshick/py-faster-rcnn\n Which was adopated by: Ellis Brown, Max deGroot\n https://github.com/amdegroot/ssd.pytorch\n\n Further:\n Updated by Gurk...
[ [ "torch.optim.lr_scheduler.MultiStepLR", "torch.set_default_tensor_type", "torch.cuda.synchronize", "numpy.hstack", "torch.ones", "numpy.random.seed", "torch.load", "torch.zeros", "torch.manual_seed", "numpy.asarray", "torch.utils.data.DataLoader", "torch.cuda.manual...
mohamedameen93/An-Autonomous-Vehicle-System-For-Udacity-s-Carla
[ "a7ecd632c5f91f2d6037cbcb0cabff94e6e74869" ]
[ "ros/src/tl_detector/light_classification/tl_classifier.py" ]
[ "import tensorflow as tf\nfrom styx_msgs.msg import TrafficLight\n\n\nPROTOBUG_GRAPH_FILE = 'light_classification/retrained_SSD/frozen_inference_graph.pb'\n\n\nclass TLClassifier(object):\n def __init__(self):\n graph = tf.Graph()\n with graph.as_default():\n od_graph_def = tf.GraphDef()...
[ [ "tensorflow.Graph", "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "tensorflow.Session", "tensorflow.GraphDef" ] ]
haokui/octobus
[ "66ba4aaf24cc43cee0f1fec226df09a451b513c1" ]
[ "octobus/base.py" ]
[ "\"\"\"\ncore APIs of the data models\n\"\"\"\nfrom collections import defaultdict\nimport numpy as np\nimport pandas as pd\n\n\nclass FeatureSet:\n \"\"\"\n currently, just a named list of feature names\n \"\"\"\n def __init__(self, feature_names=None, name=None):\n self.feature_names = feature_...
[ [ "pandas.concat", "pandas.Series" ] ]
rajvi-tiwari/Vision_for_trash_bot
[ "6ea82d0281d5ef1f6bbc6ad1bce07b43d74cff13" ]
[ "Object_detection_video.py" ]
[ "# This program uses a TensorFlow-trained classifier to perform object detection.\r\n# It loads the classifier and uses it to perform object detection on a video.\r\n# It draws boxes, scores, and labels around the objects of interest in each\r\n# frame of the video.\r\n\r\n## Some of the code is copied from Google'...
[ [ "tensorflow.Graph", "numpy.expand_dims", "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "numpy.squeeze", "tensorflow.Session", "tensorflow.GraphDef" ] ]
chahuja/aisle
[ "08d854f837767129eb454d32db8814d3b51a071e" ]
[ "src/data/transform.py" ]
[ "import os\nimport sys\nsys.path.append(os.path.dirname(os.path.abspath(__file__)))\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport pickle as pkl\nfrom pathlib import Path\nfrom tqdm import tqdm\nfrom pathlib import Path\nimport sklearn.cluster\nimport sklearn.mixture\nimport...
[ [ "torch.linspace", "torch.ones", "torch.Tensor", "torch.cat", "torch.zeros", "torch.utils.data.DataLoader", "torch.from_numpy", "torch.zeros_like", "torch.no_grad", "numpy.array" ] ]
sarmstr5/kaggle_intel_mobleODT_cervix_classification
[ "800e713a30827fc3701525b8e64c39ae97b7634a" ]
[ "src/data_explore.py" ]
[ "import platform\nimport os, pickle\nimport pandas as pd\n\n\n\n\ndef get_file_paths():\n if 'c001' in platform.node(): \n# colfax cluster\n abspath_dataset_dir_train_1 = '/data/kaggle/train/Type_1'\n abspath_dataset_dir_train_2 = '/data/kaggle/train/Type_2'\n abspath_dataset_dir_train_3 =...
[ [ "pandas.Series", "pandas.DataFrame" ] ]
BloodAxe/segmentation-networks-benchmark
[ "2e3feb560102230be9369ab442b4a59cc86dff61" ]
[ "lib/models/dilated_linknet.py" ]
[ "from torch import nn\nimport torch\nfrom torchvision import models\nimport torchvision\nfrom torch.nn import functional as F\n\nfrom lib.models.dilated_resnet import dilated_resnet34\n\n\nclass DecoderBlockLinkNet(nn.Module):\n def __init__(self, in_channels, n_filters):\n super().__init__()\n\n s...
[ [ "torch.nn.Dropout2d", "torch.nn.ConvTranspose2d", "torch.nn.Conv2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
manishgit138/numcodecs
[ "322baaca4162c43a6e37d4f4c0d0f0fd51faa554" ]
[ "numcodecs/tests/test_shuffle.py" ]
[ "from multiprocessing import Pool\nfrom multiprocessing.pool import ThreadPool\n\n\nimport numpy as np\nimport pytest\n\n\ntry:\n from numcodecs.shuffle import Shuffle\nexcept ImportError: # pragma: no cover\n pytest.skip(\n \"numcodecs.shuffle not available\", allow_module_level=True\n )\n\n\nfrom...
[ [ "numpy.linspace", "numpy.random.choice", "numpy.arange", "numpy.frombuffer", "numpy.random.normal", "numpy.array", "numpy.random.randint" ] ]
beark007/smarts_ppo
[ "8f6aa33a6fcfb74dc0b8e92951d6b70d6e2874de" ]
[ "benchmark/agents/maac/tf_policy.py" ]
[ "# MIT License\n#\n# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without ...
[ [ "numpy.product", "numpy.eye", "numpy.concatenate", "numpy.zeros_like", "numpy.zeros" ] ]
thcasey3/DeerLab
[ "27ff814fb8c2771740bd7928f283c1f70e88215c" ]
[ "deerlab/model.py" ]
[ "# model.py - DeerLab's modelling interface\r\n# ---------------------------------------------------------------------------\r\n# This file is a part of DeerLab. License is MIT (see LICENSE.md). \r\n# Copyright(c) 2019-2021: Luis Fabregas, Stefan Stoll and other contributors.\r\n\r\nimport numpy as np\r\nfrom scipy...
[ [ "numpy.diag", "numpy.expand_dims", "numpy.asarray", "numpy.squeeze", "numpy.concatenate", "numpy.all", "numpy.any", "numpy.where", "numpy.testing.assert_equal", "numpy.hstack", "numpy.unique", "numpy.arange", "numpy.linalg.slogdet", "numpy.full", "numpy....
loosolab/Datenanalyse-2021
[ "2a94f6153a504bd6f1ee205eeeab279b20fb847d" ]
[ "wp3/DefiningTF.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jan 20 19:51:13 2022\n\n@author: Moritz Hobein\n\"\"\"\nimport pandas as pd\nimport argparse\n\n#parser for using the tool via command-line interface\ndef cliParser():\n parser = argparse.ArgumentParser(description='Script to extract the transcription factors that...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
maslankam/Photometric-Stereo-Assistent
[ "e3af46c8a984df10f37747b77630cdb5125e0b7f" ]
[ "Include/project/light_model.py" ]
[ "from Include.project.segment import Segment\nfrom Include.project.image_reader import ImageReader\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom pathlib import Path\nfrom mpl_toolkits.mplot3d import Axes3D\nimport shutil\n\nimport os, cv2, csv, math\n\n\nclass LightModel(Segment):\n \"\"\"LightMod...
[ [ "numpy.dot", "matplotlib.pyplot.ylim", "numpy.max", "matplotlib.pyplot.xlim", "matplotlib.pyplot.grid", "matplotlib.pyplot.quiver", "numpy.ndenumerate", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
pavansainov15/MatchPrediction
[ "79a3782dae086586ac699947d66c75f7286ede1d" ]
[ "scrape_data.py" ]
[ "import pandas as pd\nfrom bs4 import BeautifulSoup\nimport requests\n\n# For player ranks\nurl = 'http://www.cricmetric.com/ipl/ranks/'\npd.read_html(requests.get(url).content)[-1].to_csv(\"./Dataset/_player_rank.csv\", index=False, header=None)\n\n# Store the sum of EF score by team.\ndata = pd.read_csv('./Datase...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
AroosaIjaz/Mypennylane
[ "40f2219b5e048d4bd93df815811ca5ed3f5327fa" ]
[ "pennylane/plugins/default_gaussian.py" ]
[ "# Copyright 2018 Xanadu Quantum Technologies Inc.\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 applica...
[ [ "numpy.sqrt", "numpy.asarray", "numpy.zeros_like", "numpy.any", "numpy.exp", "numpy.trace", "numpy.hstack", "numpy.arange", "numpy.sin", "numpy.linalg.det", "numpy.block", "scipy.special.factorial", "numpy.zeros", "numpy.cosh", "numpy.linalg.inv", "n...
LiangbeiXu/edm2016
[ "728e3605d1af5113ed75883f11fea2f1271fd427" ]
[ "rnn_prof/run_irt.py" ]
[ "\"\"\"\nScript for running basic online IRT\n\"\"\"\nimport logging\n\nimport numpy as np\nimport pandas as pd\nfrom scipy import sparse as sp\n\nfrom .data.constants import (ITEM_IDX_KEY, TEMPLATE_IDX_KEY, USER_IDX_KEY, CORRECT_KEY,\n CONCEPT_IDX_KEY)\nfrom .data.wrapper import DEFAULT...
[ [ "numpy.random.seed", "scipy.sparse.eye", "pandas.DataFrame", "numpy.concatenate", "numpy.array" ] ]
epfml/relaysgd
[ "536f809f2a5fed5f5004b3f49857d67462ac89d2", "536f809f2a5fed5f5004b3f49857d67462ac89d2" ]
[ "tasks/deit/models.py", "tasks/utils/non_iid_dirichlet.py" ]
[ "# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\n# https://github.com/facebookresearch/deit/blob/cb29b5efd522a0ac83d64aa8b41fe27cead3a030/models.py\nimport torch\nimport torch.nn as nn\nfrom functools import partial\n\nfrom timm.models.vision_transformer import VisionTransformer, _cfg\nfrom ti...
[ [ "torch.zeros", "torch.cat", "torch.nn.Linear", "torch.nn.Identity", "torch.hub.load_state_dict_from_url" ], [ "numpy.split", "numpy.unique", "numpy.cumsum", "numpy.repeat", "numpy.array", "numpy.where", "numpy.random.RandomState" ] ]
juliendehos/nevergrad
[ "b31a66bdc883e29a6c8572e341b4b56cc4157a9d" ]
[ "nevergrad/benchmark/test_plotting.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\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\nfrom . import plotting # pylint: disable=wrong-import-position, wrong-import-order\nfrom unittest.mock import ...
[ [ "numpy.testing.assert_equal", "matplotlib.use", "pandas.DataFrame", "numpy.testing.assert_array_equal", "numpy.testing.assert_almost_equal", "numpy.identity" ] ]
HDI-Project/DataTracer
[ "4bb0906f1716bbcfeb0881cade5d6d47bca90764" ]
[ "datatracer/column_map/basic.py" ]
[ "import logging\n\nfrom sklearn.ensemble import RandomForestRegressor\n\nfrom datatracer.column_map.base import ColumnMapSolver\nfrom datatracer.column_map.transformer import Transformer\n\nLOGGER = logging.getLogger(__name__)\n\n\nclass BasicColumnMapSolver(ColumnMapSolver):\n \"\"\"Basic Solver for the data li...
[ [ "sklearn.ensemble.RandomForestRegressor" ] ]
Tongzhenguo/bpr-spark
[ "5ee01ba09b2dc7247052296b6097eb63d52f0dca" ]
[ "bpr.py" ]
[ "import random\nfrom tqdm import tqdm\nimport numpy as np\n\n\ndef _gradient_single_point(user_id, prod_id, prod_id_neg,\n user_mat, prod_mat, lambda_reg, alpha):\n\n x_uij = user_mat[user_id].dot(prod_mat[prod_id]) - \\\n user_mat[user_id].dot(prod_mat[prod_id_neg])\n\n step_...
[ [ "numpy.random.uniform", "numpy.exp", "numpy.random.randint" ] ]
pierreablin/smica
[ "f56d4fac065f88788a0682e68f0121902601f161" ]
[ "smica/core_smican.py" ]
[ "import numpy as np\n\nfrom sklearn.utils import check_random_state\n\nfrom .core_fitter import CovarianceFitNoise\nfrom .utils import fourier_sampling, itakura\n\neps = 1e-12\n\n\ndef wiener(A, powers, noise_inv):\n '''\n The Wiener filter\n '''\n C = np.linalg.pinv(A.T.dot(noise_inv.dot(A)) +\n ...
[ [ "numpy.diag", "numpy.dot", "numpy.conj", "numpy.linalg.inv", "numpy.arange", "numpy.fft.ifft", "numpy.linalg.pinv", "numpy.mean", "numpy.zeros", "sklearn.utils.check_random_state" ] ]
xuyu0010/ARID_v1
[ "b03d0975f41547e8aa78929b8e26a62248f8e18f" ]
[ "network/inception_v1_i3d.py" ]
[ "import logging\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport os\n# from mmcv.cnn import constant_init, kaiming_init\n# from mmcv.runner import load_checkpoint\n\n# from ...registry import BACKBONES\n# from mmaction.ops.reflection_pad3d import reflection_pad3d\n\ntry:\n from . i...
[ [ "torch.cat", "torch.load", "torch.randn", "torch.nn.MaxPool3d", "torch.nn.Conv3d", "torch.nn.ReLU", "torch.nn.BatchNorm3d", "torch.nn.functional.pad" ] ]
Armandpl/stable-baselines3
[ "59bec3018058300f8892cc12593fcd1bd164ef48" ]
[ "stable_baselines3/common/distributions.py" ]
[ "\"\"\"Probability distributions.\"\"\"\n\nfrom abc import ABC, abstractmethod\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nimport gym\nimport torch as th\nfrom gym import spaces\nfrom torch import nn\nfrom torch.distributions import Bernoulli, Categorical, Normal\n\nfrom stable_baselines3.common....
[ [ "torch.tanh", "torch.finfo", "torch.mm", "torch.ones", "torch.sqrt", "torch.distributions.Bernoulli", "torch.round", "torch.bmm", "torch.distributions.kl_divergence", "torch.ones_like", "torch.nn.Parameter", "torch.zeros_like", "torch.exp", "torch.nn.Linear"...
ksh981214/icml18-jtnn
[ "701c363e24e38a47fc0c4509565fb021b5ba91c6" ]
[ "molopt/optimize.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\n\nimport math, random, sys\nfrom optparse import OptionParser\nfrom collections import deque\n\nimport rdkit\nimport rdkit.Chem as Chem\nfrom rdkit.Chem import Descriptors\nimport sascorer\n\nfrom jtnn import *\n\nlg = rdkit.RDLogger.logger(...
[ [ "torch.load" ] ]
dkaramit/ASAP
[ "afade2737b332e7dbf0ea06eb4f31564a478ee40" ]
[ "Artificial_Neural_Networks/python/FeedForwardANN/FFANN_VanillaSGD.py" ]
[ "from numpy import sqrt as np_sqrt\nfrom numpy import abs as np_abs\nfrom .FFANN_SGD import StochasticGradientDescent\n\nclass VanillaSGD(StochasticGradientDescent):\n '''\n Not the best (far from it) strategy, but the simplest. Will use it to test if the implementation works.\n '''\n def __init__(self,...
[ [ "numpy.abs", "numpy.sqrt" ] ]
TatsukichiShibuya/theoretical_framework_for_target_propagation
[ "b6ee350c238be645e9cb42e12c79606f28f20f11" ]
[ "lib/networks.py" ]
[ "#!/usr/bin/env python3\n# Copyright 2019 Alexander Meulemans\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 requir...
[ [ "torch.randn_like", "torch.mean", "numpy.sqrt", "torch.tanh", "numpy.mean", "torch.norm", "torch.nn.functional.relu", "torch.autograd.grad", "torch.sigmoid", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn.init.xavier_normal_", "torch.nn.Linear", ...
GiftofHermes/queue_simulation
[ "aeb7ef818e1b2671c55d33179a6dc72e67976351" ]
[ "simulation.py" ]
[ "from abc import ABC\r\nimport numpy as np\r\nfrom collections import deque\r\nimport heapq\r\n\r\nclass Simulation:\r\n \"\"\"\r\n Fill here according to python guidelines\r\n \"\"\"\r\n def __init__(self):\r\n self.event_id = 0\r\n self.time = 0.0\r\n self.event_queue = [] #sh...
[ [ "numpy.random.randint" ] ]
jayanthkoushik/cmu-ammml-project
[ "d087924b64f91754addb19ef251b5dececb672e3" ]
[ "src/uniimg.py" ]
[ "# coding=utf-8\n# uniimg.py: unimodal image based classifier.\n\nfrom __future__ import print_function\nimport argparse\nimport sys\nimport os\nimport random\nimport glob\nimport cPickle\nimport math\nfrom datetime import datetime\n\nimport numpy as np\nfrom models.vgg16 import VGG16\nfrom keras.optimizers import ...
[ [ "scipy.misc.imread" ] ]
ajmaurais/peptide_analyzer
[ "62f37d88fefd0a8cfb57a8c157cfc85692956360" ]
[ "complete/main.py" ]
[ "\nimport os\nimport argparse\nimport pandas as pd\n\nimport uniprot\nimport molecular_formula\n\n\n# def main():\n# '''\n# Main method.\n#\n# This is the function which will be executed first when you call the program form the command line.\n# '''\n#\n# # Load and parse command line arguments\n...
[ [ "pandas.read_csv" ] ]
vishalbelsare/h2o-3
[ "9322fb0f4c0e2358449e339a434f607d524c69fa" ]
[ "h2o-py/tests/testdir_sklearn/pyunit_sklearn_classification_all_estimators.py" ]
[ "from __future__ import print_function\nfrom collections import defaultdict\nfrom functools import partial\nimport gc, inspect, os, sys\n\nimport numpy as np\nfrom sklearn.datasets import make_classification\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.model_selection import train_test_split\n\nimport ...
[ [ "numpy.sum", "sklearn.datasets.make_classification", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score" ] ]
aalto-ics-kepaco/lcms2struct_exp
[ "5baa3edd0e58d24f739efd4086031f6fbdba6ad9" ]
[ "data/import_sirius_scores.py" ]
[ "####\n#\n# The MIT License (MIT)\n#\n# Copyright 2021 Eric Bach <eric.bach@aalto.fi>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limita...
[ [ "numpy.max", "numpy.random.RandomState", "numpy.ones_like", "numpy.min" ] ]
lpworld/LatentUnexp
[ "55cfa214733d6fd31f8113b8ae47f83e03984f0d" ]
[ "surprise/similarities.py" ]
[ "\"\"\"\nThe :mod:`similarities <surprise.similarities>` module includes tools to\ncompute similarity metrics between users or items. You may need to refer to the\n:ref:`notation_standards` page. See also the\n:ref:`similarity_measures_configuration` section of the User Guide.\n\nAvailable similarity measures:\n\n....
[ [ "numpy.zeros", "numpy.sqrt" ] ]
glynpu/lhotse
[ "1d7807025575fdaa96cb907c451db0fb0fd23cde" ]
[ "test/cut/test_cut_mixing.py" ]
[ "from math import isclose\n\nimport numpy as np\nimport pytest\n\nfrom lhotse.cut import CutSet, MixedCut, MonoCut\nfrom lhotse.supervision import SupervisionSegment\nfrom lhotse.testing.dummies import remove_spaces_from_segment_text\nfrom lhotse.utils import nullcontext as does_not_raise\n\n\n# Note:\n# Definition...
[ [ "numpy.exp", "numpy.sum" ] ]
lbeltrame/bcbio-nextgen
[ "1135176df8cb6a47ae39f997ffa4eaac17f8b4ff" ]
[ "bcbio/ngsalign/tophat.py" ]
[ "\"\"\"Next-gen alignments with TopHat a spliced read mapper for RNA-seq experiments.\n\nhttp://tophat.cbcb.umd.edu\n\"\"\"\nimport os\nimport shutil\nimport glob\nimport subprocess\n\nimport numpy\nimport pysam\n\nfrom bcbio.pipeline import config_utils\nfrom bcbio.ngsalign import bowtie, bowtie2\nfrom bcbio.utils...
[ [ "numpy.median" ] ]
ewulczyn/ewulczyn.github.io
[ "8e77b3a9a6a484696678f5b937b12f5742c05e99" ]
[ "ipython/How_Naive_AB_Testing_Goes_Wrong/abstract_abtest.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom abtest_util import SimStream\nfrom abc import ABCMeta, abstractmethod\n\nclass ABTest(object):\n \"\"\"\n This is the base class for dynamically\n terminating AB tests. The idea is that you define\n a stopping crietion and e...
[ [ "numpy.percentile", "numpy.mean", "pandas.DataFrame.from_records", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
janzmazek/langerhansGUI
[ "aa0f3f1636f96964f2172383aadb734a71bc4885" ]
[ "langerhansGUI/view.py" ]
[ "import tkinter as tk\nfrom tkinter import messagebox\nfrom tkinter import filedialog\nfrom tkinter.ttk import Progressbar\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\nimport copy\nimport webbrowser\n\n\n# Window parameters\nWIDTH = 1000\nHEIGHT = 600\n\nWHITE = \"white\"\nTEXT = \"white\"\n# B...
[ [ "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg" ] ]
mrbermell/ffai
[ "8b70faf615fc70eb40aa8b3519a7d2339872ea15" ]
[ "tests/performance/run_env.py" ]
[ "#!/usr/bin/env python3\n\nimport gym\nimport numpy as np\nimport botbowl\nfrom botbowl.core.game import Game\nfrom botbowl.core.model import Agent\n\nimport cProfile\nimport io\nimport pstats\n\n\ndef profile_and_print_result(function, sortkey=\"tottime\"):\n \"\"\"\n Choose sortkey from: 'ncalls', 'tottime'...
[ [ "numpy.random.RandomState" ] ]
nesl/DeepCEP_DAIS
[ "04dbfefe3c42d74836035a73bfbcd51eebc7992d" ]
[ "detection.py" ]
[ "import os\nimport time\nimport cv2\nimport numpy as np\nfrom yolo.yolo_model import YOLO\n\ndef process_image(img):\n \"\"\"Resize, reduce and expand image.\n\n # Argument:\n img: original image.\n\n # Returns\n image: ndarray(64, 64, 3), processed image.\n \"\"\"\n image = cv2.resize(...
[ [ "numpy.array", "numpy.expand_dims", "numpy.floor" ] ]
thompson318/arucochristmas
[ "0cf6e2f646ae4d0380aa1330b155418db2449ad1" ]
[ "arucochristmas/aruco.py" ]
[ "\"\"\" Module to provide the aruco tracking logic \"\"\"\n#pylint:disable=import-error\nimport numpy as np\nfrom picamera import PiCamera\nfrom picamera.array import PiRGBArray\nfrom sksurgeryarucotracker.arucotracker import ArUcoTracker\n\n\ndef init_camera_and_tracker():\n \"\"\"\n Initialises an sksurgery...
[ [ "numpy.array" ] ]
alfa-th/lang-modeler-pytorch
[ "a13e94841df9fc3996b33a93d0a58a99c0596359" ]
[ "transformer/main.py" ]
[ "import time\nimport math\nimport copy\n\nfrom torchtext.datasets import WikiText2\nimport torch.nn as nn\nimport torch\n\nfrom functions import evaluate, train\nfrom dataset import get_vocab, get_processed_data, get_tokenizer\nfrom classes.transformer_model import TransformerModel\n\ntokenizer = get_tokenizer(\"ba...
[ [ "torch.device", "torch.nn.CrossEntropyLoss", "torch.optim.lr_scheduler.StepLR" ] ]
mcsorkun/Genetic-Selection-Cheminformatics
[ "6f85cd26ffc0aa00b8c34c6d482a2a5f4de149ae" ]
[ "AqSolDB_example.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue May 26 18:35:38 2020\r\n\r\n@author: Murat Cihan Sorkun\r\n\r\nFeature Selection by Genetic Algorithm: An example on AqSolDB dataset (Aqueous Solubility) \r\n\"\"\"\r\n\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.neural_network import ...
[ [ "pandas.read_csv", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.neural_network.MLPRegressor" ] ]
neurotechdk/fnirs-bci
[ "fa7d757dad2060b8acc6e64a51968707b45aa120" ]
[ "code/exp_bci_task.py" ]
[ "from sklearn.model_selection import KFold\r\nfrom sklearn.metrics import f1_score\r\nfrom sklearn.metrics import confusion_matrix\r\nfrom helper_functions import *\r\nfrom helper_functions import preprocess, visualize_loss, show_plot\r\nimport warnings\r\nfrom icecream import ic\r\nic(\"Importing packages...\")\r\...
[ [ "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.layers.Dense", "tensorflow.keras.preprocessing.timeseries_dataset_from_array", "numpy.load", "numpy.repeat", "tensorflow.keras.callbacks.EarlyStopping", "tensorflow.keras.models.Sequential" ] ]
phillipi/AMT_Real_vs_Fake
[ "4f5f25cdaffc8ee8c0a3ccd186f6ff45beb0c5c9" ]
[ "process_csv.py" ]
[ "\nimport numpy as np\nimport csv\nfrom collections import OrderedDict\nimport argparse\nfrom tqdm import tqdm\n\nfrom IPython import embed\n\ndef collect_csv_results(filename):\n\twith open(filename, newline='') as csvfile:\n\t\treader = csv.DictReader(csvfile)\n\t\tfor rr,row in enumerate(reader):\n\t\t\tif(rr==0...
[ [ "numpy.setdiff1d", "numpy.max", "numpy.std", "numpy.argmax", "numpy.mean", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.random.randint" ] ]
jalilm/SDN-Monitoring
[ "4ba8dd0f0ed5e44c0e803713d6c82ee2c815c7e4" ]
[ "util/get_percentage_plots.py" ]
[ "#!/usr/bin/env python\n\nimport glob\nimport os\n\nimport matplotlib.pyplot as plt\n\n\ndef main():\n res_per_k = {}\n for fn in glob.glob(os.path.expanduser('~/logs/') + '*-Topk-*'):\n if os.path.isfile(fn):\n # bfn = os.path.basename(fn)\n # mechanism, topk, rate, directory, ti...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
pavanchhatpar/AttnGAN
[ "9a4ac53aee9890ad488f11aeb913623d2c93a6b2" ]
[ "code/trainer.py" ]
[ "from __future__ import print_function\nfrom six.moves import range\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.autograd import Variable\nimport torch.backends.cudnn as cudnn\n\nfrom PIL import Image\n\nfrom miscc.config import cfg\nfrom miscc.utils import mkdir_p\nfrom miscc.uti...
[ [ "torch.cuda.set_device", "torch.load", "torch.from_numpy", "torch.FloatTensor", "numpy.transpose", "numpy.repeat" ] ]
vibhoothi/awcy
[ "172edeeca8c331d63ee72f6a3928fc6b2965d845" ]
[ "dump_convex_hull.py" ]
[ "#!/usr/bin/env python3\n\nfrom __future__ import print_function\n\nfrom numpy import *\nimport numpy as np\nfrom scipy import *\nfrom scipy.interpolate import interp1d\nfrom scipy.interpolate import pchip\nfrom scipy.interpolate import BPoly\nfrom scipy._lib._util import _asarray_validated\nimport sys\nimport os\n...
[ [ "numpy.flipud" ] ]
RichardJ112/nebula_dynamic_2021
[ "6e120f4562e46cd02d981e75aa4238d16ee0e9c8" ]
[ "nebula_test_files/vox_tri_pri/gen_pri_wall.py" ]
[ "import numpy as np\nimport os\n\n# Point exposure for Wall Depositions\n\n#Automation Additions\nHPC_toggle = False\nmulti_run_folder_toggle = False# single or multi folder (True is multi,False is single)\ndesktop_toggle = True\n\ndate = \"/20_8_2021/\"\n\n# Parameters Geom\nvoxel_size = 0.3; # voxel size in nanom...
[ [ "numpy.linspace", "numpy.dtype", "numpy.random.normal", "numpy.zeros", "numpy.empty" ] ]
mcx/tensorflow
[ "d7e521a1ad21681855b439b9c2a05837c804e488" ]
[ "tensorflow/python/distribute/sharded_variable_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.compat.v2_compat.enable_v2_behavior", "tensorflow.python.framework.tensor_shape.TensorShape", "tensorflow.python.distribute.distribution_strategy_context._get_default_strategy", "tensorflow.python.distribute.test_util.TestClusterParams", "tensorflow.python.ops.variables.Vari...
tonyw/antares
[ "6c2c505ab73d25b2f40831898a10bbf09602a4a0" ]
[ "platforms/c-rocm/schedule/standard/batch_matmul_v1.py" ]
[ "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\nimport numpy as np\nfrom tvm import te\nimport logging\nimport sys, time, subprocess\n\n\nimport json\nimport os\n\n\ndef schedule(attrs):\n cfg, s, output = attrs.auto_config, attrs.scheduler, attrs.outputs[0]\n th_vals, rd_vals = ...
[ [ "numpy.product" ] ]
hogikyan/xarrayutils
[ "a0c583113665882e70fce8590a90a5b2fff176c3" ]
[ "xarrayutils/plotting.py" ]
[ "import numpy as np\nimport xarray as xr\nimport matplotlib.pyplot as plt\nimport gsw\n\n\ndef center_lim(ax, which='y'):\n if which == 'y':\n lim = np.array(ax.get_ylim())\n ax.set_ylim(np.array([-1, 1]) * abs(lim).max())\n elif which == 'x':\n lim = np.array(ax.get_xlim())\n ax.s...
[ [ "matplotlib.pyplot.gca", "numpy.linspace", "numpy.meshgrid", "matplotlib.pyplot.gcf", "numpy.diff", "matplotlib.pyplot.text", "numpy.array" ] ]
rluver/ocr_attention_tensorflow
[ "448876d809bd6f80d7fae00ebdbbc9222046ddb4" ]
[ "inference.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Jul 31 23:13:26 2021\n\n@author: MJH\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nfrom model import OCR_Attention\nfrom auxiliary import decode_batch_predictions, encode_single_sample\nfrom tensorflow.keras.models import Mode...
[ [ "tensorflow.data.Dataset.from_tensor_slices", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
MLO-lab/MuVI
[ "98796ab6deab225adc3add75e20c4b51f842f529" ]
[ "muvi/core/index.py" ]
[ "import numpy as np\n\n\ndef _normalize_index(indexer, index, as_idx=True):\n # work with ints, convert at the end\n # if single str, get idx and put to list\n # TODO: can be an issue if any of the indices is named 'all'..\n if isinstance(indexer, str):\n if indexer == \"all\":\n index...
[ [ "numpy.array", "numpy.where" ] ]
czlwang/groundedSCAN
[ "3d03ac6de37dde8d22d487dc3cc5a53af188fa2e" ]
[ "GroundedScan/gym_minigrid/minigrid.py" ]
[ "import math\nimport gym\nfrom enum import IntEnum\nimport numpy as np\nfrom gym import spaces\nfrom gym.utils import seeding\n\n# Size in pixels of a cell in the full-scale human view\nCELL_PIXELS = 60\n\n# Map of color names to RGB values\nCOLORS = {\n 'red': np.array([128, 0, 0]),\n 'green': np.array([46, ...
[ [ "numpy.array", "numpy.zeros", "numpy.array_equal" ] ]
blakeNaccarato/boilerdaq
[ "bc39074237c42d94c5402327495f05ff662e7a35" ]
[ "src/boilerdaq.py" ]
[ "\"\"\"Data acquisition and control of a boiler.\"\"\"\n\nfrom __future__ import annotations\n\nimport os\nfrom collections import OrderedDict, deque\nfrom csv import DictReader, DictWriter\nfrom datetime import datetime, timedelta\nfrom os.path import splitext\nfrom threading import Thread\nfrom time import sleep\...
[ [ "numpy.random.normal", "numpy.exp" ] ]
KiroSummer/AMR
[ "49f4edc9e738ba3409d2d5e45e5e1881d8b338cc" ]
[ "parser/decoder.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torch.nn import Parameter\nfrom parser.data import NIL, PAD\nfrom parser.utils import compute_f_by_tensor\nfrom parser.transformer import MultiheadAttention, Transformer, TiedTransformer\n\nfrom parser.utils import label_smoothed_nll_loss\n\...
[ [ "torch.ge", "torch.max", "torch.nn.functional.log_softmax", "torch.nn.functional.dropout", "torch.nn.init.constant_", "torch.cat", "torch.eq", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.nn.init.normal_", "torch.log", "torch.scatter_add", "torch.ne" ] ]
sugarchain-dev/electrum-sugar
[ "5c70bfa883950bb501625916a888618792cd635b" ]
[ "electrum/plot.py" ]
[ "import datetime\nfrom collections import defaultdict\n\nimport matplotlib\nmatplotlib.use('Qt5Agg')\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as md\n\nfrom .i18n import _\nfrom .bitcoin import COIN\n\n\nclass NothingToPlotException(Exception):\n def __str__(self):\n return _(\"Nothing to ...
[ [ "matplotlib.pyplot.gca", "matplotlib.dates.DateFormatter", "matplotlib.use", "matplotlib.pyplot.subplots", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel" ] ]
tchayintr/thwcc-attn
[ "4ee38365eb338e82bf455f46ff5fe7c59fb7a975" ]
[ "src/models/rnn_with_chunk_sw_tagger.py" ]
[ "from allennlp.modules.conditional_random_field import ConditionalRandomField\nfrom allennlp.nn.util import get_mask_from_sequence_lengths\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pad_sequence\n\nimport sys\n\nimport constants\nimport ...
[ [ "torch.div", "torch.nn.CrossEntropyLoss", "torch.nn.functional.softmax", "torch.ones", "torch.transpose", "torch.nn.Module.__init__", "torch.cat", "torch.nn.functional.dropout", "torch.zeros", "torch.nn.utils.rnn.pad_sequence", "torch.sum", "torch.unsqueeze", "t...
ietheredge/VisionEngine
[ "271c8dcaef6eb574e9047fca436d7b13cab75d3b" ]
[ "VisionEngine/utils/eval.py" ]
[ "import tensorflow as tf\nimport math\n\n\ndef embed_images(x, model):\n outputs = [\n model.model.get_layer(\"variational_layer\").output,\n model.model.get_layer(\"variational_layer_1\").output,\n model.model.get_layer(\"variational_layer_2\").output,\n model.model.get_layer(\"varia...
[ [ "tensorflow.losses.mean_squared_error", "tensorflow.exp", "tensorflow.keras.Model", "tensorflow.sqrt", "tensorflow.keras.layers.Flatten" ] ]
mengzaiqiao/MultiObjectiveOptimization
[ "7085638b3918506836118f88fed8bb2f8994a499" ]
[ "multi_task/metrics.py" ]
[ "# Adapted from: https://github.com/meetshah1995/pytorch-semseg/blob/master/ptsemseg/metrics.py\n\nfrom losses import l1_loss_instance\nimport numpy as np\n\nclass RunningMetric(object):\n def __init__(self, metric_type, n_classes =None):\n self._metric_type = metric_type\n if metric_type == 'ACC':...
[ [ "numpy.diag", "numpy.zeros", "numpy.sum", "numpy.nanmean" ] ]
wasiahmad/community_question_answering
[ "73d13bc1cdf2ea66d13209c007dcc2767cf2155c" ]
[ "senteval/examples/all.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\n\"\"\"\nInferSent models. See https://github.com/facebookresearch/InferSent.\n\"\"\"\n\nfrom __future__ import abso...
[ [ "numpy.concatenate" ] ]
gan3sh500/keras-YOLOv3-model-set
[ "1a1108c52073c01c130618dc68607f455adadf28" ]
[ "common/utils.py" ]
[ "#!/usr/bin/python3\n# -*- coding=utf-8 -*-\n\"\"\"Miscellaneous utility functions.\"\"\"\n\nfrom PIL import Image\nimport numpy as np\nimport os, cv2, colorsys\nfrom matplotlib.colors import rgb_to_hsv, hsv_to_rgb\nfrom common.backbones.efficientnet import swish\nfrom common.backbones.mobilenet_v3 import hard_sigm...
[ [ "numpy.random.seed", "numpy.around", "tensorflow.config.experimental.list_physical_devices", "numpy.random.shuffle", "tensorflow.config.experimental.VirtualDeviceConfiguration", "tensorflow.ConfigProto", "tensorflow.Session", "numpy.array", "tensorflow.__version__.startswith" ...
werlang/Gas-Station-BinanceSmartChain
[ "4462dfcae2407d4785e333bdc88b0486e1095896" ]
[ "gasPriceApi.py" ]
[ "import time\nimport sys\nimport json\nimport math\nimport traceback\nimport os\nimport pandas as pd\nimport numpy as np\nfrom web3 import Web3, HTTPProvider\nfrom web3.middleware import geth_poa_middleware\n## newly added packages for api\nimport click\nimport logging\nfrom threading import Thread\nfrom sanic impo...
[ [ "numpy.isnan", "numpy.ma.masked_array", "pandas.DataFrame", "pandas.DataFrame.from_dict" ] ]
Storiesbyharshit/Deep-Learning
[ "2464e3354c8c2c99237d76b47264d509cc1a7cef" ]
[ "Deep Learning using Tensorflow Keras/Churn-Model-using-ANN/ANN - Churn Modelling.py" ]
[ "\r\n\r\n# Importing the libraries \r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\n\r\nimport warnings\r\nwarnings.filterwarnings('ignore')\r\nwarnings.filterwarnings(\"ignore\", category=DeprecationWarning)\r\n\r\n\r\n\r\n\r\n\r\n# Importing the datasetm\r\ndataset = pd.read_csv...
[ [ "pandas.read_csv", "sklearn.preprocessing.OneHotEncoder", "sklearn.metrics.confusion_matrix", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.StandardScaler", "sklearn.preprocessing.LabelEncoder" ] ]
mariaborbones/AIF360
[ "05b3d155aa89a1b173ac3f1ec42110a899710cf8" ]
[ "aif360/datasets/standard_dataset.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom logging import warn\n\nimport numpy as np\nimport pandas as pd\n\nfrom aif360.datasets import BinaryLabelDataset\n\n\nclass StandardDataset(BinaryLabelData...
[ [ "numpy.issubdtype", "numpy.array", "numpy.equal.outer", "pandas.get_dummies" ] ]
shfshf/ner_s2s
[ "a04311310bddf396b551969fd1e63fdb3fc2ca0b" ]
[ "ner_s2s/ner_estimator/algorithms/model.py" ]
[ "from pathlib import Path\n\nimport tensorflow as tf\nimport numpy as np\nfrom ner_s2s.metrics import precision, recall, f1, correct_rate\n\n\nclass Model(object):\n @classmethod\n def default_params(cls):\n return {}\n\n @classmethod\n def get_model_name(cls):\n return cls.__name__\n\n ...
[ [ "tensorflow.get_variable", "tensorflow.contrib.lookup.index_table_from_tensor", "tensorflow.metrics.accuracy", "tensorflow.layers.dropout", "numpy.vstack", "tensorflow.train.AdamOptimizer", "tensorflow.contrib.crf.crf_decode", "tensorflow.contrib.crf.crf_log_likelihood", "tenso...
pfriesch/neural-pipeline
[ "2df4f7467a721b1fbd93f4439086c6dcee5dac2c", "2df4f7467a721b1fbd93f4439086c6dcee5dac2c" ]
[ "examples/files/img_classification.py", "neural_pipeline/builtin/monitors/mpl.py" ]
[ "from neural_pipeline.builtin.monitors.tensorboard import TensorboardMonitor\nfrom neural_pipeline import DataProducer, AbstractDataset, TrainConfig, TrainStage,\\\n ValidationStage, Trainer, FileStructManager\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torchvision import dataset...
[ [ "torch.nn.NLLLoss", "torch.nn.functional.log_softmax", "torch.nn.Conv2d", "torch.nn.Linear", "torch.device", "torch.nn.functional.max_pool2d" ], [ "matplotlib.pyplot.cm.get_cmap", "matplotlib.pyplot.subplot", "numpy.mean", "matplotlib.ticker.MaxNLocator", "matplotli...
jyf588/SimGAN
[ "23283d7b5629f1653567b2437bb28aac1cc17169", "23283d7b5629f1653567b2437bb28aac1cc17169" ]
[ "third_party/a2c_ppo_acktr/model_split.py", "third_party/a2c_ppo_acktr/algo/ppo.py" ]
[ "# MIT License\n#\n# Copyright (c) 2017 Ilya Kostrikov and (c) 2020 Google LLC\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitati...
[ [ "numpy.sqrt", "torch.cat", "torch.nn.init.constant_", "torch.nn.Tanh", "torch.nn.Linear" ], [ "torch.exp", "torch.clamp", "torch.max", "torch.min" ] ]
PilmautBotics/Tracking_SSD_ReID
[ "5fa2f83ac48c64dc1be24cc1a156d19ba5908dff" ]
[ "data_management/VOC2012ManagerObjDetection.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nPascal VOC2012 dataset manager\n\"\"\"\n\nimport os\nimport xml.etree.ElementTree as ET\n\nimport numpy as np\nimport tensorflow as tf\n\n\nclass VOC2012ManagerObjDetection:\n def __init__(self, path=\"\", trainRatio=0.7, batch_size=32, floatType=32):\n...
[ [ "tensorflow.clip_by_value", "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.Variable", "tensorflow.math.minimum", "tensorflow.keras.preprocessing.image.load_img", "tensorflow.expand_dims", "tensorflow.repeat", "numpy.array", "tensorflow.keras.preprocessing....
alopezgit/project-adapt
[ "e93ab350344a5504f76f4e460002e0163996f88a" ]
[ "Models/model.py" ]
[ "\"\"\"\nAuthor: Wouter Van Gansbeke\nLicensed under the CC BY-NC 4.0 license (https://creativecommons.org/licenses/by-nc/4.0/)\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.data\nimport torch.nn.functional as F\nimport numpy as np\nfrom .ERFNet import Net\nimport copy\nimport Utils.utils as ut...
[ [ "torch.nn.Softmax", "torch.nn.ConvTranspose2d", "torch.cat", "torch.nn.Conv2d", "torch.nn.Sigmoid", "torch.nn.functional.relu", "torch.nn.functional.interpolate", "torch.nn.BatchNorm2d", "torch.chunk", "torch.nn.ReLU", "torch.nn.functional.max_pool2d" ] ]
sameh999/kalam
[ "7a867c71daa4d230356d0b85fde2e36397ce608a" ]
[ "utils.py" ]
[ "import torch\r\nimport librosa \r\nfrom FastSpeech2.buckwalter import ar2bw, bw2ar\r\n\r\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\r\n\r\ndef load_file_to_data(file, srate = 16_000):\r\n batch = {} \r\n speech, sampling_rate = librosa.load(file, sr=srate)\r\n batch[\"sp...
[ [ "torch.nn.Softmax", "torch.no_grad", "torch.cuda.is_available", "torch.topk", "torch.argmax" ] ]
va9abund/GAN-traffic-sign
[ "a9e7cc1c6839cdb0f29f68a951040fb27c64f738" ]
[ "classifier/train.py" ]
[ "# Python Standard Library\nfrom datetime import datetime\nimport json\nimport os\nimport time\n\n# Public Libraries\nfrom keras.utils import np_utils\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Conv2D, Flatten, Lambda, Dropout, MaxPooling2D\nfrom keras.optimizers import Adam\nfrom keras.u...
[ [ "sklearn.model_selection.train_test_split" ] ]
songhaoyu/RCDG
[ "962c3b5803b766bd25577460aa90c2741d500d99" ]
[ "reinforcement_train/onmt/io/TextDataset.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom collections import Counter\nfrom itertools import chain\nimport io\nimport codecs\nimport sys\n\nimport torch\nimport torchtext\n\nfrom onmt.Utils import aeq\nfrom onmt.io.DatasetBase import ONMTDatasetBase, PAD_WORD, BOS_WORD, EOS_WORD\n\nfrom torch.nn.functional import Variable\nf...
[ [ "torch.LongTensor", "torch.nn.functional.Variable" ] ]
MCZhi/SMARTS
[ "3ef5650b04ac6fb7145cf4e23d5534d73e0929fc" ]
[ "zoo/policies/cross-rl-agent/cross_rl_agent/train/run_test.py" ]
[ "# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rig...
[ [ "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.train.import_meta_graph", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.reset_default_graph", "numpy.mean", "tensorflow.compat.v1.train.Saver", "numpy.sum" ] ]
pesavent/SMC
[ "8e53f73b81798761ef3aad3dc94e550eb83a3d9b" ]
[ "SMC_V3_11302020.py" ]
[ "# This python script was written by a simple biochemist with little formal programming training. Is the code great?\n# Nope, but it is indeed functional. The program was designed to accomplish a few quick\n# tasks, namely: how many ms2 events occur for a given precursors mass, summing ms2 ions for a given precurso...
[ [ "numpy.amax", "numpy.unique", "matplotlib.style.use", "matplotlib.use", "matplotlib.figure.Figure", "numpy.amin", "numpy.delete", "numpy.append", "numpy.loadtxt", "matplotlib.backends.backend_tkagg.NavigationToolbar2Tk", "numpy.array", "matplotlib.rc", "matplotl...
muyuuuu/PyQt-learn
[ "a9134566505c88ae9d46ae23480b140c8c911c33" ]
[ "GUI/Basic-train/QtPandas/qtpandas/models/DataFrameModel.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nEasy integration of DataFrame into pyqt framework\n\n@author: Jev Kuznetsov, Matthias Ludwig - Datalyze Solutions\n\"\"\"\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\n\nfrom...
[ [ "pandas.Series", "numpy.dtype", "numpy.finfo", "pandas.DataFrame", "numpy.iinfo", "numpy.float64", "pandas.Timestamp", "numpy.bool_", "pandas.read_sql" ] ]
tomerwei/Fusion360GalleryDataset
[ "3e1d58920ac56d271c01a7ba05749c5a05097152" ]
[ "tools/regraphnet/src/inference.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport json\nimport time\nimport argparse\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom train import *\n\ndef load_graph_pair(path_tar,path_cur,bbox):\n action_type_dict={'C...
[ [ "torch.nn.functional.softmax", "torch.zeros", "torch.load", "torch.no_grad", "torch.cuda.is_available", "torch.device", "numpy.array", "numpy.zeros" ] ]
mholts1020/Challenge-5-module
[ "d26eaac00b761bfc625e2e15573e26b256a9e843" ]
[ "MCForecastTools.py" ]
[ "# Import libraries and dependencies\r\nimport numpy as np\r\nimport pandas as pd\r\nimport os\r\nimport alpaca_trade_api as tradeapi\r\nimport datetime as dt\r\nimport pytz\r\n\r\nclass MCSimulation:\r\n \"\"\"\r\n A Python class for runnning Monte Carlo simulation on portfolio price data. \r\n \r\n .....
[ [ "numpy.random.normal", "pandas.MultiIndex.from_tuples", "pandas.DataFrame" ] ]
jiangyy12/application-tracking-system
[ "6de2d98351df65d43c09a5739c3c3dbdf3bf78d3" ]
[ "backend/app.py" ]
[ "#importing required python libraries\nfrom flask import Flask, jsonify, request\nfrom flask_cors import CORS, cross_origin\nfrom selenium import webdriver\nfrom bs4 import BeautifulSoup\nfrom itertools import islice\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom data.connection import query, inser...
[ [ "pandas.DataFrame" ] ]
TuxStory/LCsvGraph
[ "61abca24692a2230597a3736c677322adb262e74" ]
[ "LottoCSVGraph.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport csv, statistics\n\ndef DataList():\n path =\"./LottoGameData.csv\"\n file = open(path,newline='')\n reader = csv.reader(file)\n header = next(reader) #first line is the reader\n data = []\n for row in reader:\n # row = [date, n1,...
[ [ "matplotlib.pyplot.title", "numpy.unique", "matplotlib.pyplot.subplot", "matplotlib.pyplot.grid", "matplotlib.pyplot.show" ] ]
Haichao-Zhang/leap
[ "4d75961ff2ff203d4412633cbeb12889de3c79b6" ]
[ "railrl/torch/pytorch_util.py" ]
[ "import torch\nimport numpy as np\nfrom torch.autograd import Variable as TorchVariable\nfrom torch.nn import functional as F\n\n\ndef soft_update_from_to(source, target, tau):\n for target_param, param in zip(target.parameters(), source.parameters()):\n target_param.data.copy_(\n target_param....
[ [ "torch.ones", "torch.floor", "torch.cuda.set_device", "torch.zeros", "numpy.sqrt", "numpy.eye", "torch.from_numpy", "torch.cuda.FloatTensor", "torch.nn.functional.relu", "torch.FloatTensor", "numpy.random.rand", "numpy.prod", "numpy.floor", "torch.clamp", ...
daniele21/Financial_Sentiment_Analysis
[ "3734733f2d1d291c81a6239de121edcce861b463" ]
[ "tests/network_test.py" ]
[ "import unittest\nimport logging\nimport torch\nfrom torch import nn\n\nfrom constants.config import MOVIE_DATASET, TOKENIZER, MAX_WORD_SENTENCE, SST_DATASET\nfrom scripts.datasets.dataloader import generate_dataloader\nfrom scripts.datasets.dataset import NN_Dataset\nfrom scripts.datasets.sst_dataset import Bert_N...
[ [ "torch.device", "torch.nn.CrossEntropyLoss", "torch.nn.BCELoss" ] ]
HaiNguyen2903/Faster-RCNN
[ "78d249a07dae0c9dad095543dab6385394c8dc0a" ]
[ "data/dataset.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nimport torch as t\nfrom data.voc_dataset import VOCBboxDataset\nfrom skimage import transform as sktsf\n# import skimage.transform as sktsf\nfrom torchvision import transforms as tvtsf\nfrom data import util\nimport numpy as np\nfrom utils....
[ [ "numpy.array", "torch.from_numpy" ] ]
turoger/df_Collate
[ "4c4266fc7074957ca44d5085e915ea6c47123193" ]
[ "dfCollate/dfCollate.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[ ]:\n\n\nimport os\nimport dask.dataframe as ddf\nimport pandas as pd\nimport numpy as np\n\n\n#\ndef big_ddf (directory_to_traits_table,\n directory_to_phenotypes, phenotype_list, filename_type,\n directory_to_MAF,\n gene_name, dir...
[ [ "pandas.read_csv" ] ]
tomiyee/6.806-Card-Translation
[ "9286b232f60ec53fabbbcbeca23ddd71cd6c3483" ]
[ "code/model.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass Card2CodeModel(nn.Module):\n def __init__(self):\n self.linear = nn.Linear(5,5)\n \n def forward(self, inputs=None):\n return self.linear(inputs)\n" ]
[ [ "torch.nn.Linear" ] ]
seungjooshin/kornia
[ "5bfb8f2f23cc1d99647c36aa982132c5b7adbb6d" ]
[ "test/geometry/calibration/test_undistort.py" ]
[ "import pytest\nimport torch\nfrom torch.autograd import gradcheck\n\nfrom kornia.geometry.calibration.undistort import undistort_points\nfrom kornia.testing import assert_close\n\n\nclass TestUndistortion:\n def test_smoke(self, device, dtype):\n points = torch.rand(1, 2, device=device, dtype=dtype)\n ...
[ [ "torch.autograd.gradcheck", "torch.rand", "torch.tensor" ] ]
ZhaoZhangZZlab/eccDNA_formation_2021
[ "35bd3db1ab475bd440d7fe20c0856002f2cc73ba" ]
[ "Script/TEinsertion_convert.py" ]
[ "import pandas as pd\nimport os\nimport argparse\nimport re\nfrom Bio import SeqIO\nimport pysam\n\npd.set_option(\"display.max_columns\",40)\n\nparser=argparse.ArgumentParser()\nparser.add_argument(\"-bam\",\"--bamFile\")\nargs=parser.parse_args()\n\nbamFile=args.bamFile\n\n\nfrom TEinsertion_bamConverter import b...
[ [ "pandas.set_option" ] ]
dbanys/glide-text2im
[ "9cc8e563851bd38f5ddb3e305127192cb0f02f5c", "5177545ec62f1fddc3075a8a69b63df3eb2256a5" ]
[ "glide_text2im/gaussian_diffusion.py", "notebooks/run_inpaint.py" ]
[ "\"\"\"\nSimplified from https://github.com/openai/guided-diffusion/blob/main/guided_diffusion/gaussian_diffusion.py.\n\"\"\"\n\nimport math\n\nimport numpy as np\nimport torch as th\n\n\ndef _warmup_beta(beta_start, beta_end, num_diffusion_timesteps, warmup_frac):\n betas = beta_end * np.ones(num_diffusion_time...
[ [ "torch.randn_like", "numpy.log", "numpy.sqrt", "numpy.linspace", "torch.zeros", "torch.sqrt", "torch.randn", "torch.from_numpy", "numpy.ones", "torch.exp", "torch.tensor", "numpy.cumprod", "numpy.append", "torch.no_grad", "torch.split", "numpy.array"...
codema-dev/seai_deap
[ "52b67582beac8d8a2b46b5991970b6ad6695f7b3" ]
[ "tests/test_fab.py" ]
[ "import numpy as np\nfrom numpy.testing import assert_array_equal\n\nfrom seai_deap import fab\n\n\ndef test_calculate_thermal_bridging() -> None:\n\n expected_output = np.array(0.75)\n\n output = fab.calculate_thermal_bridging(\n wall_area=np.array(1),\n roof_area=np.array(1),\n floor_ar...
[ [ "numpy.testing.assert_array_equal", "numpy.array" ] ]
patrick-g-zhang/MPNet
[ "7788b5883c8d3037215d7c0b939b6e9b6e5f4bca" ]
[ "pretraining/setup.py" ]
[ "#!/usr/bin/env python3\n# 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\nfrom setuptools import setup, find_packages, Extension\nimport sys\n\n\nif sys.version_info < (3,):\n sys...
[ [ "numpy.get_include" ] ]
alexacarlson/pggan-pytorch
[ "96600b13dbda732b7c2737ee0e15c47bc239d7ca" ]
[ "dataloader.py" ]
[ "import os\nimport torch as torch\nimport numpy as np\nfrom io import BytesIO\nimport scipy.misc\n#import tensorflow as tf\nimport torchvision\nimport torchvision.transforms as transforms\nfrom torch.utils.data import DataLoader\nfrom torchvision.datasets import ImageFolder\nfrom torch.autograd import Variable\n#fr...
[ [ "torch.utils.data.DataLoader" ] ]
mcgibbon/marble
[ "801abdf65e112203d2b3c8983b0f73b0a4c821da" ]
[ "examples/initialization.py" ]
[ "import xarray as xr\nimport sympl\nimport numpy as np\nfrom marble import InputHeightToPrincipalComponents, convert_height_to_principal_components\nimport os\n\nheight_to_pc = InputHeightToPrincipalComponents()\n\ndata_path = os.path.join(\n os.path.dirname(\n os.path.realpath(__file__)\n ),\n 'dat...
[ [ "numpy.linspace" ] ]