repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
cassiofragadantas/torch
[ "0db832121a82eef34cb75f6006825836cae379ac" ]
[ "tltorch/factorized_tensors/tensorized_matrices.py" ]
[ "import math\n\nimport numpy as np\nimport torch\nfrom torch import nn\n\nimport tensorly as tl\ntl.set_backend('pytorch')\nfrom tensorly import tenalg\nfrom tensorly.decomposition import parafac, tucker, tensor_train, tensor_train_matrix\n\nfrom .core import TensorizedMatrix\nfrom ..utils.parameter_list import Fac...
[ [ "torch.nn.Parameter", "torch.Tensor", "torch.zeros", "torch.unsqueeze", "torch.no_grad", "numpy.prod", "torch.squeeze" ] ]
kfoerderer/ANN-based-surrogates
[ "aef0eca9e969858e47babfc73a15c04262285e6b" ]
[ "modules/neuralnetwork/layer.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass DebugLayer(nn.Module):\n\n def __init__(self, depth):\n super().__init__()\n\n self.depth = depth\n\n def forward(self, input):\n print('nn, DebugLayer %d, %s'%(self.depth, str(input.size())))\n return input\n\nclass SkipConnection(nn.M...
[ [ "torch.cat" ] ]
oscarramos2001/Oscar-Marino-Ramos
[ "c05e497b467aab4572f3578f1b9068d4585106d2" ]
[ "tema2/mountain_car_qlearner.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 11 10:27:43 2018\n\n@author: juangabriel\n\"\"\"\n\nimport gym\nimport numpy as np\n\n\n# EPISILON_MIN : vamos aprendiendo, mientras el incremento de aprendizaje sea superior a dicho valor\n# MAX_NUM_EPISONES : número máximo de iteraciones...
[ [ "numpy.random.random", "numpy.max", "numpy.argmax", "numpy.zeros" ] ]
takemiyamakoto/mpltools
[ "5235bc6b2522abf28b5fac13ca8ff3a55434b99c" ]
[ "examples/plot_all_styles.py" ]
[ "\"\"\"\nSave test plots for all styles defined in `mpltools.style`.\n\nNote that `test_artists_plot` calls `matplotlib.pyplot.tight_layout` so subplot\nspacing is not tested for this plot.\n\"\"\"\nfrom __future__ import print_function\n\nimport os\nimport os.path as pth\n\nimport numpy as np\n\nimport matplotlib ...
[ [ "numpy.random.random", "numpy.linspace", "matplotlib.use", "matplotlib.pyplot.subplots", "numpy.sin", "matplotlib.pyplot.Circle", "matplotlib.pyplot.rcdefaults" ] ]
gibsramen/q2-convexhull
[ "6f9228f286535589509f7313ff39f1a29d6dcbdf" ]
[ "q2_convexhull/convexhull.py" ]
[ "# ----------------------------------------------------------------------------\n# Copyright (c) 2022--, convex-hull development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# ------------------------------------...
[ [ "pandas.DataFrame", "scipy.spatial.ConvexHull" ] ]
mjoshi07/AutoPano
[ "1d60ac1c717ccdaae40c129959fed5a27533d225" ]
[ "Phase2/Code/Test_unsupervised.py" ]
[ "\"\"\"\nCMSC733 Spring 2022: Classical and Deep Learning Approaches for Geometric Computer Vision\nProject1: MyAutoPano: Phase 2\n\nAuthor(s):\nMayank Joshi\nMasters student in Robotics,\nUniversity of Maryland, College Park\n\nAdithya Gaurav Singh\nMasters student in Robotics,\nUniversity of Maryland, College Par...
[ [ "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.trainable_variables", "numpy.dstack", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.placeholder", "numpy.float32", "numpy.load", "numpy.array", "tensorflow.compat.v...
mahitha2001/DSA-Questions
[ "f8970f3489fff9c79a67c58ac26e5923436ec652" ]
[ "Matrix/Python/Largest_Rectangle_Of_0.py" ]
[ "'''\r\n@Author 28Pollux28\r\nIn order to calculate the largest rectangle position and area in the matrix, we will first transform the matrix into an\r\narray of histogram (where each number tells how many consecutive zeros (the zero of the row is included) are above the\r\n number we are looking at). For example, ...
[ [ "numpy.zeros", "numpy.random.randint" ] ]
kewitz/mestrado
[ "04af87b6533cb26fcfc9a6579d691e5d019ac9dc" ]
[ "Eletromagnetismo Computacional I/FDTD2D.yee .py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nThe MIT License (MIT)\nCopyright (c) 2014 Leonardo Kewitz\n\nSimulação do erro de dispersão do FDTD quando não considerado o passo mágico em\num impulso gaussiano modulado em seno.\n\nCreated on Wed May 28 11:11:30 2014\n@author: leo\n\"\"\"\nimport numpy as np\nimport matplotlib.p...
[ [ "matplotlib.pyplot.imshow", "matplotlib.animation.ArtistAnimation", "numpy.power", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
samuelfu/Visualization
[ "f960aa8045d9aaeeaec73e0277093f46ac49a422" ]
[ "multipleRegression.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.linear_model import LinearRegression\nfrom scipy.stats import linregress\n\nfile = 'data.xlsx'\nspreadsheet = pd.ExcelFile(file)\ndf = spreadsheet.parse(spreadsheet.sheet_names[0])\ntarget = spreadsheet.parse(spreadsheet.sheet_names[1])\n\nregresso...
[ [ "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "sklearn.linear_model.LinearRegression", "pandas.ExcelFile", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figure" ] ]
pasindubawantha/sherlock-framework
[ "92d64fbc86256a61c6b00b7ca9eb0a17634c7446" ]
[ "scripts/model_runner_CDD_CNN.py" ]
[ "import json\nimport pandas\nimport math\nimport sys\nimport os\nimport numpy as np\nimport re\nimport shutil\nimport helpers\nimport confusion_metrics\n\n# args\nsherlock = \"../debug/src/SherlockCDDCNN\"\ninput_dir = \"../data/nab_tuned/\"\n# input_dir = \"../data/test/\"\ninput_summary_file = \"../data/nab_tuned...
[ [ "numpy.isnan", "numpy.array", "pandas.read_csv" ] ]
umitanuki/chainer
[ "225c56b233e684ff4855451d2af4c2fb66915f21" ]
[ "chainer/utils/conv.py" ]
[ "import numpy\nimport six\n\nfrom chainer import cuda\n\n\ndef get_conv_outsize(size, k, s, p, cover_all=False):\n if cover_all:\n return (size + p * 2 - k + s - 1) // s + 1\n else:\n return (size + p * 2 - k) // s + 1\n\n\ndef im2col_cpu(img, kh, kw, sy, sx, ph, pw, pval=0, cover_all=False):\n ...
[ [ "numpy.zeros", "numpy.pad", "numpy.ndarray" ] ]
polceanum/data.augmentation
[ "d47d93f20bca453bfda94e5cd714399fd35a6287" ]
[ "scripts/dataClean.py" ]
[ "# script: Data cleaner. Reads video files and generates pickles of cropped objects.\n# author: Mihai Polceanu\n\nimport cv2\nimport numpy as np\nimport os\nimport sys\nimport pickle\nimport argparse\n\ndef processImage(img):\n # the following two lines define the range of colors that is THROWN AWAY\n # chang...
[ [ "numpy.array", "numpy.sum", "numpy.ones" ] ]
benlazarine/GARD
[ "567bdcf59a258bdf981b395f24a5af669da628b3" ]
[ "helpers/erai/convert.py" ]
[ "import numpy as np\nfrom bunch import Bunch\n\nR=8.3144621 # J/mol/K\ncp=29.19 # J/mol/K =1.012 J/g/K\ng=9.81 # m/s^2\n\ndef subset_pressure_levels(output_data):\n levels = [0,6,11,15,20,26,28,31]\n\n output_data.u = output_data.u[:,levels,:,:]\n output_data.v = output_data.v[:,levels,:,:]\n outp...
[ [ "numpy.zeros" ] ]
khalednakhleh/vq_algorithms
[ "2b3a2954c3cf4b72f9a9b6c5d739c873e4d6f999" ]
[ "main.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 11 16:37:55 2018\n\nName: khalednakhleh\n\"\"\"\nimport numpy as np\nfrom vq_algorithms import Lloyd_max, LBG\nimport time\n\n#####################################################################\n\"\"\"\nScalar quantization of a 1-D input...
[ [ "numpy.random.randn", "numpy.random.seed" ] ]
YujiaBao/Predict-then-Interpolate
[ "50ab39de5ff70217d47a08a146a0e7b60f317b8e" ]
[ "src/models/embedding/resnet.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torchvision.models import resnet50\n\n\nclass Resnet50(nn.Module):\n def __init__(self):\n super(Resnet50, self).__init__()\n resnet = resnet50(pretrained=True, progress=True)\n modules=list(resnet.children())[:-1]\n ...
[ [ "torch.nn.Sequential" ] ]
kjang96/flow-1
[ "92b16feee3ee62cc176aa047dbb89d3b164b972a" ]
[ "flow/envs/green_wave_env.py" ]
[ "\"\"\"Environments for scenarios with traffic lights.\n\nThese environments are used to train traffic lights to regulate traffic flow\nthrough an n x m grid.\n\"\"\"\n\nimport numpy as np\nimport re\n\nfrom gym.spaces.box import Box\nfrom gym.spaces.discrete import Discrete\nfrom gym.spaces.tuple_space import Tupl...
[ [ "numpy.array", "numpy.zeros" ] ]
ecacikgoz97/Probing
[ "5df8f9fedeffdd2c6f9328b6ff47e36adca49dbb" ]
[ "pos_tagging/probe_train7.py" ]
[ "# -----------------------------------------------------------\n# Date: 2021/12/19 \n# Author: Muge Kural\n# Description: Trainer of surface form pos tagging probe, saves the results under ./results directory.\n# -----------------------------------------------------------\n\nimport sys, argparse, random...
[ [ "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.load", "matplotlib.use", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "torch.no_grad", "torch.cuda.is_available" ] ]
wakepon21/Gasyori100knock
[ "b9c92bfda9d2288d2b4742c2fb67719ee0ab338b" ]
[ "Question_11_20/answers_py/answer_14.py" ]
[ "import cv2\nimport numpy as np\n\n# Gray scale\ndef BGR2GRAY(img):\n\tb = img[:, :, 0].copy()\n\tg = img[:, :, 1].copy()\n\tr = img[:, :, 2].copy()\n\n\t# Gray scale\n\tout = 0.2126 * r + 0.7152 * g + 0.0722 * b\n\tout = out.astype(np.uint8)\n\n\treturn out\n\n# different filter\ndef different_filter(img, K_size=3...
[ [ "numpy.expand_dims", "numpy.zeros", "numpy.sum", "numpy.clip" ] ]
MukundVarmaT/tf-lightning
[ "bdd5493cbb99c3eb1b12979745dacd20be62c51d" ]
[ "tf_lightning/trainer/training_loop.py" ]
[ "\"\"\"\n\n@author: vasudevgupta\n\"\"\"\nfrom pathlib import Path\nimport tensorflow as tf\n\nfrom tf_lightning.callbacks import Callback\nfrom tf_lightning.loggers import WandbLogger\nfrom tf_lightning.trainer.checkpointer import Checkpointer\nfrom tf_lightning.trainer.precision_training import PrecisionTraining\...
[ [ "tensorflow.function", "tensorflow.constant" ] ]
aditya02acharya/TypingAgent
[ "34c5230be72c3878942457a6e44b7078fbd08ea0" ]
[ "src/supervisor/supervisor_agent.py" ]
[ "import csv\nimport tqdm\nimport random\nimport logging\nimport numpy as np\nimport pandas as pd\nfrom os import path\nfrom datetime import datetime\n\nimport chainer\nimport chainerrl\nimport chainer.links as L\nfrom chainerrl import misc\nimport chainer.functions as F\nfrom chainer import serializers\nfrom chaine...
[ [ "pandas.read_csv" ] ]
iwyoo/TPS_STN-tensorflow
[ "e7bed913a644629042c9dbd141b15b5792f0b1e6" ]
[ "test.py" ]
[ "import tensorflow as tf\nimport numpy as np\nfrom PIL import Image\nfrom TPS_STN import TPS_STN\n\nimg = np.array(Image.open(\"original.png\"))\nout_size = list(img.shape)\nshape = [1]+out_size+[1]\n\nnx = 2\nny = 2\n\nv = np.array([\n [0.2, 0.2],\n [0.4, 0.4],\n [0.6, 0.6],\n [0.8, 0.8]])\n\np = tf.constant(v...
[ [ "tensorflow.initialize_all_variables", "numpy.array", "tensorflow.Session" ] ]
bol-edu/xilinx-acc-2021_Submission
[ "1f212212d12e3be9638f92f3e7953dc81f89606d" ]
[ "test_toolkit/pcap_gen.py" ]
[ "from cgi import print_exception\nfrom util.graph import Edge, Graph, createGraph, isNegCycleBellmanFord\nfrom util.pcap import PcapGen\nimport numpy as np\nimport pandas as pd\nimport argparse\n\n\n# 18 total\nexch_index2id = np.array([[1, 3], [3, 1], [0, 4], [4, 0], [3, 2], [2, 3], [1, 2], [2, 1], [\n ...
[ [ "numpy.log", "pandas.read_csv", "numpy.random.random", "numpy.arange", "pandas.DataFrame", "numpy.array" ] ]
NunchakusLei/OpenCV_examples
[ "74974ecd5dae096863fa8915135bfbcfd20ed9a4" ]
[ "ModifyImages/load_float_image.py" ]
[ "import cv2, numpy as np\nimport struct\nimport sys\n\ndef load_float_image(filename):\n # open file\n file = open(filename, \"rb\")\n\n # load info\n value = file.read(4)\n width = struct.unpack('i', value)[0]\n value = file.read(4)\n height = struct.unpack('i', value)[0]\n\n z_image = np.z...
[ [ "numpy.zeros" ] ]
skmatti/streamz
[ "47917b93f5d1ee6716f4c99f235b791cd55f117d" ]
[ "streamz/dataframe/tests/test_cudf.py" ]
[ "\"\"\"\nTests for cudf DataFrame\nAll these tests are taken from test_dataframes module in the same folder.\nSome of these tests pass with cudf as they are, and others are marked xfail\nwhere a pandas like method is not implemented yet in cudf.\nBut these tests should pass as cudf implement more pandas like method...
[ [ "numpy.arange" ] ]
pedromanrique/tensorflow-tts
[ "473eb717503454fa2eabadefd7bcd2459673f6f2" ]
[ "tensorflow_tts/models/tacotron2.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2020 The Tacotron-2 Authors, Minh Nguyen (@dathudeptrai), Eren Gölge (@erogol) and Jae Yoo (@jaeyoo)\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 Licen...
[ [ "tensorflow.keras.layers.LayerNormalization", "tensorflow.concat", "numpy.sqrt", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.keras.layers.StackedRNNCells", "tensorflow.boolean_mask", "tensorflow.gather", "tensorflow.math.softplus", "tenso...
ConnorPeng/PathPlanning
[ "28afd52864cb53b53fe2bbd876c2f22b6a4363d7" ]
[ "Sampling_based_Planning/rrt_2D/env.py" ]
[ "\"\"\"\nEnvironment for rrt_2D\n@author: huiming zhou\n\"\"\"\nimport numpy as np\nimport binvox_rw\nfrom matplotlib import pyplot as plt\n\n\n\nclass Env:\n def __init__(self):\n self.x_range = (0, 1000)\n self.y_range = (0, 1000)\n self.obs_boundary = self.obs_boundary()\n self.obs...
[ [ "numpy.load" ] ]
Homeronius/ASL
[ "7cfd489c1603b94bce1e7f40c081896f7a69a77d" ]
[ "helper_scripts/plot_performance_alt.py" ]
[ "from os import path\nimport argparse\nfrom typing import Type\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom math import log2\n\nAMD = r\" $\\bf{AMD\\ Ryzen\\ 7\\ 4800H\\ (Zen\\ 2),\\ 2.9GHz}$\"\nINTEL = r\" $\\bf{Intel\\ i5-7300U\\ (Kaby\\ Lake),\\ 2.6GHz}$\"\n\n\ndef format_fun...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.MultipleLocator", "numpy.divide", "matplotlib.pyplot.figure" ] ]
siddsach/OpenNRE-PyTorch
[ "7b38a12b7920e5313cd7c3500cab70c53e4e290f" ]
[ "networks/classifier.py" ]
[ "import torch\nimport torch.autograd as autograd\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.autograd import Variable\n\nclass Classifier(nn.Module):\n def __init__(self, params):\n super(Classifier, self).__init__()\n self.params = params\n ...
[ [ "torch.nn.CrossEntropyLoss", "torch.max" ] ]
mraggi/DifferentialEvolutionPytorch
[ "f316da5de439a4b2cb6bef50b2daf3e9af803347" ]
[ "differential_evolution.py" ]
[ "import torch\nfrom progress_bar import progress_bar\nfrom helpers import *\n\ndef individual2population(f):\n return lambda P : torch.stack([f(p) for p in P])\n\nclass DifferentialEvolver:\n def __init__(self, f, \n initial_pop = None, # In next version, I'll remove the option of giving...
[ [ "torch.randint", "torch.randperm", "torch.randn", "torch.min", "torch.multinomial", "torch.rand", "torch.where", "torch.arange" ] ]
leonardozcm/ASFM-Net-Review
[ "2584d2d098c760e559d3f632b72b9ad9881c59d5" ]
[ "core/test_baseline.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: XP\n\nimport logging\nimport torch\nfrom models.modelutils import fps_subsample\nimport utils.data_loaders\nimport utils.helpers\nfrom tqdm import tqdm\nfrom utils.average_meter import AverageMeter\nfrom utils.metrics import Metrics\nfrom utils.loss_utils import chamfer_sqrt\nfr...
[ [ "torch.nn.DataParallel", "torch.no_grad", "torch.cuda.is_available", "torch.load" ] ]
xiaow2/orofacial_pipeline
[ "fdfac5d1a2dd780f017966dc353f77eda1d21b93" ]
[ "pipeline/util.py" ]
[ "import numpy as np\n\nfrom . import (experiment, psth, ephys)\n\n\ndef _get_trial_event_times(events, units, trial_cond_name):\n \"\"\"\n Get median event start times from all unit-trials from the specified \"trial_cond_name\" and \"units\" - aligned to GO CUE\n For trials with multiple events of the same...
[ [ "numpy.array" ] ]
pauldmccarthy/fslpy
[ "4ef642f362486f42628a1c81dcdd8ea6b92a5faf" ]
[ "tests/test_transform/test_nonlinear.py" ]
[ "#!/usr/bin/env python\n\nimport itertools as it\nimport os.path as op\n\nimport numpy as np\n\nimport fsl.data.image as fslimage\nimport fsl.utils.image.resample as resample\nimport fsl.utils.image.roi as roi\nimport fsl.transform.affine as affine\nimport fsl.transform.nonlinear as nonlinea...
[ [ "numpy.random.random", "numpy.isnan", "numpy.arange", "numpy.random.randint", "numpy.array", "numpy.vstack", "numpy.isclose" ] ]
sauceda/deepqmc
[ "36ae8cf5bcb1ae723d00dd34fa2b023662f90a24" ]
[ "tests/test_det.py" ]
[ "import pytest\nimport torch\n\nfrom deepqmc import torchext\n\n\n@pytest.fixture\ndef xs():\n return torch.randn(10, 4, 4).double().requires_grad_()\n\n\ndef test_1st_deriv(xs):\n assert torch.autograd.gradcheck(torchext.bdet, xs)\n\n\ndef test_2nd_deriv(xs):\n assert torch.autograd.gradgradcheck(torchext...
[ [ "torch.randn", "torch.autograd.gradgradcheck", "torch.autograd.gradcheck", "torch.ones_like" ] ]
misialq/qiime2
[ "6d8932eda130d4a9356f977fece2e252c135d0b9" ]
[ "qiime2/sdk/action.py" ]
[ "# ----------------------------------------------------------------------------\n# Copyright (c) 2016-2021, QIIME 2 development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# -------------------------------------...
[ [ "matplotlib.matplotlib_fname" ] ]
webclinic017/hyperdrive
[ "3c930336efc1e46947548c30d48bb6ac1d6392f9" ]
[ "test/test_History.py" ]
[ "import sys\r\nimport numpy as np\r\nimport pandas as pd\r\nsys.path.append('hyperdrive')\r\nfrom History import Historian # noqa autopep8\r\n\r\n\r\nhist = Historian()\r\nls = [np.nan, True, True, np.nan, False, np.nan, np.nan, np.nan, True]\r\nfs = [True, True, True, True, False, False, False, False, True...
[ [ "numpy.array_equal", "numpy.arange", "pandas.DataFrame", "numpy.mean", "numpy.array" ] ]
samharnew/moneytrack
[ "6c798623ea93229e04fda69deea82bca6d5273c1" ]
[ "test/test_moneyframe.py" ]
[ "import logging\nimport unittest\nfrom datetime import datetime\n\nimport numpy as np\nimport pandas as pd\n\nfrom moneytrack import BalanceTransfers, BalanceUpdates, MoneyFrame\n\nlogging.basicConfig(level=logging.DEBUG)\n\n\nclass TestMoneyFrame(unittest.TestCase):\n\n def test_get_daily_balances(self):\n ...
[ [ "numpy.testing.assert_equal", "pandas.to_datetime", "numpy.testing.assert_array_almost_equal" ] ]
Arpan-29/Machine-Learning
[ "3e1e32bcc77884f8ecb964324a1ab2d74badff98" ]
[ "Hyperparameter Tuning/Gradient Checking/gc_utils.py" ]
[ "import numpy as np\n\ndef sigmoid(x):\n\n s = 1/(1+np.exp(-x))\n \n return s\n\ndef relu(x):\n\n s = np.maximum(0,x)\n \n return s\n\ndef dictionary_to_vector(parameters):\n\n keys = []\n count = 0\n for key in [\"W1\", \"b1\", \"W2\", \"b2\", \"W3\", \"b3\"]:\n \n # flatte...
[ [ "numpy.reshape", "numpy.exp", "numpy.maximum", "numpy.concatenate" ] ]
CedricVallee/pythonFinancialAnalyst
[ "64c562134de7801aeef3981f4ef4ac5d5b5fd70b" ]
[ "FinancialAnalystV2/main.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Mar 05 2016\r\nAuthor: Cedric Vallee\r\n\"\"\"\r\n\r\nimport os\r\nimport re\r\nimport pandas as pd\r\nimport csv\r\nimport sklearn\r\nimport numpy as np\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\nfrom sklearn.feature_extraction.text import...
[ [ "pandas.crosstab", "pandas.merge", "pandas.read_csv", "pandas.Series", "sklearn.ensemble.RandomForestClassifier", "pandas.DataFrame", "sklearn.metrics.classification_report" ] ]
vishalbelsare/pymanopt
[ "ca14b6d1c2cc9adb1f6a5561bfcc7047c267c60f" ]
[ "examples/low_rank_psd_matrix_approximation.py" ]
[ "import autograd.numpy as np\nimport tensorflow as tf\nimport theano.tensor as T\nimport torch\nfrom examples._tools import ExampleRunner\nfrom numpy import linalg as la, random as rnd\n\nimport pymanopt\nfrom pymanopt.manifolds import PSDFixedRank\nfrom pymanopt.solvers import TrustRegions\n\nSUPPORTED_BACKENDS = ...
[ [ "tensorflow.norm", "torch.transpose", "torch.norm", "numpy.linalg.matrix_rank", "tensorflow.transpose", "tensorflow.zeros", "torch.from_numpy", "numpy.linalg.norm", "numpy.random.randn" ] ]
yasokada/ADDA_pySpherepts_171217
[ "ae1688c788811c616c0594f4d2c1eeca7643b797" ]
[ "test_use_PAZ_pySpherepts_171217.py" ]
[ "import numpy as np\nimport polarAzimuthCalc_171209 as pac\nimport getIcosNodes_171126 as gIN\nimport sys\n\n'''\nDec. 17, 2017\nThis script requires the setup of [pySpherepts_171126] package shown at\n https://github.com/yasokada/pySpherepts_171126\nfor [getIcosNodes_171126]\n'''\n\n'''\nv0.1 Dec. 17, 2017\n ...
[ [ "numpy.rad2deg" ] ]
IvanKosik/retinal-fundus-models
[ "a2135f0ef9a70b403aa9bcff91de511f3f635296" ]
[ "src/bsmu/retinal_fundus/models/utils/csv.py" ]
[ "import random\nfrom pathlib import Path\n\nimport pandas as pd\n\n\ndef generate_train_valid_csv(image_dir: Path, mask_dir: Path,\n train_csv_path: Path, valid_csv_path: Path,\n filter_predicate=lambda file_name: True, train_part: float = 0.75):\n data_fil...
[ [ "pandas.DataFrame" ] ]
jer-green/triage-bandit-sandbox
[ "18a824a4af736dff2246f4d86dd1d7104874b044" ]
[ "triage_bandit_sandbox/triage_models_sandbox/triage_data_transformers/label_encoders.py" ]
[ "from typing import Optional\nimport numpy as np\nfrom scipy.stats import mode\n\nfrom babylon_pgm.triage_models.triage_decisions import (\n TRIAGE_MODEL_DECISION_TYPE,\n TriageModelDecisionDefault,\n)\n\nfrom ..interfaces import PreparedDataTransformer, PreparedData\n\n\ndef _check_correct_decisions_type(cor...
[ [ "scipy.stats.mode" ] ]
jksr/cemba_data
[ "c796c33a2fd262b2ef893df1951a90b8d0ba9289" ]
[ "cemba_data/mapping/stats/utilities.py" ]
[ "import pathlib\nfrom collections import defaultdict\nfrom pysam import TabixFile\nimport pandas as pd\n\nfrom ...utilities import parse_mc_pattern\n\n\ndef parse_trim_fastq_stats(stat_path):\n # example trim fastq stats\n \"\"\"\nstatus\tin_reads\tin_bp\ttoo_short\ttoo_long\ttoo_many_n\tout_reads\tw/adapters...
[ [ "pandas.concat", "pandas.read_csv", "pandas.Series", "pandas.DataFrame" ] ]
sshepherd637/aiida-core
[ "99fd841f33a5c2afa6a0c808c5e6ef9eff73a9df" ]
[ "aiida/orm/nodes/data/array/projection.py" ]
[ "# -*- coding: utf-8 -*-\n###########################################################################\n# Copyright (c), The AiiDA team. All rights reserved. #\n# This file is part of the AiiDA code. #\n# ...
[ [ "numpy.shape" ] ]
waq1129/GP-RNN_UAI2019
[ "2d223bdda962e8571b10b80ba17fb4031cd97bd4" ]
[ "funs.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport tensorflow as tf\nimport edward as ed\nfrom edward.models import Normal, MultivariateNormalTriL\nfrom tensorflow.contrib import slim\n\n\ndef normal_cell(hprev, zt, H):\n ...
[ [ "tensorflow.convert_to_tensor", "numpy.dot", "tensorflow.get_variable", "numpy.sqrt", "tensorflow.orthogonal_initializer", "tensorflow.tanh", "tensorflow.python.ops.control_flow_ops.with_dependencies", "numpy.arange", "numpy.sin", "tensorflow.name_scope", "tensorflow.sq...
rBatt/mystock
[ "0944b4e46d1720fa47126d95f9b5a857276c8e38" ]
[ "tests/test_stockdata.py" ]
[ "import os\nimport re\nimport pandas as pd\nfrom pandas.util.testing import assert_frame_equal\nimport unittest\nfrom unittest.mock import patch\n\nfrom mystock.stockdata import StockData\n\nclass TestApiCall(unittest.TestCase):\n\n def setUp(self):\n self.input_patch = patch('mystock.apicall.input')\n ...
[ [ "pandas.DataFrame" ] ]
jiangwei1995910/cnocr
[ "e685db43622916b127728e0a714fef81036b8caa" ]
[ "cnocr/data_utils/data_iter.py" ]
[ "from __future__ import print_function\n\nimport os\nfrom PIL import Image\nimport numpy as np\nimport mxnet as mx\nimport random\n\nfrom .multiproc_data import MPData\n\n\nclass SimpleBatch(object):\n def __init__(self, data_names, data, label_names=list(), label=list()):\n self._data = data\n sel...
[ [ "numpy.array", "numpy.zeros", "numpy.transpose" ] ]
Edelbert/tf2-mobile-2d-single-pose-estimation
[ "a6961b2c12e8edfd9b7c4e87d0925c046ff7b673" ]
[ "data_loader/dataset_prepare.py" ]
[ "# -*- coding: utf-8 -*-\n# @Time : 18-3-6 3:20 PM\n# @Author : edvard_hua@live.com\n# @FileName: data_prepare.py\n# @Software: PyCharm\n# @updated by Jaewook Kang 20181010 for tf-tiny-pose-estimation\n\n\nimport numpy as np\nimport cv2\nimport struct\nimport math\n\n\nclass CocoMetadata:\n\n @staticmethod\n...
[ [ "numpy.array", "numpy.fromstring", "numpy.zeros" ] ]
gjmulder/gluon-ts
[ "cb5b257e7dc38a3da2b07a1c9be07a5e58653105" ]
[ "src/gluonts/trainer/_base.py" ]
[ "# Copyright 2018 Amazon.com, Inc. or its affiliates. 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# A copy of the License is located at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# or ...
[ [ "numpy.prod", "numpy.isfinite" ] ]
KushGabani/ml4a-guides
[ "d71b61a99c417b9ace3404420b37d22f6da06153" ]
[ "ml4a/utils/latents.py" ]
[ "import numpy as np\n\n\ndef interpolation_walk(endpoints, num_frames_per=30, loop=False):\n z1, z2 = endpoints[:-1], endpoints[1:]\n if loop:\n z1.append(endpoints[-1])\n z2.append(endpoints[0])\n z1, z2 = endpoints[:-1], endpoints[1:]\n if loop:\n z1.append(endpoints[-1])\n ...
[ [ "numpy.squeeze", "numpy.linspace" ] ]
patrickherring-TRI/beep
[ "7d3e8745f54ae86dcc4ac5679656dd70457ddd10" ]
[ "beep/utils/splice.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) 2019 Toyota Research Institute\n\n\"\"\"Script for joining together two Maccor files that correspond to the same run\nbut data has been split between two files. The column increment function makes sure\nthat certain columns are monotonically increasing across the two files....
[ [ "pandas.concat" ] ]
youhanamikhaiel/BigGANs_testy
[ "3bf1cc5976a6b310ea7c44f32cb5f5170cb95609" ]
[ "BigGANOriginal/train_fns.py" ]
[ "''' train_fns.py\nFunctions for the main loop of training different conditional image models\n'''\nimport torch\nimport torch.nn as nn\nimport torchvision\nimport os\n\nimport utils\nimport losses\n\n\n# Dummy training function for debugging\ndef dummy_training_function():\n def train(x, y):\n return {}\n ret...
[ [ "torch.no_grad", "torch.Tensor", "torch.split" ] ]
OpenSourceDocs/magenta
[ "11ee0dbe9d2dce7160af7db737d7a21920cacc40" ]
[ "magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py" ]
[ "# Copyright 2019 The Magenta Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "tensorflow.Graph", "tensorflow.initializers.local_variables", "tensorflow.gfile.Open", "tensorflow.placeholder", "tensorflow.app.flags.DEFINE_string", "tensorflow.logging.set_verbosity", "tensorflow.app.flags.DEFINE_float", "tensorflow.Session", "tensorflow.logging.info", ...
isunjin/pytext
[ "898c41c4881f30480cf744ea524993339df7213a" ]
[ "pytext/models/embeddings/scriptable_embedding_list.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nfrom inspect import signature\nfrom typing import Dict, Iterable, List, Tuple\n\nimport torch\nfrom pytext.models.embeddings import EmbeddingBase\nfrom torch.utils.tensorboard import SummaryWriter\n\n\nclass ScriptableE...
[ [ "torch.cat" ] ]
basedrhys/detectron2
[ "979cf435cb302df46c1e07def5b07816216d971a" ]
[ "detectron2/engine/defaults.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\n\"\"\"\nThis file contains components with some default boilerplate logic user may need\nin training / testing. They will not work for everyone, but many users may find them useful.\n\nThe behavior of functions/class...
[ [ "torch.no_grad" ] ]
ahmedABDELFATTAH1/GradesAutoFiller
[ "b850f073d4270be559fbfd9518785aaf70017b0f" ]
[ "GradeAutofiller/DMv2/DigitsModule.py" ]
[ "import pickle\nfrom commonfunctions import *\nfrom skimage.feature import hog\nfrom sklearn.preprocessing import normalize\nimport skimage\nfrom skimage.morphology import binary_erosion, binary_dilation, binary_closing,skeletonize, thin,erosion,dilation\nfrom skimage.transform import rotate\nfrom skimage.measure i...
[ [ "sklearn.preprocessing.normalize" ] ]
jenniferbrennan/regmod
[ "8e1a9d6970b32449bab6f7897c42a82a9a59651b" ]
[ "tests/test_function.py" ]
[ "\"\"\"\nTest function module\n\"\"\"\nimport numpy as np\nimport pytest\nfrom regmod.function import fun_dict\n\n\ndef ad_dfun(fun, x, eps=1e-16):\n return fun(x + eps*1j).imag/eps\n\n\n@pytest.mark.parametrize(\"x\", np.random.randn(3))\ndef test_identity(x):\n fun = fun_dict[\"identity\"]\n assert np.is...
[ [ "numpy.random.randn", "numpy.random.rand" ] ]
dongwuuu/Cell-calssification
[ "c80a9b41d42e3a4d36dc6a6e1f910ae0b467ed1f" ]
[ "train.py" ]
[ "import argparse\nimport os\nimport copy\nimport random\nimport shutil\nimport time\nimport csv\nfrom random import shuffle\nimport warnings\nfrom PIL import Image\nimport cv2\nimport matplotlib.pyplot as plt\nwarnings.filterwarnings(\"ignore\")\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as ...
[ [ "matplotlib.pyplot.legend", "sklearn.metrics.roc_auc_score", "torch.nn.functional.softmax", "torch.max", "torch.load", "torch.utils.data.DataLoader", "matplotlib.pyplot.plot", "torch.no_grad", "sklearn.metrics.f1_score", "torch.nn.CrossEntropyLoss", "torch.autograd.set_...
richardbaihe/conversation
[ "ba85518a1ac2a57988188fc5f2b8fe42e1facf64" ]
[ "source/modules/decoders/rnn_decoder.py" ]
[ "#!/usr/bin/env python\n################################################################################\n#\n# Copyright (c) 2019 Baidu.com, Inc. All Rights Reserved\n#\n################################################################################\n\"\"\"\nFile: source/decoders/rnn_decoder.py\n\"\"\"\n\nimport t...
[ [ "torch.nn.Dropout", "torch.nn.LogSoftmax", "torch.cat", "torch.nn.GRU", "torch.nn.Linear" ] ]
rentainhe/glasses
[ "34300a76985c7fc643094fa8d617114926a0ee75" ]
[ "test/test_RegNet.py" ]
[ "from functools import partial\n\nimport torch\nfrom glasses.models.classification.regnet import *\nfrom glasses.models.classification.resnet import ResNetShorcutD, ResNetStemC\n\n\ndef test_regnet():\n x = torch.rand(1, 3, 224, 224)\n with torch.no_grad():\n model = RegNet.regnetx_002()\n pred ...
[ [ "torch.no_grad", "torch.rand" ] ]
pabloe4993/foolbox
[ "2daabba8355afce9dfbec3de8d71dadadcfbd10b" ]
[ "foolbox/attacks/iterative_projected_gradient.py" ]
[ "from __future__ import division\nimport numpy as np\nfrom abc import abstractmethod\nimport logging\nimport warnings\n\nfrom .base import Attack\nfrom .base import call_decorator\nfrom .. import distances\nfrom ..utils import crossentropy\nfrom .. import nprng\n\n\nclass IterativeProjectedGradientBaseAttack(Attack...
[ [ "numpy.sign", "numpy.square", "numpy.abs", "numpy.clip" ] ]
Combustion-Transport-Analysis/Virial-Coefficient-Data-for-Combustion-Species
[ "035c74ac23b30aefef9ee91065b61b62c9fc3ca4" ]
[ "databaseExp.py" ]
[ "# -*- coding: utf-8 -*- \n\n# Headers for Python\nimport pandas as pd\nimport numpy as np\n\n# FUNCTIONS NEEDED IN THIS DATABASE\ndef BerrCalc(Bvalues, DataQuality):\n # determine the error class as defined by Dymond & Smith, 1980\n # class I: estimated precision < 2% or < 1 cm^3 mol^-1, whichever is greater...
[ [ "numpy.exp", "numpy.array", "numpy.trapz", "numpy.linspace" ] ]
msarrafj/LimiterDG
[ "afac2f4d5cd0312009f88e8eaf3cc6d273dcad5a" ]
[ "Codes/Pressure_driven/Homogen/NIPGvsUpwind/Limiter/flux_limiter.py" ]
[ "from firedrake import *\nimport numpy as np\nimport math,sys\nimport time as tm\nfrom matplotlib import pyplot as plt\nfrom Limiter.hsign import *\nnp.set_printoptions(precision=9)\nfrom warnings import *\n\nclass get_flux(SignFlip):\n def __init__(self,mesh,fluxes):\n self.mesh = mesh\n self.flux...
[ [ "numpy.minimum", "numpy.abs", "numpy.multiply", "numpy.set_printoptions", "numpy.subtract", "numpy.finfo", "numpy.all", "numpy.ones", "numpy.shape", "numpy.zeros", "numpy.where", "numpy.divide" ] ]
vd1371/GIAMS
[ "dd6551f344b8d0377131d4496846eb5d03b6189c" ]
[ "Optimizer/BruteForce.py" ]
[ "#Loading dependencies\nimport time\nimport numpy as np\nimport pandas as pd\nimport multiprocessing as mp\nfrom multiprocessing import Queue, Process\nfrom itertools import product\nfrom ._objectives import LCASolution\nfrom ._objectives import _eval_sol\n\nclass BruteForce:\n\n\tdef __init__(self, **params):\n\n\...
[ [ "numpy.array" ] ]
xmnlab/bodoai-examples
[ "621e17356004031300a56288c7c27e47b6c247cc" ]
[ "bodoai_examples/udacity_course_ud188/intro_neural_networks/gradient_descent/main.py" ]
[ "\"\"\"\noriginal code available at:\n https://github.com/udacity/deep-learning-v2-pytorch/\n tree/master/intro-neural-networks/gradient-descent\n\n\nImplementing the Gradient Descent Algorithm\n\nIn this lab, we'll implement the basic functions of the Gradient Descent\nalgorithm to find the boundary in a...
[ [ "numpy.dot", "pandas.concat", "pandas.read_csv", "numpy.log", "numpy.random.seed", "numpy.random.normal", "pandas.testing.assert_frame_equal", "numpy.exp", "numpy.array" ] ]
jrderek/Deployment-
[ "eff84d3141136138154d26567d04d61dd76ee842" ]
[ "Employee_Retention_Prediction-main/apps/ingestion/load_validate.py" ]
[ "import json\nfrom os import listdir\nimport shutil\nimport pandas as pd\nfrom datetime import datetime\nimport os\nfrom apps.database.database_operation import DatabaseOperation\nfrom apps.core.logger import Logger\n\nclass LoadValidate:\n\t\"\"\"\n\t****************************************************************...
[ [ "pandas.read_csv" ] ]
victorgmlyra/CameraCalib
[ "5485872e39e054c4aa6733484fe500a065f909bc" ]
[ "calibration.py" ]
[ "'''\r\n File name: calibration.py\r\n Author: Victor Lyra\r\n Date created: 17/02/2020\r\n Date last modified: 20/25/2013\r\n Python Version: 3.7\r\n'''\r\n\r\nimport numpy as np\r\nimport cv2\r\nimport glob, os\r\n\r\n# VARIABLES\r\nframes_from_video = True # If true => Extract frames from a video ...
[ [ "numpy.zeros" ] ]
TBGAnsell/Protocol
[ "90e2da93a95f9fc81a9606a33a4c4e22f5532e97" ]
[ "lipidens/test_PyLipID_cutoffs/test_PyLipID_cutoffs.py" ]
[ "#!/usr/bin/env python3\n\n\"\"\"\nScript to plot the probability distribution of protein-lipid distances and test a range of lower and upper cutoff combinations.\n\nAuthor: Wanling Song, Modified: T. Bertie Ansell\n\n\"\"\"\n#%matplotlib inline\nimport seaborn as sns\nimport os\nimport re\nimport numpy as np\nimpo...
[ [ "matplotlib.ticker.MultipleLocator", "matplotlib.pyplot.tight_layout", "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.concatenate", "matplotlib.pyplot.close" ] ]
cheng-tan/estimators
[ "993c0805e8ae3fb018ec42901d83b45d39c80c62" ]
[ "ips_snips.py" ]
[ "import math\nfrom scipy.stats import beta\n\n\nclass Estimator:\n def __init__(self):\n ############################### Aggregates quantities ######################################\n #\n # 'n': IPS of numerator\n # 'N': total number of samples in bin from log (IPS = n/N)\n ...
[ [ "scipy.stats.beta.ppf" ] ]
olavosamp/kaggle-real-or-not
[ "fffd0716301362af8da403e86cae6b0d54cf5955" ]
[ "libs/train.py" ]
[ "import time\nimport uuid\nfrom pathlib import Path\n\nimport torch\nimport numpy as np\nimport pandas as pd\nimport sklearn.metrics\nfrom tqdm import tqdm\n\nimport libs.commons as commons\nimport libs.models as models\n\n\nclass EarlyStop:\n '''Early stopping monitor for loss minimization'''\n def __init__...
[ [ "torch.nn.Softmax", "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader", "pandas.DataFrame", "torch.tensor", "numpy.concatenate", "torch.set_grad_enabled", "numpy.zeros", "numpy.sum" ] ]
BenevolentAI/benevolentai-dat
[ "a68c2a438bb5b9651e4e0cb72cdbe02738cc88a9", "a68c2a438bb5b9651e4e0cb72cdbe02738cc88a9" ]
[ "diversity_analysis_tool/clean_ipums_script.py", "diversity_analysis_tool/cli.py" ]
[ "import pandas as pd\nimport numpy as np\n\n\n# Converted raw IPUMS data set in .csv to cleaned dataframe\n# Cleaned dataframe is an example input to diversity_analysis_tool\ndef rename_by_code(df):\n # Sex\n df.loc[(df.SEX == 1), \"SEX\"] = \"Male\"\n df.loc[(df.SEX == 2), \"SEX\"] = \"Female\"\n\n # R...
[ [ "pandas.read_csv" ], [ "pandas.read_csv" ] ]
kevinddchen/sudoku
[ "135b47ffcfade88628acabacd0a2c916da98a9e4" ]
[ "tests/test_sudoku.py" ]
[ "from time import time\nfrom typing import Iterator\n\nimport numpy as np\n\nfrom sudoku.solve import Puzzle, solve\n\n# ------------------------------------------------------------------------------\n\n'''\nTest sudoku solver on 100 puzzles taken from\nhttps://projecteuler.net/problem=96.\n\nUsage:\n `python te...
[ [ "numpy.array" ] ]
mevtorres/astrotools
[ "42047837ef59f646a7519e82562bcafd5ad0d5f0" ]
[ "spectral_cube/tests/data/make_test_cubes.py" ]
[ "\"\"\"\nCreates several 4D fits images with a single stokes axis,\nin various transpositions\n\"\"\"\n\nfrom astropy.io import fits\nfrom astropy import wcs\nimport numpy as np\n\nHEADER_FILENAME = 'header_jybeam.hdr'\n\ndef transpose(d, h, axes):\n d = d.transpose(np.argsort(axes))\n h2 = h.copy()\n\n fo...
[ [ "numpy.random.random", "numpy.random.seed", "numpy.arange", "numpy.argsort", "numpy.recarray", "numpy.zeros" ] ]
ReyhaneAskari/sngan.pytorch
[ "d9edf36cadd0835aeed2bb7f73115d04d5a76edd" ]
[ "functions.py" ]
[ "# -*- coding: utf-8 -*-\n# @Date : 2019-07-25\n# @Author : Xinyu Gong (xy_gong@tamu.edu)\n# @Link : None\n# @Version : 0.0\n\nimport os\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torchvision.utils import make_grid\nfrom imageio import imsave\nfrom tqdm import tqdm\nfrom copy import deepc...
[ [ "numpy.concatenate", "torch.mean", "numpy.random.normal", "torch.nn.ReLU" ] ]
ultravideo/eye-tracking-framework
[ "505f3f5481a8c716dc5245ceb3e52c0f96a642d6" ]
[ "source/detect_outliers.py" ]
[ "from sklearn.neighbors import LocalOutlierFactor\n\n\ndef detect_outliers(points, k=10):\n \"\"\"\n Detect outliers in given time series.\n Use LocalOutlierFactor to for detection.\n Returns an array of indexes of outlying points.\n \"\"\"\n outlier_indices = []\n\n clf = LocalOutlierFactor(n_...
[ [ "sklearn.neighbors.LocalOutlierFactor" ] ]
benj252/python-control
[ "47f00d336a61c5780a8960dd14fac01889590614" ]
[ "control/xferfcn.py" ]
[ "\"\"\"xferfcn.py\n\nTransfer function representation and functions.\n\nThis file contains the TransferFunction class and also functions\nthat operate on transfer functions. This is the primary representation\nfor the python-control library.\n\"\"\"\n\n# Python 3 compatibility (needs to go here)\nfrom __future__ i...
[ [ "numpy.sqrt", "numpy.squeeze", "numpy.any", "scipy.signal.zpk2tf", "numpy.exp", "numpy.polyval", "numpy.finfo", "numpy.roots", "scipy.signal.cont2discrete", "numpy.isclose", "numpy.nonzero", "numpy.polymul", "scipy.signal.tf2zpk", "numpy.tan", "numpy.del...
naavis/halosim-proto
[ "a0e89097a79e0dcbd76e8607f3e10224e0c5be9c" ]
[ "halosim/crystals.py" ]
[ "import numpy as np\n\n\ndef generate_hexagonal_prototype_crystal():\n \"\"\"\n Generate a hexagonal prototype crystal with a c/a ratio of 1.0 and c axis parallel to the y coordinate axis.\n :return: 3xn array of vertex coordinates and nx3 array of vertex indices to indicate each triangle.\n \"\"\"\n ...
[ [ "numpy.sqrt", "numpy.arange", "numpy.cos", "numpy.tile", "numpy.sin", "numpy.linalg.norm", "numpy.random.randn", "numpy.random.rand", "numpy.cross", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
felixmzd/Conceptors.jl
[ "6673ee497cb6351f8f84cec81a48b54e5e3591a5" ]
[ "lorenz/reservoir_lorenz.py" ]
[ "from lorenz import functions\nimport numpy as np\n\n\nclass Reservoir:\n\n def __init__(self, N=500, alpha=400, NetSR=0.6, bias_scale=0.4, inp_scale=1.2, conn=None):\n\n self.N = N\n self.alpha = alpha\n self.NetSR = NetSR\n self.bias_scale = bias_scale\n self.inp_scale = inp_...
[ [ "numpy.diag", "numpy.dot", "numpy.linalg.svd", "numpy.arctanh", "numpy.linalg.inv", "numpy.eye", "numpy.tile", "numpy.linalg.norm", "numpy.random.randn", "numpy.mean", "numpy.transpose", "numpy.outer", "numpy.zeros" ] ]
uafgeotools/array_processing
[ "9ad464588aa162d36c9a90677784d6a8d7d4e6e8" ]
[ "array_processing/tools/array_characterization.py" ]
[ "import numpy as np\nfrom scipy import optimize\nfrom scipy.special import gammainc\nfrom fastkml import kml\n\n\ndef arraySig(rij, kmax, sigLevel, p=0.9, velLims=(0.27, 0.36), NgridV=100,\n NgridTh=100, NgridK=100):\n r\"\"\"\n Estimate 2-D array uncertainties in trace velocity and back-azimuth, ...
[ [ "numpy.sqrt", "numpy.linspace", "scipy.special.gammainc", "numpy.arctan2", "numpy.max", "scipy.optimize.fmin", "numpy.hstack", "numpy.linalg.eig", "numpy.sin", "numpy.finfo", "numpy.real", "numpy.diff", "numpy.zeros", "numpy.log", "numpy.array", "num...
FlunderMayFly/RoboND_Rover_Project
[ "9c5f8dd6a538b57f26ef3feeff953c7b5f0aaef1" ]
[ "code/decision.py" ]
[ "import numpy as np\nimport pdb\n\n\n# This is where you can build a decision tree for determining throttle, brake and steer \n# commands based on the output of the perception_step() function\ndef decision_step(Rover):\n\n # Implement conditionals to decide what to do given perception data\n # Here you're all...
[ [ "numpy.mean" ] ]
bage79/transformer-evolution-bage
[ "715bdf61421dc19e21fb0f66bfa4b564305987f8" ]
[ "gpt/train.py" ]
[ "import argparse\nimport os\nimport random\n\nimport numpy as np\nimport torch\nimport torch.distributed as dist\nimport torch.multiprocessing as mp\nimport wandb\nfrom torch.nn.parallel import DistributedDataParallel\nfrom tqdm import tqdm, trange\n\nimport config as cfg\nimport optimization as optim\nfrom vocab i...
[ [ "torch.nn.CrossEntropyLoss", "torch.distributed.init_process_group", "numpy.random.seed", "torch.multiprocessing.spawn", "torch.eq", "torch.manual_seed", "numpy.mean", "torch.cuda.is_available", "torch.distributed.destroy_process_group", "torch.cuda.manual_seed_all", "t...
liangzhenduo0608/Paddle
[ "23a4f54b73305f43c469fd7444310a74b9d49b67" ]
[ "python/paddle/fluid/tests/unittests/dygraph_to_static/test_program_translator.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.random.randn", "numpy.random.seed" ] ]
Anaphory/100woerterbuecher
[ "d70c9077a18e1cae9506a9713edf78e9972d7143" ]
[ "05-Needleman-Wunsch/needlemanwunsch.py" ]
[ "#!/usr/bin/python\n\n\"\"\"Needleman-Wunsch algorithm for sequence alignment, and application\nto NorthEuraLex data.\"\"\"\n\nimport pandas\nimport itertools\n\n\ndef needleman_wunsch(sequence1, sequence2):\n \"\"\"Generate an alignment between sequence1 and sequence2.\n\n Use Needleman and Wunsch's dynamic ...
[ [ "pandas.read_csv" ] ]
weiziyoung/instacart
[ "5da75e6a033859c3394e4e651331aafb002f161c", "5da75e6a033859c3394e4e651331aafb002f161c" ]
[ "appendix/902_reorder.py", "py_feature/215_onb_diff.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue May 30 23:28:19 2017\n\n@author: konodera\n\nnohup python -u 902_reorder.py > LOG/_xgb_item.txt &\n\n\n\"\"\"\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nimport pandas as pd\nimport numpy as np\nimport gc\nimport xgboost as xgb\ni...
[ [ "numpy.mean", "numpy.random.seed" ], [ "pandas.merge", "numpy.min", "numpy.median", "numpy.max", "numpy.std", "numpy.mean", "pandas.DataFrame.from_dict", "scipy.stats.skew" ] ]
manoelhortaribeiro/HatefulUsersTwitter
[ "84a5f58f1b0d8de932c635488564c10184b2840d" ]
[ "preprocessing/5_get_diffusion_graph.py" ]
[ "import networkx as nx\nimport numpy as np\n\ninitial_belief = 1\nk = 2\n\nnp.random.seed(1)\ngraph = nx.read_graphml(\"../data/preprocessing/users_infected.graphml\")\n\nslur_nodes = list(nx.get_node_attributes(graph, \"slur\"))\nother_nodes = list(set(graph.nodes()).difference(set(slur_nodes)))\nnode_list = slur_...
[ [ "numpy.random.seed" ] ]
x893/openmv
[ "ec968f4988fbd3baf8c9b97b8f51ac0ea942496f" ]
[ "usr/openmv.py" ]
[ "#!/usr/bin/env python2\n# This file is part of the OpenMV project.\n# Copyright (c) 2013/2014 Ibrahim Abdelkader <i.abdalkader@gmail.com>\n# This work is licensed under the MIT license, see the file LICENSE for details.\n#\n# Openmv module.\n\nimport struct\nimport sys,time\nimport serial\nimport platform\nimport ...
[ [ "numpy.fromstring", "numpy.column_stack" ] ]
shree-gade/CrypTen
[ "09f636827a07291f50a4ba62a6d4274a70265b4d" ]
[ "crypten/common/functions/approximations.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\nimport math\n\nimport crypten\nimport torch\nfrom crypten.config import cfg\n\n\n__all__ = [\n \"exp\",...
[ [ "torch.zeros_like", "torch.ones_like", "torch.zeros" ] ]
sschlenkrich/HybridMonteCarlo
[ "72f54aa4bcd742430462b27b72d70369c01f9ac4" ]
[ "hybmc/models/HybridModel.py" ]
[ "#!/usr/bin/python\n\nimport numpy as np\nfrom hybmc.models.StochasticProcess import StochasticProcess\n\n\nclass HybridModel(StochasticProcess):\n\n # Python constructor\n def __init__(self, \n domAlias, # name of our domestic (numeraire) currency\n domRat...
[ [ "numpy.log", "numpy.sqrt", "numpy.concatenate", "numpy.interp", "numpy.linalg.cholesky", "numpy.array", "numpy.zeros" ] ]
anonymous-dense-submission/DensE
[ "34f604d9e2f4e57b3acecc2e3da7da99863255e0" ]
[ "codes/model.py" ]
[ "#!/usr/bin/python3\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport logging\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom sklearn.metrics import average_precision_score\n\nfrom torch.u...
[ [ "torch.abs", "torch.LongTensor", "torch.nn.functional.softmax", "numpy.sqrt", "torch.Tensor", "torch.sqrt", "torch.nn.functional.logsigmoid", "torch.from_numpy", "torch.nn.Embedding", "torch.no_grad", "sklearn.metrics.average_precision_score", "torch.stack", "nu...
brianafischer/P3_Implement_SLAM
[ "935d7f069514c347cd9939a1cb8e76840dca2c71" ]
[ "helpers.py" ]
[ "from robot_class import robot\nfrom math import *\nimport random\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n\n# --------\n# this helper function displays the world that a robot is in\n# it assumes the world is a square grid of some given size\n# and that landmarks is a list of l...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.grid" ] ]
JosiahCraw/Python-Comms-Utils-ENEL422-
[ "d9f3be4adcfed198ee0d331f956b7341796c0797" ]
[ "comms_utils/plot.py" ]
[ "import numpy as np\nfrom scipy import special\nfrom typing import List\nimport matplotlib.pyplot as plt\nfrom comms_utils.ak import AK\nfrom comms_utils.pulse import Pulse\nfrom comms_utils.signal import Signal\nfrom comms_utils.comb import Comb\nimport comms_utils.threaded as threaded\nimport comms_utils.decode a...
[ [ "matplotlib.pyplot.axvline", "numpy.sqrt", "matplotlib.pyplot.title", "matplotlib.pyplot.yscale", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "numpy.sum", "matp...
AnsonYanxin/pytorch-YOLOv4
[ "f5122d600d3d7f7a8ff07b12dc2967e92c3f0586" ]
[ "demo_onnx.py" ]
[ "import sys\nimport onnx\nimport os\nimport argparse\nimport numpy as np\nimport cv2\nimport onnxruntime\nfrom tool.utils import *\nfrom tool.darknet2onnx import *\n\n\ndef main(cfg_file, weight_file, image_path, batch_size):\n\n # Transform to onnx as specified batch size\n fransform_to_onnx(cfg_file, weight...
[ [ "numpy.expand_dims", "numpy.transpose" ] ]
os-simopt/WRFtamer
[ "3646441c5438118c455f54d336547b1822c3076c" ]
[ "wrftamer/plotting/load_and_prepare.py" ]
[ "import datetime as dt\nimport xarray as xr\nimport pandas as pd\nimport numpy as np\n\n\n########################################################################################################################\n# Load Data\n##########################################...
[ [ "pandas.concat", "numpy.linspace", "numpy.asarray", "pandas.DataFrame", "numpy.datetime64", "numpy.arctan2", "numpy.mod" ] ]
gcroci2/pytorch-lightning
[ "eb648855110c604c547d04884f9352e8c4d81785" ]
[ "pytorch_lightning/utilities/apply_func.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.from_numpy", "torch.tensor" ] ]
stephen2run/EcoDataLearn
[ "eff8c86586077a495666bcfddd1adb5abc56eefe" ]
[ "src/example/data_visualization.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.cross_validation import train_test_split\nfrom sklearn.metrics import accuracy_score\n\n# visulaize the important characteristics of the dataset\nimport matplotlib...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "sklearn.cross_validation.train_test_split", "matplotlib.pyplot.title", "numpy.unique", "matplotlib.pyplot.scatter", "sklearn.manifold.TSNE", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "sklearn.preprocessing.Standa...
gquarles/qhost-bot
[ "402716555b887489382e3ce82af45017c2a548bb" ]
[ "plot.py" ]
[ "import matplotlib.pyplot as plt\nimport discord\nimport os\nimport psutil\nimport json\nimport urllib.request\n\nTOKEN = 'NTUwODU1MTUxODkyNjkyOTky.D1ovfA._13Nmqjkh01I_Q9b8I_wPX9mtBA'\nclient = discord.Client()\ndirectory = \"D:\\servers\\sapphire\\isle\"\nplayersDir = 'D:\\servers\\sapphire\\isle\\TheIsle\\Saved\\...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel" ] ]
StannisZhou/mixed_hmc
[ "7925b3290c9ba692a2afbe06e102ea88a7cea511" ]
[ "scripts/correlated_topic_models/generate_samples_ap_data.py" ]
[ "import os\nimport tempfile\n\nimport numpy as np\n\nimport joblib\nimport sacred\nfrom momentum.correlated_topic_models.dhmc import draw_samples_dhmc\nfrom momentum.correlated_topic_models.gibbs import draw_samples_gibbs\nfrom momentum.correlated_topic_models.hmc_within_gibbs import \\\n draw_samples_hmc_within...
[ [ "numpy.diag", "numpy.stack", "numpy.mean", "numpy.argsort", "numpy.sum" ] ]
zer0sh0t/wall_e
[ "be98c1517dcd481d177ab1bbe71312003fddbce0" ]
[ "wall_e/core.py" ]
[ "import math\nimport copy\nimport sympy as sp\nfrom functools import partial\nfrom scipy.optimize import minimize\n\n# import matplotlib.pyplot as plt\n# from matplotlib.animation import FuncAnimation\n\npprint = lambda inp: sp.pprint(inp)\n\nclass Robot():\n def __init__(self, name, type_, dh_params, masses, le...
[ [ "scipy.optimize.minimize" ] ]
formermagic/git-t5
[ "5ee27d1be72988986f03659bd79fc2f9680e5372" ]
[ "git_t5/core/data_module.py" ]
[ "import copy\nimport typing\nfrom dataclasses import dataclass\nfrom typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union\n\nimport datasets as hfds\nimport jax\nimport numpy as np\nfrom git_t5.core import HFDatasetConfig, LocalDatasetConfig, MultitaskDatasetConfig\nfrom git_t5.data import (\n ...
[ [ "torch.utils.data.DataLoader", "numpy.random.default_rng" ] ]
ISISNeutronMuon/SScanSS-2
[ "aa70107c8771e0ed0c1202a683ad94de84dff411" ]
[ "sscanss/core/scene/renderer.py" ]
[ "import ctypes\nimport numpy as np\nfrom OpenGL import GL, error\nfrom PyQt5 import QtCore, QtGui, QtWidgets\nfrom .camera import Camera, world_to_screen, screen_to_world\nfrom .node import Node, InstanceRenderNode, BatchRenderNode\nfrom .scene import Scene\nfrom .shader import DefaultShader, GouraudShader\nfrom .....
[ [ "numpy.array" ] ]