repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
bigheiniu/BigData-MDA-WS
[ "c93c32f1f36412e825d32f4d560ee3399a6f902c", "c93c32f1f36412e825d32f4d560ee3399a6f902c" ]
[ "Models/TextTrainer.py", "Models/Trainer.py" ]
[ "import pytorch_lightning as pl\nfrom transformers import RobertaTokenizer, RobertaModel, RobertaConfig\nimport torch\nimport torch.nn as nn\nfrom Models.CNNModel import CNN_Text\nimport pandas as pd\nfrom Util import data_split, evaluation\nimport numpy as np\nfrom Dataset import TextDataset, CommenetDataset\nfro...
[ [ "numpy.concatenate", "torch.stack", "torch.utils.data.DataLoader", "torch.softmax" ], [ "numpy.concatenate", "torch.stack", "torch.utils.data.DataLoader", "torch.softmax" ] ]
nicofirst1/ray
[ "ddd4c42fe5aaf0d2b494b4a23bf8f4f12e62561f" ]
[ "rllib/policy/dynamic_tf_policy.py" ]
[ "\"\"\"Graph mode TF policy built using build_tf_policy().\"\"\"\n\nfrom collections import OrderedDict\nimport logging\nimport numpy as np\n\nfrom ray.rllib.policy.policy import Policy\nfrom ray.rllib.policy.sample_batch import SampleBatch\nfrom ray.rllib.policy.tf_policy import TFPolicy\nfrom ray.rllib.models.cat...
[ [ "numpy.expand_dims", "numpy.array", "numpy.zeros" ] ]
AnuragSinghChaudhary/demo
[ "4425b7ae6f48a2ff92892bf36f54c51a4b8f8423" ]
[ "extracts/plot_maps_for_paper.py" ]
[ "import os\n\nimport numpy\nimport matplotlib as mpl\nprint(\"current backend is %s\" % mpl.get_backend())\nmpl.use('TkAgg')\n\nfrom mpl_toolkits.basemap import Basemap\nimport matplotlib.pyplot as plt\n\nfrom create_multiple_extracts import ALL_CITIES\nfrom extract_pipeline import ExtractPipeline\nfrom gtfspy.gtfs...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.show", "matplotlib.get_backend" ] ]
shnela/pytorch-lightning
[ "583fcf281c69e9d2fea76d19eb5574f03c7ba8ee" ]
[ "pytorch_lightning/utilities/__init__.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "numpy.finfo" ] ]
seandiacono/Nav-AI
[ "8e49914f3af5ed3dcd3f43725f355347b4894f56" ]
[ "src/nav_ai.py" ]
[ "from __future__ import print_function\nimport sys\nsys.path.insert(\n 1, 'C:/Users/seand/OneDrive/Documents/University/Autonomous Drone Navigation/Implementation/AirSimAPI')\nimport time\nimport numpy as np\nimport cv2\nfrom tensorflow import keras\nimport tensorflow as tf\nfrom numpy.lib.function_base import a...
[ [ "numpy.average", "tensorflow.keras.models.load_model", "numpy.amax" ] ]
jmfrank63/Historic_Crypto
[ "d99190e8b35b30b21a4e15bb76f4911567c7e566" ]
[ "HistoricalData.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\nimport requests\r\nimport json\r\nimport time\r\nfrom random import randint\r\nimport pandas as pd\r\nimport sys\r\nfrom datetime import datetime, timedelta\r\n\r\n\r\nclass HistoricalData(object):\r\n \"\"\"\r\n This class provides methods for gathering historical price data o...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
hankin1127/Image_manipulation_detection
[ "fdad7abf091ab5df44253523de3c5d696e136947" ]
[ "lib/setup.py" ]
[ "from __future__ import print_function\n# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\nimport os\nfrom os.p...
[ [ "numpy.get_numpy_include", "numpy.get_include" ] ]
michael-conrad/neuspell
[ "f1d1a8b4efa7c6aa6e0564ea17db152905f4c7dc" ]
[ "neuspell/seq_modeling/models.py" ]
[ "# pip install allennlp\n# pip install torch\n\n\n# from tqdm import tqdm, tqdm_notebook\n# import os, sys\n# import numpy as np\n# import re\n# import time\n# from typing import List\n\nimport torch\nimport torch.nn.functional as F\nimport transformers\nfrom torch import nn\nfrom torch.nn.utils.rnn import pack_pad...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LSTM", "torch.nn.ModuleList", "torch.LongTensor", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.CrossEntropyLoss", "torch.sum", "torch.topk", "torch.unsqueeze", "torch.tensor", "torch.div", "torch.max", "torch...
eng-tools/liquepy
[ "b1e42e27733044cb2ca18fba97aa7c819645fa31" ]
[ "liquepy/num/models.py" ]
[ "from collections import OrderedDict\nimport sfsimodels as sm\nimport numpy as np\nfrom sfsimodels.functions import clean_float\nfrom sfsimodels.build_model_descriptions import build_parameter_descriptions\nfrom liquepy.exceptions import deprecation\n\n\nclass PM4Sand(sm.StressDependentSoil):\n _h_po = None\n ...
[ [ "numpy.sin", "numpy.log", "numpy.arcsin", "numpy.exp", "numpy.degrees", "numpy.radians", "numpy.clip" ] ]
andrawaag/WRP
[ "df58b060b21df23c4fdc09ca7f2dc7ff63602049" ]
[ "src/archive/WRP.py" ]
[ "# Run in terminal with command 'python3 WRP.py' *in src folder *use venv as needed\n## Make sure you've first run \"pip install -r 00_requirements.txt\"\n\n# Table of Contents\n## Packages: Line 9\n## Nodes: Line 28\n## Edges: Line 174\n\n# Relevant Packages\nimport pandas as pd\n\nimport time \nfrom datetime impo...
[ [ "pandas.concat" ] ]
salayhin/talkofacta
[ "8b5a14245dd467bb1fda75423074c4840bd69fb7", "8b5a14245dd467bb1fda75423074c4840bd69fb7" ]
[ "buildout_env/lib/python2.7/site-packages/scipy/sparse/coo.py", "buildout_env/lib/python2.7/site-packages/scipy/odr/odrpack.py" ]
[ "\"\"\" A sparse matrix in COOrdinate or 'triplet' format\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\n__docformat__ = \"restructuredtext en\"\n\n__all__ = ['coo_matrix', 'isspmatrix_coo']\n\nfrom warnings import warn\n\nimport numpy as np\n\nfrom scipy._lib.six import xrange, zip as i...
[ [ "numpy.concatenate", "numpy.logical_or", "numpy.add.reduceat", "numpy.array", "numpy.empty", "numpy.asarray", "numpy.zeros", "numpy.lexsort", "numpy.max", "numpy.nonzero", "scipy._lib.six.zip", "numpy.arange", "numpy.append", "scipy._lib.six.xrange", "nu...
kasyoukin/Paddle-Lite
[ "1de171ecd7de60ea2ad7f507644349389057cdc4" ]
[ "lite/tests/unittest_py/op/common/test_sequence_pad_op_base.py" ]
[ "# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.random.random", "numpy.array", "numpy.random.randint", "numpy.sort" ] ]
icarofua/vehicle-ReId
[ "09517109fdc6aec0de6702dc290c4828ae424e12" ]
[ "siamese_three_stream.py" ]
[ "import string\nimport pandas as pd\nfrom keras.optimizers import Adam\nfrom keras.utils import np_utils\nimport numpy as np\nfrom config import *\nimport json\nfrom keras import backend as K\nfrom keras.layers import Dense, Dropout\nfrom keras.models import Model, load_model\nfrom sys import argv\nfrom custom_laye...
[ [ "numpy.array", "pandas.read_csv", "numpy.argmax" ] ]
joaogui1/swift-apis
[ "6f5cccd3083181eb1aac71b6845bd48efbe27b55" ]
[ "Sources/TensorFlow/Bindings/generate_wrappers.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v1.gfile.Open", "tensorflow.python.framework.c_api_util.ApiDefMap", "tensorflow.compat.v1.gfile.Exists", "tensorflow.compat.v1.app.run" ] ]
tomdbar/dynamical-disentanglement
[ "0f8556e3b53eedb6d295fadd0ffbaf5b4b386ae1" ]
[ "src/environments.py" ]
[ "from abc import ABC, abstractmethod\nfrom collections.abc import Iterable\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\n\nfrom src.representations import Representation\n\n\nclass BaseWorld(ABC):\n '''Base class for constructing environments.'''\n\n class action_space():\n def ...
[ [ "torch.zeros", "numpy.array", "numpy.ones_like", "torch.stack", "torch.norm", "matplotlib.pyplot.figure", "torch.from_numpy", "torch.randint", "matplotlib.pyplot.gca", "torch.matmul", "matplotlib.pyplot.imshow" ] ]
vishalbelsare/mlaut
[ "a3bd4b2591c3144d100f413f6c4c2231392103e5" ]
[ "mlaut/benchmarking/evaluation.py" ]
[ "__author__ = [\"Viktor Kazakov\", \"Markus Löning\", \"Aaron Bostrom\"]\n__all__ = [\"Evaluator\"]\n\nimport itertools\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport scikit_posthocs as sp\nfrom scipy import stats\nfrom scipy.stats import ranksums\nfrom scipy.stats import ttest_...
[ [ "matplotlib.pyplot.text", "numpy.tile", "numpy.min", "numpy.mean", "numpy.sort", "numpy.size", "numpy.max", "pandas.DataFrame", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.tight_layout", "scipy.stats.ranksums", "numpy.append", "numpy.sqr...
tt6746690/code_snippets
[ "0200f8036fb0fab8a917afae2554ddb6cf507a4e" ]
[ "src/rosemary/plt.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\n\n__all__ = [\n 'plt_kernel_matrix_one',\n 'plt_scaled_colobar_ax',\n 'plt_savefig',\n 'plt_slices',\n]\n\n\ndef plt_kernel_matrix_one(fig, ax, K, title=None, n_ticks=5,\n custom_ticks=True, vmin=None, vmax=None, annotate=F...
[ [ "numpy.array" ] ]
beric7/material_segmentation
[ "bb612a6fd383ec9a9e3183140f22ecbf8c00d858" ]
[ "Pre-processing/image_utils.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nSpyder Editor\n\nThis is a temporary script file.\n\n@Author Eric Bianchi\n\"\"\"\nimport os\nimport shutil\nimport cv2\nimport numpy as np\nfrom PIL import Image\nimport random\nfrom numpy import save\nfrom tqdm import tqdm\n\ndef buildImageFileList(BASE, TEST_IMAGES_DIR, sort_ID_...
[ [ "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.load", "numpy.save" ] ]
chenmingwei00/SQuAD
[ "246d1cb6eef9c397766a755ff19910daff1fc13c" ]
[ "prepro.py" ]
[ "import tensorflow as tf\nimport random\nfrom tqdm import tqdm\nimport spacy\nimport ujson as json\nfrom collections import Counter\nimport numpy as np\nimport os.path\nimport struct\nnlp = spacy.blank(\"en\")\n\n\ndef word_tokenize(sent):\n doc = nlp(sent)\n return [token.text for token in doc]\n\n\ndef conv...
[ [ "numpy.random.normal", "tensorflow.python_io.TFRecordWriter", "numpy.zeros" ] ]
ConorMacBride/mcalf
[ "aa72ef4ac1470c81ee618c25194cf170e11091e1" ]
[ "examples/gallery/visualisation/plot_bar.py" ]
[ "\"\"\"\nPlot a bar chart of classifications\n===================================\nThis is an example showing how to produce a bar chart showing the percentage\nabundance of each classification in a 2D or 3D array of classifications.\n\"\"\"\n\n#%%\n# First we shall create a random 3D grid of classifications that c...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
cheng052/H3DNet
[ "872dabb37d8c2ca3581cf4e242014e6464debe57" ]
[ "sunrgbd/model_util_sunrgbd.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# \n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport numpy as np\nimport sys\nimport os\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(BASE_DIR)\nROOT_D...
[ [ "numpy.array", "numpy.zeros" ] ]
ishine/aps
[ "c814dc5a8b0bff5efa7e1ecc23c6180e76b8e26c" ]
[ "aps/task/sse.py" ]
[ "#!/usr/bin/env python\n\n# Copyright 2020 Jian Wu\n# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\"\"\"\nFor Speech Separation and Enhancement task, using sse.py for abbreviation\n\"\"\"\nimport torch as th\nimport torch.nn as nn\nimport torch.nn.functional as tf\n\nfrom typing import Dict, T...
[ [ "torch.cos", "torch.sqrt", "torch.stack", "torch.min", "torch.nn.Parameter", "torch.nn.functional.mse_loss", "torch.nn.functional.conv1d", "torch.clamp_min", "torch.log", "torch.mean", "torch.sum" ] ]
MasterXin2020/DL-based-Intelligent-Diagnosis-Benchmark
[ "dd49b077984d15802681a9be723937342d6b59e3" ]
[ "AE_Datasets/R_A/datasets/PUFFT.py" ]
[ "import os\r\nimport numpy as np \r\nimport pandas as pd\r\nfrom scipy.io import loadmat\r\nfrom sklearn.model_selection import train_test_split\r\nfrom datasets.SequenceDatasets import dataset\r\nfrom datasets.sequence_aug import *\r\nfrom tqdm import tqdm\r\n\r\n#Digital data was collected at 40,000 samples per s...
[ [ "pandas.DataFrame", "scipy.io.loadmat", "numpy.fft.fft", "numpy.abs", "sklearn.model_selection.train_test_split" ] ]
HLTCHKUST/sentiment-lookahead
[ "1c076b7c5c31b0f7c454720377db4e733838ebb2" ]
[ "train_rl.py" ]
[ "import os\nimport math\nimport random\nimport operator\nimport traceback\nfrom functools import reduce\n\nimport numpy as np\nfrom tqdm import tqdm\nfrom sklearn.metrics import f1_score\nfrom nltk.util import everygrams\nfrom scipy.stats import pearsonr\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.funct...
[ [ "numpy.concatenate", "numpy.array", "torch.nn.MSELoss", "torch.no_grad", "numpy.mean", "scipy.stats.pearsonr", "torch.cuda.empty_cache", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.nn.BCEWithLogitsLoss", "numpy.argsort", "torch.mean", "sklearn.metrics.f1_sc...
CharlesW95/senior_project
[ "d7bfe89c640b892f4c2f156a881c19cb5405b8ae" ]
[ "train_crop_cos.py" ]
[ "#!/usr/bin/env python\nfrom math import ceil, floor\nfrom random import uniform\nimport argparse\nimport os\n\nimport tensorflow as tf\n\nfrom adain.nn import build_vgg, vgg_layer_params, build_decoder\nfrom adain.norm import adain\nfrom adain.util import get_params\nfrom adain.weights import open_weights\nfrom ed...
[ [ "tensorflow.train.start_queue_runners", "tensorflow.nn.moments", "tensorflow.reshape", "tensorflow.sqrt", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initializer", "tensorflow.image.rgb_to_grayscale", "tensorflow.cast", "tensorflow.train.GradientDesce...
ingmarschuster/flax
[ "88464610af7bb80b063f7c9e86e8cb859e869e9f" ]
[ "examples/mnist/mnist_benchmark.py" ]
[ "# Copyright 2021 The Flax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or a...
[ [ "numpy.array", "numpy.mean" ] ]
andro2157/tick
[ "d22d0e70c8bb2d5b232ffa7b97426010c2328edc" ]
[ "examples/plot_hawkes_em.py" ]
[ "\"\"\"\n=========================\nFit Hawkes random kernels\n=========================\n\nThis Hawkes EM (`tick.inference.HawkesEM`) algorithm assume that kernels are\npiecewise constant. Hence it can fit basically any kernel form. However it\ndoesn't scale very well.\n\nIt has been originally described in this p...
[ [ "matplotlib.pyplot.show", "numpy.array", "numpy.sin", "numpy.linspace" ] ]
G0ssamer/HCAP2021
[ "bf30bd72e06537cdb901d316f1716c77647eee17" ]
[ "convolucion.py" ]
[ "import numpy as np\nimport cv2\n\ndef convolucion(Ioriginal,Kernel):\n fr = len(Ioriginal)-(len(Kernel)-1)\n cr = len(Ioriginal[0])-(len(Kernel[0])-1)\n Resultado = np.zeros((fr,cr),np.uint8)\n\n #For para recorrer filas \n for i in range(len(Resultado)):\n\n #For para recorrer columnas\n ...
[ [ "numpy.array", "numpy.zeros" ] ]
Farzin-Negahbani/stereo-frustum-pointnets
[ "3f5dbeb0fb1290775ce077d68efa52c877de4082" ]
[ "train/train.py" ]
[ "''' Training Frustum PointNets.\n\nAuthor: Charles R. Qi\nDate: September 2017\n'''\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport argparse\nimport importlib\nimport numpy as np\nimport tensorflow as tf\nfrom datetime import datetime\nBASE_DIR = os.path.dirname(os.path.abspath(__file__)...
[ [ "tensorflow.constant_initializer", "tensorflow.global_variables_initializer", "tensorflow.cast", "tensorflow.argmax", "tensorflow.train.Saver", "tensorflow.add_n", "tensorflow.ConfigProto", "numpy.argmax", "tensorflow.get_collection", "numpy.array", "tensorflow.minimum"...
thomcom/geopandas
[ "1e975abc597d43d80d8ea7e3197facadc71e0ff0" ]
[ "geopandas/tools/geocoding.py" ]
[ "from collections import defaultdict\nimport time\n\nimport pandas as pd\n\nfrom shapely.geometry import Point\n\nimport geopandas\n\n\ndef _get_throttle_time(provider):\n \"\"\"\n Amount of time to wait between requests to a geocoding API, for providers\n that specify rate limits in their terms of service...
[ [ "pandas.Series" ] ]
jurlaub/jubilant-fedora
[ "829432ff4fb8b3972ad5a1a152ecf6f1f7e94f9b" ]
[ "pipeline.py" ]
[ "#!/usr/bin/env python\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport cv2\nimport copy\nfrom moviepy.editor import VideoFileClip\n\nfrom utils import obtainCalibrationPointsFromFile\nfrom utils import save_frame, load_frame\nfrom utils import threshold_hls\nfrom line import Line\n\n\nclass Pipeline(ob...
[ [ "numpy.concatenate", "numpy.int_", "numpy.zeros_like", "numpy.int", "numpy.array", "numpy.max", "numpy.sum", "numpy.copy", "numpy.mean", "numpy.float32", "numpy.argmax", "numpy.absolute", "numpy.hstack", "numpy.linspace", "numpy.vstack" ] ]
JamesHaverstick/SpectraFrame
[ "5bb29a34d6ca09104e236ad013ce9ac38b995677" ]
[ "spectraframe/spectradataframe/spectradataframe.py" ]
[ "\"\"\"\nDefine SpectraDataFrame class\n\"\"\"\nimport pandas as pd\nimport numpy as np\nfrom scipy import integrate\nfrom typing import Union\nfrom ._dataframe_functions import normalize_to_range, bound_errors\n\n\nclass SpectraDataFrame:\n def __init__(self,\n data: Union[pd.DataFrame, dict],\n...
[ [ "numpy.array", "pandas.DataFrame", "numpy.min", "numpy.mean", "scipy.integrate.cumtrapz" ] ]
Lizhengo/models
[ "ab5a16f297389f87f9d20adcfdd36a1ccce887d0" ]
[ "dygraph/mnist/train.py" ]
[ "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.random.seed", "numpy.array" ] ]
LuggiStruggi/MADDPG
[ "20cbef7cf531f7573fa9cdf8742733becef1f827" ]
[ "src/plot.py" ]
[ "import os\nimport argparse\nimport numpy as np\nimport seaborn\nimport pandas\nimport matplotlib.pyplot as plt\n\n\ndef test_plot(run_folder):\n\tpass\n\n\ndef make_plots(run_folder):\n\t\n\tseaborn.set(rc={'figure.figsize':(11.7,8.27)})\n\n\tcsv = pandas.read_csv(os.path.join(run_folder, \"losses.csv\"))\n\tline1...
[ [ "matplotlib.pyplot.clf", "matplotlib.pyplot.twiny" ] ]
ntpythondev/testpypi2019
[ "e9b767d4353e09861a6f7408613bb18bdbd4df04" ]
[ "json2oraparser/MetadataController/MetadataList.py" ]
[ "import pandas as pd\nimport os\n\nclass MetadataList:\n\n def __init__(self):\n print(\"Metadata List Generation from CSV is getting started\" + '\\n')\n\n\n def fn_getPath(self, strParent, list):\n \n \"\"\" This routine is intended to determine the path object in run time.\n and...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
hcancakici/action-recognition
[ "30a17defb316157b1be9c35eddbb819da29dd84c" ]
[ "src/test.py" ]
[ "'''\nUSAGE:\npython test.py --model ../outputs/sports.pth --label-bin ../outputs/lb.pkl --input ../input/example_clips/chess.mp4 --output ../outputs/chess.mp4\n'''\nimport argparse\nimport time\n\nimport albumentations\nimport cv2\nimport joblib\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torc...
[ [ "numpy.array", "torch.max", "torch.no_grad", "torch.tensor", "numpy.transpose", "torch.load" ] ]
mlatcl/fbp-vs-soa
[ "4f007c5b5c75f51e51f6a8d59ce0c0c610617f14" ]
[ "playlist_builder/soa_app_ml/flaskr/movie.py" ]
[ "from flask import (Blueprint, request, make_response, jsonify)\nimport numpy as np\n\nfrom .data import movie\n\nbp = Blueprint('movie', __name__, url_prefix='/movie')\n\n@bp.route('/add', methods=['POST'])\ndef add_movie():\n res = {}\n affected = 0\n req = request.get_json()\n affected = movie.create...
[ [ "numpy.quantile", "numpy.array" ] ]
twni2016/Prostate-Image-Segmentation
[ "d68e61f3910477c6a635aa8e0f4b35304798586e" ]
[ "crf.py" ]
[ "# Baseline Code\nimport numpy as np\nfrom scipy.misc import imresize\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torchvision import datasets\nfrom torchvision import transforms\nimport torchvision as tv\n\nimport ...
[ [ "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal", "torch.cuda.is_available", "torch.nn.DataParallel", "numpy.concatenate", "torch.mul", "numpy.log", "torch.autograd.Variable", "torch.nn.ConvTranspose2d", "torch.utils.data.DataLoader", "numpy.array", "torch.max...
AndreasMadsen/course-02456-sparsemax
[ "629f7bb9576b79783655a49c3f46bbcc7f970df7" ]
[ "python_reference/sparsemax.py" ]
[ "import numpy as np\n\n\ndef forward(z):\n \"\"\"forward pass for sparsemax\n\n this will process a 2d-array $z$, where axis 1 (each row) is assumed to be\n the the z-vector.\n \"\"\"\n\n # sort z\n z_sorted = np.sort(z, axis=1)[:, ::-1]\n\n # calculate k(z)\n z_cumsum = np.cumsum(z_sorted, ...
[ [ "numpy.sum", "numpy.arange", "numpy.sort", "numpy.argmax", "numpy.cumsum", "numpy.maximum" ] ]
amyvdham/veni_sysrev
[ "e8e4e88e4c8d451f941a9f268dcca0d8694dd815" ]
[ "amy/try_outs/create_w2v_embedding.py" ]
[ "import pandas as pd\nimport numpy as np\nimport csv\nfrom gensim.models import KeyedVectors\nimport itertools\n\n# load data frame than inludes the words we want the vectors of. \ndata = pd.read_csv(\"/Users/amyvanderham/Documents/Research_Assistant_Rgit/veni_sysrev/amy/try_outs/final_filter.csv\")\n\n\n# create a...
[ [ "numpy.array", "pandas.read_csv" ] ]
nwu63/pygeo
[ "9eff5c04b999c8e8f7e99c80b6850868a87415c3" ]
[ "pygeo/geo_utils/file_io.py" ]
[ "import numpy as np\n\n# --------------------------------------------------------------\n# I/O Functions\n# --------------------------------------------------------------\n\n\ndef readNValues(handle, N, dtype, binary=False, sep=\" \"):\n \"\"\"Read N values of dtype 'float' or 'int' from file hand...
[ [ "numpy.array", "numpy.zeros", "numpy.where", "numpy.fromfile", "numpy.outer", "numpy.linspace" ] ]
inkyusa/models
[ "204c689b5b582578b5477c61f4111036bfa1859f" ]
[ "research/delf/delf/python/examples/extract_features.py" ]
[ "# Copyright 2017 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 requi...
[ [ "tensorflow.io.decode_jpeg", "tensorflow.io.gfile.GFile", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.logging.info", "tensorflow.compat.v1.WholeFileReader", "tensorflow.train.Coordinator", "tensorflow.Graph", "tensorflow.python.platform.app.run", ...
swkang73/ppp
[ "d54f21a9e43e7522a8aa5432310dd466a1ee5d9c" ]
[ "baseline_gcn.py" ]
[ "import argparse\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\nfrom torch_geometric.utils import negative_sampling\n\nimport torch_geometric.transforms as T\nfrom torch_geometric.nn import GCNConv, SAGEConv\n\nfrom ogb.linkproppred import PygLinkPropPredDataset, Evaluato...
[ [ "torch.nn.Linear", "torch.device", "torch.cat", "torch.sigmoid", "torch.stack", "torch.nn.ModuleList", "torch.nn.utils.clip_grad_norm_", "torch.no_grad", "torch.nn.functional.dropout", "torch.nn.init.xavier_uniform_", "torch.manual_seed", "torch.nn.functional.relu",...
japonophile/Education4Climate
[ "7502af540d597ed4f47724df7adb6bc34a95d8ba" ]
[ "src/score/courses.py" ]
[ "# -*- coding: utf-8 -*-\nfrom pathlib import Path\nimport argparse\nfrom typing import List, Dict\n\nimport json\nimport pandas as pd\nfrom ast import literal_eval\nfrom unidecode import unidecode\n\nimport langdetect\nfrom langdetect import DetectorFactory\nimport re\n\nfrom settings import CRAWLING_OUTPUT_FOLDER...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
vedsgit/pyEX
[ "5115c0221c2cd9f6edde267ba7c02801c8bfb736" ]
[ "pyEX/stocks/profiles.py" ]
[ "# -*- coding: utf-8 -*-\nimport requests\nimport pandas as pd\nfrom functools import wraps\nfrom IPython.display import Image as ImageI\nfrom io import BytesIO\nfrom PIL import Image as ImageP\nfrom ..common import _expire, _getJson, _raiseIfNotStr, _reindex, _toDatetime, _UTC\n\n\n@_expire(hour=4, tz=_UTC)\ndef c...
[ [ "pandas.DataFrame", "pandas.io.json.json_normalize" ] ]
akarmi/model-optimization
[ "2d3faaa361ecb3639f4a29da56e0e6ed52336318" ]
[ "tensorflow_model_optimization/python/core/quantization/keras/graph_transformations/model_transformer_test.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.keras.Model", "tensorflow.python.keras.layers.serialize", "tensorflow.python.keras.layers.Input", "tensorflow.python.keras.layers.Dense", "tensorflow.python.keras.layers.ReLU", "tensorflow.python.platform.test.main" ] ]
Adi-Jayakumar/pyIGRF
[ "5017fb709ccc902f6db81e21cb7c00c971001724" ]
[ "test/igrf12syn_old.py" ]
[ "import numpy as np\n\nfrom goto import with_goto\n\nfrom pyIGRF.loadCoeffs import gh\n\n\n@with_goto\ndef igrf12syn_old(isv, date, itype, alt, colat, elong):\n \"\"\"\n This is a synthesis routine for the 12th generation IGRF as agreed\n in December 2014 by IAGA Working Group V-MOD. It is valid 1900.0 t...
[ [ "numpy.sin", "numpy.sqrt", "numpy.cos" ] ]
nyartsgnaw/CryptoPrices_Scraper
[ "af896b9fdf5abc027daa73a7eb347fb41c6f591d" ]
[ "lib/get_features.py" ]
[ "import pandas as pd\nimport datetime\nimport re\nimport time\npd.options.mode.chained_assignment = None # default='warn'\nfrom utils.utils import time_it,read_price_csv\nimport os\nimport sys\ntry:\n\tCWDIR = os.path.abspath(os.path.dirname(__file__))\nexcept:\n\tCWDIR = os.getcwd()\nsys.path.append('{}/utils'.fo...
[ [ "pandas.DataFrame" ] ]
dylan-plummer/scHiCTools
[ "8e6051add2bb20f8a4011bc332517ddec77fbb16" ]
[ "scHiCTools/load/cool.py" ]
[ "# -*- coding: utf-8 -*-\n# Adapted from https://github.com/mirnylab/cooler\nfrom .cooler_api import Cooler, parse_region, region_to_extent, annotate\nimport numpy as np\nimport pandas as pd\nimport sys\n\n\ndef _comes_before(a0, a1, b0, b1, strict=False):\n if a0 < b0:\n return a1 <= b0 if strict else a1...
[ [ "numpy.concatenate", "numpy.array", "numpy.ceil", "numpy.asarray", "pandas.DataFrame", "numpy.diff", "numpy.arange", "pandas.concat", "numpy.searchsorted" ] ]
sorrowise/polyomino-solver
[ "4ae3c45a60c6d597c94254a3cba48f2966f9ce39" ]
[ "board.py" ]
[ "import xlwings as xw\r\nimport numpy as np\r\nfrom helpers import get_solutions, exact_cover_matrix\r\nfrom solver import solve\r\nfrom models import Board, Solution\r\nfrom constants import PENT_BASES, SGIQ_BASES\r\n\r\n\r\n@xw.sub\r\ndef pent512_solver():\r\n wb = xw.Book.caller()\r\n sheet = wb.sheets[\"P...
[ [ "numpy.vectorize" ] ]
nhatanh81096/Lung-Segmentation
[ "2af9d028760814d1d70d0539377ddff0a83a242f" ]
[ "HybridNet/src/callbacks.py" ]
[ "import numpy as np\nfrom keras.callbacks import Callback\nfrom sklearn.metrics import confusion_matrix\n\n\nclass Metrics(Callback):\n def on_train_begin(self, logs={}):\n self.val_f1s = []\n self.val_recalls = []\n self.val_precisions = []\n\n def on_epoch_end(self, epoch, logs={}):\n ...
[ [ "sklearn.metrics.confusion_matrix", "numpy.diag", "numpy.fliplr" ] ]
greentea1079/MERlin
[ "3aa784fb28a2a4ebae92cfaf3a72f30a459daab9" ]
[ "test/test_codebook.py" ]
[ "import numpy as np\nimport pytest\n\nfrom merlin.core import dataset\n\n\ndef test_codebook_get_barcode_count(simple_merfish_data):\n assert simple_merfish_data.get_codebook().get_barcode_count() == 140\n\n\ndef test_codebook_get_bit_count(simple_merfish_data):\n assert simple_merfish_data.get_codebook().get...
[ [ "numpy.sum", "numpy.arange" ] ]
AlexisRalli/VQE-code
[ "4112d2bba4c327360e95dfd7cb6120b2ce67bf29" ]
[ "Projects/CS_VQE/myriad_parallel_jobs_FULL_H.py" ]
[ "import numpy as np\nimport scipy as sp\n\nimport cs_vqe as c\nimport ast\nimport os\nfrom tqdm import tqdm\nfrom copy import deepcopy\n\nimport cs_vqe_with_LCU as c_LCU\nimport quchem.Misc_functions.conversion_scripts as conv_scr \nfrom openfermion import qubit_operator_sparse\n\nimport pickle\nimport datetime\n\n...
[ [ "scipy.sparse.linalg.eigsh" ] ]
econcarol/ISLR
[ "497b65efdab5291111b8d8472606ea4bc40bba30" ]
[ "Ch09.py" ]
[ "# ISLR Ch 9 by Carol Cui\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nimport seaborn as sns\nfrom mlxtend.plotting import plot_decision_regions\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.model_sel...
[ [ "numpy.random.rand", "numpy.median", "pandas.concat", "pandas.read_csv", "matplotlib.pyplot.bar", "matplotlib.pyplot.xticks", "pandas.DataFrame", "matplotlib.pyplot.subplots", "sklearn.svm.SVC", "numpy.arange", "sklearn.decomposition.PCA", "matplotlib.pyplot.subplot...
FaisalAhmed0/stable-baselines3
[ "6541983e909b8de87511af48706391e94fd749c2" ]
[ "stable_baselines3/common/off_policy_algorithm.py" ]
[ "import io\nimport pathlib\nimport time\nimport warnings\nfrom copy import deepcopy\nfrom typing import Any, Dict, List, Optional, Tuple, Type, Union\n\nimport gym\nimport numpy as np\nimport torch as th\n\nfrom stable_baselines3.common.base_class import BaseAlgorithm\nfrom stable_baselines3.common.buffers import D...
[ [ "numpy.zeros_like" ] ]
AlfandaryAviv/Transitions
[ "86333fec41f43727e256f94be173a24f6e93c779" ]
[ "GCN_II/GCN_temporal_communities_main.py" ]
[ "import time\r\nfrom itertools import product\r\nfrom loggers import CSVLogger, PrintLogger, FileLogger, multi_logger\r\nimport torch\r\nfrom torch.optim import Adam\r\nimport os\r\nimport networkx as nx\r\nimport pickle\r\nimport numpy as np\r\nimport logging\r\nfrom model_runner import ModelRunner,execute_runners...
[ [ "torch.device", "torch.cuda.is_available", "numpy.arange", "torch.tensor" ] ]
cll27/pyro
[ "8279d69225ecc8ff07ba65aa2a9101720c926e86" ]
[ "pyro/ops/contract.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport itertools\nfrom abc import ABCMeta, abstractmethod\nfrom collections import OrderedDict, defaultdict\n\nimport opt_einsum\nimport torch\nfrom opt_einsum import shared_intermediates\nfrom six import add_metaclass\nfrom six.moves import map\n...
[ [ "torch.Size" ] ]
3dpose/3D-Multi-Person-Pose
[ "0b38a71c4e2979f887950321c410e943f915b80b" ]
[ "calculate_mupots_integrate.py" ]
[ "import os \nimport torch\nimport pickle \nimport numpy as np \n\nfrom lib import inteutil\nfrom lib import posematcher\nfrom lib.models import networkinte\n\nfrom tqdm import tqdm \nfrom TorchSUL import Model as M \nfrom collections import defaultdict \n\nif __name__=='__main__':\n\t## step 1: match the poses \n\t...
[ [ "torch.zeros", "torch.no_grad", "numpy.stack", "torch.from_numpy" ] ]
mg14/genomicsurveillance
[ "3eaa1410691e26506aca4800a8662f029a39ef5c" ]
[ "genomicsurveillance/models/legacy.py" ]
[ "import jax.numpy as jnp\nimport numpy as np\nimport numpyro as npy\nimport numpyro.distributions as dist\nfrom jax.ops import index\nfrom jax.scipy.special import logsumexp\n\nfrom genomicsurveillance.distributions import NegativeBinomial\nfrom genomicsurveillance.handler import Model\nfrom genomicsurveillance.uti...
[ [ "numpy.ceil", "numpy.arange", "numpy.log", "numpy.einsum" ] ]
eugenevinitsky/bayesian_reasoning_traffic
[ "de3c14f03fed9cab913bb692877851320a3b6843" ]
[ "flow/envs/multiagent/bayesian_1_inference_env.py" ]
[ "\"\"\"Environment testing scenario one of the bayesian envs.\"\"\"\nfrom copy import deepcopy\nimport math\nimport numpy as np\nfrom gym.spaces import Box, Dict, Discrete\nfrom flow.core.rewards import desired_velocity\nfrom flow.envs.multiagent.base import MultiEnv\n\nfrom traci.exceptions import FatalTraCIError\...
[ [ "numpy.random.choice", "numpy.zeros", "numpy.ones", "numpy.random.randint", "numpy.abs" ] ]
HenriqueCCdA/bootCampAluraDataScience
[ "dbfbb8421e39f664af2c62c964f6dc1843be37f4" ]
[ "modulo5/src/curva_roc.py" ]
[ "import numpy as np\n\ndef calulo_matriz_de_confusao(y, y_pred):\n '''\n ------------------------------------------------------------------------------\n Calculo da matriz de confusao\n ------------------------------------------------------------------------------\n @param y_pred - valores previstos\n @param ...
[ [ "numpy.concatenate", "numpy.array", "numpy.sort" ] ]
itsmeafra/Sublevel-Set-TDA
[ "ee02004ed56d5558a09d127e6005e93ad899f497" ]
[ "Helper_Scripts/range_enforcement.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon May 18 23:03:54 2020\n\n@author: afran\n\"\"\"\nimport numpy as np\nimport scipy.io as sio\nimport os\n\n\n# Range Enforcing All Signals\ndef range_enforce(directory, divisor):\n for file in os.listdir(directory):\n x = np.squeeze(np.transpose(sio.loadmat(d...
[ [ "scipy.io.loadmat" ] ]
whitegr/xopt
[ "4109cbae22523d753ea117aba5f5a6c807ef932a" ]
[ "xopt/bayesian/optimize.py" ]
[ "import logging\nimport os\nimport sys\nimport time\n\nimport torch\nfrom botorch.utils.sampling import draw_sobol_samples\n\nfrom .data import save_data_dict, get_data_json\nfrom .models.models import create_model\nfrom .utils import get_bounds, collect_results, sampler_evaluate, \\\n get_corrected_outputs, NoV...
[ [ "torch.hstack", "torch.all", "torch.vstack" ] ]
sioliv/University
[ "275f3ab7be238c6cbd3a54070172adb3c567c36f" ]
[ "tests/test_textures.py" ]
[ "import basetestcase\nimport os\nfrom OpenGL.GL import *\ntry:\n import numpy as np\nexcept ImportError as err:\n np = None\nfrom OpenGL.arrays import arraydatatype\nHERE = os.path.abspath(os.path.dirname(__file__))\nfrom OpenGL.GL.ARB import texture_rg\n\nclass TestTextures(basetestcase.BaseTest):\n def t...
[ [ "numpy.array", "numpy.zeros" ] ]
keti-ai/kpick-suction-release
[ "6b16a6e9714adb3d9817c47993648b3f94f9548a" ]
[ "ketisdk/vision/detector/classifier/cifar_classification_models/resnet.py" ]
[ "from __future__ import absolute_import\n\n'''Resnet for cifar dataset.\nPorted form\nhttps://github.com/facebook/fb.resnet.torch\nand\nhttps://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py\n(c) YANG, Wei\n'''\nimport torch.nn as nn\nimport math\n\n\n__all__ = ['resnet']\n\ndef conv3x3(in_plane...
[ [ "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
HazzaCheng/DeepCTR
[ "7ab8bc6a70982aa79c36c20678c98becb7f291b1" ]
[ "deepctr/models/flen.py" ]
[ "# -*- coding:utf-8 -*-\n\"\"\"\nAuthor:\n Tingyi Tan,5636374@qq.com\n\nReference:\n [1] Chen W, Zhan L, Ci Y, Lin C. FLEN: Leveraging Field for Scalable CTR Prediction . arXiv preprint arXiv:1911.04690, 2019.(https://arxiv.org/pdf/1911.04690)\n\n\"\"\"\n\nfrom itertools import chain\n\nimport tensorflow as t...
[ [ "tensorflow.keras.initializers.glorot_normal", "tensorflow.keras.models.Model" ] ]
paschalidoud/hmmlearn
[ "9d1ef3e82f0ff4bc5fc81b0c2e928692d0c0f90d" ]
[ "hmmlearn/tests/test_base.py" ]
[ "from __future__ import print_function\n\nfrom unittest import TestCase\n\nimport numpy as np\nfrom numpy.testing import assert_array_equal, assert_array_almost_equal\n\nfrom hmmlearn import hmm\nfrom hmmlearn.utils import assert_raises, logsumexp\n\nnp.seterr(all='warn')\n\n\nclass StubHMM(hmm._BaseHMM):\n def ...
[ [ "numpy.array", "numpy.log", "numpy.random.RandomState", "numpy.zeros", "numpy.testing.assert_array_equal", "numpy.ones", "numpy.tile", "numpy.seterr", "numpy.exp", "numpy.testing.assert_array_almost_equal", "numpy.allclose" ] ]
melvingelbard/lots-iam-3d
[ "c2bdcd07498eb13df189b4f878710d37732e4345" ]
[ "evaluation_lib.py" ]
[ "\"\"\"\nThis file calculates the Jaccard index, Dice coefficient, Positive Predictive Value, Sensitivity and Specificity according to\nthe ground truth. Then, it outputs a csv file containing all the information.\nThis assumes binary arrays for both prediction and ground truth. This also assumes the roi to have va...
[ [ "numpy.max", "numpy.count_nonzero", "numpy.isnan", "numpy.nan_to_num", "numpy.asarray", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.xlabel", "numpy.sum", ...
sashank06/PySyft
[ "dd288be096dba8cb9074de9d27de97c9c659ba98" ]
[ "test/workers/test_websocketIOServerWorker.py" ]
[ "import time\n\nimport torch\n\nimport syft as sy\nfrom syft.workers import WebsocketIOServerWorker\n\n\ndef _payload(location):\n x = torch.tensor([10, 20, 30, 40, 50.0])\n x.send(location)\n\n\nhook = sy.TorchHook(torch)\nserver_worker = WebsocketIOServerWorker(hook, \"localhost\", 5000, log_msgs=True, payl...
[ [ "torch.tensor" ] ]
hocherie/ocrl_hw2
[ "1412e2b8392c93537351e8ee21b3049696289479" ]
[ "ocrl/scripts/lqr_functions.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nlqr controller for steering and speed control of ackerman system\n\"\"\"\n\nimport math\nimport sys\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.linalg as la\n\nL = 0.335\nmax_steer = np.deg2rad(25)\nclass State:\n\n def __init__(self, x=0.0, y=0.0, yaw=0.0...
[ [ "numpy.deg2rad", "numpy.dot", "numpy.zeros" ] ]
ry-werth/nba-automation
[ "b62ed1fd34fad06ba41f11c4f229fb5991b8885c" ]
[ "object_tracker.py" ]
[ "#================================================================\n#\n# File name : object_tracker.py\n# Author : PyLessons\n# Created date: 2020-09-17\n# Website : https://pylessons.com/\n# GitHub : https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3\n# Description : code to track d...
[ [ "numpy.array", "tensorflow.shape", "tensorflow.concat", "numpy.copy", "tensorflow.constant" ] ]
mwmajew/Tonic
[ "f09b9f95ac5281e9299638e4bd513d31ef703bc9" ]
[ "control/dataset.py" ]
[ "import pandas as pd\r\nimport os\r\nimport json\r\n\r\ndef steering_df(directory, jsonfilename='steering.json',to_letters_dict=None):\r\n to_letters_dict = {87:'w', 83:'s', 68:'d', 65:'a'} if to_letters_dict is None else to_letters_dict\r\n jdata = None\r\n with open(os.path.join(directory,jsonfilename),'...
[ [ "pandas.merge", "pandas.merge_asof", "pandas.DataFrame", "pandas.concat", "pandas.read_csv" ] ]
Breakend/cule
[ "5babc33dacde5a4f53f7409e3123c5b6b1aba9c7" ]
[ "examples/ppo/train.py" ]
[ "import math\nimport time\nimport torch\nimport torch.cuda.nvtx as nvtx\n\nimport numpy as np\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom tqdm import tqdm\nfrom utils.initializers import args_initialize, env_initialize, log_initialize, model_initialize\n\nfrom a2c....
[ [ "torch.cuda.nvtx.range_pop", "torch.optim.lr_scheduler.StepLR", "numpy.finfo", "torch.cuda.stream", "torch.exp", "torch.nn.utils.clip_grad_norm_", "torch.cuda.current_stream", "torch.utils.data.DataLoader", "torch.cuda.Stream", "torch.zeros", "torch.min", "torch.cla...
davidackerman/multiresolutionMeshes
[ "0370fca17b34567f88764f97d312f525a91fb710" ]
[ "utils.py" ]
[ "import numpy as np\nfrom functools import cmp_to_key\nimport struct\nimport os\nimport json\nimport glob\nfrom collections import namedtuple\nimport trimesh\n\nCompressedFragment = namedtuple(\n 'CompressedFragment',\n ['draco_bytes', 'position', 'offset', 'lod_0_positions'])\n\n\ndef mesh_loader(filepath):\...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.unique" ] ]
meder411/Tangent-Images
[ "6def4d7b8797110e54f7faa2435973771d9e9722" ]
[ "experiments/distorted_mnist/train.py" ]
[ "import torch\nimport torchvision\n\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom spherical_distortion.util import *\nfrom spherical_distortion.transforms import DistortionSimpleRadial\n\nimport os\n\n# Training parameters\nn_epochs = 20\nbatch_size_train = 32\nbatch_s...
[ [ "torch.device", "torch.no_grad", "torch.nn.functional.log_softmax", "torch.manual_seed", "torch.nn.Conv2d", "torch.cuda.is_available", "torch.load", "torch.nn.functional.nll_loss" ] ]
anyou-jiang/20210703
[ "ed3cc65f2032957b3b214938af1613b76bfd5bf5" ]
[ "test05.py" ]
[ "import scipy.io\nimport matplotlib.pyplot as plt\nfrom LearnGraphAndCPDs import LearnGraphAndCPDs\nfrom SamplePose import SamplePose\nfrom ShowPose import ShowPose\nimport numpy as np\n\nmat = scipy.io.loadmat('PA8Data.mat')\ntrainData = mat['trainData']\ntrain_data_labels = trainData[0][0]\ntrainData_data = train...
[ [ "numpy.random.seed", "matplotlib.pyplot.cla", "matplotlib.pyplot.imshow" ] ]
0sm1um/Stone-Soup
[ "aaa895b54383e9a9b9c9f9ff746291bf60242aab" ]
[ "stonesoup/reader/tests/test_image.py" ]
[ "# -*- coding: utf-8 -*\nimport pytest\nimport numpy as np\nfrom PIL import Image\n\nfrom ...reader.image import SingleImageFileReader\n\n\n@pytest.fixture()\ndef img_gt_filename(tmpdir):\n img_filename = tmpdir.join(\"test.png\")\n imarray = np.random.rand(100, 100, 3) * 255\n im = Image.fromarray(imarray...
[ [ "numpy.array", "numpy.random.rand", "numpy.array_equal" ] ]
AndreaCampagner/skweak
[ "7ad621bea1c21c0144e08710efd882a0f82085ef" ]
[ "scikit_weak/tests/classification/test_neighbors.py" ]
[ "import pytest\nimport numpy as np\nfrom ...classification import WeaklySupervisedKNeighborsClassifier, WeaklySupervisedRadiusClassifier\nfrom sklearn.datasets import load_iris\nfrom ...data_representation import *\n\nfrom sklearn.neighbors import KNeighborsClassifier\n\n@pytest.fixture\ndef dataset():\n X, y = ...
[ [ "numpy.max", "sklearn.neighbors.KNeighborsClassifier", "numpy.empty", "sklearn.datasets.load_iris" ] ]
aalaprana995/Dynamic_Path_Planning
[ "73e6d4b0e4f648d471ee37a79c233b6141311d1a" ]
[ "code/final_prm.py" ]
[ "import random\r\nimport math\r\nimport numpy as np\r\nimport scipy.spatial\r\nimport matplotlib.pyplot as plt\r\n\r\nclass Node:\r\n\r\n def __init__(self, x, y, cost, pind):\r\n self.x = x\r\n self.y = y\r\n self.cost = cost\r\n self.pind = pind\r\n def __str__(self):\r\n ...
[ [ "numpy.array", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "numpy.vstack", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "numpy.mat" ] ]
samuel-clarke/ddsp
[ "6b1ba66e5838437248e5db3347cd3cb8270fe1f0" ]
[ "ddsp/training/train_util.py" ]
[ "# Copyright 2020 The DDSP Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or a...
[ [ "tensorflow.compat.v2.summary.scalar", "tensorflow.compat.v2.train.latest_checkpoint", "tensorflow.compat.v2.tpu.experimental.initialize_tpu_system", "tensorflow.compat.v2.config.experimental_connect_to_cluster", "tensorflow.compat.v2.distribute.MirroredStrategy", "tensorflow.compat.v2.dis...
LunaDilangalen/gpu-pathfinding
[ "ba34c44595a6ede0c3c47bc60bb2a34355fc4891" ]
[ "implementations/gpumem_test.py" ]
[ "TPB = 4\n\nfrom numba import cuda, int32\nimport numpy as np\nimport cupy as cp\nimport math\nfrom skimage.util.shape import view_as_windows\n\ndim = (8,8)\n@cuda.jit\ndef gpu_memory_test(arr, block, thread, shared_sum_arr, local_sum_arr, padded_arr):\n x, y = cuda.grid(2)\n width, height = dim\n tx = cud...
[ [ "numpy.arange", "numpy.zeros" ] ]
xhuang98/Dtect
[ "929d01945fd2768032dbb84d8ba1f62069132172" ]
[ "test/data_processing/test_data.py" ]
[ "import sys\nimport numpy as np\nsys.path.append('../../server/data_analysis/')\nsys.path.append('../../server/')\nfrom dataset import *\n\n\ndef test_construct_encoding():\n values = {\n 'src_user': 'A123',\n 'dest_user': 'A321',\n 'src_comp': 'B123',\n 'dest_comp': 'B321',\n ...
[ [ "numpy.array" ] ]
victoragcosta/Trab3_IPI
[ "bc0f0c2b5be3ed04c9fa789a8960de4c00ee9831" ]
[ "src/problema1.py" ]
[ "import numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n# from src.funcoes import *\nfrom funcoes import *\n\n## Main ##\nimg = cv2.imread('img/img_cells.jpg', cv2.IMREAD_GRAYSCALE)\ncv2.imshow('Original', img)\ncv2.imwrite('img/quest1_original.jpg', img)\n\n# Binarize\n_, binary = cv2.threshold(img, 125,...
[ [ "numpy.repeat", "numpy.zeros" ] ]
NCLPhD/FedScale
[ "7a7cc0c384a80b2c7e59541c772ae3a6b1ed3b58" ]
[ "fedscale/core/utils/dqn.py" ]
[ "import torch \nimport torch.nn as nn \nimport torch.nn.functional as F \nimport numpy as np \nimport gym \n\nclass RLData(object):\n def __init__(self, args):\n self.args = args\n self.env = gy...
[ [ "torch.nn.Linear", "torch.device", "numpy.random.choice", "torch.nn.MSELoss", "numpy.zeros", "torch.max", "torch.FloatTensor", "numpy.random.uniform", "numpy.random.randint", "numpy.hstack" ] ]
michalnand/rl_envs
[ "0b44ebc398e450f1f52c1000adefd64f67a888e4" ]
[ "RLEnvs/rooms_explore_env.py" ]
[ "import numpy\nimport gym\nimport cv2\n\nclass RoomsExploreEnv:\n def __init__(self, envs_count = 4, grid_size = 8, room_size = 16, upscale = 6):\n self.envs_count = envs_count \n self.grid_size = grid_size\n self.room_size = room_size\n self.upscale ...
[ [ "numpy.array", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.tile", "numpy.clip", "numpy.repeat", "numpy.moveaxis", "numpy.around" ] ]
quant-violinista/MITx-6.86x
[ "d6cc5824f6e6161c6e7b270c1948b53749ca85c9" ]
[ "svm/main.py" ]
[ "import numpy as np\n\n\ndef randomization(n):\n \"\"\"\n Arg:\n n - an integer\n Returns:\n A - a randomly-generated nx1 Numpy array.\n \"\"\"\n A = np.random.random([n, 1])\n print(len(A))\n return A\n\n\ndef operations(h, w):\n \"\"\"\n Takes two inputs, h and w, and makes tw...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.vectorize", "numpy.transpose", "numpy.random.random" ] ]
illaiza115/malaya
[ "d90be6d5b2a1393a3f8b8b1ffa8ae676cdaa083c" ]
[ "malaya/model/wordvector.py" ]
[ "import collections\nimport re\nimport numpy as np\nimport tensorflow as tf\nfrom sklearn.utils import shuffle\nfrom tqdm import tqdm\n\n\ndef counter_words(sentences):\n word_counter = collections.Counter()\n word_list = []\n num_lines, num_words = (0, 0)\n for i in sentences:\n words = re.finda...
[ [ "tensorflow.matmul", "tensorflow.train.AdagradOptimizer", "tensorflow.nn.embedding_lookup", "tensorflow.global_variables_initializer", "tensorflow.nn.nce_loss", "tensorflow.random_normal", "tensorflow.InteractiveSession", "sklearn.utils.shuffle", "tensorflow.concat", "tenso...
farhadrgh/torchani
[ "fb2072c926b2e2facbe8de108c345ce2c15da50a" ]
[ "torchani/ase.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Tools for interfacing with `ASE`_.\n\n.. _ASE:\n https://wiki.fysik.dtu.dk/ase\n\"\"\"\n\nimport torch\nfrom .nn import Sequential\nimport ase.neighborlist\nfrom . import utils\nimport ase.calculators.calculator\nimport ase.units\nimport copy\n\n\nclass Calculator(ase.calculators....
[ [ "torch.zeros_like", "torch.zeros" ] ]
choonlim01/hugs-scipy-clim
[ "f566437a88c633754ab3be97beff3bc5aeffc3c9" ]
[ "hugs/calc/tests/test_met.py" ]
[ "\"\"\"Test the `met` module.\"\"\"\n\nfrom hugs.calc import get_wind_dir, get_wind_speed, get_wind_components\nfrom hugs.calc import snell_angle \n\nimport numpy as np\nfrom numpy.testing import assert_almost_equal, assert_array_almost_equal\nimport pytest \n\ndef test_speed():\n \"\"\"Test calculating wind spe...
[ [ "numpy.testing.assert_array_almost_equal", "numpy.array", "numpy.testing.assert_almost_equal", "numpy.sqrt" ] ]
mari-linhares/deep-audio
[ "a3074a5977710e70d836130f23316c6fd660633d" ]
[ "src/models/DAE_CNN.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras.layers import Conv2D, Conv2DTranspose, Dense, Flatten, Reshape, BatchNormalization\nfrom models.model import Model\n\nclass DAE_CNN(Model):\n def __init__(self, input_shape):\n super().__init__()\n\n # BatchNorm\n self.batchNorm = BatchNormaliz...
[ [ "tensorflow.shape", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.pow", "tensorflow.keras.layers.BatchNormalization" ] ]
kimfunn/spatial-smoothing
[ "4f849d57c66c2dbdfaa56fc28727e95eddfd337c" ]
[ "ops/meters.py" ]
[ "import math\nimport numpy as np\n\n\nclass AverageMeter(object):\n \"\"\"\n Computes and stores the average and std\n \"\"\"\n\n def __init__(self, name, fmt=\".3f\"):\n self.name = name\n self.fmt = fmt\n\n self.avg = 0.0\n self.sum = 0.0\n self.count = 0.0\n ...
[ [ "numpy.square", "numpy.sum", "numpy.array" ] ]
errrr0501/wrs2020
[ "8695eca402081d3d02dc12bb50b3ebd78464e96f" ]
[ "arm_control/src/arm_control/dual_arm_task.py" ]
[ "#!/usr/bin/env python3\n#-*- coding: utf-8 -*-\n\n\"\"\"Use to generate dual_arm task and control both arms.\"\"\"\n\nimport rospy\nimport tf\n#import queue\nfrom multiprocessing import Queue\nimport threading\nimport copy\n# import object_distribtion\n\nfrom math import radians, degrees, sin, cos, pi\nfrom numpy ...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.norm" ] ]
3it-nano/QDMS
[ "9ec2d4e198c00f394d8882517c4b3b336c7fe8c2" ]
[ "qdms/Memristor.py" ]
[ "import math\nfrom abc import ABC, abstractmethod\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\nclass Memristor(ABC):\n \"\"\"\n Parameters\n ----------\n r_off : float\n Off (maximum) resistance of the device (ohms).\n r_on : float\n On (minimum) resistance of the device (o...
[ [ "numpy.sin", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.yscale" ] ]
leilin-research/Time-series-prediction
[ "97ca6a7525e2c6329276b66ece1747124da8ab42" ]
[ "tests/transformer_layer_test.py" ]
[ "\n# the transformer test case mainly refer to the official:\n# https://github.com/tensorflow/models/blob/r2.1.0/official/transformer/v2/transformer_layers_test.py\n\nimport tensorflow as tf\nfrom deepts.layers.attention_layer import *\n\n\nclass TransformerLayerTest(tf.test.TestCase):\n def test_attention_layer...
[ [ "tensorflow.ones", "tensorflow.test.main" ] ]
Srijans01/Proctor-Master
[ "0802122191ecf6da3d996e97870ca605adc462ea" ]
[ "face_landmarks.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Jul 29 19:47:08 2020\r\n\r\n@author: hp\r\n\"\"\"\r\n\r\nimport cv2\r\nimport numpy as np\r\nimport tensorflow as tf\r\nfrom tensorflow import keras\r\n\r\n\r\ndef get_landmark_model(saved_model='models/pose_model'):\r\n \"\"\"\r\n Get the facial landmark m...
[ [ "tensorflow.keras.models.load_model", "numpy.array", "numpy.reshape", "tensorflow.constant" ] ]
lbin/CenterNet
[ "e7f5b9eccc23137bd3260cc25ce1d3adec5bdeaa" ]
[ "src/tools/voc_eval_lib/utils/blob.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\n\"\"\"Blob helper functions.\"\"\"\nfrom __future__ import ...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.round", "numpy.min" ] ]
OOAmusat/idaes-pse
[ "ae7d3bb8e372bc32822dcdcb75e9fd96b78da539" ]
[ "idaes/apps/matopt/materials/lattices/unit_cell_lattice.py" ]
[ "#################################################################################\n# The Institute for the Design of Advanced Energy Systems Integrated Platform\n# Framework (IDAES IP) was produced under the DOE Institute for the\n# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021\n# by th...
[ [ "numpy.array" ] ]
nikmerlock97/neurolib
[ "664305456f5ec15753f33c165d5751a4551614de" ]
[ "neurolib/optimize/exploration/exploration.py" ]
[ "import copy\nimport datetime\nimport logging\nimport multiprocessing\nimport os\nimport pathlib\n\nimport numpy as np\nimport pandas as pd\nimport psutil\nimport pypet\nimport tqdm\nimport xarray as xr\n\nfrom ...utils import paths\nfrom ...utils import pypetUtils as pu\nfrom ...utils.collections import dotdict, f...
[ [ "pandas.DataFrame", "numpy.stack", "numpy.unique" ] ]
LeoIV/sparse-ho
[ "f0a5792766a7f0c03bba28cddb983621174cb4ea" ]
[ "sparse_ho/algo/implicit.py" ]
[ "import numpy as np\n\nfrom scipy.sparse.linalg import cg\n\nfrom sparse_ho.utils import init_dbeta0_new\nfrom sparse_ho.algo.forward import compute_beta\n\n\nclass Implicit():\n \"\"\"Algorithm to compute the hypergradient using implicit differentiation.\n\n First the algorithm computes the regression coeffi...
[ [ "numpy.ones", "numpy.exp" ] ]
cadl/libmc
[ "10ba59527292d2d415eb963d0080c6b34a1c5f1d" ]
[ "tests/test_cmemcached_regression.py" ]
[ "# coding: utf-8\nimport time\nimport threading\nimport warnings\n\nfrom libmc import Client, ThreadUnsafe\nimport unittest\nimport pytest\n\nfrom builtins import int\n\n# defined in _client.pyx\n_FLAG_DOUBAN_CHUNKED = 1 << 12\n_DOUBAN_CHUNK_SIZE = 1000000\n\n\ntry:\n import cmemcached\nexcept ImportError:\n ...
[ [ "numpy.int32", "numpy.uint32" ] ]