repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
jorag/pgnlm
[ "798a1c08505713ad6176be3568df2fe05308843f" ]
[ "pgnlm/datasets.py" ]
[ "#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@author: jorag\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport os \r\nfrom osgeo import gdal\r\nfrom helperfuncs import iq2complex, norm01\r\n\r\n\r\ndef _test_dataset(load_options):\r\n \"\"\" Load and crop the simulated test dataset.\r\n\r\n ...
[ [ "numpy.max", "numpy.transpose", "numpy.min" ] ]
harrys17451/CryptocurrencyPrediction
[ "7ec542bcd6bf960b115638484737f097120badcd" ]
[ "DataProcessor.py" ]
[ "\n# coding: utf-8\n\n# In[2]:\n\n\nimport pandas as pd\nimport numpy as np\nimport h5py\n\n\n# In[24]:\n\n\ninput_step_size = 50\noutput_size = 30\nsliding_window = False\nfile_name= 'bitcoin2012_2017_50_30_prediction.h5' \n\n\n# In[19]:\n\n\ndf = pd.read_csv('data/bitstampUSD_1-min_data_2012-01-01_to_2017-05-31.c...
[ [ "pandas.to_datetime", "numpy.array", "pandas.read_csv" ] ]
DCGM/pero_ocr_web
[ "e901027712827278f9ace914f6ccba16d3ac280f" ]
[ "app/ocr/general.py" ]
[ "import os\nimport numpy as np\nimport shutil\n\nfrom app.db.model import RequestState, RequestType, Request, DocumentState, TextLine, Annotation, TextRegion, Document\nfrom app.db.user import User\nfrom app.db.general import get_text_region_by_id, get_text_line_by_id\nfrom app import db_session\nfrom flask import ...
[ [ "numpy.asarray" ] ]
lammySup/ncscli
[ "1758b7c894f2b890c7462d63a9c46ce47bf1262b" ]
[ "examples/batchMode/plotGatlingOutput.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nplots loadtest results produced by runBatchJMeter\n\"\"\"\n# standard library modules\nimport argparse\nimport csv\nimport glob\nimport json\nimport logging\nimport math\nimport os\nimport re\nimport sys\nimport warnings\n# third-party modules\nimport matplotlib as mpl\nimport matpl...
[ [ "numpy.sin", "matplotlib.pyplot.xlim", "matplotlib.ticker.MultipleLocator", "numpy.zeros", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.Polygon", "matplotlib.py...
pagiux/passflow
[ "602d86896c0ed69fa828b51cafb1584286e2782c" ]
[ "models/real_nvp/coupling_layer.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom enum import IntEnum\nimport numpy as np\n\nfrom models.nn import MLP, ResNet\n\n\nclass MaskType(IntEnum):\n CHECKERBOARD = 0\n HORIZONTAL = 1\n CHAR_RUN = 2\n\n\nclass AffineTransform(nn.Module):\n def __init__(self, dim, device, mask_type, mask_pattern, net...
[ [ "torch.zeros", "numpy.zeros", "numpy.ones", "numpy.tile", "torch.tanh", "torch.exp" ] ]
KedoKudo/tomoproc
[ "b20270e87af4ce7459004a6ed928037ae8573b1e" ]
[ "tomoproc/prep/correction.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n\"\"\"\nContain functions operating on tomography sinograsm\n\nNOTE:\n Different experiment requires different type of correction, the choice of\n which should be established via trial and error.\n\"\"\"\nimport tomopy\nimport numpy as ...
[ [ "numpy.array", "numpy.ceil", "scipy.ndimage.shift", "numpy.ones", "scipy.signal.medfilt2d", "numpy.where", "numpy.sqrt", "numpy.absolute", "numpy.average", "numpy.random.random", "numpy.linspace", "numpy.linalg.svd" ] ]
AJTYNAN/rlcard
[ "7370c4c81bd5fc3e087df29d1d73cfc4514c081a" ]
[ "rlcard/games/nolimitholdem/game.py" ]
[ "from enum import Enum\n\nimport numpy as np\nfrom copy import deepcopy\nfrom rlcard.games.limitholdem import Game\nfrom rlcard.games.limitholdem import PlayerStatus\n\nfrom rlcard.games.nolimitholdem import Dealer\nfrom rlcard.games.nolimitholdem import Player\nfrom rlcard.games.nolimitholdem import Judger\nfrom r...
[ [ "numpy.sum", "numpy.random.RandomState" ] ]
ricoai/ricar_ryc
[ "811aefaf9893f3fe9c61d2070d8dc3a949f36697" ]
[ "manage.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nScripts to drive a donkey 2 car and train a model for it. \n\nUsage:\n manage.py drive [--model=<model>] [--web=<True/False>] [--throttle=<Throttle 0.0-1.0>] [--js]\n manage.py train (--tub=<tub>) (--model=<model>)\n manage.py calibrate\n manage.py (calibrate)\n manag...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.hist", "matplotlib.pyplot.show" ] ]
fy-meng/lunarlander-saliency
[ "294a2008ad010a42ebbde4fa039c711611e96044" ]
[ "lunarLander.py" ]
[ "\"\"\"\nFile name: lunarLander.py\n Agent for landing successfully the 'Lunar Lander' which is implemented in\n OpenAI gym (reference [1]).\n\nUsage: python lunarLander.py -h\n\nusage: lunarLander.py [-h] [-v {0,1,2}] -e {train,test} [-a A]\n\nLunar Lander with DQN\n\noptional arguments:\n -h, --help ...
[ [ "matplotlib.pyplot.switch_backend", "numpy.max", "numpy.array", "numpy.random.rand", "pandas.to_pickle", "numpy.zeros", "numpy.random.seed", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot...
Gjain234/AdaptiveQLearning
[ "4bb9751a3cb76604bdc5ac2225da84e5daa32755" ]
[ "create_fig_multiple_ambulance.py" ]
[ "import matplotlib.pyplot as plt\nimport seaborn as sns\nimport matplotlib.patches as patches\nimport pickle\nimport numpy as np\nfrom src import agent\nfrom adaptive_Agent import AdaptiveDiscretization\nfrom eNet_Agent import eNet\nimport pandas as pd\n\nepLen = 5\nnEps = 2000\n\nproblem_type = 'ambulance'\nproble...
[ [ "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.rc", "matplotlib.pyplot.tight_layout", "matplotlib.pypl...
ishipachev/UdacitySDCND-CarND-Advanced-Lane-Lines-P4
[ "a34d728f0062acc29aee312cb3f7b739edcc5c08" ]
[ "calibrate.py" ]
[ "import numpy as np\nimport cv2\nimport glob\nimport os\nimport pickle\nimport matplotlib.pyplot as plt\n\n# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)\nnx = 9\nny = 6\nobjp = np.zeros((ny*nx, 3), np.float32)\nobjp[:,:2] = np.mgrid[0:nx, 0:ny].T.reshape(-1, 2)\n\n# Arrays to store object poi...
[ [ "numpy.zeros" ] ]
jukiewiczm/guildai
[ "478cc29cb102a8bd0bed693ce9626fe4949257a2" ]
[ "guild/commands/tensorflow_impl.py" ]
[ "# Copyright 2017-2019 TensorHub, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ag...
[ [ "tensorflow.python.tools.inspect_checkpoint.main", "tensorflow.Graph", "tensorflow.Session", "tensorflow.GraphDef", "tensorflow.import_graph_def", "tensorflow.gfile.FastGFile" ] ]
abgcsc/CDANs
[ "7113ed836df1369895054b11c121071faa8392af" ]
[ "KerasSupplementary.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 06 11:28:39 2016\n\n@author: Drew\n\"\"\"\n\nimport numpy as np\nimport os\nfrom keras.models import model_from_json, Model, Sequential\nfrom keras.layers import merge, Input\nfrom keras.layers.core import Lambda, Masking, Reshape, Dense, Flatten, Dropout\nfrom k...
[ [ "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.prod", "numpy.random.randint", "numpy.argmax", "numpy.power", "numpy.unique" ] ]
haquebd/robotic-warehouse
[ "55036332f82e79cf3f60c377c73d2d39733ec9e0" ]
[ "rware/warehouse.py" ]
[ "import logging\n\nfrom collections import defaultdict, OrderedDict\nimport gym\nfrom gym import spaces\n\nfrom rware.utils import MultiAgentActionSpace, MultiAgentObservationSpace\n\nfrom enum import Enum\nimport numpy as np\n\nfrom typing import List, Tuple, Optional, Dict\n\nimport networkx as nx\nimport astar\n...
[ [ "numpy.rot90", "numpy.pad", "numpy.array", "numpy.random.choice", "numpy.zeros", "numpy.ones", "numpy.unravel_index", "numpy.stack", "numpy.arange", "numpy.random.randint", "numpy.indices" ] ]
GChen-ai/simple-deeplearning-framework
[ "0ad48f107457f576e4952e75637d68fa3da4f5a7" ]
[ "test_pool.py" ]
[ "from src.layers import*\nimport numpy as np\npool=Avgpool2D(2)\nimg=np.array([[[[3,0,4,2],[6,5,4,1],[3,0,2,2],[1,1,1,1]]\n ],\n [[[3,0,4,2],[6,5,4,1],[3,0,2,2],[1,1,1,1]]\n ]])\nprint(img.shape)\nout=pool.forward(img)\nprint(out)\nback=pool.backward(out)" ]
[ [ "numpy.array" ] ]
pelperscience/arctic-connectivity
[ "946e90c5310682d7e2499e2ca9e2fd5ace71535c" ]
[ "community_detection/cooc.py" ]
[ "\"\"\"Create a matrix that shows how often bin pairs fall in the same degenerate solution.\"\"\"\n\nimport numpy as np\nfrom scipy import sparse\nimport xarray as xr ######################### xr\n\nfrom itertools import combinations\n\nimport sys\nimport pickle\nfrom glob import glob\nfrom importlib import reloa...
[ [ "numpy.matmul", "numpy.zeros", "numpy.sum", "numpy.degrees", "numpy.unique" ] ]
rongou/cudf
[ "23cafcf0ae1a2fe5e6b7138f4c92c2dbfa2ec93b" ]
[ "python/cudf/cudf/core/series.py" ]
[ "# Copyright (c) 2018-2021, NVIDIA CORPORATION.\n\nfrom __future__ import annotations\n\nimport functools\nimport inspect\nimport pickle\nimport warnings\nfrom collections import abc as abc\nfrom hashlib import sha256\nfrom numbers import Number\nfrom shutil import get_terminal_size\nfrom typing import Any, Mutable...
[ [ "numpy.result_type", "numpy.array", "numpy.asarray", "pandas._config.get_option", "numpy.sort", "pandas.Series", "numpy.issubdtype", "numpy.iinfo" ] ]
anhaidgroup/py_entitymatching
[ "6724081d7d95c547e5a51625b4a8207c6c1737f8" ]
[ "py_entitymatching/dask/daskmlmatcher.py" ]
[ "\"\"\"\nThis module contains functions related to ML-matcher, that is common across\nall the ML-matchers.\n\"\"\"\nimport logging\n\nimport pandas as pd\nimport numpy as np\n\n# import dask\nimport dask\nfrom dask import delayed\nfrom dask.diagnostics import ProgressBar\n\nimport py_entitymatching.catalog.catalog_...
[ [ "pandas.concat", "numpy.delete", "numpy.array_split" ] ]
pyc-ycy/qtpandas
[ "5adf5f0cee8d3409e25342ecb390cce19beb6ff1" ]
[ "tests/test_CustomDelegates.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom builtins import super\nfrom builtins import str\nfrom future import standard_library\nstandard_library.install_aliases()\nfrom qtp...
[ [ "numpy.int8", "numpy.uint8", "numpy.uint32", "numpy.float16", "numpy.uint16", "pandas.DataFrame", "numpy.int64", "numpy.float64", "numpy.finfo", "numpy.float32", "numpy.uint64", "numpy.int32", "numpy.iinfo", "numpy.dtype", "numpy.int16" ] ]
JiehangXie/PaddleSpeech
[ "60090b49ec27437127ab62358026dd5bb95fccc7" ]
[ "paddlespeech/text/exps/ernie_linear/avg_model.py" ]
[ "#!/usr/bin/env python3\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/LIC...
[ [ "numpy.array", "numpy.argsort" ] ]
jchkoch/pycalculix
[ "c943c0408297873de104bd60c404c42eea66b895" ]
[ "pycalculix/results_file.py" ]
[ "\"\"\"This module stores the Results_File class.\"\"\"\n\nimport collections\nimport math # used for metric number conversion\nimport os #need to check if results file exists\nimport re # used to get info from frd file\nimport subprocess # used to check ccx version\n\nimport matplotlib.pyplot as plt\nimport matplo...
[ [ "matplotlib.cm.ScalarMappable", "matplotlib.pyplot.tricontourf", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.tripcolor", "numpy.arange", "numpy.polyfit", "numpy.core.function_base.linspace", "numpy.poly1d", "matplotlib.pyplot.gca", "nu...
JerryX1110/VFS
[ "22b915318935f459c9ee2d854d741b3f01a2ce9a" ]
[ "mmaction/models/backbones/resnet3d_slowfast.py" ]
[ "import torch\nimport torch.nn as nn\nfrom mmcv.cnn import ConvModule, kaiming_init\nfrom mmcv.runner import _load_checkpoint, load_checkpoint\nfrom mmcv.utils import print_log\n\nfrom ...utils import get_root_logger\nfrom ..registry import BACKBONES\nfrom .resnet3d import ResNet3d\n\n\nclass ResNet3dPathway(ResNet...
[ [ "torch.nn.Sequential", "torch.cat", "torch.zeros" ] ]
burgalon/spinningup
[ "6ae9e69d795919f8775ded5d2dd6d6b60ae8ffea" ]
[ "spinup/utils/plot.py" ]
[ "import seaborn as sns\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport json\nimport os\nimport os.path as osp\nimport numpy as np\n\nDIV_LINE_WIDTH = 50\n\n# Global vars for tracking and labeling data at load time.\nexp_idx = 0\nunits = dict()\n\ndef plot_data(data, xaxis='Epoch', value=\"AverageEpRet...
[ [ "numpy.asarray", "numpy.ones", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "pandas.concat", "matplotlib.pyplot.show", "matplotlib.pyplot.ticklabel_format", "numpy.convolve" ] ]
hukkelas/full_body_anonymization
[ "c61745b137c84ffb742ef6ab2f4721db4acf22b7" ]
[ "fba/data/build.py" ]
[ "from .transforms import build_transforms\nfrom .utils import DataPrefetcher, InfiniteSampler\nfrom .datasets import build_dataset\nimport torch\nfrom fba import utils\nfrom torch.utils.data._utils.collate import default_collate\n\n\ndef get_dataloader(cfg, is_train: bool):\n imsize = cfg.imsize\n if is_train...
[ [ "torch.utils.data.DistributedSampler", "torch.utils.data._utils.collate.default_collate", "torch.utils.data.DataLoader" ] ]
Knoxantropicen/rlkit
[ "c60fb3794bdd8a6fc4480e668dc3832c5f5f3ab5" ]
[ "rlkit/pytorch/sac/policies.py" ]
[ "import numpy as np\nimport torch\nfrom torch import nn as nn\n\nfrom rlkit.policies.base import ExplorationPolicy, Policy\nfrom rlkit.pytorch.distributions import TanhNormal\nfrom rlkit.pytorch.networks import Mlp\n\n\nLOG_SIG_MAX = 2\nLOG_SIG_MIN = -20\n\n\nclass TanhGaussianPolicy(Mlp, ExplorationPolicy):\n \...
[ [ "torch.nn.Linear", "numpy.log", "torch.clamp", "torch.tanh", "torch.exp" ] ]
DrLachie/pyclesperanto_prototype
[ "56843fac2543265c40f108fd40eac3ecf85c8458" ]
[ "tests/test_voronoi_otsu_labeling.py" ]
[ "import pyclesperanto_prototype as cle\nimport numpy as np\n\ndef test_voronoi_otsu_labeling():\n \n gpu_input = cle.push(np.asarray([\n\n [0, 0, 1, 1, 0, 0],\n [0, 1, 8, 9, 1, 0],\n [0, 1, 7, 6, 1, 0],\n [0, 0, 1, 1, 1, 0],\n [0, 0, 1, 1, 1, 0],\n ...
[ [ "numpy.array_equal", "numpy.asarray" ] ]
herman-nside/spektral
[ "58bb524ec783f187145c3afe53db491dbc1f0ba0" ]
[ "examples/graph_prediction/tud_mincut.py" ]
[ "\"\"\"\nThis example shows how to perform molecule regression with the\n[Open Graph Benchmark](https://ogb.stanford.edu) `mol-esol` dataset, using a\nsimple GCN with MinCutPool in batch mode.\nExpect unstable training due to the small-ish size of the dataset.\n\"\"\"\n\nimport numpy as np\nfrom tensorflow.keras.ca...
[ [ "tensorflow.keras.layers.Input", "numpy.split", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Model", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.callbacks.EarlyStopping" ] ]
hankyul2/Show_Attend_Tell
[ "1fc76af8f62e5ba84307f91622ba243fff49b943" ]
[ "main.py" ]
[ "import json\nimport os\n\nimport math\nimport warnings\n\nimport torch\nfrom torch.nn.utils.rnn import pack_padded_sequence\n\nwarnings.filterwarnings('ignore')\nos.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID'\n\nfrom torch.optim import SGD, Adam, AdamW\nfrom torch.optim.lr_scheduler import OneCycleLR\nfrom pytorch...
[ [ "torch.max", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "torch.tensor", "torch.nn.utils.rnn.pack_padded_sequence", "matplotlib.pyplot.xticks", "matplotlib.pyplot.imshow" ] ]
XuehaiPan/Soft-Actor-Critic
[ "9018199f28351f4106dab73a9dc3631c52b72260" ]
[ "common/network.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\n\n\n__all__ = [\n 'build_encoder',\n 'Container', 'NetworkBase',\n 'VanillaNeuralNetwork', 'VanillaNN',\n 'MultilayerPerceptron', 'MLP',\n 'GRUHidden', 'cat_hidden',\n 'RecurrentNeuralNetwork', 'RNN',\n 'ConvolutionalNeuralNetwork', 'CNN...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ParameterList", "torch.nn.GRU", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "torch.load", "torch.FloatTensor", "numpy.sqrt", "torch.Tensor", "torch.zeros", "torch.device", "torch.nn.Identity", "torch.save", "t...
CK-er/mmdet
[ "9bea4068efbcf7bf739dbe41917a68d525c29868" ]
[ "mmdet/core/bbox/transforms.py" ]
[ "import numpy as np\nimport torch\n\ndef bbox2delta(proposals, gt, means=[0, 0, 0, 0], stds=[1, 1, 1, 1]):\n assert proposals.size() == gt.size()\n\n proposals = proposals.float()\n gt = gt.float()\n px = (proposals[..., 0] + proposals[..., 2]) * 0.5\n py = (proposals[..., 1] + proposals[..., 3]) * 0...
[ [ "torch.cat", "torch.stack", "numpy.log", "numpy.zeros", "torch.log", "torch.addcmul" ] ]
kaist-dmlab/Ada-Boundary
[ "9514a2a005aaf79db7eac84c55cbcefbb72a4011" ]
[ "src/reader/batch_patcher.py" ]
[ "import numpy as np\nimport time, os, math, operator, statistics, sys\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nfrom random import Random\n\nclass Sample(object):\n def __init__(self, id, image, label):\n self.id = id\n self.image = image\n self.label = label\n\nclass Min...
[ [ "numpy.random.choice", "numpy.zeros", "tensorflow.compat.v1.disable_v2_behavior", "numpy.sum", "numpy.ones" ] ]
ThisIsIsaac/high-res-stereo
[ "55341fd4b3205162a01ad6aebff0086e49e1a909" ]
[ "unlabeled_util/argoverse_make_pseudo_gt.py" ]
[ "import argparse\nimport cv2\nfrom models import hsm\nimport numpy as np\nimport os\nimport pdb\nimport skimage.io\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nfrom torch.autograd import Variable\nimport time\nfrom models.submodule import *\nfrom utils.eval import mkdir_p, save_pfm\nf...
[ [ "numpy.logical_or", "numpy.reshape", "numpy.zeros", "torch.cuda.synchronize", "numpy.lib.pad", "torch.no_grad", "torch.FloatTensor", "torch.cuda.empty_cache", "torch.squeeze", "torch.load", "torch.nn.DataParallel" ] ]
LitianD/ObjDetect
[ "849f63467ce9e25c8ba0c24ca7bfdea9d836b0dd" ]
[ "gif.py" ]
[ "from PIL import Image\nimport image2gif\nimport numpy as np\nimport os\n\noutfilename = \"D:\\PyCharmProject\\objDetect\\keras-yolo3\\gif\\\\1\\\\1.gif\" # 转化的GIF图片名称\nl = os.listdir(\"D:\\PyCharmProject\\objDetect\\keras-yolo3\\gif\\\\1\")\nframes = []\nfor image_name in l: # 索引各自目录\n im = Image...
[ [ "numpy.array" ] ]
Saravji/pmdarima
[ "7f42e36beb888d9e1e7e41b0d9c9f7419c730a3a" ]
[ "examples/arima/example_persisting_a_model.py" ]
[ "\"\"\"\n=========================\nPersisting an ARIMA model\n=========================\n\n\nThis example demonstrates how we can persist an ARIMA model to disk after\nfitting it. It can then be loaded back up and used to generate forecasts.\n\n.. raw:: html\n\n <br/>\n\"\"\"\nprint(__doc__)\n\n# Author: Taylor ...
[ [ "sklearn.externals.joblib.load", "sklearn.externals.joblib.dump" ] ]
facebookresearch/uimnet
[ "d7544cf5fb4c65cb262dca203afb0db4ba6c569d" ]
[ "uimnet/algorithms/mixup.py" ]
[ "#!/usr/bin/env python3\n#\n# # Copyright (c) 2021 Facebook, inc. and its affiliates. All Rights Reserved\n#\n#\nimport torch\nfrom uimnet import utils\nfrom uimnet.algorithms.erm import ERM\nimport numpy as np\n\n\nclass Mixup(ERM):\n HPARAMS = dict(ERM.HPARAMS)\n HPARAMS.update({\n \"alpha\": (0.3, l...
[ [ "torch.zeros", "torch.nn.functional.one_hot", "numpy.random.choice", "torch.arange", "torch.distributions.Beta" ] ]
lmsac/GproDIA
[ "3fc1cdee535c9743806b7be423aba29daca24406" ]
[ "src/filter_assays.py" ]
[ "import argparse\n\nparser = argparse.ArgumentParser(\n description='Filter assays.'\n)\nparser.add_argument(\n '--in', nargs='+',\n help='input assay files'\n)\nparser.add_argument(\n '--out',\n help='output assay file'\n)\n\nparser.add_argument(\n '--swath_windows',\n help='SWATH isolation wi...
[ [ "pandas.read_csv" ] ]
idchlife/tf2-mobile-pose-estimation
[ "a1f1f52eecbb841fa878bff4d3c311b79864835d" ]
[ "models/simplepose_coco.py" ]
[ "\"\"\"\n SimplePose for COCO Keypoint, implemented in TensorFlow.\n Original paper: 'Simple Baselines for Human Pose Estimation and Tracking,' https://arxiv.org/abs/1804.06208.\n\"\"\"\n\n__all__ = ['SimplePose', 'simplepose_resnet18_coco', 'simplepose_resnet50b_coco', 'simplepose_resnet101b_coco',\n ...
[ [ "tensorflow.keras.Sequential", "tensorflow.executing_eagerly", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.backend.get_value", "tensorflow.keras.layers.Cropping2D" ] ]
samuelyu2002/PACS
[ "5010b2f0d20933b0647e3d6230d673e1830249ec" ]
[ "experiments/CLIP/predict.py" ]
[ "import torch\nimport numpy as np\nimport torch.nn as nn\nfrom utils import load_model\nfrom torchvision import transforms\nfrom PIL import Image\nimport json\nimport clip\nfrom collections import defaultdict\nimport argparse\nimport os\n\nparser = argparse.ArgumentParser(description='Extracting frames and audio')\...
[ [ "torch.cat", "numpy.sum", "torch.no_grad", "torch.cuda.is_available", "torch.load", "torch.nn.CosineSimilarity" ] ]
guanyuliu0818/ITU-Rpy
[ "524f30f73a6fed9be4416637d8d83ad7717f0a00" ]
[ "itur/models/itu676.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport warnings\n\nimport numpy as np\nfrom astropy import units as u\n\nfrom itur import utils\nfrom itur.models.itu453 import radio_refractive_index\nfrom itur.mod...
[ [ "numpy.arccos", "numpy.minimum", "numpy.exp", "numpy.where", "numpy.cos", "numpy.cumsum", "numpy.deg2rad", "numpy.zeros_like", "numpy.sin", "numpy.vectorize", "numpy.log", "numpy.logical_and", "numpy.arange", "numpy.sqrt", "numpy.mod", "numpy.array",...
TCherici/StRADRL
[ "528bf4fbd61f91a79dfc24fc6d6c9caa66a4a5a5" ]
[ "settings/options3.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\n\ndef get_options(option_type):\n \"\"\"\n option_type: string\n 'training' or 'diplay' or 'visualize'\n \"\"\" \n # name\n tf.app.flags.D...
[ [ "tensorflow.app.flags.DEFINE_float", "tensorflow.app.flags.DEFINE_integer", "tensorflow.app.flags.DEFINE_boolean", "tensorflow.app.flags.DEFINE_string" ] ]
wjm41/soapgp
[ "ef57cebb7413abb96b54983141e188dff5166d03" ]
[ "data/Malaria/generate_smiles.py" ]
[ "import pandas as pd\nimport sys\n\ncsv_name = sys.argv[1]+'.csv'\nsmiles_name = sys.argv[1]+'.can'\n\nSMILES_df = pd.read_csv(csv_name,header=0, index_col=False)\nfile=open(smiles_name,'w')\nfor i,row in SMILES_df.iterrows():\n\tfile.write(row['SMILES']+'\\t'+str(row['Percentage_inhibition_3D7'])+'\\t'+str(row['Pe...
[ [ "pandas.read_csv" ] ]
leying95/stereopy
[ "1580a88a091a2ebc0f177ea73409e2c4b4dd4c7e" ]
[ "stereo/tools/cell_type_anno.py" ]
[ "#!/usr/bin/env python3\n# coding: utf-8\n\"\"\"\n@author: Ping Qiu qiuping1@genomics.cn\n@last modified by: Ping Qiu\n@file:cell_type_anno.py\n@time:2021/03/09\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport os\nfrom multiprocessing import Pool\nimport traceback\nfrom ..log_manager import logger\nfrom .....
[ [ "scipy.sparse.issparse", "numpy.random.choice", "pandas.DataFrame", "numpy.log1p", "pandas.Series", "pandas.read_csv", "numpy.unique" ] ]
TylerYep/ml-toolkit
[ "095bdce961133acc720f90b6d1bbb0a7becbfc9f" ]
[ "ai_toolkit/datasets/dataset.py" ]
[ "from __future__ import annotations\n\nimport sys\nfrom pathlib import Path\nfrom typing import Any, Callable, Tuple\n\nimport torch\nfrom torch.utils.data import DataLoader, TensorDataset, random_split\nfrom torch.utils.data.dataloader import default_collate\n\nfrom ai_toolkit.args import Arguments\n\nTensorDataLo...
[ [ "torch.cuda.is_available", "torch.utils.data.random_split", "torch.Generator", "torch.utils.data.dataloader.default_collate" ] ]
bearpelican/PSSR
[ "a90b7d208d4369946500a70a6f31c44e3367e4c7" ]
[ "utils/resnet.py" ]
[ "import torch.nn as nn\nimport torch,math,sys\nimport torch.utils.model_zoo as model_zoo\nfrom functools import partial\nimport fastai.vision.learner as fvl\n\n__all__ = ['WNResNet', 'wnresnet18', 'wnresnet34', 'wnresnet50', 'wnresnet101', 'wnresnet152']\n\n# or: ELU+init (a=0.54; gain=1.55)\nact_fn = nn.ReLU(inpla...
[ [ "torch.nn.Linear", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.MaxPool2d", "torch.nn.init.kaiming_normal_", "torch.utils.model_zoo.load_url", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
thejus-vm/dopamine
[ "d2f4128f056f781e70ea926ab071a621f955a23c" ]
[ "dopamine/jax/agents/quantile/quantile_agent.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Dopamine 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 b...
[ [ "tensorflow.compat.v1.Summary.Value" ] ]
janvi16/-HACKTOBERFEST2K20
[ "aa9c8b6f7feb245793c0a003ba6fbea3fca9ca22" ]
[ "Python/Read Excel File/excel_file.py" ]
[ "import pandas\n\nexcel_data_df = pandas.read_excel('records.xlsx', sheet_name='Employees')\n\n# print whole sheet data\nprint(excel_data_df)" ]
[ [ "pandas.read_excel" ] ]
hyabe/onnx-chainer
[ "339ff390957d9dd29843add015533290fdd051c0" ]
[ "onnx_chainer/functions/normalization.py" ]
[ "import sys\n\nimport chainer\nimport numpy as np\n\nfrom onnx_chainer.functions.opset_version import support\nfrom onnx_chainer import onnx_helper\n\n\n@support((1, 6, 7))\ndef convert_BatchNormalization(func, opset_version, input_names,\n num_outputs, context, parameters):\n if le...
[ [ "numpy.zeros_like", "numpy.ones_like" ] ]
lucasalexsorensen/mlops
[ "2d8157eb493061775bdab9a8e176d2bdcc2c166e" ]
[ "src/models/train_model.py" ]
[ "from ..data import MaskDataset\nfrom torch.utils.data import DataLoader\nimport kornia as K\nimport torch.nn as nn\nimport torchvision\nimport torch\n\nimport wandb\nimport numpy as np\nimport pandas as pd\nfrom torchvision.transforms import ToTensor\nfrom .model import Net\nimport argparse\nimport torchmetrics\n\...
[ [ "numpy.array", "torch.no_grad", "numpy.diff", "torch.cuda.is_available", "torch.utils.data.DataLoader", "numpy.append", "torch.nn.CrossEntropyLoss" ] ]
hg-zhang/deepst
[ "fc35cfd40785a3a0cc56a83c151c629e53eaf6bd" ]
[ "deepst/datasets/TaxiBJ.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n load BJ Data from multiple sources as follows:\n meteorologic data\n\"\"\"\nfrom __future__ import print_function\n\nimport os\n#import cPickle as pickle\nimport pickle\nfrom copy import copy\nimport numpy as np\nimport h5py\nfrom . import load_stdata, stat\nfrom ..prepr...
[ [ "numpy.hstack", "numpy.asarray", "numpy.vstack" ] ]
marcorainone/TropPOLoRaTools
[ "d89e24f29325c50be050b79c2cdce75225fdfaa6" ]
[ "src/graph-rsigra-interval.py" ]
[ "#!/usr/bin/env python3\n# ===================================================================================\n# Project: TropPo \n# v. 1.0 2020-03-01, ICTP Wireless Lab\n# Programmer: Marco Rainone - ICTP Wireless Lab\n# Specifications, revisions and verifications: \n# Marco Zennaro, ...
[ [ "pandas.DataFrame.from_records", "pandas.read_csv", "numpy.isfinite" ] ]
hui2000ji/masif
[ "70a76c5f4639f70c546d5603612c7cc9f47a35b8" ]
[ "source/data_preparation/01-pdb_extract_and_triangulate.py" ]
[ "#!/usr/bin/python\nimport numpy as np\nimport os\nimport Bio\nimport shutil\nfrom Bio.PDB import * \nimport sys\nimport importlib\nfrom IPython.core.debugger import set_trace\n\n# Local includes\nfrom default_config.masif_opts import masif_opts\nfrom triangulation.computeMSMS import computeMSMS\nfrom triangulation...
[ [ "sklearn.neighbors.KDTree", "numpy.where", "numpy.square" ] ]
UpSea/ZipLineMid
[ "1e0cdcfa7974f412dbee32809cffdaf2de6b4971" ]
[ "xpower/Strategies/testTemp/testParams01.py" ]
[ "import numpy as np\n\nt = np.arange(0.0, 10.0, 0.01)\ns = np.sin(2*np.pi*t)\nparams={}\nparams['s']=s\nparams['t']=t" ]
[ [ "numpy.sin", "numpy.arange" ] ]
IEM-Computer-Vision/pytorch3d
[ "e3819a49dfa855de1a7c99c0583fb69f9bdad75b" ]
[ "pytorch3d/structures/meshes.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nfrom typing import List\n\nimport torch\n\nfrom . import utils as struct_utils\nfrom .textures import Textures\n\n\nclass Meshes(object):\n \"\"\"\n This class provides functions for working with batches of triangulated\n meshes wi...
[ [ "torch.zeros", "torch.device", "torch.cat", "torch.nn.functional.normalize", "torch.stack", "torch.unique", "torch.arange", "torch.is_tensor", "torch.sparse.FloatTensor", "torch.ones", "torch.full", "torch.empty", "torch.cross", "torch.zeros_like", "torc...
nderako/NeuroFeedback-api
[ "07be188a751c8e68a97f788d74c666dc158cd0f4" ]
[ "pythonModules/parser.py" ]
[ "import requests, json, sys, getopt, time, random\nfrom scipy.io import loadmat\nimport mne\nimport numpy as np\n\ndef main(argv):\n inputfile = ''\n try:\n opts, args = getopt.getopt(argv,\"hi:\",[\"ifile=\"])\n except getopt.GetoptError:\n print('transmissorClient.py -i <inputfile>')\n ...
[ [ "numpy.concatenate", "scipy.io.loadmat" ] ]
xieliaing/scikit-learn
[ "9b210ae8ffdc40e210f30f24656779ac690b899a", "9b210ae8ffdc40e210f30f24656779ac690b899a" ]
[ "examples/compose/plot_compare_reduction.py", "examples/compose/plot_transformed_target.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n=================================================================\nSelecting dimensionality reduction with Pipeline and GridSearchCV\n=================================================================\n\nThis example constructs a pipeline that does dimensionality\nreduction followed...
[ [ "numpy.array", "sklearn.datasets.load_digits", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "sklearn.decomposition.NMF", "matplotlib.pyplot.ylabel", "sklearn.feature_selection.Select...
GitHubChuanYu/T3Project4_SystemIntegration
[ "1cd2224c5b94292927441e46df137749a0520f09" ]
[ "ros/src/tl_detector/tl_detector.py" ]
[ "#!/usr/bin/env python\nimport rospy\nfrom std_msgs.msg import Int32\nfrom geometry_msgs.msg import PoseStamped, Pose\nfrom styx_msgs.msg import TrafficLightArray, TrafficLight\nfrom styx_msgs.msg import Lane, Waypoint\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge\nfrom light_classification.tl_...
[ [ "scipy.spatial.KDTree", "numpy.array", "numpy.dot" ] ]
SenseTime-Knowledge-Mining/BridgeDPI
[ "0dbbecb73d7ffe982ff4fbbf05a58b65591343ba" ]
[ "nnLayer.py" ]
[ "from torch import nn as nn\nfrom torch.nn import functional as F\nimport torch,time,os,random\nimport numpy as np\nfrom collections import OrderedDict\n\nclass TextSPP(nn.Module):\n def __init__(self, size=128, name='textSpp'):\n super(TextSPP, self).__init__()\n self.name = name\n self.spp...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LSTM", "torch.nn.GRU", "torch.nn.ModuleList", "torch.nn.functional.elu", "torch.nn.AdaptiveAvgPool1d", "torch.nn.utils.rnn.pack_padded_sequence", "numpy.cos", "torch.exp", "torch.nn.CrossEntropyLoss", "torch.sum", "torch...
DrewAlexander98/Couch-Mk2
[ "d9dc7768d0e6714c2eb58dcd901988617303ce95" ]
[ "FormulaTest.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\ndef main():\n angleList = np.arange(1, 90, 10)\n numVals = angleList.size\n xValues = np.array(numVals)\n yValues = np.array(numVals)\n turnWheelVal1 = np.array(numVals)\n turnWheelVal2 = np.array(numVals)\n lvr = np.array(numVals)\n xv...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.radians", "numpy.arange", "numpy.power", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
cbim-medical-group/pytorch-template
[ "7f76ee095420e23efe22df560d8e0a314fbc16dd", "7f76ee095420e23efe22df560d8e0a314fbc16dd" ]
[ "data_loader/my_transforms/to_tensor.py", "loss/bce_loss.py" ]
[ "import numpy as np\nimport torch\nfrom skimage.transform import resize\n\n\nclass ToTensor:\n def __init__(self, training=True):\n \"\"\"\n Convert numpy array to Torch.Tensor\n \"\"\"\n self.training = training\n\n def __call__(self, sample):\n image, mask = sample['image'...
[ [ "torch.tensor" ], [ "torch.unique", "torch.Tensor", "torch.nn.functional.binary_cross_entropy" ] ]
chaitanya2334/stain-normalization-tool
[ "8f7aab84466bf96c344f93f46f2103a8e906fe51" ]
[ "mat_estimation/scd.py" ]
[ "import cv2\nimport numpy as np\n\nfrom training.scd_trainer import SCDTrainer\n\n\ndef est_using_scd(img, trainer):\n assert isinstance(trainer, SCDTrainer)\n prob_maps, _ = trainer.classify_stain_regions(img)\n\n double_img = cv2.normalize(img.astype('float'), None, 0.0, 1.0, cv2.NORM_MINMAX)\n\n col_...
[ [ "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.mean", "numpy.cross" ] ]
astepanian1/gpt-2-simple
[ "6fd93398dc4f2df2910cebc7cf09d22c8704d5c3" ]
[ "gpt_2_simple/gpt_2.py" ]
[ "import tarfile\nimport os\nimport json\nimport requests\nimport sys\nimport shutil\nimport re\nfrom tqdm import tqdm, trange\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.core.protobuf import rewriter_config_pb2\nfrom tensorflow.python.client import device_lib\nimport time\nfrom datetime import dat...
[ [ "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.summary.FileWriter", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.train.latest_checkpoint", "tensorflow.compat.v1.train.AdamOptimizer", "numpy.random.seed", "tensorflow.compat.v1.train.Saver", "tensorflow...
madhukar-m-rao/deephyper
[ "d280701d9e4cae3e639be054bf1c5ef918d9a1a7" ]
[ "deephyper/search/hps/automl/classifier/autosklearn1/run.py" ]
[ "import inspect\nfrom inspect import signature\nfrom pprint import pprint\n\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.model_selection import train_test_split\n\nfrom deephyper.search.hps.automl.classifier.mapping import CLASSIFIERS\nfrom deephyper.search.nas.model.preprocessing import minmaxstdscale...
[ [ "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score" ] ]
MiVaVo/Antispoof-3d
[ "03ee614f4daf85069ce22c80cb6ed4642bdf762e" ]
[ "src/icp/utils.py" ]
[ "import copy\nimport functools\n\nimport numpy as np\nimport open3d as o3d\n\n\ndef points_to_pointcloud(func):\n @functools.wraps(func)\n def ensure_is_pointcloud(*args, **kwargs):\n if 'left_points_array' in kwargs.keys() and 'right_points_array' in kwargs.keys():\n if not isinstance(kwarg...
[ [ "numpy.any", "numpy.asarray", "numpy.asanyarray" ] ]
upscale-project/hslink_phy
[ "741f78da673d2e633da05d292aa6645125ebae32" ]
[ "DaVE/mLingua/examples_ncsim/serdes/ch_response/plot.py" ]
[ "#! /usr/bin/env python \n\n\"\"\"\n Generate eyediagram and save it to eye.png\n\"\"\"\n\nimport numpy as np\nfrom scipy.interpolate import interp1d\nimport matplotlib.pylab as plt\nimport matplotlib\nfrom scipy.signal import lsim, zpk2tf\n\nfont = { 'size' : 19}\nmatplotlib.rc('font', **font)\n\ndef main():\n ...
[ [ "matplotlib.pylab.savefig", "matplotlib.pylab.ylabel", "matplotlib.pylab.legend", "matplotlib.pylab.close", "matplotlib.rc", "numpy.loadtxt", "matplotlib.pylab.subplot", "matplotlib.pylab.tight_layout", "matplotlib.pylab.title", "matplotlib.pylab.plot" ] ]
songquanpeng/BigGAN-PyTorch
[ "6988f1f3ccfa4f6794ce269f056422da4ce9baf6" ]
[ "BigGAN.py" ]
[ "import numpy as np\nimport math\nimport functools\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.nn import Parameter as P\n\nimport layers\nfrom sync_batchnorm import SynchronizedBatchNorm2d as SyncBatchNorm2d\n\n\n# Archi...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.AvgPool2d", "torch.split", "torch.nn.init.xavier_uniform_", "torch.nn.ReLU", "torch.nn.init.normal_", "torch.nn.init.orthogonal_", "torch.set_grad_enabled" ] ]
Koriban/Hummingbot-Demex
[ "0ed19e41285b41999eb4ea7c69b5c4a16722e00b" ]
[ "test/test_pmm_take_if_cross.py" ]
[ "#!/usr/bin/env python\n\nfrom os.path import join, realpath\nimport sys; sys.path.insert(0, realpath(join(__file__, \"../../\")))\n\nfrom typing import List\nfrom decimal import Decimal\nimport logging; logging.basicConfig(level=logging.ERROR)\nimport pandas as pd\nimport unittest\n\nfrom hummingbot.strategy.marke...
[ [ "pandas.Timestamp" ] ]
changyu98/GoogLeNet-PyTorch
[ "a2fae2b8b14e830a3f64c81bc4e62dadb6cfe5b7" ]
[ "examples/simple/test.py" ]
[ "# Copyright 2020 Lorna Authors. All Rights Reserved.\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...
[ [ "torch.no_grad", "torch.softmax", "torch.topk" ] ]
polltooh/FineGrainedAction
[ "4582b4179e643119448c7c20ab06044fb211163e" ]
[ "nn/test_nn_fc7.py" ]
[ "import tensorflow as tf\nfrom bvlc_alexnet_fc7 import AlexNet\nimport nt\nimport numpy as np\nimport utility_function as uf\nimport os\nimport time\nimport cv2\nimport image_io\nimport sys\nimport math\n# the dimension of the final layer = feature dim\nNN_DIM = 100\n\n# TEST_TXT = 'file_list_test_nba_dunk_fc7.txt'...
[ [ "tensorflow.train.start_queue_runners", "tensorflow.app.flags.DEFINE_integer", "tensorflow.concat", "tensorflow.train.batch", "tensorflow.app.flags.DEFINE_string", "tensorflow.TextLineReader", "tensorflow.initialize_all_variables", "tensorflow.train.Coordinator", "tensorflow.Se...
soham97/Predictive-Threat-Intelligence
[ "fa0bfbea905c9179aa67791d26f1f219e59a1b32" ]
[ "codes/kafka/flask-server/deploy_functions.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn.preprocessing import LabelEncoder\nfrom tqdm import tqdm_notebook as tqdm\n\nenc = LabelEncoder()\nenc.fit(['cowrie.session.connect', 'cowrie.client.version',\n 'cowrie.login.success', 'cowrie.session.closed',\n 'cowrie.login.failed', 'cowrie.log.cl...
[ [ "pandas.DataFrame", "sklearn.preprocessing.LabelEncoder", "numpy.argmax" ] ]
Hunter8moon/h8m2
[ "9cb2ced9d701650258f5e4d14e6036a3b56b0b96" ]
[ "source/util/image_util.py" ]
[ "import os\nfrom random import randint, random\n\nimport numpy as np\nfrom PIL import Image\n\n\nclass ImageUtil:\n @staticmethod\n def file_to_array(file_path, width, height, augment=True):\n \"\"\"\n Loads a image from disk and returns an np.array pf that image.\n\n :param file_path: Pa...
[ [ "numpy.asarray" ] ]
jawad26/numpy
[ "07447fd215ebffbce2f4e516ef02629e91fca6b0" ]
[ "numpy/ma/core.py" ]
[ "\"\"\"\nnumpy.ma : a package to handle missing or invalid values.\n\nThis package was initially written for numarray by Paul F. Dubois\nat Lawrence Livermore National Laboratory.\nIn 2006, the package was completely rewritten by Pierre Gerard-Marchant\n(University of Georgia) to make the MaskedArray class a subcla...
[ [ "numpy.core.umath.equal", "numpy.ndarray.sort", "numpy.isclose", "numpy.dot", "numpy.void", "numpy.core.umath.less", "numpy.core.umath.greater", "numpy.where", "numpy.resize", "numpy.iscomplexobj", "numpy.finfo", "numpy.unique", "numpy.outer", "numpy.issubdt...
giuliovv/cryptotrading
[ "9627f68ef318e17f14784e3275a849885fb3710a" ]
[ "utils/technical.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom tqdm.auto import tqdm\n\nfrom utils import ultimate_cycle\n\n# OSCILLATORS\n\ndef macd(prices: pd.Series, long: int, short: int, strategy=False, getgains=False, winning=False, commissions=0.005) -> pd.Series:\n '''\n Return the MACD\n\n :param pd.Series prices...
[ [ "numpy.zeros", "pandas.Series" ] ]
avant1/server
[ "effbc03644de60ed97242811e0933e3611f14cd8" ]
[ "qa/L0_infer/infer_test.py" ]
[ "# Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list...
[ [ "numpy.dtype" ] ]
R1704/SpeechRecognitionSNN
[ "4b788d1bd20d8ce201da6da8b200b3ca722c7efa" ]
[ "SpykeTorch/utils.py" ]
[ "import torch\nimport torch.nn.functional as fn\nimport numpy as np\nimport math\nfrom torchvision import transforms\nfrom torchvision import datasets\nimport os\n\ndef to_pair(data):\n\tr\"\"\"Converts a single or a tuple of data into a pair. If the data is a tuple with more than two elements, it selects\n\tthe fi...
[ [ "numpy.max", "torch.nonzero", "numpy.sin", "torch.stack", "torch.split", "torch.save", "numpy.exp", "numpy.mean", "torch.from_numpy", "torch.tensor", "numpy.cos", "torch.load", "torch.zeros_like", "torch.nn.functional.pad", "torch.abs_", "torch.nn.fu...
tusharsarkar3/TLA
[ "a898617765e2af8ce4f416d8430a8ee9c92aba94" ]
[ "build/lib/TLA/Lang_Classify/predict.py" ]
[ "from TLA.Lang_Classify.model import get_model, BERT_Arch\nimport argparse\nimport torch\nimport pandas as pd\nimport numpy as np\nfrom transformers import AutoModel, BertTokenizerFast\nimport pickle\nfrom distutils.sysconfig import get_python_lib\n\ndef predict(val_text,model):\n try:\n if isinstance(pd....
[ [ "numpy.array", "torch.no_grad", "torch.cuda.is_available", "torch.tensor", "numpy.argmax", "pandas.read_csv" ] ]
hhelm10/graspy
[ "bbf93b069af426885261d64a6225228ff5aa049b" ]
[ "graspy/utils/utils.py" ]
[ "#!/usr/bin/env python\n\n# utils.py\n# Created by Eric Bridgeford on 2018-09-07.\n# Email: ebridge2@jhu.edu\n# Copyright (c) 2018. All rights reserved.\n\nimport warnings\nfrom collections import Iterable\nfrom functools import reduce\nfrom pathlib import Path\n\nimport networkx as nx\nimport numpy as np\nfrom skl...
[ [ "numpy.max", "numpy.isinf", "numpy.array", "numpy.count_nonzero", "numpy.array_equal", "numpy.errstate", "numpy.sum", "numpy.triu", "numpy.mean", "numpy.allclose", "numpy.stack", "numpy.sqrt", "sklearn.utils.check_array", "numpy.diag", "numpy.tril" ] ]
zongdaoming/TinyTransformer
[ "8e64f8816117048c388b4b20e3a56760ce149fe3" ]
[ "unn/models/heads/pair_head_clean/pair.py" ]
[ "#coding: utf-8\nfrom ..utils import bbox_helper\nfrom ..utils.pair_helper import pair_nms\nfrom ..utils.pair_helper import pair_box_transform\nfrom ..utils.pair_helper import pair_pos_score\nimport pdb\nimport ctypes\n\nimport math\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\nimport logg...
[ [ "numpy.array", "numpy.zeros", "torch.is_tensor", "numpy.random.shuffle", "torch.from_numpy", "numpy.where", "numpy.unique", "numpy.hstack", "numpy.vstack" ] ]
rystylee/pytorch-3DGAN
[ "768f53182183c123a7cbac16581fb777fcf8f726" ]
[ "trainer.py" ]
[ "import os\n\nfrom tqdm import tqdm\n\nimport torch\nimport torch.optim as optim\nfrom torch.utils.tensorboard import SummaryWriter\nfrom torchsummary import summary\n\nfrom model import Discriminator\nfrom model import Generator\nfrom losses import GANLoss\nfrom data_loader import load_dataloader\nfrom utils impor...
[ [ "torch.no_grad", "torch.cat", "torch.utils.tensorboard.SummaryWriter", "torch.load" ] ]
sms1097/imodels
[ "b2b062c8ff1b12c02271f041674a11af85fcfea6" ]
[ "experiments/combine.py" ]
[ "import argparse\nimport glob\nimport os\nimport pickle as pkl\nimport warnings\n\nimport numpy as np\nimport pandas as pd\n\nfrom experiments.compare_models import compute_meta_auc, MODEL_COMPARISON_PATH\n\n\ndef combine_comparisons(path, model, test):\n all_files = glob.glob(path + '*')\n model_files = list...
[ [ "numpy.unique", "pandas.concat" ] ]
amandanic11/shopping-cart
[ "a7a4a11ba452582a83e5a01bc69ec8834edbad5b" ]
[ "shopping-cart-pandas.py" ]
[ "# shopping_cart_pandas.py\nfrom __future__ import print_function\nimport datetime\nimport os\nimport pandas as pd \nimport csv\nfrom dotenv import load_dotenv\nfrom sendgrid import SendGridAPIClient\nfrom sendgrid.helpers.mail import Mail\nimport functools\n\n\nnow = datetime.datetime.now()\npd.options.display.flo...
[ [ "pandas.read_csv" ] ]
chrisdxie/rice
[ "c3e42822226af9ac28d95d434cd582386122b679" ]
[ "src/data_augmentation.py" ]
[ "import torch\nimport random\nimport numpy as np\nimport cv2\n\nfrom .util import utilities as util_\n\n\n##### Useful Utilities #####\n\ndef array_to_tensor(array):\n \"\"\"Convert a numpy.ndarray to torch.FloatTensor.\n\n numpy.ndarray [N, H, W, C] -> torch.FloatTensor [N, C, H, W]\n OR\n numpy.nd...
[ [ "numpy.random.normal", "numpy.array", "numpy.zeros_like", "numpy.random.rand", "numpy.random.choice", "numpy.count_nonzero", "numpy.logical_or", "numpy.random.gamma", "numpy.mean", "torch.from_numpy", "numpy.where", "numpy.random.uniform", "numpy.random.randint"...
Mushroomcat9998/U-2-Net
[ "290d82b087b5eb6e7b781cacea18f270badc51e3" ]
[ "u2net_test.py" ]
[ "import os\nimport glob\nimport torch\nimport argparse\nfrom PIL import Image\nfrom tqdm import tqdm\nfrom skimage import io\nfrom torchvision import transforms\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\n\nfrom model import U2NET\nfrom model import U2NETP\n\nfrom data_loader impo...
[ [ "torch.min", "torch.max", "torch.autograd.Variable", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load" ] ]
msAlcantara/tsgen
[ "b8b5e1d5bf99997135b696284261b9fe41a2a614" ]
[ "tests/gen_test.py" ]
[ "import pandas as pd\nimport numpy as np\nimport os.path\nfrom unittest import TestCase\nfrom tsgen.gen import TimeSerieGenerator\n\n\nclass TimeSerieGeneratorTestCase(TestCase):\n def test_generate_df_freq(self):\n ts_gen = TimeSerieGenerator(\n date_start=\"1990-01-01\",\n date_end...
[ [ "pandas.datetime.now" ] ]
jamesthesnake/bonvoyage
[ "60c4d442138a65262496fd7dea0c8c8837b6c5a7" ]
[ "bonvoyage/tests/test_visualize.py" ]
[ "import matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport pytest\n\n\n@pytest.fixture(params=['hexbin', 'scatter'])\ndef kind(request):\n return request.param\n\n\ndef test_waypointplot(waypoints, kind):\n from bonvoyage import waypointplot\n\n fig, ax = plt.subplots()\n waypointplot(waypoints,...
[ [ "matplotlib.pyplot.subplots" ] ]
RK900/learna
[ "c61f88fff5275fb627ab16d539ccc9c81e5a4b46" ]
[ "src/analyse/analyse_experiment_group.py" ]
[ "from pathlib import Path\nimport pandas as pd\nimport numpy as np\nimport scikits.bootstrap as sci\n\nfrom .read_data import read_data_from_method_path, read_sequence_lengths\nfrom .process_data import (\n solved_across_time_per_run,\n solved_across_time_min,\n runs_solve_instance,\n solved_per_time_li...
[ [ "pandas.DataFrame", "pandas.to_csv" ] ]
Munyola/dnc
[ "d3d94b3b1f1efc282481910054f82047caf37f65" ]
[ "train.py" ]
[ "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed...
[ [ "tensorflow.train.SingularMonitoredSession", "tensorflow.trainable_variables", "tensorflow.logging.set_verbosity", "tensorflow.zeros_initializer", "tensorflow.flags.DEFINE_string", "tensorflow.train.CheckpointSaverHook", "tensorflow.expand_dims", "tensorflow.sigmoid", "tensorfl...
feifzhou/deepmind-research
[ "769bfdbeafbcb472cb8e2c6cfa746b53ac82efc2" ]
[ "hierarchical_transformer_memory/pycolab_ballet/ballet_environment.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.array", "numpy.zeros", "numpy.ones", "numpy.random.default_rng", "numpy.tensordot" ] ]
yzh119/tvm
[ "19400c9967020ca822399f57de0253c3dc98845b" ]
[ "tests/python/unittest/test_tir_intrin.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.nextafter", "numpy.arccos", "numpy.arcsin", "numpy.log1p", "numpy.arange", "numpy.random.randint", "numpy.sinh", "numpy.hypot", "numpy.log10", "numpy.arctanh", "numpy.zeros", "numpy.arccosh", "numpy.arctan", "numpy.copysign", "numpy.power", "n...
NunoEdgarGFlowHub/gandissect
[ "1a162a6bd3d4842139feb9f191aa1fad565dee4e" ]
[ "netdissect/upsegmodel/prroi_pool/functional.py" ]
[ "#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n# File : functional.py\n# Author : Jiayuan Mao, Tete Xiao\n# Email : maojiayuan@gmail.com, jasonhsiao97@gmail.com\n# Date : 07/13/2018\n# \n# This file is part of PreciseRoIPooling.\n# Distributed under terms of the MIT license.\n# Copyright (c) 2017 Megvii Te...
[ [ "torch.zeros", "torch.zeros_like" ] ]
dongzhi0312/can
[ "067d19844f1bf0e058acd03c23f47449686570ac" ]
[ "solver/can_solver.py" ]
[ "import torch\nimport torch.nn as nn\nimport os\nfrom . import utils as solver_utils\nfrom utils.utils import to_cuda, to_onehot\nfrom torch import optim\nfrom . import clustering\nfrom discrepancy.cdd import CDD\nfrom math import ceil as ceil\nfrom .base_solver import BaseSolver\nfrom copy import deepcopy\n\n\ncla...
[ [ "torch.no_grad" ] ]
robert-mijakovic/hoomd-blue
[ "f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a" ]
[ "hoomd/md/pytest/test_dihedral.py" ]
[ "# Copyright (c) 2009-2022 The Regents of the University of Michigan.\n# Part of HOOMD-blue, released under the BSD 3-Clause License.\n\nimport hoomd\nimport pytest\nimport numpy\n\n# Test parameters include the class, class keyword arguments, bond params,\n# force, and energy.\ndihedral_test_parameters = [\n (\...
[ [ "numpy.testing.assert_allclose", "numpy.sin", "numpy.cos" ] ]
petakajaib/dia-kata
[ "5e3f90498352eb4fbf8d7b95e807d4d31df139a2" ]
[ "ml_pipeline/vectorization/relative_entity_position_vector.py" ]
[ "import numpy as np\nfrom .entity_position_vector import get_entity_position_vector\n\ndef get_relative_entity_position_vector(entry, enriched_collection):\n entity_position = get_entity_position_vector(entry, enriched_collection)\n\n sorted_map = {}\n for idx, elem in enumerate(sorted(set(entity_position)...
[ [ "numpy.array" ] ]
strates-git/mathematics
[ "1271033400cece3e987cd6e0d7a8db82abeea769" ]
[ "CDCmodels.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 30 18:17:48 2020\n\n@author: Shane Strate\n\"\"\"\nimport pandas as pd\nimport glob, os\nfrom sklearn import preprocessing\nfrom sklearn.metrics import mean_squared_error, mean_absolute_error, confusion_matrix\nimport numpy as np\nimport seaborn as sns\nimport ma...
[ [ "pandas.to_datetime", "numpy.array", "sklearn.metrics.mean_squared_error", "pandas.merge", "pandas.DataFrame", "sklearn.metrics.mean_absolute_error", "sklearn.preprocessing.MinMaxScaler", "numpy.sqrt", "pandas.unique", "pandas.read_csv" ] ]
amazon-research/cmaxent
[ "a18998b5b02a7d1ef96fceadbea6a9c1aae8cae1" ]
[ "experiments/ace_bounds_experiment.py" ]
[ "# ./experiments/ace_bounds_experiment.py\n\"\"\" Experiments testing our derived ACE bounds.\n\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved. \nSPDX-License-Identifier: Apache-2.0\n\"\"\"\nimport numpy as np\nfrom tqdm import trange\n\nfrom experiments.synthetic_data_generation import *\n\nfro...
[ [ "numpy.array", "numpy.clip" ] ]
15thai/Gibb_ringing
[ "0e019d0da60d6da7c933a85d2407b655ada206bc" ]
[ "unring_parallel.py" ]
[ "import time\nimport numpy as np\nimport multiprocessing\nimport ctypes\nfrom contextlib import closing\nfrom unring import unring_2d\n\ndef unring_wrapper(vol):\n inp = np.frombuffer(shared_input)\n sh_input= inp.reshape(arr_shape)\n\n out = np.frombuffer(shared_output)\n sh_out= out.reshape(arr_shape)\n\n...
[ [ "numpy.frombuffer" ] ]
mjziebarth/gmt-python
[ "0005152780528c7248369fb1446a9670383f2b19" ]
[ "gmt/helpers/tempfile.py" ]
[ "\"\"\"\nUtilities for dealing with temporary file management.\n\"\"\"\nimport os\nfrom tempfile import NamedTemporaryFile\n\nimport numpy as np\n\n\ndef unique_name():\n \"\"\"\n Generate a unique name with the prefix 'gmt-python-'.\n\n Useful for generating unique names for figures (otherwise GMT will pl...
[ [ "numpy.loadtxt" ] ]
Peterror/CPS-2018
[ "e63c17032e9af0a0cd2e0c30a9b31a8bc3018888" ]
[ "Transformata/FFT.py" ]
[ "import numpy as np\n\n\nclass FFT(object):\n def __init__(self, sampling_frequency, samples_power_of_two):\n \"\"\"\n samples - 2^samples_power_of_two\n sampling_frequency must be equal to the number of samples\n \"\"\"\n try:\n self._number_of_samples = 1 <...
[ [ "numpy.complex", "numpy.sin", "numpy.cos" ] ]
guy-amir/swt
[ "9f7f1de45318d2cfb1903f777a7fbb965cd845ac" ]
[ "src/utils.py" ]
[ "\"\"\"\nsome utiliy functions for data processing and visualization.\n\"\"\"\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import ConnectionPatch\nimport numpy as np\nimport torch\n\n# class name for CIFAR-10 dataset\ncifar10_class_name = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', \n ...
[ [ "matplotlib.pyplot.rcParams.update", "torch.cat", "matplotlib.pyplot.figure", "torch.abs", "matplotlib.patches.ConnectionPatch", "matplotlib.pyplot.gcf", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.axis", ...
vinsis/attention-seeking-in-pytorch
[ "fe9cab2cd9def3efb1837d70cd0179b0fb04b2c0" ]
[ "code/content_based_concat_attention.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.optim import Adam\nimport torch.nn.functional as F\n\nfrom loader import loader, sequence_length\n\n# sequence_length is equal to 10\nencoder_input_size = 32\nencoder_hidden_size = 32\n\ndecoder_input_size = 32\ndecoder_output_size = 32*2\n\ndevice = 'cuda' if torch....
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.nn.LSTM", "torch.nn.CrossEntropyLoss", "torch.optim.Adam", "torch.no_grad", "torch.bmm", "torch.sort", "torch.cuda.is_available", "torch.nn.functional.softmax", "torch.Tensor", "torch.nn.Embedding" ] ]
tillbiskup/cwepr
[ "fb5df019238b63f36c7cfdf2d88264e5d18078be" ]
[ "cwepr/plotting.py" ]
[ "\"\"\"\nPlotting: Graphical representations of data extracted from datasets.\n\nGraphical representations of cw-EPR data are an indispensable aspect of data\nanalysis. To facilitate this, a series of different plotters are available.\n\nPlotting relies on `matplotlib <https://matplotlib.org/>`_, and mainly its\nob...
[ [ "numpy.power", "numpy.sqrt" ] ]