repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
azopticsinc/optical-neural-network
[ "28280014a6c1fc717a5077ed5e3c3496a4b103ac" ]
[ "codes/ONNet/case_brain.py" ]
[ "'''\n@Author: Yingshi Chen\n\n@Date: 2020-04-08 17:12:34\n@\n# Description: \n'''\nimport torch\nfrom torch.utils.data import Dataset\nfrom torchvision.transforms import ToPILImage\nimport os\nimport math\nimport hdf5storage\nfrom enum import Enum\nimport re\nfrom torchvision.transforms import transforms\nimport c...
[ [ "numpy.max", "torch.ones_like", "numpy.min" ] ]
hephaex/data-validation
[ "21543a6896e4630aeb8b569e79e7a7cc03a3c565" ]
[ "tensorflow_data_validation/utils/bin_util_test.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.testing.assert_array_equal" ] ]
ForrestPi/DefectDetection
[ "7e999335ffbd50519cdfaba7de0d6bfa306a579a" ]
[ "RoadCrackSegmentation/get_plot.py" ]
[ "# -*- coding: UTF-8 -*-\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport os\n\ndef get_loss_list(model):\n dir = os.path.join('checkpoint', model)\n files = os.listdir(dir)\n sorted(files)\n\n index =[]\n losses = []\n acc =[]\n for i,x in enumerate(files)...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
Adrimeov/keras-malicious-url-detector
[ "22b8d075b41117f016100bb5ebff14a77907dacb" ]
[ "keras_malicious_url_detector/library/utility/url_data_loader.py" ]
[ "import pandas as pd\nimport os\n\n\ndef load_url_data(data_dir_path):\n url_data = pd.read_csv(data_dir_path, sep=',')\n\n url_data.columns = ['text', 'label']\n\n class_zero = url_data[url_data['label'] == 0].reset_index()\n class_one = url_data[url_data['label'] == 1].reset_index()\n\n class_zero ...
[ [ "pandas.concat", "pandas.read_csv" ] ]
ska-telescope/katpoint
[ "0e94e17db179065835c701ddaba079854eb1e7e5" ]
[ "katpoint/conversion.py" ]
[ "################################################################################\n# Copyright (c) 2009-2020, National Research Foundation (SARAO)\n#\n# Licensed under the BSD 3-Clause License (the \"License\"); you may not use\n# this file except in compliance with the License. You may obtain a copy\n# of the Lice...
[ [ "numpy.sqrt", "numpy.abs", "numpy.char.rstrip", "numpy.cos", "numpy.sin", "numpy.arctan2", "numpy.isscalar", "numpy.mod", "numpy.hypot", "numpy.char.add" ] ]
nathangrinsztajn/RL_for_dynamic_scheduling
[ "04e7d7dda192a168aa22d226a348fb2114f4fba4" ]
[ "a2c/a2c.py" ]
[ "import itertools\nimport time\nimport numpy as np\nimport os\nimport pandas as pd\nimport random\nfrom copy import deepcopy\nimport torch\nimport torch.nn.functional as F\nfrom torch import optim\nfrom torch.optim.lr_scheduler import CyclicLR, LambdaLR\n# from torch_geometric.data import Batch\n\nfrom joblib impor...
[ [ "torch.optim.lr_scheduler.CyclicLR", "torch.optim.lr_scheduler.LambdaLR", "numpy.random.seed", "torch.load", "torch.zeros", "torch.manual_seed", "torch.multinomial", "torch.tensor", "numpy.zeros_like", "numpy.mean", "torch.save", "torch.device", "numpy.empty", ...
adrianosantospb/estrutura_base_pytorch
[ "36a6a45d39c312513645337802dea95b78cdb9ab" ]
[ "estrutura2/model.py" ]
[ "# Estrutura básica para projetos de Machine Learning e Deep Learning\n# Por Adriano Santos.\n\nfrom torch import nn, relu\n\nclass Model(nn.Module):\n def __init__(self, input_size, hidden_1, hidden_2, output_size):\n super(Model, self).__init__()\n self.entry = nn.Linear(input_size, hidden_1)\n ...
[ [ "torch.nn.Linear" ] ]
jzitovsky/batch_rl
[ "ded5703784f896c0f3c31cfcf84514abe7f59606" ]
[ "batch_rl/tests/atari_init_test.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v1.test.main" ] ]
MoMagDii/VAUV-simulator
[ "56f55f9349e38e0a327a40feb5a437fcad511b00", "56f55f9349e38e0a327a40feb5a437fcad511b00" ]
[ "uuv_control/uuv_trajectory_control/scripts/rov_nmb_sm_controller.py", "uuv_control/uuv_trajectory_control/scripts/rov_pid_controller.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) 2020 The Plankton Authors.\n# All rights reserved.\n#\n# This source code is derived from UUV Simulator\n# (https://github.com/uuvsimulator/uuv_simulator)\n# Copyright (c) 2016-2019 The UUV Simulator Authors\n# licensed under the Apache license, Version 2.0\n# cf. 3rd-party-...
[ [ "numpy.hstack", "numpy.multiply", "numpy.sign", "numpy.array", "numpy.exp", "numpy.zeros" ], [ "numpy.zeros" ] ]
TRex22/picam
[ "591ffe3aaccb648e470f2335506f402f94fb34f4" ]
[ "src/overlay_handler.py" ]
[ "import numpy as np\r\nfrom PIL import Image\r\n\r\nimport math\r\n\r\nfrom picamerax import mmal\r\n\r\n# Modules\r\nimport mmal_handler\r\n\r\ndef compute_shutter_speed_from_us(us):\r\n one_second = 1000000\r\n\r\n if us == 0:\r\n return 'auto'\r\n\r\n converted_seconds = math.ceil(one_second/us)\r\n\r\n i...
[ [ "numpy.zeros" ] ]
SethuEapen/Real_life_Sharingan
[ "fb7d7e2b29137a44ef396395a8e77177d0ebffc7" ]
[ "sharingen_run.py" ]
[ "import cv2\nimport tensorflow as tf\n\nfont = cv2.FONT_HERSHEY_SIMPLEX \norg = (50, 50)\nfontScale = 1\ncolor = (255, 0, 0)\nthickness = 2\nCATEGORIES = [\"boar\", \"ox\"]\nIMG_SIZE = 50\n\n\n\ndef prepare(image):\n\t#img_array = cv2.imread(image, cv2.IMREAD_GRAYSCALE)\n\tnew_array = cv2.resize(image, (IMG_SIZE, I...
[ [ "tensorflow.keras.models.load_model" ] ]
mgeier/ipyvolume
[ "16ab04eaf7e27801aec1a43cbdcdb6a6063a9145" ]
[ "ipyvolume/pylab.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\n_last_figure = None\nimport ipywidgets\nfrom IPython.display import display\nimport IPython\nimport ipyvolume as ipv\nimport ipyvolume.embed\nimport os\nimport numpy as np\nfrom . import utils\nimport time\nfrom . import examples\nimport warn...
[ [ "numpy.nanmax", "numpy.radians", "numpy.sqrt", "numpy.isfinite", "numpy.arcsin", "numpy.min", "numpy.median", "numpy.nanmin", "numpy.percentile", "numpy.arctan2", "numpy.max", "numpy.diff", "numpy.ravel", "numpy.array", "numpy.zeros", "numpy.where" ...
johnehunt/PythonDataScienceIntro
[ "73dc6938c65c6b64486d3e6c6f968fa99976d90a" ]
[ "06-pandas-data-wrangling/iris_data_processing.py" ]
[ "import pandas as pd\n\niris_df = pd.read_csv('iris.csv')\n\nprint(iris_df.head())\nprint(iris_df.shape)\n\nprint('-' * 25)\n\n# find out information about unique values in the sample\nprint(iris_df.sepallength.unique()) # give the unique values\nprint(iris_df.sepallength.nunique()) # count the unique values\n\np...
[ [ "pandas.read_csv" ] ]
geekpineapple/ElegantRL
[ "d8fe318a0dbba0a9f85be9291d8a5397823d5d33" ]
[ "elegantrl_helloworld/agent.py" ]
[ "import os\nimport numpy.random as rd\nfrom copy import deepcopy\nfrom elegantrl_helloworld.net import *\n\n\nclass AgentBase:\n def __init__(self):\n self.state = None\n self.device = None\n self.action_dim = None\n self.if_off_policy = None\n self.explore_noise = None\n ...
[ [ "numpy.random.rand", "numpy.random.choice", "numpy.random.randint" ] ]
andrekwr/numpy
[ "e564fcbecfb0b589e224e6e66e8894105a46aedf" ]
[ "numpy/lib/tests/test_function_base.py" ]
[ "import operator\nimport warnings\nimport sys\nimport decimal\nfrom fractions import Fraction\nimport math\nimport pytest\nimport hypothesis\nfrom hypothesis.extra.numpy import arrays\nimport hypothesis.strategies as st\n\n\nimport numpy as np\nfrom numpy import ma\nfrom numpy.testing import (\n assert_, assert_...
[ [ "numpy.lib.unwrap", "numpy.sqrt", "numpy.cumsum", "numpy.all", "numpy.lib.blackman", "numpy.broadcast", "numpy.digitize", "numpy.exp", "numpy.lib.setxor1d", "numpy.sin", "numpy.diff", "numpy.insert", "numpy.zeros", "numpy.testing.assert_raises_regex", "n...
AndreaCeccarelli/gpu-monitor
[ "aad4dc88387a69235e9c370cb08da1f16ba4aa96" ]
[ "mnist.py" ]
[ "import torch as torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport numpy as np\nfrom art.utils import load_dataset\nimport art.attacks\nfrom art.classifiers import PyTorchClassifier\nfrom art.utils import load_mnist\nfrom art.utils import load_cifar10\nimport torchvi...
[ [ "torch.nn.Linear", "torch.nn.Conv2d", "torch.nn.functional.max_pool2d" ] ]
udapy/applied-ml
[ "9cd4efb5ae4b201f10c92cc1f79b64c04e99b1f7" ]
[ "tests/tagifai/test_data.py" ]
[ "# tests/tagifai/test_data.py\n# Test tagifai/data.py components.\n\nimport itertools\nimport tempfile\nfrom argparse import Namespace\nfrom collections import Counter\nfrom pathlib import Path\n\nimport numpy as np\nimport pytest\n\nfrom app import config\nfrom tagifai import data, main, utils\n\n\n@pytest.fixture...
[ [ "numpy.array", "numpy.shape" ] ]
takoyaki1116/CGCNN2
[ "5a12c19135e36ea8a642d452cfc0f8c8da5ee435" ]
[ "module/arguments.py" ]
[ "import argparse\nimport sys\n\nimport torch\n\ndef arguments():\n parser = argparse.ArgumentParser('CGCNN Combined Model Transfer Learning')\n parser.add_argument('data_options', metavar='OPTIONS', nargs='+',\n help='dataset options, started with the path to root dir, '\n ...
[ [ "torch.cuda.is_available" ] ]
Xiaziheng89/Spatial-Location-Constraint-Prototype-Loss-for-Open-Set-Recognition
[ "022b7e5a81360a8b448072999ecf2988b34055cc" ]
[ "datasets/datasets.py" ]
[ "import os\nimport torch\nimport torchvision\nfrom torch.utils.data import DataLoader\nimport torchvision.transforms as transforms\nfrom torchvision.datasets import MNIST, KMNIST\nfrom PIL import Image\n\n\nclass MNISTRGB(MNIST):\n \"\"\"MNIST Dataset.\n \"\"\"\n def __getitem__(self, index):\n img,...
[ [ "torch.utils.data.DataLoader" ] ]
SimonasJocys/retina_net
[ "c2bd3851d3de50c7b624e983187ed28429552ab4" ]
[ "keras-retinanet/keras_retinanet/bin/train.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless ...
[ [ "tensorflow.ConfigProto", "tensorflow.device", "tensorflow.Session" ] ]
sdpython/covidsim
[ "765d43ac29831f1a630ef5e187cff10f3ddc5cf1" ]
[ "examples/plot_covid_r0.py" ]
[ "# coding: utf-8\n\"\"\"\nReprésentation du R0 par départements\n=====================================\n\nCet exemple reprend des données de tests par gouvernement\npour calculer le coefficient R0 de l'épidémie. La méthode\nde Cori est utilisée avec la formule proposée dans :epkg:`covidtracker` :\n\n.. math::\n\n ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "pandas.Timedelta", "pandas.DataFrame" ] ]
iliasprc/video-augment
[ "bd95f415a22f0abc4f85d7836857cd33b211c02e" ]
[ "videoaugment/transforms/general.py" ]
[ "\nimport PIL\nimport PIL.Image\nimport torch\nimport numpy as np\nimport torchvision.transforms.functional as TF\n\nfrom einops import rearrange\n\n\nclass RearrangeTensor:\n\n\n def __call__(self, input_tensor):\n return rearrange(input_tensor, 'h w c -> c h w')\n\nclass PILToNumpy:\n def __call__(sel...
[ [ "numpy.asarray", "torch.from_numpy", "numpy.stack", "torch.stack" ] ]
cclauss/TensorFlowTTS
[ "cac7e27e9d2bf2144f6fef409675d16dd48bc158" ]
[ "tensorflow_tts/trainers/base_trainer.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2020 Minh Nguyen (@dathudeptrai)\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# Unl...
[ [ "tensorflow.train.CheckpointManager", "tensorflow.keras.mixed_precision.experimental.LossScaleOptimizer", "tensorflow.Variable", "tensorflow.summary.create_file_writer", "tensorflow.cast", "tensorflow.math.maximum", "tensorflow.function", "tensorflow.keras.metrics.Mean", "tenso...
alienbrett/numerical-eqs-collection
[ "23619bf379d53ce0facb63be08ee6a3902d404d5" ]
[ "numerical_eqs/matrix/tridiag.py" ]
[ "import numpy as np\n\n\n\n\nclass TriDiag:\n def __init__(self, a, d, b, n=None):\n if n is None:\n n = len(d)\n \n self.n = n\n self.a = np.asarray(a)\n self.b = np.asarray(b)\n self.d = np.asarray(d)\n \n \n\n\n\n\n def mult(self, x):\n '''M...
[ [ "numpy.asarray", "numpy.arange", "numpy.linalg.norm", "numpy.ones", "numpy.concatenate" ] ]
xdeng7/redwood_open3d_3dreconstruction
[ "dda9b3a0129fa6c60f913672a70ff02483dcd0f3" ]
[ "Open3D/examples/python/reconstruction_system/sensors/realsense_recorder.py" ]
[ "# Open3D: www.open3d.org\n# The MIT License (MIT)\n# See license file or visit www.open3d.org for details\n\n# examples/python/reconstruction_system/sensors/realsense_recorder.py\n\n# pyrealsense2 is required.\n# Please see instructions in https://github.com/IntelRealSense/librealsense/tree/master/wrappers/python\...
[ [ "numpy.hstack", "numpy.where", "numpy.dstack" ] ]
toraud96/sqlalchemy-challenge
[ "9e5f0f4e57d435be68ede9def8384d372d415bdf" ]
[ "sqlalchemy.app.py" ]
[ "import numpy as np\n\nimport sqlalchemy\nfrom sqlalchemy.ext.automap import automap_base\nfrom sqlalchemy.orm import Session\nfrom sqlalchemy import create_engine, func\nimport datetime as dt\n\nfrom flask import Flask, jsonify\n\n#################################################\n# Database Setup\n###############...
[ [ "numpy.ravel" ] ]
HERA-Team/casa-imaging
[ "8cad11102f0a70b51ce9d73056d6c5dab16e1a73" ]
[ "scripts/calfits_to_Bcal.py" ]
[ "#!/usr/bin/env python2.7\n\"\"\"\ncalfits_to_Bcal.py\n----------------\n\nA CASA script for converting a\ncalfits gain file into a CASA\nbandpass cal table.\n\nRun as casa -c calfits_to_Bcal.py <args>\n\nNicholas Kern\nOct. 2018\n\"\"\"\nimport pyfits\nimport os\nimport shutil\nimport numpy as np\nimport argparse\...
[ [ "numpy.asarray", "numpy.arange", "numpy.ones", "numpy.moveaxis", "numpy.isclose" ] ]
pranavjain594/Application-Rating-Prediction-and-User-Sentiment-Analysis
[ "051fa2eeb554b6764c612aaf688632afb85699a0" ]
[ "Code/reviews.py" ]
[ "# Natural Language Processing\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('googleplaystoreuserreviews.csv')\n\ndataset.dropna(inplace=True)\n\nX = dataset.iloc[:,0].values\n\n# Cleaning the texts\nimport re...
[ [ "pandas.read_csv", "sklearn.metrics.r2_score", "sklearn.linear_model.LogisticRegression", "sklearn.naive_bayes.GaussianNB", "sklearn.model_selection.cross_val_score", "sklearn.model_selection.train_test_split", "sklearn.metrics.confusion_matrix", "sklearn.feature_extraction.text.Co...
mirkobronzi/project20
[ "e7a9b52d87e21f436117c7020f167454ee78ffd6" ]
[ "project20/models/my_model.py" ]
[ "import logging\nimport torch.nn as nn\n\nfrom project20.utils.hp_utils import check_and_log_hp\n\nlogger = logging.getLogger(__name__)\n\n\nclass MyModel(nn.Module): # pragma: no cover\n \"\"\"Simple Model Class.\n\n Inherits from the given framework's model class. This is a simple MLP model.\n \"\"\"\n\...
[ [ "torch.nn.Linear" ] ]
Morgan-Gan/Slowfast-TSM
[ "ca6783df0cc9577abb1735b2cab52653d569beff" ]
[ "slowfast/datasets/utils.py" ]
[ "#!/usr/bin/env python3\n\nimport logging\nimport numpy as np\nimport os\nimport random\nimport time\nfrom collections import defaultdict\nimport cv2\nimport torch\nfrom fvcore.common.file_io import PathManager\n\nfrom . import transform as transform\n\nlogger = logging.getLogger(__name__)\n\n\ndef retry_load_image...
[ [ "torch.linspace", "numpy.zeros", "numpy.stack", "torch.tensor" ] ]
DuaneNielsen/atari-representation-learning
[ "fe34f389768416deaa6a6ff0bdebba3d05762a55" ]
[ "atariari/methods/pretrained_agents.py" ]
[ "from a2c_ppo_acktr import utils\nfrom a2c_ppo_acktr.envs import make_vec_envs as mve\nfrom collections import deque\nfrom itertools import chain\nimport numpy as np\nimport torch\nimport wandb\nimport time\nimport os\n\nfrom atariari.benchmark.envs import make_vec_envs\nfrom atariari.benchmark.episodes import chec...
[ [ "torch.load", "torch.zeros", "torch.tensor", "torch.no_grad", "numpy.mean", "numpy.random.uniform", "numpy.random.randint" ] ]
khwilson/EconML
[ "80264390106a8c57e2286177a2c4f8a47b51a32e", "80264390106a8c57e2286177a2c4f8a47b51a32e" ]
[ "monte_carlo_tests/monte_carlo_statsmodels.py", "econml/deepiv.py" ]
[ "import numpy as np\r\nfrom econml.dml import LinearDMLCateEstimator\r\nfrom sklearn.linear_model import LinearRegression, MultiTaskLassoCV, MultiTaskLasso, Lasso\r\nfrom econml.inference import StatsModelsInference\r\nfrom econml.tests.test_statsmodels import _summarize\r\nfrom econml.sklearn_extensions.linear_mod...
[ [ "sklearn.ensemble.RandomForestRegressor", "numpy.sqrt", "numpy.concatenate", "numpy.mean", "numpy.hstack", "numpy.arange", "sklearn.ensemble.GradientBoostingRegressor", "numpy.std", "matplotlib.pyplot.close", "numpy.repeat", "numpy.zeros", "matplotlib.pyplot.figure"...
IvoAA/dl2
[ "f656d24b3d227a35b4fc9e0094150fbe17d055ce" ]
[ "training/supervised/oracles.py" ]
[ "import numpy as np\nimport torch\n\nclass DL2_Oracle:\n\n def __init__(self, learning_rate, net, constraint, use_cuda):\n self.learning_rate = learning_rate\n self.net = net\n self.constraint = constraint\n self.use_cuda = use_cuda\n\n def attack(self, x_batch, y_batch, domains, n...
[ [ "numpy.sign", "torch.mean", "numpy.mean" ] ]
usc-isi-i2/datamart-upload
[ "c27a3d745daabb2d24681d8224bec140b6a4a7b9" ]
[ "datamart_isi/upload/file_parsers/csv_parser.py" ]
[ "import logging\nimport pandas as pd\nimport time\nimport wikifier\nimport typing\nimport hashlib\nimport json\nimport os\n\nfrom .parser_base import ParserBase, PreParsedResult\nfrom pandas.util import hash_pandas_object\n\nfrom datamart_isi.materializers.general_materializer import GeneralMaterializer\nfrom datam...
[ [ "pandas.util.hash_pandas_object", "pandas.read_csv", "pandas.to_datetime", "pandas.isnull" ] ]
ege-k/nlp4nethack
[ "8b8b45a2f0be09c5233b33a47f421906e9e4b561", "8b8b45a2f0be09c5233b33a47f421906e9e4b561" ]
[ "nethack_baselines/torchbeast/models/baseline_tensorized.py", "test_submission.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\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 app...
[ [ "torch.nn.functional.softmax", "torch.cat", "torch.zeros", "torch.load", "torch.nn.ELU", "torch.sum", "torch.nn.Embedding", "torch.no_grad", "torch.nn.MultiheadAttention", "torch.sqrt", "torch.nn.MaxPool1d", "torch.nn.Sequential", "torch.nn.Conv2d", "torch.u...
amirshnll/Wine
[ "673c879bbea6d0b5313f52f028ea983d0807830c" ]
[ "knn.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\n# Author : Amir Shokri\n# github link : https://github.com/amirshnll/Wine\n# dataset link : http://archive.ics.uci.edu/ml/datasets/Wine\n# email : amirsh.nll@gmail.com\n\n\n# In[1]:\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd...
[ [ "pandas.read_csv", "sklearn.metrics.accuracy_score", "sklearn.model_selection.train_test_split", "sklearn.neighbors.KNeighborsClassifier" ] ]
nils-werner/pytorch-lightning
[ "f36b395c4eb4c8d113954d768444194b3729be28" ]
[ "tests/utilities/test_auto_restart.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.multiprocessing.spawn", "torch.cat", "torch.load", "numpy.in1d", "torch.cuda.is_available", "torch.allclose", "numpy.random.randint", "torch.Generator", "torch.utils.data.DistributedSampler", "torch.distributed.init_process_group", "torch.testing.assert_allclose"...
NicholasCorrado/stable-baselines3
[ "77793947335c6b14747c2c5179a7c05c93289ffd" ]
[ "stable_baselines3/td3_latent/td3_latent.py" ]
[ "from typing import Any, Dict, List, Optional, Tuple, Type, Union\n\nimport gym\nimport numpy as np\nimport torch as th\nfrom torch.nn import functional as F\n\nfrom stable_baselines3.common.buffers import ReplayBuffer\nfrom stable_baselines3.common.noise import ActionNoise, OrnsteinUhlenbeckActionNoise\nfrom stabl...
[ [ "torch.nn.functional.mse_loss", "torch.no_grad", "torch.min", "numpy.mean" ] ]
Shreya2297/t4
[ "1e9d83feeb874d637f2a2742e8f2b34cc54b5465" ]
[ "task- creating and merging images.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[21]:\n\n\n#importing libraries\nimport numpy as np\nimport cv2 as cv\n\n\n# In[23]:\n\n\n#creating a blank black colored image\nblank=np.zeros((500,500,3),dtype='uint8') \n#creating a rectangle on left side vertically\nblank=cv.rectangle(blank,(0,0),(250,500),(49,99,5...
[ [ "numpy.hstack", "numpy.zeros" ] ]
Dani7B/claimed
[ "d6323602337a7a5702432a547bf2b0e7177c76bd" ]
[ "coursera_ml/fourier_transform/disc_ft.py" ]
[ "\"\"\"\n(C) 2018 Nikolay Manchev\n\nThis work is licensed under the Creative Commons Attribution 4.0 International\nLicense. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.\n\"\"\"\n\n\nimport numpy as np\n\nimport matplotlib.pyplot as plt\n\nimport math\n\nfrom numpy.fft import ...
[ [ "numpy.sqrt", "numpy.fft.fft", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.sin", "matplotlib.pyplot.show", "matplotlib.pyplot.style.use" ] ]
wuweialways17/EE5904-neural-networks
[ "ec733a725de3631b3d364ceae13a76a24171f184" ]
[ "HW1/Q4/LMS.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Jan 28 17:37:39 2021\r\n\r\n@author: wwis17\r\n\"\"\"\r\n\"\"\"LMS method\"\"\"\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# x = [bias, x]\r\nX = np.array([[1,0.5],[1,1.5],[1,3.0],[1,4.0],[1,5.0]])\r\n\r\nd = np.array([8.0,6.0,5,2,0.5])\r\n\r...
[ [ "numpy.dot", "matplotlib.pyplot.tight_layout", "numpy.reshape", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.copy", "numpy.append", "numpy.array" ] ]
nicogab34/AudioMNIST
[ "39d8bf5eb2bf5d8a32d21d3d5549935cb4a62931" ]
[ "audiomnist/io/preprocess_data.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport glob\nimport os\nimport sys\nimport scipy.io.wavfile as wavf\nimport scipy.signal\nimport h5py\nimport json\nimport librosa\nimport tensorflow as tf\nfrom tqdm import tqdm\n\ntf.enable_eager_execution()\n\n# The following functions can be used to convert a valu...
[ [ "tensorflow.enable_eager_execution", "numpy.abs", "numpy.percentile", "numpy.atleast_3d", "tensorflow.train.BytesList", "tensorflow.train.FloatList", "tensorflow.train.Features", "numpy.zeros", "scipy.io.wavfile.read", "tensorflow.train.Int64List" ] ]
seqRep/dgl-lifesci
[ "c4bd45be6dbb59dc270957ed90bb19d9ed6dc157" ]
[ "examples/molecule_embeddings/main.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: Apache-2.0\n\nimport dgl\nimport errno\nimport numpy as np\nimport os\nimport torch\n\nfrom dgl.nn.pytorch.glob import AvgPooling\nfrom dgllife.model import load_pretrained\nfrom dgllife.uti...
[ [ "pandas.read_csv", "torch.cat", "torch.utils.data.DataLoader", "numpy.save", "torch.no_grad", "torch.cuda.is_available", "torch.device", "numpy.array" ] ]
mortendaehli/min-symaskin-inventory-utils
[ "a573f4723eb4153d0421272a55bcc50e5a78861e" ]
[ "main.py" ]
[ "import os\nimport pathlib\nimport logging\nfrom pathlib import Path\n\nimport pandas as pd\nimport shopify\nfrom dotenv import load_dotenv\n\nlogging.basicConfig(format='%(asctime)s | %(name)s | %(levelname)s | %(message)s')\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.DEBUG)\n\n\ndef get_all_res...
[ [ "pandas.read_excel", "pandas.to_datetime" ] ]
Miyembe/multiagent-particle-envs
[ "971756f6c99c8e18f34a4dadbf65486dea08d47a" ]
[ "pheromone_multi.py" ]
[ "#!/usr/bin/env python\n# Node that handles pheromone layer\n# Subscriber - Robot (x, y) position\n# Publisher - Pheromone value at (x, y)\nimport os\nimport numpy as np\n\nfrom math import *\nimport time\nfrom npsocket_sn import SocketNumpyArray\n\nclass Node():\n\n def __init__(self, phero):\n self.num_...
[ [ "numpy.asarray", "numpy.save", "numpy.copy", "numpy.load", "numpy.zeros" ] ]
StepNeverStop/Staged-Experience-Mechanism
[ "52bd0edf352b7d07f5d0ae25aac857f39976c523" ]
[ "gym/gym/wrappers/pixel_observation.py" ]
[ "\"\"\"An observation wrapper that augments observations by pixel values.\"\"\"\n\nimport collections\nimport copy\n\nimport numpy as np\n\nfrom gym import spaces\nfrom gym import ObservationWrapper\n\nSTATE_KEY = 'state'\n\n\nclass PixelObservationWrapper(ObservationWrapper):\n \"\"\"Augment observations by pix...
[ [ "numpy.issubdtype" ] ]
ehthiede/python-pygelib
[ "8140ce7ab05a47dad202b2b7f1e8aee5309723e2" ]
[ "src/pygelib/SO3TensorArray.py" ]
[ "import torch\nimport operator\n\n\nclass SO3TensorArray(object):\n \"\"\"\n Base class for a collection of tensors, each of which is associated with a\n specific value of ell.\n \"\"\"\n def __init__(self, data):\n if isinstance(data, type(self)):\n data = data.data\n else:\...
[ [ "torch.stack", "torch.allclose", "torch.zeros_like" ] ]
shrija14/Multilingual-Deep-Neural-Math-Word-Problem-Solver
[ "3d37cd3fd8e6493a87c95ed25406f65ad7070868" ]
[ "FirstStage/src/model/attention_1.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass Attention_1(nn.Module):\n def __init__(self, dim):\n super(Attention_1, self).__init__()\n self.linear_out = nn.Linear(dim*2, dim)\n self.mask = None\n\n def set_mask(self, mask):\n self.mask = mask\n\n ...
[ [ "torch.nn.Linear", "torch.bmm", "torch.cat" ] ]
umbrellagong/VHGPR
[ "859c135f8a18be0a7e679d44cf292c2825ccd09d" ]
[ "fourbranches.py" ]
[ "import numpy as np\n\ndef f(X):\n return mean(X) + np.random.normal(0, std(X))\n\ndef mean(X, deviation=5): \n X = np.array(X)\n if X.ndim == 1:\n X=np.atleast_2d(X)\n X1 = 3 + 0.1*(X[:,0]-X[:,1])**2 - (X[:,0]+X[:,1])/np.sqrt(2)\n X2 = 3 + 0.1*(X[:,0]-X[:,1])**2 + (X[:,0]+X[:,1])/np.sqrt(2)\n...
[ [ "numpy.sqrt", "numpy.amin", "numpy.stack", "numpy.atleast_2d", "numpy.array" ] ]
lvxingvir/template
[ "089f5817e031a7c2b2d82e239158a6a5488b3b26" ]
[ "drutils/augmentation.py" ]
[ "\"\"\"This file contains utility functions used for numpy-based input augmentation\n\nTODO: make more general for 3D images\n\"\"\"\n\nimport logging\nimport cv2\nimport random\nimport scipy.ndimage\nfrom skimage.filters import threshold_otsu, gaussian\ntry:\n import dicom\nexcept:\n import pydicom as dicom\...
[ [ "numpy.amax", "numpy.sqrt", "numpy.asarray", "numpy.around", "numpy.max", "numpy.mean", "numpy.zeros_like", "numpy.any", "numpy.exp", "numpy.ones_like", "numpy.pad", "numpy.clip", "numpy.unique", "numpy.fliplr", "numpy.std", "numpy.zeros", "numpy...
jmeyers314/astrophotoreduce
[ "814177f494bbe6bb7ef5cf1b09ab2083a119fa42" ]
[ "cfa.py" ]
[ "import numpy as np\n\ndef make_cfa(img):\n cfa = np.zeros_like(img[:,:,0])\n y, x = np.mgrid[0:cfa.shape[0], 0:cfa.shape[1]]\n Rloc = (np.mod(x, 2) == 0) & (np.mod(y, 2) == 0)\n Gloc = np.mod(x+y, 2) == 1\n Bloc = (np.mod(x, 2) == 1) & (np.mod(y, 2) == 1)\n cfa[Rloc] = img[Rloc,0]\n cfa[Gloc] ...
[ [ "numpy.mod", "numpy.zeros_like" ] ]
PabloEduardoMartinezPicazo/Bootcamp-DataScience-2021
[ "0fa5288aec5fb14e3796877882e4f1ddc5ad4aea" ]
[ "EDA/SRC/utils_/apis_tb.py" ]
[ "#funciones para flasks para la lectura y el return del json\nimport pandas as pd \nimport numpy as np\nimport json\n\n\ndef read_json(fullpath):\n with open(fullpath, \"r\") as json_file_readed:\n json_readed = json.load(json_file_readed)\n return json_readed\n\ndef return_json(filepath):\n df = pd...
[ [ "pandas.read_csv" ] ]
HypnosXC/mmaction2
[ "777546f27f8f5a3c83e10d966e2149be2fc9fa31" ]
[ "mmaction/models/losses/nll_loss.py" ]
[ "import torch.nn.functional as F\n\nfrom ..registry import LOSSES\nfrom .base import BaseWeightedLoss\n\n\n@LOSSES.register_module()\nclass NLLLoss(BaseWeightedLoss):\n \"\"\"NLL Loss.\n\n It will calculate NLL loss given cls_score and label.\n \"\"\"\n\n def _forward(self, cls_score, label, **kwargs):\...
[ [ "torch.nn.functional.nll_loss" ] ]
JoelPendleton/QDot-Detector
[ "e53b80c02fe95ceacd3dde9981dcd0481b907bdc" ]
[ "tools/swa.py" ]
[ "# -*- coding:utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nfrom tensorflow.python import pywrap_tensorflow\nimport numpy as np\nimport sys\nimport os\nsys.path.append('....
[ [ "tensorflow.get_variable", "tensorflow.local_variables_initializer", "tensorflow.python.pywrap_tensorflow.NewCheckpointReader", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.train.Saver" ] ]
jqueguiner/haven
[ "7b2a5d46b08f48f1112f8903f1b97c6adadff3f4" ]
[ "examples/minimal/models.py" ]
[ "import torch\nimport tqdm\n\nfrom torch import nn\n\n\ndef get_model(model_name):\n if model_name == 'mlp':\n return MLP()\n\nclass MLP(nn.Module):\n def __init__(self, input_size=784, n_classes=10):\n \"\"\"Constructor.\"\"\"\n super().__init__()\n\n self.input_size = input_size\...
[ [ "torch.nn.Linear", "torch.nn.functional.relu", "torch.no_grad", "torch.nn.functional.nll_loss" ] ]
GrigalashviliT/spoilerBlocker
[ "18a5e9689099d3b631a15ed20cc84a043f324055" ]
[ "src/data_collection/preprocess_data/make_csv.py" ]
[ "import pandas as pd\r\nimport glob\r\nfrom re import sub\r\n\r\ndct = {\r\n 'sentence': [],\r\n 'label': []\r\n}\r\n\r\ndef process_text(text):\r\n \r\n text = text.replace('\\r\\n', '.')\r\n text = text.replace('\\n', '.')\r\n text = text.replace('\\r', '.')\r\n text = text.lower()\r\n tex...
[ [ "pandas.DataFrame" ] ]
kyehyeon/SNIPER
[ "2b8723729bfb91275d598b55752f32d8a00a33ad" ]
[ "init.py" ]
[ "import sys\nimport logging\nimport os\nimport matplotlib\nmatplotlib.use('Agg')\n\nos.environ['PYTHONUNBUFFERED'] = '1'\nos.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0'\nlogging.basicConfig(level=logging.INFO)\nsys.path.insert(0,'lib')\nsys.path.insert(0,'SNIPER-mxnet/python')\n" ]
[ [ "matplotlib.use" ] ]
makaishi2/cplex-samples
[ "d798a8d2dc14826eb5b3f00e6f64a2a08b2bc5f1" ]
[ "diet-ml/ml-submit.py" ]
[ "# -*- coding: utf-8 -*-\n\n# コマンドによる事前準備\n# $ pip install -U ibm-watson-machine-learning \n\nimport sys\n\n# Watson ML credentails\napikey = 'xxxx'\nlocation = 'us-south'\n\nimport pandas as pd\n\n# Watson ML credentails\n\n# DO Deployment ID\ndeployment_uid = 'xxxx'\n\n# Input CSV File\ninput_data1 = 'diet_food.c...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
Ravirajanan/tennislive-visualization
[ "f5d555a9caea61c1286cc7bc3505281f52d37322" ]
[ "plot.py" ]
[ "#imports\nimport pandas as pd\nimport numpy as np\nimport re\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\nimport plotly.express as px\nfrom plotly.subplots import make_subplots\nimport plotly.graph_objects as go\n\n#reads the in...
[ [ "numpy.arange", "pandas.read_csv", "numpy.where" ] ]
catmaid/catpy
[ "481d87591a6dfaedef2767dcddcbed7185ecc8b8" ]
[ "tests/test_image.py" ]
[ "from __future__ import absolute_import\n\nfrom itertools import cycle, chain\n\nimport pytest\nimport numpy as np\nimport requests\nfrom PIL import Image\nfrom io import BytesIO\nfrom concurrent.futures import Future\nfrom requests import HTTPError\n\ntry:\n import mock\nexcept ImportError:\n from unittest i...
[ [ "numpy.allclose", "numpy.asarray", "numpy.ones", "numpy.diff", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
note-nota/ML_models
[ "e9ede1b5cc3ef7bab43f22467cb806043d86e451" ]
[ "UNet/model.py" ]
[ "from typing import Optional\nimport argparse\nimport tensorflow as tf\n\n\nclass conv_set:\n def __init__(self, filters: int):\n self.filters = filters\n\n def __call__(self, inputs: tf.Tensor) -> tf.Tensor:\n y = tf.keras.layers.Conv2D(\n self.filters, kernel_size=3, padding=\"SAME\...
[ [ "tensorflow.keras.Input", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.regularizers.l2", "tensorflow.keras.layers.concatenate", "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.Model", "tensorflow.keras.layers.Cropping2D", ...
Ch4nYH/dataset-distillation
[ "61effcfe8aa7a1a3d9f66ece1fa29bcb393472c2" ]
[ "networks/networks.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\n\nfrom . import utils\n\n\nclass LeNet(utils.ReparamModule):\n supported_dims = {28, 32}\n\n def __init__(self, state):\n if state.dropout:\n raise ValueError(\"LeNet doesn't support dropout\")\n super(LeNet, self).__init__()\n ...
[ [ "torch.nn.Sequential", "torch.nn.LocalResponseNorm", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.functional.max_pool2d" ] ]
ccbrain/hddm_upt
[ "153abccf20633811503aff5467097ad2cc3fa0e7" ]
[ "hddm/tests/test_optimization.py" ]
[ "\nfrom copy import copy\nimport itertools\nimport glob\nimport os\n\nimport unittest\nimport pymc as pm\nimport numpy as np\nimport pandas as pd\nimport nose\npd.set_printoptions(precision=4)\nfrom nose import SkipTest\n\nimport hddm\nfrom hddm.diag import check_model\n\n\ndef add_outliers(data, p_outlier):\n \...
[ [ "pandas.concat", "numpy.random.seed", "numpy.linspace", "pandas.DataFrame", "pandas.set_printoptions", "numpy.random.rand", "numpy.testing.assert_allclose", "numpy.random.randint" ] ]
zhangzhimin/mace
[ "c28f093d719fd650a4308895cd045c26d0f198f6" ]
[ "tools/python/run_micro.py" ]
[ "# Copyright 2020 The MACE 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 required b...
[ [ "numpy.random.random", "numpy.random.seed" ] ]
WannabeSmith/betting-paper-simulations
[ "00a6d870c5d619add22b9710b9b43bb84df5d0c6" ]
[ "simulations/Time-uniform/simulations.py" ]
[ "import sys\nimport os\nsys.path.append(os.path.relpath(\"../../\"))\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import binom\nfrom scipy.stats import beta\nfrom scipy.stats import multinomial\nimport matplotlib.cm as cm\n\nfrom confseq.cs_plots import ConfseqToPlot, DataGeneratingProce...
[ [ "numpy.random.binomial", "scipy.stats.binom.pmf", "numpy.random.beta", "scipy.stats.beta.pdf" ] ]
aurmarsan/pyturbo
[ "b4f1c6e535b816fbb51b142f7a694aac9ff9b088" ]
[ "exemples/exemple-lecteur-fnc-snc.py" ]
[ "import numpy, scipy\nimport pyturbo as p\n\n\n######################################\n# pour lire un fichier surface SNC\npath_snc = \"indiquer.snc\"\nr = p.LecteurSNC(file_path = path_snc)\nr.lire_parametres()\nr.get_infos_temporelles() # ca affiche des trucs\nr.get_infos_variables() # ca affiche d'autres trucs\n...
[ [ "numpy.rad2deg" ] ]
Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING-
[ "13fac05601efed16ae8b29989aad487e04cd90a7" ]
[ "packnet-sfm/packnet_sfm/utils/load.py" ]
[ "# Copyright 2020 Toyota Research Institute. All rights reserved.\n\nimport importlib\nimport logging\nimport os\nimport warnings\nimport torch\n\nfrom inspect import signature\nfrom collections import OrderedDict\n\nimport sys\nsys.path.append('../packnet-sfm/packnet_sfm/utils')\nsys.path.append('../packnet-sfm/c...
[ [ "torch.load" ] ]
space-physics/geomag-indices
[ "c989f7df05ac1082f7347cd32cfee7a916e3b30d" ]
[ "src/geomagindices/io.py" ]
[ "from __future__ import annotations\nfrom pathlib import Path\nimport pandas\nimport numpy as np\nfrom datetime import datetime, timedelta\nfrom dateutil.parser import parse\n\nfrom .web import URLmonthly, URL45dayfcast, URL20yearfcast\nfrom .utils import yeardec2datetime\n\n\ndef load(flist: Path | list[Path]) -> ...
[ [ "pandas.concat", "pandas.Series", "pandas.DataFrame", "pandas.read_json", "numpy.column_stack", "pandas.to_numeric", "numpy.loadtxt" ] ]
jackstellwagen/deepcell-tf
[ "d9326b8aceb2f25637e0d3934646da8f6a9f9539" ]
[ "deepcell/utils/export_utils.py" ]
[ "# Copyright 2016-2019 The Van Valen Lab at the California Institute of\n# Technology (Caltech), with support from the Paul Allen Family Foundation,\n# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.\n# All rights reserved.\n#\n# Licensed under a modified Apache License, Version 2.0 (the \...
[ [ "tensorflow.python.saved_model.builder.SavedModelBuilder", "tensorflow.constant", "tensorflow.local_variables_initializer", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.GPUOptions", "tensorflow.python.keras.backend.set_session", "tensorflow.pytho...
nxihe/xhtools
[ "6cdebc576fe6d89f69a4ef8c5cfb23cd7036ab6c" ]
[ "xhtools.py" ]
[ "import pandas as pd\nimport numpy as np\n\nclass Xhtools:\n '''\n npproduct:求两个一维数组的笛卡尔积\n threesigmod:根据3Sigma法则求异常值\n numericoutlier:箱线图法求异常值\n cutbin:自定义分箱,woe、iv值计算\n '''\n def __init__(self):\n return None\n \n def npproduct(self,array1,array2):\n if len(array1) == len...
[ [ "numpy.log", "numpy.quantile", "numpy.std", "numpy.mean", "pandas.cut" ] ]
thibnoel/solo-collisions
[ "87bf492266578b7bfd04a6657675b1477d27b314" ]
[ "src/python/collision_approx_fourier.py" ]
[ "import numpy as np \nfrom scipy import signal\nimport matplotlib.pyplot as plt\nfrom solo12_shoulder_collision_utils import followBoundary, colMapToDistField\n\n# Load the collision map from file\nres = 200\ncol_map_file = './npy_data/collision_map_centered_res{}.npy'.format(res)\ndist_field_file = './npy_data/upd...
[ [ "matplotlib.pyplot.imshow", "numpy.fft.ifft2", "matplotlib.pyplot.title", "numpy.min", "numpy.asarray", "matplotlib.pyplot.xscale", "numpy.fft.fftshift", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplot", "numpy.fft.ifftshift", "matpl...
GusevMihail/dlcourse_ai
[ "7f20c625e09f92f20f2da9304abb1a4edd4ae93c" ]
[ "assignments/assignment1/knn.py" ]
[ "import numpy as np\n\n\nclass KNN:\n \"\"\"\n K-neariest-neighbor classifier using L1 loss\n \"\"\"\n\n def __init__(self, k=1):\n self.k = k\n\n def fit(self, X, y):\n self.train_X = X\n self.train_y = y\n\n def predict(self, X, num_loops=0):\n '''\n Uses the K...
[ [ "numpy.argsort", "numpy.zeros", "numpy.abs" ] ]
rohitgirdhar/ActionVLAD
[ "08d3d65301940991e0a0cdca2c0534edf6749f41", "08d3d65301940991e0a0cdca2c0534edf6749f41" ]
[ "datasets/mnist.py", "preprocessing/vgg_preprocessing.py" ]
[ "# ------------------------------------------------------------------------------\n# ActionVLAD: Learning spatio-temporal aggregation for action classification\n# Copyright (c) 2017 Carnegie Mellon University and Adobe Systems Incorporated\n# Please see LICENSE on https://github.com/rohitgirdhar/ActionVLAD/ for det...
[ [ "tensorflow.FixedLenFeature", "tensorflow.zeros" ], [ "tensorflow.convert_to_tensor", "tensorflow.image.resize_bilinear", "tensorflow.image.random_flip_left_right", "tensorflow.shape", "tensorflow.slice", "tensorflow.greater", "tensorflow.reshape", "tensorflow.equal", ...
doudoune144/openpilot
[ "25fbad410d51e48d9189d5b3ef8a05a6e75f037c" ]
[ "selfdrive/controls/lib/longitudinal_planner.py" ]
[ "#!/usr/bin/env python3\nimport math\nimport numpy as np\nfrom common.numpy_fast import interp\n\nimport cereal.messaging as messaging\nfrom common.conversions import Conversions as CV\nfrom common.filter_simple import FirstOrderFilter\nfrom common.realtime import DT_MDL\nfrom selfdrive.modeld.constants import T_ID...
[ [ "numpy.zeros", "numpy.interp" ] ]
Hser2bio/ViLight
[ "e8c4179d13178fe61796e8f9ae264e697d599664" ]
[ "lib/plot.py" ]
[ "from PyQt5.QtGui import *\nfrom .i18n import _\n\n\nimport datetime\nfrom collections import defaultdict\nfrom .bitcoin import COIN\n\nimport matplotlib\nmatplotlib.use('Qt5Agg')\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as md\nfrom matplotlib.patches import Ellipse\nfrom matplotlib.offsetbox impor...
[ [ "matplotlib.pyplot.gca", "matplotlib.dates.DateFormatter", "matplotlib.use", "matplotlib.pyplot.subplots", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel" ] ]
raikonenfnu/mlir-npcomp
[ "29e1b2fe89848d58c9bc07e7df7ce651850a5244", "29e1b2fe89848d58c9bc07e7df7ce651850a5244" ]
[ "frontends/pytorch/test/ivalue_import/list.py", "frontends/pytorch/python/torch_mlir_torchscript/e2e_test/framework.py" ]
[ "# -*- Python -*-\n# This file is licensed under a pytorch-style license\n# See frontends/pytorch/LICENSE for license information.\n\nimport typing\n\nimport torch\nimport torch_mlir\n\n# RUN: %PYTHON %s | npcomp-opt | FileCheck %s\n\nmb = torch_mlir.ModuleBuilder()\n\nclass TestModule(torch.nn.Module):\n def __...
[ [ "torch.jit.script" ], [ "torch.manual_seed", "torch.rand" ] ]
austinmroczek/pauser
[ "4e81808be98d3495ad93c3270a8a43584b62b8cd" ]
[ "listener.py" ]
[ "#import unicodedata\n\nclass Listener:\n\n def __init__(self):\n import log\n self.myLog = log.Log('listener.log')\n\n # files and paths\n self.fileName = 'rectest.wav' # default file name\n\n import os\n if not os.path.isfile(self.fileName):\n file = open(se...
[ [ "numpy.square", "scipy.fftpack.irfft", "scipy.io.wavfile.read", "scipy.fftpack.rfft" ] ]
hydrogo/FIT_ML
[ "4c3f4abd707baf9eb83e061f84d183630264c96b" ]
[ "code/examples/scripts/21_ML_glacier_wise_weekly_jjas.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.model_selection import LeaveOneOut\nfrom sklearn.metrics import r2_score\n\nimport pickle\n\n\nglacier_ids = np.load(\"../results/misc/glacier_ids_valid.npy\")\n\n\ntsl_path = \"../results/tsl_csv/\"\nmeteo_...
[ [ "sklearn.ensemble.RandomForestRegressor", "pandas.read_hdf", "pandas.read_csv", "pandas.concat", "sklearn.metrics.r2_score", "sklearn.model_selection.LeaveOneOut", "pandas.DataFrame", "numpy.round", "numpy.deg2rad", "numpy.argmax", "numpy.load", "numpy.array" ] ]
rousik/pudl
[ "52db209ff83d1b2c8ef0f93d599a844f12a715ef" ]
[ "src/pudl/output/eia860.py" ]
[ "\"\"\"Functions for pulling data primarily from the EIA's Form 860.\"\"\"\n\n# import datetime\n\nimport pandas as pd\nimport sqlalchemy as sa\n\nimport pudl\n\n\ndef utilities_eia860(pudl_engine, start_date=None, end_date=None):\n \"\"\"Pull all fields from the EIA860 Utilities table.\n\n Args:\n pud...
[ [ "pandas.merge", "pandas.to_datetime", "pandas.read_sql" ] ]
tangyisheng2/mne-python
[ "740fcb89b9910ef2fa84cffe402a06b4da643374" ]
[ "mne/minimum_norm/inverse.py" ]
[ "# -*- coding: utf-8 -*-\n# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>\n# Teon Brooks <teon.brooks@gmail.com>\n#\n# License: BSD (3-clause)\n\nfrom copy import deepcopy\nfrom math import sqrt\nimport numpy as np\nfrom scipy import linalg...
[ [ "numpy.dot", "scipy.linalg.get_blas_funcs", "numpy.sqrt", "numpy.max", "numpy.zeros_like", "numpy.iscomplexobj", "numpy.where", "numpy.reshape", "numpy.eye", "numpy.matmul", "scipy.linalg.norm", "numpy.zeros", "numpy.errstate", "numpy.array", "numpy.sum"...
alanphys/pylinac
[ "9b2dabe85d3038a9ec922c77bbb943b4e06dbdda" ]
[ "pylinac/field_analysis.py" ]
[ "\"\"\"Module for performing analysis of images or 2D arrays for parameters such as flatness and symmetry.\"\"\"\nimport dataclasses\nimport io\nimport os.path as osp\nimport warnings\nfrom dataclasses import dataclass\nfrom enum import Enum\nfrom math import floor, ceil\nfrom typing import Union, Optional, Tuple, ...
[ [ "numpy.abs", "numpy.linspace", "numpy.min", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.sign", "numpy.max", "matplotlib.pyplot.ioff", "numpy.argmax", "numpy.mean", "matplotlib.pyplot.subplot2grid", "matplotlib.pyplot.suptitle", "numpy.sum",...
KoryakovDmitry/DewarpNet
[ "6b5c687548d9db3b5bcfd1503b7a8997c875ea1f" ]
[ "utils.py" ]
[ "'''\nMisc Utility functions\n'''\nfrom collections import OrderedDict\nimport os\nimport numpy as np\nimport torch\nimport random\nimport torchvision\n\ndef recursive_glob(rootdir='.', suffix=''):\n \"\"\"Performs recursive glob with given suffix and rootdir \n :param rootdir is the root directory\n ...
[ [ "torch.cat", "numpy.min", "torch.unsqueeze", "numpy.full", "numpy.zeros" ] ]
LarryShamalama/scikit-mobility
[ "d58324c20d8a1651c97feb988619ce4405e78278" ]
[ "tutorial/stats_utils.py" ]
[ "#!/usr/bin/env python\n\n# ciacia_stats.py\n# Filippo Simini\n# Created: 20131021\n\nimport sys,os\nimport math\nimport random\n#import mpmath\nimport operator\nimport csv\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.pylab as pyl\nimport itertools\nimport scipy as sp\nfrom scipy import s...
[ [ "scipy.optimize.fmin", "scipy.optimize.leastsq", "numpy.array" ] ]
coolerking/caterpillar
[ "f8d02d48963759118b6acfcf9b5d73a9f061a24b" ]
[ "manage_cat.py" ]
[ "# -*- coding: utf-8 -*-\n#!/usr/bin/env python3\n\"\"\"\nScripts to drive a donkey 2 car\n\nUsage:\n manage_cat.py (drive) [--model=<model>] [--js] [--type=(linear|categorical|rnn|imu|behavior|3d|localizer|latent)] [--camera=(single|stereo)] [--meta=<key:value> ...] [--debug]\n manage_cat.py (train) [--tub=<...
[ [ "tensorflow.python.keras.models.model_from_json" ] ]
opietx/core_tools
[ "d5bd2d4beed74791b80ff5bdabd67774403763ef" ]
[ "core_tools/GUI/virt_gate_matrix_qml/gui_controller.py" ]
[ "from core_tools.GUI.virt_gate_matrix_qml.models import attenuation_model, table_header_model, vg_matrix_model\nfrom core_tools.drivers.hardware.hardware import hardware\n\nfrom PyQt5 import QtCore, QtQuick, QtGui, QtWidgets, QtQml\n\nimport core_tools.GUI.virt_gate_matrix_qml as qml_in\nimport os, sys\n\nclass vi...
[ [ "numpy.array" ] ]
xieyulai/MSP-STTN-BJ
[ "d691a20e32963330a6024c77284fed6c00b68fed" ]
[ "record/3548/pre_main_short.py" ]
[ "import warnings\nwarnings.filterwarnings('ignore')\nimport pickle\nimport numpy as np\nimport time\nimport sys\nimport cv2\nimport random\nimport torch\nimport torch.optim as optim\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset, DataLoader, TensorDataset\nimport argpa...
[ [ "torch.mean", "torch.abs", "torch.optim.lr_scheduler.LambdaLR", "torch.load", "torch.utils.data.DataLoader", "numpy.concatenate", "torch.no_grad", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "torch.device", "torch.nn.L1Loss", "torch.nn.CrossEntropyLoss"...
dimthe/rasa
[ "90f37c70d982cac0bad38ecd8a082041f813cc25" ]
[ "rasa/utils/common.py" ]
[ "import logging\nimport os\nfrom typing import Any, Callable, Dict, List, Text, Optional, Union\n\nimport rasa.core.utils\nimport rasa.utils.io\nfrom rasa.constants import (\n GLOBAL_USER_CONFIG_PATH,\n DEFAULT_LOG_LEVEL,\n ENV_LOG_LEVEL,\n DEFAULT_LOG_LEVEL_LIBRARIES,\n ENV_LOG_LEVEL_LIBRARIES,\n)\n...
[ [ "tensorflow.logging.set_verbosity" ] ]
y894577/FocusDiscrimination
[ "b8c44cce0a0a61e5c86bcdbace970e5b7813c2a7" ]
[ "CK.py" ]
[ "from __future__ import print_function\nfrom PIL import Image\nimport numpy as np\nimport h5py\nimport torch.utils.data as data\nimport pickle\n\n\nclass CK(data.Dataset):\n \"\"\"`CK+ Dataset.\n\n Args:\n train (bool, optional): If True, creates dataset from training set, otherwise\n create...
[ [ "numpy.concatenate" ] ]
existentmember7/TEMP_monitor
[ "b8116f4c134793c4caa22eda78f90dd24d0cad30" ]
[ "align/reID/aligned_reid/dataset/__init__.py" ]
[ "from .TestSet import TestSet\nfrom .TrainSet import TrainSet\nfrom ..utils.dataset_utils import parse_im_name\nfrom ..utils.utils import load_pickle\nimport numpy as np\nimport os.path as osp\nospj = osp.join\nospeu = osp.expanduser\n\n\ndef create_dataset(\n name='market1501',\n part='trainval',\n ...
[ [ "numpy.array" ] ]
ecell/scopyon
[ "99436fbfd34bb684966846eba75b206c2806f69c" ]
[ "test/test_epifm.py" ]
[ "import unittest\n\n\nclass TestEPIFM(unittest.TestCase):\n\n def setUp(self):\n self.radial_cutoff = 1000.0e-9\n self.radial_resolution = 1.0e-9\n\n def tearDown(self):\n pass\n\n def test1(self):\n import scopyon._epifm\n\n def test2(self):\n print('Testing TRITC ......
[ [ "numpy.arange", "numpy.zeros", "numpy.sum" ] ]
donguk-dev/pycls
[ "31355a3473fd9389313527cf7e1bf5ad31466aad" ]
[ "pycls/datasets/cifar10.py" ]
[ "#!/usr/bin/env python3\n\n# 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\n\"\"\"CIFAR10 dataset.\"\"\"\n\nimport os\nimport pickle\n\nimport numpy as np\nimport pycls.core.logging ...
[ [ "numpy.random.uniform", "numpy.pad", "numpy.vstack", "numpy.random.randint" ] ]
thorjohnsen/onnxruntime
[ "81101c9efd15a69342dec94362cf7c29a4e41be9" ]
[ "orttraining/orttraining/test/python/orttraining_run_glue.py" ]
[ "# adapted from run_glue.py of huggingface transformers\n\nimport dataclasses\nimport logging\nimport os\nfrom dataclasses import dataclass, field\nfrom typing import Dict, Optional\nimport unittest\nimport numpy as np\n\nfrom transformers import (\n AutoConfig,\n AutoModelForSequenceClassification,\n Auto...
[ [ "numpy.squeeze", "numpy.argmax" ] ]
vipasi/indiacovid19
[ "08c5799cb0ad531b26b63a0faaeb22cdf45a80a8" ]
[ "py/plot.py" ]
[ "#!/usr/bin/python3\n\n# Copyright (c) 2020 Susam Pal\n# Licensed under the terms of the MIT License.\n\n# The MIT License (MIT)\n#\n# Copyright (c) 2020 Susam Pal\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Soft...
[ [ "matplotlib.pyplot.legend", "matplotlib.ticker.MultipleLocator", "matplotlib.pyplot.plot", "matplotlib.pyplot.gca", "matplotlib.pyplot.gcf", "matplotlib.ticker.FuncFormatter", "matplotlib.pyplot.text", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot....
mzmzm/taichi
[ "39129820a922fdd936728d6feb7944ae208345a5" ]
[ "tests/python/test_mpm88.py" ]
[ "import os\n\nimport pytest\n\nimport taichi as ti\nfrom taichi import approx\n\n\ndef run_mpm88_test():\n dim = 2\n N = 64\n n_particles = N * N\n n_grid = 128\n dx = 1 / n_grid\n inv_dx = 1 / dx\n dt = 2.0e-4\n p_vol = (dx * 0.5)**2\n p_rho = 1\n p_mass = p_vol * p_rho\n E = 400\n...
[ [ "numpy.zeros" ] ]
Kumaken/fyp-vehicle-counting-system
[ "51adb3bfc762d5489bc643da5f79bec3fa9eeb84" ]
[ "test.py" ]
[ "import torch\n\n# Model\nmodel = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)\n\n# Images\ndir = 'https://github.com/ultralytics/yolov5/raw/master/data/images/'\nimgs = [dir + f for f in ('zidane.jpg', 'bus.jpg')] # batched list of images\n\n# Inference\nresults = model(imgs)\nprint(results.xy...
[ [ "torch.hub.load" ] ]
JuanAsensioAyesa/ProyectoCGEIM_2021
[ "9025c23fa7e2429a9846dae1146fbbf6314685cb" ]
[ "progressive_photon_mapping.py" ]
[ "import os\nimport numpy\nimport random\nimport PIL\nfrom PIL import Image\nif __name__ == \"__main__\":\n lista = [10,15,20,25,30,35,40,50,100,200]\n lista = numpy.arange(100)\n for i in numpy.arange(len(lista)):\n command = \"./bin/yscene render\"\n out_file = \"imagen_\"+str(lista[i])\n ...
[ [ "numpy.round", "numpy.arange", "numpy.zeros" ] ]
ronen85/causal_inference_project
[ "aa2688ba0629f9984aa714fe07e9c319228bb461" ]
[ "visualization.py" ]
[ "from collections import defaultdict\nfrom matplotlib.pylab import plt\nfrom matplotlib import pyplot as mp\nfrom utilities import *\n\n\ndef bar_graph(category, age_grp, sex, x, y, year=None, country=None):\n\n plt.figure()\n plt.ylabel('ATE = Y1 - Y0')\n plt.xlabel('Years')\n plt.bar(range(len(x)), x,...
[ [ "matplotlib.pylab.plt.tight_layout", "matplotlib.pylab.plt.title", "matplotlib.pylab.plt.figure", "matplotlib.pylab.plt.ylabel", "matplotlib.pylab.plt.xlabel" ] ]
NavarreCML/National-EAT-Lancet-Diets
[ "d61ffb59829a64d1bfca3f43e593e656d4543f33" ]
[ "functions/POM_build.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom functions import fao_regions as regions\n\ndata = 'data/'\n\ndef data_build(crop_proxie, diet_div_crop, diet_source_crop, diet_ls_only, diet_ls_only_source, min_waste):\n\n \"\"\"*** Import of country data to build national diets ***\"\"\"\n WPR_height = pd.read_...
[ [ "pandas.merge", "pandas.read_excel", "pandas.read_csv", "pandas.concat", "numpy.isnan", "pandas.DataFrame" ] ]
Dragon-hxl/LARC
[ "e13295d7217b621e6e2691b57cd58c88cded5830" ]
[ "dreamcoder/grammar.py" ]
[ "from frozendict import frozendict\nfrom collections import defaultdict\n\nfrom dreamcoder.frontier import *\nfrom dreamcoder.program import *\nfrom dreamcoder.type import *\nfrom dreamcoder.utilities import *\n\nimport time\n\nimport itertools\n\nclass GrammarFailure(Exception):\n pass\n\nclass SketchEnumeratio...
[ [ "numpy.array" ] ]
r-b-g-b/spacy-ann-linker
[ "3a625052686fc745fa1508c238fc68a5c7f50053" ]
[ "spacy_ann/ann_kb.py" ]
[ "from pathlib import Path\nfrom timeit import default_timer as timer\nfrom typing import List, Set, Tuple\n\nimport joblib\nimport nmslib\nimport numpy as np\nimport scipy\nimport srsly\nfrom nmslib.dist import FloatIndex\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom spacy.kb import KnowledgeBa...
[ [ "scipy.sparse.load_npz", "numpy.size", "numpy.array", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]