repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
rajk97/Adversial-Attacks-on-densely-fused-point-clouds-for-6D-Pose-Estimation
[ "e296e70c3a1286b7491995215369d9f39cfcba17" ]
[ "tools/sampling.py" ]
[ "import numpy as np\nfrom numba import jit\nfrom projection import cross, norm\n\n@jit(nopython = True)\ndef _init_seed():\n np.random.seed(1234)\n\n_init_seed()\n\n@jit(nopython = True)\ndef binary_search(a, b):\n lo = 0\n hi = len(a) - 1\n\n while lo < hi:\n m = (lo + hi - 1) // 2\n\n if...
[ [ "numpy.random.random", "numpy.random.seed", "numpy.linalg.norm", "numpy.concatenate", "numpy.argmax", "numpy.random.randn", "numpy.random.uniform", "numpy.array", "numpy.exp", "numpy.empty" ] ]
TurnphyGithub/PhotonicComposite
[ "ec6abdd8b5eb2181236a466b40a03074a7c9aca4" ]
[ "MultilayerSimulationFunc.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@author: Turnphy\r\n\"\"\"\r\n\r\nfrom tkinter import filedialog\r\nfrom tkinter import *\r\nfrom PIL import ImageTk\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\nfrom tkinter import *\r\nfrom TransferMatrixEngine import (coh_tmm, position_resolved, find_in_s...
[ [ "matplotlib.pyplot.yticks", "matplotlib.pyplot.tight_layout", "numpy.linspace", "matplotlib.pyplot.figure", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel" ] ]
michaelhilborn/AmbulanceDeployement
[ "7bc1e920ba6ba45cd29e8fc3d9f62c8cb7bdf18d" ]
[ "Data_Preprocessing/unit_test.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nSpyder Editor\n\nThis is a temporary script file.\n\"\"\"\n\nimport numpy as np\nimport json\nimport math\nimport collections\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\n# This is the grid object, which is used throughout all data preprocessing.\n# It represents th...
[ [ "numpy.array", "numpy.sum", "matplotlib.pyplot.show", "numpy.genfromtxt" ] ]
Vious/LPG_BBox_Segmentation
[ "bcb4c9e948df16763308087a4986cdb7f1a5896b" ]
[ "utils/losses.py" ]
[ "import torch\nimport torch.nn as nn\nfrom PIL import Image\nimport numpy as np\n\n\ndef resize_labels(labels, size):\n \"\"\"\n Downsample labels for 0.5x and 0.75x logits by nearest interpolation.\n Other nearest methods result in misaligned labels.\n -> F.interpolate(labels, shape, mode='nearest')\n ...
[ [ "numpy.asarray", "torch.LongTensor", "torch.nn.CrossEntropyLoss" ] ]
HolyCrap96/mmocr-1
[ "c6c4acd39b1c56fec1b87530b2d241fe8af4ceed" ]
[ "mmocr/models/textdet/dense_heads/pan_head.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom mmcv.runner import BaseModule\n\nfrom mmocr.models.builder import HEADS, build_loss\nfrom mmocr.utils import check_argument\nfrom . import HeadMixin\n\n\n@HEADS.register_module()\nclass PANHead(HeadMixin,...
[ [ "numpy.array", "torch.cat" ] ]
ffmpbgrnn/google-research
[ "eb924d158768e0ca91fd382f02818d1440fb5e75" ]
[ "l2tl/train_l2tl.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Google Research 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 requ...
[ [ "tensorflow.initializers.zeros", "tensorflow.control_dependencies", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.nn.l2_loss", "tensorflow.train.AdamOptimizer", "tensorflow.add_n", "tensorflow.get_collection", "tensorflow.train.get_global_step", "tensorflow.stop_g...
Narsil/chempy
[ "ac7217f45a8cfe3b11ca771f78f0a04c07708818" ]
[ "chempy/tests/test_reactionsystem.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import (absolute_import, division, print_function)\n\nfrom itertools import chain\n\nimport pytest\n\nfrom ..util.testing import requires\nfrom ..util.parsing import parsing_library\nfrom ..units import default_units, units_library\nfrom ..chemistry import Substance, Reacti...
[ [ "numpy.all" ] ]
LeiWang1999/tf-lenet
[ "9b47f8b4c5aad40d1bdaeed917f86d920124b6ce" ]
[ "lenet/network.py" ]
[ "import tensorflow as tf\nimport numpy as np\nfrom .layers import *\nfrom .support import visualize_images\nfrom .global_definitions import *\n\ndef apply_gradient_descent(var_list, obj):\n \"\"\"\n Sets up the gradient descent optimizer\n\n Args:\n var_list: List of variables to optimizer over. ...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.summary.scalar", "tensorflow.train.RMSPropOptimizer", "tensorflow.get_collection", "tensorflow.summary.image", "tensorflow.cast", "tensorflow.placeholder", "tensorflow.nn.l2_loss", "tensorflow.train.GradientDescentO...
deicon/tastyworks-pnl
[ "de949852865eb6b163245e06ecfcfc1a6511ca47" ]
[ "tw-pnl.py" ]
[ "#!/usr/bin/python3\n#\n# Copyright (C) 2020-2021 Florian La Roche <Florian.LaRoche@gmail.com>\n# https://github.com/laroche/tastyworks-pnl\n#\n# Generate data for a German tax income statement from Tastyworks trade history.\n#\n#\n# Download your trade history as csv file from\n# https://trade.tastyworks.com/index...
[ [ "pandas.read_csv", "pandas.to_datetime", "pandas.read_html", "pandas.DataFrame", "pandas.ExcelWriter", "matplotlib.pyplot.show", "pandas.to_numeric" ] ]
MontpellierRessourcesImagerie/napari
[ "8d5ffd29f3c9d460600e65e58c64c7294fb2164e" ]
[ "napari/_qt/qt_viewer.py" ]
[ "from __future__ import annotations\n\nimport logging\nimport warnings\nfrom typing import TYPE_CHECKING, List, Optional, Sequence, Tuple\n\nimport numpy as np\nfrom qtpy.QtCore import QCoreApplication, QObject, Qt\nfrom qtpy.QtGui import QCursor, QGuiApplication\nfrom qtpy.QtWidgets import QFileDialog, QSplitter, ...
[ [ "numpy.array" ] ]
Ignoramus-Sage/RBM-DBN_DNN
[ "175d722c4c9898a1a61e86ea164d80c17f4b7943" ]
[ "principal_DNN_MNIST.py" ]
[ "from principal_DBN_alpha import *\r\nimport tensorflow as tf\r\nimport numpy as np\r\n\r\ndef scale_and_read_img(data_set):\r\n snip = None\r\n data_std = (data_set - np.min(data_set))/(np.max(data_set) - np.min(data_set))\r\n for datum in data_std:\r\n temp = datum.flatten(order='F')\r\n if...
[ [ "numpy.log", "numpy.min", "numpy.arange", "tensorflow.keras.datasets.mnist.load_data", "numpy.max", "numpy.mean", "numpy.zeros", "numpy.vstack" ] ]
justiniann/ConvX
[ "78e74a2cd8b8f43088d7fd52e75db5e2468177b9" ]
[ "source/convx/analysis.py" ]
[ "from keras.applications import ResNet50\nfrom keras.layers import *\nfrom keras.models import Model\nfrom keras.models import Sequential\nfrom keras.models import model_from_json\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.utils import to_categorical\nfrom sklearn.metrics import accuracy_...
[ [ "sklearn.metrics.fbeta_score", "sklearn.metrics.confusion_matrix", "sklearn.metrics.accuracy_score" ] ]
Willqie/pytorch
[ "5bc28c897e5d00c0a839de9692b9b54de5294aff" ]
[ "torch/utils/cpp_extension.py" ]
[ "import copy\nimport glob\nimport importlib\nimport os\nimport re\nimport shlex\nimport setuptools\nimport subprocess\nimport sys\nimport sysconfig\nimport warnings\nimport collections\n\nimport torch\nimport torch._appdirs\nfrom .file_baton import FileBaton\nfrom ._cpp_extension_versioner import ExtensionVersioner...
[ [ "torch.version.hip.split", "torch.__config__.parallel_info", "torch.ops.load_library", "torch._appdirs.user_cache_dir", "torch.cuda.get_device_capability", "torch.version.cuda.replace", "torch.cuda.is_available", "torch.cuda.device_count", "torch.cuda.get_arch_list" ] ]
seequent/lfview-resources-files
[ "7ac0d44724471646bb90cf0a030b279fbc9c5c7e" ]
[ "tests/test_array.py" ]
[ "from __future__ import unicode_literals\n\nimport numpy as np\nimport pytest\n\nimport properties\nimport properties.extras\nfrom lfview.resources import files\n\n\ndef test_empty_init():\n arr = files.Array()\n with pytest.raises(properties.ValidationError):\n arr.validate()\n\n\ndef test_object_with...
[ [ "numpy.array", "numpy.dtype" ] ]
MatthewK3023/FoodCalorieDetector
[ "b0bfa4e0f10bd70bbb9b2bee085a15706c566fe5" ]
[ "caffe_transfer/demo_tensorrt.py" ]
[ "import logging\nimport math\nimport os\nimport pickle\nimport time\n\nimport cv2\nimport numpy as np\nimport tensorrt as trt\nimport torch\nimport _init_paths\nfrom torchvision import transforms\nfrom opts_pose import opts\nfrom centernet_tensorrt_engine import CenterNetTensorRTEngine\n\nlogger = logging.getLogger...
[ [ "numpy.array" ] ]
kos-kaggle/pytorch_advanced
[ "a241067ddbcb37ef42bb243ea55efddf8cc36860" ]
[ "2_objectdetection/utils/ssd_model.py" ]
[ "\"\"\"\n第2章SSDで実装した内容をまとめたファイル\n\"\"\"\n\n# パッケージのimport\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch.nn.functional as F\nfrom torch.autograd import Function\nimport torch.utils.data as data\nimport torch\nimport cv2\nimport numpy as np\nimport os.path as osp\nfrom itertools import product as...
[ [ "torch.nn.Softmax", "numpy.expand_dims", "torch.zeros", "torch.FloatTensor", "torch.nn.functional.smooth_l1_loss", "torch.from_numpy", "torch.mul", "torch.index_select", "torch.div", "torch.LongTensor", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn...
abstractpaper/prop
[ "f2ca127119ffbfb3f7d2855eff7e7473e0bb3a80" ]
[ "tests/buffers/priority_rep_buffer_test.py" ]
[ "import pytest\nimport numpy as np\nimport torch\nimport random\nfrom collections import namedtuple\nfrom prop.buffers.priority_replay_buffer import PrioritizedReplayBuffer\n\nTransition = namedtuple('Transition',\n ('state', 'action', 'next_state', 'reward', 'mask'))\n\n@pytest.fixture\ndef ...
[ [ "numpy.random.exponential", "numpy.zeros", "numpy.abs" ] ]
amueller/scikit-learn_bench
[ "4752e4590c11cdd6c13a4af5aaf9f88e8a86ecbb" ]
[ "sklearn/distances.py" ]
[ "# Copyright (C) 2017-2019 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport argparse\nfrom bench import parse_args, time_mean_min, print_header, print_row\nimport numpy as np\nfrom sklearn.metrics.pairwise import pairwise_distances\n\nparser = argparse.ArgumentParser(description='scikit-learn pairwise...
[ [ "numpy.random.rand" ] ]
mevol/metric_ml
[ "f09ef35eeec8fe64fce83bb238f1ba75362856ce" ]
[ "metrix_ml/decisiontree_ada_randomsearch_scaled.py" ]
[ "###############################################################################\n#\n# imports and set up environment\n#\n###############################################################################\n'''Defining the environment for this class'''\nimport argparse\nimport pandas as pd\nimport os\nimport numpy as ...
[ [ "sklearn.metrics.roc_auc_score", "pandas.read_csv", "sklearn.model_selection.RandomizedSearchCV", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.tree.DecisionTreeClassifier", "sklearn.ensemble.AdaBoostClassifier", "numpy.mean", "scipy.stats.uniform", ...
tguillemLSST/eotest
[ "c6f150984fa5dff85b9805028645bf46fc846f11" ]
[ "python/lsst/eotest/simulation/generate_Fe55_images.py" ]
[ "\"\"\"\n@brief Generate Fe55 images and associated darks and bias images\naccording to section 5.4 of the E/O document (Dec 19, 2012 version).\n\n@author J. Chiang <jchiang@slac.stanford.edu>\n\"\"\"\nimport os\nimport numpy as np\nfrom sim_inputs import *\nfrom sim_tools import *\n\n\ndef generate_Fe55_images(exp...
[ [ "numpy.linspace" ] ]
RobertLuo1/AmazonShoesReviewsClassifier
[ "752f17f9c253a08513b143be9e90fa1e3f9335fb" ]
[ "textdataset.py" ]
[ "#-*- coding: utf-8 -*-\n#@author: Zhuoyan Luo,Ruiming Chen\n\nimport torch\nfrom torch.utils.data import DataLoader,Dataset\nfrom config import ws,max_len,train_batch_size,test_batch_size\nimport os\nfrom nltk import word_tokenize\nimport numpy as np\n\nclass textDataset(Dataset):\n def __init__(self,mode):\n ...
[ [ "torch.LongTensor", "torch.utils.data.DataLoader", "torch.tensor" ] ]
zhaofeng-shu33/pyBHC
[ "55f80e6d13cbfc12555bd165a49ae80ea6f08393" ]
[ "pyBHC/bhc.py" ]
[ "from __future__ import print_function, division\nimport itertools as it\nimport numpy as np\nimport sys\n\nfrom numpy import logaddexp\nimport math\n\n\nclass bhc(object):\n \"\"\"\n An instance of Bayesian hierarchical clustering CRP mixture model.\n Attributes\n ----------\n assignments : list(lis...
[ [ "numpy.vstack", "numpy.mean", "numpy.random.rand", "numpy.array", "numpy.zeros", "numpy.logaddexp" ] ]
aurora32s/pytorch-example
[ "83d494306829aec025796eb6adba4cef5b1641eb" ]
[ "mnist/main.py" ]
[ "from __future__ import print_function\nimport argparse\nimport json #변경222\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nfrom torch.optim.lr_scheduler import StepLR\n\n\nclass Net(nn.Module):\n def __init__(self)...
[ [ "torch.nn.Dropout2d", "torch.nn.functional.log_softmax", "torch.nn.functional.nll_loss", "torch.manual_seed", "torch.nn.Conv2d", "torch.utils.data.DataLoader", "torch.nn.Linear", "torch.nn.functional.relu", "torch.no_grad", "torch.cuda.is_available", "torch.flatten", ...
kmagdy20/qiskit-terra
[ "fcec842f1de9fd12120e30a1bf73bf7c52b1bf81" ]
[ "test/python/visualization/test_circuit_latex.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ...
[ [ "numpy.eye", "numpy.zeros" ] ]
Escapist-007/CVIP_Projects
[ "457dbdde3dca78229c2ae4eeb852681c42563ba9" ]
[ "Project_01/Template_Matching/task1.py" ]
[ "\"\"\"\n UB_ID : 50291708\n Name : Md Moniruzzaman Monir\n\nEdge Detection : (Due date: March 8th, 11: 59 P.M.)\n\nThe goal of this task is to experiment with two commonly used edge detection operator, i.e., Prewitt operator and Sobel operator,\nand familiarize you with 'tricks', e.g., padding, commonly used ...
[ [ "numpy.asarray", "numpy.max", "numpy.sqrt" ] ]
Cerenaut/rsm
[ "33bf8a3a620b46b5180280f2ca5f0b28c168b806" ]
[ "rsm/datasets/text_embedding_dataset.py" ]
[ "# Copyright (C) 2019 Project AGI\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 agr...
[ [ "tensorflow.TensorShape", "numpy.reshape", "numpy.prod", "tensorflow.data.Dataset.from_generator", "numpy.zeros", "numpy.random.randint" ] ]
Ali-Parandeh/Transfer_Learning_Image_Classifier
[ "b887a14053d30dd14ed340d88cd02b1ccde190fc" ]
[ "train.py" ]
[ "# PROGRAMMER: Alireza Parandeh\n# DATE CREATED: 22.06.2019\n# REVISED DATE:\n# PURPOSE: Create functions to train a new network on a dataset and save the model as a checkpoint.\n# Also, Prints out training loss, validation loss, and validation accuracy as the network trains\n\nimport torch\nfrom torch imp...
[ [ "torch.exp", "torch.no_grad", "torch.utils.data.DataLoader", "torch.save" ] ]
kyleclo/allennlp
[ "0205c26f3db7ef44d7ee70fa9ebdf5a7f6b43baf", "0205c26f3db7ef44d7ee70fa9ebdf5a7f6b43baf" ]
[ "allennlp/training/checkpointer.py", "allennlp/models/encoder_decoders/copynet_seq2seq.py" ]
[ "from typing import Union, Dict, Any, List, Tuple\n\nimport logging\nimport os\nimport re\nimport shutil\nimport time\n\nimport torch\n\nfrom allennlp.nn import util as nn_util\n\nlogger = logging.getLogger(__name__)\n\nclass Checkpointer:\n \"\"\"\n This class implements the functionality for checkpointing y...
[ [ "torch.load", "torch.save" ], [ "torch.tanh", "torch.nn.modules.linear.Linear", "torch.cat", "torch.nn.modules.rnn.LSTMCell" ] ]
IgorDavidyuk/conflicting_tasks_learning
[ "ecaed415d710723e5fe9880984cae3f163735860" ]
[ "dataset/classification_dataset.py" ]
[ "import os\n# import cv2\nfrom PIL import Image\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nfrom torchvision import transforms\nfrom create_google_fonts_dataset import parse_gf_metadata, save_rendered_glyphs\n\n\nclass CharClassificationDataset(Dataset):\n\n def __init__(self, gf_dat...
[ [ "numpy.mean", "torch.is_tensor" ] ]
healenrens/A-fast-demo-to-help-you-build-and-training-your-network
[ "62494656d3555ecb0c424d539630c74ef4db791f" ]
[ "test.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nclass tester():\r\n def __init__(self,model,testdata,criterion,batchsize):\r\n self.modle=model\r\n self.set=testdata\r\n self.device=torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')\r\n self.cri=criterion\r\n self.batchsi...
[ [ "torch.max", "torch.cuda.is_available" ] ]
marcelsan/Deep-HdrReconstruction
[ "7cb0d93938baa6fbe029116451a661c18dfba49e" ]
[ "loss.py" ]
[ "import sys\nsys.path.append(\"..\")\n\nimport torch\nimport torch.nn as nn\n\nfrom lib.io import print_\nfrom network.vgg import VGG16FeatureExtractor\n\ndef gram_matrix(feat):\n \"\"\"\n Calculate gram matrix used in style loss\n https://github.com/pytorch/examples/blob/master/fast_neural_style/neural_st...
[ [ "torch.abs", "torch.cat", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.tensor", "torch.exp", "torch.log", "torch.bmm", "torch.no_grad", "torch.device", "torch.clamp", "torch.nn.L1Loss" ] ]
shumwaymark/sentinelcam
[ "a6381915b6b315b354856e6895a1ceacb798d755" ]
[ "camwatcher/camdata.py" ]
[ "\"\"\"camdata: access to camera event data from sentinelcam outpost nodes\n\nCopyright (c) 2021 by Mark K Shumway, mark.shumway@swanriver.dev\nLicense: MIT, see the sentinelcam LICENSE for more details.\n\"\"\"\n\nimport os\nimport pandas as pd\nfrom datetime import datetime\n\nclass CamData:\n \"\"\" Data and ...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
simonverret/deep_continuation
[ "986bfba7f6806dc4869a023ff1fc1d0d18324b25" ]
[ "deep_continuation/function_generator.py" ]
[ "import time\nimport warnings\n\nimport numpy as np\nfrom scipy import integrate\nfrom scipy.special import gamma\nimport matplotlib.pyplot as plt\n\nfrom deep_continuation import utils\nfrom deep_continuation import monotonous_functions as monofunc\n\n\nSMALL = 1e-10\nINF = 1e10\n\ndefault_parameters = {\n 'see...
[ [ "numpy.hstack", "scipy.special.gamma", "numpy.sqrt", "numpy.random.seed", "numpy.linspace", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.nan_to_num", "numpy.ones", "numpy.log10", "numpy.exp", "numpy.random.uniform", "matplotlib.pyplot.show", "numpy.f...
rohitgajawada/Where-are-they-looking-PyTorch
[ "d4627a1659b5f6ddc7b829b3a60f5e360f1791d5" ]
[ "modeltester.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.autograd import Variable\nimport getdata as ld\nimport utils\nimport os\nimport opts\nfrom PIL import Image\nimport models.gazenet as gazenet\nimport torchvision\nfrom torchvision import transforms\nimport matplotlib.pyplot as plt\nimport...
[ [ "matplotlib.pyplot.imshow", "torch.max", "torch.load", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf" ] ]
pkulwj1994/AdversarialConsistentScoreMatching
[ "f439f242f004ce06382ed72f2aa7daf9c262abfa" ]
[ "runners/abc_runner.py" ]
[ "import abc\nimport os\n\nimport numpy as np\nfrom torch.nn import DataParallel\n\nfrom datasets import data_transform, get_dataloader\nfrom losses import get_optimizer\nfrom models.GAN_D import *\nfrom models.UNet import *\nfrom models.ema import EMAHelper\nfrom models.ncsnv2 import NCSNv2, NCSNv2Deeper, NCSNv2Dee...
[ [ "numpy.geomspace", "torch.nn.DataParallel", "numpy.sqrt", "numpy.linspace" ] ]
emirkmo/imagematch
[ "99c48a37aad455c7451e907f9ea8689b19e21a35" ]
[ "imagematch/VTKHelperFunctions.py" ]
[ "'''A module to help translate back and forth from python layer to VTK'''\n\nimport vtk\nfrom vtk.util import numpy_support\nimport numpy as np\n\n\ndef NumToVTKArray(arr, name=None):\n __typeDict = {np.uint8:vtk.vtkUnsignedCharArray,\n np.byte:vtk.vtkUnsignedCharArray,\n np.bool:vtk.vtkUnsignedCh...
[ [ "numpy.multiply.reduce", "numpy.sum", "numpy.asarray", "numpy.less", "numpy.squeeze", "numpy.arange", "numpy.ndarray.flatten", "numpy.sort", "numpy.ones", "numpy.ravel", "numpy.zeros", "numpy.where" ] ]
algoix/blog
[ "91adfe1f526f0ebd41febe469f114871555e3c02", "91adfe1f526f0ebd41febe469f114871555e3c02" ]
[ "resource 1/join.py", "resource 1/plotdata.py" ]
[ "import pandas as pd\n\n\ndef test_run():\n # Define test range\n start_date = '2015-01-01'\n end_date = '2015-01-31'\n dates = pd.date_range(start_date, end_date)\n\n # Create an empty dataframe\n df1 = pd.DataFrame(index=dates)\n\n # Read SPY data into temporary dataframe\n dfSPY = pd.read...
[ [ "pandas.read_csv", "pandas.DataFrame", "pandas.date_range" ], [ "pandas.read_csv", "matplotlib.pyplot.show" ] ]
szussman/strikeouts
[ "afe6be07a49e8e2c0450e505af0ebbef8bede710" ]
[ "strikeouts.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom bokeh.plotting import figure, output_file, show\nimport bokeh.models.tickers as tickers\nfrom bokeh.models import NumeralTickFormatter\n\noutput_file(\"so.html\")\n\nfilename = \"/Users/stuartzussman/Desktop/baseballdatabank-master/core/Teams.csv\"\nstarting_df = pd.re...
[ [ "numpy.arange", "pandas.read_csv" ] ]
metang/MLProj1
[ "3964a1e75bb31b5ce9d043dcdc626e3285821cd8" ]
[ "src/run_pretraining_ort.py" ]
[ "# coding=utf-8\n# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved.\n# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. 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 obt...
[ [ "torch.load", "numpy.asarray", "torch._C._jit_set_profiling_mode", "torch.utils.data.DataLoader", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.is_available", "torch.distributed.get_rank", "torch.save", "torch.nn.CrossEntropyLoss", "torch.ones", "torch.tensor", ...
ostrokach/protein-adjacency-net
[ "fd3ad0b9034eb61b0187752c1f38f7eed1a8f1dc" ]
[ "src/pagnn/training/dcn/main.py" ]
[ "import itertools\nimport json\nimport logging\nimport os\nimport random\nimport runpy\nimport time\nfrom typing import Any, Dict, Optional, Union\n\nimport numpy as np\nimport sqlalchemy as sa\nimport torch\nimport torch.nn as nn\nimport torch.onnx\nimport torch.optim as optim\n\nimport pagnn.models\nfrom pagnn im...
[ [ "torch.cuda.manual_seed", "torch.cat", "numpy.random.seed", "torch.manual_seed", "torch.load", "torch.tensor", "torch.nn.BCELoss", "torch.no_grad", "torch.stack", "torch.device", "torch.nn.L1Loss" ] ]
cedricrupb/ctxmutants
[ "88f5bdc0e320c2e9c74012e8c6fc56f63b6d548d" ]
[ "ctxmutants/mutation/utils.py" ]
[ "import random\nimport numpy as np\n\n\nclass MutationSampler:\n\n def __init__(self, mutation_op):\n self.mutation_op = mutation_op\n\n def __call__(self, tokens, location, types = None):\n mutation_dist = self.mutation_op(tokens, location, types)\n \n operators = list(mutation_di...
[ [ "numpy.random.rand", "numpy.cumsum" ] ]
futurityab/haystack
[ "af8ce74dde221a58f01d25aa9c54fbb646549418" ]
[ "haystack/retriever/dense.py" ]
[ "import logging\nfrom typing import List, Union, Tuple, Optional\nimport torch\nimport numpy as np\nfrom pathlib import Path\nfrom tqdm import tqdm\n\nfrom haystack.document_store.base import BaseDocumentStore\nfrom haystack import Document\nfrom haystack.retriever.base import BaseRetriever\n\nfrom farm.infer impor...
[ [ "numpy.concatenate", "torch.no_grad", "torch.cuda.is_available", "torch.device", "torch.utils.data.sampler.SequentialSampler" ] ]
maltanar/dataset_loading
[ "75ba02f16735c78dfbd3e3962b484b9b57189dcd" ]
[ "tests/time_read.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport timeit\nfrom time import sleep # noqa\nfrom dataset_loading import cifar # noqa\nimport io\nfrom contextlib import redirect_stdout\nimport argparse\n\n\ndef test_time(args):\...
[ [ "numpy.median" ] ]
rpatil524/data
[ "9e76c7f22a75ad4e52522444a080ed3f5c6da7dd" ]
[ "scripts/us_cdc/environmental_health_toxicology/parse_air_quality.py" ]
[ "# Copyright 2021 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "pandas.read_csv", "pandas.to_datetime" ] ]
txyzwh/MarioPCG
[ "26b8804b30371bf699dbbc1f0897653dec784006" ]
[ "pytorch/generator_ws.py" ]
[ "# This generator program expands a low-dimentional latent vector into a 2D array of tiles.\n# Each line of input should be an array of z vectors (which are themselves arrays of floats -1 to 1)\n# Each line of output is an array of 32 levels (which are arrays-of-arrays of integer tile ids)\n\nimport torch\nimport t...
[ [ "torch.load", "numpy.argmax", "torch.no_grad", "torch.FloatTensor", "numpy.zeros", "torch.autograd.Variable" ] ]
junohpark221/BSc_individual_project
[ "44f49d3cbb93298880f046551056185b72324d17" ]
[ "codes/Version 8.3 - supp_node_num is multiple of 2/main.py" ]
[ "import networkx as nx\nimport pandas as pd\n\nfrom pymnet import *\nimport random\nimport matplotlib\nimport cascade as cas\nimport statistics\nimport math\nimport time\nimport csv\nmatplotlib.use('TkAgg')\n\nnodes = 500\nlayers = 3\nsupp_node_num = 2\nintra_thres = 0.0392\ninter_thres = 0.7\n\nattack_size = 50\na...
[ [ "matplotlib.use" ] ]
luis-armando-perez-rey/diffusion_vae_github
[ "1d44723a6363c304f575c584142492950591e6f5" ]
[ "modules/utils/callbacks/latent_space_callback.py" ]
[ "import keras\nimport time\nimport numpy as np\nimport imageio\nimport glob\nimport os\n\nclass LatentSpaceCallback(keras.callbacks.Callback):\n def __init__(self, train_data, vae,save_folder, experiment_name, periodicity, batch_size):\n self.train_data = train_data\n self.vae = vae\n self.s...
[ [ "numpy.argsort" ] ]
zhonghua-wang/NPTP
[ "bbf2367395c0a0b0aad63cb39d6f9403a215a52f" ]
[ "python_code/ml/RF_2.py" ]
[ "import multiprocessing as mp\nimport os\nimport warnings\nfrom random import shuffle\nfrom rdkit.Chem import MACCSkeys\nimport numpy as np\nimport pandas as pd\nfrom rdkit.Chem import MolFromSmiles,AllChem\nfrom rdkit.Chem.AllChem import GetMorganFingerprintAsBitVect\nfrom rdkit import DataStructs\n#from sklearn.c...
[ [ "numpy.hstack", "sklearn.metrics.roc_auc_score", "pandas.read_csv", "sklearn.ensemble.RandomForestClassifier", "numpy.nanmean", "numpy.array", "numpy.zeros", "numpy.where" ] ]
david0811/atms597_proj3
[ "3f89c4e4d745b19879dee9bf71fa01ce23e5a909" ]
[ ".ipynb_checkpoints/seasonal_anomalies-checkpoint.py" ]
[ "import xarray as xr\nimport pandas as pd\nfrom siphon.catalog import TDSCatalog\nimport metpy\nfrom metpy.units import units\n\n# Create list of extreme precipitation days from PrecipData.py\ntimes = ['1997-06-13T00:00:00.000000000', '1997-07-06T00:00:00.000000000',\n '1997-07-25T00:00:00.000000000', '1997...
[ [ "pandas.to_datetime" ] ]
spcl/GMS
[ "bd8f384ca2f02c52909f4ab77cbb86edba89c7b6" ]
[ "scripts/plotmaker_old.py" ]
[ "#!/bin/python3\n\n##################################################################################################################\n##\n## usage info is at the bottom, scroll down to main part for how-to\n##\n########################################################################################################...
[ [ "pandas.read_csv", "matplotlib.pyplot.figure" ] ]
ianhi/animatplot
[ "632d988687fca7e7415e9fa49fe7eebc3f0991c6" ]
[ "animatplot/blocks/base.py" ]
[ "import matplotlib.pyplot as plt\n\n\nclass Block:\n \"\"\"A base class for blocks\n\n Parameters\n ----------\n ax : matplotlib.axes.Axes, optional\n The matplotlib axes to attach the animation to.\n Defaults to matplotlib.pyplot.gca()\n t_axis : int, optional\n The axis of the ...
[ [ "matplotlib.pyplot.gca" ] ]
jennahamlin/nf-core-mashwrapper
[ "621e68fa1f1b37bd1dfd2795f4b56d6e7bff0a92" ]
[ "bin/run_species_id.py" ]
[ "#!/usr/bin/env python3.7\n\nimport argparse, sys, os\nimport logging\nimport shutil\nimport subprocess\nimport pandas as pd\nfrom io import StringIO\nfrom datetime import datetime\nfrom tabulate import tabulate\n\n#############################\n## Argument Error Messages ##\n#############################\n\n## cre...
[ [ "pandas.DataFrame" ] ]
darrida/Detect-and-Move-Blury-Images--using-Open-CV-
[ "7c3c702ce362cc77e2f9594a7c00baa40be24288" ]
[ "working_sample/2017.12.31/findedges.py" ]
[ "from PIL import Image\nfrom PIL import ImageFilter\n#from IPython.display import Image as JubImage\nimport numpy\n\n# NOTE: last try before it somehow worked was pip3 install opencv-python\n#\n# Sorts pictures in current directory into two subdirs, blurred and ok\n# Found original here: https://photo.stackexchange...
[ [ "numpy.median" ] ]
nettourist/ex_pandas
[ "61998b448ef21d19389dc43943faf4b6ac2ab929" ]
[ "main.py" ]
[ "# -*- coding: utf-8 -*-\n# -*- vk.com/nettourist -*-\nimport pandas as pd\n\ndefault = pd.read_excel (r'data/default.xlsx')\nkeys = pd.read_excel (r'data/keys.xlsx')\n\nwhile True:\n search = input('[1] Default\\n[2] Keys\\nPress: ')\n if search in ['1']:\n print (default)\n\n if search in ['2']:\n...
[ [ "pandas.read_excel" ] ]
Fanta007/Graph-U-Nets
[ "96fcd45fd1f486d2e9e45cde169b7cadaca86247" ]
[ "network.py" ]
[ "from __future__ import print_function\nimport os\nimport ops\nimport sys\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\nsys.path.append('%s/pytorch_structure2vec-master/s2v_lib' % os.path.dirname(\n os.path.realpath(__file__)))\nfrom s2v_lib import S2...
[ [ "torch.Tensor", "torch.cat", "torch.zeros", "torch.nn.ModuleList", "torch.nn.MaxPool1d", "torch.nn.Linear", "torch.nn.functional.relu", "torch.nn.Conv1d", "torch.nn.functional.tanh", "torch.autograd.Variable" ] ]
chriscohoat/3DDFA_V2
[ "35815c91acc2cb7ba0450ba4a318eb4e7e3b3928" ]
[ "utils/serialization.py" ]
[ "# coding: utf-8\n\n__author__ = 'cleardusk'\n\nimport numpy as np\n\nfrom utils.pose import calc_pose\n\nfrom .tddfa_util import _to_ctype\nfrom .functions import get_suffix\nimport matplotlib.pyplot as plt\nfrom itertools import product, combinations\n\nheader_temp = \"\"\"ply\nformat ascii 1.0\nelement vertex {}...
[ [ "numpy.maximum", "numpy.linspace", "numpy.squeeze", "numpy.cos", "numpy.sin", "matplotlib.pyplot.axes", "numpy.atleast_2d", "numpy.deg2rad", "numpy.round", "matplotlib.pyplot.plot", "numpy.meshgrid", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
dhomeier/lightkurve
[ "ea53c81f3d7617441a02288ed84c016e8ef80ceb" ]
[ "lightkurve/search.py" ]
[ "\"\"\"Defines tools to retrieve Kepler data from the archive at MAST.\"\"\"\nfrom __future__ import division\nimport os\nimport glob\nimport logging\nimport re\nimport warnings\nfrom requests import HTTPError\n\nimport numpy as np\nfrom astropy.table import join, Table, Row\nfrom astropy.coordinates import SkyCoor...
[ [ "numpy.unique", "numpy.asarray", "numpy.atleast_1d", "numpy.array", "numpy.where" ] ]
IC-hub/ProteinLM
[ "fda4f381b4b974721b187cece968dd7bc96a81f4" ]
[ "tape/tape/utils/utils.py" ]
[ "import typing\nimport random\nfrom pathlib import Path\nimport logging\nfrom time import strftime, gmtime\nfrom datetime import datetime\nimport os\nimport argparse\nimport contextlib\nfrom collections import defaultdict\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nimport torch.distri...
[ [ "numpy.random.seed", "torch.manual_seed", "numpy.asanyarray", "torch.cuda.manual_seed_all", "torch.distributed.get_world_size" ] ]
pappuks/rpi-soundmeter
[ "8d1aa585cc08669bc496cdb64ce7fed0c9403971" ]
[ "spl_meter_lcd.py" ]
[ "#!/usr/bin/env python\nimport os, errno\nimport pyaudio\nimport spl_lib as spl\nfrom scipy.signal import lfilter\nimport numpy\nimport lcd1602 as lcd1602\nimport led_bcm as led\n\n## For web browser handling\n#from selenium import webdriver\n\n\n''' The following is similar to a basic CD quality\n When CHUNK siz...
[ [ "scipy.signal.lfilter", "numpy.fromstring" ] ]
liuhongbing1220/fundanNLP_task
[ "20c7b3b5d21d4b030dc936b2f0bc54fc17f9a619" ]
[ "segment_classifier/charCNN_classifier/charCNN_model.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Jun 29 13:07:37 2019\n\n@author: liuhongbing\n\"\"\" \n \n# coding=utf-8\nimport tensorflow as tf\nfrom read_data import Dataset\nfrom math import sqrt\n\n\nclass CharCNN(object):\n \"\"\"\n A CNN for text classification.\n Uses...
[ [ "tensorflow.device", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.nn.max_pool", "tensorflow.cast", "tensorflow.nn.conv2d", "tensorflow.name_scope", "tensorflow.argmax", "tensorflow.nn.dropout", "tensorflow.nn.xw_plus_b", "tensorflow.matmul", "tensorflo...
Daniel1586/Initiative_machine_learning
[ "dfbadd50c14ccccf1cd28acc314e4ae8cd511f60" ]
[ "04_classification_naive_bayes/tutorials_naive_bayes.py" ]
[ "#!/usr/bin/python\n# -*- coding:utf-8 -*-\n\n\"\"\"\n@file: tutorials_naive_bayes.py\n\"\"\"\nimport numpy as np\nimport pandas as pd\n\n\n# 读取样本数据,最后1列为类别\ndef load_data(file):\n dataset = pd.read_csv(file)\n\n return dataset\n\n\n# 数据集划分训练集和测试集(当前设置测试集仅1个数据)\n# 返回数据类型为n维数组格式\ndef split_dataset(dataset, tes...
[ [ "pandas.read_csv", "numpy.unique", "numpy.argmax", "numpy.array", "numpy.where" ] ]
MICLab-Unicamp/BTRSeg
[ "03078ac591fe95cf6cf3efaeb00ebf3e509181dc" ]
[ "src/train.py" ]
[ "'''\nExperiment Description\nBTRSeg architecutre: expansion of the 2D UNet from E2DHipseg to 3D, testing various parameter configurations.\n'''\nEXPERIMENT_NAME = \"BTRSeg\"\n\n# Standard Library\nimport os\nimport logging\nimport argparse\n\n# External Libraries\nimport numpy as np\nimport torch\nfrom torch.optim...
[ [ "torch.stack", "numpy.array", "torch.optim.lr_scheduler.ExponentialLR" ] ]
unknownuser13570/FODGE
[ "3d5c1c5fb3c5ff23b134afa633dcf0e1649d108c" ]
[ "GEA/gae_pytorch/gae/utils.py" ]
[ "import pickle as pkl\n\nimport networkx as nx\nimport numpy as np\nimport scipy.sparse as sp\nimport torch\nfrom sklearn.metrics import roc_auc_score, average_precision_score\n\n\ndef load_data(dataset):\n # load the data: x, tx, allx, graph\n names = ['x', 'tx', 'allx', 'graph']\n objects = []\n for i...
[ [ "numpy.dot", "sklearn.metrics.roc_auc_score", "numpy.round", "numpy.any", "scipy.sparse.vstack", "numpy.exp", "numpy.random.randint", "numpy.hstack", "scipy.sparse.coo_matrix", "torch.Size", "scipy.sparse.isspmatrix_coo", "torch.from_numpy", "numpy.power", "...
esp32wrangler/Self-Driving-Car
[ "d989a9aa8d309cc0de7939f94d5aaef1300eb442" ]
[ "trainer/raw2img.py" ]
[ "import numpy as np\nimport cv2\nimport matplotlib.image as mpimg\n\nfile1=open('image_raw_sample', 'r')\nimg_count=0\nwhile True:\n line = file1.readline();\n if not line:\n break\n if line[:7]==\"data: [\":\n lines = line.strip()[7:-1].split(',')\n print(len(lines))\n arr=np.a...
[ [ "numpy.reshape", "numpy.array" ] ]
tarrade/proj_DL_models_and_pipelines_with_GCP
[ "8c400b6bdc006f99f1412166824d68b64264abf2" ]
[ "src/model_mnists_skripts/keras_cnn_eager.py" ]
[ "# MNIST example from eager execution guide \n# https://www.tensorflow.org/guide/eager#train_a_model\nimport tensorflow as tf\nimport numpy as np\n\ntf.enable_eager_execution()\n\nBATCH = 32\n# Fetch and format the mnist data\n# (mnist_images, mnist_labels), _ = tf.keras.datasets.mnist.load_data()\ntry:\n raise ...
[ [ "tensorflow.enable_eager_execution", "tensorflow.keras.layers.GlobalAveragePooling2D", "tensorflow.losses.sparse_softmax_cross_entropy", "tensorflow.keras.layers.Dense", "tensorflow.cast", "tensorflow.keras.layers.Conv2D", "numpy.load", "tensorflow.keras.datasets.mnist.load_data", ...
patricebechard/SDGym
[ "827272b877661d65cc91dc055799c53682834c41" ]
[ "sdgym/synthesizers/sdv.py" ]
[ "import pandas as pd\nfrom sdv import tabular\n\nfrom sdgym.synthesizers.base import BaseSynthesizer\nfrom sdgym.synthesizers.utils import select_device\n\n\nclass SDVTabular(BaseSynthesizer):\n\n _MODEL = None\n _MODEL_KWARGS = None\n\n def fit(self, data, categorical_columns, ordinal_columns):\n d...
[ [ "pandas.DataFrame" ] ]
rayguan97/M3DETR
[ "cb76890a28c1555f2c0138030e0a432df6ee731b" ]
[ "pcdet/models/backbones_3d/pfe/voxel_set_abstraction.py" ]
[ "import math\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom ....ops.pointnet2.pointnet2_stack import pointnet2_modules as pointnet2_stack_modules\nfrom ....ops.pointnet2.pointnet2_stack import pointnet2_utils as pointnet2_stack_utils\nfrom ....utils import common_utils\nfrom ...backbones_2d.transf...
[ [ "torch.nn.BatchNorm1d", "torch.floor", "torch.max", "torch.cat", "torch.nn.ModuleList", "torch.nn.ReLU", "torch.tensor", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.nn.Identity", "torch.arange", "torch.topk", "torch.clamp", "torch.t", "torch.atan2" ...
maartenb/zipline-reloaded
[ "7cd7ef496dde7b5efe5423ae6c98181a67a99c15" ]
[ "tests/test_algorithm.py" ]
[ "#\n# Copyright 2018 Quantopian, 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...
[ [ "pandas.Series", "pandas.date_range", "numpy.isnan", "numpy.arange", "numpy.repeat", "numpy.cumsum", "pandas.DataFrame", "pandas.Timedelta", "numpy.testing.assert_array_equal", "numpy.concatenate", "numpy.full", "numpy.cumprod", "numpy.insert", "numpy.copysi...
Ricardozzf/pytorch-0.4-yolov3
[ "96a226a541158b640ad87781ca09c75baffe1956" ]
[ "yolo_layer.py" ]
[ "import math\nimport numpy as np\nimport sys\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom utils import bbox_iou, multi_bbox_ious, convert2cpu\n\nclass YoloLayer(nn.Module):\n def __init__(self, anchor_mask=[], num_classes=0, anchors=[1.0], num_anchors=1, use_cuda=None)...
[ [ "torch.nn.CrossEntropyLoss", "torch.linspace", "torch.ones", "torch.zeros", "torch.FloatTensor", "torch.cuda.is_available", "torch.device", "torch.nn.MSELoss" ] ]
bing-jian/probreg
[ "eee9839e4f9d7286128371f8d58444fe7fae589c" ]
[ "probreg/se3_op.py" ]
[ "from __future__ import print_function\nfrom __future__ import division\nimport numpy as np\nimport transformations as trans\nfrom . import _se3_op\n\n\ndef skew(x):\n \"\"\"\n skew-symmetric matrix, that represent\n cross products as matrix multiplications.\n\n Args:\n x (numpy.ndarray): 3D vect...
[ [ "numpy.square", "numpy.dot", "numpy.identity", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
actuy/tensor2tensor
[ "607463b0c594896e1841d64b2110e1aafc99d646" ]
[ "tensor2tensor/models/research/glow.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Tensor2Tensor 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 requir...
[ [ "numpy.log", "tensorflow.Print", "tensorflow.zeros", "tensorflow.cast", "tensorflow.floor", "tensorflow.zeros_like", "tensorflow.variable_scope", "tensorflow.add_to_collection" ] ]
rafiberlin/clp-sose21-pm-vision
[ "55c786182ed4568cdeda4bb3676fa02b9580d68d" ]
[ "avatar_sgg/captioning/catr/inference.py" ]
[ "import torch\nimport torch.nn.functional\n\nfrom transformers import BertTokenizer\nfrom PIL import Image\nfrom avatar_sgg.captioning.catr.hubconf import v3\nfrom avatar_sgg.captioning.catr.datasets import coco\nfrom avatar_sgg.captioning.catr.configuration import Config\nfrom avatar_sgg.config.util import get_con...
[ [ "torch.ones", "torch.floor", "torch.nn.functional.log_softmax", "torch.zeros", "torch.reshape", "torch.unsqueeze", "torch.no_grad", "torch.index_select", "torch.topk", "numpy.zeros", "numpy.where", "torch.argmax" ] ]
silentz/Free-Form-Image-Inpainting-With-Gated-Convolution
[ "75e1c5ea1950c9385651e353cb0562b9f1dbba6a" ]
[ "train/lightning.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset\nfrom torch.utils.data import DataLoader\n\nimport wandb\nfrom wandb.sdk.data_types import Image\nimport pytorch_lightning as pl\nfrom typing import Any, Dict, List\n\nfrom src.collate import collate_fn, Batch\nfrom src.models impo...
[ [ "torch.mean", "torch.cat", "torch.utils.data.DataLoader", "torch.nn.functional.relu", "torch.chunk" ] ]
VSAnimator/stgan
[ "afadc2356002092eed16d737a2ed0cb02dc94821" ]
[ "models/networks_branched.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport functools\nfrom torch.optim import lr_scheduler\n\n\n###############################################################################\n# Helper Functions\n###############################################################################\ndef get_n...
[ [ "torch.optim.lr_scheduler.LambdaLR", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.cat", "torch.nn.BCEWithLogitsLoss", "torch.cuda.is_available", "torch.nn.ReplicationPad2d", "torch.nn.Dropout", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.tensor", "torch.ran...
horinoA/startSpotify
[ "524de651f72d0e89be01d3792c070cc70a3a36d7" ]
[ "startSpotify.py" ]
[ "# CSVファイルを保存するpandasをpdという名前でインポートします\nimport pandas as pd\n# Spotify用のAPIを取り込みます\nimport spotipy\nfrom spotipy.oauth2 import SpotifyClientCredentials\n# token用のファイルspotifyAPI.pyを別で用意し、apiよいう名前でインポートします\n# これでtokenをとりあえずベタガキしないですみます\nimport spotifyAPI as api\n\n# apiからtokenはよびだします\nclient_id = api.client_id\nclien...
[ [ "pandas.DataFrame" ] ]
NVIDIA-AI-IOT/centernet_kinect
[ "92438e9f1469d1d8deffb33569068d2b635f99b6" ]
[ "model/utils.py" ]
[ "'''\nCopyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy...
[ [ "torch.nn.MSELoss", "torch.nn.functional.l1_loss", "torch.isnan", "torch.log", "torch.pow" ] ]
thomascbrs/quadruped-reactive-walking
[ "38553b3fd14dab3dd989a3488d4077df73cb2d26" ]
[ "scripts/MPC_Wrapper.py" ]
[ "# coding: utf8\n\nimport numpy as np\nimport libquadruped_reactive_walking as MPC\nfrom multiprocessing import Process, Value, Array\nfrom utils_mpc import quaternionToRPY\n# import crocoddyl_class.MPC_crocoddyl as MPC_crocoddyl\n\n\nclass Dummy:\n \"\"\"Dummy class to store variables\"\"\"\n\n def __init__(...
[ [ "numpy.sum", "numpy.array_equal", "numpy.reshape", "numpy.isnan", "numpy.cumsum", "numpy.int", "numpy.any", "numpy.ndenumerate", "numpy.array", "numpy.zeros", "numpy.roll" ] ]
KangSK-KAIST/SCALE-Sim
[ "349dd7b7053ea5bac482183597d2c403ad061560" ]
[ "version2/memory/double_buffered_scratchpad_mem.py" ]
[ "import time\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom scalesim.memory.read_buffer import read_buffer as rdbuf\nfrom scalesim.memory.read_port import read_port as rdport\nfrom scalesim.memory.write_buffer import write_buffer as wrbuf\nfrom scalesim.memory.write_port import write_port as wrport\n\n\nclass d...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.asarray", "numpy.savetxt" ] ]
bluesea0/nlp-tutorial
[ "9f17b18d3df9e79ea116d2c4c6ce0820a2dbe126" ]
[ "5-1.Transformer/Transformer-Torch.py" ]
[ "'''\n code by Tae Hwan Jung(Jeff Jung) @graykode, Derek Miller @dmmiller612\n Reference : https://github.com/jadore801120/attention-is-all-you-need-pytorch\n https://github.com/JayParks/transformer\n'''\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch...
[ [ "torch.nn.Softmax", "numpy.sqrt", "torch.nn.Embedding", "torch.FloatTensor", "torch.nn.CrossEntropyLoss", "torch.from_numpy", "numpy.sin", "matplotlib.pyplot.figure", "torch.LongTensor", "numpy.power", "torch.nn.Linear", "torch.nn.Conv1d", "matplotlib.pyplot.sho...
karlberggren/QuantumCircuitsClass
[ "ea0c7599c53a481ee854a0f8496cd91444311d16" ]
[ "web_app/bokeh_measurement_and_diffusion/utils/wavefunction.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec 16 17:34:28 2020\n\n@author: pmbpanther\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.integrate import quad, nquad\nfrom numpy.testing import assert_almost_equal\nfrom inspect import signature\n\nπ = np.pi\noo = ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.figaspect", "numpy.imag", "numpy.abs", "numpy.linspace", "matplotlib.pyplot.title", "matplotlib.testing.compare.compare_images", "matplotlib.pyplot.subplots", "matplotlib.pyplot.gcf", "numpy.testing.assert_almost_equal", "n...
omartrinidad/pattern-recognition-bit
[ "ba3eb4e541fff2b1aedbaa4420d7a8cea8100dc7" ]
[ "03/lloyd-algorithm.py" ]
[ "import numpy as np\n\nk = 3\nX = np.genfromtxt(\"data-clustering-1.csv\", dtype=float, delimiter=',')\nX = X.T\nmax_iter = 100\n\nn_examples = X.shape[0]\nn_features = X.shape[1]\nn_classes = k\n\n# Initialization\nt = 0\nu = np.random.rand(k, n_features)\nconverged = False\n\nindices = np.arange(n_examples)\n\n# ...
[ [ "numpy.array_equal", "numpy.arange", "numpy.linalg.norm", "numpy.genfromtxt", "numpy.argmin", "numpy.random.rand", "numpy.mean", "numpy.where" ] ]
wenleix/torcharrow-1
[ "9c398a361156973e29be868520ea9278db00ea52" ]
[ "torcharrow/test/test_numerical_column.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport statistics\nimport unittest\nfrom math import ceil, floor, log\n\nimport numpy as np\nimport numpy.testing\nimport torcharrow as ta\nimport torcharrow.dtypes as dt\nfrom torcharrow.icolumn import IColumn\nfrom torcharrow.inumerical_column import INumerical...
[ [ "numpy.int32", "numpy.int8", "numpy.int16", "numpy.int64", "numpy.float64", "numpy.float32", "numpy.array" ] ]
anonomity/MinMaxCheckers
[ "faadb081399387e38b061cd555c71eb9c02cd3d0" ]
[ "src/board.py" ]
[ "import numpy as np\nfrom pawn import pawn\nimport copy\nimport random\n\nclass board():\n\n\n def __init__(self):\n pos = 0\n col = pos % 8\n row = pos // 8\n reso = col % 2\n count = 1\n board = np.zeros([8, 8], dtype=int)\n posBoard = np.zeros([8, 8], dtype=int...
[ [ "numpy.zeros" ] ]
devran1/gradslam
[ "1e3d8610101a07551a1dc5a4d40170becc8be2d3" ]
[ "gradslam/datasets/tumutils.py" ]
[ "#!/usr/bin/python\n# Software License Agreement (BSD License)\n#\n# Copyright (c) 2013, Juergen Sturm, TUM\n# 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#\n# * Redistributions of s...
[ [ "numpy.dot", "numpy.sqrt", "numpy.isnan", "numpy.finfo", "numpy.outer", "numpy.array" ] ]
tjjlemaire/MorphoSONIC
[ "e1e302afe2e00642480dae8a5e869f0a16baa599" ]
[ "tests/test_mpi.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: Theo Lemaire\n# @Email: theo.lemaire@epfl.ch\n# @Date: 2021-06-16 11:36:32\n# @Last Modified by: Theo Lemaire\n# @Last Modified time: 2021-07-27 17:46:58\n\nimport logging\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom argparse import ArgumentParser\n\nfrom PySON...
[ [ "matplotlib.pyplot.show", "numpy.linspace" ] ]
Nikeshbajaj/MachineLearningFromScratch
[ "f025d3547bb7a605d62ed238536e6ae526ad55da" ]
[ "DeepLearning from scratch/example2.py" ]
[ "'''\nExample 2: Deep Neural Network from scrach\n\n@Author _ Nikesh Bajaj\nPhD Student at Queen Mary University of London &\nUniversity of Genova\nConact _ http://nikeshbajaj.in \nn[dot]bajaj@qmul.ac.uk\nbajaj[dot]nikkey@gmail.com\n'''\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom DeepNet import ...
[ [ "matplotlib.pyplot.ion", "numpy.sum", "matplotlib.pyplot.close" ] ]
jim22k/dask-grblas
[ "f0090b61b220db06fa6b54b3448297c0e9ce8ca9" ]
[ "dask_grblas/utils.py" ]
[ "import numpy as np\n\n\ndef np_dtype(dtype):\n return np.dtype(dtype.numba_type.name)\n\n\ndef get_meta(val):\n return getattr(val, \"_meta\", val)\n\n\ndef get_grblas_type(val):\n return _grblas_types[type(val)]\n\n\ndef get_inner_type(val):\n return _inner_types[type(val)]\n\n\ndef get_return_type(va...
[ [ "numpy.dtype" ] ]
stephaniemweber/pyblp
[ "3f8e0abb4f9473dd8d80468afed7b49c729dd6a2" ]
[ "pyblp/moments.py" ]
[ "\"\"\"Micro moments.\"\"\"\n\nimport abc\nimport collections\nimport functools\nfrom typing import Any, Callable, Dict, Hashable, List, Optional, Sequence, TYPE_CHECKING\n\nimport numpy as np\n\nfrom . import options\nfrom .utilities.basics import Array, StringRepresentation, format_number, format_table, output\n\...
[ [ "numpy.unique", "numpy.asarray", "numpy.argmax", "numpy.array", "numpy.zeros", "numpy.where" ] ]
efocht/tensorflow
[ "1e264cfc048d247c7f99d6eb663bdb219c97d36b" ]
[ "tensorflow/api_template_v1.__init__.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.framework.load_library.load_library", "tensorflow.python.tools.module_util.get_parent_dir", "tensorflow.python.lib.io.file_io.file_exists" ] ]
ZurichNLP/nematus-multisource
[ "6929149aa297625a92d52215bc0d6ed9bea48d50" ]
[ "nematus/theano_util.py" ]
[ "'''\nTheano utility functions\n'''\n\nimport sys\nimport json\nimport cPickle as pkl\nimport numpy\nfrom collections import OrderedDict\nimport logging\n\nimport theano\nimport theano.tensor as tensor\nfrom theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams\n\nfloatX = theano.config.floatX\nnumpy_flo...
[ [ "numpy.load", "numpy.savez", "numpy.zeros_like" ] ]
potating-potato/napari
[ "2ab705daf6a47561f409fb623093fe93d5b11c35" ]
[ "napari/components/_tests/test_viewer_model.py" ]
[ "import time\n\nimport numpy as np\nimport pytest\n\nfrom napari._tests.utils import (\n good_layer_data,\n layer_test_data,\n restore_settings_on_exit,\n)\nfrom napari.components import ViewerModel\nfrom napari.errors import MultipleReaderError, ReaderPluginError\nfrom napari.errors.reader_errors import (...
[ [ "numpy.testing.assert_equal", "numpy.random.random", "numpy.random.seed", "numpy.may_share_memory", "numpy.save", "numpy.all", "numpy.testing.assert_almost_equal", "numpy.max", "numpy.testing.assert_allclose", "numpy.zeros", "numpy.random.randint" ] ]
hpc0/simple-neural-network
[ "222b75d8dce3603941ea3d43b67643fa3d99d945" ]
[ "snn/__init__.py" ]
[ "#!/usr/bin/env python\r\n# coding: utf-8\r\nimport numpy as np\r\n\r\n# tasks\r\nREGRESSION = 0\r\nCLASSIFICATION = 1\r\n\r\n\r\n# activation functions\r\ndef sigmoid(x):\r\n return 1 / (1 + np.exp(-x))\r\n\r\n\r\ndef identity(x):\r\n return x\r\n\r\n\r\nclass Layer:\r\n def train(self, prev_z, task, targ...
[ [ "numpy.exp", "numpy.random.rand", "numpy.array", "numpy.sum" ] ]
jvdgoltz/launcher_trajectory
[ "a65a321ef6148a698fbe844e31a82fa719a3b83e" ]
[ "main.py" ]
[ "#this programm simulates the flight of multistage rocket from lift-off to orbit insertion\r\n#input parameters are:\r\n\t#the empty mass of the rocket\r\n\t#the fuel mass of the rocket\r\n\t#the engine expansion ratio, exit area, chamber pressure, propellant molecular mass\r\n\t#the mass flow of the rocket engine\...
[ [ "numpy.sqrt", "matplotlib.pyplot.title", "numpy.linspace", "numpy.meshgrid", "matplotlib.pyplot.subplot", "numpy.array", "matplotlib.pyplot.show", "numpy.divide", "matplotlib.pyplot.figure" ] ]
kpedro88/koza4ok
[ "32eaad4c7f352c53c4455e89123585607d4f4f74" ]
[ "examples/bdt_sklearn_to_tmva_AdaBoost.py" ]
[ "from sklearn.tree import DecisionTreeClassifier\nfrom sklearn.ensemble import AdaBoostClassifier\n\nfrom skTMVA import convert_bdt_sklearn_tmva\n\nimport cPickle\n\nimport numpy as np\nfrom numpy.random import RandomState\n\nRNG = RandomState(21)\n\n# Construct an example dataset for binary classification\nn_vars ...
[ [ "numpy.concatenate", "numpy.random.RandomState", "sklearn.ensemble.AdaBoostClassifier", "numpy.ones" ] ]
wadimiusz/hseling-repo-diachrony-webvectors
[ "5488d74141df360a6a721637ae7c7577136172d7" ]
[ "hseling_lib_diachrony_webvectors/hseling_lib_diachrony_webvectors/utils/utils.py" ]
[ "import os\nimport sys\nimport gensim\nimport numpy as np\nimport logging\nimport functools\n\n\ndef informative_output(words_and_scores, w2v1: gensim.models.KeyedVectors, w2v2: gensim.models.KeyedVectors,\n top_n_neighbors: int, model_name: str):\n print(model_name.center(40, '='))\n\n ...
[ [ "numpy.array" ] ]
pjvazquez/yolact_edge
[ "b5d246732ffc414d79d6986aa65a4ca0d81cfe1c" ]
[ "yolact.py" ]
[ "import torch, torchvision\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision.models.resnet import Bottleneck, conv1x1, conv3x3\nimport numpy as np\nfrom functools import partial\nfrom itertools import product, chain\nfrom math import sqrt\nfrom typing import List, Tuple, Optional\nfrom torch...
[ [ "torch.set_default_tensor_type", "torch.nn.functional.softmax", "torch.zeros", "torch.cat", "torch.load", "torch.sum", "torch.nn.functional.interpolate", "torch.nn.functional.smooth_l1_loss", "torch.ones", "torch.randn", "torch.tensor", "torch.nn.functional.relu", ...
ssayyah/cudf
[ "b5ffdf5ffb398adef25435bc696df3ff30c4aa9a" ]
[ "python/dask_cudf/dask_cudf/backends.py" ]
[ "# Copyright (c) 2020-2021, NVIDIA CORPORATION.\n\nimport cupy as cp\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\n\nfrom dask.dataframe.categorical import categorical_dtype_dispatch\nfrom dask.dataframe.core import get_parallel_type, meta_nonempty\nfrom dask.dataframe.methods import (\n concat...
[ [ "numpy.dtype", "numpy.arange", "numpy.array", "pandas.api.types.is_numeric_dtype" ] ]
masroorhasan/seldon-core
[ "674e00cd4b740ee21ac3de00ab145ebd6ebf8b9e" ]
[ "components/outlier-detection/isolation-forest/OutlierIsolationForest.py" ]
[ "import numpy as np\nimport pickle\nfrom sklearn.ensemble import IsolationForest\n\nfrom utils import flatten, performance, outlier_stats\n\nclass OutlierIsolationForest(object):\n \"\"\" Outlier detection using Isolation Forests.\n \n Arguments:\n - threshold (float): anomaly score threshold; score...
[ [ "numpy.asarray" ] ]
dmitryhits/charting
[ "c76f6bc047224ebfcce7e0965c4cd35905cb98f1" ]
[ "ts_charting/charting.py" ]
[ "import pandas as pd\nfrom pandas.util.decorators import Appender\n\nfrom ts_charting import Figure\nimport ts_charting.styles as cstyler\n\nCURRENT_FIGURE = None\n\ndef reset_figure(*args):\n \"\"\"\n In ipython notebook, clear the figure after each cell execute.\n This negates the need to specify a Figur...
[ [ "pandas.util.decorators.Appender" ] ]
irgroup/repro_eval
[ "35a4cf083dbb5f4b29d6ef602a604f0686a537c9" ]
[ "example/rpd_arp.py" ]
[ "import pytrec_eval\nfrom repro_eval.Evaluator import RpdEvaluator\nfrom repro_eval.util import arp, arp_scores\nfrom repro_eval.util import trim\nimport pandas as pd\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nsns.set()\nsns.set_style('whitegrid')\n# palette = sns.color_palette(\"GnBu_d\")\n# sns...
[ [ "matplotlib.pyplot.show", "pandas.DataFrame" ] ]