repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
niujiaxing/face-mask
[ "21a3f79c38d90c579c5e7c717cce0e83b4aa9a1c" ]
[ "utils/anchor_generator.py" ]
[ "import numpy as np\n\ndef generate_anchors(feature_map_sizes, anchor_sizes, anchor_ratios, offset=0.5):\n '''\n generate anchors.\n :param feature_map_sizes: list of list, for example: [[40,40], [20,20]]\n :param anchor_sizes: list of list, for example: [[0.05, 0.075], [0.1, 0.15]]\n :param anchor_r...
[ [ "numpy.expand_dims", "numpy.sqrt", "numpy.meshgrid", "numpy.linspace", "numpy.tile", "numpy.concatenate", "numpy.array" ] ]
abhijeetsatpute/WhatsAppPriceAlert
[ "b4d5fab81269241f17c1d19db7493bb8d32ca113" ]
[ "main.py" ]
[ "import requests\nimport lxml\nfrom bs4 import BeautifulSoup\nfrom twilio.rest import Client\nfrom termcolor import colored\nimport write_csv\nimport pandas\nimport track\nimport schedule\nimport time\n\nif __name__ == \"__main__\":\n url = input(colored(\"Enter the product Link: \",\"blue\"))\n mobile_num = ...
[ [ "pandas.read_csv" ] ]
jmmeneguel/sd-maskrcnn
[ "75f2a81108c9e74702f831f60fcef8c5e903c8ab", "75f2a81108c9e74702f831f60fcef8c5e903c8ab" ]
[ "sd_maskrcnn/gop/detect.py", "sd_maskrcnn/envs/physics_engine.py" ]
[ "\"\"\"Detection utilites for using gop/mcg pre-compiled segmentors.\n\"\"\"\nimport cv2\nimport numpy as np\nimport os, sys, time, scipy.io as scio\nfrom tqdm import tqdm\n\nfrom perception import BinaryImage\n\nfrom .src.gop import segmentation, proposals, contour, imgproc\nfrom .src.util import setupLearned\n\nf...
[ [ "numpy.dot", "numpy.maximum", "numpy.sum", "numpy.nonzero", "numpy.logical_and", "numpy.min", "numpy.arange", "numpy.reshape", "scipy.io.loadmat", "numpy.stack", "numpy.max", "numpy.any", "numpy.array", "numpy.zeros", "numpy.where" ], [ "numpy.ar...
gtolias/tma
[ "3148baf2dac2b4ac64be9df1615d1cad30ee78da" ]
[ "test.py" ]
[ "from __future__ import print_function\nimport sys, time, copy, os, pdb, argparse, ast\nfrom scipy.misc import imsave\nimport numpy as np\nfrom PIL import Image\nimport matplotlib.pyplot as plt\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport torch...
[ [ "scipy.misc.imsave", "torch.cuda.is_available" ] ]
mankadronit/SelfDrivingCar
[ "c264cb4c7464ba9e5f55be54f6781990039d9739" ]
[ "load_data.py" ]
[ "import cv2\nimport numpy as np\nimport pandas as pd\nimport pickle\nimport os\nimport scipy\n\nfrom itertools import islice\nimport matplotlib.pyplot as plt\n\nLIMIT = None\n\nDATA_FOLDER = 'dataset'\nTRAIN_FILE = os.path.join(DATA_FOLDER, 'data.txt')\n\ndef preprocess(img):\n resized = cv2.resize((cv2.cvtColor...
[ [ "matplotlib.pyplot.imread", "numpy.array" ] ]
sands-lab/rethinking-sparsification
[ "0687b1b360f5c95068261c81a9de1bc967f75e50" ]
[ "ncf/dataloading.py" ]
[ "# Copyright (c) 2018, deepakn94, codyaustun, robieta. 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...
[ [ "torch.empty_like", "torch.chunk", "torch.cat", "torch.zeros_like", "torch.sort", "torch.gather", "torch.ones_like" ] ]
jmukher1/MLP-MNIST
[ "94861910936c2fa3707fc4f4e741c4a8aac99ede" ]
[ "linear.py" ]
[ "# Do not import any additional 3rd party external libraries as they will not\n# be available to AutoLab and are not needed (or allowed)\n\nimport numpy as np\nimport math\n\nclass Linear():\n def __init__(self, in_feature, out_feature, weight_init_fn, bias_init_fn):\n\n \"\"\"\n Argument:\n ...
[ [ "numpy.dot", "numpy.zeros", "numpy.sum" ] ]
dewyeon/patchcore
[ "ca68cce8d814357178668de5663d027337c999b6" ]
[ "train_cifar.py" ]
[ "from sklearn.random_projection import SparseRandomProjection\nfrom sampling_methods.kcenter_greedy import kCenterGreedy\nfrom torch.utils.data import Dataset, DataLoader\nfrom sklearn.metrics import confusion_matrix\nfrom scipy.ndimage import gaussian_filter\nfrom sklearn.metrics import roc_auc_score\nfrom torch.n...
[ [ "sklearn.metrics.roc_auc_score", "torch.cat", "torch.utils.data.DataLoader", "sklearn.metrics.confusion_matrix", "numpy.max", "torch.cdist", "torch.cuda.is_available", "numpy.exp", "torch.pow", "numpy.reshape", "numpy.uint8", "torch.argmin", "numpy.argmax", ...
cesinco/Munge-Facebook-Posts
[ "f4665b342f3f52651cf485943d6a6808ae5be4a5" ]
[ "MungeFacebookPosts.py" ]
[ "import regex as re\nimport numpy as np\n\n\ndef randomSwapLetters(word, swapCount=1):\n rng = np.random.default_rng()\n # Create a sorted list of indexes into characters to be swapped within the word\n # We want to draw 2 distinct positions for each swap\n # This explains why we multiply the swapCount ...
[ [ "numpy.random.default_rng" ] ]
KoslickiLab/mutation-rate-ci-calculator
[ "a9a7307380955f8daa29c98601798e6147106359" ]
[ "mrcc/p_from_scaled_containment.py" ]
[ "#!/usr/bin/env python3\n\nimport sys\nfrom math import ceil\nimport mrcc.kmer_mutation_formulas_thm5 as thm5\nimport mrcc.hypergeometric_slicer as hgslicer\nfrom scipy.optimize import brentq, fsolve, newton\nfrom scipy.stats import norm as scipy_norm\nfrom numpy import sqrt\nimport argparse\nimport mrcc.third_mome...
[ [ "scipy.stats.norm.ppf", "scipy.optimize.brentq", "numpy.sqrt" ] ]
osmidy/Dischord
[ "3c3802eb4917adb9384256d8a0c7ba4f123fd166" ]
[ "project/Foreground.py" ]
[ "import sys\nsys.path.append('..')\nfrom common.core import *\nfrom common.gfxutil import *\nfrom common.audio import *\nfrom common.mixer import *\nfrom common.note import *\nfrom common.wavegen import *\nfrom common.wavesrc import *\nfrom common.writer import *\n\nfrom kivy.core.window import Window\nfrom kivy.cl...
[ [ "numpy.linspace" ] ]
xvdp/pytorch-image-models
[ "f1a04a7d8bf7c77b2891cafb8e7b7416421ba95c" ]
[ "timm/data/dataset.py" ]
[ "\"\"\" Quick n Simple Image Folder, Tarfile based DataSet\n\nHacked together by / Copyright 2020 Ross Wightman\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch.utils.data as data\n\nimport os\nimport re\nimport torch\nimport tar...
[ [ "torch.zeros" ] ]
jason-dai/BigDL
[ "81ee60a73707d91c58d9bcd5b17c8e5731741a85" ]
[ "python/nano/src/bigdl/nano/pytorch/trainer/Trainer.py" ]
[ "#\n# Copyright 2016 The BigDL 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 ...
[ [ "torch.device" ] ]
snapADDY/sklearn-onnx
[ "8e5d3c924af3a922c3c36c08b8cf7af5967e81b6" ]
[ "tests/test_sklearn_k_bins_discretiser_converter.py" ]
[ "# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"\nTests scikit-learn's KBinsDiscretiser converter.\n\"\"\"\n\nimport unittest\nimport numpy as np\ntry:\n from sklearn.preprocessing import KBinsDiscretizer\nexcept ImportError:\n # available since 0.20\n KBinsDiscretizer = None\nfrom skl2onnx import convert_...
[ [ "numpy.array", "sklearn.preprocessing.KBinsDiscretizer" ] ]
apache/incubator-mxnet-test
[ "5d02cab1fe64c5e7b5973253b75d509fe3ef5d21" ]
[ "python/mxnet/symbol.py" ]
[ "# coding: utf-8\n# pylint: disable=invalid-name, protected-access, too-many-arguments, too-many-lines\n# pylint: disable=import-error, no-name-in-module\n\"\"\"Symbolic configuration API of MXNet.\"\"\"\nfrom __future__ import absolute_import as _abs\n\nimport ctypes\nimport warnings\nfrom numbers import Number\n\...
[ [ "numpy.prod", "numpy.dtype", "numpy.hypot" ] ]
niobeus/onnx2torch
[ "d2dc0a0927ced3ac32d4a1dc925a5528874b5c0c" ]
[ "onnx2torch/node_converters/concat.py" ]
[ "__all__ = ['OnnxConcat']\n\nimport torch\nfrom torch import nn\n\nfrom onnx2torch.node_converters.registry import add_converter\nfrom onnx2torch.onnx_graph import OnnxGraph\nfrom onnx2torch.onnx_node import OnnxNode\nfrom onnx2torch.utils.common import OnnxToTorchModule\nfrom onnx2torch.utils.common import Operati...
[ [ "torch.cat" ] ]
lvolkmann/CS-490-Deep-Learning
[ "48e637e6892d2e87999ed87b994be659cb30f1e2" ]
[ "Week 3 - Classes/submission.py" ]
[ "# @author: Landon Volkmann\n\n# imports\nimport numpy as np\nimport gc\nfrom bs4 import BeautifulSoup\nimport requests\n\n\n# Question 1: Employee Class\n\nclass Employee(object):\n\n EMPLOYEE_COUNT = 0\n\n def __init__(self, name: str, family: str, department: str):\n self.name = name\n self.f...
[ [ "numpy.where", "numpy.random.randint" ] ]
vagi/selenium-youtube-scaper
[ "a0453a022db94db41c93ffe11c2f252d5e5e324a" ]
[ "scraper.py" ]
[ "# The tutorial is here: https://www.browserstack.com/guide/python-selenium-to-run-web-automation-test\nimport pandas as pd\n\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\nfrom selenium.webdriver.common.keys import Keys\nfrom selenium.webdriver.common.by import By\n\n\nYOUT...
[ [ "pandas.DataFrame" ] ]
milesgray/simp
[ "d7f8398b33a879112ec1bd233044db576dd732ac" ]
[ "simp.py" ]
[ "\"\"\"\npyflann needs to be converted from python2 to python3. Here is an example if you are using an AWS sagemaker notebook instance:\n`pip install 2to3`\n`2to3 -w ~/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/pyflann`\n\"\"\"\nfrom collections import defaultdict\nimport time\nimport warnings\nimport a...
[ [ "numpy.ones_like", "scipy.sparse.eye", "numpy.arange", "scipy.sparse.csr_matrix", "numpy.argmin", "numpy.fill_diagonal", "sklearn.metrics.pairwise.pairwise_distances", "scipy.sparse.csgraph.connected_components" ] ]
VinayakShuklaa/arc_project
[ "a0f24131162a7bcdd37fb0c6efcf97725ee7c79b" ]
[ "code.py" ]
[ "import xlrd\r\nimport os\r\ncwd=(os.getcwd())+'\\\\data'\r\nloc = (cwd)+'\\\\courses.xls'\r\nloc2= (cwd)+'\\\\data1.xls'\r\nwb = xlrd.open_workbook(loc, formatting_info=True)\r\nwb2 = xlrd.open_workbook(loc2)\r\nsheet1=wb.sheet_by_index(1)\r\nsheet0=wb.sheet_by_index(0)\r\nsheet2=wb2.sheet_by_index(0)\r\n\r\n\r\n\...
[ [ "pandas.concat", "pandas.read_excel", "pandas.ExcelWriter" ] ]
rubencart/self-critical.pytorch
[ "5b01e44618c406592184275b734d3fbd3f11234c" ]
[ "eval_ensemble.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport json\nimport numpy as np\n\nimport time\nimport os\nfrom six.moves import cPickle\n\nimport opts\nimport models\nfrom dataloader import *\nfrom dataloaderraw import *\nimport eval_utils\nimport ...
[ [ "torch.load" ] ]
bek0s/gbkf
[ "2ef56e8554fdf7ee8136141bc16d59bd34efa6c8" ]
[ "src/gbkfit/model/gmodels/_smdisk.py" ]
[ "\nimport logging\n\nimport numpy as np\n\nfrom . import _disk\n\n\nlog = logging.getLogger(__name__)\n\n\nclass SMDisk(_disk.Disk):\n\n def __init__(\n self,\n loose, tilted, rnodes, rnstep, interp,\n rptraits, rhtraits,\n vptraits, vhtraits,\n dptraits, dh...
[ [ "numpy.abs" ] ]
sgttwld/tensorflow-comparison
[ "6e7764cae417fdb4fcf5e5d0338cc8569b72d912" ]
[ "4_NeuralNetwork_keras.py" ]
[ "\"\"\"\nExample of a multilayer-perceptron learning XOR using Keras\nAuthor: Sebastian Gottwald\nProject: https://github.com/sgttwld/tensorflow-comparison\n\"\"\"\n\nfrom __future__ import print_function\nimport numpy as np\nfrom keras.models import Sequential, Model\nfrom keras.layers import Input, Dense, Activat...
[ [ "numpy.array" ] ]
giovanisleite/serenata-toolbox
[ "78c549916d9d83beca76fb1ed4713ed1f931099b" ]
[ "serenata_toolbox/chamber_of_deputies/presences_dataset.py" ]
[ "import os\nimport urllib\nimport xml.etree.ElementTree as ET\nimport socket\nimport time\n\nimport pandas as pd\n\nfrom serenata_toolbox.datasets.helpers import (\n save_to_csv,\n translate_column,\n xml_extract_datetime,\n xml_extract_text,\n)\n\n\nclass PresencesDataset:\n\n URL = (\n 'http...
[ [ "pandas.DataFrame" ] ]
LucaZampieri/DL
[ "e53ade2638ccc3ca368e15c8454845856776e719" ]
[ "Project2_FromScratch/optim.py" ]
[ "\"\"\"\"\nFile that contains the optimizers for the project two of DeepLearning.\n\"\"\"\n\nimport torch\nfrom torch import Tensor\nimport math\n\n\nclass Optimizer(object):\n def step(self, model, lr, *input):\n raise NotImplementedError\n\n\nclass SGDOptimizer(Optimizer):\n \"\"\"implementation of t...
[ [ "torch.sqrt", "torch.zeros_like" ] ]
prstrive/EPCDepth
[ "84119c806741334b652749ee953e3eab60a3718c" ]
[ "precompute_depth_hints.py" ]
[ "# copy from DepthHints (https://arxiv.org/pdf/1909.09051.pdf), please follow their license.\n\n\"\"\" Script to precompute depth hints using the 'fused SGM' method \"\"\"\n\nfrom __future__ import absolute_import, division, print_function\n\nimport os\nimport random\nimport numpy as np\nimport copy\nfrom PIL impor...
[ [ "torch.abs", "torch.utils.data.DataLoader", "torch.argmin", "numpy.stack", "torch.from_numpy", "torch.eye", "numpy.linalg.pinv", "torch.cuda.is_available", "torch.gather", "numpy.array" ] ]
rkbk2000/pandas
[ "8f9266a9dac8b041193bf85156d0df1660a660b1", "e95ac5c4fd49acf63bb671f81e97ddeb4a1460f0" ]
[ "pandas/tests/groupby/aggregate/test_aggregate.py", "pandas/core/dtypes/cast.py" ]
[ "\"\"\"\ntest .agg behavior / note that .apply is tested generally in test_groupby.py\n\"\"\"\nimport functools\n\nimport numpy as np\nimport pytest\n\nimport pandas as pd\nfrom pandas import DataFrame, Index, MultiIndex, Series, concat\nimport pandas._testing as tm\nfrom pandas.core.base import SpecificationError\...
[ [ "pandas.Series", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "numpy.max", "numpy.mean", "pandas.NamedAgg", "pandas._testing.assert_frame_equal", "pandas.Index", "numpy.std", "pandas.Int64Index", "pandas._testing.assert_series_equal", "pandas._testing.assert...
aymericvie/evology
[ "8f00d94dee7208be5a5bdd0375a9d6ced25097f4" ]
[ "evology/research/icml/test_analysis.py" ]
[ "\n# %%\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom scipy.ndimage.filters import gaussian_filter\nimport ternary\nimport numpy as np\nimport pandas as pd\nfrom math import isnan\nfrom ternary.helpers import simplex_iterator\ndata = pd.read_csv(\"/Users/aymericvie/Documents/GitHub/evology/evology/r...
[ [ "matplotlib.pyplot.tight_layout", "pandas.read_csv", "matplotlib.pyplot.show" ] ]
hologerry/mmflow
[ "40caf064851bd95317424e31cc137c0007a2bece" ]
[ "tests/test_models/test_decoder/test_pwcnet_decoder.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport pytest\nimport torch\n\nfrom mmflow.models.decoders.pwcnet_decoder import PWCModule, PWCNetDecoder\n\n\ndef _get_test_data():\n\n input_feat1 = dict(\n level6=torch.randn(1, 196, 8, 8).cuda(),\n level5=torch.randn(1, 128, 16, 16).cuda())\n\n ...
[ [ "torch.randn", "torch.Size", "torch.cuda.is_available" ] ]
JaveyWang/5-char-real-number-recognition
[ "dca6cb748d466a774b4e5a1daa4a31af7e04a550" ]
[ "src/train.py" ]
[ "import os\nimport numpy as np\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\nimport logging\nimport csv\nimport pickle\nfrom tensorflow.python import debug as tf_debug\n\nlogging.basicConfig(level=logging.INFO)\n\nDIR_DATASET = \"../dataset\"\nFILENAME_PKL = \"train.pkl\"\n\nPATH_IMG_PKL = os.path.join...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.cast", "tensorflow.train.AdamOptimizer", "tensorflow.layers.dense", "tensorflow.ConfigProto", "tensorflow.name_scope", "tensorflow.Session", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.train.Saver", ...
agux/faix
[ "99fcca313518b57dcde46c2ddcea9896598b64ea", "99fcca313518b57dcde46c2ddcea9896598b64ea", "99fcca313518b57dcde46c2ddcea9896598b64ea" ]
[ "corl/wc_test/test19_dnc.py", "corl/wc_test/test21_lstm.py", "mnist/dnn.py" ]
[ "# from __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom corl.wc_test.test_runner import run\nfrom corl.model.tf2 import dnc_regressor\nfrom time import strftime\n# Path hack.\nimport sys\nimport os\nimport numpy as np\nsys.path.append(os.path.dirname(os.path.abspath(__file__)) ...
[ [ "numpy.random.seed" ], [ "numpy.random.seed" ], [ "tensorflow.matmul", "tensorflow.constant", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.Variable", "tensorflow.random.truncated_normal", "tensorflow.nn.max_pool2d", "tensorflow.reshape", "tensorflow.cast"...
yangyahu-1994/Python-Crash-Course
[ "51fe429dd606583a790f3c1603bb3439382c09e0" ]
[ "VSCode_work/chapter16/chapter16_16_2_2.py" ]
[ "# auther:杨亚虎\n# encoding:utf-8\n# 导入必要的模块和类\nimport csv\nfrom matplotlib import pyplot as plt\nfrom datetime import datetime\nfrom matplotlib import dates as mdates\n\ndef get_weather_data(filename, dates, highs, lows):\n \"\"\"从文件中获取日期、最高气温和最低气温\"\"\"\n\n with open(filename) as f:\n reader = csv.read...
[ [ "matplotlib.pyplot.gca", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlim", "matplotlib.pyplot.fill_between", "matplotlib.pyplot....
wholmgren/solarforecastarbiter-core
[ "e692c7e142f24c0253e4288a6ac760e10ba41dbd", "e692c7e142f24c0253e4288a6ac760e10ba41dbd" ]
[ "solarforecastarbiter/metrics/tests/test_preprocessing.py", "solarforecastarbiter/tests/test_datamodel.py" ]
[ "import json\nimport datetime as dt\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom pandas.testing import (\n assert_frame_equal, assert_index_equal, assert_series_equal)\n\nfrom solarforecastarbiter import datamodel\nfrom solarforecastarbiter.metrics import preprocessing\n\n\nTHREE_HOURS = pd.da...
[ [ "pandas.to_datetime", "pandas.testing.assert_series_equal", "pandas.Series", "numpy.arange", "pandas.DatetimeIndex", "pandas.DataFrame", "pandas.Timedelta", "pandas.testing.assert_frame_equal", "numpy.random.rand", "pandas.date_range", "pandas.testing.assert_index_equal...
HyeonwooNoh/rl-starter-files
[ "d568cfd25c9b3f60413d5ff3ac20de573e554b62" ]
[ "scripts/evaluate.py" ]
[ "#!/usr/bin/env python3\n\nimport argparse\nimport gym\nimport gym_minigrid\nimport time\nimport torch\nfrom torch_ac.utils.penv import ParallelEnv\n\nimport utils\n\n# Parse arguments\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--env\", required=True,\n help=\"name of the enviro...
[ [ "torch.tensor", "torch.ones", "torch.cuda.is_available", "torch.zeros" ] ]
omni-us/pagexml
[ "92d605e2a675d8bbc2ac91e08192b56b4766606c" ]
[ "py-pagexml/pagexml/__init__.py" ]
[ "import os\nfrom .swigPageXML import * # pylint: disable=import-error\ntry:\n import cv2\n import numpy as np\nexcept ImportError:\n cv2 = False\n\n\n__version__ = '2021.07.28'\n\nPAGE_XSD_SEARCHINK = os.path.dirname(os.path.realpath(__file__))+'/xsd/pagecontent_searchink.xsd'\nPAGE_XSD_OMNIUS = os.path.d...
[ [ "numpy.asarray" ] ]
lab-midas/torch-mednet
[ "4b972e2fd77abe01355856049cb8b1e60270d149" ]
[ "midasmednet/unet/loss.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn as nn\nfrom torch.autograd import Variable\nfrom torch.nn import MSELoss, SmoothL1Loss, L1Loss\n\n\ndef flatten(tensor):\n \"\"\"Flattens a given tensor such that the channel axis is first.\n The shapes a...
[ [ "torch.nn.Softmax", "torch.nn.CrossEntropyLoss", "torch.mean", "torch.nn.functional.softmax", "torch.nn.LogSoftmax", "torch.zeros", "torch.nn.functional.cross_entropy", "torch.argmax", "torch.nn.Sigmoid", "torch.nn.functional.mse_loss", "torch.autograd.Variable" ] ]
CREVIOS/MediSinGAN
[ "c54e3f13995204d9ae6934090e4862d41f323813" ]
[ "SinGAN_pytorch/SinGAN/training.py" ]
[ "import SinGAN.functions as functions\nimport SinGAN.models as models\nimport os\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data\nimport math\nimport matplotlib.pyplot as plt\nfrom SinGAN.imresize import imresize\nfrom tqdm import tqdm\nimport numpy as np\n\ndef train(opt,Gs,Zs,reals,No...
[ [ "torch.nn.MSELoss", "numpy.save" ] ]
pruidzeko/PythonRobotics
[ "5ff9b70d737121c2947d844ecfb1fa07abdd210c" ]
[ "PathTracking/pure_pursuit/pure_pursuit.py" ]
[ "\"\"\"\n\nPath tracking simulation with pure pursuit steering and PID speed control.\n\nauthor: Atsushi Sakai (@Atsushi_twi)\n Guillaume Jacquenot (@Gjacquenot)\n\n\"\"\"\nimport numpy as np\nimport math\nimport matplotlib.pyplot as plt\n\n# Parameters\nk = 0.1 # look forward gain\nLfc = 2.0 # [m] look-ah...
[ [ "matplotlib.pyplot.legend", "numpy.arange", "matplotlib.pyplot.cla", "matplotlib.pyplot.subplots", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "numpy.argmin", "matplotlib.pyplot.grid", "matplotlib.pyplot.axis", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show"...
jadsonlucio/Opengl-CG-Project
[ "47b50bf93b8d3a1ccef1f41f22ed3327d9496b8c" ]
[ "engine/omega_engine/objects/square.py" ]
[ "import numpy as np\nfrom OpenGL.GL import GL_FLOAT\n\nvertices = [-0.5, -0.5, 0, 1.0, 1.0, 1.0, 0.0, 0.0, -1.0,\n 0.5, -0.5, 0, 1.0, 1.0, 1.0, 0.0, 0.0, -1.0, \n 0.5, 0.5, 0, 1.0, 1.0, 1.0, 0.0, 0.0, -1.0, \n -0.5, -0.5, 0, 1.0, 1.0, 1.0, 0.0, 0.0, -1.0, \n 0.5, ...
[ [ "numpy.array" ] ]
atypon/OCTIS
[ "ff49bb3785197ca929c5626a3f04fbb917de2376" ]
[ "octis/models/pytorchavitm/avitm/avitm_model.py" ]
[ "\"\"\"Class to train AVITM models.\"\"\"\n\nimport datetime\nfrom collections import defaultdict\n\nimport numpy as np\nimport torch\nfrom torch import optim\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nfrom torch.utils.data import DataLoader\n\nfrom octis.models.early_stopping.pytorchtools import Earl...
[ [ "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.load", "numpy.isnan", "torch.utils.data.DataLoader", "torch.sum", "numpy.concatenate", "torch.no_grad", "torch.log", "torch.cuda.is_available", "torch.topk", "numpy.array" ] ]
hgt312/EE334
[ "ef4e85100f5d68d38cb8369ed117bc7bbadda8be" ]
[ "lab4.py" ]
[ "from tensorflow.examples.tutorials.mnist import input_data\nfrom tensorflow.contrib.layers import xavier_initializer\nimport tensorflow as tf\n\ntf.set_random_seed(66666)\n\n# prepare data\nmnist = input_data.read_data_sets('MNIST_data', one_hot=True)\n\nxs = tf.placeholder(tf.float32, [None, 784]) # 28*28*1\nys ...
[ [ "tensorflow.layers.conv2d", "tensorflow.nn.softmax", "tensorflow.reshape", "tensorflow.cast", "tensorflow.placeholder", "tensorflow.layers.max_pooling2d", "tensorflow.layers.dense", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.nn.softmax_cros...
AurelienNioche/planet
[ "5d128b9396f99f0ca2fb85d33d236666b1d083cf" ]
[ "planet/models/drnn.py" ]
[ "# Copyright 2019 The PlaNet 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 require...
[ [ "tensorflow.layers.dense", "tensorflow.concat", "tensorflow.compat.v1.nn.rnn_cell.GRUCell", "tensorflow.make_template" ] ]
airacid/pruned-face-detector
[ "ef587e274ccf87633af653694890eb6712d6b3eb" ]
[ "lib/dataset/augmentor/visual_augmentation.py" ]
[ "import cv2\r\nimport numpy as np\r\nimport random\r\n\r\ndef pixel_jitter(src,p=0.5,max_=5.):\r\n\r\n src=src.astype(np.float32)\r\n if random.uniform(0, 1) < p:\r\n pattern=(np.random.rand(src.shape[0], src.shape[1],src.shape[2])-0.5)*2*max_\r\n img = src + pattern\r\n\r\n img[img<0]=0\...
[ [ "numpy.ones_like", "numpy.clip", "numpy.random.rand", "numpy.mod", "numpy.random.uniform" ] ]
zxhuang97/planet
[ "c5fe704d744fc434e0a163973fd8259314fadea3", "c5fe704d744fc434e0a163973fd8259314fadea3", "c5fe704d744fc434e0a163973fd8259314fadea3" ]
[ "planet/control/batch_env.py", "planet/control/in_graph_batch_env.py", "planet/training/utility.py" ]
[ "# Copyright 2019 The PlaNet 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 require...
[ [ "numpy.array", "numpy.stack" ], [ "tensorflow.scatter_update", "tensorflow.cast", "tensorflow.identity", "tensorflow.constant_initializer", "tensorflow.zeros_like", "tensorflow.name_scope", "tensorflow.variable_scope", "tensorflow.to_int32", "numpy.array", "tens...
kenners/odc
[ "7e03589bc2ce69736415c94b3560bc61b54b512d" ]
[ "odc.py" ]
[ "\"\"\"\nodc.py\n\nAn implementation of the Siggaard-Andersen TANH oxyhaemoglobin dissociation curve model in Python.\n\nSiggaard-Andersen O, Siggaard-Andersen M, Fogh-Andersen N. The TANH-equation modified for the hemoglobin, oxygen, and carbon monoxide equilibrium. Scand J Clin Lab Invest Suppl 1993;214:113–9. do...
[ [ "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.axis", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
elnikkis/snlocest
[ "89dbbc489c862a3901c4599397dfc7ca3297fbed" ]
[ "snlocest/tests/test_sklearn_api.py" ]
[ "# coding: utf-8\n\n'''\nscikit-learnのAPIで推定手法が利用できる\n'''\n\n\nfrom sklearn.model_selection import train_test_split, LeaveOneOut, KFold, cross_val_score\nfrom sklearn.metrics import precision_recall_fscore_support, classification_report\n\nfrom snlocest.graph import SpMatLikeDOLGraph, CSRGraph\nfrom snlocest.method...
[ [ "sklearn.model_selection.cross_val_score", "sklearn.model_selection.train_test_split", "sklearn.model_selection.KFold" ] ]
roybens/neuroGPU
[ "667d266af133e98013904effe75670b44119d424" ]
[ "Benchmarking/CoreNeuron/BBP_TTPC_clean/TTPC1.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Oct 5 13:44:17 2020\n\n@author: bensr\n\"\"\"\n\nimport sys\nfrom neuron import h, gui\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport logging\nlogging.warning('Watch out!')\nh.nrnmpi_init()\npc = h.ParallelContext()\nprint(f'First: the mpi_id is {pc.id...
[ [ "numpy.loadtxt" ] ]
colinthart/sdf
[ "0fa9ce43602482091883ca087de77d27d0f35663" ]
[ "examples/generate_2d.py" ]
[ "from sdf import *\nimport numpy as np\n\nf = rectangle(1) - circle(0.5)\npoints = f.generate(workers=1)\n\nprint(np.array(points).shape)\n" ]
[ [ "numpy.array" ] ]
ymap-team/ROOT2020
[ "70db45f20aaea038c017656c63b0c51416156a33" ]
[ "yoshimoto/poly_fit_manual.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport sys\nimport my_style\n\ndef poly_fit_manual(fit=False):\n vx=[]\n vy=[]\n i=1\n with open(\"temperature.txt\") as f:\n for line in f:\n vx.append(i)\n vy.append(float(line.split()[0]))\n i+=1\n\n # グラ...
[ [ "matplotlib.pyplot.legend", "numpy.sqrt", "numpy.linspace", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
NEWPLAN/nvcaffe-0.17.3
[ "7b8e4fdef8216d8497f6d71df465e881e47e009b" ]
[ "models/modelBuilder/build_cifar10_resnet.py" ]
[ "#!/usr/bin/env python\n# ref: Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\"Deep Residual Learning for Image Recognition\"\n# https://arxiv.org/pdf/1512.03385v1.pdf\n\n\nimport numpy\n\nfrom layers import *\n\n# ------------------------------------------------------------------------------\n\n\ndef addRe...
[ [ "numpy.matrix" ] ]
twy80/svd_image
[ "625ea344b79de5a6a6fed3f287c7d5491a70cec9" ]
[ "svd_image_functions.py" ]
[ "\"\"\"\r\nFunctions for Image Compression using SVD\r\nCoded by T.-W. Yoon, Aug. 2021\r\n\"\"\"\r\n\r\nimport tkinter as tk\r\n\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\r\nfrom skimage.util import img_as_float, img_as_ubyte\r\n\r\n\...
[ [ "numpy.linalg.svd", "matplotlib.pyplot.Figure", "numpy.clip", "matplotlib.pyplot.subplots", "matplotlib.pyplot.close", "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.pause", "matplotlib.backends.backend_tkagg.FigureCanvasTkA...
cmcuervol/Estefania
[ "13b564261dfc786b93c77fbc442a568018f87cc9" ]
[ "Exploracion_datos_variables.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport pandas as pd\nfrom datetime import datetime, timedelta\nimport numpy as np\nfrom scipy.stats import pearsonr\nfrom scipy import stats\n# from mpl_toolkits.axes_grid1 import host_subplot\n# import mpl_toolkits.axisartist as AA\nimport matplotlib\nimport matplot...
[ [ "numpy.nanmax", "matplotlib.pyplot.legend", "pandas.to_datetime", "scipy.stats.norm.cdf", "matplotlib.pyplot.rc", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.where", "pandas.read_csv", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.figure", "pandas...
klecki/DALI
[ "3aa1b44349cb94f25a35050bbf33c001049851c7" ]
[ "docs/examples/video/superres_pytorch/main.py" ]
[ "import argparse\nimport logging as log\nimport os\nimport time\nimport datetime\nfrom functools import reduce\n\nimport numpy as np\n\nfrom math import ceil, floor\nfrom tensorboardX import SummaryWriter\n\nimport torch\nimport torch.distributed as dist\nimport torch.optim as optim\nimport torch.utils.data.distrib...
[ [ "torch.optim.Adam", "torch.cuda.synchronize", "torch.optim.lr_scheduler.LambdaLR", "torch.distributed.init_process_group", "torch.cuda.manual_seed", "torch.cuda.set_device", "torch.manual_seed", "torch.autograd.Variable" ] ]
JSchuurmans/DCNplus
[ "2a25045349b8b1b645f74575c8613a513ced6eca" ]
[ "src/dataset.py" ]
[ "import pandas as pd\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nfrom src.preprocessing import Preprocessing\n\nclass SquadDataset(Dataset):\n \"\"\"Dataset object for the Stanford Question Answering Dataset. \n \n \n \"\"\"\n \n def __init__(self, data_file_path, glov...
[ [ "torch.from_numpy", "pandas.read_json" ] ]
JoshuaRaiser/HICS
[ "4a4154ac1c2b624df015852ba2f0dd1641b39eed" ]
[ "main.py" ]
[ "import matplotlib.pyplot as plt\n\nimport random\nimport math\n\nfrom objects.ion import Ion\nfrom mathematics.calculator import Calculator\n\n# grid to draw graphs\ngrid = plt.GridSpec(2, 2, wspace=0.4, hspace=0.3)\n\n# impact parameter\nimpact_param = 0\n\n# actual ion\nion = Ion()\n\ndef main():\n global imp...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.Circle", "matplotlib.pyplot.subplot", "matplotlib.pyplot.axis", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.GridSpec", "matplotlib.pyplot...
phanav/metalearn
[ "731442f7999ba04252a5b91057903962156e7e1c" ]
[ "src/reptile-v4.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[2]:\n\n\nimport os, shutil\nfrom os.path import join as joinpath\nfrom os import listdir\n\n\n# In[3]:\n\n\n\"\"\"\n# Expected input format: an `images` folder with all images in flat structure, i.e. as direct children.\ndatadir = \"/mnt/beegfs/home/vu/Codalab-MetaDL/...
[ [ "torch.cat", "torch.load", "torch.utils.data.DataLoader", "torch.cuda.is_available", "matplotlib.pyplot.rcParams.update", "sklearn.preprocessing.LabelEncoder", "torch.nn.CrossEntropyLoss", "pandas.read_csv", "matplotlib.pyplot.figure", "pandas.concat", "numpy.random.cho...
maxpmx/HisToGene
[ "44ff75b9b68949796f27f1b4121d36ea4cba8bf3" ]
[ "vis_model.py" ]
[ "import os\nfrom argparse import ArgumentParser\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nimport pytorch_lightning as pl\nfrom torchmetrics.functional import accuracy\nfrom transformer import ViT\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\n\nclass Featur...
[ [ "torch.nn.Sequential", "torch.ones", "torch.nn.functional.nll_loss", "torch.nn.functional.log_softmax", "torch.nn.Embedding", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.nn.functional.mse_loss", "torch.nn.functional.relu", "torch.rand", "torch.argmax" ] ]
haseley/scikit-allel
[ "300ab04c858eedf64d339e942589dfcf45d719c7" ]
[ "allel/stats/fst.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, division\n\n\nimport logging\nimport itertools\n\n\nimport numpy as np\n\n\nfrom allel.util import asarray_ndim, check_dim0_aligned, ensure_dim1_aligned\nfrom allel.model.ndarray import GenotypeArray\nfrom allel.stats.window import wi...
[ [ "numpy.dstack", "numpy.nansum", "numpy.mean", "numpy.column_stack", "numpy.zeros", "numpy.sum" ] ]
KyleAMoore/deepforge
[ "986f5d4094d3ab6aa89d82c3683504811fb0081a" ]
[ "src/plugins/GenerateJob/templates/plotly_backend.py" ]
[ "\"\"\"\nPlotly backend for matplotlib\n\"\"\"\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\nimport six\nimport io\nimport base64\nimport math\n\nimport numpy as np\nimport numpy.ma as ma\n\nimport matplotlib\nfrom matplotlib._pylab_helpers import Gc...
[ [ "numpy.asarray", "matplotlib._pylab_helpers.Gcf.get_all_fig_managers", "numpy.ma.getdata", "matplotlib.transforms.IdentityTransform", "matplotlib.backend_bases.FigureCanvasBase.filetypes.copy", "numpy.array", "matplotlib.dates.num2date" ] ]
EastonHMorrill/MorrillPhantomBlackHole
[ "2c230243273e82edf7a0fd37e48ce090a5717ec0" ]
[ "NSPressure.py" ]
[ "import numpy as np\nimport math\nimport matplotlib.pyplot as plt\n\nc = 299792458 # speed of light in m/s\nG = 6.6743E-11 # Newton's gravitational constant in m^3/kg*s^2\nrho_central = 9.9E17 # central density in kg/m^3\nR_NS = 11400 # Radius of neutron star in m\nM_NS = 1.4*1.9891E30 # Mass of neutron star in kg\...
[ [ "matplotlib.pyplot.legend", "numpy.sqrt", "numpy.linspace", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.tan", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "numpy.empty", "matplotlib.pyplot.ylabel" ] ]
ayhokuyan/CartooNet
[ "3bda4a4a57148fc1ee9edaccbae25e921132c2ce" ]
[ "networks/commons.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport pytorch_lightning as pl\nfrom collections import OrderedDict\n\n\nclass Mean(nn.Module):\n def __init__(self, dim: list, keepdim=False):\n super().__init__()\n self.dim = dim\n self.keepdim = keepdim\n\n def forward(self, x):\n...
[ [ "torch.mean" ] ]
TimO96/DCE-NET
[ "437876e5c6a53b9329c0939170c9347ee0d29626" ]
[ "train.py" ]
[ "# import libraries\nimport torch\nimport torch.nn as nn\nimport torch.utils.data as utils\nimport copy\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport model\nimport matplotlib\nfrom tqdm import tqdm\nmatplotlib.use('TkAgg')\n\n# np.random.seed(42)\n# torch.manual_seed(42)\n\n\ndef NMSE_loss...
[ [ "torch.mean", "torch.nn.MSELoss", "matplotlib.pyplot.tight_layout", "torch.Tensor", "torch.cat", "matplotlib.use", "torch.utils.data.DataLoader", "torch.sum", "torch.nan_to_num", "matplotlib.pyplot.gcf", "numpy.concatenate", "torch.no_grad", "matplotlib.pyplot.c...
astrochun/DRAGONS
[ "041cdeeaf3eca9751085f6e01222d48c8e63cd3c", "041cdeeaf3eca9751085f6e01222d48c8e63cd3c" ]
[ "geminidr/gmos/tests/spect/test_extract_1d_spectra.py", "geminidr/gsaoi/primitives_gsaoi.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nRegression tests for GMOS LS `extract1DSpectra`. These tests run on real data to\nensure that the output is always the same. Further investigation is needed to\ncheck if these outputs are scientifically relevant.\n\nNotes\n-----\n- The `indirect` argument on `@pytest.mark.parametrize...
[ [ "numpy.testing.assert_allclose" ], [ "numpy.std", "numpy.mean", "numpy.ma.mask_or" ] ]
PabloAlvarado/ssgp
[ "678d2b234b7d3ca29f1c397de80abec02fec14ea" ]
[ "gpitch/covsamp.py" ]
[ "import numpy as np\nimport scipy as sp\n\n\ndef sample_cov(x, niter, msize):\n \"\"\"Infer covariance matrix by sampling segments from a large vector\"\"\"\n cov = np.zeros((msize, msize))\n samples = niter*[None]\n for i in range(niter):\n idx = np.random.randint(0, x.size - msize) # sample st...
[ [ "numpy.sqrt", "numpy.abs", "numpy.eye", "numpy.matmul", "numpy.max", "scipy.optimize.minimize", "numpy.outer", "numpy.zeros", "numpy.random.randint" ] ]
yeyupiaoling/PaddlePaddle-MTCNN
[ "8e59368470fb2f54bbea8e5bd3d1e9a71db48e48" ]
[ "train_ONet/generate_ONet_data.py" ]
[ "import os\nimport pickle\nimport sys\n\nimport cv2\nimport numpy as np\nimport paddle\nfrom tqdm import tqdm\n\nsys.path.append(\"../\")\n\nfrom utils.data_format_converter import convert_data\nfrom utils.utils import py_nms, combine_data_list, crop_landmark_image, delete_old_img, pad, processed_image\nfrom utils....
[ [ "numpy.ones_like", "numpy.minimum", "numpy.round", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.where", "numpy.vstack" ] ]
joAschauer/evaluating_methods_for_reconstructing_large_gaps_in_historic_snow_depth_time_series
[ "e0763f77369f85fec6fd5d84a4da0b4aa95f862b", "e0763f77369f85fec6fd5d84a4da0b4aa95f862b" ]
[ "src/cv_evaluate_monthly.py", "src/cv_results_database.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed May 5 09:22:49 2021\n\n@author: aschauer\n\"\"\"\n\n\"\"\"\nevaluate monthly means and max\n\"\"\"\nimport os\nimport logging\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport seaborn as sns\nfrom sklearn.m...
[ [ "numpy.polyfit", "matplotlib.pyplot.tight_layout", "sklearn.metrics.r2_score", "pandas.read_pickle", "pandas.concat", "sklearn.metrics.mean_squared_error", "matplotlib.pyplot.close", "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.show" ], [ "pandas.concat", ...
bambi1202/bvhTraceDrawer
[ "99f6324e8bfeff363e4fbceceda5c6bdcab61c76" ]
[ "test1.py" ]
[ "import numpy as np\nimport similaritymeasures\nimport matplotlib.pyplot as plt\n\n# Generate random experimental data\nx = np.random.random(5)\ny = np.random.random(5)\nz = np.random.random(5)\nexp_data = np.zeros((5, 3))\n\nexp_data[:, 0] = x * 10\nexp_data[:, 1] = y * 10\nexp_data[:, 2] = z * 10\n\nsubz = np.arr...
[ [ "numpy.random.random", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
daxxog/GamestonkTerminal
[ "2227c99f5d7c080191a4b4dd66691596bd4d677b" ]
[ "terminal.py" ]
[ "#!/usr/bin/env python\n\nimport argparse\n\nimport sys\nimport os\nfrom datetime import datetime, timedelta\nimport pandas as pd\nfrom alpha_vantage.timeseries import TimeSeries\nfrom prompt_toolkit.completion import NestedCompleter\n\nfrom gamestonk_terminal import config_terminal as cfg\nfrom gamestonk_terminal ...
[ [ "pandas.DataFrame" ] ]
kraktos/Eagle
[ "00e0bfe3c5be208ed609d865ac13bba61282884f" ]
[ "eagle/core.py" ]
[ "import logging\nfrom scipy import misc\nfrom scipy import ndimage\nfrom skimage import exposure\n\nimport pylab\n\nimport matplotlib.pyplot as plt\nimport matplotlib\nmatplotlib.use(\"gtk\")\n\n_logger = logging.getLogger(__name__)\n\n\nclass ImageConverter:\n def __init__(self, img):\n self.name = img\n...
[ [ "scipy.misc.imsave", "matplotlib.use", "scipy.ndimage.gaussian_filter", "scipy.misc.imread" ] ]
schneider-p/3D-BoNet
[ "70dbc5281bf93766433969e893f4eb0ac5d0f1ec" ]
[ "helper_data_scannet_prepare.py" ]
[ "from plyfile import PlyData, PlyElement\nimport numpy as np\nimport os\nimport json\nimport shutil\nimport csv\n\n### nyu40 class\nCLASS_LABELS = ['wall', 'floor', 'cabinet', 'bed', 'chair', 'sofa', 'table', 'door', 'window', 'bookshelf', 'picture',\n 'counter', 'blinds',\n 'desk', 's...
[ [ "numpy.concatenate", "numpy.savez_compressed", "numpy.array", "numpy.zeros" ] ]
wwwennie/spectra_fit
[ "9c594aeda9d0b5c67c91b62d49fbd4af75442433" ]
[ "truncdata.py" ]
[ "#!/usr/bin/python\n\n# created by: Wennie Wang (wwwennie@gmail.com)\n# created on: 20 July 2016\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.interpolate import interp1d\n\n#==============================#\n#========= USER INPUTS ========#\n#==============================#\n\ndef trunc_data(fi...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.draw", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.pause", "numpy.loadtxt", "matplotlib.pyplot.figure" ] ]
TomHilder/pymcfost
[ "90f9e58308ec8a089100b58f805c288acd3527e9" ]
[ "pymcfost/SED.py" ]
[ "import os\nimport astropy.io.fits as fits\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as colors\nimport numpy as np\n\ntry:\n import mpl_scatter_density\nexcept ImportError:\n print('WARNING: mpl_scatter_density is not present')\n\nfrom .parameters import Params, find_parameter_file\nfrom .dis...
[ [ "matplotlib.colors.LogNorm", "numpy.sqrt", "matplotlib.pyplot.xscale", "matplotlib.pyplot.cla", "matplotlib.pyplot.loglog", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.su...
vb690/bayesian_ANN
[ "c7b11469108c5519849e12e3f44c9b2c95de1bf6" ]
[ "modules/viz_utils.py" ]
[ "import numpy as np\n\nfrom scipy.stats import sem\nfrom scipy.stats import median_abs_deviation as mad\n\nfrom sklearn.calibration import calibration_curve\n\nimport umap\nimport umap.aligned_umap\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Circle\nimport seaborn as sns\n\...
[ [ "matplotlib.pyplot.yticks", "matplotlib.pyplot.tight_layout", "sklearn.calibration.calibration_curve", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.title", "numpy.unique", "numpy.vstack", "numpy.median", "matplotlib.pyplot.subplots", "numpy.argwhere", "scipy.stats.m...
YueNing/AI_View
[ "81ab768ca757764061bc5c4fdf3eb89367079327", "81ab768ca757764061bc5c4fdf3eb89367079327" ]
[ "finetune_cnn.py", "video-classification-3d-cnn-pytorch/generate_result_video/generate_result_video.py" ]
[ "import torch\nfrom torch.utils.data import DataLoader\nfrom torch.autograd import Variable\nfrom torch import nn\nimport torch.optim as optim\nimport os\nimport json\nimport argparse\nfrom dataloader import CocoDataset\nimport pretrainedmodels\nfrom pretrainedmodels import utils\n\n\nC, H, W = 3, 224, 224\n\n\ncla...
[ [ "torch.cuda.synchronize", "torch.ones", "torch.zeros", "torch.nn.MultiLabelSoftMarginLoss", "torch.utils.data.DataLoader", "torch.autograd.Variable", "torch.nn.Linear", "torch.nn.DataParallel", "torch.optim.lr_scheduler.StepLR" ], [ "numpy.array", "numpy.argmax" ]...
pkiage/credit-risk-modelling-tool
[ "74f6cdb27c8333c9cae5b08b91b5521af8e444e0" ]
[ "src/models/logistic_train_model.py" ]
[ "\nimport numpy as np\nfrom sklearn.linear_model import LogisticRegression\nfrom features.build_features import SplitDataset\nimport streamlit as st\nimport pandas as pd\n\nfrom visualization.graphs_logistic import plot_logistic_coeff_barh\n\n\n@st.cache(suppress_st_warning=True)\ndef create_clf_logistic_model(X_...
[ [ "numpy.ravel", "sklearn.linear_model.LogisticRegression", "pandas.DataFrame" ] ]
dev-SB/invisible-object
[ "22306102113479caf85fb87baade144592214f5b" ]
[ "invisible.py" ]
[ "import cv2\nimport numpy as np\nimport time\n\ncaptured_video = cv2.VideoCapture(0)\ncurrentFrame = 0\n\n\n# Define the codec and create VideoWriter object\n# uncomment to save output as video:\n\n# fourcc = cv2.VideoWriter_fourcc(*'XVID')\n# out = cv2.VideoWriter('output.avi',fourcc, 20, (640,480))\n\n\ntime.slee...
[ [ "numpy.array", "numpy.flip", "numpy.ones" ] ]
kylebarron/quantized-mesh-py
[ "98e9246ee14738a6665d7c87ce0883b6fe4b941e" ]
[ "test/test_bounding_sphere.py" ]
[ "import numpy as np\nimport pytest\n\nfrom quantized_mesh_encoder.bounding_sphere import bounding_sphere\n\n\ndef test_bounding_sphere_unit_cube():\n \"\"\"Test bounding sphere of the unit cube\n\n Here the naive implementation _does_ find the minimal bounding sphere.\n \"\"\"\n positions = [\n -...
[ [ "numpy.sqrt", "numpy.array", "numpy.linalg.norm" ] ]
nijinjose/The-Supervised-Learning-Workshop
[ "33a2fec1e202dc1394116ed7a194bd8cabb61d49" ]
[ "Chapter03/unittests/testActivity3_05.py" ]
[ "import unittest\nimport os\nimport pandas as pd\nimport numpy as np\nfrom sklearn.metrics import r2_score\nfrom sklearn.linear_model import SGDRegressor\n\nclass TestingActivity3_05(unittest.TestCase):\n def setUp(self) -> None:\n ROOT_DIR = os.path.dirname(os.path.abspath(__file__))\n\n self.data...
[ [ "sklearn.linear_model.SGDRegressor", "sklearn.metrics.r2_score", "numpy.random.seed" ] ]
gongel/DeepSpeech
[ "84ea04638622dcd6a5e2fef8bf2edd50b90f4f52", "84ea04638622dcd6a5e2fef8bf2edd50b90f4f52" ]
[ "paddlespeech/t2s/exps/fastspeech2/synthesize_e2e.py", "paddlespeech/s2t/frontend/utility.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.load" ], [ "numpy.square", "numpy.min", "numpy.squeeze", "numpy.max", "numpy.load", "numpy.array" ] ]
imatiach-msft/interpret-text
[ "62a5e7406bf5c7d2df69648a278082d602e88dd6" ]
[ "python/interpret_text/experimental/common/preprocessor/glove_preprocessor.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom typing import Any, Iterable, List\nfrom interpret_text.experimental.common.base_explainer import BaseTextPreprocessor\n\nPAD = \"<PAD>\"\nUNK = \"<UNK>\"\n\n\nclass GlovePreprocessor(BaseTextPreprocessor):\n \"\"\" Glove Preprocessor to split tokens that can be pass...
[ [ "numpy.array", "numpy.sum", "pandas.DataFrame" ] ]
COHRINT/minau_tools
[ "e033a070c6934e6a0ec80c82f076625a9d336361" ]
[ "scripts/echo_axis_orientation.py" ]
[ "#!/usr/bin/env python\n\nimport rospy\nimport tf\nimport numpy as np\nfrom sensor_msgs.msg import Imu\n\ndef callback(imu):\n pose = imu\n roll, pitch, yaw = tf.transformations.euler_from_quaternion([pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w])\n\n print('RPY: ({:0.2f},...
[ [ "numpy.degrees" ] ]
MartinSmeyer/bop_toolkit
[ "fb726efcf504be2fa1c381e2484601c47b32e79c" ]
[ "scripts/vis_est_poses.py" ]
[ "# Author: Tomas Hodan (hodantom@cmp.felk.cvut.cz)\n# Center for Machine Perception, Czech Technical University in Prague\n\n\"\"\"Visualizes object models in pose estimates saved in the BOP format.\"\"\"\n\nimport os\nimport numpy as np\nimport itertools\n\nfrom bop_toolkit_lib import config\nfrom bop_toolkit_lib ...
[ [ "numpy.dstack" ] ]
jmborr/sasmodels
[ "bedb9b0fed4f3f4bc2bbfa5878de6f2b6fdfbcc9" ]
[ "sasmodels/models/core_shell_parallelepiped.py" ]
[ "r\"\"\"\nDefinition\n----------\n\nCalculates the form factor for a rectangular solid with a core-shell structure.\nThe thickness and the scattering length density of the shell or \n\"rim\" can be different on each (pair) of faces. However at this time\nthe 1D calculation does **NOT** actually calculate a c face r...
[ [ "numpy.cos", "numpy.sqrt", "numpy.sin" ] ]
sahil7pathak/K-means_Clustering_and_Color_Quantization
[ "f89469b412f6b41e96344a5cc9dccf54204f17f8" ]
[ "Task3.py" ]
[ "import numpy as np\r\nUBIT = 'sahilsuh'\r\nnp.random.seed(sum([ord(c) for\r\nc in UBIT]))\r\nfrom matplotlib import pyplot as plt\r\nX = np.array([[5.9, 3.2],\r\n [4.6, 2.9],\r\n [6.2, 2.8],\r\n [4.7, 3.2],\r\n [5.5, 4.2],\r\n [5.0, 3.0],\r\n [4.9, 3.1],\r\n [6.7, 3.1],\r\n [5.1, 3....
[ [ "matplotlib.pyplot.scatter", "numpy.array_equal", "numpy.linalg.norm", "matplotlib.pyplot.savefig", "matplotlib.pyplot.clf", "numpy.mean", "matplotlib.pyplot.text", "numpy.array", "numpy.zeros" ] ]
deadpoolssr/MyCTR
[ "4326931f3d2495b38b916d21e6791f93711ea22c" ]
[ "examples/annoytest.py" ]
[ "from annoy import AnnoyIndex\nimport random\nimport time\nimport numpy as np\n\nf = 40\nt = AnnoyIndex(f, 'angular') # Length of item vector that will be indexed\nfor i in range(100):\n v = np.random.randn(f)\n t.add_item(i, v)\nstartTime = time.time()\nt.build(1000) # 10 trees\nt.save('test.ann')\n\n# ...\...
[ [ "numpy.random.randn" ] ]
yashin-alexander/MiDaS
[ "d87c97bb30c977403b0c4e4bd37e55e542ecccfc" ]
[ "tf/utils.py" ]
[ "import numpy as np\nimport sys\nimport cv2\n\n\ndef write_pfm(path, image, scale=1):\n \"\"\"Write pfm file.\n Args:\n path (str): pathto file\n image (array): data\n scale (int, optional): Scale. Defaults to 1.\n \"\"\"\n\n with open(path, \"wb\") as file:\n color = None\n\...
[ [ "numpy.flipud", "numpy.finfo" ] ]
alabamagan/maxillary_sinus_diagnosis_toolkit
[ "2529578a35f16787d63dfc18a37c9a19738dd665" ]
[ "msdtk/img_proc/normalize.py" ]
[ "import torchio as tio\nimport SimpleITK as sitk\nimport nibabel\nimport os\nimport numpy as np\nimport multiprocessing as mpi\nimport torchio as tio\nfrom pathlib import Path\n\nfrom pytorch_med_imaging.logger import Logger\nfrom typing import Union, Callable, Iterable, Optional\n\n__all__ = ['resample_to_standard...
[ [ "numpy.asarray", "numpy.load", "numpy.save", "numpy.isclose" ] ]
prashankkadam/POMDPy
[ "845334abe75538b1c7eee15c3df86897c15a0e43" ]
[ "pomcp.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import print_function\nfrom pomdpy import Agent\nfrom pomdpy.solvers import POMCP\nfrom pomdpy.log import init_logger\nfrom examples.rock_sample import RockModel\nimport argparse\nimport numpy as np\n\n# prashank\n\nif __name__ == '__main__':\n\n parser = argparse.Argument...
[ [ "numpy.random.seed" ] ]
vardhman1996/text_categorization
[ "23847d2f81e98a26743c7cda90125581ab5eaecf" ]
[ "train_model.py" ]
[ "from data_layer import FeaturizeData\nfrom sklearn import linear_model\nfrom sklearn.utils import class_weight\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom sklearn.metrics import classification_report\nimport matplotlib\nmatplotlib.use...
[ [ "torch.LongTensor", "torch.nn.functional.log_softmax", "torch.cat", "numpy.unique", "matplotlib.use", "torch.nn.functional.nll_loss", "torch.argmax", "torch.Tensor", "matplotlib.pyplot.savefig", "torch.nn.Linear", "torch.no_grad", "torch.cuda.is_available", "tor...
zhaoyuchen2018/Paddle
[ "2cd3abdc91b3bbcae6cb4d752f872258aa0ce06a" ]
[ "python/paddle/fluid/tests/unittests/test_gru_cudnn_op.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 ...
[ [ "numpy.reshape", "numpy.set_printoptions", "numpy.matmul", "numpy.concatenate", "numpy.copy", "numpy.exp", "numpy.random.RandomState", "numpy.zeros" ] ]
ehoehn/spectroscopy-data-evaluation
[ "c2ebfc55e2887d0bc76587c9215bd36cc9056d26", "c2ebfc55e2887d0bc76587c9215bd36cc9056d26" ]
[ "Oszilloskop/Oszi-Data to Graph all Channels universal.py", "Ramanspektren/erstesPaper/graph Wasserfall gestaucht.py" ]
[ "'''\nimput file: .csv-Datei aus Osziloskop\noutput file: #eine Datei mit allen Kennzahlen, die nach Glattung einer berechnet wurden\n'''\n#written by EvaMaria Hoehn\n\n\nimport os\nimport numpy as np\nimport pandas as pd\nimport scipy.signal\nimport plotly\nfrom plotly import graph_objs as go\n#import lib.plotlygr...
[ [ "pandas.read_csv", "pandas.to_numeric" ], [ "pandas.read_csv", "numpy.float64", "pandas.DataFrame" ] ]
marykthompson/ribopop_rnaseq
[ "6125bc15657491f14d99fd192a711110884e8c11" ]
[ "scripts/abundance_by_gene.py" ]
[ "'''\nabundance_by_gene.py\n- Collapse the Kallisto transcript quantification to gene quantification.\n- Calculate totals of primary and mature transcripts as summed tpm and summed\nestimated counts.\n'''\n\nimport pandas as pd\n\ntxt_2_gene_file = snakemake.input['txt_2_gene_file']\nwith open(txt_2_gene_file, 'r')...
[ [ "pandas.concat", "pandas.read_csv", "pandas.Series" ] ]
ibaiGorordo/depthai
[ "57b437f38ebe80e870ee4852ca7ccc80eaaa76cc" ]
[ "depthai_helpers/calibration_utils.py" ]
[ "#!/usr/bin/env python3\n\nimport cv2\nimport glob\nimport os\nimport shutil\nimport numpy as np\nimport re\nimport time\nimport json\nimport cv2.aruco as aruco\nfrom pathlib import Path\n# Creates a set of 13 polygon coordinates\n\n\ndef setPolygonCoordinates(height, width):\n horizontal_shift = width//4\n v...
[ [ "numpy.linalg.inv", "numpy.set_printoptions", "numpy.eye", "numpy.matmul", "numpy.copy", "numpy.array", "numpy.zeros", "numpy.where" ] ]
Lyken17/Colorize.PyTorch
[ "9d352c52dc879988e2eb518261bc45e8216ffed6" ]
[ "utils.py" ]
[ "import os\nimport sys\n\nimport numpy as np\nimport torch\nfrom PIL import Image\nfrom torch.autograd import Variable\nfrom torch.utils.serialization import load_lua\n\nfrom vgg16 import Vgg16\n\n\ndef tensor_load_rgbimage(filename, size=None, scale=None):\n img = Image.open(filename)\n if size is not None:\...
[ [ "torch.cat", "torch.from_numpy", "torch.chunk", "numpy.array", "torch.autograd.Variable" ] ]
talkhaldi/transformers
[ "c0328a6c263494fff527fac7288faa627e3267e0", "c0328a6c263494fff527fac7288faa627e3267e0", "c0328a6c263494fff527fac7288faa627e3267e0" ]
[ "examples/seq2seq/run_translation.py", "examples/seq2seq/run_summarization.py", "examples/text-classification/run_xnli.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n# Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ...
[ [ "numpy.mean", "numpy.where", "numpy.count_nonzero" ], [ "numpy.mean", "numpy.where", "numpy.count_nonzero" ], [ "numpy.argmax" ] ]
biggorilla-gh/frameit
[ "9cae56b4089fff6c955f8b86c699aa402a1390ac" ]
[ "frameit/models/model.py" ]
[ "import json\nimport numpy as np\nfrom random import shuffle\n\nfrom frameit import Utterance\nfrom frameit.models.model_utils import to_categorical\nfrom frameit.models.model_utils import build_cnn_model, EMBEDDING_DIM\nfrom frameit.models.model_utils import dict_to_keras_model\nfrom frameit.models.model_utils imp...
[ [ "numpy.asarray", "numpy.zeros" ] ]
dongxinshuai/ASCC
[ "f4f6115236831eca7570df48d21a6399b9c62b5d" ]
[ "models/LSTMBI.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch\nfrom torch.autograd import Variable\n#from memory_profiler import profile\nfrom models.BaseModel import BaseModel\nfrom models.BaseModelAdv import AdvBaseModel\n\n\n\nclass AdvLSTMBI(AdvBaseModel): \n def __init__(s...
[ [ "torch.mean", "torch.nn.Parameter", "torch.nn.LSTM", "torch.zeros", "torch.nn.Embedding", "torch.nn.Linear", "torch.cuda.is_available" ] ]
anhydrous99/Rainbow
[ "0e259b13412d2edbd94337f5e0a0e22757f6b7aa" ]
[ "setup.py" ]
[ "from distutils.core import setup\nfrom Cython.Build import cythonize\nfrom distutils.extension import Extension\nimport numpy\nimport sys\n\nif sys.platform == 'win32':\n c_options = ['/O2', '/fp:fast', '/arch:AVX2']\nelse:\n c_options = ['-Ofast', '-march=native']\n\nextensions = [\n Extension(\"segment_...
[ [ "numpy.get_include" ] ]
IrisWangHe/maddpg
[ "f155df9d2660419c5c94bc133b7debe256636d8c" ]
[ "maddpg/trainer/replay_buffer.py" ]
[ "import numpy as np\nimport random\n\nclass ReplayBuffer(object):\n def __init__(self, size):\n \"\"\"Create Prioritized Replay buffer.\n\n Parameters\n ----------\n size: int\n Max number of transitions to store in the buffer. When the buffer\n overflows the old...
[ [ "numpy.array", "numpy.random.shuffle" ] ]
yuzhenmao/dataprep
[ "1dbcddbf084ed49f719fe01f61d3e5e1ec418715", "1dbcddbf084ed49f719fe01f61d3e5e1ec418715" ]
[ "dataprep/eda/diff/compute/multiple_df.py", "dataprep/eda/missing/render.py" ]
[ "# pylint: disable=unused-import\n# type: ignore\n\"\"\"Computations for plot_diff([df1, df2, ..., dfn]).\"\"\"\n\nfrom collections import UserList, OrderedDict\nfrom typing import Any, Callable, Dict, List, Tuple, Union, Optional\n\nimport pandas as pd\nimport numpy as np\nimport dask\nimport dask.array as da\nimp...
[ [ "pandas.to_timedelta", "pandas.Grouper", "pandas.Series" ], [ "pandas.DataFrame", "numpy.ones" ] ]