repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
syuntoku14/flow
[ "3a1157cde31d0b7d6a3cc2f91eef0ec9ea53575e", "3a1157cde31d0b7d6a3cc2f91eef0ec9ea53575e", "3a1157cde31d0b7d6a3cc2f91eef0ec9ea53575e" ]
[ "flow/scenarios/loop_merge.py", "flow/multiagent_envs/loop/loop_accel.py", "flow/benchmarks/baselines/bottleneck2.py" ]
[ "\"\"\"Contains the loop merge scenario class.\"\"\"\n\nfrom flow.scenarios.base_scenario import Scenario\nfrom flow.core.params import InitialConfig\nfrom flow.core.params import TrafficLightParams\nfrom numpy import pi, sin, cos, linspace\nimport numpy as np\n\nADDITIONAL_NET_PARAMS = {\n # radius of the loops...
[ [ "numpy.linspace", "numpy.random.randn", "numpy.sin", "numpy.cos" ], [ "numpy.ndarray.flatten" ], [ "numpy.std", "numpy.mean" ] ]
drewlevitt/public-transit-tools
[ "4e2f6a578c526fd0d9dccdd81c2dc1fb3c5fbeb6" ]
[ "transit-network-analysis-tools/parallel_odcm.py" ]
[ "############################################################################\r\n## Tool name: Transit Network Analysis Tools\r\n## Created by: Melinda Morang, Esri\r\n## Last updated: 13 September 2021\r\n############################################################################\r\n\"\"\"Count the number of dest...
[ [ "pandas.concat", "pandas.DataFrame", "pandas.read_csv", "pandas.api.types.is_integer_dtype" ] ]
RuntianZ/smoothing-adversarial
[ "ab955ecd07070d53ffc4c657d21f523af56f7825" ]
[ "code/train_pgd.py" ]
[ "# this file is based on code publicly available at\r\n# https://github.com/locuslab/smoothing\r\n# written by Jeremy Cohen.\r\n\r\nimport argparse\r\nimport copy\r\nimport datetime\r\nimport os\r\nimport time\r\n\r\n\r\nfrom IPython import embed\r\nfrom architectures import ARCHITECTURES, get_architecture\r\nfro...
[ [ "torch.cat", "torch.optim.lr_scheduler.StepLR", "torch.no_grad", "torch.enable_grad", "numpy.min", "torch.randn_like", "torch.utils.data.DataLoader", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
stamas02/camera_z_transition
[ "0c481ac8e304b415925e5750d5a6624c7bddf9ea" ]
[ "generate_motion_field.py" ]
[ "import argparse\nimport cv2\nimport numpy as np\nfrom camera_z_transition.camera_motion import _z_translation_fn\nfrom src.helper import render_displacements\n\n\ndef parseargs():\n parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,\n description=...
[ [ "numpy.linspace", "numpy.ones", "numpy.meshgrid", "numpy.reshape" ] ]
berquist/pyquante2
[ "91a352bfb59038f513a5690792475636d5227252" ]
[ "tests/plots.py" ]
[ "import numpy as np\nfrom pyquante2 import basisset,rhf,h2\nfrom pyquante2.graphics.vtkplot import vtk_orbs\nfrom pyquante2.graphics.lineplot import test_plot_orbs,test_plot_bfs,lineplot_orbs\nfrom pyquante2.graphics.contourplot import test_contour\n\ndef test_lineplot_orbs(): return test_plot_orbs()\ndef test_line...
[ [ "numpy.array", "numpy.linspace" ] ]
ami-iit/paper_viceconte_2021_ral_adherent
[ "a06d4baf2c63b471d95469737d800d30eb82e51f" ]
[ "src/adherent/trajectory_generation/utils.py" ]
[ "# SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia\n# SPDX-License-Identifier: BSD-3-Clause\n\nimport math\nimport numpy as np\nfrom scenario import core\nfrom typing import List, Dict\nfrom dataclasses import dataclass\nfrom gym_ignition.utils import misc\nfrom scenario import gazebo as scenario...
[ [ "numpy.dot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.arrow", "numpy.sqrt", "numpy.cross", "matplotlib.pyplot.axis", "numpy.array", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.clf", "matplotlib.pyplot.ion",...
atul2099/squad
[ "7901894c0db3aad097a0f61279dff96b142c1b01" ]
[ "models_modified.py" ]
[ "\"\"\"Top-level model classes.\n\nAuthor:\n Chris Chute (chute@stanford.edu)\n\"\"\"\n\nimport layers_modified as layers\nimport torch\nimport torch.nn as nn\n\n\nclass BiDAF(nn.Module):\n \"\"\"Baseline BiDAF model for SQuAD.\n\n Based on the paper:\n \"Bidirectional Attention Flow for Machine Compreh...
[ [ "torch.zeros_like" ] ]
vdestraitt/toucan-data-sdk
[ "09327592daef6bc94d0d6f79a041b581226c2b7b" ]
[ "tests/utils/postprocess/test_sort.py" ]
[ "import pandas as pd\nfrom toucan_data_sdk.utils.postprocess import sort_values\n\n\ndef test_sort_values():\n \"\"\" It should sort dataframe \"\"\"\n data = pd.DataFrame([\n {'variable': 'toto', 'Category': 1, 'value': 300},\n {'variable': 'toto', 'Category': 1, 'value': 100},\n {'varia...
[ [ "pandas.DataFrame" ] ]
nithesh230303/FACE-DETECTION-AT-VARIOUS-ANGLES
[ "13c4e4f18e2b7dae5ca5b8a05de9153136b2eb66" ]
[ "preprocess.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom scipy import misc\nimport os\nimport tensorflow as tf\nimport numpy as np\nimport facenet\nimport detect_face\n\nclass preprocesses:\n def __init__(self, input_datadir, output_datadir):\n ...
[ [ "numpy.asarray", "numpy.zeros", "tensorflow.Graph", "tensorflow.compat.v1.ConfigProto", "scipy.misc.imresize", "scipy.misc.imread", "numpy.random.randint", "numpy.argmax", "tensorflow.compat.v1.GPUOptions", "scipy.misc.imsave", "numpy.power", "numpy.squeeze", "n...
jamekuma/Pointnet_Pointnet2_pytorch
[ "d7d6469eba6291724c8cc37da46977081cc1fb46" ]
[ "test_classification.py" ]
[ "\"\"\"\nAuthor: Benny\nDate: Nov 2019\n\"\"\"\nfrom data_utils.ModelNetDataLoader import ModelNetDataLoader\nimport argparse\nimport numpy as np\nimport os\nimport torch\nimport logging\nfrom tqdm import tqdm\nimport sys\nimport importlib\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nROOT_DIR = BASE_DI...
[ [ "torch.no_grad", "numpy.mean", "torch.utils.data.DataLoader", "numpy.zeros" ] ]
magictiger/pytorch
[ "eb71f7d93145379db4b3b2006065559ac46df344" ]
[ "torch/testing/_internal/distributed/distributed_test.py" ]
[ "import copy\nimport itertools\nimport math\nimport os\nimport random\nimport sys\nimport tempfile\nimport time\nimport unittest\nfrom collections import namedtuple\nfrom contextlib import contextmanager, suppress\nfrom datetime import timedelta\nfrom functools import reduce\nfrom typing import Union, NamedTuple\n\...
[ [ "torch.cat", "torch.cuda.amp.autocast", "torch.load", "torch.distributed.ProcessGroupNCCL", "torch.testing._internal.common_distributed.captured_output", "torch.distributed.get_backend", "torch.distributed.Backend", "torch.testing._internal.common_distributed.nccl_skip_if_lt_x_gpu"...
Costopoulos/NTUA-Telecommunications
[ "e713045fac4224e1813f3ee12fc40c8652412519" ]
[ "code/PyLabTelecom86.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[2]:\n\n\n#O kwdikas tha grafei antikeimenostrefws\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import signal\nfrom sympy.combinatorics.graycode import GrayCode \n\n\n# In[3]:\n\n\n#For Question 1\n#Every plot is scatter\n\n#For sub-questions a)i...
[ [ "scipy.signal.firwin", "matplotlib.pyplot.xlim", "scipy.signal.lfilter", "numpy.sin", "matplotlib.pyplot.savefig", "scipy.signal.sawtooth", "matplotlib.pyplot.step", "numpy.arange", "numpy.zeros", "numpy.round", "matplotlib.pyplot.title", "matplotlib.pyplot.show", ...
ganthern/sdf
[ "9e69c9d8a2ce83513faaa1912e72b4aeadcf5fbd" ]
[ "tools/pybench.py" ]
[ "import sys\nimport numpy as np\nimport trimesh\nfrom pysdf import SDF\n\nteapot = trimesh.load(sys.argv[1], use_embree=(sys.argv[2] == 'True'))\nteapot_sdf = SDF(np.array(teapot.vertices), np.array(teapot.faces))\nprint('SDF:', teapot_sdf)\nprint('Trimesh:', teapot)\nprint('Trimesh ray:', teapot.ray)\nprint('SFD t...
[ [ "numpy.array", "numpy.random.randn", "numpy.abs" ] ]
taufikxu/RepLibrary
[ "012c6049e95cb1e06d8a1ecd037b5acc4e5ff804" ]
[ "DALP/train.py" ]
[ "import torch\nimport numpy as np\nfrom collections import defaultdict\n\nfrom Tools.logger import save_context, Logger, CheckpointIO\nfrom Tools import FLAGS, load_config, utils_torch\n\n# from library import loss_gan\nfrom library import inputs, data_iters\n\nKEY_ARGUMENTS = load_config(FLAGS.config_file)\ntext_l...
[ [ "torch.cat", "torch.cuda.manual_seed", "torch.min", "numpy.random.seed", "torch.manual_seed", "torch.cuda.is_available", "torch.eye", "torch.utils.data.DataLoader", "torch.utils.data.Subset", "torch.sum" ] ]
BrononymousEngineer/options3d
[ "92f903b68373622acee765513da4ab1a3304c9c4" ]
[ "app.py" ]
[ "\"\"\"Run this app with `python app.py` and visit http://127.0.0.1:8050/ in your web browser.\"\"\"\n# TODO: add source type: YahooIV\n# TODO: make the params header a link that goes to a page that gives more information about the param.\n# TODO: display 2D or 3D graph mouse controls as a div above the graph\nimpo...
[ [ "pandas.DataFrame", "pandas.read_json" ] ]
kunjing96/DDNAS
[ "fbc2864de5fbd33b5ac791c31a58ea1a9d8e30b7" ]
[ "main.py" ]
[ "import sys, time, math, random, argparse\nfrom copy import deepcopy\nimport torch\nfrom data import get_datasets, get_nas_search_loaders\nfrom utils import prepare_seed, prepare_logger, save_checkpoint, copy_checkpoint, obtain_accuracy, AverageMeter, time_string, convert_secs2time, load_config, dict2config, get_op...
[ [ "torch.no_grad", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.load", "torch.nn.DataParallel", "torch.set_num_threads" ] ]
eic/uproot4
[ "deb8d88c2643521f372bf5005c51af8926016c7e", "deb8d88c2643521f372bf5005c51af8926016c7e" ]
[ "src/uproot/deserialization.py", "tests/test_0412-write-multidimensional-numpy-to-ttree.py" ]
[ "# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE\n\n\"\"\"\nThis module defines low-level routines for deserialization, including\n:doc:`uproot.deserialization.compile_class`, which creates class objects from\n``TStreamerInfo``-derived code, and\n:doc:`uproot.deserialization.read...
[ [ "numpy.int64", "numpy.dtype" ], [ "numpy.array", "numpy.array_equal", "numpy.asarray", "numpy.sqrt", "numpy.dtype" ] ]
Lexa307/PhotonDefender
[ "a08dc652e5c64e3ccb33b7cfa206846dca0575bd" ]
[ "sc2/game_info.py" ]
[ "from collections import deque\nfrom typing import Any, Deque, Dict, FrozenSet, Generator, List, Optional, Sequence, Set, Tuple, Union\n\nimport numpy as np\n\nfrom .cache import property_immutable_cache, property_mutable_cache\nfrom .pixel_map import PixelMap\nfrom .player import Player\nfrom .position import Poin...
[ [ "numpy.ndenumerate", "numpy.unique" ] ]
geraint-37d5/advent-of-code
[ "09e97ed629d3a010ca52026b3e4f6c4ba71ecf44" ]
[ "2021/17/__main__.py" ]
[ "from numpy import array\nfrom re import match\n\n\nclass Probe:\n def __init__(self, position=None, velocity=None):\n self.position = position if position is not None else array([0, 0])\n self.velocity = velocity if velocity is not None else array([0, 0])\n self.max_y = self.position[1]\n\n...
[ [ "numpy.array" ] ]
satya77/transformer_rankers
[ "0d2c20bd26041d887fb65102020a0b609ec967fc" ]
[ "transformer_rankers/trainers/losses/sigma/polynomial/sp.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Function\n\nfrom losses.sigma.polynomial.divide_conquer import divide_and_conquer\nfrom losses.sigma.polynomial.multiplication import Multiplication\nfrom losses.sigma.polynomial.grad import d_logS_d_expX\nfrom itertools import combinations\ndef CNK(n...
[ [ "torch.zeros", "torch.max", "torch.ones", "torch.Tensor", "torch.exp" ] ]
shannonxtreme/DeepReg
[ "373f6c28fed1d7376d5c39340b08a3814804efb2" ]
[ "test/unit/test_network_cond.py" ]
[ "# coding=utf-8\n\n\"\"\"\nTests for deepreg/model/network/cond.py\n\"\"\"\nimport tensorflow as tf\n\nfrom deepreg.model.network.cond import build_conditional_model, conditional_forward\nfrom deepreg.model.network.util import build_backbone\n\n\ndef test_conditional_forward():\n \"\"\"\n Testing that conditi...
[ [ "tensorflow.ones" ] ]
jeffmylife/models
[ "30f398518ea1709245a9de445fcff8071528e400" ]
[ "DeepBind/template/dataloader.py" ]
[ "\"\"\"DeepBind dataloader\n\"\"\"\n# python2, 3 compatibility\nfrom __future__ import absolute_import, division, print_function\n\nimport numpy as np\nimport pandas as pd\nimport pybedtools\nfrom pybedtools import BedTool\nfrom genomelake.extractors import FastaExtractor\nfrom kipoi.data import Dataset\nfrom kipoi...
[ [ "pandas.read_csv" ] ]
Xunius/nitime
[ "8b837976c5639f44489bb2175890c06dd81f23a8" ]
[ "nitime/analysis/tests/test_granger.py" ]
[ "\"\"\"\nTesting the analysis.granger submodule\n\n\"\"\"\n\n\nimport numpy as np\nimport numpy.testing as npt\n\nimport nitime.analysis.granger as gc\nimport nitime.utils as utils\nimport nitime.timeseries as ts\n\n\ndef test_model_fit():\n \"\"\"\n Testing of model fitting procedure of the nitime.analysis.g...
[ [ "numpy.array", "numpy.empty", "numpy.testing.assert_equal", "numpy.testing.assert_almost_equal", "numpy.mean" ] ]
raphael-group/bnpy
[ "b11dc6f5689b06fc967bab6dffe7e01551d84667" ]
[ "bnpy/obsmodel/BernObsModel.py" ]
[ "import numpy as np\nimport itertools\n\nfrom scipy.special import gammaln, digamma\n\nfrom bnpy.suffstats import ParamBag, SuffStatBag\nfrom bnpy.util import dotATA, dotATB, dotABT\nfrom bnpy.util import as1D, as2D, as3D\nfrom bnpy.util import numpyToSharedMemArray, sharedMemToNumpyArray\n\nfrom bnpy.obsmodel.Abst...
[ [ "numpy.dot", "scipy.special.gammaln", "numpy.asarray", "numpy.zeros", "numpy.minimum", "numpy.log", "numpy.sum", "numpy.ones", "numpy.tile", "numpy.mean", "numpy.tensordot", "numpy.isfinite", "numpy.inner", "scipy.special.digamma", "numpy.maximum" ] ]
web-sys1/SeismicSonify
[ "9c0c3880bb403a94bb4f8ca937976e4fef849cbe" ]
[ "sonify/plotter.py" ]
[ "#!/usr/bin/env python3\r\n\r\nimport os\r\nimport subprocess\r\nimport warnings\r\n\r\nimport colorcet as cc\r\nimport matplotlib.dates as mdates\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport matplotlib.animation as anim\r\nfrom matplotlib.animation import FuncAnimation\r\nfrom matplotlib.grid...
[ [ "matplotlib.dates.AutoDateLocator", "scipy.signal.spectrogram", "matplotlib.pyplot.ion", "numpy.array", "numpy.min", "matplotlib.artist.Artist.remove", "matplotlib.pyplot.show", "numpy.sqrt", "matplotlib.pyplot.ioff", "numpy.log2", "matplotlib.gridspec.GridSpec" ] ]
rbassett3/Fused-Density-Estimator
[ "f5a448057964cd76289bd4dda4c0444a83f73892" ]
[ "Examples/Univariate/NormalData.py" ]
[ "import sys\nimport os\nsys.path.append(os.path.join(os.path.dirname(__file__), \"..\",\"..\",\"FDE-Tools\"))\nfrom FDE import *\nimport scipy.stats as stats\nrandom.seed(0)\n\nP = stats.norm.rvs(size = 100)\n(a,b) = (-4,4)\nfde = UnivarFDE((a,b), P)\nfde.GenerateProblem()\nfde.SolveProblem(.030)\nfde.Plot()\n\nKee...
[ [ "scipy.stats.norm.pdf", "scipy.stats.norm.rvs" ] ]
CanYouImagine/openspeech
[ "10307587f08615224df5a868fb5249c68c70b12d", "095d78828a9caed0151727897f35534231947846" ]
[ "openspeech/modules/transformer_embedding.py", "openspeech/data/audio/load.py" ]
[ "# MIT License\n#\n# Copyright (c) 2021 Soohwan Kim and Sangchun Ha and Soyoung Cho\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitati...
[ [ "torch.nn.Embedding" ], [ "numpy.concatenate", "numpy.memmap" ] ]
margaritageleta/vesper-tech-debt
[ "e3e98112a9a04da3658d892e6ea3576c8064b0b6" ]
[ "src/analyze.py" ]
[ "import sqlite3\nimport pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\ndef count_uniques(df):\n n_unique = {}\n pct_unique = {}\n rows = len(df)\n for i in range(df.shape[1]):\n col = df.columns[i]\n n_unique[col] = df[col].nunique()\n pc...
[ [ "pandas.DataFrame", "pandas.DatetimeIndex", "pandas.read_sql_query" ] ]
FCP-INDI/C-PAC
[ "f33bbe64ea796a0e6f586d09cc90cf4a0a432b17" ]
[ "CPAC/qpp/tests/test_qpp.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pytest\nimport scipy.io\nfrom CPAC.qpp.qpp import detect_qpp\n\nnp.random.seed(10)\n\n\n@pytest.mark.skip(\n reason=\"No such file or directory: 'CPAC/qpp/tests/matlab/qpp.mat'\")\ndef test_qpp():\n\n voxels, trs = 600, 200\n window_length = 15\n...
[ [ "numpy.zeros", "numpy.random.seed", "numpy.ones", "matplotlib.pyplot.legend", "numpy.tile", "matplotlib.pyplot.figure", "numpy.random.uniform", "matplotlib.pyplot.show", "matplotlib.pyplot.axvline", "numpy.linspace", "numpy.convolve" ] ]
MOWaqar/MSc-Project
[ "14464da68cc112038714eb5c71a29e2a386bce22" ]
[ "ProjectCode/UtilityFunctions.py" ]
[ "\"\"\"\nAUTHOR: M O WAQAR 20/08/2018\n\nUtility Functions used by other scripts are written in this file\nIt contains code snippets that are taken from different kernel publically shared on Kaggle competition\n\n\"\"\"\n\n \n\n#Import Packages\n#memory management\nimport gc\n\n# File system manangement\nimport os\...
[ [ "sklearn.preprocessing.MinMaxScaler", "sklearn.feature_selection.SelectKBest", "pandas.concat", "pandas.read_csv", "matplotlib.pyplot.xticks", "numpy.log", "pandas.set_option", "pandas.DataFrame", "sklearn.feature_selection.VarianceThreshold", "matplotlib.pyplot.subplots", ...
zml24/fairseq
[ "6f5025d9e5a4fdc58eb8e7c820e721c72a9d9dc1" ]
[ "fairseq/dataclass/configs.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport sys\nfrom dataclasses import _MISSING_TYPE, dataclass, field\nfrom typing import Any, List, Optional\n\nimport torch\n\nfrom ...
[ [ "torch.cuda.device_count" ] ]
FischbachLab/sangeria
[ "2946bafb166b67be54875cdd3c8729523e16f566" ]
[ "scripts/silva_blast_filter.py" ]
[ "#!/usr/bin/env python3\n## USAGE: python silva_blast_filter.py <blast_frmt_6> <PREFIX>\n# EXAMPLE: python silva_blast_filter.py TY0000039_frmt_6.tsv TY0000039\n\nimport pandas as pd\nimport sys\n\nsilva_db=\"/mnt/efs/scratch/Xmeng/data/16S/Sanger/sanger_scripts/SILVA_138.1_SSURef_NR99.headers\"\nkeys_db=\"/mnt/ef...
[ [ "pandas.read_csv" ] ]
candleinwindsteve/mne-python
[ "a361dced7663c616ac1fd184f7eed183d2b71580" ]
[ "mne/bem.py" ]
[ "# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Matti Hamalainen <msh@nmr.mgh.harvard.edu>\n# Eric Larson <larson.eric.d@gmail.com>\n# Lorenzo De Santis <lorenzo.de-santis@u-psud.fr>\n#\n# License: BSD (3-clause)\n\nimport sys\nimport os\nimport os.path as op\n...
[ [ "numpy.dot", "numpy.array_equal", "numpy.median", "scipy.linalg.svd", "numpy.min", "numpy.where", "scipy.optimize.fmin_cobyla", "numpy.concatenate", "numpy.max", "numpy.empty", "numpy.log", "numpy.eye", "numpy.arange", "numpy.sqrt", "numpy.array", "n...
Youssef15015/tardis
[ "adde5b0114f23634fe5afef6937b285174ad6b55" ]
[ "tardis/io/model_reader.py" ]
[ "#reading different model files\n\nimport warnings\nimport numpy as np\nfrom numpy import recfromtxt, genfromtxt\nimport pandas as pd\nfrom astropy import units as u\nfrom pyne import nucname\n\nimport logging\n# Adding logging support\nlogger = logging.getLogger(__name__)\n\nfrom tardis.util.base import parse_quan...
[ [ "pandas.Index", "pandas.DataFrame", "numpy.recfromtxt", "numpy.loadtxt", "numpy.arange", "pandas.MultiIndex", "pandas.read_csv" ] ]
alexisrosuel/AMSDT
[ "c3a4f45b022770a87ce533cc39d948fabaf39030" ]
[ "amsdt/statistical_test.py" ]
[ "import statsmodels.stats.diagnostic\nimport pysal.spreg.diagnostics\nfrom statsmodels.stats.outliers_influence import reset_ramsey\nimport arch.unitroot\nimport numpy as np\n\nfrom amsdt.settings import library\n\nclass StatisticalTest:\n def __init__(self, statistical_test_type):\n '''\n :param t...
[ [ "numpy.asscalar", "numpy.min" ] ]
blbarker/atk
[ "bcb747d053e801820233a6439c88a457c8cf2438" ]
[ "python-client/trustedanalytics/core/classifymetrics.py" ]
[ "# vim: set encoding=utf-8\n\n#\n# Copyright (c) 2015 Intel Corporation \n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#       http://www.apache.org/licenses/LICENSE-2.0\n...
[ [ "pandas.DataFrame" ] ]
BeyonderXX/tensorflow-serving-java
[ "e8cbb502c8fb1b00da9b0ea8115847931e8129f1" ]
[ "python/bert_model.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "tensorflow.contrib.tpu.TPUEstimatorSpec", "tensorflow.data.TFRecordDataset", "tensorflow.train.Features", "tensorflow.contrib.tpu.TPUEstimator", "tensorflow.matmul", "tensorflow.metrics.mean", "tensorflow.nn.softmax", "tensorflow.one_hot", "pandas.read_csv", "tensorflow.pa...
hanq0212/Few_Shot-Neural_Talking_Head
[ "a5d2b4e745531e39d4d4c31a94557c0bd5e6072e" ]
[ "models/discriminator.py" ]
[ "import torch\nimport torch.nn as nn\nfrom models.blocks import *\n\nclass Discriminator(nn.Module):\n \n def __init__(self, batch_size= 16, curr_size = 224, ideal_size=256, fine_tuning = False, pool_mode = \"sum\"):\n super(Discriminator, self).__init__()\n self.batch_size = batch_size\n\n ...
[ [ "torch.nn.AdaptiveMaxPool2d", "torch.cat", "torch.nn.LeakyReLU", "torch.nn.ReLU", "torch.mean", "torch.randn", "torch.nn.LPPool2d" ] ]
panambY/Data_Science_inProduction
[ "32e5a88dba0f3929050c092f68882d73bea27d83" ]
[ "api/rossmann/Rossmann.py" ]
[ "import pickle\nimport inflection\nimport pandas as pd\nimport numpy as np\nimport math\nimport datetime\n\nclass Rossmann( object ):\n def __init__( self ):\n self.home_path='/Users/favh2/github_projects/Data_Science_inProduction/'\n self.competition_distance_scaler = pickle.load( open( self.hom...
[ [ "pandas.to_datetime", "numpy.sin", "numpy.expm1", "numpy.cos", "pandas.get_dummies" ] ]
wfondrie/depthcharge
[ "d2bc81a1c21f14cdfca2e181faaa611929dee973" ]
[ "tests/unit_tests/test_components/test_transformers.py" ]
[ "\"\"\"Test the transformer components\"\"\"\nimport torch\nfrom depthcharge.masses import PeptideMass\nfrom depthcharge.components.transformers import (\n SpectrumEncoder,\n PeptideEncoder,\n PeptideDecoder,\n)\n\n\ndef test_spectrum_encoder():\n \"\"\"Test that a spectrum encoder will run.\"\"\"\n ...
[ [ "torch.tensor" ] ]
haiguanl/GlobalRoutingProblemGenerator
[ "8e5907852bf02b5801e44708122b84c1af3adbb5" ]
[ "BenchmarkGenerator/TwoPinRouterASearch.py" ]
[ "from __future__ import print_function\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\n\nimport Initializer as init\nimport GridGraph as gridgraph\n\nimport matplotlib.patches as patches\nimport numpy as np\nimport pandas as pd\nfrom matplotlib import cm\nfrom mpl_toolkits.mplot3d impo...
[ [ "matplotlib.use", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
593903762/ttf
[ "691b062f77b004ad85403c85e30cdf15034daf5e" ]
[ "do_other_things/plot_the_widerperson_rectangle.py" ]
[ "import os\n# import cv2\nimport sys\nimport pandas as pd\nfrom PIL import Image, ImageDraw,ImageFont\nimport json\n# sys.append('')\n\ndef plt_box(img_cat):\n base_path = '../data/WiderPerson'\n path = os.path.join(base_path, img_cat+'.txt')\n with open(path, 'r') as f:\n img_ids = [x for x in f.re...
[ [ "pandas.DataFrame" ] ]
chrisochoatri/dgp
[ "7eb437072b656804a8716186cc61f6ba148e3a46" ]
[ "tests/utils/structures/test_key_line_2d.py" ]
[ "import numpy as np\nfrom numpy.lib.ufunclike import fix\nimport pytest\nfrom dgp.utils.structures.key_line_2d import KeyLine2D\n\n\n@pytest.fixture\ndef keyline():\n k = np.float32([\n [.5, 2],\n [0, 3],\n [0, 1],\n [.25, -.25],\n [100, 1],\n ])\n return KeyLine2D(k)\n\n...
[ [ "numpy.float32" ] ]
ralfcosta/COVID-19
[ "6f4e0f19ca36ce56f7454e1c40f78067fa14f209" ]
[ "simulator/covid19/crawler_cnes.py" ]
[ "import pandas as pd\nimport sys\nimport time\nimport os\n\nfrom data import get_ibge_code_list\nfrom crawler_utils import get_city_beds\nfrom crawler_utils import get_bed_codes\n\nlist_city = get_ibge_code_list()\n\ndf_beds = pd.DataFrame(columns=['codibge', 'Codigo', 'Descrição', 'Existente', 'Sus', 'Não Sus'])\n...
[ [ "pandas.DataFrame", "pandas.to_numeric", "pandas.merge" ] ]
NunoEdgarGFlowHub/dm_control
[ "19e998b53053ed0aeff69041ca9c026a27b96442", "19e998b53053ed0aeff69041ca9c026a27b96442" ]
[ "dm_control/locomotion/walkers/initializers/__init__.py", "dm_control/composer/entity.py" ]
[ "# Copyright 2019 The dm_control 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 applicable law...
[ [ "numpy.random.randint", "numpy.zeros" ], [ "numpy.array", "numpy.linalg.norm", "numpy.empty_like" ] ]
godspeed5/qiskit-terra
[ "a5d87c3e4a663ab962704585fba0caef15061246" ]
[ "test/python/quantum_info/operators/channel/test_chi.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.testing.assert_allclose", "numpy.diag", "numpy.eye" ] ]
Linjackffy/toppra
[ "e72b40b682c3b1b6d558a29cacdd746cf0a3faee" ]
[ "toppra/constraint/linear_joint_velocity.py" ]
[ "\"\"\"This module implements the joint velocity constraint.\"\"\"\nimport numpy as np\nfrom toppra._CythonUtils import (_create_velocity_constraint,\n _create_velocity_constraint_varying)\nfrom .linear_constraint import LinearConstraint\n\n\nclass JointVelocityConstraint(LinearConst...
[ [ "numpy.array", "numpy.isnan" ] ]
FrankPfirmann/playground
[ "9379cbfd57d98eadcaf7b00d777434490a536540" ]
[ "pommermanLearn/params.py" ]
[ "from datetime import datetime\nimport torch\n\n# train_dqn.py\nnum_iterations = 500\nepisodes_per_iter = 1\ngradient_steps_per_iter = 100\nbatch_size = 128\nepisodes_per_eval = 50\nintermediate_test = 100\ncentralize_planes = False\nrender_tests = False\nenv = 'PommeRadio-v2' # PommeFFACompetition-v0, OneVsOne-v0...
[ [ "torch.device", "torch.cuda.is_available" ] ]
HAIbingshuai/albert-model_attempt-
[ "d8e40001910d54409932eb5a49bb36685c266a20" ]
[ "albert.py" ]
[ "import tensorflow as tf\nfrom Albert_untils import albert_until\nfrom albert_config import Config\nimport numpy as np\n\nclass EmbeddingLookupFactorized(tf.keras.layers.Layer):\n def __init__(self,vocab_size = Config.vocab_size,hidden_size = Config.hidden_size,embdding_size = Config.embdding_size):\n sup...
[ [ "tensorflow.shape", "tensorflow.zeros", "tensorflow.expand_dims", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.keras.layers.Embedding", "tensorflow.keras.layers.LayerNormalization", "tensorflow.keras.layers.Dense", "tensorflow.keras.Model", "tensorflow.keras.layer...
wangyankiko/cnn-relation-extraction-master
[ "f4a5b7de79c5065f6a32d983c6426fec3a200702" ]
[ "train_wy_entity_wy5.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport os,sys\nimport datetime\nimport time\nimport server_bert\nfrom logger import Logger\nBASEDIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(BASEDIR)\nfrom text_cnn_entity_wy2 import TextCNN\nimport datahelper3\nimport utils\nfrom configure import F...
[ [ "numpy.array", "tensorflow.summary.merge", "tensorflow.contrib.learn.preprocessing.VocabularyProcessor", "tensorflow.summary.scalar", "tensorflow.Graph", "tensorflow.Session", "tensorflow.Variable", "tensorflow.global_variables", "numpy.mean", "tensorflow.ConfigProto", ...
spdkh/MIMO-Detector-Design-based-on-Deep-Learning
[ "ed2914423fda728911d344e33a4751f2912cd74f" ]
[ "maximum_likelihood.py" ]
[ "import numpy as np\nimport time\n\n\ndef data_converter(Num, base, size, power):\n x = []\n while Num > 0:\n x.insert(0, Num % base)\n Num = Num // base\n for i in range(size - len(x)):\n x.insert(0, 0)\n return power * (np.array(x) * 2 - base + 1)\n\n\n# WARNING! This function can...
[ [ "numpy.not_equal", "numpy.array", "numpy.size", "numpy.zeros" ] ]
ogal93/pre-training-multilingual-document-encoders
[ "9b62ef1fc68c1dd67fe8ed170f6afef601a14acd" ]
[ "data_collator.py" ]
[ "\"\"\" A data collator which enables dynamic padding for jagged lists.\"\"\"\nfrom dataclasses import dataclass\n\nimport torch\n\n\n@dataclass\nclass CustomDataCollator:\n \"\"\" A data collator which can be used for dynamic padding, when each instance of a batch is a\n list of lists. Each sentence is a lis...
[ [ "torch.tensor" ] ]
anhydrous99/cppgym
[ "0b1009a74faebfe5a31bcfd6a86c74cf13464d56" ]
[ "bench/baselines_bench.py" ]
[ "import gym\nimport cppgym\n\nfrom stable_baselines.common.policies import MlpPolicy\nfrom stable_baselines import PPO2\n\nfrom tqdm import tqdm\nfrom time import time\nimport numpy as np\nimport pandas as pd\n\n\ndef run_test(env):\n model = PPO2(MlpPolicy, env)\n t0 = time()\n model.learn(10000)\n t1 ...
[ [ "numpy.average", "pandas.DataFrame" ] ]
max-andr/provable-robustness-max-linear-regions
[ "28200b663986310021c70c5a98c959a943731f66" ]
[ "models.py" ]
[ "\"\"\"\nModel definitions.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport math\n\nimport numpy as np\nimport tensorflow as tf\n\n\nclass MLP:\n def __init__(self, flag_train, hps):\n ...
[ [ "tensorflow.zeros", "tensorflow.nn.relu", "tensorflow.nn.conv2d", "tensorflow.constant", "tensorflow.sqrt", "tensorflow.get_variable", "numpy.sqrt" ] ]
NCAR/ml-ocean-bl
[ "69a5bf8c95cca59eba87f6472ba1f5e791ec8caa" ]
[ "mloceanbl/train.py" ]
[ "####################################################################################\n####################################################################################\n########################### File Description #######################################\n#########################################################...
[ [ "tensorflow.exp", "tensorflow.keras.backend.set_floatx", "numpy.ceil", "tensorflow.shape", "numpy.random.choice", "tensorflow.GradientTape", "numpy.zeros", "numpy.random.rand", "numpy.random.permutation", "tensorflow.ragged.constant", "tensorflow.keras.optimizers.Nadam"...
GregoireJan/salesforecastaip
[ "daa43b16007b88121101af9c88bcb8236f6b4c69" ]
[ "model_ml/predict_tensor.py" ]
[ "# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\nfrom IPython import get_ipython\n\n# %%\nfrom __future__ import division\nfrom datetime import datetime, timedelta,date\nimport pandas as pd\nget_ipython().run_line_magic('matplotlib', 'inline')\nimport matplotlib.pyplot ...
[ [ "pandas.to_datetime", "pandas.read_csv", "sklearn.preprocessing.MinMaxScaler", "numpy.append" ] ]
corcorf/pi_logger
[ "4fcb4ec57997b9a50c1efef48eb43d18999356e1" ]
[ "pi_logger/api_server.py" ]
[ "\"\"\"\nAPI for the pi_logger module\n\nadapted from:\nhttps://www.codementor.io/@sagaragarwal94/building-a-basic-restful-api-in-python-58k02xsiq\n\"\"\"\n# pylint: disable=C0103\n\nimport json\nimport logging\nimport urllib\n\nimport pandas as pd\nfrom flask import Flask, render_template, url_for\nfrom flask_rest...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
bobchengyang/SDP_RUN
[ "f6976ed24255b026a68438085225293c780b0065" ]
[ "ttvt_idx_no_val.py" ]
[ "import torch\n\ndef ttvt_idx_no_val(n_sample,train_all_n,train_net_n,val_n):\n b_ind=torch.arange(0,round(train_all_n*n_sample)) # ~50% training_all sample\n b_ind_train_net=b_ind.shape[0]+torch.arange(0,round(train_net_n*n_sample)) # ~20% training_net sample\n b_ind_val=b_ind_train_net\n n_train=b_ind...
[ [ "torch.arange" ] ]
biblhertz/atlas
[ "c0d70f4c0f8bcf143c68b7a9c0b1200de3b6b8e5" ]
[ "utils/process_images.py" ]
[ "#!/usr/bin/python\n\n'''\nGenerates all data required to create a PixPlot viewer.\n\nDocumentation:\nhttps://github.com/YaleDHLab/pix-plot\n\nUsage:\n python utils/process_images.py --image_files=\"data/*/*.jpg\"\n\n * * *\n'''\n\nfrom __future__ import division, print_function\nfrom collecti...
[ [ "numpy.array", "numpy.set_printoptions", "sklearn.cluster.KMeans", "tensorflow.Session", "tensorflow.GraphDef", "tensorflow.import_graph_def", "sklearn.manifold.TSNE", "numpy.load", "numpy.save", "sklearn.metrics.pairwise_distances_argmin_min", "tensorflow.gfile.FastGFi...
rickyHong/Densenet-repl
[ "6454c0e15696e0229d92398a03aa933818f22a59" ]
[ "Cifar10/Densenet_Cifar10.py" ]
[ "import tensorflow as tf\nfrom tflearn.layers.conv import global_avg_pool\nfrom tensorflow.contrib.layers import batch_norm, flatten\nfrom tensorflow.contrib.layers import xavier_initializer\nfrom tensorflow.contrib.framework import arg_scope\nfrom cifar10 import *\n\n# Hyperparameter\ngrowth_k = 24\nnb_block = 2 #...
[ [ "tensorflow.contrib.layers.batch_norm", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.train.get_checkpoint_state", "tensorflow.contrib.layers.flatten", "tensorflow.global_variables_initializer", "tensorflow.cast", "tensorflow.concat", "tensorflow.argmax", "tens...
genematx/nmrglue
[ "8a24cf6cbd18451e552fc0673b84c42d1dcb69a2" ]
[ "nmrglue/analysis/lineshapes1d.py" ]
[ "\"\"\"\nOne-dimensional lineshape functions and classes\n\"\"\"\n\nimport numpy as np\nimport scipy.special # needed for complex error function (wo\n\npi = np.pi\n\n####################################\n# 1D lineshape simulator functions #\n####################################\n\n\n# Gaussian (normal) lineshape...
[ [ "numpy.empty", "numpy.log", "numpy.exp", "numpy.nonzero", "numpy.arange", "numpy.sqrt", "numpy.abs" ] ]
ahmadsalimi/MLP_NeuralNetwork
[ "86c263fe8bd5371533d57b2b3adce970d272b903" ]
[ "4. MlpNeuralNetworks/WebApplication/digit_classifier.py" ]
[ "import keras\nimport matplotlib.pyplot as plt\nfrom keras.models import Sequential, load_model\nfrom keras.layers.core import Dense, Dropout, Activation\nimport numpy as np\nfrom skimage.transform import resize\n\ndef draw(image):\n fig = plt.figure(figsize=(4, 4))\n ax = fig.add_subplot(111)\n ax.set_asp...
[ [ "matplotlib.pyplot.savefig", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
yashbhalgat/QualcommAI-MicroNet-submission-MixNet
[ "8e4a2a253e68dc67eed91a5d3bb764afda5f32c8" ]
[ "lsq_quantizer/utils/iterative_compression_utils.py" ]
[ "import torch\r\nimport numpy as np\r\n\r\n\r\ndef get_all_layer_names(model, subtypes=None):\r\n if subtypes is None:\r\n return [name for name, module in model.named_modules()][1:]\r\n return [name for name, module in model.named_modules() if isinstance(module, subtypes)]\r\n\r\n\r\ndef get_layer_nam...
[ [ "torch.zeros", "numpy.array", "torch.sort", "torch.sum" ] ]
DotStarMoney/NBD
[ "7a6b76b84cc35de7825ede55c4c89a391a5dff7f" ]
[ "old/dccdc/train.py" ]
[ "import datetime\nimport math\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\nfrom absl import app\nfrom absl import flags\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport tensorflow as tf\n\nimport dataset\nimport loss\nimport metrics\nimport model\nimport optimizer\n\nFLAGS = flags.FLAGS\n\n...
[ [ "tensorflow.range", "matplotlib.pyplot.xkcd", "tensorflow.GradientTape", "tensorflow.sigmoid", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "tensorflow.config.list_physical_devices", "tensorflow.cast" ] ]
fhaase2/sentence-transformers
[ "40f994e5e3ce3e2819833773117d788dfa0c7e7f", "40f994e5e3ce3e2819833773117d788dfa0c7e7f" ]
[ "examples/training_wikipedia_sections.py", "examples/training_stsbenchmark_bert.py" ]
[ "\"\"\"\nThis script trains sentence transformers with a triplet loss function.\n\nAs corpus, we use the wikipedia sections dataset that was describd by Dor et al., 2018, Learning Thematic Similarity Metric Using Triplet Networks.\n\nSee docs/pretrained-models/wikipedia-sections-modesl.md for further details.\n\nYo...
[ [ "torch.utils.data.DataLoader" ], [ "torch.utils.data.DataLoader" ] ]
snuspl/parallax
[ "80e350fd933b8f82721bdc4950bc969ba0c630a4" ]
[ "parallax/parallax/core/python/tools/launch_ps.py" ]
[ "# Copyright (C) 2018 Seoul National University\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...
[ [ "tensorflow.train.Server", "tensorflow.app.flags.DEFINE_integer", "tensorflow.train.ClusterSpec", "tensorflow.app.flags.DEFINE_string", "tensorflow.app.run" ] ]
tivvit/crypto_trading_bot_devfest_2017
[ "7e642bb455f70f79582f98cca4996765bcaea148" ]
[ "df_17/ct/time_frame_trade_stats.py" ]
[ "import numpy as np\n\nfrom .history import HistoryDownloader\nfrom .stats import WeightedSequenceStats\nfrom .stats import TradeStats\n\n\nclass TimeFrameTradeStats(WeightedSequenceStats):\n def __init__(self, from_currency, to_currency, granularity, client=None,\n no_download=False, start=None,...
[ [ "numpy.mean" ] ]
anguyen8/generative-attribution-methods
[ "b533ac799d14e66f9da9123266b83f3c942653d0" ]
[ "formal_MP_single_image.py" ]
[ "import os\nimport cv2\nimport sys\nimport time\nimport scipy\nimport torch\nimport argparse\nimport numpy as np\nimport torch.optim\n\nfrom formal_utils import *\nfrom skimage.transform import resize\nfrom PIL import ImageFilter, Image\n\nuse_cuda = torch.cuda.is_available()\n\n# Fixing for deterministic results\n...
[ [ "numpy.random.rand", "scipy.ndimage.filters.gaussian_filter", "numpy.where", "torch.cuda.is_available", "torch.nn.DataParallel", "numpy.uint8", "torch.nn.Softmax", "torch.manual_seed", "torch.abs", "numpy.arange", "numpy.transpose", "numpy.random.randint", "torc...
dongwooc/lim
[ "ab1e4c5c62a3486d89e197badff456b393022b31" ]
[ "source/tools/_vid_tools.py" ]
[ "'''\nMiscellaneous functions for VID and CVID calculations\n'''\n\nimport numpy as np\nimport scipy as sp\nimport astropy.units as u\nfrom scipy.integrate import quad\nfrom scipy.interpolate import interp1d\n\n# Parallelization functions for convolutions\nfrom multiprocessing import Pool as ThreadPool\nfrom functo...
[ [ "scipy.interpolate.interp1d", "numpy.zeros", "numpy.log", "numpy.diff", "scipy.fft.ifft", "numpy.sqrt", "numpy.append", "scipy.fft.fft", "scipy.integrate.quad" ] ]
Vaibhav-Chopra-GT/pymc
[ "75ea2a80cb27773e93b7b207043077953940e6ff" ]
[ "pymc/step_methods/metropolis.py" ]
[ "# Copyright 2020 The PyMC Developers\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 appli...
[ [ "numpy.dot", "numpy.random.choice", "numpy.random.rand", "numpy.copy", "numpy.exp", "numpy.size", "numpy.random.random", "numpy.concatenate", "numpy.max", "numpy.random.randint", "numpy.isfinite", "numpy.sqrt", "numpy.zeros", "numpy.round", "numpy.random...
EvilPsyCHo/Deep-Time-Series-Prediction
[ "f6a6da060bb3f7d07f2a61967ee6007e9821064e" ]
[ "deepseries/train.py" ]
[ "# encoding: utf-8\n\"\"\"\n@author : zhirui zhou\n@contact: evilpsycho42@gmail.com\n@time : 2020/4/1 17:03\n\"\"\"\nimport os\nimport torch\nfrom torch.utils.tensorboard import SummaryWriter\nfrom deepseries.log import get_logger\nimport numpy as np\nimport time\nimport copy\n\nclass EarlyStopping(Exception):\n ...
[ [ "torch.no_grad", "torch.utils.tensorboard.SummaryWriter" ] ]
cattidea/VinVL-Paddle
[ "4e2d4410110b74352fbed11d437e90fce2834950" ]
[ "tools/train_retrieval.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport time\nimport random\nimport logging\nimport argparse\nimport numpy as np\n\n# paddle\nimport paddle\nimport paddle.nn as nn\nimport paddle.nn.functional as F\nfrom paddle.io import DataLoader, BatchSampler, DistributedBatchSampler\n\n# model\nfro...
[ [ "numpy.prod" ] ]
clbarras/pyannote-audio
[ "73c4fe7311d4a1314f18c11fea60aca6bc7e5359" ]
[ "pyannote/audio/labeling/tasks/overlap_detection.py" ]
[ "#!/usr/bin/env python\n# encoding: utf-8\n\n# The MIT License (MIT)\n\n# Copyright (c) 2019-2020 CNRS\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, includin...
[ [ "numpy.array", "numpy.random.rand", "numpy.log", "numpy.sum", "numpy.mean", "numpy.random.shuffle", "numpy.random.random_sample", "numpy.int64", "numpy.random.random" ] ]
konabuta/azureml-hybrid
[ "9073d70c617e6e27788db5d5cdff1ee359e81c41" ]
[ "examples/code/pytorch-hyperdrive/train.py" ]
[ "import os\nimport argparse\nimport torch\nimport torch.optim as optim\nimport torchvision\nimport torchvision.transforms as transforms\n\nfrom model import Net\nfrom azureml.core import Run\n\nrun = Run.get_context()\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser()\n parser.add_argument(\...
[ [ "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader" ] ]
Reself-C/AI_Hackathon_Molecular_Dynamics
[ "623e38f4d7533e6e065cdc1317e57e37aadd5dc0" ]
[ "codes/model/seqmodel.py" ]
[ "from sympy import im\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .transformers.transformer import Transformer\n\nclass SeqModel(nn.Module):\n def __init__(self) -> None:\n super().__init__()\n self.T = Transformer()\n self.fc1 = nn.Linear(3, 5)\n sel...
[ [ "torch.nn.Linear", "torch.nn.functional.relu", "torch.stack", "torch.mean" ] ]
DiogoM1/si
[ "cea8eeec265b2d4c4f6351dfd07b471309817053" ]
[ "src/si/util/cv.py" ]
[ "# -*- coding: utf-8 -*-\n# ----------------------------------------------------------------------------\n# Created By : Vítor Pereira\n# Created Date: 01-09-2021\n# version ='0.0.1'\n# ---------------------------------------------------------------------------\n\"\"\"Cross Validation module\"\"\"\n# -------------...
[ [ "numpy.all", "pandas.DataFrame", "numpy.ma.apply_along_axis" ] ]
hikopensource/DAVAR-Lab-OCR
[ "c65285f6668864cca7a12770ae4c8d083ea1cf1b" ]
[ "davarocr/davarocr/davar_table/core/post_processing/generate_html.py" ]
[ "\"\"\"\n##################################################################################################\n# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.\n# Filename : generate_html.py\n# Abstract : generate html from area, which is the interme...
[ [ "numpy.zeros" ] ]
twebr/libspn-keras
[ "b5f107899795634f011b0e0bfedce182c0e87568" ]
[ "tests/test_dynamic_spn.py" ]
[ "import tensorflow as tf\nfrom tensorflow import test as tftest\n\nfrom tests.utils import get_discrete_data\nfrom tests.utils import get_dynamic_model\nfrom tests.utils import NUM_VARS\n\ntf.config.experimental_run_functions_eagerly(True)\n\n\nclass TestDynamicSPN(tftest.TestCase):\n @classmethod\n def setUp...
[ [ "tensorflow.pad", "tensorflow.config.experimental_run_functions_eagerly", "tensorflow.reduce_logsumexp", "tensorflow.concat" ] ]
yusugomori/tftf
[ "e98b9ddffdbaa1fe04320437a47f12f3182ab6f3" ]
[ "examples/lstm_imdb.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom sklearn.model_selection import train_test_split\nfrom tftf.datasets import load_imdb\nfrom tftf.layers \\\n import Dense, Activation, RNN, LSTM, Embedding\nfrom tftf.preprocessing.sequence import Pad\nfrom tftf.preprocessing.sequence import pad_sequences, sort\n...
[ [ "numpy.random.seed", "tensorflow.set_random_seed", "sklearn.model_selection.train_test_split" ] ]
ocareyde/qiskit-terra
[ "6a2602a9ecf9b1a3345de1516b873ac7b3da587f" ]
[ "qiskit/opflow/gradients/circuit_qfis/lin_comb_full.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2020, 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.conj", "numpy.abs", "numpy.conjugate" ] ]
sarthakbatragatech/style_transfer
[ "a29a43b2b161784a51dc81c75c4320abf683e67b" ]
[ "utils.py" ]
[ "from PIL import Image\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n# efficient gradient descents\nimport torch.optim as optim\n# Prevent browser caching of generated image\nimport time\n#to deep copy the models\nimport copy\nimport os\n\n# Function to chec...
[ [ "torch.nn.Sequential", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "torch.nn.functional.mse_loss", "torch.nn.ReLU", "torch.tensor", "matplotlib.pyplot.imshow" ] ]
jeffskinnerbox/people-counter
[ "f4381ee82df11f30d98673d0bba403c3350a8463" ]
[ "app.py" ]
[ "#!/usr/bin/python3\n#\n# Maintainer: jeffskinnerbox@yahoo.com / www.jeffskinnerbox.me\n# Version: 0.4.1\n#\n# USAGE:\n# python3 app.py -s picamera - using pi camera and no trace messages\n\n# Source: \"People Counter\" series of blog by Federico Mejia Barajas\n# http://www.femb.com.mx/people-c...
[ [ "numpy.array", "numpy.ones", "numpy.array_str" ] ]
louisl3grand/plancklens
[ "2a7d832e044da87f2833628816e0d74fe83743f7" ]
[ "plancklens/nhl.py" ]
[ "\"\"\"Calculation of semi-analytical noise biases module.\n\n\"\"\"\nfrom __future__ import print_function\n\nimport os\nimport pickle as pk\nimport numpy as np\nimport healpy as hp\n\nfrom plancklens import qresp, utils, utils_spin as uspin\nfrom plancklens.helpers import mpi, sql\n\n\ndef get_nhl(qe_key1, qe_key...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "scipy.interpolate.UnivariateSpline", "numpy.copy", "numpy.any", "numpy.arange", "numpy.append", "numpy.all", "numpy.unique" ] ]
mmmaaaggg/QABAT
[ "d6f20d926de047af6857e466cf28084d0ba69993" ]
[ "script/create_file_order.py" ]
[ "#! /usr/bin/env python\n# -*- coding:utf-8 -*-\n\"\"\"\n@author : MG\n@Time : 19-3-21 上午11:16\n@File : create_file_order.py\n@contact : mmmaaaggg@163.com\n@desc : 创建 file_order 文件,供测试使用\n\"\"\"\nimport pandas as pd\nimport os\n\n\ndef create_file(long_inst_id='', long_position=0, short_inst_id='', short_...
[ [ "pandas.DataFrame" ] ]
eddieluo01/pytorch
[ "e19f2e52adebd9ce36b8ac5302a9036662446d7f" ]
[ "torch/distributed/_shard/sharded_tensor/_ops/_common.py" ]
[ "# coding=utf-8\n\nfrom typing import List\n\nimport torch\nimport torch.distributed as dist\nfrom torch.distributed._shard.sharding_spec._internals import (\n get_split_size,\n get_chunked_dim_size,\n)\nfrom torch.distributed.nn.functional import (\n all_gather,\n all_to_all_single,\n)\n\n\ndef _handle...
[ [ "torch.cat", "torch.distributed._shard.sharding_spec._internals.get_chunked_dim_size", "torch.transpose", "torch.where", "torch.mul", "torch.abs", "torch.searchsorted", "torch.tensor", "torch.zeros_like", "torch.empty", "torch.Tensor", "torch.distributed.nn.function...
salesforce/precision-oncology-open
[ "ff31b34a18c38c575b90e7f05dda1d66465fc366", "ff31b34a18c38c575b90e7f05dda1d66465fc366" ]
[ "SSL/simclr/scripts/downstream_cnn/outcomes/no_lr_schedule/pod1/collect_results.py", "clinical_data_classifier/rtog_constants.py" ]
[ "import os\nimport numpy as np\n\ndir = \"/export/medical_ai/ucsf/ssl_rtog/simclr/model_resnet50_gp4plus_pretrained_lr=0.0005/distant_met_5year/no_lr_schedule/pod1\"\nrun_dirs = ['run1', 'run2', 'run3', 'run4', 'run5']\n\n\ndef extract_auc(dir_contents, prefix=\"testing\"):\n paths = [f for f in dir_contents if ...
[ [ "numpy.max", "numpy.array" ], [ "numpy.concatenate" ] ]
rickecon/OG-Core
[ "550410dd40610cf0caf1e9ab89b625c08a8a9cda" ]
[ "ogcore/tests/test_SS.py" ]
[ "'''\nTest of steady-state module\n'''\n\nimport multiprocessing\nfrom _pytest.fixtures import scope2index\nfrom distributed import Client, LocalCluster\nimport pytest\nimport numpy as np\nimport os\nimport pickle\nimport copy\nfrom ogcore import SS, utils, aggregates, household, constants\nfrom ogcore.parameters i...
[ [ "numpy.array", "numpy.zeros", "numpy.ones", "numpy.allclose", "numpy.abs", "numpy.absolute" ] ]
TsuTikgiau/Learning-to-Disentangle-Latent-Physical-Factors-for-Video-Prediction
[ "e2a45c62210c17d5cf595cb85ab476cd85cb93ad" ]
[ "video_prediction/datasets/collision_dataset.py" ]
[ "import itertools\nimport os\nimport re\n\nimport tensorflow as tf\n\nfrom video_prediction.datasets.base_dataset import VarLenFeatureVideoDataset\n\n\nclass CollisionDataset(VarLenFeatureVideoDataset):\n def __init__(self, *args, **kwargs):\n super(CollisionDataset, self).__init__(*args, **kwargs)\n ...
[ [ "tensorflow.image.decode_jpeg", "tensorflow.image.convert_image_dtype", "tensorflow.random_uniform", "tensorflow.reshape", "tensorflow.image.decode_and_crop_jpeg", "tensorflow.image.extract_jpeg_shape", "tensorflow.unstack" ] ]
iboraham/ds-class-notes
[ "4c2452c85a9f0ff530f77abe08fb2822d333f395" ]
[ "hands-on-ml2/src/fetch_housing_data/__init__.py" ]
[ "import os\nimport tarfile\nimport urllib\nimport pandas as pd\n\nDOWNLOAD_ROOT = \"https://raw.githubusercontent.com/ageron/handson-ml2/master/\"\nHOUSING_PATH = os.path.join(\"datasets\", \"housing\")\nHOUSING_URL = DOWNLOAD_ROOT + \"datasets/housing/housing.tgz\"\n\n\ndef fetch_housing_data(housing_url=HOUSING_U...
[ [ "pandas.read_csv" ] ]
IgiArdiyanto/PINTO_model_zoo
[ "9247b56a7dff37f28a8a7822a7ef4dd9adf7234d", "9247b56a7dff37f28a8a7822a7ef4dd9adf7234d", "9247b56a7dff37f28a8a7822a7ef4dd9adf7234d", "9247b56a7dff37f28a8a7822a7ef4dd9adf7234d", "9247b56a7dff37f28a8a7822a7ef4dd9adf7234d" ]
[ "216_Zero-DCE-TF/demo/demo_Zero-DCE-TF_tflite.py", "016_EfficientNet-lite/01_efficientnet_lite0/01_float32/03_float16_quantization.py", "213_TBEFN/demo/demo_TBEFN_tflite.py", "043_face_landmark/lib/core/api/keypoint.py", "061_U-2-Net/01_float32/u2net.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport copy\nimport time\nimport argparse\n\nimport cv2 as cv\nimport numpy as np\nimport tensorflow as tf\n\n\ndef run_inference(interpreter, input_size, image, use_post_process=False):\n original_image = cv.resize(image, dsize=(input_size[1], input_size[0]))\n ...
[ [ "numpy.array", "tensorflow.lite.Interpreter", "numpy.power", "numpy.clip", "numpy.expand_dims" ], [ "tensorflow.lite.TFLiteConverter.from_saved_model" ], [ "tensorflow.lite.Interpreter", "numpy.squeeze", "numpy.expand_dims", "numpy.clip" ], [ "numpy.max", ...
yeshaokai/mmpose_for_maDLC
[ "84efe0ff00de3d916086c8c5579eae17c1ef43cb" ]
[ "mmpose/datasets/datasets/bottom_up/bottom_up_mpii_map.py" ]
[ "import os\nfrom collections import OrderedDict, defaultdict\n\nimport json_tricks as json\nimport numpy as np\nimport xtcocotools\nfrom xtcocotools.coco import COCO\nfrom xtcocotools.cocoeval import COCOeval\n\nfrom mmpose.datasets.builder import DATASETS\nfrom .bottom_up_base_dataset import BottomUpBaseDataset\n\...
[ [ "numpy.array", "numpy.ceil", "numpy.zeros", "numpy.ones", "numpy.amax", "numpy.amin" ] ]
Abhishekvats1997/ResRep
[ "a05d9fbcdb97c9cbf5639131e55c1149d1fa9631" ]
[ "rr/resrep_builder.py" ]
[ "from rr.resrep_config import ResRepConfig\nfrom builder import ConvBuilder\nfrom base_config import BaseConfigByEpoch\nimport torch.nn as nn\nfrom rr.compactor import CompactorLayer\n\nclass ResRepBuilder(ConvBuilder):\n\n def __init__(self, base_config:BaseConfigByEpoch, resrep_config:ResRepConfig, mode='train...
[ [ "torch.nn.Conv2d" ] ]
MasayukiTanaka0412/megumi
[ "f7fc402611d86b4cbf86cbb8fa24d4742b571ed8" ]
[ "main.py" ]
[ "import sys\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\nimport csv\r\nimport pandas as pd\r\n\r\nprint('Started')\r\ninputfile = sys.argv[1]\r\nprint('input file = {}'.format(inputfile))\r\n\r\nidffile = sys.argv[2]\r\nprint('idf file = {}'.format(idffile))\r\n\r\noutfile = sys.argv[3]\r\nprin...
[ [ "pandas.DataFrame", "sklearn.feature_extraction.text.CountVectorizer" ] ]
everdoubling/byt5-Korean
[ "6676adb4157a9dd38f3374f547a57a12bb4c2e7d", "6676adb4157a9dd38f3374f547a57a12bb4c2e7d" ]
[ "dataset.py", "ape210k_t5_byt5.py" ]
[ "\n# The following code includes modification from t5, see LICENSE.\n\n# we are using tensorflow just for preprocessing (using codes from google/t5)\n# so force to use cpus\nimport os\ncuda_devices = os.environ[\"CUDA_VISIBLE_DEVICES\"]\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"-1\"\nimport tensorflow.compat.v2 as ...
[ [ "tensorflow.compat.v2.size", "tensorflow.compat.v2.config.experimental.list_physical_devices", "tensorflow.compat.v2.constant", "tensorflow.compat.v2.config.experimental.set_memory_growth" ], [ "pandas.read_csv", "torch.tensor" ] ]
soldierofhell/Towards-Realtime-MOT
[ "f564bbfb4d3e8ddc173ff83ed9e7d1462550e4cc" ]
[ "test.py" ]
[ "import argparse\nimport json\nimport time\nfrom pathlib import Path\n\nfrom sklearn import metrics\nfrom scipy import interpolate\nimport torch.nn.functional as F\nfrom models import *\nfrom utils.utils import *\nfrom torchvision.transforms import transforms as T\nfrom utils.datasets import LoadImagesAndLabels, Jo...
[ [ "torch.nn.functional.normalize", "scipy.interpolate.interp1d", "sklearn.metrics.roc_curve" ] ]
zenoengine/JORLDY
[ "1eb867e52a03e0282a55fa612cbc5b5de701ffe7" ]
[ "jorldy/core/agent/ppo.py" ]
[ "import torch\n\ntorch.backends.cudnn.benchmark = True\nimport torch.nn.functional as F\nfrom torch.distributions import Normal, Categorical\nimport numpy as np\n\nfrom .reinforce import REINFORCE\n\n\nclass PPO(REINFORCE):\n \"\"\"Proximal Policy Optimization (PPO) agent.\n\n Args:\n batch_size (int):...
[ [ "torch.distributions.Categorical", "torch.min", "torch.no_grad", "torch.distributions.Normal", "torch.normal", "numpy.mean", "numpy.random.shuffle", "torch.clamp", "torch.multinomial", "torch.nn.functional.mse_loss", "torch.tanh", "torch.argmax" ] ]
stdiff/emo-classifier
[ "211731a44022408c750b611383216ce0578f2d41" ]
[ "training/evaluation.py" ]
[ "from datetime import datetime\nfrom typing import Union, Optional\n\nimport numpy as np\nimport pandas as pd\nimport altair as alt\nfrom sklearn.metrics import precision_recall_curve, precision_recall_fscore_support\n\nfrom emo_classifier.classifiers.metrics import SimpleStats, stats_roc_auc\nfrom emo_classifier.m...
[ [ "sklearn.metrics.precision_recall_curve", "pandas.DataFrame", "sklearn.metrics.precision_recall_fscore_support", "sklearn.metrics.log_loss", "pandas.concat" ] ]
TropComplique/WESPE
[ "84738f1ed802a3f6a4a0549677d8137997fac617" ]
[ "utils.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import grad\nfrom torchvision.models import vgg19\nfrom scipy import signal\n\n\nclass ContentLoss(nn.Module):\n\n def __init__(self):\n super(ContentLoss, self).__init__()\n\n self.model ...
[ [ "torch.rand", "torch.cat", "torch.split", "torch.nn.Parameter", "scipy.signal.gaussian", "numpy.outer", "torch.Tensor", "torch.nn.functional.conv2d", "torch.pow" ] ]
OsmoSystems/osmo-jupyter
[ "adea072709c1f51b3d731a01d324cf15dcb2ec76" ]
[ "osmo_jupyter/spectrometer_test.py" ]
[ "import pkg_resources\nfrom unittest.mock import sentinel\n\nimport pandas as pd\nimport pytest\n\nfrom . import spectrometer as module\n\n\nFORMATTED_SPECTROMETER_DF = pd.DataFrame(\n {\n \"timestamp\": [\n \"2019-01-07 16:13:37.597000\",\n \"2019-01-07 16:13:42.397000\",\n ...
[ [ "pandas.DataFrame", "pandas.testing.assert_frame_equal" ] ]
geraldzakwan/non-task-oriented-chatbot-using-seq2seq
[ "8e561b4034933cd2f7b67908d0ce9489b8ac2b4f" ]
[ "chatbot_web/cornell_word_seq2seq_glove_predict_gru.py" ]
[ "from keras.models import Model\r\nfrom keras.layers.recurrent import GRU\r\nfrom keras.layers import Dense, Input, Embedding, Bidirectional, Concatenate\r\nfrom keras.preprocessing.sequence import pad_sequences\r\nimport numpy as np\r\nimport nltk\r\nimport os\r\nimport sys\r\nimport zipfile\r\nimport urllib.reque...
[ [ "numpy.array", "numpy.argmax", "numpy.load", "numpy.zeros" ] ]