repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
ada-shen/utility | [
"6bc9520951276d3d1460796509022704323d9fca",
"6bc9520951276d3d1460796509022704323d9fca"
] | [
"POINTNET2/models/Pointnet2/pointnet2_cls_ad.py",
"Pointsift/models/PointSIFT/pointnet2_sift_noisy.py"
] | [
"\"\"\"\n PointNet++ Model for point clouds classification\n\"\"\"\nimport os\nimport sys\nBASE_DIR = os.path.dirname(__file__)\nsys.path.append(BASE_DIR)\nsys.path.append(os.path.join(BASE_DIR, 'utils'))\nimport tensorflow as tf\nimport numpy as np\nimport models.Pointnet2.utils.tf_util as tf_util\nfrom pointne... | [
[
"tensorflow.zeros",
"tensorflow.summary.scalar",
"tensorflow.Graph",
"tensorflow.reshape",
"tensorflow.norm",
"tensorflow.constant",
"tensorflow.placeholder",
"tensorflow.reduce_mean",
"tensorflow.add_to_collection",
"tensorflow.nn.sparse_softmax_cross_entropy_with_logits"
... |
NicoHendrickx/pulse_lib | [
"94cd9cf7a8d4d422b86c0759dd2eb7c3466d6413"
] | [
"pulse_lib/segments/segment_markers.py"
] | [
"\"\"\"\nMarker implementation.\n\"\"\"\n\nfrom pulse_lib.segments.segment_base import segment_base, last_edited\nfrom pulse_lib.segments.segment_IQ import segment_IQ\nfrom pulse_lib.segments.utility.data_handling_functions import loop_controller\nfrom pulse_lib.segments.data_classes.data_markers import marker_data... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend"
]
] |
Dorkat0/Pommerman_students | [
"28f3b90d63de8726aab3e5cfb3107c1a918d17a1"
] | [
"student_agents/heuristic_agent/heuristic_agent/game_state.py"
] | [
"import numpy as np\n\nfrom pommerman import agents\nfrom pommerman import constants\nfrom pommerman import characters\n\n\n# we have to create a game state from the observations\n# in this example we only use an approximation of the game state, this can be improved\n# approximations are:\n# - flames: initialized ... | [
[
"numpy.where",
"numpy.array"
]
] |
hboshnak/nidaqmx-python | [
"b756fbd7f0c0f7deadb468d77ceacb03ed467885"
] | [
"nidaqmx/task.py"
] | [
"import ctypes\nimport numpy\nimport six\nimport warnings\n\nfrom nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32\nfrom nidaqmx._task_modules.channels.channel import Channel\nfrom nidaqmx._task_modules.export_signals import ExportSignals\nfrom nidaqmx._task_modules.in_stream import InStream\nfrom nidaqm... | [
[
"numpy.asarray",
"numpy.zeros"
]
] |
PyFillingTeam/PyFilling | [
"bdcec0caa28cf0b97670593a012dca7485cdf637"
] | [
"PAS/ts.py"
] | [
"#!/usr/bin/python\r\n\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom statsmodels.tsa.arima_model import ARIMA\r\nfrom sklearn.metrics import mean_squared_error\r\nimport warnings\r\nwarnings.simplefilter(\"ignore\")\r\n\r\ndef get_data(start):\r\n #iterate through protocols\r\n protocols = ['dns', 'htt... | [
[
"numpy.array",
"sklearn.metrics.mean_squared_error",
"numpy.append",
"pandas.read_csv",
"pandas.Series"
]
] |
gcinar/coinML | [
"9014516f786f3211a80cf784bb8a295dd6ab6c2d"
] | [
"src/data_collection/api.py"
] | [
"import requests\nimport pandas as pd\nimport json\n\nclass CryptoAPI:\n def get_pair(self, symbol, granularity=86400):\n #code example from: https://www.cryptodatadownload.com/blog/how-to-download-coinbase-price-data.html\n url = f'https://api.pro.coinbase.com/products/{symbol}/candles?granularity... | [
[
"pandas.to_datetime"
]
] |
segasai/gala | [
"8d6f3557894231d975c287a2b8560d09a4789513"
] | [
"gala/coordinates/pal5.py"
] | [
"\"\"\" Astropy coordinate class for the Palomar 5 stream coordinate system \"\"\"\n\n# Third-party\nimport numpy as np\n\nimport astropy.units as u\nimport astropy.coordinates as coord\nfrom astropy.coordinates import frame_transform_graph\nfrom astropy.coordinates.matrix_utilities import matrix_transpose\n\n__all... | [
[
"numpy.array"
]
] |
koukoulala/yanmtt | [
"24a499aff8f587e6de252dd67a64471fce6fe71b"
] | [
"transformers/src/transformers/models/mbart/modeling_mbart.py"
] | [
"# coding=utf-8\n# Copyright 2021, The Facebook AI Research Team and The HuggingFace Inc. team. All rights reserved.\n# Copyright 2021, National Institute of Information and Communication Technology (Raj Dabre)\n# Modified portions by Raj Dabre are indicated as so. \n#\n# Licensed under the Apache License, Version... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.einsum",
"torch.nn.ModuleList",
"torch.isnan",
"torch.finfo",
"torch.bmm",
"torch.nn.Parameter",
"torch.ones",
"numpy.cos",
"torch.nn.CrossEntropyLoss",
"numpy.sin",
"torch.nn.LayerNorm",
"torch.tril",
"torch.tensor... |
wpisailbot/boat | [
"7c053d67422d21af95e350c4c9d31425e5760df8"
] | [
"scripts/parse.py"
] | [
"#!/usr/bin/python3\nimport numpy as np\n\ndata = np.genfromtxt(\"race.csv\")\n\nwith open(\"race.csv\") as pts:\n for pt in pts:\n pt = pt.split(' ')\n lat = float(pt[1]) + float(pt[2]) / 60.0\n lon = float(pt[4]) + float(pt[5]) / 60.0\n print(\"points: {x: \" + repr(lon) + \", y: \"... | [
[
"numpy.genfromtxt"
]
] |
pengchenyu111/PaperCodeReplication | [
"7b8681654e25b7d707f4b4d7ebcfb85ffc0fd52a",
"7b8681654e25b7d707f4b4d7ebcfb85ffc0fd52a",
"7b8681654e25b7d707f4b4d7ebcfb85ffc0fd52a"
] | [
"Pytorch/5-CNN/model_train_gpu_2.py",
"Pytorch/5-CNN/model_load.py",
"Anomaly_Detection/Clustering_Based_Approaches/OPTICS.py"
] | [
"import torchvision\nfrom torch.utils.tensorboard import SummaryWriter\nfrom my_nn_model import *\nfrom torch import nn\nfrom torch.utils.data import DataLoader\nimport time\n\n\"\"\"\n 1050ti,i5-7300HQ 环境下GPU是CPU计算速度的5倍\n 利用GPU进行训练,方式2:\n 在 数据、网络结构、损失函数使用to(device)方法\n\"\"\"\n\ndevice = torch.device(\... | [
[
"torch.nn.CrossEntropyLoss",
"torch.utils.tensorboard.SummaryWriter",
"torch.utils.data.DataLoader"
],
[
"torch.load"
],
[
"numpy.dot",
"numpy.random.rand",
"sklearn.datasets.make_blobs",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.figure",
"sklearn.c... |
CharlesCo12/CarlosCordoba_Ejercicio22 | [
"0eeddb2781d5cd9692a5d15796ecef7b6227671b"
] | [
"graficar.py"
] | [
"import os\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nos.system(\"g++ funcion.cpp -o funcion.x\")\nos.system(\"./funcion.x > datos.txt\")\n\ndatos=np.loadtxt('datos.txt',usecols=0)\ndatos=datos/np.sqrt(2*np.pi)\nplt.figure(figsize=(10,10))\nplt.hist(datos,color='green')\nplt.xlabel('Datos')\nplt.grid()... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.hist",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel",
"numpy.sqrt"
]
] |
ywu94/Tencent-Ads-Algo-Comp-2020 | [
"8f008fc1cc21c832e6bdb76056d12ad357da5475"
] | [
"Script/train_v2_age_final_resgru_cnn_multiInp.py"
] | [
"import os\nimport sys\nimport numpy as np \nimport pandas as pd\nimport logging\nimport gc\nimport tqdm\nimport pickle\nimport json\nimport time\nimport tempfile\nfrom gensim.models import Word2Vec\nfrom sklearn.metrics import accuracy_score, roc_auc_score\n\nimport torch\nfrom torch import nn\nimport torch.nn.fun... | [
[
"numpy.array",
"torch.no_grad",
"torch.cuda.get_device_properties",
"torch.cuda.memory_cached",
"torch.cuda.memory_allocated",
"sklearn.metrics.accuracy_score",
"torch.cuda.empty_cache",
"torch.cuda.is_available",
"numpy.arange",
"torch.load",
"torch.optim.lr_scheduler.... |
aaarendt/PointDatabase | [
"c99c2d17693d65b919349c1eb652bdbe855dc0a7"
] | [
"ATL06_tiles.py"
] | [
"#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Apr 29 09:40:02 2019\n\n@author: ben\n\"\"\"\nimport numpy as np\nimport scipy.interpolate as si\nimport h5py\nfrom PointDatabase.geo_index import geo_index\nfrom PointDatabase.point_data import point_data\nfrom PointDatabase.point_data impor... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros_like",
"numpy.round",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.nanmin",
"matplotlib.pyplot.figure",
"numpy.min",
"numpy.diff",
"numpy.arange",
"numpy.argsort",
"numpy.isfinite",
"numpy.abs",... |
Kh4L/kaolin | [
"83002fedc67e1c9112a8f834ffb4f8a890e6042a"
] | [
"kaolin/models/OccupancyNetwork.py"
] | [
"# Copyright (c) 2019, 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\n\n# Unless requir... | [
[
"torch.zeros",
"torch.Size",
"torch.nn.Linear",
"torch.nn.InstanceNorm1d",
"torch.nn.GroupNorm1d",
"torch.nn.Conv1d",
"torch.nn.Sequential",
"torch.nn.init.ones_",
"torch.ones",
"torch.nn.ReLU",
"torch.distributions.Bernoulli",
"torch.nn.BatchNorm1d",
"torch.dis... |
S-HuaBomb/FixMatch-Paddle | [
"c722670ec8af70e4f7a84f67c4d37a0cfb4d7db2"
] | [
"test.py"
] | [
"# encoding=utf8\n# Copyright (c) 2021 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\... | [
[
"numpy.random.seed"
]
] |
voxel51/fiftyone | [
"0f113175174ec1d4cd2f901a43317bb817847b53"
] | [
"fiftyone/utils/data/parsers.py"
] | [
"\"\"\"\nSample parsers.\n\n| Copyright 2017-2021, Voxel51, Inc.\n| `voxel51.com <https://voxel51.com/>`_\n|\n\"\"\"\nimport os\n\nimport numpy as np\n\nimport eta.core.image as etai\nimport eta.core.serial as etas\nimport eta.core.utils as etau\n\nimport fiftyone as fo\nimport fiftyone.core.clips as foc\nimport fi... | [
[
"numpy.asarray"
]
] |
TobyChen0106/DeepQ_Final_B05901170 | [
"808a224c01272726a051eb7b7bb9e1b28887716e"
] | [
"test.py"
] | [
"import numpy as np\n\n# data_1 = np.load('train_data_1.npy')\n# data_2 = np.load('train_data_2.npy')\n\nlabel_1 = np.load('train_label.npy')\n# label_2 = np.load('train_label_2.npy')\n\n# label_1 = np.squeeze(label_1, axis =1 )\n\n# label_1 = np.expand_dims(label_1, axis = 0)\nprint(label_1)\n\nprint(label_1.shape... | [
[
"numpy.load"
]
] |
cartosquare/gdal | [
"c2ce185366e6276e77bbebbe9fe509055ed6d0fd"
] | [
"gdal/swig/python/osgeo/gdal.py"
] | [
"# This file was automatically generated by SWIG (http://www.swig.org).\n# Version 3.0.12\n#\n# Do not make changes to this file unless you know what you are doing--modify\n# the SWIG interface file instead.\n\nfrom sys import version_info as _swig_python_version_info\nif _swig_python_version_info >= (2, 7, 0):\n ... | [
[
"numpy.ma.array"
]
] |
toddrme2178/pandas_ext | [
"6e5fd5aa3e567dec641014dfaee3c9f616f7e057"
] | [
"pandas_ext/excel.py"
] | [
"\"\"\"Save xls[x] files to s3.\"\"\"\nimport os\n\nfrom tempfile import gettempdir\n\nimport pandas as pd\nimport s3fs\n\nfrom pandas_ext.common.utils import is_s3_path\n\n\ndef to_excel(df: pd.DataFrame, file_path: str, engine='', **kwargs) -> None:\n \"\"\"Given a df, write it to s3 if necessary.\"\"\"\n i... | [
[
"pandas.ExcelWriter"
]
] |
gregoryrpitts/sportsreference | [
"008b13d8ca59aa0fe227dc2c5c0028439c3198dd"
] | [
"sportsreference/ncaaf/boxscore.py"
] | [
"import pandas as pd\nimport re\nfrom datetime import timedelta\nfrom pyquery import PyQuery as pq\nfrom urllib.error import HTTPError\nfrom .. import utils\nfrom ..constants import AWAY, HOME\nfrom ..decorators import int_property_decorator\nfrom .constants import (BOXSCORE_ELEMENT_INDEX,\n ... | [
[
"pandas.DataFrame"
]
] |
orionr/gpytorch | [
"b31a9907223e7b8793cc179b1d5d9e6fb1128a5b"
] | [
"gpytorch/utils/pivoted_cholesky.py"
] | [
"import torch\nfrom torch.autograd import Variable\nfrom .cholesky import batch_potrf, batch_potrs\n\n\ndef pivoted_cholesky(matrix, max_iter, error_tol=1e-3):\n from ..lazy import LazyVariable, NonLazyVariable\n\n # matrix is assumed to be batch_size x n x n\n if matrix.ndimension() < 3:\n batch_si... | [
[
"torch.sqrt",
"torch.arange",
"torch.max",
"torch.is_tensor",
"torch.norm",
"torch.gather",
"torch.autograd.Variable",
"torch.sum"
]
] |
trinity652/Desicion-tree-Network-Analysis | [
"b284231680eed8ad6c16863e98159b6cc1b90da3"
] | [
"data_set1.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Apr 18 05:31:53 2017\n\n@author: abhilasha\n\"\"\"\n\nimport csv\nimport os\n#import random\nfrom sklearn import tree\nx=[]\narr=[0,1]\ny=[]\nz=[]\nconnection_result=[]\nConnection_info=dict()\nwith open('Desktop/test1.csv','r') as tcpfile:\n ... | [
[
"sklearn.tree.export_graphviz",
"sklearn.tree.DecisionTreeClassifier"
]
] |
MiRL-IITM/BioExp | [
"d121661bac7ae2d8c1bed7a52e9a0f550f446baa"
] | [
"examples/general_examples/graph_example.py"
] | [
"import sys\nsys.path.append('..')\nimport argparse\nimport keras\nimport numpy as np\nimport tensorflow as tf\nfrom keras.models import load_model\nimport pandas as pd\nfrom tqdm import tqdm\nfrom glob import glob\nfrom BioExp.helpers import utils\nfrom BioExp.graphs import concept\nimport os\n\nfrom keras.backend... | [
[
"tensorflow.ConfigProto",
"tensorflow.Session"
]
] |
joycenerd/genrep_aug | [
"f2b626fde6e2c539ced8d7d4ab82df596a683242"
] | [
"GenRep/online_learning/main_unified_online_mp_v2_130k.py"
] | [
"from __future__ import print_function\nimport math\nfrom torch.multiprocessing import Pool\nimport functools\n\nimport numpy as np\nimport pdb\nimport os\nimport sys\nimport argparse\nimport time\nimport math\n\nimport torchvision.utils as vutils\nfrom torch.utils.data import *\nimport tensorboard_logger as tb_log... | [
[
"torch.cat",
"numpy.random.choice",
"tensorflow.compat.v1.disable_v2_behavior",
"torch.cuda.current_device",
"torch.cuda.is_available",
"torch.load",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel",
"numpy.concatenate",
"tensorflow.compat.v1.global_variables_initialize... |
meixinzhang/tfx | [
"04d98f94b37f82fd8f30d782934d21e9d812c1c3"
] | [
"tfx/components/evaluator/component_test.py"
] | [
"# Lint as: python2, python3\n# Copyright 2019 Google LLC. 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\... | [
[
"tensorflow.test.main"
]
] |
messiest/gamelab | [
"ed366f62f51c29480a76d55cf248ef4bb0681d57"
] | [
"gamelab/microeconomic_system/agent.py"
] | [
"import numpy as np\nfrom message import Message\nfrom thespian.actors import *\n\n\nclass Agent(Actor):\n def __init__(self):\n self.wealth = np.random.randint(1, 10)\n\n def get_wealth(self):\n return self.wealth\n\n def receiveMessage(self, message, sender):\n if isinstance(message,... | [
[
"numpy.random.randint"
]
] |
Z-yq/TensorflowTTS | [
"abbc79f6e8d97fed3c7308ae844b97f59d349301"
] | [
"dataloaders/vocoder_dataloader.py"
] | [
"import logging\nimport os\n\nimport librosa\nimport numpy as np\nimport tensorflow as tf\nfrom utils.speech_featurizers import SpeechFeaturizer\n\n\n\nclass VocoderDataLoader():\n def __init__(self, config, training=True):\n self.config = config\n self.batch = config['batch_size']\n self.ma... | [
[
"numpy.pad",
"numpy.array",
"tensorflow.TensorShape",
"numpy.random.shuffle",
"numpy.stack",
"numpy.hstack"
]
] |
YangQi-y7/MedImgSeg-Cls | [
"4234752c869120cc4e4fed672d15a21ca8bf8284"
] | [
"dataset_prepare/1_cut_patch.py"
] | [
"import os\r\nimport numpy as np\r\nimport SimpleITK as sitk\r\nimport random\r\nimport pandas as pd\r\nfrom tqdm import tqdm\r\nfrom parameters import K, processed_dir, patches_dir, patch_size\r\n\r\n\r\ndef check_out_dirs(base_dir):\r\n if not os.path.exists(os.path.join('..', base_dir)):\r\n os.mkdir(o... | [
[
"pandas.DataFrame",
"numpy.clip"
]
] |
br4ch1st0chr0n3/robotic_systems_labs | [
"23b8b81dc845e00cf02460258b9cec817019957b"
] | [
"practices/practice_4/task3.1.py"
] | [
"from matplotlib.pyplot import contour\nfrom libs.can import CANSocket\nfrom libs.myactuator import MyActuator\nfrom time import perf_counter\nimport numpy as np\n\n# the serial port of device\n# you may find one by examing /dev/ folder,\n# this is usually devices ttyACM\nserial_device = \"ttyACM0\"\n\n# Initiate t... | [
[
"numpy.full",
"numpy.array",
"numpy.sin",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
avineshwar/clusterfuzz | [
"cd72fc66fb5cd4013196662c3564339a940e1c41"
] | [
"src/python/bot/fuzzers/ml/rnn/utils.py"
] | [
"# Copyright 2019 Google LLC\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 agreed ... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.reshape",
"numpy.sum",
"numpy.roll",
"numpy.argsort",
"numpy.squeeze"
]
] |
RUrlus/ModelMetricUncertainty | [
"f401a25dd196d6e4edf4901fcfee4b56ebd7c10b"
] | [
"tests/api/test_prpoint.py"
] | [
"import os\nimport itertools\nimport numpy as np\nimport pytest\nimport scipy.stats as sts\nimport sklearn.metrics as skm\nfrom sklearn.datasets import make_classification\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.model_selection import train_test_split\n\n\nimport mmu\nfrom mmu.commons._te... | [
[
"sklearn.metrics.confusion_matrix",
"numpy.isclose",
"numpy.array_equal",
"numpy.asarray",
"numpy.isnan",
"numpy.random.seed",
"numpy.load",
"sklearn.metrics.precision_recall_fscore_support",
"sklearn.linear_model.LogisticRegression",
"numpy.allclose",
"numpy.random.uni... |
anguanping/flopy | [
"4a9ea1a8f47467239f40c67b6f6823a424a845df",
"4a9ea1a8f47467239f40c67b6f6823a424a845df"
] | [
"flopy/plot/plotbase.py",
"flopy/modflow/mfhyd.py"
] | [
"import numpy as np\r\nfrom ..plot.crosssection import _StructuredCrossSection\r\nfrom ..plot.vcrosssection import _VertexCrossSection\r\nfrom ..plot import plotutil\r\n\r\ntry:\r\n import matplotlib.pyplot as plt\r\n import matplotlib.colors\r\nexcept ImportError:\r\n plt = None\r\n\r\n\r\nclass PlotCross... | [
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.ma.masked_equal",
"numpy.ravel",
"numpy.sqrt",
"numpy.all"
],
[
"numpy.dtype"
]
] |
timoudas/premier_league_api | [
"2b850466ed1c910ee901c68e660706d55f53df61"
] | [
"dashboard/dashboard_data.py"
] | [
"\nimport pandas as pd\n\nfrom db_connector import FixturesDB\nfrom db_connector import LeagueDB\nfrom db_connector import PlayersDB\nfrom db_connector import TeamsDB\n\n\nclass DataInit():\n\n def __init__(self, league='EN_PR', season='2019'):\n self.league = league\n self.season = season\n\n @... | [
[
"pandas.DataFrame.from_dict"
]
] |
judithernandez/hydra_test | [
"239207afbaee00a27f8d87ac14905dfff3e1c502"
] | [
"src/datamodule/MNIST.py"
] | [
"import logging\n\nimport pytorch_lightning as pl\nfrom hydra.utils import instantiate\nfrom torch.utils.data import DataLoader, Dataset\n\n\nclass MNISTDataLoader(pl.LightningDataModule):\n def __init__(\n self,\n dataset,\n data_base_path: str,\n batch_size: int,\n num_worker... | [
[
"torch.utils.data.DataLoader"
]
] |
dumasl/Pandora | [
"6bae22926e59bcd02d7f6f9485bd5715ffceb450"
] | [
"pandora/validation/interpolated_disparity.py"
] | [
"#!/usr/bin/env python\n# coding: utf8\n#\n# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).\n#\n# This file is part of PANDORA\n#\n# https://github.com/CNES/Pandora_pandora\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance wi... | [
[
"numpy.array",
"numpy.zeros",
"numpy.copy",
"numpy.argmax",
"numpy.abs",
"numpy.nanmedian"
]
] |
kashif/distrax | [
"55f2afbcf144be6602a742b41ee6a62efa622f6d"
] | [
"distrax/_src/bijectors/tfp_compatible_bijector_test.py"
] | [
"# Copyright 2021 DeepMind Technologies Limited. 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# Unle... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.full",
"numpy.zeros",
"numpy.ones"
]
] |
weixsong/Codeblock | [
"413e7acd6addc4950bffe2d57eb0cc7973c6fb7a"
] | [
"tensorflow-wavenet/wavenet/model.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\nfrom .ops import causal_conv, mu_law_encode\n\n\ndef create_variable(name, shape):\n '''Create a convolution filter variable with the specified name and shape,\n and initialize it using Xavier initialition.'''\n initializer = tf.contrib.layers.xavier_initiali... | [
[
"tensorflow.constant_initializer",
"tensorflow.matmul",
"tensorflow.histogram_summary",
"tensorflow.reshape",
"tensorflow.nn.embedding_lookup",
"tensorflow.tanh",
"tensorflow.one_hot",
"tensorflow.cast",
"tensorflow.trainable_variables",
"tensorflow.shape",
"tensorflow.... |
philip-fu/FairMOT | [
"8f9c5317eff6f357952a33a26400d3b8b7ea4ff4"
] | [
"src/track.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport _init_paths\nimport os\nimport os.path as osp\nimport cv2\nimport logging\nimport argparse\nimport motmetrics as mm\nimport numpy as np\nimport torch\n\nfrom lib.tracker.multitracker import JDET... | [
[
"numpy.sum",
"numpy.dot",
"numpy.asarray",
"torch.from_numpy"
]
] |
onlyrico/lightseq | [
"3b84e87170fb82c239738b06588bf55f4cf4c911"
] | [
"tests/fairseq_layers.py"
] | [
"\"\"\"\nCopyright 2021 The LightSeq Team\nCopyright Facebook Fairseq\nWe use layers from Facebook Fairseq as our baseline for unit test\n\"\"\"\n\nfrom typing import Dict, List, Optional, Callable\nimport math\nfrom copy import deepcopy\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom ... | [
[
"torch.nn.Linear",
"torch.device",
"torch.cat",
"torch.zeros",
"torch.cos",
"torch.arange",
"torch.nn.init.constant_",
"torch.sin",
"torch.nn.functional.dropout",
"torch.ne",
"torch.nn.init.normal_",
"torch.nn.Embedding",
"torch.cumsum"
]
] |
npolosky/BayesianOptimization | [
"909f4e954be82cb09588aecf3ab79c59d5e7462d"
] | [
"cmaes.py"
] | [
"import numpy as np\nfrom typing import Callable\n\ndef CMAES(initialMean:np.ndarray, initialSigma:float, numIterations:int, f:Callable, params, minimize:bool):\n \"\"\"\n This is an implementation of the Covariance Matrix Adaptation Evolution Strategy (CMA-ES).\n It is a python implementation tran... | [
[
"numpy.random.normal",
"numpy.dot",
"numpy.random.rand",
"numpy.isnan",
"numpy.zeros",
"numpy.log",
"numpy.random.seed",
"numpy.sum",
"numpy.linalg.norm",
"numpy.ones",
"numpy.real",
"numpy.eye",
"numpy.arange",
"numpy.power",
"numpy.linalg.eig",
"nu... |
google/ehr-predictions | [
"811d3087ced4f92d28f98161478ff0ad6b571ad4"
] | [
"ehr_prediction_modeling/embeddings/input_embedding_base.py"
] | [
"# coding=utf-8\n# Copyright 2021 Google Health Research.\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 ... | [
[
"tensorflow.compat.v1.constant"
]
] |
agottipati9/GraphSAGE | [
"694bda8dd555416d5ddf219ea4de91c17f5589bf"
] | [
"eval_scripts/ppi_eval.py"
] | [
"from __future__ import print_function\nimport json\nimport numpy as np\nimport pandas as pd\n\nfrom networkx.readwrite import json_graph\nfrom argparse import ArgumentParser\n\n''' To evaluate the embeddings, we run a logistic regression.\nRun this script after running unsupervised training.\nBaseline of using fea... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.log",
"sklearn.preprocessing.StandardScaler",
"numpy.random.seed",
"numpy.genfromtxt",
"numpy.load",
"numpy.min",
"sklearn.linear_model.SGDClassifier",
"sklearn.dummy.DummyClassifier",
"numpy.expand_dims"
]
] |
BLimmie/eyewire_validator | [
"119f36098e1b6342c4b97eec89b6021b655d1440"
] | [
"data_scripts/test_loss.py"
] | [
"from models.custom_loss import Bayes_BCE_Loss_With_Logits\r\nimport torch\r\nfrom tools.create_data import create_gt\r\n\r\nx = torch.randn(256,256,256, requires_grad=True)\r\nsigma = torch.ones(256,256,256, dtype=torch.float, requires_grad=True)\r\ny = torch.tensor(create_gt(10531), dtype=torch.float)\r\n\r\nlos... | [
[
"torch.randn",
"torch.ones"
]
] |
matech96/federated | [
"cfe9d3e35ba033b1c4e47d347427a83f682f41de"
] | [
"tensorflow_federated/python/core/api/computation_types.py"
] | [
"# Copyright 2018, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"tensorflow.TensorShape"
]
] |
Pacman1984/etna | [
"9b3ccb980e576d56858f14aca2e06ce2957b0fa9"
] | [
"tests/test_transforms/test_encoders/test_segment_encoder_transform.py"
] | [
"import numpy as np\nimport pandas as pd\n\nfrom etna.transforms import SegmentEncoderTransform\n\n\ndef test_segment_encoder_transform(dummy_df):\n transform = SegmentEncoderTransform()\n transformed_df = transform.fit_transform(dummy_df)\n assert (\n len(transformed_df.loc[:, pd.IndexSlice[:, \"re... | [
[
"numpy.all"
]
] |
Samitha156/Deploying-a-dentiment-analysis-Udacity-AWS | [
"4c9879cd99784530ab15d21152a04603ccca28fb"
] | [
"serve/predict.py"
] | [
"import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\nfrom utils import review_to_words, convert_and_p... | [
[
"torch.no_grad",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.load",
"numpy.hstack"
]
] |
arielleoren/clearml | [
"01f0be9895272c483129bab784a43cbd002022a7",
"01f0be9895272c483129bab784a43cbd002022a7"
] | [
"examples/frameworks/ignite/cifar_ignite.py",
"clearml/binding/frameworks/tensorflow_bind.py"
] | [
"from pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torchvision.datasets as datasets\nimport torchvision.transforms as transforms\nfrom ignite.contrib.handlers import TensorboardLogger\nfrom ignite.en... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"matplotlib.pyplot.figure",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.nn.functional.softmax",
"torch.nn.CrossEntropyLoss"
],
[
"tensorflow.python.eager.context.context",
"tensorflow.py_function",
"tensorflow.python.ops... |
par2/lamana | [
"f3bcc3dd609ba69ff4ed203270fa0d2592195dda"
] | [
"lamana/tests/test_output_.py"
] | [
"#------------------------------------------------------------------------------\n'''Confirm output of general models.'''\n\nimport logging\nimport itertools as it\n\nimport matplotlib as mpl\nmpl.use('Agg') # required to prevent DISPLAY error; must be before pyplot (REF ... | [
[
"matplotlib.use",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots"
]
] |
awgansekoele/outlier-exposure | [
"9557c7915fa466fc54951357519cfba27f7659ad"
] | [
"utils/tinyimages_80mn_loader.py"
] | [
"import numpy as np\nimport torch\nfrom bisect import bisect_left\n\n\nclass TinyImages(torch.utils.data.Dataset):\n\n def __init__(self, transform=None, exclude_cifar=True):\n\n data_file = open('/raid/data/arwin/data/tiny_images.bin', \"rb\")\n\n def load_image(idx):\n data_file.seek(i... | [
[
"numpy.fromstring",
"numpy.random.randint"
]
] |
jakobkruse1/thesis-emotion-detection | [
"59edec10255e57b79a3c2cb32723cb2e852e6797"
] | [
"src/evaluation/scripts/best_text_models.py"
] | [
"\"\"\"This script prints the five best text models from the experiments.\"\"\"\nimport glob\n\nimport numpy as np\n\nfrom src.evaluation.evaluator import Evaluator\n\nif __name__ == \"__main__\": # pragma: no cover\n evaluator = Evaluator()\n evaluator.read_results(\n glob.glob(\"experiments/results/... | [
[
"numpy.asarray"
]
] |
PeiliangLi/avod | [
"655b333d36710d665de63fa67355d973364625b5"
] | [
"avod/core/evaluator_utils.py"
] | [
"import sys\nimport datetime\nimport subprocess\nfrom distutils import dir_util\n\nimport numpy as np\nimport os\nfrom PIL import Image\nimport tensorflow as tf\n\nfrom wavedata.wavedata.tools.core import calib_utils\n\nimport avod\nfrom avod.core import box_3d_projector\nfrom avod.core import summary_utils\n\n\nde... | [
[
"numpy.max",
"numpy.savetxt",
"numpy.asarray",
"numpy.round",
"numpy.median",
"numpy.min",
"numpy.mean",
"numpy.loadtxt",
"tensorflow.summary.FileWriter",
"numpy.column_stack",
"tensorflow.get_collection"
]
] |
WERimagin/OpenNMT | [
"d33eb7077864ddab5f3a3832bba5153d1055502e"
] | [
"bleu_noninterro.py"
] | [
"import warnings\nwarnings.filterwarnings(\"ignore\")\nimport nltk\nfrom nltk.tokenize import word_tokenize,sent_tokenize\nfrom nltk.translate.bleu_score import corpus_bleu,sentence_bleu\nfrom onmt.utils.corenlp import CoreNLP\n\nfrom tqdm import tqdm\nfrom collections import defaultdict\nimport collections\nimport... | [
[
"numpy.random.seed"
]
] |
GodWriter/RL-Pytorch | [
"26f5b3ec4c12bd5c7c33d0a9b0952165c86330ae"
] | [
"value_function_approximate/DQN/DQN_CartPole_V0.py"
] | [
"import gym\nimport argparse\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data.sampler import BatchSampler, SubsetRandomSampler\n\nfrom collections import namedtuple\nfrom tensorboardX import SummaryWriter\n\n\n# Environment Config\nenv = gym.make('Ca... | [
[
"torch.nn.Linear",
"numpy.random.rand",
"torch.nn.MSELoss",
"torch.max",
"torch.no_grad",
"torch.manual_seed",
"torch.tensor",
"torch.LongTensor"
]
] |
zhangyuejoslin/R2R-EnvDrop | [
"5993831ad3174f4d68150e587fb6a52c7a0ce472"
] | [
"r2r_src/agent.py"
] | [
"import json\nimport os\nimport sys\nimport numpy as np\nimport random\nimport math\nimport time\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch import optim\nimport torch.nn.functional as F\n\nfrom env import R2RBatch\nfrom utils import padding_idx, add_idx, Tokenizer\nimpor... | [
[
"torch.distributions.Categorical",
"torch.stack",
"torch.ones",
"torch.load",
"torch.nn.CrossEntropyLoss",
"numpy.concatenate",
"numpy.zeros_like",
"torch.autograd.Variable",
"numpy.argmax",
"torch.zeros",
"numpy.logical_or",
"numpy.array",
"numpy.zeros",
"t... |
sebascuri/rhucrl | [
"27663e1302f3bbc636dff28495c6f2667bb7c1da"
] | [
"rhucrl/policy/adversarial_policy.py"
] | [
"\"\"\"Python Script Template.\"\"\"\nfrom abc import ABCMeta\n\nimport torch\nfrom hucrl.policy.augmented_policy import AugmentedPolicy\nfrom rllib.policy import AbstractPolicy, NNPolicy\n\n\nclass AdversarialPolicy(AbstractPolicy, metaclass=ABCMeta):\n \"\"\"Given a protagonist and an antagonist policy, combin... | [
[
"torch.cat"
]
] |
Kokkini/DQfD | [
"58465a4c99127a36075454f6bf7e80da5d9ed1e9"
] | [
"dqfd.py"
] | [
"# This code is based on code from OpenAI baselines. (https://github.com/openai/baselines)\nimport os.path as osp\nfrom tqdm import tqdm\nfrom time import time\nfrom collections import deque\nimport pickle\nimport dill\nimport tensorflow as tf\nimport numpy as np\n\nfrom common.schedules import LinearSchedule, Cons... | [
[
"numpy.max",
"tensorflow.train.CheckpointManager",
"numpy.sum",
"numpy.min",
"numpy.mean",
"tensorflow.constant",
"numpy.sign",
"numpy.abs",
"tensorflow.device",
"numpy.expand_dims",
"tensorflow.train.Checkpoint"
]
] |
mnm-team/pyzx-heuristics | [
"636ca151f325087c0e6ce8ed1e2ee1cb896cab56"
] | [
"pyzx/scripts/cnot_mapper.py"
] | [
"# PyZX - Python library for quantum circuit rewriting \n# and optimization using the ZX-calculus\n# Copyright (C) 2018 - Aleks Kissinger and John van de Wetering\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 ... | [
[
"pandas.DataFrame",
"numpy.copy"
]
] |
mixuala/fast-neural-style-pytorch | [
"0210810c1060a4c0b597fc4018b4dfd48a91f762"
] | [
"experimental.py"
] | [
"import torch\nimport torch.nn as nn\n\nclass TransformerNetworkV2(nn.Module):\n \"\"\"\n Feedforward Transformation NetworkV2\n \n - No Tanh\n + Using Fully Pre-activated Residual Layers \n \"\"\"\n def __init__(self):\n super(TransformerNetworkV2, self).__init__()\n self... | [
[
"torch.cat",
"torch.nn.functional.interpolate",
"torch.nn.ConvTranspose2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.ReflectionPad2d",
"torch.nn.InstanceNorm2d"
]
] |
claire98han/SpikeTools | [
"f1cdffd50e2cbdb75961a716425c4665aa930f54"
] | [
"spiketools/tests/utils/test_timestamps.py"
] | [
"\"\"\"Tests for spiketools.utils.timestamps\"\"\"\n\nimport numpy as np\n\nfrom spiketools.utils.timestamps import *\n\n###################################################################################################\n##############################################################################################... | [
[
"numpy.array"
]
] |
brainma/ASRNet | [
"b88edbcfbcee2cc77f7f4b2a8d139ced303a4f14"
] | [
"model.py"
] | [
"import torch\nimport torchvision\nimport torchvision.transforms as transforms\nimport torch.optim as optim\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\n\nclass down(nn.Module):\n \n def __init__(self, inChannels, outChannels, filterSize):\n\n super(down, self).__init_... | [
[
"numpy.array",
"torch.nn.functional.avg_pool2d",
"torch.stack",
"torch.cat",
"torch.nn.functional.interpolate",
"torch.nn.Conv2d",
"torch.nn.functional.grid_sample",
"torch.tensor",
"numpy.arange",
"numpy.linspace",
"torch.Tensor"
]
] |
gnkampou/Crawler-Indexer | [
"277d30fdf3ed97e999b64bedda46be9106fd5785"
] | [
"csv_handler.py"
] | [
"import pandas\nimport os\n\n\n# at first we create a csv if doesn't exist after we overwrited with all the words we found in the websites follow it\n# by their frequency in every url.\nfrom Index import Index\n\n\ndef write_a_csv(obj):\n val = list()\n if not os.path.exists('Inverted Index.csv'):\n o... | [
[
"pandas.read_csv"
]
] |
hongshaoyang/pandas | [
"03b9ad89b41da5c5d606c575b39ff3ed1f718a53"
] | [
"pandas/tests/resample/test_period_index.py"
] | [
"from datetime import datetime\n\nimport dateutil\nimport numpy as np\nimport pytest\nimport pytz\n\nfrom pandas._libs.tslibs.ccalendar import DAYS, MONTHS\nfrom pandas._libs.tslibs.period import IncompatibleFrequency\nfrom pandas.errors import InvalidIndexError\n\nimport pandas as pd\nfrom pandas import DataFrame,... | [
[
"pandas.DatetimeIndex",
"pandas.Grouper",
"pandas.core.indexes.period.PeriodIndex",
"pandas.Timestamp",
"pandas.core.indexes.datetimes.date_range",
"pandas.core.indexes.period.period_range",
"pandas._testing.assert_series_equal",
"pandas.period_range",
"pandas.core.resample._ge... |
Doik/micropsi2 | [
"35ef3b48d9da255939e8e7af0e00bbcc98597602"
] | [
"micropsi_core/tests/test_node.py"
] | [
"#!/usr/local/bin/python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nTests for node, nodefunction and the like\n\"\"\"\n\nfrom micropsi_core.nodenet.node import Nodetype\nfrom micropsi_core.nodenet.nodefunctions import neuron, concept\nimport pytest\n\n\ndef test_node_name_defaults(runtime, test_nodenet, resourcepath):\n ... | [
[
"numpy.all",
"numpy.random.rand"
]
] |
keyme/deep_learning | [
"1d08a739d889cf736e75b87cc30ec0476c3dec6d"
] | [
"ICNet/inference.py"
] | [
"\"\"\"\nThis script demonstrates how to load the pretrained numpy weights\n(we use icnet_cityscapes_trainval_90k_bnnomerge.npy specifically) from\nhttps://github.com/hellochick/ICNet-tensorflow and use them to perform\ninference with ICNet on cityscapes images.\n\"\"\"\n\nimport argparse\nimport os\n\nimport cv2\n... | [
[
"tensorflow.assign",
"numpy.load",
"numpy.expand_dims"
]
] |
daniel-schreier/gs-quant | [
"abc5670a35874f2ce701418c9e1da7987092b4f7"
] | [
"gs_quant/markets/indices_utils.py"
] | [
"\"\"\"\nCopyright 2019 Goldman Sachs.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in wr... | [
[
"pandas.DataFrame"
]
] |
EricThomson/gigadetector | [
"c94ff09e4e6f73b803a529b165be68ad3bb0a029"
] | [
"gigadetector/bb_extract_folder.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nProcess bounding boxes on multiple images analyzed using gigatest_folder.py.\nSaves resulting data in gigafolder_bb_reults.pkl and images in processed_images \nfolder.\n\nPart of gigadetector repo:\nhttps://github.com/EricThomson/gigadetector\n\"\"\"\nimport... | [
[
"numpy.delete",
"numpy.asarray"
]
] |
okawo80085/hobo_vr | [
"994bb305f4be6bf46e78cae901f0eb3ae697d863"
] | [
"bindings/python/examples/fake_driver_udu.py"
] | [
"# (c) 2021 Okawo\n# This code is licensed under MIT license (see LICENSE for details)\n\n\"\"\"\nfake driver, meant to be used as a debugger\n\npress c to toggle first person control\n\npress esc to exit\n\n\"\"\"\n\nimport math\nfrom pathlib import Path\nfrom pyrr import Matrix44, matrix44, Vector3\nimport numpy ... | [
[
"numpy.random.seed",
"numpy.array",
"numpy.random.randint",
"numpy.eye"
]
] |
linancn/CrystaLCA-Data-Import | [
"6c343bb2eeb505a71203b4c723c0f53cb0e0f630"
] | [
"OpenLCA/data_init_all.py"
] | [
"import pandas as pd\nimport json\nimport os\nfrom pandas.core.frame import DataFrame\nimport sqlalchemy\nfrom sqlalchemy.engine import create_engine\nfrom sqlalchemy.sql.expression import column, true\n\n\ndef findAllFile(base):\n # os walk files\n for root, ds, fs in os.walk(base):\n for f in fs:\n ... | [
[
"pandas.concat"
]
] |
DdATM/ML-FlappyBird | [
"6cee4d719bbbd80b8fc5303f05a7b0d7c9368fc8"
] | [
"ml-agents/mlagents/trainers/learn.py"
] | [
"# # Unity ML-Agents Toolkit\nimport logging\nimport argparse\n\nfrom multiprocessing import Process, Queue\nimport os\nimport glob\nimport shutil\nimport numpy as np\n\nfrom typing import Any, Callable, Optional, List, NamedTuple\n\nimport mlagents.trainers\nimport mlagents.envs\nfrom mlagents import tf_utils\nfro... | [
[
"numpy.random.randint"
]
] |
jinwang7/Page-Rank-Algorithm | [
"3d2cce9ae3f938802d9301d70a8ec2788ec86863"
] | [
"module/core.py"
] | [
"import numpy as np\nimport time\nimport argparse\nimport sys\n\n\"\"\"\nBelow is code for the PageRank algorithm (power iteration).\n\n\"\"\"\n\n\ndef author():\n return \"Jin Wang\"\n\n\ndef id():\n return 123456789\n\n\nclass PageRank:\n def __init__(self, edge_file):\n\n self.node_degree = {}\n ... | [
[
"numpy.ones",
"numpy.random.rand"
]
] |
PennLINC/xcp_d | [
"9634df0af387a6a3503dc4162c446cc390dfe309"
] | [
"xcp_d/workflow/outputs.py"
] | [
"# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\nimport numpy as np\nimport os\nfrom nipype.pipeline import engine as pe\nfrom nipype.interfaces import utility as niu\nfrom niworkflows.engine.workflows import LiterateWorkflow as Workflow\nfrom ..ut... | [
[
"numpy.int"
]
] |
wdmwhh/pytorch-lightning | [
"5d10a36762776c4b6f6a9c55b4e6bf7bd258137f",
"4018237c309b7d9d6978da73132003615341e04a"
] | [
"pytorch_lightning/metrics/regression/explained_variance.py",
"tests/trainer/test_dataloaders.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.cat"
],
[
"torch.nn.ReLU",
"torch.utils.data.dataloader.DataLoader",
"torch.utils.data.distributed.DistributedSampler",
"torch.cuda.device_count"
]
] |
aminzadenoori/POPCORN-POMDP | [
"a2867bf40f6b89c9a01456dd9cd9ea2f2d20d9fd"
] | [
"src/sepsis_sim.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n\n\nWrapper around the sepsis simulator to get trajectories & optimal policy out.\nBehavior for our purposes will be eps-greedy of optimal.\n\nLots of code here is directly copied from the original gumbel-max-scm repo.s\n\n@author: josephfutoma\n\"\"\"\n\nim... | [
[
"numpy.copy",
"scipy.linalg.block_diag",
"numpy.zeros"
]
] |
AjitNair2/grr | [
"2a2ea891b3927775872904cdd402a18e7bb3d143"
] | [
"grr_colab/convert.py"
] | [
"#!/usr/bin/env python\n\"\"\"Module containing functions for converting messages to dataframe.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport collections\nimport datetime\nimport pandas as ... | [
[
"pandas.DataFrame",
"pandas.Series",
"pandas.concat"
]
] |
datarail/msda | [
"7a09789e6abd4d11abdee3eb5a451c907279eb42"
] | [
"msda/pca.py"
] | [
"import matplotlib.pyplot as plt\nfrom sklearn.decomposition import PCA\nimport pandas as pd\nfrom msda import scatter\nimport matplotlib\nmatplotlib.rcParams['pdf.fonttype'] = 42\nmatplotlib.rcParams['ps.fonttype'] = 42\n\n\ndef compute_pca(df, dfm=None, num_components=2):\n \"\"\"Performs PCA using sklearn's P... | [
[
"pandas.DataFrame",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.subplots",
"pandas.concat"
]
] |
code-review-doctor/FaST-LMM | [
"d1fdad820ebb80329b39cedf8e599ef33230487e"
] | [
"fastlmm/association/tests/test_single_snp_scale.py"
] | [
"import doctest\nimport unittest\nimport numpy as np\nimport logging\nimport os\nimport pandas as pd\nimport tempfile\nimport shutil\nimport sys\nfrom numpy.random import RandomState\n\nimport pysnptools.util as pstutil\nfrom pysnptools.snpreader import Bed, DistributedBed\nfrom pysnptools.snpreader import Pheno, S... | [
[
"numpy.array",
"numpy.random.RandomState",
"numpy.testing.assert_equal",
"numpy.nanmean",
"pandas.read_csv"
]
] |
akitenkrad/glove_pytorch | [
"99981343e3a3c795464606377416f827eb032d5a"
] | [
"train.py"
] | [
"import os\nfrom pathlib import Path\nfrom time import time\nfrom tqdm import tqdm\nfrom argparse import ArgumentParser\nimport numpy as np\nimport torch\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.utils.tensorboard import SummaryWriter\nfrom datasets import GloveDataset\nfrom glove im... | [
[
"torch.log",
"torch.cuda.is_available",
"torch.utils.tensorboard.SummaryWriter",
"numpy.mean"
]
] |
DaneseAnna/scanpy | [
"b7c091caf9126e48e0b352833a960efb3cfe43a7"
] | [
"scanpy/plotting/_tools/scatterplots.py"
] | [
"from matplotlib import pyplot as pl\nfrom pandas.api.types import is_categorical_dtype\nimport numpy as np\nfrom matplotlib import rcParams\nfrom matplotlib.colors import is_color_like\nfrom .. import _utils as utils\nfrom ...utils import sanitize_anndata, doc_params\nfrom ... import settings\nfrom .._docs import ... | [
[
"matplotlib.pyplot.colorbar",
"numpy.ceil",
"matplotlib.colors.to_hex",
"matplotlib.colors.is_color_like",
"numpy.array",
"numpy.median",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.figure",
"numpy.argsort",
"pandas.api.types.is_categorical_dtype",
"matplotlib.pypl... |
genepattern/cuzcatlan | [
"811bbaff6d4d78816441552c0e2e08675f293ff1"
] | [
"cuzcatlan/information.py"
] | [
"\"\"\"Parts of this code are borrowed from the CCAL library: https://github.com/UCSD-CCAL\"\"\"\nimport sys\nfrom numpy import asarray, exp, finfo, isnan, log, sign, sqrt, sum, sort, array, concatenate, where, nan_to_num, \\\n apply_along_axis, array_split, empty, unique\nfrom numpy.random import random_sample,... | [
[
"numpy.random.choice",
"numpy.exp",
"scipy.stats.pearsonr",
"numpy.finfo",
"numpy.where",
"numpy.apply_along_axis",
"numpy.sign",
"scipy.stats.rankdata",
"numpy.concatenate",
"pandas.read_table",
"numpy.empty",
"numpy.nan_to_num",
"pandas.DataFrame",
"matplo... |
yuyuyu223/giraffe | [
"1523606355a792f662cb04242b5fe86b96f62bf9",
"1523606355a792f662cb04242b5fe86b96f62bf9"
] | [
"im2scene/data/datasets.py",
"eval_files.py"
] | [
"import os\nimport logging\nfrom torch.utils import data\nimport numpy as np\nimport glob\nfrom PIL import Image\nfrom torchvision import transforms\nimport lmdb\nimport pickle\nimport string\nimport io\nimport random\n# fix for broken images\nfrom PIL import ImageFile\nImageFile.LOAD_TRUNCATED_IMAGES = True\n\nlog... | [
[
"numpy.random.randint",
"numpy.load"
],
[
"numpy.savez",
"numpy.load"
]
] |
SSLotfi/Open3D-PointNet2-Semantic3D | [
"3a9751dc724877933fc883320100796cef23489d"
] | [
"util/pointnet_util.py"
] | [
"# PointNet++ Layers\n# Author: Charles R. Qi\n# Date: November 2017\n\nimport os\nimport sys\nimport numpy as np\nimport tensorflow as tf\nfrom tf_ops.tf_interpolate import three_nn, three_interpolate\nfrom tf_ops.tf_grouping import query_ball_point, group_point, knn_point\nfrom tf_ops.tf_sampling import farthest_... | [
[
"tensorflow.exp",
"numpy.array",
"tensorflow.concat",
"tensorflow.expand_dims",
"tensorflow.reshape",
"tensorflow.transpose",
"tensorflow.norm",
"tensorflow.variable_scope",
"tensorflow.reduce_max",
"tensorflow.squeeze",
"tensorflow.reduce_sum",
"tensorflow.tile",
... |
taimurzahid/Computer-Vision-Nanodegree | [
"7820ba20c979f8319145c65c823c95e8d9e46052"
] | [
"Project 2 - Image Captioning/Backup/model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torchvision.models as models\n\n\nclass EncoderCNN(nn.Module):\n def __init__(self, embed_size):\n super(EncoderCNN, self).__init__()\n resnet = models.resnet50(pretrained=True)\n for param in resnet.parameters():\n param.requires_grad_... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LSTM",
"torch.max",
"torch.nn.Sequential",
"torch.nn.Embedding"
]
] |
liulab-dfci/lisa | [
"c60207a9e58efe943374aa7e002f61ee29042532"
] | [
"setup.py"
] | [
"\"\"\"lisa: a bioinformatics software\nepigenome analysis to rank TFs from gene set\n\"\"\"\nimport os\nfrom glob import glob\nfrom setuptools import setup, find_packages, Extension\nfrom numpy.distutils.misc_util import get_numpy_include_dirs\n\ndef get_extension():\n \"\"\" get extension for computing regulat... | [
[
"numpy.distutils.misc_util.get_numpy_include_dirs"
]
] |
EASI-STRESS/easistrain | [
"86192d1c4135875daec8e4e4abcb67e372f86efb"
] | [
"easistrain/EDD/fitEDD.py"
] | [
"from typing import Sequence\nimport numpy as np\nimport h5py\nfrom easistrain.EDD.io import (\n create_info_group,\n peak_dataset_data,\n save_fit_data,\n)\nfrom easistrain.EDD.utils import fit_detector_data, run_from_cli\n\n\ndef fitEDD(\n fileRead: str,\n fileSave: str,\n sample: str,\n data... | [
[
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.arange",
"numpy.ndim",
"numpy.append",
"numpy.size"
]
] |
wbknez/breakdb | [
"f783820425c8cb70d8caedc6f5839a72de7c945e"
] | [
"tests/io/image/test_transform_coords.py"
] | [
"\"\"\"\nContains unit tests to ensure that the transformation of bounding box\ncoordinates from one image to another after scaling is correct.\n\"\"\"\nimport numpy as np\n\nfrom breakdb.io.image import transform_coords, compute_resize_transform\n\n\nclass TestTransformCoords:\n \"\"\"\n Test suite for :func... | [
[
"numpy.random.randint",
"numpy.array_equal"
]
] |
bridgeland/Theano-PyMC | [
"ddfbde2d03061dead7190a99b78c7cef7896bd04"
] | [
"theano/scalar/basic_scipy.py"
] | [
"# Definitions of theano.scalar ops that have their python implementation taken\n# from SciPy. As SciPy is not always available, we treat them separately.\n\nimport numpy as np\nimport os\n\nimport theano\nfrom theano.gradient import grad_not_implemented\nfrom theano.scalar.basic import (\n UnaryScalarOp,\n B... | [
[
"numpy.sqrt"
]
] |
ncrubin/representability | [
"eb79caec4a834b8e158b19309eeb690b18b2a818"
] | [
"representability/purification/unitary_subspace_purification.py"
] | [
"\"\"\"Purify a 2-marginal by the unitary decomposition technique\n\n0. Decompose tpdm into it's three components of the unitary group\n1. set 2D(0) to be fixed by the trace\n2. set 2D(1) to be fixed by a valid opdm contracted from the real one\n3. reconstruct total tpdm\n5. diagonalize and find exposed operators\n... | [
[
"numpy.linalg.norm",
"numpy.isclose",
"numpy.trace",
"numpy.zeros",
"numpy.linalg.eigh",
"numpy.eye",
"numpy.linalg.lstsq",
"numpy.conj",
"numpy.sqrt"
]
] |
rutikasb/transcribe-asl | [
"bc7b2ae0d3f091acdb76a179e9352afb80a3f502"
] | [
"code/video/train_model.py"
] | [
"import os\nimport numpy as np\nimport glob\nimport cv2, json\nimport argparse\nfrom sklearn.utils import shuffle\nfrom keras.optimizers import SGD, Adam\nfrom keras.models import Sequential\nfrom keras.layers import Dropout, Dense\nfrom keras.callbacks import EarlyStopping, ModelCheckpoint\nfrom keras.preprocessin... | [
[
"numpy.expand_dims",
"numpy.vstack",
"numpy.save"
]
] |
edddict/vision | [
"36c99645dc633239042e92c4b4e9901d8178170f"
] | [
"test/common_utils.py"
] | [
"import os\nimport shutil\nimport tempfile\nimport contextlib\nimport unittest\nimport pytest\nimport argparse\nimport sys\nimport torch\nimport __main__\nimport random\nimport inspect\nimport functools\n\nfrom numbers import Number\nfrom torch._six import string_classes\nfrom collections import OrderedDict\nfrom t... | [
[
"numpy.array",
"torch.get_rng_state",
"torch.testing.integral_types",
"torch.jit.script",
"torch.cuda.set_rng_state",
"torch.manual_seed",
"torch.abs",
"torch.randint",
"torch.cuda.is_available",
"torch.cuda.get_rng_state",
"torch.set_rng_state",
"torch.testing.asse... |
kwxu/lungmask | [
"44d89de517925c818dc145683c522389c178728d"
] | [
"lungmask/data_io.py"
] | [
"import os\nfrom utils import read_file_contents_list, convert_flat_2_3d, get_logger\nimport nibabel as nib\nimport numpy as np\nimport pickle\n\nlogger = get_logger('DataFolder')\n\n\nclass DataFolder:\n def __init__(self, in_folder, data_file_list=None):\n self._in_folder = in_folder\n self._file... | [
[
"numpy.rot90",
"numpy.zeros",
"numpy.flip"
]
] |
fedelux3/deeprob-kit | [
"3bae5ab1a36b13ee1317f650e68e2d310dbf403c"
] | [
"deeprob/spn/models/dgcspn.py"
] | [
"import numpy as np\nimport torch\nimport torch.autograd as autograd\nimport torch.nn.functional as F\n\nfrom typing import Optional, Union, Tuple, List\n\nfrom deeprob.torch.base import ProbabilisticModel\nfrom deeprob.torch.constraints import ScaleClipper\nfrom deeprob.spn.layers.dgcspn import SpatialGaussianLaye... | [
[
"torch.log_softmax",
"torch.nn.ModuleList",
"torch.isnan",
"torch.no_grad",
"torch.unsqueeze",
"torch.mean",
"torch.ones_like",
"torch.nn.functional.nll_loss",
"numpy.log2"
]
] |
DDDong2666/tum-adlr-ws20-02 | [
"2e439886e0287777589cd276d614fd03bea4ed0c"
] | [
"GridWorld/random_rectangles.py"
] | [
"import numpy as np\n\nfrom wzk import get_first_non_empty, fill_with_air_left, safe_add_small2big, initialize_image_array\n\n\ndef create_rectangles(*, n, size_limits=(1, 10), n_voxels=(64, 64),\n special_dim=None):\n \"\"\"\n Create a series of randomly placed and randomly sized rectang... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.logical_and",
"numpy.where",
"numpy.random.randint",
"numpy.isscalar",
"numpy.size"
]
] |
Czaki/napari | [
"5ebb3cc914038519591d7186a8a2d42b6fdc42b9"
] | [
"napari/layers/points/_points_mouse_bindings.py"
] | [
"import numpy as np\n\nfrom ._points_utils import points_in_box\n\n\ndef select(layer, event):\n \"\"\"Select points.\n\n Clicking on a point will select that point. If holding shift while clicking\n that point will be added to or removed from the existing selection\n depending on whether it is selected... | [
[
"numpy.array"
]
] |
thepycoder/clearml | [
"717edba8c2b39fb7486bd2aba9ca0294f309b4c3"
] | [
"examples/frameworks/tensorflow/legacy/tensorboard_toy.py"
] | [
"# ClearML - Example of tensorboard with tensorflow (without any actual training)\n#\nimport os\nfrom tempfile import gettempdir\n\nimport tensorflow as tf\nimport numpy as np\nfrom PIL import Image\n\nfrom clearml import Task\n\n\n# Connecting ClearML with the current process,\n# from here on everything is logged ... | [
[
"tensorflow.random_gamma",
"tensorflow.make_tensor_proto",
"tensorflow.random_poisson",
"tensorflow.summary.image",
"tensorflow.concat",
"numpy.asarray",
"tensorflow.summary.scalar",
"tensorflow.summary.histogram",
"tensorflow.random_uniform",
"tensorflow.Session",
"num... |
Lanselott/mmdetection | [
"03ce0a87f4d52f4adf4f78fd39ad30b2da394376"
] | [
"mmdet/models/anchor_heads/ddb_v3_center_sampling_head.py"
] | [
"import torch\nimport torch.nn as nn\nfrom mmcv.cnn import normal_init\n\nfrom mmdet.core import multi_apply, multiclass_nms, multiclass_nms_sorting, distance2bbox, bbox2delta, bbox_overlaps\nfrom ..builder import build_loss\nfrom ..registry import HEADS\nfrom ..utils import bias_init_with_prob, Scale, ConvModule\n... | [
[
"torch.zeros",
"torch.bincount",
"torch.cat",
"torch.stack",
"torch.arange",
"torch.nn.ModuleList",
"torch.max",
"torch.ones",
"torch.nn.ReLU",
"torch.abs",
"torch.nn.Conv2d",
"torch.ones_like",
"torch.zeros_like",
"torch.meshgrid",
"torch.sort",
"to... |
dunnkers/fseval | [
"49a11a63e09e65b1f14389b6ba3a9ae3aeae086d"
] | [
"fseval/pipelines/rank_and_validate/_ranking_validator.py"
] | [
"from dataclasses import dataclass\nfrom logging import Logger, getLogger\nfrom typing import Dict, Union\n\nimport numpy as np\nimport pandas as pd\nfrom fseval.types import IncompatibilityError, TerminalColor\nfrom omegaconf import MISSING\n\nfrom .._experiment import Experiment\nfrom ._config import RankAndValid... | [
[
"pandas.DataFrame",
"numpy.ndim"
]
] |
RobMulla/pandas | [
"0b7a08b70444056f964bb636a74ac41ca0058d37",
"0b7a08b70444056f964bb636a74ac41ca0058d37"
] | [
"pandas/tests/indexes/multi/test_missing.py",
"pandas/core/common.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pandas as pd\nimport pandas.util.testing as tm\nimport pytest\nfrom pandas import Int64Index, MultiIndex, PeriodIndex, UInt64Index\nfrom pandas._libs.tslib import iNaT\nfrom pandas.core.indexes.datetimelike import DatetimeIndexOpsMixin\n\n\ndef test_fillna(idx)... | [
[
"pandas.util.testing.assert_numpy_array_equal",
"pandas.DataFrame",
"pandas.util.testing.assert_index_equal",
"pandas.MultiIndex.from_arrays",
"pandas.util.testing.assert_raises_regex",
"pandas.MultiIndex"
],
[
"pandas.core.dtypes.missing.isna",
"numpy.asarray",
"numpy.rand... |
fgitmichael/AutoregressiveModeDisentangling | [
"c556b2384ba90e87acd1358d5aae34c3cf477ae5"
] | [
"mode_disent_no_ssm/agent.py"
] | [
"import os\nimport json\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom torch.optim import Adam\nfrom torch.utils.tensorboard import SummaryWriter\nfrom tqdm import tqdm\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport warnings\n\nfrom mode_disent_no_ssm.utils.skill_policy_wrappe... | [
[
"torch.nn.Linear",
"matplotlib.pyplot.interactive",
"torch.cuda.is_available",
"matplotlib.pyplot.gcf",
"torch.meshgrid",
"numpy.max",
"torch.Size",
"matplotlib.pyplot.subplots",
"torch.manual_seed",
"numpy.random.randint",
"torch.tensor",
"matplotlib.pyplot.gca",
... |
ryanlindeborg/CN-DPM | [
"df2f839efde28a23748ebe2fe23b88600c40fbf6"
] | [
"cn_dpm/components/component.py"
] | [
"from abc import ABC, abstractmethod\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\nfrom torch import Tensor, autograd\nfrom cn_dpm.ndpm.summaries import Summaries, VaeSummaries, ClassificationSummaries\nfrom typing import Tuple, List\n\n\nclass Component(nn.Module, ABC):\n def __... | [
[
"torch.zeros",
"torch.stack",
"torch.nn.utils.clip_grad_norm_",
"torch.norm",
"torch.nn.utils.clip_grad_value_",
"torch.ones",
"torch.optim.lr_scheduler.LambdaLR"
]
] |
oikosohn/ColossalAI | [
"fc5101f24c9a2ad8e7e16cb81e1ef7646a1061fd"
] | [
"colossalai/amp/naive_amp/grad_scaler/dynamic_grad_scaler.py"
] | [
"#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\nimport torch\nfrom .base_grad_scaler import BaseGradScaler\n\n__all__ = ['DynamicGradScaler']\n\n\nclass DynamicGradScaler(BaseGradScaler):\n\n def __init__(self,\n initial_scale: int = 2**16,\n growth_factor: int = 2,\n ... | [
[
"torch.min",
"torch.max"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.