repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
weihaosky/SMVmatching
[ "814d00530026278f3582df3849ead46b3479cc57" ]
[ "models/stackhourglass_prob.py" ]
[ "from __future__ import print_function\nimport torch\nimport torch.nn as nn\nimport torch.utils.data\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport math\nfrom .submodule import *\n\n\nclass hourglass(nn.Module):\n def __init__(self, inplanes):\n super(hourglass, self).__init...
[ [ "torch.nn.functional.softmax", "torch.nn.ConvTranspose3d", "torch.nn.Conv2d", "torch.nn.Conv3d", "torch.nn.functional.relu", "torch.nn.ReLU", "torch.nn.BatchNorm3d", "torch.squeeze" ] ]
Kouki706/Prob-Paper
[ "01173d7f544cb274224a53ffc1ad1034a06084d6" ]
[ "ProbPaper/Uniform.py" ]
[ "#%%\nimport numpy as np\nimport math\nfrom scipy.stats import norm\nfrom scipy.optimize import curve_fit\nimport matplotlib.pyplot as plt\n\n# 回帰式\ndef func(x, a, b):\n f = a*x + b\n return f\n\n# データの読み込み\nQin=np.loadtxt('./Data.csv', delimiter=',',usecols=[0])\nQin = np.sort(Qin)\n\n# データサイズの取得\nmax = Qin....
[ [ "matplotlib.backends.backend_pdf.PdfPages", "numpy.unique", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "numpy.sort", "numpy.round", "numpy.loadtxt", "numpy.mean", "numpy.savetxt", "numpy.array", "scipy.optimize.curve_fit", "numpy.sum", "numpy.empty", ...
SriramRamesh/traffic-signaling-networks
[ "17fa5ed5e3cc935b0baa354bbfd6e6cd3030da64" ]
[ "scripts/plot_exit_rate.py" ]
[ "import sys\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# provide as argument the exrates.txt file, which contains raw number\n# of cars exiting every sink every second\ninpath = sys.argv[1]\n#sinks_exrates = np.loadtxt(sys.argv[1], skiprows=2)\nsinks_exrates = pd.read_csv(inpath, c...
[ [ "pandas.read_csv", "numpy.arange", "numpy.vstack", "matplotlib.pyplot.close", "numpy.empty", "matplotlib.pyplot.figure" ] ]
idin/chronometry
[ "e022a1d06d8e8be990483130bc314a189de2f149" ]
[ "chronometry/estimate/Estimator.py" ]
[ "\nfrom slytherin.hash import hash_object\nfrom slytherin.functions import get_function_arguments\nfrom ravenclaw.preprocessing import Polynomial, Normalizer\n\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.ensemble import RandomForestClassifier\nfrom pandas import DataFrame, concat\nfrom random i...
[ [ "pandas.concat", "sklearn.ensemble.RandomForestClassifier", "matplotlib.pyplot.subplots", "pandas.DataFrame", "sklearn.linear_model.LinearRegression", "pandas.DataFrame.from_records", "matplotlib.pyplot.show", "numpy.where" ] ]
thejoeejoee/unit-brno-2018
[ "94b704cf09f1b29c3f6e620bd751682a0e744c44" ]
[ "unit/detectors/hough_circle.py" ]
[ "# coding=utf-8\nimport logging\nfrom collections import defaultdict, namedtuple\nfrom math import pi\nfrom typing import DefaultDict, Dict, Iterable, Tuple, Set, Callable\n\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nCircle = namedtuple('Circle', 'x y radius')\n\n\nclass HoughCircleDetector(object...
[ [ "matplotlib.pyplot.Rectangle", "matplotlib.pyplot.gca", "matplotlib.pyplot.imshow", "numpy.linspace", "numpy.cos", "numpy.dstack", "numpy.sin", "matplotlib.pyplot.Circle", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "numpy.zeros" ] ]
jamorrison/wgms_kit_comparison
[ "f0da12f368f91b6ab8b94aaef60574cf5ca09bcf" ]
[ "analysis/analyze_the_data/cpg_questions/control_methylation/control_vectors_qc.py" ]
[ "\"\"\"Create plots to show methylation for mitochondrial and control vector DNA.\"\"\"\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nimport numpy as np\nimport os\n\n# Colors to use for each sample\nCOLOR = {\n 10: '#D81B60', # Ftube{A,B}kapaBC\n 9: '#D81B60', # Ftube{A,B}kap...
[ [ "pandas.concat", "matplotlib.pyplot.tight_layout", "pandas.read_csv", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlim", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "matplotlib.pyplo...
jesseerdmann/audiobonsai
[ "ec1edcdbadc6b2aff3b743b5c42515f4d5638830" ]
[ "stat_stuff.py" ]
[ "import pandas as pd\n\nfrom ab_util import create_connection\nfrom datetime import datetime, timedelta\nfrom math import floor\n\nif __name__ == '__main__':\n db_conn = create_connection()\n today_date = datetime.now() # - timedelta(days=6)\n today_name = today_date.strftime(\"%Y%m%d\")\n weekago_date...
[ [ "pandas.read_sql" ] ]
droubo/meta-level-analysis-of-anomaly-detectors
[ "a64671365b6c98ad14fc82f3430d3082b0455a6c" ]
[ "Analysis Scripts/cdf.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\ndata = pd.read_csv(\"AUC_SCORES.csv\", delimiter=\";\")\ndatasets = data['DATASETS'].tolist()\nprint(datasets)\nn = len(data)\nscores = []\nfor i in range(n):\n scores.append(data.loc[i:i].to_numpy()[0][1:])\nfor i in range(len(datasets...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.axvline", "matplotlib.pyplot.ylim", "matplotlib.pyplot.hlines", "numpy.cumsum", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.yticks", "matplotlib.pypl...
patrickphatnguyen/deepchem
[ "f310f0a8d9eeb804f5e04974edff10ba62efab63" ]
[ "deepchem/feat/graph_features.py" ]
[ "import numpy as np\nfrom rdkit import Chem\n\nimport deepchem as dc\nfrom deepchem.feat import Featurizer\nfrom deepchem.feat.atomic_coordinates import ComplexNeighborListFragmentAtomicCoordinates\nfrom deepchem.feat.mol_graphs import ConvMol, WeaveMol\nfrom deepchem.data import DiskDataset\nimport multiprocessing...
[ [ "numpy.asarray", "numpy.squeeze", "numpy.stack", "numpy.concatenate", "numpy.delete", "numpy.mean", "numpy.array", "numpy.zeros", "numpy.vstack" ] ]
lihaod/Deep_inpainting_localization
[ "f9841168f2e289347838e7de8e7206cba4516081" ]
[ "utils/vgg_mfcn.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport collections\nimport tensorflow as tf\nfrom tensorflow.contrib import layers\nfrom tensorflow.contrib.framework.python.ops import arg_scope\nfrom tensorflow.contrib.layers.pyt...
[ [ "tensorflow.nn.softmax", "tensorflow.contrib.layers.python.layers.layers.max_pool2d", "tensorflow.contrib.layers.python.layers.regularizers.l2_regularizer", "tensorflow.shape", "numpy.squeeze", "tensorflow.contrib.layers.python.layers.layers.dropout", "tensorflow.contrib.layers.python....
SuiMingYang/sales-message-classify
[ "1b9ce984e907b688096c2287ad80e495034b347c" ]
[ "push_chatdata_api/chatdata.py" ]
[ "#!flask/bin/python\nimport pandas as pd\nfrom sqlalchemy import create_engine\nfrom flask import Flask, jsonify\nfrom flask import request,Response\nimport requests\nimport json\n\napp = Flask(__name__)\n\n@app.route('/push_chatdata', methods=['POST'])\ndef push_chatdata():\n try:\n info_list=request.for...
[ [ "pandas.DataFrame" ] ]
steveschulze/skyportal
[ "8f6bec6de89ea774d8d88f0ef24e9d10f3fce151" ]
[ "skyportal/handlers/api/color_mag.py" ]
[ "import numpy as np\nfrom baselayer.app.access import auth_or_token\nfrom ..base import BaseHandler\n\nfrom ...models import (\n Obj,\n Annotation,\n)\n\n\ndef normalize_key(str):\n # convert the string to lowercase and remove underscores\n return str.lower().replace('_', '')\n\n\ndef get_color_mag(anno...
[ [ "numpy.isnan", "numpy.log10" ] ]
Rhushabh1/Mini-AI-Games
[ "a9478c1e8bb93ffecdc247b0cf3ba7e3416ff095" ]
[ "envs/2048/engine_2048.py" ]
[ "import pygame\nimport random\nimport numpy as np\n\nSCREEN_WIDTH = 800\nSCREEN_HEIGHT = 900\nGRID_SIZE = 20\n\n# fontcolor, bgcolor\nwhite = '#ffffff'\nBgColor = '#cccccc'\ncolors = {\n\t1: \t\t['#b3adad', '#b3adad'],\n\t2: \t\t['#776e64', '#eee4da'],\n\t4: \t\t['#776e64', '#ede0c8'],\n\t8: \t\t['#f9f6f2', '#f2b17...
[ [ "numpy.array", "numpy.where", "numpy.zeros", "numpy.random.choice" ] ]
migperfer/crema
[ "0aabbfa4dd67bdc86ff628203795060942c45aac" ]
[ "crema/models/chord.py" ]
[ "#!/usr/bin/env python\n'''CREMA Chord model'''\n\nimport numpy as np\nfrom scipy.stats import gmean\nfrom librosa import time_to_frames\nimport mir_eval\n\nfrom .base import CremaModel\n\n\nSEMITONE_TO_SCALE_DEGREE = ['1', 'b2', '2', 'b3', '3',\n '4', 'b5', '5', 'b6', '6', 'b7', '7']\n\n...
[ [ "scipy.stats.gmean", "numpy.argmax", "numpy.mod", "numpy.save" ] ]
LegendaryDaim/arXiv2020-RIFE
[ "8b1c0679a1d088117ab854b537ec631450658b70" ]
[ "inference_video_parallel.py" ]
[ "import os\nimport cv2\nimport torch\nimport argparse\nimport numpy as np\nfrom tqdm import tqdm\nfrom torch.nn import functional as F\nimport warnings\nimport _thread\nimport skvideo.io\nfrom queue import Queue, Empty\n\nwarnings.filterwarnings(\"ignore\")\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_availab...
[ [ "numpy.transpose", "numpy.round", "torch.set_grad_enabled", "torch.cuda.is_available", "torch.nn.functional.interpolate", "numpy.array", "torch.nn.functional.pad" ] ]
JJavier98/TFG-Bebop-YOLO
[ "d56e307862c853fbea8bc1b0a634a0e65d7ba95c" ]
[ "src/yolo3/model.py" ]
[ "\"\"\"YOLO_v3 Model Defined in Keras.\"\"\"\n\nfrom functools import wraps\n\nimport numpy as np\nimport tensorflow as tf\nfrom keras import backend as K\nfrom keras.layers import Conv2D, Add, ZeroPadding2D, UpSampling2D, Concatenate\nfrom keras.layers.advanced_activations import LeakyReLU\nfrom keras.layers.norma...
[ [ "tensorflow.boolean_mask", "numpy.expand_dims", "numpy.maximum", "numpy.minimum", "tensorflow.image.non_max_suppression", "numpy.argmax", "numpy.floor", "numpy.array" ] ]
n0whereRuoxi/rl-starter-files
[ "b2ae68d544f4665a62b3d782c44008ef050e9b62" ]
[ "gym_minigrid/wrappers.py" ]
[ "import math\nimport operator\nfrom functools import reduce\n\nimport numpy as np\nimport gym\nfrom gym import error, spaces, utils\nfrom .minigrid import OBJECT_TO_IDX, COLOR_TO_IDX, STATE_TO_IDX\n\nclass ReseedWrapper(gym.core.Wrapper):\n \"\"\"\n Wrapper to always regenerate an environment with the same se...
[ [ "numpy.array", "numpy.zeros", "numpy.arctan", "numpy.divide" ] ]
akhilmeleth/greyatom-python-for-data-science
[ "634530dc8bb25ea6283a53861bf701d94d1fb5e4" ]
[ "Project:-Make-Sense-of-Census/code.py" ]
[ "# --------------\n# Importing header files\r\nimport numpy as np\r\nimport warnings\r\n\r\nwarnings.filterwarnings('ignore')\r\n\r\n#New record\r\nnew_record=[[50, 9, 4, 1, 0, 0, 40, 0]]\r\n\r\n#Reading file\r\ndata = np.genfromtxt(path, delimiter=\",\", skip_header=1)\r\n\r\n#Code starts here\r\n#Loading da...
[ [ "numpy.concatenate", "numpy.genfromtxt" ] ]
ricardodeazambuja/IJCNN2017-2
[ "817165185de6152041bbaf21cbad6d12fb58f064" ]
[ "membrane_lowpass_md.py" ]
[ "\nimport numpy\n\nclass membrane_lowpass(object):\n \n def __init__(self, Number_of_Neurons, tau):\n '''\n Initializes the neuron membranes.\n Number_of_Neurons: total number of neurons to be simulated\n tau: time constant (in seconds)\n '''\n self.neurons = numpy.ze...
[ [ "numpy.exp", "numpy.zeros" ] ]
huotarim/huotarim-xgboost-li-ion-batteries
[ "a5c183be35aab4bd86924913d37d0ec7bc3a4220" ]
[ "922_tune_learning_rate.py" ]
[ "# battery 023, parallel cross validation\nfrom pandas import read_csv\nfrom sklearn.model_selection import train_test_split\nfrom xgboost import XGBRegressor\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.model_selection import TimeSeriesSplit\nimport matplotlib\nmatplotlib.use('Agg')\nfrom matplo...
[ [ "matplotlib.pyplot.legend", "sklearn.model_selection.GridSearchCV", "pandas.read_csv", "matplotlib.use", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.savefig", "sklearn.model_selection.TimeSeriesSplit", "matplotlib.pyplot.xlabel", "numpy.array", "matplotli...
asuberlin/price_wage_dynamics
[ "06ac51fa0b3ad7f1bb3e81540354b8aea866a693" ]
[ "single/firm.py" ]
[ "from scipy.optimize import minimize, minimize_scalar, basinhopping, curve_fit\nimport numpy as np\n\nclass Firm:\n def __init__(self, money, firmParameters, p_star, S_star, L_star, z_star, expectation):\n self.gamma = firmParameters['gamma']\n self.p_t = p_star\n self.zeta_0 = firmParameter...
[ [ "numpy.random.normal", "scipy.optimize.minimize_scalar", "numpy.zeros" ] ]
affromero/SMILE
[ "931510d69b2e33f2fe633563833c50a7408f89ef" ]
[ "metrics/arcface_resnet.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 18-5-21 下午5:26\n\n@author: ronghuaiyang\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\nimport torch.nn.utils.weight_norm as weight_norm\nimport torch.nn.functional as F\n\n# https://github.com/ronghuaiyang/arcface-py...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.PReLU", "torch.nn.Conv2d", "torch.nn.init.xavier_normal_", "torch.nn.Sigmoid", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d", "torch.nn.Ba...
FujitsuLaboratories/CAC
[ "d12df8e47f61eaf7d7b0ed355e2d1aa296453f86" ]
[ "cac/pruning/examples/resnet110/resnet110.py" ]
[ "# resnet110.py COPYRIGHT Fujitsu Limited 2021\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nclass LambdaLayer(nn.Module):\r\n def __init__(self, lambd):\r\n super(LambdaLayer, self).__init__()\r\n self.lambd = lambd\r\n\r\n def forward(self, x):\r\n ...
[ [ "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.functional.relu", "torch.nn.AdaptiveAvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.functional.pad" ] ]
daviesje/21cmFAST
[ "f36885a813ace72f34c881d80473208d06e3829a" ]
[ "src/py21cmfast/cli.py" ]
[ "\"\"\"Module that contains the command line app.\"\"\"\nimport builtins\nimport click\nimport inspect\nimport logging\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport warnings\nimport yaml\nfrom os import path, remove\nfrom pathlib import Path\n\nfrom . import _cfg, cache_tools, global_params, plotting...
[ [ "numpy.abs", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.log10", "numpy.mean", "numpy.array" ] ]
Afafabdb/Instahawk
[ "43e380980968fdf9102dc439161fa2fe288e488a" ]
[ "app.py" ]
[ "import instaloader\nfrom flask import Flask, render_template, request, jsonify\nfrom instaloader import Profile, Post\nfrom vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer\nimport numpy as np\n\n\napp = Flask(__name__)\nloader = instaloader.Instaloader()\n\n\n@app.route('/', methods=['GET'])\ndef h...
[ [ "numpy.array" ] ]
jakeatmsft/MachineLearningNotebooks
[ "f918280668e6d4f6ff98dc2c9ea04527b716fc60" ]
[ "how-to-use-azureml/training-with-deep-learning/train-hyperparameter-tune-deploy-with-keras/keras_mnist.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport numpy as np\nimport argparse\nimport os\nimport glob\n\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\n\nfrom tensorflow.keras.models import Sequential, model_from_json\nfrom tensorflow.keras.layers ...
[ [ "matplotlib.pyplot.legend", "tensorflow.keras.layers.Dense", "tensorflow.keras.optimizers.RMSprop", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "tensorflow.keras.models.Sequential", "matplotlib.pyplot.figure" ] ]
Tung-I/nips2019_template
[ "a1fcf35b7633d192d2706a533731cb8c457ac230" ]
[ "src/runner/predictors/vipcup_seg_predictor.py" ]
[ "import csv\nimport torch\nimport logging\nimport numpy as np\nimport nibabel as nib\nfrom tqdm import tqdm\n\nfrom src.data.transforms import compose\n\n\nclass VIPCUPSegPredictor(object):\n \"\"\"The predictor for the VIPCUP 2018 segmentation task.\n Args:\n data_dir (Path): The directory of the save...
[ [ "numpy.eye", "torch.no_grad", "numpy.mean", "torch.zeros" ] ]
Velcon-Zheng/scPretrain
[ "e12081cbfeb9b014e7e780770ada3e816d2a856c" ]
[ "fig.py" ]
[ "import config\nimport re\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib.ticker as ticker\n\nfrom tqdm import tqdm\nfrom matplotlib.pyplot import MultipleLocator\n\nfold=config.fold1\nfold2=config.fold2\n\nacc_pt,acc_ft=[[] for i in range(fold*fold2)],[[] for i in range(fold*fold2)]\nkappa_...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.yticks", "numpy.linspace", "matplotlib.pyplot.title", "matplotlib.pyplot.scatter", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.MultipleLocator", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel",...
ZAKAUDD/LightNet
[ "58353b28d33e69cc877db878c4a888aabc2118ce" ]
[ "modules/dense.py" ]
[ "from collections import OrderedDict\n\nimport torch\nimport torch.nn as nn\n\nfrom .bn import ABN\n\n\nclass DenseModule(nn.Module):\n def __init__(self, in_chns, squeeze_ratio, out_chns, n_layers, dilate_sec=(1, 2, 4, 8, 16), norm_act=ABN):\n super(DenseModule, self).__init__()\n self.n_layers = ...
[ [ "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.Dropout2d", "torch.cat" ] ]
LMEst-Rotor/ross
[ "33aaa4b32ff7c32465cb81840f3cb2d6b2cdd65a" ]
[ "ross/fluid_flow/cylindrical.py" ]
[ "import time\n\nimport numpy as np\nfrom numpy.linalg import pinv\nfrom scipy.optimize import curve_fit, minimize\n\nfrom ross.units import Q_, check_units\n\n\nclass THDCylindrical:\n \"\"\"This class calculates the pressure and temperature field in oil film of a cylindrical bearing, with two (2) pads. It is al...
[ [ "numpy.linalg.solve", "numpy.sqrt", "numpy.arange", "numpy.cos", "numpy.linalg.norm", "numpy.sin", "numpy.concatenate", "scipy.optimize.curve_fit", "numpy.ones", "scipy.optimize.minimize", "numpy.zeros", "numpy.sum" ] ]
Zhangyongtao123/maskrcnn_benchmark
[ "059f04c26df2c1bd19dd7360ee2487ce3461da37" ]
[ "tools/test_net.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n# Set up custom environment before nearly anything else is imported\n# NOTE: this should be the first import (no not reorder)\nfrom maskrcnn_benchmark.utils.env import setup_environment # noqa F401 isort:skip\n\nimport argparse\nimport os\n\...
[ [ "torch.distributed.init_process_group", "torch.cuda.set_device", "torch.cuda.current_device", "torch.cuda.is_available", "torch.cuda.get_device_name", "torch.cuda.device_count" ] ]
bwosh/DLR_CollaborationAndCompetition
[ "aee211990dbb889888df2397bdbd7e229acdc770" ]
[ "utils/utils.py" ]
[ "import numpy as np\nimport torch\n\ndef soft_update(local_model, target_model, tau):\n for target_param, local_param in zip(target_model.parameters(), local_model.parameters()):\n target_param.data.copy_(tau*local_param.data + (1.0-tau)*target_param.data)\n\ndef tensor(t, device):\n return torch.tenso...
[ [ "numpy.sqrt", "torch.tensor" ] ]
Ericknht/DataEngineer
[ "966dd45288ad9ec7bcea7fec5f198496dd54d0e9" ]
[ "web_scrapper/transform/main.py" ]
[ "import argparse\nimport hashlib\nimport nltk\nfrom nltk.corpus import stopwords\nimport logging\nlogging.basicConfig(level=logging.INFO)\nfrom urllib.parse import urlparse\n\nimport pandas as pd\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef main(filename):\n logger.info('Starting cleaning process')\n\n ...
[ [ "pandas.read_csv" ] ]
aryavohra/ray
[ "6d884f1442c271329829ff0bceae588f3cd49d7d" ]
[ "rllib/utils/exploration/ornstein_uhlenbeck_noise.py" ]
[ "import numpy as np\nfrom typing import Optional, Union\n\nfrom ray.rllib.models.action_dist import ActionDistribution\nfrom ray.rllib.utils.annotations import override\nfrom ray.rllib.utils.exploration.gaussian_noise import GaussianNoise\nfrom ray.rllib.utils.framework import try_import_tf, try_import_torch, \\\n ...
[ [ "numpy.array" ] ]
mahmlk/ENSF619.2_Assignments
[ "e1cff2159a23f3482e632cd460ac8d14c60f365e" ]
[ "Final Project/Model/main.py" ]
[ "from __future__ import print_function\nimport torch, os, copy, time, pickle\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torchvision\nfrom torchvision import datasets, transforms\nfrom torch.autograd import Variable\nimport matplotlib.pyplot as plt\nimport numpy as n...
[ [ "torch.nn.Softmax", "matplotlib.pyplot.legend", "numpy.linspace", "torch.load", "numpy.asarray", "matplotlib.pyplot.ylim", "numpy.set_printoptions", "sklearn.metrics.confusion_matrix", "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplot", "to...
GT4SD/-reinvent_models
[ "e1cf00d1b24fe5f39354e34829adc25460da84e2" ]
[ "reinvent_models/link_invent/networks/attention_layer.py" ]
[ "import math\r\n\r\nimport torch\r\nfrom torch import nn as tnn\r\n\r\n\r\nclass AttentionLayer(tnn.Module):\r\n\r\n def __init__(self, num_dimensions: int):\r\n super(AttentionLayer, self).__init__()\r\n\r\n self.num_dimensions = num_dimensions\r\n\r\n self._attention_linear = tnn.Sequentia...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Tanh" ] ]
tridungduong16/fairCE
[ "b13c72c253d875e68c0294b91aaddcbf93460d92" ]
[ "src/counterfactual_explanation/flow_ssl/data/nlp_datasets.py" ]
[ "import os.path\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nimport subprocess\n\nGDRIVE_DOWNLOAD = lambda FID,FNAME: f\"wget --load-cookies /tmp/cookies.txt \\\"https://docs.google.com/uc?export=download&confirm=$(wget\\\n --quiet --save-cookies /tmp/cookies.txt --keep-session-co...
[ [ "numpy.load", "torch.from_numpy" ] ]
ara-ta3/mnist
[ "5af3cc964145dc94cab3cc860819ea37717a346f" ]
[ "python/mnist/functions.py" ]
[ "import numpy as np\n\n\ndef cross_entropy_error(y, t):\n if y.ndim == 1:\n t = t.reshape(1, t.size)\n y = y.reshape(1, y.size)\n if t.size == y.size:\n t = t.argmax(axis=1)\n\n batch_size = y.shape[0]\n return -np.sum(np.log(y[np.arange(batch_size), t])) / batch_size\n\n\ndef numer...
[ [ "numpy.arange", "numpy.zeros_like", "numpy.nditer" ] ]
rwest/RMG-Py
[ "54e645b17a8e9a1652c9e60b9251444bc6c25e5f" ]
[ "rmgpy/data/thermo.py" ]
[ "#!/usr/bin/env python3\n\n###############################################################################\n# #\n# RMG - Reaction Mechanism Generator #\n# ...
[ [ "numpy.std", "numpy.array", "numpy.sum", "numpy.average" ] ]
SanjibSarkarU/iver-rf-ac-test
[ "5b42711c1efe4ec99e8349c37431097aa86e279d" ]
[ "MRC_Iver.py" ]
[ "from time import monotonic\r\nimport time\r\n# import geopy.distance\r\nimport serial\r\nimport pandas as pd\r\nimport numpy as np\r\n# import checkSum\r\nimport re\r\nimport warnings\r\nimport tkinter as tk\r\nfrom geographiclib.geodesic import Geodesic\r\nimport numpy.polynomial.polynomial as poly\r\nimport pyma...
[ [ "numpy.dot", "numpy.polyfit", "numpy.absolute", "numpy.polynomial.polynomial.polyfit", "pandas.DataFrame", "scipy.stats.linregress", "numpy.polynomial.polynomial.polyval", "numpy.array" ] ]
ralgara/pointer-generator
[ "4c5ebec95af14847218326175a1a31b0232a74aa" ]
[ "batcher.py" ]
[ "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n# Modifications Copyright 2017 Abigail See\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.apach...
[ [ "tensorflow.logging.error", "tensorflow.logging.warning", "numpy.zeros", "tensorflow.logging.info" ] ]
sudhaveturi/repo
[ "7510d31fe27a0e759e12850f281619ce415dd279" ]
[ "software/metax/MatrixManager.py" ]
[ "import pandas\nimport numpy\nimport Exceptions\n\ndef load_matrix_manager(path):\n d = pandas.read_table(path, sep=\"\\s+\")\n m = MatrixManager(d)\n return m\n\n\nclass MatrixManager(object):\n def __init__(self, d):\n _validate(d)\n self.data = _build_data(d)\n\n def get(self, gene, ...
[ [ "numpy.matrix", "pandas.read_table" ] ]
DK-Jang/human_motion_manifold
[ "dd3b603b892d66685204909c8818f3e1621ab7dc" ]
[ "result2bvh.py" ]
[ "import sys\nimport os\nimport numpy as np\nimport h5py\nsys.path.append('./utils_motion')\nfrom Animation import Animation, positions_global\nfrom Quaternions import Quaternions\nfrom BVH import save\nfrom skeleton import Skeleton\nimport argparse\n\noffsets = np.array([\n [ 0. , 0. , 0. ...
[ [ "numpy.append", "numpy.array", "numpy.min" ] ]
adeeconometrics/s_distributions
[ "a29b1db324d7ee7f63498c8ed1888ab6ead849d8" ]
[ "source/univariate/test/BetaPrime.py" ]
[ "try:\r\n from scipy.special import beta as _beta, betainc as _betainc\r\n import numpy as _np\r\n from typing import Union, Dict, List\r\n from math import sqrt as _sqrt\r\n from univariate._base import SemiInfinite\r\nexcept Exception as e:\r\n print(f\"some modules are missing {e}\")\r\n\r\n\r\...
[ [ "numpy.power", "numpy.any", "numpy.array", "scipy.special.betainc", "scipy.special.beta" ] ]
Bahrd/AppliedPythonology
[ "65d7bd665eba823c3319c3efdc5a5047ddfa534d" ]
[ "auxiliary.py" ]
[ "## Auxiliary routines for image processing algorithms\nimport numpy as np; from numpy.linalg import inv\nimport matplotlib.pyplot as plt; from matplotlib.colors import LinearSegmentedColormap as lscm\n\n#Image presentation\ndef displayImages(images, titles = '', cmp = 'gray', show = True):\n if type(images) is ...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.title", "numpy.tile", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplot", "numpy.floor", "matplotlib.colors.LinearSegmentedColormap.from_list", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
rabernat/oceanspy
[ "9bd58f8529cb0fa865393c057ad7498e4f99681d" ]
[ "oceanspy/plot.py" ]
[ "\"\"\"\nPlot using OceanDataset objects.\n\"\"\"\n# TODO: add test that check squeezing!\n\nimport xarray as _xr\nimport oceanspy as _ospy\nimport numpy as _np\nimport warnings as _warnings\nimport copy as _copy\nimport functools as _functools\n\nfrom . import compute as _compute\n\ntry: \n import...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.clabel", "numpy.linspace", "numpy.asarray", "matplotlib.use", "matplotlib.pyplot.axes" ] ]
robotcreating2020-1/cola_with_crane_x7_ros
[ "bf9f9df35925703a0b625fd3dda3b88e80d1f48a" ]
[ "cola_examples/scripts/find_red.py" ]
[ "#!/usr/bin/env python \n# -*- coding: utf-8 -*-\nimport sys\nimport rospy\nimport cv2\nimport numpy as np\nfrom std_msgs.msg import String\nfrom std_msgs.msg import Int32\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge, CvBridgeError\n\nclass image_converter:\n def __init__(self):\n self.ima...
[ [ "numpy.array" ] ]
lorenzobasile/DeepRobust
[ "3f56dcc45f1fed788423d32cc179c26513416e2e" ]
[ "deeprobust/image/defense/pgdtraining.py" ]
[ "\"\"\"\nReference:\nMądry, A., Makelov, A., Schmidt, L., Tsipras, D., & Vladu, A. (2017).\nTowards Deep Learning Models Resistant to Adversarial Attacks.\nstat, 1050, 9.\n\"\"\"\n\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nimport torc...
[ [ "torch.nn.functional.nll_loss", "torch.manual_seed", "torch.optim.lr_scheduler.ExponentialLR", "torch.cuda.is_available", "torch.device" ] ]
vatj/integer_polyomino
[ "ffa7f53bb17e43c53ea387bfc3cf8a6c917037c4" ]
[ "notebooks/example_genome_metrics_to_hdf.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport sys, os\nos.nice(0)\n\n\n# In[2]:\n\n\nimport pandas as pd\nimport numpy as np\nimport glob\n\n\n# In[3]:\n\n\nimport integer_polyomino.assembly as ipa\nsys.path.append(os.path.join(os.getcwd(), \"..\", \"src\", \"integer_polyomino\", \"scripts\"))\nim...
[ [ "pandas.set_option" ] ]
javiermcebrian/glcapsnet
[ "07b1093c922461024d8049161e646bd1847eccbb" ]
[ "configs/02_gf/config.py" ]
[ "import numpy as np\nimport pandas as pd\nimport sys\nimport os\nsys.path.append(os.path.abspath('../'))\n\nfrom utils.functions import kld, margin_loss, spread_loss, mean_squared_error, sum_squared_errors, information_gain_wrapper, normalized_scanpath_saliency, cc, similarity, auc_judd, auc_borji_wrapper, sAUC_wra...
[ [ "numpy.arange", "pandas.read_csv" ] ]
eman-ramadan/deepcache_netai2018
[ "b13474dc677f4b13095498baa7b8be05f9c2b3d0" ]
[ "RequestsGeneration/requestAnalysis.py" ]
[ "\"\"\"\n DeepCache\n \nDeepCache is distributed under the following BSD 3-Clause License:\n\nCopyright(c) 2019\n University of Minensota - Twin Cities\n Authors: Arvind Narayanan, Saurabh Verma, Eman Ramadan, Pariya Babaie, and Zhi-Li Zhang\n\nAll right...
[ [ "pandas.merge", "pandas.read_csv" ] ]
Erica233/mlflow-project-best-practices
[ "3208af250fb91f44c635031db694b92a16d31729" ]
[ "old_main.py" ]
[ "# pylint: disable=no-name-in-module\n# pylint: disable=no-self-argument\n\nfrom fastapi import FastAPI\nimport uvicorn\nimport mlflow\nimport pandas as pd\nfrom pydantic import BaseModel\nfrom fastapi.responses import JSONResponse\nfrom fastapi.encoders import jsonable_encoder\n\nclass Story(BaseModel):\n text:...
[ [ "pandas.DataFrame" ] ]
sushmita-mishra/e-comm-chatobot-luis
[ "ede7c98e75bcac1ff1c55396dc24392d33ce0ee5" ]
[ "dialogs/operations/createorder_dialog.py" ]
[ "from botbuilder.dialogs import (\r\n ComponentDialog,\r\n WaterfallDialog,\r\n WaterfallStepContext,\r\n DialogTurnResult,\r\n)\r\nfrom botbuilder.dialogs.prompts import TextPrompt, PromptOptions, ChoicePrompt, ConfirmPrompt\r\nfrom botbuilder.core import MessageFactory\r\nfrom botbuilder.schema import...
[ [ "pandas.DataFrame" ] ]
WHSnyder/tensorflow
[ "a4821531c61821b1442417694aaf93821f07045a" ]
[ "tensorflow/python/eager/context.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.core.protobuf.config_pb2.RunMetadata", "tensorflow.python.pywrap_tfe.TFE_ContextSetThreadLocalMirroringPolicy", "tensorflow.python.pywrap_tfe.TFE_ContextOptionsSetDevicePlacementPolicy", "tensorflow.python.pywrap_tfe.TFE_ContextGetExecutorForThread", "tensorflow.python.pywrap_tfe.T...
hassanmohsin/2d-image-classification
[ "7b52a203fa305d6064fe938d380c94067dc696ee" ]
[ "train/utils.py" ]
[ "import os\n\nimport torch\nimport torch.functional as F\nimport torch.nn as nn\n\n\nclass FocalLoss(nn.Module):\n def __init__(self, alpha=0.25, gamma=3):\n super(FocalLoss, self).__init__()\n self.alpha = alpha\n self.gamma = gamma\n\n def forward(self, inputs, targets):\n bce_lo...
[ [ "torch.mean", "torch.sigmoid", "torch.load", "torch.round", "torch.sum", "torch.exp", "torch.functional.binary_cross_entropy_with_logits", "torch.save" ] ]
JonathanShor/DoubletDetection
[ "fd08d1c0310a78a63438ddff0693a1fba0ad50e4" ]
[ "tests/test_package.py" ]
[ "import numpy as np\n\nimport doubletdetection\n\n\ndef test_classifier():\n\n counts = np.random.poisson(size=(500, 100))\n\n # no phenograph\n clf = doubletdetection.BoostClassifier(n_iters=2, use_phenograph=False, standard_scaling=True)\n clf.fit(counts).predict(p_thresh=1e-16, voter_thresh=0.5)\n ...
[ [ "numpy.random.poisson" ] ]
shahrukhx01/siamese-nn-semantic-text-similarity
[ "df15c4f1473f8ab3ff1dbfb1c4a888817c684ecd" ]
[ "siamese_sts/siamese_net/siamese_lstm.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom siamese_sts.utils.utils import similarity_score\n\n\"\"\"\nWrapper class using Pytorch nn.Module to create the architecture for our \nbinary classification model\n\"\"\"\n\n\nclass SiameseLSTM(nn.Module):\n def __init__(\n sel...
[ [ "torch.zeros", "torch.nn.Embedding", "torch.nn.LSTM" ] ]
thunlp/VisualDS
[ "855b5e0904b9bd6a8d6c30e4ea9156c5967e1143" ]
[ "maskrcnn_benchmark/structures/bounding_box.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\n\n# transpose\nFLIP_LEFT_RIGHT = 0\nFLIP_TOP_BOTTOM = 1\n\n\nclass BoxList(object):\n \"\"\"\n This class represents a set of bounding boxes.\n The bounding boxes are represented as a Nx4 Tensor.\n In order to unique...
[ [ "torch.device", "torch.cat", "torch.as_tensor" ] ]
ehgh/COVID-19-case-estimation-and-policy-effects
[ "afc2001a0f29caf1e6e0ae9311983752ac7efff8" ]
[ "Linear Regression and Scenario Generation/code/Linear Regression.py" ]
[ "# policy contains the information on which day the policy was introduced\r\n# policy_lift contains information on which day the policy was relaxed\r\n# 1000: the policy was not introduced (relaxed) in according to the file (policy/ policy_lift)\r\n# we use data from February 18, 2020 to May 7, 2020 to estimate the...
[ [ "pandas.read_csv", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "numpy.percentile", "sklearn.linear_model.Lasso", "numpy.load", "scipy.stats.sem", "numpy.zeros" ] ]
manideep2510/Lipreading-Keras
[ "d5b41a62599a68e6506cbf8d25779f770505f6b7" ]
[ "aligns.py" ]
[ "import numpy as np\n\nclass Align(object):\n def __init__(self, absolute_max_string_len=128, label_func=None):\n self.label_func = label_func\n self.absolute_max_string_len = absolute_max_string_len\n\n def from_file(self, path):\n with open(path, 'r') as f:\n lines = f.readli...
[ [ "numpy.array" ] ]
jfkcooper/SScanSS-2
[ "ae50c1d065732a7742eaf1a7b9a9349907c29f8a" ]
[ "sscanss/core/instrument/robotics.py" ]
[ "from enum import Enum, unique\nimport logging\nimport math\nimport time\nimport nlopt\nimport numpy as np\nfrom PyQt5 import QtCore\nfrom ..geometry.mesh import MeshGroup\nfrom ..math.constants import VECTOR_EPS\nfrom ..math.matrix import Matrix44\nfrom ..math.misc import trunc\nfrom ..math.transform import (rotat...
[ [ "numpy.dot", "numpy.radians", "numpy.linspace", "numpy.clip", "numpy.linalg.inv", "numpy.isfinite", "numpy.degrees", "numpy.linalg.norm", "numpy.copy", "numpy.append", "numpy.array", "numpy.polyval", "numpy.zeros" ] ]
phykn/smatrix
[ "d23655a5c96500e5a5b8905ff3733baaf89dffdb" ]
[ "helper.py" ]
[ "import numpy as np\r\n\r\ndef constant_refractive_index(n, ws):\r\n '''\r\n Args:\r\n n (float): constant refractive index\r\n ws (float list): wavenumber\r\n Return:\r\n refractive_index (complex array): refractive index\r\n '''\r\n refractive_index = complex(n, 0)\r\n refra...
[ [ "numpy.array" ] ]
JRaidal/Bayesian2D
[ "67d130d56566e68075317f6f520ac6607604f8fe" ]
[ "Bayesian2D/tests/test_acquisition.py" ]
[ "import unittest\nfrom Bayesian2D.tools import acquisition\nimport numpy as np\nfrom sklearn.gaussian_process import GaussianProcessRegressor\nfrom sklearn import preprocessing\nfrom sklearn.gaussian_process.kernels import Matern\n\nclass TestAcquisition(unittest.TestCase):\n\n\tdef setUp(self):\n\t\tself.XY = np.a...
[ [ "numpy.array", "sklearn.gaussian_process.kernels.Matern" ] ]
austiezr/pandas
[ "4c8d66ecfe2b13607afd254443979b1ff842b6c1" ]
[ "pandas/core/internals/blocks.py" ]
[ "from datetime import datetime, timedelta\nimport inspect\nimport re\nfrom typing import TYPE_CHECKING, Any, List, Optional, Type, Union, cast\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import NaT, algos as libalgos, internals as libinternals, lib, writers\nfrom pandas._libs.internals import BlockP...
[ [ "pandas.util._validators.validate_bool_kwarg", "pandas.core.dtypes.cast.maybe_box_datetimelike", "pandas.core.arrays.DatetimeArray._simple_new", "pandas.core.missing.clean_interp_method", "pandas.core.dtypes.common.is_datetime64_dtype", "numpy.place", "numpy.where", "pandas.core.dt...
Penlect/rectangle-packer
[ "52639f09ef0ce84bb1dbd81332554ba33ef2d835" ]
[ "misc/recstat.py" ]
[ "#!/usr/bin/env python3\n\"\"\"Visualize rpack packing & benchmark results\n\nSync files from Bucket:\n\n$ gsutil -m rsync -r gs://bucket.penlect.com/rpack artifacts/\n\n\"\"\"\n\n# Built-in\nimport argparse\nimport os\nimport re\nimport pickle\nimport math\nfrom pathlib import Path\n\n# PyPI\nimport matplotlib\nim...
[ [ "numpy.polyfit", "numpy.poly1d", "matplotlib.ticker.MultipleLocator", "matplotlib.use", "matplotlib.pyplot.figure", "matplotlib.pyplot.subplots", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.savefig", "matplotlib.pyplot.colorbar", "numpy.mean", "matplotlib.animation...
doktorsleepelss/openpilot
[ "d4d21a954245bf534f344ba9de7a4cb055708564", "d4d21a954245bf534f344ba9de7a4cb055708564" ]
[ "selfdrive/controls/tests/test_lateral_mpc.py", "selfdrive/controls/lib/pathplanner.py" ]
[ "import unittest\nimport numpy as np\nfrom selfdrive.car.honda.interface import CarInterface\nfrom selfdrive.controls.lib.lateral_mpc import libmpc_py\nfrom selfdrive.controls.lib.vehicle_model import VehicleModel\nfrom selfdrive.controls.lib.drive_helpers import MPC_N, CAR_ROTATION_RADIUS\n\n\ndef run_mpc(v_ref=30...
[ [ "numpy.zeros", "numpy.ones" ], [ "numpy.arange", "numpy.linalg.norm", "numpy.column_stack", "numpy.array", "numpy.zeros" ] ]
sethmerkel/qiskit-terra
[ "aa2c3e6049adff7a846be5b865d85ac77886b590" ]
[ "qiskit/quantum_info/states/statevector.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.diag", "numpy.dot", "numpy.product", "numpy.sqrt", "numpy.asarray", "numpy.kron", "numpy.allclose", "numpy.reshape", "numpy.arange", "numpy.ravel", "numpy.array2string", "numpy.zeros", "numpy.transpose", "numpy.argsort", "numpy.array", "numpy....
anudeepsekhar/Lane-Detection-Pytorch
[ "cfddda8a0768cf83afd87e29d605fd58aa89df59" ]
[ "scripts/helper.py" ]
[ "import matplotlib.pyplot as plt\nimport torchvision\nimport torch\nimport numpy as np\nimport torch.nn.functional as F\n\ndef images_to_probs(net, images):\n '''\n Generates predictions and corresponding probabilities from a trained\n network and a list of images\n '''\n output = net(images)\n # ...
[ [ "matplotlib.pyplot.imshow", "torch.nn.functional.softmax", "torch.max", "matplotlib.pyplot.scatter", "numpy.arange", "numpy.squeeze", "matplotlib.pyplot.subplots", "numpy.concatenate", "torch.nn.functional.sigmoid", "matplotlib.pyplot.subplot", "torch.squeeze", "mat...
iod-ine/philoseismos
[ "79240d11cf82c3552c4a49d4e19a79b003fa9929" ]
[ "tests/test_grids/test_surfer6text.py" ]
[ "\"\"\" philoseismos: engineering seismologist's toolbox.\n\nauthor: Ivan Dubrovin\ne-mail: io.dubrovin@icloud.com \"\"\"\n\nimport numpy as np\nimport pytest\n\nfrom philoseismos.grids import Surfer6TextGrid\n\n\ndef test_loading_surfer6text(text_grd_file, bad_text_grd_file):\n \"\"\" Test loading process of th...
[ [ "numpy.arange", "numpy.alltrue" ] ]
xiaobaishu0097/Pointcloud-InstanceSegmentation
[ "072fe748e31d466cb58b202d9bddb37303d07858" ]
[ "train_instance_classifier.py" ]
[ "'''\nPointGroup train.py\nWritten by Li Jiang\n'''\n\nimport torch\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader, DistributedSampler\nimport time, sys, os, random, glob\nfrom tensorboardX import SummaryWriter\nimport numpy as np\n\nimport util.utils as utils\n\nfrom util.class_finder import...
[ [ "numpy.random.seed", "torch.manual_seed", "torch.cuda.empty_cache", "torch.no_grad", "torch.cuda.manual_seed_all", "torch.cuda.is_available" ] ]
manjotms10/google-trends-analytics
[ "718311ba92d880623eb85cf5c76423116faaade2" ]
[ "src/analytics/video_games/scraper/vgchartz_weekly_sales_data.py" ]
[ "import requests\r\nimport pandas\r\nimport numpy as np\r\nfrom bs4 import BeautifulSoup\r\n\r\ndef weekly_sales_scrape(weeks):\r\n '''\r\n this function is to get the weekly sales data from http://www.vgchartz.com/weekly/(week code)/Global/, where\r\n (weekcode) need to be specified by the week you are lo...
[ [ "pandas.DataFrame" ] ]
xinyuewang1/chainerrl
[ "49425d09cb0749968f4e364e281670e752a46791", "49425d09cb0749968f4e364e281670e752a46791" ]
[ "tests/explorers_tests/test_additive_gaussian.py", "examples/gym/train_pcl_gym.py" ]
[ "from __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom future import standard_library\nstandard_library.install_aliases() # NOQA\nimport unittest\n\nfrom chainer import testing\nfrom chainer.testing import condi...
[ [ "numpy.asarray", "numpy.full" ], [ "numpy.arange" ] ]
rainwaterone/stat656
[ "c582fc8c6a55c377e2b57d1f7b10471d625d79db" ]
[ "final/sol/Final2020_analysis.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Aug 4 12:17:34 2020\n\n@author: EJones\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n# Classes provided from AdvancedAnalytics ver 1.25\nfrom AdvancedAnalytics.Text import text_plot\n\nAnalysis = \"Covid\...
[ [ "numpy.polyfit", "pandas.read_pickle", "matplotlib.pyplot.ylim", "matplotlib.pyplot.hlines", "matplotlib.pyplot.subplots", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.ravel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
dhimmel/kh-tools
[ "860aa846c6e4458f1270dc62f3317807f17469b7" ]
[ "khtools/knn.py" ]
[ "import os\nimport warnings\n\nfrom matplotlib.lines import Line2D\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport pandas as pd\nfrom sklearn.neighbors import NearestNeighbors\n\nfrom . import sourmash_utils\nfrom .s3_utils import savefig\n\ndef _compute_neighbor_adjacencies(data, n_neighbors=5):\n ...
[ [ "matplotlib.pyplot.gca", "matplotlib.lines.Line2D", "matplotlib.pyplot.subplots", "pandas.DataFrame", "sklearn.neighbors.NearestNeighbors" ] ]
gbriones1/stylegan2-ada-pytorch
[ "8a3722211f83b39172f04d3a4d0706c935c35a12" ]
[ "projector.py" ]
[ "# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# NVIDIA CORPORATION and its licensors retain all intellectual property\n# and proprietary rights in and to this software, related documentation\n# and any modifications thereto. Any use, reproduction, disclosure or\n# distribution of this softwa...
[ [ "torch.optim.Adam", "torch.randn_like", "torch.jit.load", "torch.roll", "numpy.random.seed", "torch.manual_seed", "torch.nn.functional.avg_pool2d", "torch.from_numpy", "numpy.cos", "torch.tensor", "numpy.concatenate", "numpy.mean", "torch.no_grad", "torch.nn...
seed4600/jaseci
[ "d738cb5e9e90d5e3e78f516af15cdd5ad920276a" ]
[ "jskit/use_enc/use_enc.py" ]
[ "import numpy as np\nimport tensorflow_hub as hub\nimport tensorflow as tf\nimport tensorflow_text # noqa\nfrom jaseci.actions.live_actions import jaseci_action\nfrom typing import Union\n\n\nmodule = hub.load(\"https://tfhub.dev/google/universal-sentence-encoder/4\")\n\n\n@jaseci_action(act_group=['use'], aliases...
[ [ "numpy.dot" ] ]
danachang/End2EndDecoder
[ "575d6077c5932a2e0a63d5af9691d12e5cb468ef" ]
[ "model.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport tensorflow as tf\nfrom util import log\nfrom decoder import Decoder\nfrom decoder_mdl import Decoder_Mdl\n\n\nclass Model(object):\n\n def __init__(self, config,\n ...
[ [ "tensorflow.reduce_mean", "tensorflow.summary.image", "tensorflow.placeholder", "tensorflow.summary.scalar", "tensorflow.abs" ] ]
Mathiasn21/Traffic_Sign_ML_final_project
[ "17dae41f139d044f73d45493ddb82fb3d4425fa5" ]
[ "main/source/main/mlp_diff_solvers.py" ]
[ "import joblib\nimport matplotlib.pyplot as plt\nfrom sklearn.neural_network import MLPClassifier\n\n# Load previously saved models, with different MLP solvers\nmlp_adam_best: MLPClassifier = joblib.load('D:\\\\group_projects\\\\Sign-machine-learning\\\\main\\\\source\\\\models\\\\mlp_adam_best.joblib')\nmlp_sgd: M...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
Noezor/msticpy
[ "f0d6d0d0bbaeba1ca060787b9929350804fa6dc5", "f0d6d0d0bbaeba1ca060787b9929350804fa6dc5" ]
[ "msticpy/data/drivers/local_data_driver.py", "tests/data/drivers/test_kql_driver.py" ]
[ "# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# --------------------------------------------------------------------------\n...
[ [ "pandas.read_pickle", "pandas.read_csv" ], [ "pandas.DataFrame" ] ]
uberduck-ai/VQGAN-CLIP
[ "2e103f4076e084ec9774476ede00d68fdd35b35f" ]
[ "generate.py" ]
[ "# Originally made by Katherine Crowson (https://github.com/crowsonkb, https://twitter.com/RiversHaveWings)\n# The original BigGAN+CLIP method was by https://twitter.com/advadnoun\n\nimport argparse\nimport math\nimport random\n# from email.policy import default\nfrom urllib.request import urlopen\nfrom tqdm import...
[ [ "torch.cuda.get_device_properties", "torch.randn_like", "torch.randint", "numpy.linspace", "torch.sin", "torch.cat", "numpy.dtype", "torch.no_grad", "torch.cuda.is_available", "torch.nn.functional.interpolate", "torch.device", "torch.logical_and", "numpy.random....
mlhaycck/examples
[ "f27903a2116cb9158b48e36ef5531a836434c2f1" ]
[ "tensorflow_examples/lite/model_maker/core/task/text_classifier.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v1.logging.info" ] ]
mmorrison1670/yellowbrick
[ "c2028de2b7703e563503f7e85fdd65ad08de1ef6" ]
[ "tests/test_classifier/test_class_prediction_error.py" ]
[ "# tests.test_classifier.test_class_prediction_error\n# Testing for the ClassPredictionError visualizer\n#\n# Author: Benjamin Bengfort\n# Author: Rebecca Bilbro\n# Author: Larry Gray\n# Created: Tue May 23 13:41:55 2017 -0700\n#\n# Copyright (C) 2017 The scikit-yb developers\n# For license information, see ...
[ [ "sklearn.ensemble.RandomForestClassifier", "sklearn.datasets.make_multilabel_classification", "sklearn.svm.LinearSVC", "matplotlib.pyplot.figure" ] ]
MMidwinter/sqlalchemy-challenge
[ "df00c4f50f21865181654a6498f821c27c3f238d" ]
[ "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\n\nfrom flask import Flask, jsonify\n\n\n#################################################\n# Database Setup\n####################################...
[ [ "numpy.ravel" ] ]
kstrauch94/SMAC3
[ "8e9b33689f8c44270f60c22826e38f0a6bca47d4", "8e9b33689f8c44270f60c22826e38f0a6bca47d4" ]
[ "smac/epm/base_epm.py", "smac/utils/validate.py" ]
[ "import copy\nimport typing\n\nimport numpy as np\n\nfrom sklearn.decomposition import PCA\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.exceptions import NotFittedError\n\nfrom smac.configspace import ConfigurationSpace\nfrom smac.utils.constants import VERY_SMALL_NUMBER\nfrom smac.utils.logging im...
[ [ "numpy.hstack", "numpy.sum", "numpy.isnan", "numpy.nan_to_num", "numpy.tile", "numpy.mean", "numpy.zeros", "sklearn.decomposition.PCA", "sklearn.preprocessing.MinMaxScaler" ], [ "numpy.random.RandomState", "numpy.isfinite" ] ]
JoshuaJoost/GNN_SS20
[ "6b905319f2e51b71569354c347805abce9df3cb1" ]
[ "Aufgaben/abgabe2/view.py" ]
[ "__authors__ = \"Rosario Allegro (1813064), Sedat Cakici (1713179), Joshua Joost (1626034)\"\n# maintainer = who fixes buggs?\n__maintainer = __authors__\n__date__ = \"2020-04-23\"\n__version__ = \"0.0\"\n__status__ = \"Development\"\n##--- TODO \n# - Graph showing the learning progress of the neural network\n# - L...
[ [ "matplotlib.pyplot.gca", "numpy.meshgrid", "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.pyplot.colorbar", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot2grid", "matplotlib.pyplot.figure" ] ]
valterlej/dvcusi
[ "c886b6f3af783e59994eb934c838fe566ab35dc1" ]
[ "code/clustering.py" ]
[ "import os\nimport numpy as np\nimport time\nimport pickle\nfrom sklearn.cluster import MiniBatchKMeans\nfrom tqdm import tqdm\n\n\ndef mini_batch_k_means_clustering(inp_data, output_file=\"./data/cluster.pkl\", epochs=5, n_clusters=1000, random_state=0, batch_size=20000, save_file=True):\n \n cluster = MiniB...
[ [ "sklearn.cluster.MiniBatchKMeans", "numpy.save", "numpy.random.shuffle" ] ]
grozail/faraday
[ "39f6c1442c52ecb7d4a962044c38591ef09eca17" ]
[ "src/data/gym/environment.py" ]
[ "import numpy as np\nimport gym\nfrom .trajectory import RandomTrajectoryGenerationProcess, trajectory_with_current_to_csv\nfrom .config import ControlConfiguration\nfrom src.visualization.tbx import board\n\nclass SingleServoEnv(gym.GoalEnv):\n def __init__(self,\n process: RandomTrajectoryGener...
[ [ "numpy.concatenate", "numpy.square", "numpy.abs" ] ]
qapture/Dis-PU
[ "539abcfb507af38fa6e7e881db9ab8193a1a8ab7" ]
[ "Common/pc_util.py" ]
[ "\"\"\" Utility functions for processing point clouds.\n\nAuthor: Charles R. Qi, Hao Su\nDate: November 2016\n\"\"\"\n\nimport os\nimport sys\nfrom matplotlib import pyplot as plt\nfrom matplotlib import cm\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom open3d import *\nimport open3d\nfrom sklearn.neighbors import ...
[ [ "numpy.amax", "numpy.expand_dims", "numpy.take", "numpy.vstack", "numpy.squeeze", "numpy.concatenate", "numpy.max", "numpy.round", "numpy.mean", "numpy.random.randn", "numpy.exp", "numpy.square", "numpy.uint8", "numpy.arange", "numpy.matmul", "numpy....
zebivy/mars
[ "edefba4e9217d614056d7f575e3c2bf63cc8cbda" ]
[ "mars/deploy/oscar/tests/test_fault_injection.py" ]
[ "# Copyright 1999-2021 Alibaba Group Holding Ltd.\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 appl...
[ [ "numpy.testing.assert_array_equal", "numpy.random.RandomState" ] ]
igrekun/layer-to-layer-pytorch
[ "6ec1b23f370c7f8345859d90fdb3a6fb6ff117a2" ]
[ "layer_to_layer_pytorch/loss.py" ]
[ "from typing import List\n\nimport copy\n\nimport numpy as np\nimport torch\nfrom torch import nn\n\nfrom layer_to_layer_pytorch.helpers import zipper\nfrom layer_to_layer_pytorch.types import LossFn\n\n\nclass L2LLoss:\n def __init__(\n self,\n model,\n loss_fn: LossFn,\n # store_gra...
[ [ "torch.no_grad", "numpy.sum" ] ]
lewisc/spark-tk
[ "5548fc925b5c278263cbdebbd9e8c7593320c2f4" ]
[ "regression-tests/sparktkregtests/testcases/models/gmm_test.py" ]
[ "# vim: set encoding=utf-8\n\n# Copyright (c) 2016 Intel Corporation \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...
[ [ "numpy.testing.assert_almost_equal" ] ]
COVIDAnalytics/DELPHI
[ "1f75ad8047fb22f386105a7d621025d744967916" ]
[ "DELPHI_model_V4.py" ]
[ "# Authors: Hamza Tazi Bouardi (htazi@mit.edu), Michael L. Li (mlli@mit.edu), Omar Skali Lami (oskali@mit.edu)\nimport os\nimport yaml\nimport logging\nimport time\nimport psutil\nimport argparse\nimport pandas as pd\nimport numpy as np\nimport multiprocessing as mp\nfrom scipy.integrate import solve_ivp\nfrom scip...
[ [ "pandas.concat", "pandas.read_csv", "pandas.to_datetime", "numpy.log", "numpy.arctan", "pandas.Timedelta", "pandas.isna", "scipy.optimize.minimize", "scipy.optimize.dual_annealing", "numpy.exp" ] ]
cgarciae/spektral
[ "34d71510791091754b6b21a01b6b91fc3e92d84c" ]
[ "spektral/datasets/tud.py" ]
[ "import os\nimport shutil\nimport zipfile\n\nimport networkx as nx\nimport numpy as np\nimport pandas as pd\nimport requests\nfrom sklearn.preprocessing import OneHotEncoder, StandardScaler\n\nfrom spektral.utils import nx_to_numpy\n\nDATASET_URL = 'https://ls11-www.cs.tu-dortmund.de/people/morris/graphkerneldatase...
[ [ "sklearn.preprocessing.OneHotEncoder", "pandas.read_html", "numpy.concatenate", "sklearn.preprocessing.StandardScaler", "numpy.array", "numpy.sum", "numpy.vstack" ] ]
f3ss1/WildHackPublic
[ "7b7d85b116a60ff8143eb1a6e53afb1dbd30ceb7" ]
[ "popularity.py" ]
[ "import pickle\n\nfrom natasha import (\n Doc,\n Segmenter,\n NewsEmbedding,\n NewsMorphTagger,\n MorphVocab\n)\nfrom pandas import read_csv\nfrom navec import Navec\nfrom tqdm import tqdm\n\nPATH = 'navec_hudlit_v1_12B_500K_300d_100q.tar' # Name of file for Navec\n\nNAME = 'popularity'\n\n# Natasha...
[ [ "pandas.read_csv" ] ]
geissdoerfer/polyprox
[ "209d75318368c4df967581910c079ed1092c96bf" ]
[ "setup.py" ]
[ "from setuptools import setup, Extension\nfrom setuptools.command.build_ext import build_ext as _build_ext\n\n\nclass build_ext(_build_ext):\n def finalize_options(self):\n _build_ext.finalize_options(self)\n __builtins__.__NUMPY_SETUP__ = False\n import numpy\n\n self.include_dirs.ap...
[ [ "numpy.get_include" ] ]
AWNystrom/Kernels
[ "8f6297dad159d36081ee1d2067dc57b8bde55189" ]
[ "gram_matrix.py" ]
[ "from numpy import array, exp\nfrom numpy.random import choice\nfrom sklearn.base import TransformerMixin, BaseEstimator\nfrom code import interact\nfrom scipy.spatial.distance import euclidean\ndef linear_kernel(a, b):\n return a.dot(b.T)\n\ndef rbf(a, b, gamma=0.01):\n return exp(-gamma * euclidean(a, b))\n \n...
[ [ "sklearn.cross_validation.train_test_split", "sklearn.datasets.make_classification", "sklearn.linear_model.LogisticRegression", "sklearn.datasets.make_moons", "numpy.arange", "scipy.spatial.distance.euclidean", "sklearn.datasets.make_circles", "matplotlib.colors.ListedColormap", ...
smalbadger/TradeBot
[ "a6d4b443a6584af3e91b2d9bf0162db2b4c362e5" ]
[ "src/Caroline/client_side/remote_mongo_test.py" ]
[ "import pymongo\nfrom getpass import getpass\nfrom datetime import datetime, timedelta\nimport matplotlib.pyplot as plt\n\n#username = input(\"Username: \")\n#password = getpass()\ndb = 'cryptos'\n\nsuccessful_login = True\nclient = pymongo.MongoClient(\"mongodb://sam:GoodVibrations_69@192.168.0.23/cryptos\")\n#cli...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "matplotlib.pyplot.gcf" ] ]
tyler961/GravitySimulation
[ "9b0f218b4273451394cb345a478aa3c8495f5ce4" ]
[ "src/particle.py" ]
[ "import numpy\r\n\r\nclass Vector:\r\n\tdef __init__(self, magnitude, direction):\r\n\t\tself.magnitude = magnitude\r\n\t\tself.direction = direction\r\n\t\tself.xComp = 0\r\n\t\tself.yComp = 0\r\n\t\tself.calcVectorComponents()\r\n\r\n\tdef calcVectorComponents(self):\r\n\t\tself.xComp = self.magnitude * numpy.cos...
[ [ "numpy.absolute", "numpy.sqrt", "numpy.arctan", "numpy.cos", "numpy.sin" ] ]
amdecker/ir
[ "22ff03512c79239c1bd155deaeb6add3708a9805" ]
[ "util.py" ]
[ "__author__ = \"Amos Decker\"\n__date__ = \"January 2020\"\n\n\"\"\"\nvarious helpful tools used in StitcherEasy and rescale\n- system file chooser\n- remove black border from panoramas\n- & others\n\"\"\"\n\nfrom tkinter import Tk\nfrom tkinter.filedialog import askdirectory\nimport numpy as np\nfrom typing import...
[ [ "numpy.amin", "numpy.unique" ] ]
kevinsung/qiskit-terra
[ "573198bdc55eaf4ad0691d441ae41c874f46313d" ]
[ "qiskit/visualization/timeline/core.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ...
[ [ "numpy.nanmax", "numpy.abs", "numpy.min", "numpy.asarray", "numpy.nanmin", "numpy.max", "numpy.mean" ] ]