repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
durham-abric/RoadDetector
[ "634b21384000abc5223d63f6030c6976263a204c" ]
[ "src/skeleton.py" ]
[ "from skimage.morphology import skeletonize, remove_small_objects, remove_small_holes\r\nfrom skimage import io\r\nimport numpy as np\r\nfrom matplotlib.pylab import plt\r\nimport cv2\r\nfrom other_tools import sknw\r\nimport os\r\nimport pandas as pd\r\nfrom functools import partial\r\nfrom itertools import tee\r\...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.norm", "scipy.spatial.distance.pdist", "numpy.squeeze", "pandas.DataFrame", "numpy.copy", "matplotlib.pylab.plt.savefig", "numpy.linalg.det", "numpy.degrees", "numpy.any", "matplotlib.pylab.plt.imshow", "numpy.argwhere",...
mskimm/sparkannoy
[ "76f82c5e41fd8ca1d5c186c96437dd8368ead261" ]
[ "data/dump.py" ]
[ "import sys\nimport h5py\nimport numpy as np\n\ntrain = h5py.File(sys.argv[1], 'r')['train']\narr = np.array(train, dtype='f4')\n\nwith open('../data/annoy/sample-glove-25-angular.txt', 'w') as f:\n for i, sample in enumerate(arr[:1000]):\n f.write(str(i) + '\\t' + ','.join([str(x) for x in sample]) + '\\...
[ [ "numpy.array" ] ]
v-liuwei/USTC2020-
[ "0ec4cf48cbd42a3cd71f8ed7c27201beaee19a8e" ]
[ "Lab1-Logistic_Regression/src/main.py" ]
[ "import numpy as np\nfrom model import LogisticRegression\n\n\n# load data\nx_train = np.load('./data/LR/train_data.npy')[:, 1:]\ny_train = np.load('./data/LR/train_target.npy')\nx_test = np.load('./data/LR/test_data.npy')[:, 1:]\ny_test = np.load('./data/LR/test_target.npy')\n\n# create an LR model and fit it\nlr ...
[ [ "numpy.load" ] ]
J535D165/asreview-wordcloud
[ "01aba8680f469455ab70dd27965f0507e38fbd7d" ]
[ "asreviewcontrib/wordcloud/entrypoint.py" ]
[ "# Copyright 2020 The ASReview 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 requir...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.set_title", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
ukky17/ori_selectivity_CNN
[ "2c32d82c1331cb2a8767ed2de68060f1ac8acea5" ]
[ "utils.py" ]
[ "import numpy as np\n\nfrom keras.datasets import cifar10\nfrom keras.utils import to_categorical\n\ndef prepare_train_test():\n # load\n (x_train, y_train), (x_test, y_test) = cifar10.load_data()\n x_train = x_train.astype('float32')\n x_test = x_test.astype('float32')\n\n # standardization\n x_t...
[ [ "numpy.mean" ] ]
mshicom/Klampt
[ "79f983a790a0ac201af484ba64f68ebc21acc6c3" ]
[ "Python/klampt/io/numpy_convert.py" ]
[ "\"\"\"Conversions to and from Numpy objects; makes numerical computations much\nmore convenient.\n\"\"\"\n\nimport numpy as np\nfrom klampt.math import so3,se3\nfrom ..model import types\n\nsupportedTypes = set(['Vector3','Point','Matrix3','Rotation','RigidTransform',\n 'Config','Configs','Trajectory',\n ...
[ [ "numpy.hstack", "numpy.array", "numpy.dot" ] ]
evgiz/variational-autoencoder
[ "61cec5d97c30580f073722be1ab4a0eae97067db" ]
[ "util.py" ]
[ "\"\"\"\nAuthor: Sigve Rokenes\nDate: February, 2019\n\nUtility functions for variational autoencoder\n\n\"\"\"\n\nimport skimage as sk\nfrom skimage import io\nimport tensorflow as tf\nimport numpy as np\n\n\n# ===================================== #\n# #\n# Utility ...
[ [ "numpy.array", "numpy.mean", "numpy.shape", "tensorflow.layers.conv2d", "tensorflow.layers.conv2d_transpose" ] ]
Terfno/learn_DL
[ "0e1f3049c2c342915e1b7237506029a42539029e" ]
[ "3/nn.py" ]
[ "import numpy as np\n\ndef sigmoid(x):\n return 1 / (1 + np.exp(-x))\n\ndef identity_function(x):\n return x\n\ndef init_network():\n network = {}\n\n network['W1'] = np.array([[0.1, 0.3, 0.5], [0.2, 0.4, 0.6]])\n network['b1'] = np.array([0.1, 0.2, 0.3])\n network['W2'] = np.array([[0.1, 0.4], [0.2, 0.5], [0...
[ [ "numpy.array", "numpy.dot", "numpy.exp" ] ]
SiftScience/transformers
[ "fedfc9853c4d50ac06aa07fda5c28dc625f5c045" ]
[ "transformers/data/processors/utils.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may...
[ [ "pandas.read_parquet" ] ]
byooooo/dispersant_screening_PAL
[ "e25acc82c18db209fbf29046780ca31835f587d0" ]
[ "work/wandb/run-20200807_173426-1hzb694b/code/work/gp_learning_curves.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\n\nimport os\n\nimport joblib\nimport numpy as np\nimport pandas as pd\nfrom six.moves import range\nfrom sklearn.feature_selection import VarianceThreshold\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import Stand...
[ [ "sklearn.model_selection.train_test_split", "sklearn.feature_selection.VarianceThreshold", "sklearn.preprocessing.StandardScaler" ] ]
Mario-Kart-Felix/nvae
[ "37b954977833198f2946830c68823b094cc00412" ]
[ "nvae/dataset.py" ]
[ "import os\nfrom glob import glob\n\nimport cv2\nimport h5py\nimport torch\nfrom torch.utils.data import Dataset\n\n\nclass ImageH5Dataset(Dataset):\n\n def __init__(self, dataset_path, img_dim):\n self.dataset_path = dataset_path\n self.img_dim = (img_dim, img_dim) if type(img_dim) == int else img...
[ [ "torch.tensor" ] ]
shadofren/deeposlandia
[ "3dcb511482aff9c62bffd383e92055920c7a7e85" ]
[ "tests/test_generators.py" ]
[ "\"\"\"Unit test related to the generator building and feeding\n\"\"\"\n\nimport pytest\n\nimport numpy as np\n\nfrom deeposlandia import generator, utils\n\n\ndef test_feature_detection_labelling_concise():\n \"\"\"Test `feature_detection_labelling` function in `generator` module by considering a concise\n l...
[ [ "numpy.array", "numpy.amax", "numpy.amin" ] ]
MarcWong/tensorpack
[ "b7e411a75ca252fda46fc3cf1887687c875abe23", "51ab279480dc1e3ffdc07884a9e8149dea9651e9" ]
[ "examples/OnAVOS/datasets/DAVIS/DAVIS.py", "examples/CTC-TIMIT/create-lmdb.py" ]
[ "import glob\nimport tensorflow as tf\nfrom datasets.Dataset import ImageDataset\nfrom datasets.Util.Util import username, unique_list\nfrom datasets.Util.Reader import load_label_default\n\nNUM_CLASSES = 2\nVOID_LABEL = 255 # for translation augmentation\nDAVIS_DEFAULT_PATH = \"/fastwork/\" + username() + \"/mywo...
[ [ "tensorflow.reduce_max" ], [ "numpy.concatenate", "scipy.io.wavfile.read", "numpy.asarray" ] ]
cubensys/pysal
[ "8d50990f6e6603ba79ae1a887a20a1e3a0734e51", "8d50990f6e6603ba79ae1a887a20a1e3a0734e51", "8d50990f6e6603ba79ae1a887a20a1e3a0734e51" ]
[ "pysal/contrib/glm/utils.py", "pysal/spreg/tests/test_error_sp.py", "pysal/spreg/tests/test_ols_sparse.py" ]
[ "\nfrom __future__ import absolute_import, print_function\nimport numpy as np\nimport warnings\n\n\ndef _bit_length_26(x):\n if x == 0:\n return 0\n elif x == 1:\n return 1\n else:\n return len(bin(x)) - 2\n\n\ntry:\n from scipy.lib._version import NumpyVersion\nexcept ImportError:\...
[ [ "numpy.asarray", "numpy.sum", "numpy.finfo", "scipy.lib._version.NumpyVersion", "numpy.linalg.svd" ], [ "numpy.testing.assert_allclose", "numpy.array", "numpy.reshape", "numpy.ones", "scipy.__version__.split", "numpy.diag" ], [ "numpy.testing.assert_allclose...
YuhangSong/pytorch-a2c-ppo-acktr
[ "a018fd9ef640a60cef75f01f9e95ecff383b6a81" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom running_stat import ObsNorm\nfrom distributions import Categorical, DiagGaussian\n\n\ndef weights_init(m):\n classname = m.__class__.__name__\n if classname.find('Conv') != -1 or classname.find('Linear') != -1:\n nn.init.orthog...
[ [ "torch.nn.Linear", "torch.nn.init.orthogonal", "torch.nn.Conv2d", "torch.nn.init.calculate_gain", "torch.nn.functional.relu", "torch.nn.functional.tanh" ] ]
asl-epfl/sml_icassp2021
[ "ed64c487c59a53d59f5d8676adbbb7a22d08cf88" ]
[ "social_learning.py" ]
[ "import numpy as np\nimport torch\nimport nn\nfrom parameters import *\nfrom generate_data import *\nimport matplotlib.pyplot as plt\n\n#%%\n\ndef generate_sc_graph(num_agents):\n '''\n Generate strongly connected graph.\n\n Parameters\n ----------\n num_agents: int\n number of agents\n\n R...
[ [ "numpy.array", "numpy.random.choice", "numpy.log", "numpy.sum", "numpy.eye" ] ]
bGhorbani/linearized_neural_networks
[ "a6d987d960988595ec1e5ec69e211535f1d4921b" ]
[ "NTK_Kernel_Gen.py" ]
[ "\"\"\"\r\nThis code implements functionalities required for computing the NT Kernel for multi-layer\r\nfully-connected neural networks. The computed kernels are saved to the disk. \r\n\r\nThe code is written for Python 3.6. \r\n\r\nInputs: \r\n\tnoise_id: The index of the noise intensity: valid range 0 to 14.\r\n\...
[ [ "numpy.int", "numpy.save", "numpy.zeros" ] ]
Bhavay192/GANmapper
[ "e059e8485c280d51b70dcfad7fb9c9d1324a9217" ]
[ "options/base_options.py" ]
[ "import argparse\nimport os\nfrom util import util\nimport torch\nimport models\nimport data\n\n\nclass BaseOptions():\n \"\"\"This class defines options used during both training and test time.\n\n It also implements several helper functions such as parsing, printing, and saving the options.\n It also gat...
[ [ "torch.cuda.set_device" ] ]
DrPanigrahi/RoboND-Perception-Project
[ "5d755c4a82ef4f7e4bc99c836ae5e03dbda03dcd" ]
[ "sensor_stick/scripts/kmeans_clustering.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport cv2\n\n# Define a function to generate clusters\ndef cluster_gen(n_clusters, pts_minmax=(10, 100), x_mult=(1, 4), y_mult=(1, 3), \n x_off=(0, 50), y_off=(0, 50)):\n \n # n_clusters = number of clusters to generate\n # pts_minmax = ...
[ [ "numpy.max", "numpy.concatenate", "numpy.zeros_like", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "numpy.min", "numpy.random.randn", "matplotlib.pyplot.figure", "numpy.random.randint", "matplotlib.pyplot.s...
alvii147/stumpy
[ "5f192a0a41fbb44f144cc4b676d525f19aaeaa98" ]
[ "stumpy/stump.py" ]
[ "# STUMPY\n# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.\n# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.\n\nimport logging\n\nimport numpy as np\nfrom numba import njit, prange\nimport numba\n\nfrom . import core, config\nfrom .aamp import aamp...
[ [ "numpy.full", "numpy.ceil", "numpy.dot", "numpy.empty", "numpy.arange", "numpy.sqrt", "numpy.abs" ] ]
rmst/rlrd
[ "05a5329066dcabfb7278ec8745890bc2e7edce15" ]
[ "rlrd/dcac.py" ]
[ "# Delay Correcting Actor-Critic\n\nfrom copy import deepcopy\nfrom dataclasses import dataclass\nfrom functools import reduce\nimport torch\nfrom torch.nn.functional import mse_loss\nimport rlrd.sac\nfrom rlrd.memory import TrajMemoryNoHidden\nfrom rlrd.nn import no_grad, exponential_moving_average\nfrom rlrd.util...
[ [ "torch.zeros", "torch.stack", "torch.min", "torch.max", "torch.no_grad", "torch.ones", "torch.nn.functional.mse_loss", "torch.where" ] ]
aadland6/OutlierScores
[ "9044b4638f0383429d2ce67a893a4c8daceef7f1" ]
[ "outlier_detection.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Oct 16 08:15:33 2017\n\n@author: maadland\n\"\"\"\nimport pandas as pd\nimport numpy as np\nfrom sklearn.datasets import load_digits\nfrom sklearn.decomposition import PCA\nfrom sklearn.ensemble import IsolationForest\nfrom sklearn.neighbors.lof import LocalOutlierFa...
[ [ "numpy.random.RandomState", "numpy.median", "numpy.percentile", "sklearn.neighbors.lof.LocalOutlierFactor", "sklearn.ensemble.IsolationForest", "numpy.abs", "pandas.concat", "pandas.read_csv", "sklearn.decomposition.PCA" ] ]
Weakcat/Reinforcement-Learning
[ "9368e13571480053a58f40f3b4fbe5b94927f3bc" ]
[ "chapter06/cliff_walking.py" ]
[ "#######################################################################\n# Copyright (C) #\n# 2016-2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# 2016 Kenta Shimada(hyperkentakun@gmail.com) #\n# Permission given to m...
[ [ "matplotlib.use", "numpy.max", "numpy.random.binomial", "numpy.random.choice", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "numpy.c...
colinpoler/case-name-changer
[ "e3cd3880607f2eacb567e97188f04da7b2728f3e" ]
[ "nameutils.py" ]
[ "import re\nimport pandas as pd\nimport json\nimport random\nfrom functools import partial\n\n# Tzioumis, Konstantinos (2018) Demographic aspects of first names, Scientific Data, 5:180025 [dx.doi.org/10.1038/sdata.2018.25].\nfirstnames=pd.read_csv('firstnames.csv')\n# https://github.com/fivethirtyeight/data/tree/ma...
[ [ "pandas.read_csv" ] ]
BU-Lisp/ogb
[ "882786c0b71f5c836275c03b8554ad919bfe34e4", "1d6dde8080261931bc6ce2491e9149298af1ea98" ]
[ "examples/linkproppred/wikikg2/run.py", "examples/graphproppred/code/main_pyg.py" ]
[ "#!/usr/bin/python3\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport json\nimport logging\nimport os\nimport re\nimport random\n\nimport numpy as np\nimport torch\n\nfrom torch.utils.data import DataLoader\n\nfrom model impo...
[ [ "numpy.concatenate", "numpy.full", "numpy.array", "torch.load" ], [ "torch.device", "numpy.array", "torch.cat", "torch.argmax", "numpy.sum", "torch.save", "torch.no_grad", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss" ] ]
OsmanMalik/TM-GCN
[ "275d057a7261d8e6b544dad66b7daa7943d11c4f", "275d057a7261d8e6b544dad66b7daa7943d11c4f" ]
[ "TM-GCN-master/experiment_amlsim_baseline.py", "TM-GCN-master/embedding_help_functions.py" ]
[ "# This version of the amlsim experiment imports data preprocessed in Matlab, and uses the GCN baseline\n\n# Imports and aliases\nimport pickle\nimport torch as t\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nimport torchvision.datasets as datasets\nimport numpy as np\nimport matplotl...
[ [ "numpy.max", "torch.Size", "torch.zeros", "torch.argmax", "numpy.zeros", "torch.no_grad", "scipy.io.loadmat", "torch.tensor", "torch.sparse.sum", "torch.nn.CrossEntropyLoss", "torch.sum" ], [ "torch.nn.Linear", "torch.cat", "torch.nn.SELU", "torch.nn...
NuriaValls/PSO-2RW-Applications
[ "129b75ec72fcb32bc9bf43c0ad3bf55c44423092" ]
[ "Base_PSO/Visualization/boxplot.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\n\nfile1 = open('parabola.txt')\nfile2 = open('ackley.txt')\nfile3 = open('mmaxmmin.txt')\nfile4 = open('rosenbrock.txt')\n\n\nit1 = []\nit2 = []\nit3 = []\nit4 = []\np = 0\n\nfor line in file1:\n aux = line.rstrip('\\n').split(' ')\n it1.append(int(aux[2...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
ytchx1999/MAXP_DGL_Graph
[ "01ea0dc3e6f957b8c7a9b6958df02559f1866b32" ]
[ "gnn/utils.py" ]
[ "# -*- coding:utf-8 -*-\n\n\"\"\"\n Utilities to handel graph data\n\"\"\"\n\nimport os\nimport dgl\nimport pickle\nimport numpy as np\nimport torch as th\nfrom ogb.nodeproppred import DglNodePropPredDataset\n\n\ndef load_dgl_graph(base_path):\n \"\"\"\n 读取预处理的Graph,Feature和Label文件,并构建相应的数据供训练代码使用。\n\n ...
[ [ "torch.from_numpy" ] ]
wangzhen263/allennlp
[ "309b2b572aeb0677511b4f972281ac265d7477a9" ]
[ "allennlp/nn/cov_beam_search.py" ]
[ "from typing import List, Callable, Tuple, Dict\nimport warnings\n\nimport torch\nimport ipdb\n\nfrom allennlp.common.checks import ConfigurationError\n\n\nStateType = Dict[str, torch.Tensor] # pylint: disable=invalid-name\nStepFunctionType = Callable[[torch.Tensor, StateType], Tuple[torch.Tensor, StateType]] # p...
[ [ "torch.isfinite", "torch.where" ] ]
huuthieu/pytorch-yolov4-tiny
[ "fac82da75e161221af74b56242272a42cf64c17e" ]
[ "utils/utils_bbox.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nfrom torchvision.ops import nms\r\nimport numpy as np\r\n\r\nclass DecodeBox():\r\n def __init__(self, anchors, num_classes, input_shape, anchors_mask = [[6,7,8], [3,4,5], [0,1,2]]):\r\n super(DecodeBox, self).__init__()\r\n self.anchors = anchors\r\...
[ [ "numpy.concatenate", "torch.sigmoid", "numpy.array", "torch.cat", "torch.max", "numpy.min", "torch.linspace", "torch.Tensor", "torch.exp" ] ]
yzh211/pgmpy
[ "f3abe04abb75db9f51f333ecf9429a8700477b55", "f3abe04abb75db9f51f333ecf9429a8700477b55" ]
[ "pgmpy/tests/test_factors/test_continuous/test_Canonical_Factor.py", "pgmpy/sampling/HMC.py" ]
[ "import unittest\n\nimport numpy as np\nimport numpy.testing as np_test\n\nfrom pgmpy.factors.distributions import GaussianDistribution as JGD\nfrom pgmpy.factors.continuous import CanonicalDistribution\n\n\nclass TestCanonicalFactor(unittest.TestCase):\n def test_class_init(self):\n phi = CanonicalDistri...
[ [ "numpy.testing.assert_almost_equal", "numpy.array", "numpy.testing.assert_array_equal" ], [ "numpy.dot", "numpy.random.rand", "numpy.log", "numpy.zeros", "numpy.exp" ] ]
inonchiu/PyMaG
[ "ca6146cd354fd35be1eb21669bf505ff1acd3cb5" ]
[ "pymag/utils/matching.py" ]
[ "#!/usr/bin/env python\n\n##################################\n#\n# Utils for PyMag\n#\n##################################\n\nimport numpy as np\nfrom math import *\n\ntry:\n from scipy.spatial import cKDTree as KDT\nexcept ImportError:\n from scipy.spatial import KDTree as KDT\n\n\n\n# ---\n# matching unique ...
[ [ "numpy.array", "numpy.random.random_integers", "numpy.sum", "numpy.shape", "scipy.spatial.KDTree", "numpy.arange", "numpy.in1d" ] ]
LSSTDESC/firecrown
[ "646c15809b48a528a833d2bef3b180b91c3af189" ]
[ "firecrown/ccl/sources/sources.py" ]
[ "import numpy as np\nfrom scipy.interpolate import Akima1DInterpolator\n\nimport pyccl as ccl\n\nfrom ..core import Source\nfrom ..systematics import IdentityFunctionMOR, TopHatSelectionFunction\n\n\n__all__ = ['WLSource', 'NumberCountsSource', 'ClusterSource', 'CMBLSource']\n\n\nclass WLSource(Source):\n \"\"\"...
[ [ "scipy.interpolate.Akima1DInterpolator", "numpy.ones_like", "numpy.argsort" ] ]
mfrasquet/valenbisi
[ "1af47664bef31df7469645e83f32fd007b2f23d8" ]
[ "plot1.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Oct 9 19:53:39 2019\n\n@author: miguel\n\"\"\"\nimport pandas as pd\nfrom datetime import datetime\nimport matplotlib.pyplot as plt \n\n\ndata=pd.read_csv('bikes.csv', sep='\\t',index_col=False)\n\n\nweek_day=[]\nfor i in range(0,len(data)):\...
[ [ "matplotlib.pyplot.scatter", "pandas.read_csv", "matplotlib.pyplot.subplots" ] ]
BigDataArchitecture/Assignment1
[ "98c02762c4927cef26a17e55533e94b34671c519" ]
[ "notebooks/eie-sevir/sevir/utils_pytorch.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\nimport h5py\n\nfrom torch.utils.data import Dataset\nfrom torch.utils.data import DataLoader\n\nos.environ[\"HDF5_USE_FILE_LOCKING\"] = 'FALSE'\nTYPES = ['vis', 'ir069', 'ir107', 'vil', 'lght']\nDEFAULT_CATALOG = '/home/gridsan/groups/EarthIntelligence/datasets/S...
[ [ "numpy.concatenate", "numpy.array", "numpy.reshape", "numpy.zeros", "pandas.DataFrame", "numpy.logical_and", "numpy.digitize", "numpy.prod", "numpy.arange", "torch.utils.data.DataLoader", "numpy.logical_or.reduce", "numpy.logical_and.reduce", "numpy.unique", ...
siduojiang/BERTVision
[ "01519bea0882fa72e86a1b62f2d0d52d22c26dfc" ]
[ "code/torch/common/trainers/H5_glue_trainer.py" ]
[ "# packages\nimport os, sys, datetime\nsys.path.append(\"C:/BERTVision/code/torch\")\nfrom common.evaluators.H5_glue_evaluator import H5_GLUE_Evaluator\nfrom utils.collate import collate_H5_GLUE\nfrom torch.cuda.amp import autocast\nimport torch\nfrom torch.utils.data import DataLoader\nfrom tqdm.auto import tqdm\n...
[ [ "torch.save", "torch.cuda.amp.autocast", "torch.utils.data.DataLoader" ] ]
mkitti/napari
[ "4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86", "4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86" ]
[ "napari/layers/points/_tests/test_points.py", "napari/conftest.py" ]
[ "from copy import copy\nfrom itertools import cycle, islice\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom vispy.color import get_colormap\n\nfrom napari._tests.utils import check_layer_world_data_extent\nfrom napari.layers import Points\nfrom napari.layers.points._points_utils import points_to_squ...
[ [ "numpy.concatenate", "numpy.testing.assert_allclose", "numpy.array", "numpy.add", "numpy.empty", "numpy.asarray", "numpy.repeat", "numpy.testing.assert_equal", "numpy.random.seed", "pandas.DataFrame", "numpy.ix_", "numpy.random.randint", "numpy.unique", "num...
culebron/erde
[ "9bbaaa1df46629a182c355413a120aa33dc6b377" ]
[ "tests/utils/test_utils.py" ]
[ "import geopandas as gpd\nimport pytest\nfrom erde import utils, read_df\nfrom erde.op import sjoin, buffer\nfrom shapely import wkt\nfrom shapely.geometry import LineString\n\npl1 = wkt.loads('LINESTRING (82.956142 55.050099,83.174036 54.923359,83.019111 54.845166,82.801218 54.963546,82.913163 55.043800,83.124060 ...
[ [ "numpy.radians" ] ]
akern40/pyro
[ "8633b7136946ab2ae2e16062503fe51c2aac8c38" ]
[ "pyro/distributions/transforms/planar.py" ]
[ "# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nimport math\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.distributions import Transform, constraints\n\nfrom pyro.distributions.conditional import ConditionalTransformModule\nfrom pyro...
[ [ "torch.Tensor", "torch.nn.functional.softplus" ] ]
ahjeongseo/MASN---Attend-What-You-Need-Motion-Appearance-Synergistic-Networks-for-Video-Question-Answering
[ "5ca3fc80cf37f7b6124070b1aae5bc599db8fa29" ]
[ "embed_loss.py" ]
[ "# --------------------------------------------------------\n# This code is modified from Jumpin2's repository.\n# https://github.com/Jumpin2/HGA\n# --------------------------------------------------------\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n# __all__ = ['MultipleChoiceLoss', ...
[ [ "torch.tensor", "torch.max" ] ]
ZivonZhang/mmdetection
[ "81272a42e606e5ab9d2ec13e91a39e31f78a61b4" ]
[ "mmdet/apis/inference.py" ]
[ "import mmcv\nimport numpy as np\nimport pycocotools.mask as maskUtils\nimport torch\n\nfrom mmdet.core import get_classes\nfrom mmdet.datasets import to_tensor\nfrom mmdet.datasets.transforms import ImageTransform\n\n\ndef _prepare_data(img, img_transform, cfg, device):\n ori_shape = img.shape\n img, img_sha...
[ [ "numpy.concatenate", "numpy.full", "torch.no_grad", "numpy.where", "numpy.random.randint", "numpy.vstack" ] ]
RaphaelDELAIR/traffic
[ "47591f39f83e22aff65ae06987bce238cd2dd353", "47591f39f83e22aff65ae06987bce238cd2dd353", "47591f39f83e22aff65ae06987bce238cd2dd353" ]
[ "traffic/core/traffic.py", "traffic/core/flight.py", "traffic/algorithms/navigation.py" ]
[ "import logging\nimport warnings\nfrom datetime import timedelta\nfrom pathlib import Path\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Dict,\n Iterable,\n Iterator,\n List,\n Optional,\n Set,\n Type,\n TypeVar,\n Union,\n overload,\n)\n\nimport pandas as pd\nim...
[ [ "pandas.DataFrame.from_records", "pandas.concat" ], [ "pandas.to_datetime", "numpy.pad", "pandas.Timedelta", "numpy.ones", "numpy.where", "numpy.radians", "numpy.stack", "numpy.timedelta64", "pandas.Series", "numpy.nanmax" ], [ "pandas.Timestamp", "n...
Gantulga9480/py2048
[ "4a1f9efab9fab4ab6c77232e2d74eaa326446e57" ]
[ "py2048/game_core.py" ]
[ "import numpy as np\nimport random\nimport copy\n\nUP = 0\nDOWN = 1\nLEFT = 2\nRIGHT = 3\nUNDO = 4 # Experimantal\nACTION_SPACE = 5 # 5 for +UNDO\nINPLACE = 5 # For animation\n\n\nclass Node:\n\n def __init__(self, value) -> None:\n self.value = value\n\n def __eq__(self, __o: object) -> bool:\n ...
[ [ "numpy.zeros" ] ]
gilbertmike/tugofwar-horserace
[ "504f9129dee1fec88daf3bcbf3714fec3db215cf" ]
[ "tugofwar_horserace/horserace.py" ]
[ "import numpy as np\n\nclass HorseRace:\n def __init__(self, quality_1: float, quality_2: float, thres: int):\n \"\"\"Creates a new simulation instance with two options with qualities\n `quality_1` and `quality_2`. Decision is made when threshold `thres`\n is reached.\n\n Every simula...
[ [ "numpy.random.rand", "numpy.zeros", "numpy.exp", "numpy.logical_and", "numpy.all" ] ]
2360673637/AIGames
[ "7d149cc2cff8fa626ee1c9e1ad7c39e1a724a5bb" ]
[ "AIPong/Algorithm_1/main.py" ]
[ "'''\n主函数\n作者: Charles\n公众号: Charles的皮卡丘\n'''\nimport config\nimport tensorflow as tf\nfrom nets.qNet import DQN\n\n\ndef main():\n\tsession = tf.InteractiveSession()\n\tDQN(config.options).train(session)\n\n\nif __name__ == '__main__':\n\tmain()" ]
[ [ "tensorflow.InteractiveSession" ] ]
manivaradarajan/tensorflow
[ "8ec19e0f48b0bfb74f67bd37c4c1ae2bce1d10f3" ]
[ "tensorflow/python/keras/metrics.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.array_ops.identity", "tensorflow.python.ops.math_ops.equal", "tensorflow.python.keras.utils.generic_utils.serialize_keras_object", "tensorflow.python.keras.utils.tf_utils.is_tensor_or_variable", "tensorflow.python.ops.math_ops.minimum", "tensorflow.python.framework.o...
anushkaray/mmsegmentation
[ "07cb3b809d59bd72cc11afd6a9ce96215e9aaf96" ]
[ "mmseg/apis/train.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport random\nimport warnings\n\nimport mmcv\nimport numpy as np\nimport torch\nimport torch.distributed as dist\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner import HOOKS, build_optimizer, build_runner, get_dist_info\nfrom ...
[ [ "torch.cuda.manual_seed_all", "numpy.random.seed", "torch.cuda.current_device", "torch.manual_seed", "torch.cuda.is_available", "numpy.random.randint", "torch.tensor", "torch.distributed.broadcast" ] ]
zabop/lightkurve
[ "d9c4c40f846aae7cb138e8943950058de3ffd8e7" ]
[ "lightkurve/interact_bls.py" ]
[ "\"\"\"This module provides helper functions for the `LightCurve.interact_bls()` feature.\"\"\"\nimport logging\nimport warnings\nimport numpy as np\nfrom astropy.convolution import convolve, Box1DKernel\n\nlog = logging.getLogger(__name__)\n\n# Import the optional AstroPy dependency, or print a friendly error othe...
[ [ "numpy.max", "numpy.median", "numpy.round", "numpy.min", "numpy.nanmin", "numpy.nanargmax", "numpy.argmax", "numpy.sort", "numpy.isfinite", "numpy.argsort", "numpy.log10", "numpy.nanmax" ] ]
RedHeadM/CCT
[ "bece91e7d2f84de96b0975aed12ef64bff833565" ]
[ "base/base_dataset.py" ]
[ "import random, math\nimport numpy as np\nimport cv2\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset\nfrom PIL import Image\nfrom torchvision import transforms\nfrom scipy import ndimage\nfrom math import ceil\n\nclass BaseDataSet(Dataset):\n def __init__(self, data_dir, spli...
[ [ "numpy.array", "numpy.uint8", "numpy.fliplr" ] ]
VidushB/Housing-Price-Prediction-with-feature-selection-and-linear-regression
[ "929dccf63d760e5ace3b74ed564014d80b674719" ]
[ "model.py" ]
[ "from sklearn.linear_model import LinearRegression\nfrom sklearn.model_selection import train_test_split\nmodel = LinearRegression()\nX=df_train.drop(\"SalePrice\",axis=1)\ny = df_train['SalePrice'].reset_index(drop = True)\nX_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.33, random_state=42)\nm...
[ [ "sklearn.model_selection.train_test_split", "sklearn.metrics.mean_squared_error", "sklearn.linear_model.LinearRegression" ] ]
robagar/teasneeze
[ "cff6a01de992162f69590decd935dedbcd2145c7" ]
[ "test/digits/collect_data.py" ]
[ "import json\nfrom itertools import count\nimport numpy as np\nfrom sklearn.datasets import load_digits\n\ncounters = []\nfor i in range(10):\n counters.append(count())\n\ndef make_entry(td):\n t,d = td\n i = next(counters[t])\n return {\n 'classification': str(t),\n 'image_path': 'images/...
[ [ "sklearn.datasets.load_digits" ] ]
woffett/pytorch-image-models
[ "d6ac5bbc481271efecee8bc8756caa864a253fdd" ]
[ "train.py" ]
[ "\nimport argparse\nimport time\nimport logging\nfrom datetime import datetime\n\ntry:\n from apex import amp\n from apex.parallel import DistributedDataParallel as DDP\n from apex.parallel import convert_syncbn_model\n has_apex = True\nexcept ImportError:\n from torch.nn.parallel import DistributedD...
[ [ "torch.distributed.get_world_size", "torch.cuda.synchronize", "torch.nn.SyncBatchNorm.convert_sync_batchnorm", "torch.distributed.init_process_group", "torch.no_grad", "torch.nn.parallel.DistributedDataParallel", "torch.manual_seed", "torch.cuda.set_device", "torch.distributed....
ParkerLab/PillowNet
[ "b511c38d62e6b847d6fe0bd9ef855dc458d94b91" ]
[ "predict.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nScript for generating predictions from a trained model.\nUse `predict.py -h` to see an auto-generated description of advanced options.\n\"\"\"\n\nimport argparse\nimport numpy as np\n\nfrom keras.models import load_model\nfrom tqdm import tqdm, trange\nimport pybedtools as pbt\nimpor...
[ [ "numpy.array", "numpy.arange", "numpy.zeros" ] ]
moneypi/SSD-pytorch
[ "25dc91db133a3575d656b2df68ffdf4ef1135233" ]
[ "utils/augmentations.py" ]
[ "import torch\nfrom torchvision import transforms\nimport cv2\nimport numpy as np\nimport types\nfrom numpy import random\n\n\ndef intersect(box_a, box_b):\n max_xy = np.minimum(box_a[:, 2:], box_b[2:])\n min_xy = np.maximum(box_a[:, :2], box_b[:2])\n inter = np.clip((max_xy - min_xy), a_min=0, a_max=np.in...
[ [ "numpy.array", "numpy.random.choice", "numpy.minimum", "numpy.random.uniform", "numpy.random.randint", "numpy.clip", "numpy.maximum" ] ]
DataverseLabs/pyinterpolate
[ "5e0caf0fd839324932918bb50bf0464fffbefb78" ]
[ "pyinterpolate/test/transform/test_prepare_kriging_data.py" ]
[ "import unittest\nimport numpy as np\nfrom pyinterpolate.transform.prepare_kriging_data import prepare_kriging_data\n\n\nclass TestPrepareKrigingData(unittest.TestCase):\n\n def test_prepare_kriging_data(self):\n EXPECTED_NUMBER_OF_NEIGHBORS = 1\n EXPECTED_OUTPUT = np.array([[13, 10, 9, 3]])\n ...
[ [ "numpy.array", "numpy.array_equal" ] ]
ArthurMor4is/grad-cam-covid-19-ct
[ "14474a635e7633c8382839582d2a2cd9ff98eb62" ]
[ "my_functions.py" ]
[ "import os\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow import keras\nimport matplotlib.pyplot as plt\nimport tensorflow_datasets as tfds\nfrom tensorflow.keras import layers\nimport matplotlib.cm as cm\nimport random\nimport glob\nfrom skimage.segmentation import chan_vese\nfrom shutil import copy...
[ [ "tensorflow.keras.preprocessing.image.load_img", "numpy.true_divide", "tensorflow.keras.preprocessing.image.array_to_img", "numpy.uint8", "tensorflow.GradientTape", "tensorflow.argmax", "tensorflow.squeeze", "numpy.arange", "matplotlib.pyplot.axis", "numpy.expand_dims", ...
JoshDumo/qiskit-terra
[ "6a2602a9ecf9b1a3345de1516b873ac7b3da587f" ]
[ "test/python/circuit/test_circuit_properties.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2018.\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.int64" ] ]
JackLonergan97/SOLikeT
[ "314fe3df3a3ccdda69a2b1142b433c5dd5997e44" ]
[ "soliket/gaussian.py" ]
[ "import numpy as np\nfrom typing import Optional, Sequence\n\nfrom cobaya.likelihood import Likelihood\nfrom cobaya.input import merge_info\nfrom cobaya.tools import recursive_update\n# from cobaya.conventions import empty_dict\n\nfrom collections import namedtuple\nfrom types import MappingProxyType\nempty_dict = ...
[ [ "numpy.loadtxt", "numpy.load" ] ]
yanhann10/afprop
[ "e7ebf8541d5224f417eb4e9209cf5012ebfe78b7" ]
[ "tests/test_afprop.py" ]
[ "import numpy as np\nimport pandas as pd\nimport pytest\nfrom afprop import afprop_vec\n\n\n# sample data with clusters for testing\nC1 = np.random.multivariate_normal(mean=[0, 0], cov=np.eye(2), size=30)\nC2 = np.random.multivariate_normal(mean=[4, 4], cov=np.eye(2), size=30)\nmydata = np.r_[C1, C2]\n\n\ndef test_...
[ [ "numpy.eye" ] ]
dani-lbnl/chainercv
[ "223fab7dd0045d57db02041d44368fe3e60ea433" ]
[ "chainercv/datasets/cityscapes/cityscapes_semantic_segmentation_dataset.py" ]
[ "import glob\nimport os\n\nimport numpy as np\n\nfrom chainer import dataset\nfrom chainer.dataset import download\nfrom chainercv.datasets.cityscapes.cityscapes_utils import cityscapes_labels\nfrom chainercv.utils import read_image\n\n\nclass CityscapesSemanticSegmentationDataset(dataset.DatasetMixin):\n\n \"\"...
[ [ "numpy.ones" ] ]
faheemali1997/SelfDrivingCar
[ "386cdaa063d51dab0409a114fa4b8a3a26b22302" ]
[ "pyipcam.py" ]
[ "import cv2\nimport urllib2\nimport numpy as np\nimport sys\n\nhost = \"192.168.0.220:8080\"\nif len(sys.argv)>1:\n host = sys.argv[1]\n\nhoststr = 'http://' + host + '/video'\nprint ('Streaming ' + hoststr)\n\nstream=urllib2.urlopen(hoststr)\n\nbytes=''\nwhile True:\n bytes+=stream.read(1024)\n a = bytes....
[ [ "numpy.fromstring" ] ]
NeerajBhadani/tensorflow
[ "8c849c65503fef22f49f7ab843803fca9c439bdf" ]
[ "tensorflow/python/framework/sparse_tensor_test.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.sparse_ops.sparse_tensor_dense_matmul", "tensorflow.python.framework.sparse_tensor.is_sparse", "numpy.array", "tensorflow.python.eager.context.graph_mode", "tensorflow.python.platform.googletest.main", "tensorflow.python.framework.tensor_shape.TensorShape", "tens...
scottrdavid/landlab
[ "bb8414df55b4e5fb9198468fadbe3c725ef60601" ]
[ "tests/io/shapefile/test_infer_dtype.py" ]
[ "import hypothesis.extra.numpy as hynp\nimport numpy as np\nimport pytest\nfrom hypothesis import assume, given\nfrom hypothesis.strategies import integers\nfrom numpy.testing import assert_array_equal\n\nfrom landlab.io.shapefile.read_shapefile import _infer_data_type\n\n\n@pytest.mark.parametrize(\"src_type\", [n...
[ [ "numpy.testing.assert_array_equal", "numpy.asarray", "numpy.issubdtype" ] ]
bh107/bohrium
[ "5b83e7117285fefc7779ed0e9acb0f8e74c7e068" ]
[ "bridge/npbackend/bohrium/contexts.py" ]
[ "\"\"\"\nBohrium Contexts\n================\n\"\"\"\nimport sys\nimport os\nfrom . import backend_messaging as messaging\n\n\nclass EnableBohrium:\n \"\"\"Enable Bohrium within the context\"\"\"\n\n def __init__(self):\n # In order to avoid complications, we import common libraries BEFORE enabling Bohr...
[ [ "matplotlib.use" ] ]
BraunPenguin/InstanceSegmentation-Detectron2
[ "f26036bffa96901f55f2bbc2fcbdf77839bd5161" ]
[ "Utility/AnalyzeTiltInstance.py" ]
[ "import sys\nimport os\nimport pickle\nimport joblib\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nfrom shapely.geometry import Point, LineString, MultiLineString, Polygon\nfrom shapely.strtree import STRtree\nfrom shapely import affinity\nfrom skimage.measure import l...
[ [ "numpy.max", "numpy.array", "numpy.ceil", "numpy.asarray", "matplotlib.pyplot.autoscale", "numpy.rad2deg", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "numpy.linspace", "numpy.mean", "numpy.std", "matplotlib.pyplot.scatter...
dmitryvinn/pytext
[ "43373462d1b9bada3ba02072aed78338d3bb3a12" ]
[ "pytext/models/representations/transformer/luna_sentence_encoder.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport math\nfrom typing import Callable, Optional\n\nimport torch\nfrom fairseq import utils\nfrom fairseq.modules import LayerNorm, PositionalEmbedding, LayerDropModuleList\nfrom fairseq.modules.fairseq_dropout impo...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cos", "torch.nn.ModuleList", "torch.arange", "torch.sin", "torch.nn.init.normal_", "torch.Tensor", "torch.nn.Embedding" ] ]
me-manu/fastespy
[ "7bf1fef68239c7d69c0917a51f24d48e9ad14728", "7bf1fef68239c7d69c0917a51f24d48e9ad14728" ]
[ "fastespy/io/rootdata.py", "fastespy/mlkeras/models.py" ]
[ "from __future__ import absolute_import, division, print_function\nimport ROOT as root\nimport glob\nimport os\nimport numpy as np\nimport time\nimport logging\n\n\ndef readgraph(directory, split = '-', overwrite = False, inputid = 'in', prefix = ''):\n \"\"\"\n Read data from a ROOT graph and save as numpy n...
[ [ "numpy.full", "numpy.zeros", "numpy.load", "numpy.save", "numpy.savez" ], [ "numpy.exp", "tensorflow.keras.metrics.FalsePositives", "tensorflow.keras.Sequential", "tensorflow.keras.layers.Dense", "tensorflow.keras.losses.BinaryCrossentropy", "numpy.log", "tensor...
spyroot/shapenet
[ "31b95f25beff5129e0db31e798719ba555661685" ]
[ "shapegnet/model_config.py" ]
[ "# Graph Generator Model Configurator\n#\n# All trainer parameters abstracted in separate entity.\n#\n# - Trainer , Evaluator and the rest this class to configurator and store data.\n# It read yaml config file that users passes either as file name or io.string.\n#\n# Mustafa B\nimport os\nimport sys\nfrom os i...
[ [ "torch.cuda.is_available", "torch.utils.tensorboard.SummaryWriter", "torch.load" ] ]
kristofgiber/lingvo
[ "4c6405a3c8b29764918dbfb599212dd7620ccf9c", "4c6405a3c8b29764918dbfb599212dd7620ccf9c" ]
[ "lingvo/core/layers_test.py", "lingvo/core/recurrent_test.py" ]
[ "# Lint as: python2, python3\n# Copyright 2018 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/...
[ [ "numpy.square", "numpy.random.normal", "numpy.array", "numpy.array_repr", "numpy.random.rand", "numpy.asarray", "numpy.zeros", "numpy.random.seed", "numpy.sum", "numpy.ones", "tensorflow.python.framework.ops.reset_default_graph", "numpy.random.randint", "numpy.a...
guruprasaad123/all_dl_projects
[ "04c869f7f001ef94c467740260663d91a34815e0" ]
[ "GTSRB/init.py" ]
[ "# The German Traffic Sign Recognition Benchmark\n#\n# sample code for reading the traffic sign images and the\n# corresponding labels\n#\n# example:\n#\n# trainImages, trainLabels = readTrafficSigns('GTSRB/Training')\n# print len(trainLabels), len(trainImages)\n# plt.imshow(trainImages[42])\n# plt.show()\n#\n# hav...
[ [ "numpy.array" ] ]
sibeshkar/jiminy
[ "7754f86fb0f246e7d039ea0cbfd9950fcae4adfb" ]
[ "jiminy/gym/envs/box2d/car_racing.py" ]
[ "import sys, math\nimport numpy as np\n\nimport Box2D\nfrom Box2D.b2 import (edgeShape, circleShape, fixtureDef, polygonShape, revoluteJointDef, contactListener)\n\nimport jiminy.gym as gym\nfrom jiminy.gym import spaces\nfrom jiminy.gym.envs.box2d.car_dynamics import Car\nfrom jiminy.gym.utils import colorize, see...
[ [ "numpy.square", "numpy.array", "numpy.linalg.norm", "numpy.sign", "numpy.fromstring" ] ]
LoopTilingBenchmark/benchmark
[ "52a3d2e70216552a498fd91de02a2fa9cb62122c" ]
[ "ppo/baselines/common/tests/test_doc_examples.py" ]
[ "import pytest\ntry:\n import mujoco_py\n _mujoco_present = True\nexcept BaseException:\n mujoco_py = None\n _mujoco_present = False\n\n\n@pytest.mark.skipif(\n not _mujoco_present,\n reason='error loading mujoco - either mujoco / mujoco key not present, or LD_LIBRARY_PATH is not pointing to mujoc...
[ [ "tensorflow.Session", "tensorflow.global_variables_initializer" ] ]
chenzhihan2020/bert
[ "52883d912d1a626d9462a0c2d974761ae5b159e1" ]
[ "run_squad_final.py" ]
[ "# coding=utf-8\r\n# Copyright 2018 The Google AI Language Team Authors.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE...
[ [ "tensorflow.contrib.tpu.TPUEstimatorSpec", "tensorflow.data.TFRecordDataset", "tensorflow.train.Features", "tensorflow.contrib.tpu.TPUEstimator", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.nn.softmax", "tensorflow.one_hot", "tensorflow.logging.warning", "tensorf...
JieRen98/rlkit-pmoe
[ "5ef4e056764d2c4a8d6e4c6da89295304b1fec3f" ]
[ "rlkit/torch/sac/sac.py" ]
[ "from collections import OrderedDict\n\nimport numpy as np\nimport torch\nimport torch.optim as optim\nfrom torch import nn as nn\n\nimport rlkit.torch.pytorch_util as ptu\nfrom rlkit.core.eval_util import create_stats_ordered_dict\nfrom rlkit.torch.torch_rl_algorithm import TorchTrainer\n\n\nclass SACTrainer(Torch...
[ [ "numpy.prod", "torch.nn.MSELoss" ] ]
ferr26/toolMusicPlagiarism
[ "cc6985d9847ca5589b5a0792845b7e85ce80e634" ]
[ "spectClustering.py" ]
[ "import chars2vec\nimport csv\nfrom sklearn.cluster import SpectralClustering\n\n\ndef spectralClustering():\n words=[]\n\n with open('./datasetFit.csv') as csv_file:\n csv_reader = csv.reader(csv_file, delimiter=',')\n line_count = 0\n for row in csv_reader:\n if line_count ==...
[ [ "sklearn.cluster.SpectralClustering" ] ]
agamemnonc/axopy
[ "e8c324a4ecfc0abdec3016bca62dcf84d371b6c0" ]
[ "axopy/design.py" ]
[ "\"\"\"Task design containers.\"\"\"\n\nimport numpy\nimport random\nimport pprint\n\n__all__ = ['Design', 'Block', 'Trial', 'Array']\n\n\nclass Design(list):\n \"\"\"Top-level task design container.\n\n The :class:`Design` is a list of :class:`Block` objects, which themselves\n are lists of :class:`Trial`...
[ [ "numpy.empty", "numpy.zeros" ] ]
ieuTeamD/pangoro
[ "b093a995e0f4624c56f399ebf563b2b66ed5b700" ]
[ "tests/test.py" ]
[ "import unittest\nfrom pangoro.preprocessing import PangoroDataFrame\nimport pandas as pd\n\n\ndef broken_function():\n raise Exception('This is broken')\n\nclass TestDataFrame(unittest.TestCase):\n def test_simple_dataframe(self):\n df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})\n df2 = pd.Data...
[ [ "pandas.DataFrame", "pandas.to_numeric" ] ]
FrancaCassol/ctapipe
[ "1e62e6800bdd52625cc8657a8f47c7dda0bd44e0", "1e62e6800bdd52625cc8657a8f47c7dda0bd44e0", "1e62e6800bdd52625cc8657a8f47c7dda0bd44e0" ]
[ "ctapipe/visualization/bokeh.py", "examples/stereo_reconstruction.py", "ctapipe/image/tests/test_image_cleaner_component.py" ]
[ "import warnings\nimport numpy as np\nfrom bokeh.plotting import figure\nfrom bokeh.events import Tap\nfrom bokeh import palettes\nfrom bokeh.models import (\n ColumnDataSource,\n TapTool,\n Span,\n ColorBar,\n LinearColorMapper,\n)\nfrom ctapipe.utils.rgbtohex import intensity_to_hex\n\nPLOTARGS = d...
[ [ "numpy.full", "numpy.empty", "numpy.zeros", "numpy.ones", "numpy.nanmin", "numpy.arange", "numpy.sqrt", "numpy.nanmax" ], [ "matplotlib.pyplot.scatter", "matplotlib.pyplot.legend", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ], [ "numpy.zeros_li...
cameronaaron/unintended-ml-bias-analysis
[ "cdf3eb08398b367b4b05245b42551eb03aa848e2" ]
[ "unintended_ml_bias/model_bias_analysis.py" ]
[ "\"\"\"Analysis of model bias.\n\nWe look at differences in model scores as a way to compare bias in different\nmodels.\n\nThe functions in this file expect scored data in a data frame with columns:\n\n<text_col>: Column containing text of the example. This column name is\n passed in as a parameter of any functi...
[ [ "numpy.median", "pandas.DataFrame", "matplotlib.pyplot.gca", "scipy.stats.mannwhitneyu", "numpy.mean", "matplotlib.pyplot.figure", "numpy.std", "matplotlib.pyplot.hist", "numpy.subtract", "pandas.concat", "matplotlib.pyplot.show", "numpy.linspace", "sklearn.metr...
ryangillard/P-CEAD
[ "d4e95fa17112af07eb99cd581470bd3146d1c8e5" ]
[ "proganomaly_modules/training_module/trainer/export_berg.py" ]
[ "# Copyright 2020 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.abs", "tensorflow.expand_dims", "tensorflow.math.sigmoid", "tensorflow.ones_like", "tensorflow.greater", "tensorflow.math.reduce_prod", "tensorflow.cast" ] ]
mgomesborges/Stone-Soup
[ "39c7f02ce11e10c9b3c612ad359f6d8bca495266", "39c7f02ce11e10c9b3c612ad359f6d8bca495266" ]
[ "stonesoup/types/tests/test_state.py", "stonesoup/updater/tests/test_kalman.py" ]
[ "# -*- coding: utf-8 -*-\nimport datetime\n\nimport numpy as np\nimport pytest\n\nfrom ..angle import Bearing\nfrom ..array import StateVector, CovarianceMatrix\nfrom ..numeric import Probability\nfrom ..particle import Particle\nfrom ..state import State, GaussianState, ParticleState, \\\n StateMutableSequence,...
[ [ "numpy.diag", "numpy.array_equal" ], [ "numpy.allclose", "numpy.linalg.inv", "numpy.array", "numpy.array_equal" ] ]
lillekemiker/blmath
[ "817ebec258388e6136765a392972b0835cabce5b" ]
[ "blmath/geometry/primitives/plane.py" ]
[ "import numpy as np\nfrom blmath.numerics import vx\n\nclass Plane(object):\n '''\n A 2-D plane in 3-space (not a hyperplane).\n\n Params:\n - point_on_plane, plane_normal:\n 1 x 3 np.arrays\n '''\n\n def __init__(self, point_on_plane, unit_normal):\n if vx.almost_zero(unit_n...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.dot", "numpy.asarray", "scipy.spatial.cKDTree", "numpy.cov", "numpy.delete", "numpy.argmin", "numpy.logical_and", "numpy.greater_equal", "numpy.less_equal", "numpy.sign", "numpy.abs", "numpy.argsort", "numpy.all...
myracheng/pronear
[ "a92e97cd860900f3c535a72a1b867d8f5ad096ab" ]
[ "near_code/dsl/library_functions.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom .neural_functions import init_neural_function\n\n\n# TODO allow user to choose device\nif torch.cuda.is_available():\n device = 'cuda:0'\nelse:\n device = 'cpu'\n\nclass LibraryFunction:\n\n def __init__(self, submodules, input_type, output_type, input_size, out...
[ [ "torch.zeros", "torch.rand", "torch.cat", "torch.nn.Linear", "torch.arange", "torch.nn.Sigmoid", "torch.cuda.is_available", "torch.tensor", "torch.index_select" ] ]
tarepan/HiPPO
[ "bc23e2dba13da6c307cb5a4ae248c2d2c56d465f" ]
[ "datasets/utils.py" ]
[ "import math\nimport numpy as np\n\nimport torch\n\n\ndef bitreversal_po2(n):\n m = int(math.log(n)/math.log(2))\n perm = np.arange(n).reshape(n,1)\n for i in range(m):\n n1 = perm.shape[0]//2\n perm = np.hstack((perm[:n1],perm[n1:]))\n return perm.squeeze(0)\n\ndef bitreversal_permutation...
[ [ "numpy.extract", "numpy.arange", "numpy.hstack" ] ]
ryoyop/seldon-core
[ "83717e88717a4030d7f76f87c3a3b713cd73d276" ]
[ "python/seldon_core/seldon_methods.py" ]
[ "import logging\nimport os\nfrom typing import Any, Dict, List, Tuple, Union\n\nimport numpy as np\nimport yaml\nfrom google.protobuf import json_format\n\nfrom seldon_core.flask_utils import SeldonMicroserviceException\nfrom seldon_core.metadata import SeldonInvalidMetadataError, validate_model_metadata\nfrom seld...
[ [ "numpy.array" ] ]
RaulAstudillo06/BOCF
[ "68d19984385cdb27c9f6c5002c67fc9467bbe705" ]
[ "GPyOpt/optimization/acquisition_optimizer.py" ]
[ "# Copyright (c) 2016, the GPyOpt Authors\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\nfrom .optimizer import OptLbfgs, OptSGD, OptDirect, OptCma, apply_optimizer, choose_optimizer, apply_optimizer_inner\nfrom .anchor_points_generator import ObjectiveAnchorPointsGenerator, ThompsonSamplingAnchorP...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.asscalar", "numpy.vstack", "numpy.atleast_2d" ] ]
shishaochen/kfac
[ "3ee1bec8dcd851d50618cd542a8d1aff92512f7c" ]
[ "kfac/python/ops/layer_collection.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.compat.v1.cast", "tensorflow.compat.v1.colocate_with", "tensorflow.compat.v1.get_default_graph", "tensorflow.compat.v1.variable_scope", "tensorflow.compat.v1.get_variable_scope", "tensorflow.compat.v1.trainable_variables", "tensorflow.compat.v1.sqrt", "tensorflow.python...
agrawalayan/R-net-1
[ "1748d108a8248466d99cdf3c3f284619d88bcc73" ]
[ "src/generator_utils.py" ]
[ "from __future__ import print_function\nimport tensorflow as tf\nfrom tensorflow.python.ops import variable_scope\nfrom tensorflow.python.ops import nn_ops\n\ndef add_first_word_prob_to_atten_dists(in_passage_words, phrase_starts, vocab_dist, attn_dist):\n '''\n in_passage_words: [batch_size, passage_length]\...
[ [ "tensorflow.constant_initializer", "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.ops.variable_scope.get_variable", "tensorflow.multinomial", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.zeros_like", "tensorflow.clip_by_value", "tensorflow.s...
mengkai94/training
[ "2a0aa29e700a33e9d3bf2645d13d89fb525e29fc" ]
[ "object_detection/pytorch/tools/train_mlperf.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nr\"\"\"\nBasic training script for PyTorch\n\"\"\"\n\n# Set up custom environment before nearly anything else is imported\n# NOTE: this should be the first import (no not reorder)\nfrom maskrcnn_benchmark.utils.env import setup_environment #...
[ [ "torch.device", "torch.distributed.get_world_size", "torch.distributed.init_process_group", "torch.nn.parallel.DistributedDataParallel", "torch.manual_seed", "torch.cuda.set_device", "torch.distributed.is_initialized", "torch.distributed.broadcast" ] ]
s-m-e/poliastro
[ "3589806e6b10a5256c9069c5d7efbd4d67ff483a" ]
[ "tests/test_maneuver.py" ]
[ "import warnings\n\nimport numpy as np\nimport pytest\nfrom astropy import units as u\nfrom astropy.tests.helper import assert_quantity_allclose\nfrom astropy.time import Time\nfrom numpy.testing import assert_allclose\n\nfrom poliastro.bodies import Earth, Mercury, Moon\nfrom poliastro.maneuver import Maneuver\nfr...
[ [ "numpy.array", "numpy.ones", "numpy.zeros" ] ]
daliwang/CellMigrationGym
[ "5801024da812fea4bfce68c41e43f63c14c8400b" ]
[ "DRL/main.py" ]
[ "import matplotlib.pyplot as plt\n\n#env related package\nimport gym,pickle,time\nimport numpy as np\nimport pybullet as p\nimport Embryo\n\n#RL related package\nimport torch\n# from stable_baselines.common.vec_env import DummyVecEnv\n# from stable_baselines.deepq.policies import MlpPolicy\n# from stable_baselines ...
[ [ "matplotlib.pyplot.ion", "torch.cuda.is_available", "matplotlib.pyplot.figure" ] ]
Aearsears/mapleai
[ "38e067db2e90a21f941bd3c56d0a329741da9d0f" ]
[ "detect_draw.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Apr 10 14:57:25 2020\n\n\"\"\"\n\nimport numpy as np\nimport tensorflow as tf\nimport pandas as pd\nimport os\nimport csv\nimport cv2\nimport time\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom PIL import Image, ImageDraw, ImageFont\nfrom six import BytesI...
[ [ "tensorflow.io.gfile.GFile", "tensorflow.compat.v2.train.Checkpoint", "matplotlib.image.imsave", "tensorflow.reshape", "numpy.expand_dims" ] ]
Azganoth/unisul-machine-learning
[ "c5c8dd65b0084521e4f5f679f53fedb03207a9a2" ]
[ "marge_skinner.py" ]
[ "import numpy as np\nimport tkinter as tk\nimport tkinter.ttk as ttk\nfrom pathlib import Path\nfrom sklearn.naive_bayes import GaussianNB\nfrom sklearn.tree import DecisionTreeClassifier\nfrom itertools import islice\nfrom tkinter.messagebox import askyesnocancel, showwarning\nfrom tkinter.filedialog import askope...
[ [ "numpy.array", "sklearn.naive_bayes.GaussianNB", "sklearn.tree.DecisionTreeClassifier" ] ]
reddyprasade/Digit-Recognizer-with-Python
[ "75545c9f81889ef561deb7949778f748c0745794" ]
[ "Digit-Recognizer-with Python.py" ]
[ "# geport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\nfrom sklearn.datasets import load_digits\r\n\r\n# Data Set Loading Form Scikit-Learn\r\nData = load_digits()\r\nprint(\"Description of the Data Optical recognition of handwritten digits dataset\",Data.DESCR)\r\nprint(\"Orginal Data\"...
[ [ "matplotlib.pyplot.show", "sklearn.datasets.load_digits", "matplotlib.pyplot.imshow" ] ]
ebt-hpc/cca-ebt
[ "4e8a515207df6f4bc1538c734077b0c01b34effe" ]
[ "python/src/cca/ebt/make_loop_classifier.py" ]
[ "#!/usr/bin/env python3\n\n\n'''\n A script for making loop classifiers\n\n Copyright 2013-2018 RIKEN\n Copyright 2018-2020 Chiba Institute of Technology\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 ...
[ [ "numpy.array", "numpy.random.seed", "sklearn.neighbors.KNeighborsClassifier", "sklearn.svm.SVC", "sklearn.preprocessing.scale", "sklearn.metrics.accuracy_score", "sklearn.metrics.precision_score", "sklearn.metrics.f1_score", "sklearn.metrics.recall_score" ] ]
int-brain-lab/analysis
[ "effedfd0b5997411f576b4ebcc747c8613715c24" ]
[ "python/RT_analysis/RT_dist_plot.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Reaction time analysis from wheel data\n#\n# Return all significant wheel velocity changes in each trial\n#\n# Plot histrograms of the reaction times relative to either goCue or stimOn times\n#\n# Author: Naoki Hiratani (N.Hiratani@gmail.com)\n#\nfrom math import *\n\nimport sys\nimpo...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.hist", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axvline", "matplotlib.pyplot.subplot" ] ]
tomxi/guitar-set
[ "82cc1477758f3bc32d6c7fdaae2cdcaccd6cc2b0" ]
[ "mirapie/utils/wav.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCopyright (c) 2015, Antoine Liutkus, Inria\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n * Redistributions of source code must retain the above copyright\...
[ [ "numpy.fromstring", "numpy.zeros" ] ]
fermi-lat/BayesianBlocks
[ "83580da7938cfb7646d659974f727cc001e550cb", "83580da7938cfb7646d659974f727cc001e550cb" ]
[ "python/test_BB.py", "python/BayesianBlocks_python.py" ]
[ "\"\"\"\n@brief Comparison of C++ and pure Python implementations for the three\ndifferent modes (unbinned, binned, and point measurement). The\nreconstructions should be identical.\n\n@author J. Chiang\n\"\"\"\n#\n# $Header: /nfs/slac/g/glast/ground/cvs/ScienceTools-scons/BayesianBlocks/python/test_BB.py,v 1.1.1....
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.mean", "numpy.sqrt", "numpy.random.random", "numpy.linspace" ], [ "numpy.array", "numpy.ones", "numpy.zeros", "numpy.log" ] ]
mattl1598/testing
[ "cd8124773b83a07301c507ffbb9ccaafbfe7a274", "cd8124773b83a07301c507ffbb9ccaafbfe7a274", "cd8124773b83a07301c507ffbb9ccaafbfe7a274", "cd8124773b83a07301c507ffbb9ccaafbfe7a274", "cd8124773b83a07301c507ffbb9ccaafbfe7a274" ]
[ "editing files/Portable Python 3.2.5.1/App/Lib/site-packages/pandas/tseries/offsets.py", "editing files/Portable Python 3.2.5.1/App/Lib/site-packages/matplotlib/tight_bbox.py", "editing files/Portable Python 3.2.5.1/App/Lib/site-packages/IPython/extensions/rmagic.py", "editing files/Portable Python 3.2.5.1/Ap...
[ "from datetime import date, datetime, timedelta\n\nfrom pandas.tseries.tools import to_datetime\n\n# import after tools, dateutil check\nfrom dateutil.relativedelta import relativedelta\nimport pandas.lib as lib\nimport pandas.tslib as tslib\n\n__all__ = ['Day', 'BusinessDay', 'BDay',\n 'MonthBegin', 'BMo...
[ [ "pandas.tseries.tools.to_datetime", "pandas.tseries.frequencies.get_offset", "pandas.tseries.frequencies.to_offset", "pandas.tslib.monthrange" ], [ "matplotlib.transforms.Bbox.from_bounds", "matplotlib.transforms.Affine2D", "matplotlib.transforms.TransformedBbox" ], [ "nump...
ocNflag/point2seq
[ "710686f576b3df5469a06c66860758b25f852dbd" ]
[ "pcdet/models/dense_heads/e2e_seqfuse_head.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport matplotlib.pyplot as plt\nimport copy\nimport math\n\nfrom pcdet.ops.iou3d_nms.iou3d_nms_utils import boxes_iou3d_gpu\n\nfrom pcdet.models.dense_heads.utils import _sigmoid\n\nfrom ...utils import box_coder_utils, common_utils\nfrom pcdet.utils import...
[ [ "torch.cat", "torch.stack", "torch.nn.ModuleList", "torch.arange", "torch.no_grad", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.topk" ] ]