repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
DarkstartsUp/pyKinectAzure | [
"50e0e697cc2c7693c89ef13e3d0ec695e99f0aa4"
] | [
"examples/exampleSmoothDepthImageOpenCV.py"
] | [
"import sys\nsys.path.insert(1, '../pyKinectAzure/')\n\nimport numpy as np\nfrom pyKinectAzure import pyKinectAzure, _k4a, postProcessing\nimport cv2\n\n# Path to the module\n# TODO: Modify with the path containing the k4a.dll from the Azure Kinect SDK\nmodulePath = 'C:\\\\Program Files\\\\Azure Kinect SDK v1.4.1\\... | [
[
"numpy.concatenate",
"numpy.round"
]
] |
nedlrichards/tau_decomp | [
"77560307836f67ae68f3571fb6cd0fd9d831398d"
] | [
"reports/jasa/decomp_cnts.py"
] | [
"\"\"\"Overview plots of transcet\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import linregress\nfrom os.path import join\n\nfrom src import Section, Config\n\nplt.ion()\ncf = Config()\nsavedir = 'reports/jasa/figures'\n\ninputed = np.load('data/processed/inputed_decomp.npz')\nlvl... | [
[
"matplotlib.pyplot.ion",
"numpy.load",
"matplotlib.pyplot.subplots"
]
] |
ericyeats/cvnn-security | [
"cdc2b2251dce012d7c25adb3e75b6554edf6e8a3"
] | [
"attacks.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision.transforms import transforms\n\n\n# estimate the gradient of the confidence score w.r.t. the input data\ndef nes_gradient_est(model, device, data, lbl, n_query=100, sigma=0.001):\n model.eval()\n g = torch.zeros_like(data)... | [
[
"torch.no_grad",
"torch.clamp",
"torch.ones",
"torch.nn.functional.cross_entropy",
"torch.randn_like",
"torch.zeros_like",
"torch.empty_like"
]
] |
larsbratholm/champs_kaggle | [
"fda4f213d02fd5e0138a86c52b4140c9f94fec6e"
] | [
"solutions/5/thanhtu/model.py"
] | [
"from dataclasses import dataclass\nfrom torch import nn\nimport torch\nfrom data.dataset import *\nfrom typing import List\nfrom torch_scatter import scatter_mean, scatter_add, scatter_max\nfrom layers import *\nfrom constants import *\n\n\nclass MegnetLayer(nn.Module):\n\n def __init__(self, n_hidden_1=600, n_... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.gather",
"torch.nn.Sequential",
"torch.FloatTensor",
"torch.split",
"torch.abs",
"torch.nn.Softplus",
"torch.zeros_like",
"torch.index_select"
]
] |
oraphaBorges/CORD-19-research-challenge | [
"90ad170b82231c73479784a82d7fa4dfacbb71ac"
] | [
"corona.py"
] | [
"import os\nimport re\nimport json\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom matplotlib import style\nfrom tqdm import tqdm\n\nstyle.use(\"ggplot\")\n'''\n READING FILES\n'''\n\ndirs = [\"biorxiv_medrxiv\",\"comm_use_subset\",\"noncomm_use_subset\",\"custom_license\"]\n\ndoc... | [
[
"matplotlib.style.use",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"numpy.mean",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
msropp/aws-data-wrangler | [
"bbcea73102342a25bba9fc8f48c2e1cc59d749cb"
] | [
"tests/test_athena_parquet.py"
] | [
"import datetime\nimport logging\nimport math\nimport time\nfrom decimal import Decimal\n\nimport boto3\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\nimport pytest\n\nimport awswrangler as wr\n\nfrom ._utils import ensure_data_types, get_df, get_df_cast, get_df_list\n\nlogging.getLogger(\"awswrang... | [
[
"pandas.DateOffset",
"pandas.DataFrame",
"pandas.isna",
"pandas.concat"
]
] |
jcabaker/amazon_et | [
"60b613c35be236c7e706154c2f7d5855c2e007c9"
] | [
"lba_eco_data_processing.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom datetime import datetime, timedelta\n\n\ndef read_lba_flux_data(path, folder_name):\n\n fid = '_Avg_month_qaqc.csv'\n fpath = path + folder_name + '/' + folder_name[-8:-5] + fid\n data = pd.read_csv(fpath)\n data = data.dropna()\n data.columns = data.ilo... | [
[
"numpy.where",
"pandas.read_csv",
"pandas.to_numeric"
]
] |
lolitsjoey/ConvArc | [
"f997731f223063b35caa5b3f034c87c7e42cd5cd",
"f997731f223063b35caa5b3f034c87c7e42cd5cd"
] | [
"models/peleeNet.py",
"models/models_skip_plus_lstm_working.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom collections import OrderedDict\nimport math\nimport requests\nimport tempfile\nimport shutil\nimport pickle\nimport os\n\nclass _DenseLayer(nn.Module):\n def __init__(self, num_input_features, growth_rate, bottleneck_width, drop_rate):\n... | [
[
"torch.nn.Linear",
"torch.device",
"torch.cat",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.functional.dropout",
"torch.typename",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.nn.functional.relu",
"torch.Tensor"
],
[
... |
opencollective/CVTron | [
"fd111d734fed4008ba9d04d18c359dbd441a1897",
"fd111d734fed4008ba9d04d18c359dbd441a1897"
] | [
"cvtron/preprocessor/segment_preprocesor.py",
"cvtron/thirdparty/slim/nets/resnet_utils.py"
] | [
"#coding:utf-8\nimport numpy as np\nimport tensorflow as tf\nfrom PIL import Image\n\n_R_MEAN = 123.68\n_G_MEAN = 116.78\n_B_MEAN = 103.94\n\n# colour map\nlabel_colours = [\n (0, 0, 0), # 0=background\n # 1=aeroplane, 2=bicycle, 3=bird, 4=boat, 5=bottle\n (128, 0, 0),\n (0, 128, 0),\n (128, 128, 0)... | [
[
"numpy.array",
"tensorflow.shape",
"tensorflow.concat",
"numpy.zeros",
"tensorflow.less",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.maximum",
"tensorflow.random_uniform",
"tensorflow.read_file",
"tensorflow.image.convert_image_dtype",
"tensorflow.reverse... |
astorfi/nmt | [
"fe2e3ddfcdfb56981725ebfa2b87ca389c11df26"
] | [
"nmt/utils/iterator_utils.py"
] | [
"# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.size",
"tensorflow.minimum",
"tensorflow.concat",
"tensorflow.contrib.data.group_by_window",
"tensorflow.TensorShape",
"tensorflow.constant",
"tensorflow.maximum",
"tensorflow.string_split",
"tensorflow.data.Dataset.zip"
]
] |
rigetticomputing/representability | [
"5410159bea7ac5619022d69014807213c18277fe"
] | [
"representability/fermions/density/antisymm_sz_maps.py"
] | [
"\"\"\"\nMap marginals between each one another by Fermionic anticommutaiton relations\n\nA collection of methods that accept a RDM and map it to another RDM\n\"\"\"\nimport numpy as np\nfrom itertools import product\n\n\ndef map_d2anti_d1_sz(tpdm, normalization, bas, m_dim):\n \"\"\"\n construct the opdm fro... | [
[
"numpy.zeros_like",
"numpy.ndim",
"numpy.zeros"
]
] |
ThomasHJorgensen/ConsumptionSavingNotebooks | [
"badbdfb1da226d5494026de2adcfec171c7f40ea"
] | [
"G2EGM/G2EGM.py"
] | [
"import numpy as np\nfrom numba import njit\n\n# consav\nfrom consav import misc\nfrom consav import linear_interp # for linear interpolation\n\n# local modules\nimport pens\nimport utility\nimport upperenvelope\n\n@njit\ndef inv_mn_and_v(c,d,a,b,w,par):\n\n v = utility.func(c,par) + w\n m = a+c+d\n n = b-... | [
[
"numpy.imag",
"numpy.argmax",
"numpy.zeros"
]
] |
vmos1/cosmogan_pytorch | [
"75d3d4f652a92d45d823a051b750b35d802e2317"
] | [
"code/1_basic_GAN/1_main_code/old_loss_working/spec_loss.py"
] | [
"\nimport numpy as np\nimport torch\nimport torch.fft\n\n\n############\n### Numpy functions ### Not used in the code. Just to test the pytorch functions\n############\ndef f_radial_profile(data, center=(None,None)):\n ''' Module to compute radial profile of a 2D image '''\n y, x = np.indices((data.shape)) # ... | [
[
"torch.stack",
"numpy.fft.fft2",
"torch.isnan",
"numpy.mean",
"torch.where",
"torch.reshape",
"torch.fft.fftn",
"torch.sum",
"torch.var",
"torch.sqrt",
"torch.gather",
"torch.unsqueeze",
"numpy.hypot",
"numpy.sqrt",
"torch.zeros",
"numpy.array",
... |
NKI-AI/direct | [
"7c9d59345b68ea70bc20a5cea2c895c6059f8e46"
] | [
"direct/nn/mri_models.py"
] | [
"# coding=utf-8\n# Copyright (c) DIRECT Contributors\n\n\"\"\"MRI model engine of DIRECT.\"\"\"\n\nimport gc\nimport pathlib\nimport time\nfrom abc import abstractmethod\nfrom collections import defaultdict\nfrom os import PathLike\nfrom typing import Callable, Dict, List, Optional, Tuple, Union\n\nimport numpy as ... | [
[
"torch.zeros",
"torch.no_grad",
"torch.stack",
"torch.cuda.empty_cache"
]
] |
eric-haibin-lin/Megatron-LM | [
"324ddf354db09239d937fabe3d0bf6620edb0e2e"
] | [
"megatron/mpu/cross_entropy.py"
] | [
"# coding=utf-8\n# Copyright (c) 2020, 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 obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0... | [
[
"torch.log",
"torch.exp",
"torch.max"
]
] |
chensheng19/Yolo3_study | [
"1f5839ca8235434c34709435a06bee4cdbf4a8e3"
] | [
"utils.py"
] | [
"#! usr/bin/env python\n# coding:utf-8\n#=====================================================\n# Copyright (C) 2020 * Ltd. All rights reserved.\n#\n# Author : Chen_Sheng19\n# Editor : VIM\n# Create time : 2020-04-29\n# File name : utils.py \n# Description : Implement load_weight,read classes name,read ... | [
[
"numpy.concatenate",
"numpy.full",
"numpy.array",
"numpy.logical_or",
"numpy.product",
"numpy.minimum",
"numpy.exp",
"numpy.logical_and",
"numpy.finfo",
"numpy.argmax",
"numpy.fromfile",
"numpy.multiply.reduce",
"numpy.maximum"
]
] |
fqiang/FATE | [
"36a5a41848f78df7be1e520ae804e64bc67d72fb"
] | [
"federatedrec/general_mf/hetero_gmf/gmf_data_convertor.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#\n# Copyright 2019 The FATE 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://w... | [
[
"numpy.array",
"numpy.ones",
"numpy.random.choice",
"numpy.zeros"
]
] |
fkiraly/sktime | [
"63e7839e80ca6d5fe5fc4f33389ec3bcacd8aa59"
] | [
"sktime/experiments/losses.py"
] | [
"import collections\nimport pandas as pd\n\n\nclass Losses(object):\n \"\"\"\n Calculates prediction losses on test datasets achieved by the trained estimators. When the class is instantiated it creates a dictionary that stores the losses.\n\n Parameters\n ----------\n metric: `mlaut.analyze_results.... | [
[
"pandas.DataFrame",
"pandas.MultiIndex.from_product"
]
] |
filip-halt/towhee | [
"7b605018a27f474c8a4c745b95870eca6883d062",
"7b605018a27f474c8a4c745b95870eca6883d062"
] | [
"tests/unittests/models/action_clip/test_action_clip.py",
"tests/unittests/models/tsm/test_tsm.py"
] | [
"# Copyright 2021 Zilliz. 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 applicable... | [
[
"torch.rand"
],
[
"torch.Size",
"torch.randn"
]
] |
udaygreddy/dash-sample-apps | [
"854b8df105e24b04f6b3f9124c016f1e01b23691"
] | [
"apps/dash-phylogeny/utils.py"
] | [
"from Bio import Phylo\nimport pandas as pd\nimport plotly.graph_objs as go\nimport numpy as np\n\n\ndef get_x_coordinates(tree):\n \"\"\"Associates to each clade an x-coord.\n returns dict {clade: x-coord}\n \"\"\"\n xcoords = tree.depths()\n # tree.depth() maps tree clades to depths (by branch ... | [
[
"numpy.extract",
"pandas.read_csv"
]
] |
Juanlu001/dask | [
"ba29ba377ae71e5a90fa5ef5198c7d317b45c06a",
"ba29ba377ae71e5a90fa5ef5198c7d317b45c06a"
] | [
"dask/array/tests/test_cupy_linalg.py",
"dask/dataframe/multi.py"
] | [
"import numpy as np\nimport pytest\nfrom packaging.version import parse as parse_version\n\npytestmark = pytest.mark.gpu\n\nimport dask.array as da\nfrom dask.array.numpy_compat import _numpy_120\nfrom dask.array.utils import assert_eq\n\ncupy = pytest.importorskip(\"cupy\")\ncupy_version = parse_version(cupy.__ver... | [
[
"numpy.dot",
"numpy.random.rand",
"numpy.triu",
"numpy.eye",
"numpy.linalg.svd",
"numpy.diag"
],
[
"numpy.concatenate",
"pandas.api.types.is_list_like",
"pandas.merge",
"pandas.merge_asof",
"numpy.isscalar",
"pandas.api.types.is_dtype_equal",
"pandas.concat"... |
Saksham1611/redeem-coupon | [
"77269da21b1024c225987a56e21c679feef69ff8"
] | [
"src/logres.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn import linear_model\nfrom sklearn import metrics\nfrom sklearn import preprocessing\n\ndef run(fold):\n\n #load training data (with folds)\n df=pd.read_csv(\"../input/train_data_folds.csv\")\n\n #all cols are feature except id, redemption_status and kf... | [
[
"sklearn.linear_model.LogisticRegression",
"pandas.concat",
"pandas.read_csv",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.metrics.roc_auc_score"
]
] |
kbogas/NetworkTextVis | [
"719557510e89643f250ea550431e0c224c319268"
] | [
"NetworkTextVis/text.py"
] | [
"import gensim\nimport numpy\nimport math\nimport networkx\nfrom sklearn.feature_extraction.text import CountVectorizer\nimport regex as re\nfrom HTMLParser import HTMLParser\nimport logging\nfrom ranking import graph_influence\n\n\n\nlogger = logging.getLogger('universal_logger')\n\n\n# --------------------- prepr... | [
[
"sklearn.feature_extraction.text.CountVectorizer"
]
] |
inferense/CVQVAE | [
"a932303a44d82feaa658fb8efeda79f7fcb0d121"
] | [
"extract_codebook.py"
] | [
"import matplotlib.pyplot as plt\n\nfrom __future__ import print_function\n\nimport numpy as np\n\nimport umap\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\nimport torch.optim as optim\n\nimport torchvision.datasets as datasets\nimport torchvision.... | [
[
"torch.cat",
"torch.no_grad",
"torch.save",
"torch.cuda.empty_cache",
"torch.load"
]
] |
VHchavez/CADMium | [
"39f3bd63ca69502a80c677855da72f9e691b57e2"
] | [
"CADMium/partition/ep_hxc.py"
] | [
"\"\"\"\nep_hxc.py\n\"\"\"\nimport numpy as np\n\ndef ep_hxc(self):\n \"\"\"\n calculate dft components of Ep\n \"\"\"\n\n if self.optPartition.interaction_type == \"dft\":\n\n ###Hartree\n ehm = 0.5 * self.hartree.v_hartree( np.sum(self.nf, axis=1) )\n Ehm = self.grid.integrate( np... | [
[
"numpy.sum",
"numpy.zeros_like"
]
] |
pskurochkin/tf-eager-fasterrcnn | [
"9de0acd0dcd0843d10e7e773a48e3441dc9e4f57",
"9de0acd0dcd0843d10e7e773a48e3441dc9e4f57"
] | [
"detection/datasets/coco.py",
"detection/core/loss/losses.py"
] | [
"import os.path as osp\nimport cv2\nimport numpy as np\nfrom pycocotools.coco import COCO\n\nfrom detection.datasets import transforms, utils\n\nclass CocoDataSet(object):\n def __init__(self, dataset_dir, subset,\n flip_ratio=0,\n pad_mode='fixed',\n mean=(0, 0, 0... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.zeros"
],
[
"tensorflow.abs",
"tensorflow.multiply",
"tensorflow.gather_nd",
"tensorflow.not_equal",
"tensorflow.reduce_sum",
"tensorflow.square"
]
] |
runawayhorse001/PythonTipsDS | [
"e82a4be4774b56ff487644d2328fe7c6a782faeb"
] | [
"doc/code/model_deployment/app.py"
] | [
"#our web app framework!\n\n#you could also generate a skeleton from scratch via\n#http://flask-appbuilder.readthedocs.io/en/latest/installation.html\n\n#Generating HTML from within Python is not fun, and actually pretty cumbersome because you have to do the\n#HTML escaping on your own to keep the application secur... | [
[
"numpy.invert",
"numpy.argmax"
]
] |
clacla504/bayestuner | [
"cb087324c4a9c18243cbf6ca2b36bc1ab2402619"
] | [
"build/lib/bayestuner/tuner.py"
] | [
"import numpy as np\nfrom sklearn.gaussian_process.kernels import RBF, ConstantKernel, Matern\nfrom sklearn.gaussian_process import GaussianProcessRegressor\nfrom .acquisitionfunc import UCB, EI\nfrom .optimizer import DifferentialEvolution,LBFGSB, OptimizerResult\nfrom .chooser import MaxAcquisition\nimport seabor... | [
[
"sklearn.gaussian_process.kernels.Matern",
"numpy.log",
"numpy.argmax",
"sklearn.gaussian_process.GaussianProcessRegressor",
"numpy.vstack",
"sklearn.gaussian_process.kernels.ConstantKernel"
]
] |
hover2pi/sedkit | [
"544226c3bd275e94233fe54ae1d4897e511f33ff"
] | [
"sedkit/tests/test_relations.py"
] | [
"import copy\nfrom pkg_resources import resource_filename\nimport unittest\n\nimport astropy.units as q\nimport numpy as np\n\nfrom .. import relations as rel\n\n\nclass TestSpectralTypeRadius(unittest.TestCase):\n \"\"\"Tests for the SpectralTypeRadius class\"\"\"\n def setUp(self):\n # Make Spectrum ... | [
[
"numpy.ones_like",
"numpy.ones"
]
] |
sagelywizard/ml4seti | [
"d56ffd46ca598ff4d44d2bc274acb7dc59389acd"
] | [
"main.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nAn entry into the ml4seti signal classifier competition.\n\nThis entry is simply a large densenet architecture convolutional neural\nnetwork. For more information, see \"Densely Connected Convolutional Networks\"\n<https://arxiv.org/pdf/1608.06993.pdf>\n\"\"\"\nimport argparse\nimpo... | [
[
"torch.stack",
"numpy.zeros",
"torch.max",
"torch.LongTensor",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.load",
"torch.nn.CrossEntropyLoss"
]
] |
krey/pandas | [
"4a51a4e0cff0111856ef3888ec41c2cfd65210c5"
] | [
"pandas/tests/series/test_analytics.py"
] | [
"from itertools import product\nimport operator\n\nimport numpy as np\nimport pytest\n\nfrom pandas.compat.numpy import _np_version_under1p18\nimport pandas.util._test_decorators as td\n\nimport pandas as pd\nfrom pandas import (\n Categorical,\n CategoricalIndex,\n DataFrame,\n Series,\n date_range,... | [
[
"numpy.repeat",
"numpy.nextafter",
"numpy.compress",
"numpy.dot",
"pandas.DatetimeIndex",
"pandas.CategoricalIndex",
"pandas.notna",
"pandas.core.indexes.timedeltas.TimedeltaIndex",
"scipy.stats.pearsonr",
"pandas.Timestamp",
"numpy.finfo",
"pandas.core.index.MultiI... |
BinahHu/ADE-Longtail | [
"4aabf1cbf50746e610b91362c40cbcb7884dd170"
] | [
"ADE/modeling/roi_heads/classifier.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\n\n\nclass Classifier(nn.Module):\n def __init__(self, num_classes, in_channels, pooler_resolution):\n super(Classifier, self).__init__()\n self.num_class = num_classes\n self.fc_512 = nn.Linear(in_channels * ... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.max",
"torch.ones",
"torch.Tensor",
"torch.nn.CrossEntropyLoss",
"torch.sum"
]
] |
apockill/EasyInference | [
"bd609769b7dc66952e1b3540f3057e8485e308d6"
] | [
"easy_inference/models/variational_autoencoder.py"
] | [
"import keras\nfrom typing import List\n\nimport cv2\nimport tensorflow\nimport numpy as np\n\nfrom easy_inference.models import BaseModel\n\n\"\"\"\nThis code is for easily running the variational autoencoder models that I make\n\"\"\"\n\n\nclass VariationalEncoder(BaseModel):\n def __init__(self, keras_model):... | [
[
"numpy.asarray",
"numpy.expand_dims"
]
] |
cibinjoseph/thinAirfoilPy | [
"eed2367aa978887df7491a4132fcc1b968346331"
] | [
"thinAirfoil.py"
] | [
"#!/usr/bin/python3\n\nimport numpy as np\nfrom scipy.integrate import simps\nimport sys\n\n_nPoints = 5001\n_eps = np.finfo(np.pi).eps\n\ndef checkAirfoilType(airfoilCode):\n if len(airfoilCode) == 4:\n return 'NACA4'\n elif len(airfoilCode) == 5:\n return 'NACA5'\n else:\n raise Valu... | [
[
"numpy.concatenate",
"scipy.integrate.simps",
"numpy.finfo",
"numpy.abs",
"numpy.cos",
"numpy.linspace"
]
] |
TuZehai/Sheffield_Clarity_CEC1_Entry | [
"179a95130505a2cd3fb9673884dda7923b6f3ea8"
] | [
"recipe_amp_fir/trainer.py"
] | [
"import os\nimport sys\nimport torch\nimport json\nimport toml\nfrom datetime import datetime\nfrom tqdm import tqdm\nfrom glob import glob\nimport soundfile as sf\nimport numpy as np\nfrom tensorboardX import SummaryWriter\n\nsys.path.append(os.path.abspath(os.path.join(__file__, '..', '..')))\nfrom hearinglossmod... | [
[
"numpy.zeros_like",
"numpy.array",
"torch.no_grad",
"torch.clamp",
"torch.load",
"numpy.clip"
]
] |
phyng/scilib | [
"7f0db56e195887c3bc88c0a8351cc706de4911a1"
] | [
"scilib/wos/importer.py"
] | [
"# coding: utf-8\n\nfrom __future__ import unicode_literals, absolute_import, print_function, division\n\nimport asyncio\nimport pandas as pd\nfrom pathlib import Path\nimport concurrent.futures\n\n\ndef _read_text_format_lines(lines):\n items = []\n current_item = None\n current_item_key = None\n for i... | [
[
"pandas.DataFrame.from_records",
"pandas.read_csv"
]
] |
juanhenao21/portfolio_optimization | [
"b91800648bd8fd2e2c2885f28c6e31fa4a873727"
] | [
"project/local_normalization/local_normalization_analysis.py"
] | [
"'''Portfolio optimization local normalization analysis module.\n\nThe functions in the module use local normalization to compute the returns, the\nnormalized returns and the correlation matrix of financial time series.\n\nThis script requires the following modules:\n * pickle\n * typing\n * numpy\n * p... | [
[
"pandas.Grouper",
"numpy.linalg.eig",
"numpy.sqrt",
"pandas.Series"
]
] |
gold-standard-phantoms/asldro | [
"6ae82ed69d66fed64e1e54e5394cc3b5d8dbe1bd"
] | [
"src/asldro/containers/image.py"
] | [
"\"\"\" Classes for image encapsulation\nUsed to create a standard interface for ND images which can\nbe instantiated with either NIFTI files or using numpy arrays \"\"\"\n\nfrom copy import deepcopy\nfrom abc import ABC, abstractmethod\nfrom typing import Union, Tuple, Type\n\n\nimport numpy as np\nimport nibabel ... | [
[
"numpy.array",
"numpy.asanyarray",
"numpy.eye"
]
] |
trevorwitter/ONA | [
"46205bc894d8129c134b7217edee82ed2221c402"
] | [
"create_network_edges.py"
] | [
"import pandas as pd\nimport random\nimport itertools\n\n\ndef create_net_edges(start_node, end_node):\n node1 = random.randint(start_node,end_node)\n node2 = random.randint(start_node,end_node)\n return node1, node2\n\ndef list_edges(n_edges, start_node, end_node):\n edges = [(create_net_edges(start_no... | [
[
"pandas.DataFrame"
]
] |
tsotfsk/ogb | [
"3c24dd5f67a13426d5f39c7a71a460499713631a"
] | [
"examples/lsc/mag240m/rgnn.py"
] | [
"import os\nimport time\nimport glob\nimport argparse\nimport os.path as osp\nfrom tqdm import tqdm\n\nfrom typing import Optional, List, NamedTuple\n\nimport numpy as np\nimport torch\nfrom torch import Tensor\nimport torch.nn.functional as F\nfrom torch.nn import ModuleList, Sequential, Linear, BatchNorm1d, ReLU,... | [
[
"numpy.concatenate",
"torch.nn.Linear",
"torch.cat",
"torch.nn.Dropout",
"torch.optim.lr_scheduler.StepLR",
"numpy.empty",
"torch.nn.ModuleList",
"torch.save",
"torch.nn.functional.dropout",
"torch.nn.functional.elu",
"torch.no_grad",
"torch.from_numpy",
"torch.... |
roatienza/dl-keras | [
"9472dce7381e0bc05b52db269905909c2a2aa5c8"
] | [
"chapter6-improved-gan/wgan-mnist-6.1.1.py"
] | [
"'''Trains WGAN on MNIST using Keras\n\nTrains a GAN using Wassertein loss. Similar to DCGAN except for\nlinear activation in output and use of n_critic training per\nadversarial training. Discriminator weights are clipped as a \nrequirement of Lipschitz constraint.\n\n[1] Radford, Alec, Luke Metz, and Soumith Chin... | [
[
"numpy.reshape",
"matplotlib.pyplot.savefig",
"numpy.ones",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.clip",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.axis",
"matplotl... |
ivalab/GraspKpNet | [
"d4b6186d74ac82a745d778892742d52a204bd1cf"
] | [
"src/lib/trains/dbmctdet.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nimport numpy as np\n\nfrom models.losses import FocalLoss\nfrom models.losses import RegL1Loss, RegLoss, NormRegL1Loss, RegWeightedL1Loss, TagLoss_2\nfrom models.utils import _sigmoid\nfr... | [
[
"torch.nn.MSELoss"
]
] |
SeunghyunSEO/seosh_fairseq | [
"443b2a8effb6b8fba5758989076cf992470ccb62"
] | [
"examples/truncated_bptt/memory_transformer_xl/memory_transformer_xl.py"
] | [
"import math\nfrom collections import namedtuple\nfrom functools import partial\nfrom inspect import isfunction\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\n\n\nfrom fairseq.modules import (\n AdaptiveInput,\n CharacterTokenEmbedder,\n AdaptiveSoftmax,\n FairseqDropout,\n L... | [
[
"torch.zeros",
"torch.nn.Linear",
"torch.cat",
"torch.nn.LayerNorm",
"torch.nn.Dropout",
"torch.stack",
"torch.einsum",
"torch.nn.Identity",
"torch.finfo",
"torch.nn.Parameter",
"torch.nn.functional.pad",
"torch.empty",
"torch.pow"
]
] |
kngwyu/Rainy | [
"535f8f49d9efe0324a8480d0165ab1b35d83dc19",
"535f8f49d9efe0324a8480d0165ab1b35d83dc19"
] | [
"tests/test_rnn.py",
"rainy/agents/acktr.py"
] | [
"from typing import Callable\n\nimport pytest\nimport torch\n\nfrom rainy.net import GruBlock, LstmBlock, RnnBlock\nfrom rainy.utils import Device\n\n\n@pytest.mark.parametrize(\"rnn_gen\", [GruBlock, LstmBlock])\ndef test_rnn(rnn_gen: Callable[[int, int], RnnBlock]) -> None:\n TIME_STEP = 10\n BATCH_SIZE = 5... | [
[
"torch.cat",
"torch.randn"
],
[
"torch.randn_like"
]
] |
woniukaibuick/DA-ML | [
"53d973c2ac0d6993d92f7135b40db377a57f3e67"
] | [
"src/com/valar/tianchi/Chapter5.py"
] | [
"import os\nimport pandas as pd\nimport numpy as np\nfrom sklearn.feature_selection import VarianceThreshold\nadult_data_file = \"D:/software/Python/data/chapter5/adult.data\"\n\nadult = pd.read_csv(adult_data_file,header=None,\n names=[\"Age\", \"Work-Class\", \"fnlwgt\",\n ... | [
[
"sklearn.feature_selection.VarianceThreshold",
"pandas.read_csv",
"numpy.arange"
]
] |
mlangford29/magenta | [
"302e4d35bab756ea7ca0350cb5150f4d5f7a8e11"
] | [
"magenta/models/shared/events_rnn_train.py"
] | [
"# Copyright 2019 The Magenta 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 o... | [
[
"tensorflow.contrib.training.train",
"tensorflow.train.NanTensorHook",
"tensorflow.train.LoggingTensorHook",
"tensorflow.contrib.training.evaluate_repeatedly",
"tensorflow.Graph",
"tensorflow.train.Saver",
"tensorflow.logging.info",
"tensorflow.train.StepCounterHook",
"tensorfl... |
QudevETH/PycQED_py3 | [
"124db8d595d35c0193bb9cd5c835e9635a8ecc13"
] | [
"pycqed/measurement/waveform_control/pulse_library.py"
] | [
"\"\"\"\nLibrary containing various pulse shapes.\n\"\"\"\n\nimport sys\nimport numpy as np\nimport scipy as sp\nfrom pycqed.measurement.waveform_control import pulse\nimport logging\n\nlog = logging.getLogger(__name__)\n\npulse.pulse_libraries.add(sys.modules[__name__])\n\n\nclass SSB_DRAG_pulse(pulse.Pulse):\n ... | [
[
"numpy.deg2rad",
"numpy.zeros_like",
"numpy.ones_like",
"numpy.sum",
"numpy.exp",
"numpy.ndim",
"numpy.cos",
"numpy.sqrt",
"scipy.special.erf"
]
] |
BaiLiping/BLPtensorforce | [
"01bc0b7130a497c9dfff9caa2fd5df919ffe7552"
] | [
"tensorforce/core/networks/network.py"
] | [
"# Copyright 2020 Tensorforce Team. 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 b... | [
[
"tensorflow.stack"
]
] |
alexchunet/raster-vision | [
"76e2965557fc8380e2ffc4aa7ab1f5dc45f79033"
] | [
"rastervision2/core/raster_stats.py"
] | [
"import json\n\nimport numpy as np\n\nfrom rastervision2.pipeline.file_system import str_to_file, file_to_str\n\nchip_sz = 300\n\n\ndef parallel_variance(mean_a, count_a, var_a, mean_b, count_b, var_b):\n \"\"\"Compute the variance based on stats from two partitions of the data.\n\n See \"Parallel Algorithm\"... | [
[
"numpy.isnan",
"numpy.zeros",
"numpy.sum",
"numpy.nanmean",
"numpy.transpose",
"numpy.sqrt",
"numpy.nanvar"
]
] |
UBCDingXin/DDRE_Sampling_GANs | [
"72ec41f8a0913a72ed7cf2c57ded1c65c6fe6823"
] | [
"STL10_64/Train_SNGAN.py"
] | [
"\"\"\"\nTrain SNGAN\n\n\"\"\"\n\nimport torch\nfrom torchvision.utils import save_image\nimport numpy as np\nimport os\nimport timeit\nfrom metrics.Inception_Score import inception_score\nfrom torch.utils.tensorboard import SummaryWriter\nimport gc\nfrom utils import IMGs_dataset\n\nNC=3\nIMG_SIZE=64\n\nNFAKE_IS_T... | [
[
"numpy.zeros",
"torch.no_grad",
"torch.cuda.device_count",
"torch.nn.ReLU",
"torch.load",
"torch.randn"
]
] |
TaoYang-CFEI/mshoot | [
"26680422a7101b386c703eee8e1979fc87de7da7"
] | [
"mshoot/mshoot.py"
] | [
"import logging\nimport abc\nimport time\nimport copy\n\nimport numpy as np\nimport pandas as pd\nfrom multiprocessing.pool import ThreadPool\nfrom scipy.optimize import fmin_slsqp\nimport matplotlib.pyplot as plt\n\nfrom mshoot.optimize import optimize\n\n\nclass SimModel(abc.ABC):\n \"\"\"\n MShoot stateful... | [
[
"numpy.concatenate",
"numpy.full",
"numpy.array",
"pandas.Index",
"numpy.zeros",
"numpy.copy",
"numpy.ones",
"numpy.mean",
"numpy.where",
"numpy.arange",
"numpy.hstack"
]
] |
Theia-4869/U-RISC | [
"c493b11ab525b39a5ac029c3f83e059d703abaae"
] | [
"models/DFF.py"
] | [
"import os\nimport torch\nfrom torch import nn\nfrom torch.nn.functional import interpolate, softmax\nfrom torch.cuda.amp import autocast\n\nfrom .base import BaseNet\n\n\nnorm_layer = nn.BatchNorm2d\n\n\nclass DFF(BaseNet):\n \"\"\"\n Reference:\n - Hu, Yuan, et.al \"Dynamic Feature Fusion for... | [
[
"torch.cat",
"torch.mul",
"torch.cuda.amp.autocast",
"torch.nn.Sigmoid",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.sum"
]
] |
omrijsharon/active-bandit | [
"f9414ac596dd33ef26027e88bc7d2158908a8d0e"
] | [
"utils/helper_functions.py"
] | [
"import numpy as np\nimport cv2\nimport torch\nimport torchvision\nfrom torch.utils import data\nfrom copy import deepcopy\nfrom tqdm import tqdm\n\n\ndef resize_dataset(dataset, dim):\n new_dataset = deepcopy(dataset)\n N = len(dataset.data)\n if len(dataset.data.size()) == 3:\n new_data = torch.ze... | [
[
"torch.zeros",
"torch.utils.data.ConcatDataset",
"torch.cat",
"numpy.array",
"torch.unique",
"torch.cosh",
"torch.utils.data.Subset",
"numpy.dtype"
]
] |
ninetailskim/PaddleOCR | [
"5586dbf42511517d00dc541070e0c5e094587c72"
] | [
"tools/infer_det.py"
] | [
"# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.concatenate"
]
] |
njanirudh/R-D-HBRS | [
"220777628406366179106069eb9ce211e50e7543"
] | [
"src/wmle_prototype.py"
] | [
"import numpy as np\nimport pandas\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom scipy.stats import norm\n\ndef obtain_sample(path):\n\n X_val = []\n Y_val = []\n Z_val = []\n\n # with open() as csv_file:\n with open(File) as csv_file:\n csv_reader = pd.read_csv(csv_file, delimit... | [
[
"numpy.random.normal",
"numpy.array",
"scipy.stats.norm.fit",
"numpy.isfinite",
"numpy.repeat",
"pandas.read_csv"
]
] |
SimOgaard/DF-VO | [
"4a7fed836fa96914de1625041db982cb6d500223"
] | [
"libs/deep_models/depth/monodepth2/depth_decoder.py"
] | [
"# Copyright Niantic 2019. Patent Pending. All rights reserved.\n#\n# This software is licensed under the terms of the Monodepth2 licence\n# which allows for non-commercial use only, the full terms of which are made\n# available in the LICENSE file.\n\nfrom __future__ import absolute_import, division, print_functio... | [
[
"numpy.array",
"torch.cat",
"torch.nn.Sigmoid"
]
] |
ZJU-lishuang/CenterNet2 | [
"cbebb83c4961566f97fd125acc41caa652f58509"
] | [
"script/train_data_analysis/data_analysis_yolo.py"
] | [
"import os\nimport json\nimport glob\nimport shutil\nimport numpy as np\nfrom tqdm import tqdm\nimport argparse\nimport matplotlib.pyplot as plt\n\n\ndef json_load(json_file):\n with open(json_file, \"r\") as f:\n data = json.load(f)\n return data\n\n\ndef json_dump(data, json_out):\n json.dump(data... | [
[
"numpy.zeros",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.unique"
]
] |
choward1491/cs598ps_project | [
"f6b15a418790c38637d80ff1bd62b6a2ab12cd3a"
] | [
"scripts/accuracy_results.py"
] | [
"#import useful libraries\nimport numpy as np\nimport matplotlib.pyplot as plot\n\n\nif __name__ == '__main__':\n\n # load PCA and NMF accuracy data for GDA\n a_gpca = 100*np.load('../data/gpca.npy')\n a_gnmf = 100*np.load('../data/gnmf.npy')\n\n # load PCA and NMF accuracy dat... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.load",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xticks"
]
] |
peipeiwang6/ML-Pipeline-1 | [
"9d70e504a1c411005407e1ef9bb61c78dc8b07f4"
] | [
"ML_regression.py"
] | [
"import sys, os, argparse, time\nimport pandas as pd\nimport numpy as np\nfrom datetime import datetime\nimport ML_functions as ML\nstart_total_time = time.time()\n\ndef warn(*args, **kwargs):\n pass\nimport warnings\nwarnings.warn = warn\n\ndef main():\n\n\t########################\n\t### Parse Input Args ###\n... | [
[
"pandas.DataFrame",
"numpy.mean",
"numpy.std",
"sklearn.preprocessing.MinMaxScaler",
"pandas.concat",
"pandas.read_csv",
"pandas.to_numeric"
]
] |
sibange/padertorch | [
"494692d877f04c66847c2943795b23aea488217d"
] | [
"padertorch/ops/losses/regression.py"
] | [
"import torch\n\n\ndef _sqnorm(x, dim=None, keepdim=False):\n x = torch.abs(x)\n if dim is None:\n assert not keepdim\n return torch.sum(x * x)\n else:\n return torch.sum(x * x, dim=dim, keepdim=keepdim)\n\n\ndef _mse(estimate, target, dim=None):\n error = torch.abs(estimate - targe... | [
[
"torch.einsum",
"torch.log10",
"torch.abs",
"torch.mean",
"torch.sum"
]
] |
jkd2021/YOLACT-with-lane-detection | [
"95f1e83422e6844363a54270a375f662a8a8e4e7",
"95f1e83422e6844363a54270a375f662a8a8e4e7"
] | [
"train.py",
"LD.py"
] | [
"from data import *\r\nfrom utils.augmentations import SSDAugmentation, BaseTransform\r\nfrom utils.functions import MovingAverage, SavePath\r\nfrom utils.logger import Log\r\nfrom utils import timer\r\nfrom layers.modules import MultiBoxLoss\r\nfrom yolact import Yolact\r\nimport os\r\nimport sys\r\nimport time\r\... | [
[
"torch.zeros",
"torch.stack",
"torch.set_default_tensor_type",
"torch.no_grad",
"torch.isfinite",
"torch.cuda.device_count",
"torch.cuda.is_available",
"torch.utils.data.DataLoader"
],
[
"numpy.max",
"numpy.array",
"numpy.zeros_like",
"numpy.min",
"numpy.mea... |
aflorithmic/DurIAN | [
"a708e9c5bb89895ddf08ca1a13bc8fd683b1e23f"
] | [
"model/prenet.py"
] | [
"import torch\n\nfrom .base import BaseModule\n\n\nclass Prenet(BaseModule):\n \"\"\"\n Prenet module from Tacotron 2.\n \"\"\"\n def __init__(self, config):\n super(Prenet, self).__init__()\n out_sizes = config['decoder_prenet_sizes']\n in_sizes = [config['decoder_rnn_dim']] + out_... | [
[
"torch.nn.Linear"
]
] |
si4141/scraper_for_economy_watcher | [
"92423ed2198263998a6593ce9cb800a10c5d0943"
] | [
"econ_watcher_reader/reader.py"
] | [
"from econ_watcher_reader.settings import TOP_MENU_PAGE, WatcherType\nimport pandas as pd\nimport datetime\nfrom econ_watcher_reader import scraper, parser\nfrom logging import getLogger\nlogger = getLogger(__name__)\n\n\nclass EconomyWatcherReader(object):\n \"\"\"\n Data reader for Economy Watcher provided ... | [
[
"pandas.to_datetime",
"pandas.offsets.MonthBegin",
"pandas.concat"
]
] |
kosmitive/abstract_rl | [
"13038a1a5a93c78374ba869c9e75221c2b73d290"
] | [
"src/abstract_rl/operator/resample_actions_operator.py"
] | [
"import torch\n\nfrom abstract_rl.src.data_structures.abstract_conf.model_configuration import ModelConfiguration\nfrom abstract_rl.src.operator.trajectory_operator import TrajectoryOperator\n\n\nclass ResampleOperator(TrajectoryOperator):\n \"\"\"\n Samples for each state additional actionsa and equips\n ... | [
[
"torch.Tensor"
]
] |
mintanwei/IPCLs-Net | [
"04937df683216a090c0749cc90ab7e517dbab0fd"
] | [
"train.py"
] | [
"from engine import train_one_epoch, evaluate\nimport utils\nimport torch\nfrom dataset import NBINewDataset\nfrom torchvision import transforms\nfrom model import rcnn_model\nfrom torch.utils.data import DataLoader, Subset\nfrom visualize import visualize\nimport os\n\n\ndef get_transform(train):\n all_transfor... | [
[
"torch.device",
"torch.optim.lr_scheduler.StepLR",
"torch.optim.Adam",
"torch.cuda.is_available",
"torch.utils.data.DataLoader"
]
] |
rysusevaiye/FB_AUTOMATIOM | [
"5296b25f79c3f90e802c9ea252416b310ada522a"
] | [
"maskrcnn_benchmark/modeling/roi_heads/box_head/roi_box_predictors.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nfrom torch import nn\n\n\nclass FastRCNNPredictor(nn.Module):\n def __init__(self, config, pretrained=None):\n super(FastRCNNPredictor, self).__init__()\n\n stage_index = 4\n stage2_relative_factor = 2 ** (stage_index ... | [
[
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.nn.init.normal_",
"torch.nn.init.constant_"
]
] |
UMich-CURLY/semantic-segmentation | [
"f7ad4ade55c479b37b61f07ef2f5335e7b588178"
] | [
"train.py"
] | [
"\"\"\"\nCopyright 2020 Nvidia Corporation\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following dis... | [
[
"torch.device",
"torch.distributed.init_process_group",
"torch.cuda.set_device",
"torch.cuda.empty_cache",
"torch.distributed.all_reduce",
"torch.randn"
]
] |
hwaranlee/ParlAI | [
"5efebdd889851cf80e496d45f0ebc324e0fde001"
] | [
"parlai/agents/seq2seq/seq2seq.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\nfrom parlai.cor... | [
[
"torch.autograd.Variable",
"torch.save",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.load",
"torch.Tensor",
"torch.nn.CrossEntropyLoss",
"torch.set_num_threads"
]
] |
hoseDUDEface/AdaptiveWingLoss | [
"9185799d87567044f437147639c3999418529684"
] | [
"utils/resizer.py"
] | [
"import cv2\nimport numpy as np\nfrom typing import Tuple, Optional\n\n\ndef resize_image(image: np.ndarray, desired_shape: Tuple[int, int] = (35, 35),\n dimension_to_match: Optional[str] = None,\n crop_center: Optional[bool] = False,\n add_padding: Optional[bool] = F... | [
[
"numpy.round",
"numpy.ceil",
"numpy.floor"
]
] |
birlrobotics/smach_based_introspection_framework | [
"f16742339cddfc86effba4dbf6e5062304704b89"
] | [
"src/smach_based_introspection_framework/online_part/smach_modifier/dmp_execute.py"
] | [
"import rospy\nimport copy\nimport numpy\nfrom smach_based_introspection_framework.configurables import (\n dmp_cmd_fields,\n)\nfrom birl_skill_management.dmp_management import (\n cook_array_from_object_using_postfixs,\n)\nfrom birl_skill_management.util import (\n get_eval_postfix,\n plot_cmd_matrix,\... | [
[
"numpy.asarray"
]
] |
K-Wu/GraphSAGE-timing | [
"412f27ef81497128444b245ab482ae9765534a1b"
] | [
"graphsage/unsupervised_train.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport time\nimport tensorflow as tf\nimport numpy as np\n\nfrom graphsage.models import SampleAndAggregate, SAGEInfo, Node2VecModel\nfrom graphsage.minibatch import EdgeMinibatchIterator\nfrom graphsage.neigh_samplers import Unif... | [
[
"tensorflow.set_random_seed",
"tensorflow.shape",
"tensorflow.assign",
"numpy.zeros",
"numpy.random.seed",
"tensorflow.Session",
"tensorflow.Variable",
"tensorflow.app.flags.DEFINE_boolean",
"numpy.save",
"numpy.mean",
"tensorflow.ConfigProto",
"tensorflow.placehold... |
bjonen/pandas | [
"e7943458c0858227b3bd5d67583e0a2bca448f1d"
] | [
"pandas/tests/test_groupby.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nimport nose\n\nfrom numpy.testing.decorators import slow\n\nfrom datetime import datetime\nfrom numpy import nan\n\nfrom pandas import date_range,bdate_range, Timestamp\nfrom pandas.core.index import Index, MultiIndex, Int64Index\nfrom pandas.core.api... | [
[
"numpy.array_equal",
"numpy.tile",
"pandas.compat.OrderedDict",
"pandas.core.common.pprint_thing",
"pandas.util.testing.getSeriesData",
"numpy.random.random",
"pandas.compat.lzip",
"numpy.empty",
"numpy.log",
"pandas.compat.iteritems",
"pandas.DataFrame",
"pandas.ut... |
JoelRaymann/Disaster_management_robot | [
"a2f1cd462c4e511275b7f522a952dff2aa0b8641"
] | [
"ObjectDetection/RPiMainUtilities.py"
] | [
"import argparse\nimport os\nimport traceback\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import imshow\nimport scipy.io\nimport scipy.misc\nimport numpy as np\nimport pandas as pd\nimport PIL\nfrom cv2 import cv2\nimport time\nimport tensorflow as tf\nfrom keras import backend as K\nfrom keras.layers ... | [
[
"numpy.asarray"
]
] |
Tetratrio/fairseq | [
"a87cafda718c7706e6f1694f0d39fc589ed2b264"
] | [
"examples/byte_level_bpe/gru_transformer.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\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE ... | [
[
"torch.nn.functional.dropout",
"torch.nn.GRU"
]
] |
HaiyiMei/i3d-keras | [
"386af843692372f0d7d5378e64d6913a5130aba6"
] | [
"demo.py"
] | [
"import pickle\nimport numpy as np\narr = np.zeros((1000,2))\nwith open('rgbs.pkl', 'wb') as f:\n pickle.dump([], f)"
] | [
[
"numpy.zeros"
]
] |
metaodi/GOSHMap | [
"e3895293f2bfe210d243258ef5eeebbdfdfcbc0f"
] | [
"getlocs.py"
] | [
"import pandas as pd\nfrom geopy.geocoders import Nominatim\nfrom geopy.extra.rate_limiter import RateLimiter\n\n# download data\ndf = pd.read_csv(\"https://raw.githubusercontent.com/thessaly/GOSHMap/master/goshmap2.csv\")\n\n# clean data\n\ndel df['item']\ndel df['coords']\n\n# Get coords for mapping\ngeolocator =... | [
[
"pandas.read_csv"
]
] |
NunoEdgarGFlowHub/strawberryfields | [
"0cfef1055f782e1c338d27fb9a17e32c542ca2eb"
] | [
"tests/test_displacement_operation.py"
] | [
"##############################################################################\n#\n# Unit tests for displacement operations\n# Convention: The displacement unitary is fixed to be\n# U(\\alpha) = \\exp(alpha \\hat{a}^\\dagger - \\alpha^* \\hat{a})\n# where \\hat{a}^\\dagger is the photon creation operator.\n#\n####... | [
[
"numpy.exp",
"scipy.special.factorial",
"numpy.conj",
"numpy.abs",
"numpy.linspace"
]
] |
PfizerRD/scikit-digital-health | [
"f834a82d750d9e3cdd35f4f5692a0a388210b821",
"f834a82d750d9e3cdd35f4f5692a0a388210b821"
] | [
"test/preprocessing/test_calibrate.py",
"src/skdh/gait/get_gait_classification.py"
] | [
"from psutil import virtual_memory\nimport pytest\nfrom numpy import around, mean, abs, arange, array, zeros, allclose\nfrom numpy.linalg import norm\n\nfrom skdh.preprocessing import CalibrateAccelerometer\n\n\nclass TestCalibrateAccelerometer:\n @pytest.mark.slow\n @pytest.mark.skipif(virtual_memory().avail... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.allclose",
"numpy.arange"
],
[
"numpy.isclose",
"scipy.signal.butter",
"numpy.linalg.norm"
]
] |
rlew631/PettingZoo | [
"169bbb2cf3e7576312f29d7e9ef66a0cd2a51b83"
] | [
"pettingzoo/sisl/multiwalker/multiwalker.py"
] | [
"import numpy as np\nfrom gym.utils import EzPickle\n\nfrom pettingzoo import AECEnv\nfrom pettingzoo.utils import agent_selector, wrappers\nfrom pettingzoo.utils.conversions import parallel_wrapper_fn\n\nfrom .multiwalker_base import MultiWalkerEnv as _env\n\n\ndef env(**kwargs):\n env = raw_env(**kwargs)\n ... | [
[
"numpy.array"
]
] |
Razerl/TRN.pytorch | [
"f6b9054f0ed80693b45a61066f9ab9a20cf0884e"
] | [
"lib/utils/multicrossentropy_loss.py"
] | [
"import torch\nimport torch.nn as nn\n\n__all__ = ['MultiCrossEntropyLoss']\n\nclass MultiCrossEntropyLoss(nn.Module):\n def __init__(self, size_average=True, ignore_index=-500):\n super(MultiCrossEntropyLoss, self).__init__()\n\n self.size_average = size_average\n self.ignore_index = ignore... | [
[
"torch.nn.LogSoftmax",
"torch.mean",
"torch.sum"
]
] |
jesseengel/ddsp | [
"de195af0a21fba52e6b88c23886c244d8607e49c"
] | [
"ddsp/processors.py"
] | [
"# Copyright 2019 The DDSP 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 or a... | [
[
"tensorflow.compat.v1.abs",
"tensorflow.compat.v1.nn.sigmoid"
]
] |
whn09/albert-chinese-ner | [
"f43a134eac92a75116496d7df1af454b62a063b6"
] | [
"run_pretraining.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.contrib.tpu.TPUEstimator",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.metrics.mean",
"tensorflow.one_hot",
"tensorflow.parse_single_example",
"tensorflow.trainable_variables",
... |
xu-kai-xu/OpenPNM | [
"61d5fc4729a0a29291cf6c53c07c4246e7a13714"
] | [
"tests/unit/io/NetworkXTest.py"
] | [
"import numpy as np\nimport openpnm as op\nfrom networkx import complete_graph, random_layout\nfrom networkx import set_node_attributes, set_edge_attributes\n\n\nclass NetworkXTest:\n\n def setup_class(self):\n ws = op.Workspace()\n ws.settings['local_data'] = True\n self.net = op.network.Cu... | [
[
"numpy.shape"
]
] |
m2man/pytorch-lung-segmentation | [
"1845841b1cc04f179ac9e7552b8b0865443f81f5"
] | [
"lung_segmentation/bse_test.py"
] | [
"import argparse\nimport os\n\nimport matplotlib.pyplot as plt\nimport torch\nfrom torchvision.transforms import Compose, Resize, ToTensor, Normalize\nfrom torchvision.utils import save_image\n\nimport lung_segmentation.importAndProcess as iap\nfrom models import model\nfrom models.unet_models import unet11, unet16... | [
[
"torch.autograd.Variable",
"torch.no_grad",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.DataParallel"
]
] |
fhoang7/pandas | [
"4c54dd298692783f417cbaa57d5fc1c0dc1f7c72"
] | [
"pandas/tests/dtypes/test_dtypes.py"
] | [
"import re\n\nimport numpy as np\nimport pytest\nimport pytz\n\nfrom pandas.core.dtypes.common import (\n is_bool_dtype, is_categorical, is_categorical_dtype,\n is_datetime64_any_dtype, is_datetime64_dtype, is_datetime64_ns_dtype,\n is_datetime64tz_dtype, is_datetimetz, is_dtype_equal, is_interval_dtype,\n... | [
[
"pandas.core.dtypes.dtypes.IntervalDtype.construct_from_string",
"pandas.SparseArray",
"pandas.core.dtypes.dtypes.DatetimeTZDtype.construct_from_string",
"pandas.CategoricalIndex",
"pandas.core.dtypes.common.is_datetime64_any_dtype",
"pandas.core.dtypes.dtypes.CategoricalDtype",
"panda... |
UditSinghParihar/Mask_RCNN | [
"4b28d8bc99b6d3d5d2ab259451a1591de121d42d"
] | [
"samples/utils.py"
] | [
"\"\"\"\nMask R-CNN\nCommon utility functions and classes.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport sys\nimport os\nimport math\nimport random\nimport numpy as np\nimport tensorflow as tf\nimport scipy\nimport skima... | [
[
"numpy.dot",
"numpy.minimum",
"numpy.exp",
"numpy.multiply",
"numpy.where",
"tensorflow.stack",
"numpy.cumsum",
"tensorflow.cast",
"numpy.concatenate",
"numpy.max",
"numpy.divide",
"numpy.empty",
"numpy.log",
"numpy.argmax",
"numpy.arange",
"numpy.sq... |
neu-spiral/ClassificationAndComparisonViaNeuralNetworks | [
"40bc170672b2a64810bb09be71abb2f040ff7edc"
] | [
"Competitors/Ensemble/combinedLinear.py"
] | [
"import cvxpy as cp\nimport numpy as np\nfrom sklearn.metrics import roc_auc_score\n\n'''\nabsFeatures: N*d\nabsLabels: N*1, +1/-1\ncmpFeatures: N*d - N*d\ncmpLabels: N*1, +1/-1\n'''\n\nclass combinedLinear(object):\n def __init__(self, input_shape=(3, 224, 224)):\n self.input_shape = input_shape\n\n d... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.load",
"numpy.shape",
"sklearn.metrics.roc_auc_score"
]
] |
shijianjian/keras-resnet3d | [
"1a8656dc24ceeea8b42a10f11595ab1ec4fd92c7"
] | [
"resnet3d/resnet3d.py"
] | [
"\"\"\"A vanilla 3D resnet implementation.\n\nBased on Raghavendra Kotikalapudi's 2D implementation\nkeras-resnet (See https://github.com/raghakot/keras-resnet.)\n\"\"\"\nfrom __future__ import (\n absolute_import,\n division,\n print_function,\n unicode_literals\n)\nimport six\nfrom math import ceil\nf... | [
[
"numpy.random.random",
"numpy.arange",
"numpy.random.randint",
"numpy.zeros"
]
] |
cgmb/Tensile | [
"b0055f18fe76bcb1a9e5fd963b6b7f93aae85ee0"
] | [
"Tensile/GenerateSummations.py"
] | [
"\n################################################################################\n# Copyright 2016-2021 Advanced Micro Devices, Inc. All rights reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), t... | [
[
"pandas.read_csv",
"numpy.polyfit"
]
] |
chungg/gnocchi | [
"bc18ebded10bc763b98bcba46db925a3a5031ecd"
] | [
"gnocchi/storage/__init__.py"
] | [
"# -*- encoding: utf-8 -*-\n#\n# Copyright © 2016-2018 Red Hat, Inc.\n# Copyright © 2014-2015 eNovance\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.o... | [
[
"numpy.sort"
]
] |
1siddharth/-web-scraper- | [
"d8a7fb0c62fa3432ca89430857664bbbbc89c2ea"
] | [
"text.py"
] | [
"import requests\r\nfrom bs4 import BeautifulSoup\r\nfrom newspaper import Article\r\nimport pandas as pd\r\nlinklist =[]\r\nfilist =[]\r\n\r\ndef mainclass():\r\n url = \"https://news.google.com/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx6TVdZU0FtVnVHZ0pKVGlnQVAB?hl=en-IN&gl=IN&ceid=IN%3Aen/\"\r\n code=requests.... | [
[
"pandas.DataFrame"
]
] |
EtienneTurc/IChooseYou | [
"9ea7767b793ba6ef389f7cc806a02db2e1434c70"
] | [
"server/service/helper/dict_helper.py"
] | [
"import numpy as np\n\n\ndef pick(dict, elements):\n new_dict = {}\n for el in elements:\n new_dict[el] = dict.get(el)\n return new_dict\n\n\ndef get_by_path(dict, path: str):\n keys = path.split(\".\")\n value = dict\n for key in keys:\n if value is None:\n return None\n ... | [
[
"numpy.sum",
"numpy.array"
]
] |
bcamino/pymatgen | [
"0093ce7ed137ef8b6324ad140981a41d81764295"
] | [
"pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py"
] | [
"# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\"\"\"\nThis module contains the main object used to identify the coordination environments in a given structure.\nIf you use this module, please cite the following:\nDavid Waroquiers, Xavier Gonze, Gian-Marco Rignanes... | [
[
"numpy.dot",
"numpy.argmin",
"numpy.min",
"numpy.mean",
"numpy.tensordot",
"numpy.cos",
"numpy.concatenate",
"numpy.max",
"numpy.sin",
"numpy.linalg.norm",
"numpy.linalg.inv",
"numpy.array",
"numpy.matmul",
"numpy.zeros",
"numpy.random.shuffle",
"num... |
spell00/fmri-autosegmentation | [
"8311c8bf4e2f844025fede27668f9072fd2a3344"
] | [
"fmri/models/unsupervised/keras/VQVAE.py"
] | [
"# source https://github.com/HenningBuhl/VQ-VAE_Keras_Implementation/blob/master/VQ_VAE_Keras_MNIST_Example.ipynb\n# VQ layer.\nfrom keras.layers import Input, Layer, Activation, Dense, Flatten, Dropout, Lambda, Conv2D, MaxPooling2D, UpSampling2D, Conv2DTranspose, SpatialDropout2D\nfrom keras import backend as K\nf... | [
[
"tensorflow.nn.embedding_lookup"
]
] |
Mattarian/GAD-USRCAT | [
"306a21e8afbeff3d8b56ae4641ac1195a12f2036"
] | [
"Exp 4 4 with USRCAT/generation_props.py"
] | [
"'''\r\nFunctions that are used while a Generation is being Evaluated \r\n'''\r\nimport os\r\nimport random\r\nimport multiprocessing\r\nfrom rdkit import Chem\r\nimport numpy as np\r\nfrom random import randrange\r\nimport discriminator as D\r\nimport evolution_functions as evo\r\nfrom SAS_calculator.sascorer impo... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.random.choice",
"numpy.argsort"
]
] |
sakshi87/pymc3 | [
"8b0279a77eb11e0b6cfd7962db202ec85573e6df"
] | [
"pymc3/tests/test_sampling.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.testing.assert_allclose",
"numpy.isclose",
"numpy.random.rand",
"numpy.random.random",
"numpy.random.normal",
"numpy.random.poisson",
"numpy.random.randint",
"numpy.sqrt",
"numpy.random.multinomial",
"numpy.atleast_2d",
"numpy.array",
"scipy.stats.norm.rvs",
... |
ogunnoo/aaw-contrib-containers | [
"8760c1427ba2ea497cc7f01e07fe80cfcb9bdb1e"
] | [
"btap/src/prepare_weather.py"
] | [
"#!/usr/bin/env python3\n\"\"\"Prepare the weather file(s) specified in the YAML configuration to be used by the pipeline.\n\nCLI arguments match those defined by ``main()``.\n\"\"\"\nimport logging\n\nimport pandas as pd\nimport typer\nimport yaml\n\nimport config\n\n# Get a log handler\nlogging.basicConfig(level=... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
Anirudh0707/EdgeML_old | [
"636c1b2ab4f09c95d7d0bd3b68d33b92a9efbf20"
] | [
"examples/pytorch/ProtoNN/protoNN_example.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT license.\n\nfrom __future__ import print_function\nimport sys\nimport os\nimport numpy as np\nfrom edgeml_pytorch.trainer.protoNNTrainer import ProtoNNTrainer\nfrom edgeml_pytorch.graph.protoNN import ProtoNN\nimport edgeml_pytor... | [
[
"torch.max",
"numpy.load",
"numpy.save",
"torch.cuda.is_available",
"torch.Tensor"
]
] |
ieaves/tenzing | [
"92d39c1c3a5633d8074e0ffe8c2687c465aebbc8"
] | [
"examples/titanic.py"
] | [
"import pandas as pd\n\nfrom visions.core.implementations import visions_complete_set\nfrom visions.core.functional import type_cast_frame, type_inference_frame\nfrom visions.application.summaries.summary import CompleteSummary\nfrom visions.core.model.dtypes.bool_fix.visions_bool import visions_boolean\n\n# Load d... | [
[
"pandas.read_csv"
]
] |
asultan123/ADP | [
"12a0875d84a6d1b660a4657e0276e7a0511487fd"
] | [
"utils.py"
] | [
"from __future__ import print_function\r\nfrom tensorflow.keras import backend as K\r\nimport tensorflow as tf\r\nimport numpy as np\r\n\r\n# from cleverhans.cleverhans_v3.1.0.attacks_tf import _project_perturbation, UnrolledAdam\r\n# from cleverhans.attacks import Attack\r\nfrom distutils.version import LooseVersi... | [
[
"tensorflow.compat.v1.flags.DEFINE_float",
"tensorflow.keras.losses.categorical_crossentropy",
"tensorflow.ones_like",
"tensorflow.reshape",
"numpy.dtype",
"numpy.concatenate",
"tensorflow.rank",
"tensorflow.argmax",
"tensorflow.math.log",
"tensorflow.transpose",
"tenso... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.