repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
AndyZCJ/CuriosityDrivenExplorationBySelfSupervisedPrediction
[ "6ba1a9ec3636aa1bda61fe86a6ba8070e15be92c" ]
[ "agents/A2C.py" ]
[ "import numpy as np\n\nimport os\n\nimport torch\nimport torch.optim as optim\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom agents.BaseAgent import BaseAgent\nfrom networks.networks import ActorCriticSMB\nfrom utils.RolloutStorage import RolloutStorage\n\nfrom timeit import default_timer as timer\...
[ [ "torch.distributions.Categorical", "numpy.mean", "torch.nn.functional.log_softmax", "torch.load" ] ]
Alexander-Serov/abortive-initiation-analysis
[ "2a036a5186459b79e7cdbd84aa8a7b130226b5e1" ]
[ "archive/plot_alpha.py" ]
[ "\"\"\"\nThis file contains all plot functions used in the project.\n\"\"\"\n\n\nimport itertools\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom constants import colors_additivity, markers_additivity\nfrom set_figure_size import set_figure_size\nfrom theoretical_phase_parameters import alpha_over_k_...
[ [ "numpy.array", "matplotlib.pyplot.tight_layout", "numpy.sqrt", "matplotlib.pyplot.title", "numpy.isnan", "matplotlib.pyplot.ylim", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.max", "matplotlib.pyplot.errorbar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot...
strider2king/EconML
[ "6567ad009eee82f7a072ca9bf65b40b00ce8d33b" ]
[ "econml/orf/_ortho_forest.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n\"\"\"Orthogonal Random Forest.\n\nOrthogonal Random Forest (ORF) is an algorithm for heterogenous treatment effect\nestimation. Orthogonal Random Forest combines orthogonalization,\na technique that effectively remov...
[ [ "numpy.diag", "numpy.dot", "scipy.stats.norm.ppf", "numpy.sqrt", "numpy.asarray", "sklearn.model_selection.KFold", "numpy.concatenate", "sklearn.clone", "numpy.all", "numpy.hstack", "numpy.unique", "numpy.arange", "numpy.matmul", "sklearn.model_selection.Str...
colindonfack/statsmodels
[ "a251e4cd4b689781916e1001d7e8ca2c0395ef1f" ]
[ "statsmodels/sandbox/regression/penalized.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"linear model with Theil prior probabilistic restrictions, generalized Ridge\n\nCreated on Tue Dec 20 00:10:10 2011\n\nAuthor: Josef Perktold\nLicense: BSD-3\n\nopen issues\n* selection of smoothing factor, strength of prior, cross validation\n* GLS, does this really work this way\n* ...
[ [ "numpy.diag", "numpy.dot", "numpy.log", "numpy.linalg.solve", "numpy.take", "numpy.linalg.matrix_rank", "numpy.asarray", "numpy.squeeze", "numpy.eye", "scipy.misc.central_diff_weights", "numpy.ones", "numpy.linalg.pinv", "numpy.size", "scipy.optimize.fmin", ...
tingard/Galaxy-builder-aggregation
[ "78fec76eeb2ab4b38e241b66fa5643e0002ba3a7", "78fec76eeb2ab4b38e241b66fa5643e0002ba3a7" ]
[ "spiral_aggregation/galaxy_pa_mc.py", "component-clustering/model-variance-exploration.py" ]
[ "import os\nimport shutil\nfrom tqdm import trange\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom gzbuilderspirals.oo import Arm\nimport theano\nimport theano.tensor as tt\nimport pymc3 as pm\nimport argparse\nfrom sklearn.preprocessing import OrdinalEncoder\nimport warnings\nfrom a...
[ [ "numpy.sqrt", "numpy.linspace", "matplotlib.pyplot.plot", "numpy.zeros_like", "numpy.exp", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "pandas.read_csv", "numpy.unique", "numpy.save", "matplotlib.pyplot.gcf", "matplotlib.pyplot.close", "matplotlib...
tipresias/tipresias
[ "8945acb8276f22f2159c24e5a1bd411e7920a79e" ]
[ "tipping/sqlalchemy-fauna/tests/integration/test_sqlalchemy_fauna.py" ]
[ "# pylint: disable=missing-docstring,redefined-outer-name\n\nfrom datetime import timezone\nimport functools\n\nfrom sqlalchemy import inspect, exc as sqlalchemy_exceptions, sql\nimport pytest\nfrom faker import Faker\nimport numpy as np\nfrom tests.fixtures.factories import UserFactory\nfrom tests.fixtures.models ...
[ [ "numpy.int16" ] ]
eliphatfs/adversarial
[ "62c51e22734fd6bc2f674d0a96fddd177e06c507" ]
[ "adv/model.py" ]
[ "from torchvision import transforms\nfrom torchvision.transforms.functional import InterpolationMode\nfrom models import resnet18\nfrom models import inception_v3\nfrom models import WideResNet, ResNet18\nfrom models import SmallResNet, WideResNet28, WideResNet34\nfrom models import PreActResNet18, PreActResNet34\n...
[ [ "torch.hub.load", "torch.load" ] ]
Magnushhoie/MLOps_sequences
[ "075558a104a3b19421b67338814775e72d7c8b7c" ]
[ "src/models/train_model.py" ]
[ "import os\nimport pathlib\nfrom pathlib import Path\n\nimport hydra\nimport wandb\nfrom omegaconf import DictConfig\nfrom pytorch_lightning import LightningModule, Trainer, seed_everything\nfrom pytorch_lightning.callbacks import ModelCheckpoint\nfrom pytorch_lightning.callbacks.early_stopping import EarlyStopping...
[ [ "torch.randn", "torch.utils.data.TensorDataset", "torch.utils.data.DataLoader" ] ]
jimmiebtlr/stable-baselines
[ "b9ce5f5e42a90712a9e78a03ee3ad8256c00fa06" ]
[ "stable_baselines/common/misc_util.py" ]
[ "import os\nimport pickle\nimport random\nimport tempfile\nimport zipfile\n\nimport gym\nimport numpy as np\nimport tensorflow as tf\n\n\ndef zipsame(*seqs):\n \"\"\"\n Performes a zip function, but asserts that all zipped elements are of the same size\n\n :param seqs: a list of arrays that are zipped toge...
[ [ "tensorflow.set_random_seed", "numpy.random.seed" ] ]
Nik-Menendez/PyCudaAnalyzer
[ "4b43d2915caac04da9ba688c2743e9c76eacdd5b", "4b43d2915caac04da9ba688c2743e9c76eacdd5b" ]
[ "Wto3l/Weighter/GPUDataMCWeighter.py", "Wto3l/selection_efficiency.py" ]
[ "import numpy as np\nimport pickle,os\n\nfrom Common.Module import Module\n\nimport pycuda.autoinit\nimport pycuda.driver as drv\nfrom pycuda.compiler import SourceModule\n\nmod = SourceModule(\"\"\"\n#include <stdio.h>\n\n__global__ void calculate(float *dest, float *xs_weight, float *selection_weight, float* data...
[ [ "numpy.zeros", "numpy.ones" ], [ "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.bar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
beaugogh/annotated-transformer
[ "735126ef526b01eeb703063ef6d2eb3d34afac09", "735126ef526b01eeb703063ef6d2eb3d34afac09" ]
[ "annotated/transformer_training.py", "pie-modeling/main.py" ]
[ "from torch.autograd import Variable\nfrom annotated.transformer_modeling import subsequent_mask\nimport time\nimport torch\nimport torch.nn as nn\nimport numpy as np\nglobal max_src_in_batch, max_tgt_in_batch\n\n\nclass Batch:\n \"Object for holding a batch of data with mask during training.\"\n\n def __init...
[ [ "torch.nn.KLDivLoss", "torch.ones", "torch.max", "torch.autograd.Variable", "torch.nonzero", "numpy.random.randint" ], [ "pandas.DataFrame" ] ]
skkapoor/MiningSubjectiveSubgraphPatterns
[ "32222660eb0ba2368db11395a0bf5f94122b2b3c" ]
[ "src/Algorithms/AirlineExp1.py" ]
[ "###################################################################################################################################################################\n######################################################################################################################################################...
[ [ "pandas.DataFrame" ] ]
ValerianRey/fed_iot_guard
[ "11002615eb0fd0f01701bf37239cb08ee2f7a407" ]
[ "src/unsupervised_experiments.py" ]
[ "from types import SimpleNamespace\nfrom typing import Tuple, List, Dict\n\nimport torch\nfrom context_printer import Color\nfrom context_printer import ContextPrinter as Ctp\n# noinspection PyProtectedMember\nfrom torch.utils.data import DataLoader\n\nfrom architectures import SimpleAutoencoder, NormalizingModel, ...
[ [ "torch.zeros", "torch.ones", "torch.tensor" ] ]
TCbacon/Crypto_Bot
[ "270902837521a6fc7f052f27412e9cfa7baebb0a" ]
[ "tkinter_crypto_bot.py" ]
[ "import websocket, json\nimport talib\nimport numpy\nfrom binance.enums import *\nfrom binance.client import Client\nimport config\nimport datetime\nfrom tkinter import *\nimport threading\nimport time\n\n\n\"\"\"\nA Tkinter crypto trading bot application\n\nColors used for messages and ui:\nlight blue - #c6d9e0\nd...
[ [ "numpy.array" ] ]
Hertin/fairseq
[ "d77e24c7a3fcb200f99faa1188d910218965c4b6" ]
[ "fairseq/models/wav2bart/wav2bart_chr.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom argparse import Namespace\nimport contextlib\nimport os\nimport copy\nimport math\nimport numpy as np\nimport torch\nimport tor...
[ [ "torch.nn.Dropout", "torch.nn.init.constant_", "torch.nn.Embedding", "torch.nn.Linear", "torch.nn.init.normal_", "torch.no_grad", "torch.nn.init.xavier_uniform_" ] ]
fishjam/vmaf
[ "030ded43ea77eb6e16b5bb69ef937b1600494b6c" ]
[ "python/script/run_vmafossexec_subsampling.py" ]
[ "from time import time\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom vmaf.config import VmafConfig, DisplayConfig\nfrom vmaf.core.quality_runner import VmafossExecQualityRunner\nfrom vmaf.core.result_store import FileSystemResultStore\nfrom vmaf.core.train_test_model import RegressorMixin\nfrom vma...
[ [ "numpy.array", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
LuisGuilhermeSousa/Analise_de_Dados_Eleitorais
[ "3fcac61e5ddf36fc8616558847e3ce03b618fec1" ]
[ "analise_de_dados.py" ]
[ "# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\nimport pandas as pd\n\n\n# %%\ndados_2012 = pd.read_csv('Dados/perfil_eleitorado_2012.csv', sep=';', encoding='latin-1')\ndados_2014 = pd.read_csv('Dados/perfil_eleitorado_2014.csv', sep=';', encoding='utf-8')\ndados_2016...
[ [ "pandas.read_csv" ] ]
SilverRon/gppy
[ "0ee56ca270af62afe1702fce37bef30add14f12a" ]
[ "gw/middletest/plot_summary.py" ]
[ "#============================================================\n#\tTHIS IS FOR COLLECTING ALL OBSERVATION DATA FOR FOLLOW-UP OBSERVATION TO S190425z\n#\t2019.05.23\tMADE BY Gregory S.H. Paek\n#============================================================\nimport os, glob\nimport numpy as np\nfrom astropy.io import a...
[ [ "numpy.log", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.log10", "numpy.array" ] ]
szh-hust/my_cnn
[ "3fed72ca585efdc9e7e671d291274416ccb0ac06" ]
[ "Pythoncode/main_skl.py" ]
[ "from sklearn import datasets\nimport matplotlib.pyplot as plt\nfrom layers import *\nfrom active import *\nfrom Multilayer import *\n\n\ndef mynn_sklearn():\n digits = datasets.load_digits()\n\n # 分割训练集与测试集\n x_train = digits.data[:1000]\n x_test = digits.data[1000:1796]\n t_train = digits.target[:1...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "sklearn.datasets.load_digits", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
Channingss/Paddle
[ "91a2627251ed8d989c45b15fea323572bc9c5544" ]
[ "python/paddle/fluid/optimizer.py" ]
[ "# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.array" ] ]
yoyomimi/TNT_pytorch
[ "fed7e182a45e5cf74d827f090d72251eedbd7cc1" ]
[ "tracklets/utils/utils.py" ]
[ "# -*- coding: utf-8 -*-\n# ------------------------------------------------------------------------------\n# Created by Mingfei Chen (lasiafly@gmail.com)\n# Created On: 2020-2-25\n# ------------------------------------------------------------------------------\nimport numpy as np\nimport pandas as pd\n\nimport tor...
[ [ "torch.cat", "torch.from_numpy", "pandas.DataFrame", "torch.stack", "numpy.where", "numpy.zeros" ] ]
zack466/autoreg-sr
[ "88146370c04bc299c0f4fa3a43d9dbc237bb102c" ]
[ "models/pconvsr.py" ]
[ "from torch.nn.modules.batchnorm import BatchNorm2d\nfrom torch.nn.modules.conv import Conv2d\nfrom torch.nn.modules.pixelshuffle import PixelShuffle\nfrom torch.nn.modules.upsampling import Upsample\nfrom .partialconv2d import PartialConv2d, PartialConv2d_3k\nimport torch\nimport torch.nn as nn\nimport torch.nn.fu...
[ [ "torch.nn.modules.batchnorm.BatchNorm2d", "torch.cat", "torch.nn.modules.pixelshuffle.PixelShuffle", "torch.zeros", "torch.zeros_like", "torch.nn.functional.relu", "torch.nn.modules.upsampling.Upsample", "torch.nn.Upsample", "torch.nn.functional.leaky_relu", "torch.nn.Batch...
corelab-src/Detectron
[ "010d86afa1a15fde2161879398f6e4b6b0cd189b" ]
[ "detectron/ops/generate_proposals.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\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 applicabl...
[ [ "numpy.hstack", "numpy.maximum", "numpy.arange", "numpy.ones", "numpy.append", "numpy.meshgrid", "numpy.where", "numpy.empty" ] ]
mandt-lab/adversarial-negative-sampling
[ "a71a9bd8e814b132ec094bd2c5d080edcb1bccad" ]
[ "aux_model/decision_tree_model.py" ]
[ "import sys\nimport numpy as np\nimport tensorflow as tf\nimport h5py\n\nfrom aux_model.abstract_aux_model import AbstractAuxModel\n\n\nclass DecisionTreeModel(AbstractAuxModel):\n def __init__(self, path, dat, tree_index=0, log_file=sys.stdout):\n AbstractAuxModel.__init__(self)\n\n log_file.write...
[ [ "tensorflow.device", "numpy.minimum", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.bitwise.bitwise_and", "tensorflow.cast", "tensorflow.contrib.eager.py_func", "numpy.all", "tensorflow.where", "tensorflow.greater", "tensorflow.stop_gradient", "tensorflow...
dkirkby/desietcimg
[ "c46c5df2020d7d2cb6712a64aaca9283ec9cd5e2" ]
[ "desietcimg/scripts/sky.py" ]
[ "\"\"\"Simulate sky camera data and analysis.\n\"\"\"\nimport argparse\n\nimport numpy as np\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\nfrom desietcimg.sky import *\nfrom desietcimg.calib import *\nfrom desietcimg.plot import *\nfrom desietcimg.util import *\n\n\ndef simulate():...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "numpy.any", "matplotlib.pyplot.close", "numpy.array", "numpy.random.RandomState" ] ]
jorgepiloto/scikit-aero
[ "06958096c04183cde87a7e8a6cd7c016eb9140b3" ]
[ "src/skaero/atmosphere/util.py" ]
[ "# coding: utf-8\n\n\"\"\"\nUtilities for atmospheric calculations.\n\n\"\"\"\n\nfrom __future__ import absolute_import, division\n\nimport numpy as np\n\n# effective earth's radius\nR_Earth = 6356.7660e3 # m\n\n\ndef geometric_to_geopotential(z):\n \"\"\"Returns geopotential altitude from geometric altitude.\n...
[ [ "numpy.asarray" ] ]
pierreosselin/teachDeepRL
[ "51b512ce17a271a63b4d8b0780850511eb008750" ]
[ "test.py" ]
[ "from teachDRL.teachers.algos.normalizing_teacher import NF\nimport numpy as np\n\n### Test initialization\nteacher = NF([0,1,2], [1,2,3])\n\n### Test update\n\nteacher.nb_random = 5\nteacher.fit_rate = 5\n\ntask = np.array([1.,2., 3.], dtype=np.float32)\nreward = 2.\nfor i in range(5):\n teacher.update(task, re...
[ [ "numpy.array" ] ]
Fmakdemir/Nonogram-Solver
[ "3d90858ee6013c9b685adb11fa5ee35c4806d288" ]
[ "nonogramsolver.py" ]
[ "#!/usr/bin/env python3\n\nimport json\nimport os\nimport sys\nimport numpy as np\nimport math\nimport itertools\nimport argparse\n\n## TODO: there is a problem where one of cells might switch to next cell\n## to reproduce use example 6\n\n# 0-'*': unknown\n# 1-'X': black\n# 2-'.': white\nNCH = ['*', 'X', '.']\n\nc...
[ [ "numpy.array", "numpy.zeros", "numpy.sum" ] ]
nikitacs16/ConvLab-2
[ "5bd4c6154957ac9c5a28db151b4724431355b258" ]
[ "convlab2/dst/evaluate_inv.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nEvaluate DST models on specified dataset\nUsage: python evaluate.py [MultiWOZ|CrossWOZ|MultiWOZ-zh|CrossWOZ-en] [TRADE|mdbt|sumbt] [val|test|human_val]\n\"\"\"\nimport random\nimport numpy\nimport torch\nimport sys\nfrom tqdm import tqdm\nimport copy\nimport jieba\nimport json\n\nm...
[ [ "torch.manual_seed", "numpy.random.seed" ] ]
OliverDudgeon/QSync
[ "34adbcf37d501b803aa000b0421ce22fb7934e9b" ]
[ "sync_gates.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom qutip import *\nfrom qutip.qip.circuit import *\n\nfrom copy import deepcopy\n\n\ndef U(args):\n \"\"\"Custom Implementation of QASM U Gate since QuTip's is different\n See QASM Docs / Koppenhofer Thesis\n \"\"\"\n theta, phi, gamma = args\n ...
[ [ "numpy.log2", "numpy.exp", "numpy.cos", "numpy.sin" ] ]
Sam-2727/isochrones
[ "11f49c6c693e91bf275bb6a20af41b5f42e233da" ]
[ "isochrones/cluster_utils.py" ]
[ "from math import log10, log, exp\nimport numba as nb\nimport numpy as np\n\nfrom .utils import trapz\nfrom .priors import powerlaw_lnpdf\n\n\n@nb.jit(nopython=True)\ndef logaddexp(x1, x2):\n xmax = max(x1, x2)\n return xmax + log(exp(x1 - xmax) + exp(x2 - xmax))\n\n\n@nb.jit(nopython=True)\ndef logsumexp(xx)...
[ [ "numpy.zeros" ] ]
ErickRosete/Deep-Reinforcement-Learning-for-Adapting-Dynamical-Systems
[ "cfea4cb65b4e43f9e1e9d3bc3a4b193a9a6cf0f2" ]
[ "drlfads/env/sawyer_peg_env.py" ]
[ "import gym\nimport hydra\nimport logging\nimport numpy as np\nimport pybullet as p\nimport pybulletX as px\nimport tacto\n\nfrom gym.spaces.box import Box\nfrom gym import spaces, ObservationWrapper, ActionWrapper, RewardWrapper\nfrom pybulletX.utils.space_dict import SpaceDict\n\nfrom drlfads.env.sawyer_grip...
[ [ "numpy.abs", "numpy.sqrt", "numpy.asarray", "numpy.linalg.norm", "numpy.ones", "numpy.random.normal", "numpy.append", "numpy.random.uniform", "numpy.array" ] ]
benjabee10/WKUResearch
[ "5cc384c0e0c1afc82c38a9e6eb63b80c85af7c97", "5cc384c0e0c1afc82c38a9e6eb63b80c85af7c97" ]
[ "OtherAlgorithms/MACD and SI.py", "OtherAlgorithms/Pairs Trading Template.py" ]
[ "'''\nPipeline Filters: \nprice > 10 (price_filter)\n5-day SMA > 10-day SMA (positive_movement)\n30-day Parkinson Volatility is in bottom 1000 of stocks (pvol_filter)\nAverageDollarVolume\n10-day SMA > 30-day SMA (positive_movement2)\n\nMACD Histogram and 5% Stochastic Indicator Trading\n\nTo-DO: \nmanage leverage\...
[ [ "numpy.log", "numpy.mean" ], [ "numpy.std", "numpy.mean" ] ]
TimofeevAlex/nni
[ "b1784602ff4887d1c71b60610a9188d914ab721c" ]
[ "examples/nas/darts/gaussian_blur.py" ]
[ "import numpy as np\nimport torch\nfrom torch import nn\nfrom torchvision.transforms import transforms\n\nnp.random.seed(0)\n\n\nclass GaussianBlur(object):\n \"\"\"blur a single image on CPU\"\"\"\n def __init__(self, kernel_size):\n radias = kernel_size // 2\n kernel_size = radias * 2 + 1\n ...
[ [ "torch.nn.ReflectionPad2d", "numpy.random.seed", "numpy.power", "numpy.arange", "torch.nn.Conv2d", "torch.from_numpy", "torch.no_grad", "numpy.random.uniform" ] ]
ersinaksar/Binance-Bot
[ "0f4c27ec64265db33eca12cca0d95b2fd2d1c915" ]
[ "bot v2 (no-tweepy).py" ]
[ "##################################################\n## Binance Python Bot :]\n##################################################\n\nimport time\n# pip install python-binance\nfrom binance.client import Client\nfrom binance.enums import *\n# pip install pandas\nimport pandas as pd\n# pip install numpy\nimport numpy...
[ [ "numpy.asarray", "numpy.diff", "pandas.DataFrame" ] ]
wangshanmin/interface
[ "598ebe023fd2c9abe838db54c49b53f190ca81b7" ]
[ "interface/interface.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed May 29 12:18:32 2019\n\n@author: wangshanmin\n\"\"\"\n#\nimport sys\nsys.path.append('../deploy')\nimport wx\nimport cv2\nimport argparse\nimport face_model\nfrom utils import load_image\nimport random\nimport numpy as np\nimport threading\nim...
[ [ "numpy.asarray", "numpy.subtract", "numpy.delete", "numpy.argmin" ] ]
massimolarsen/AMCDC
[ "162bc8c0b1be1a11ee4b78af27a3808722771559" ]
[ "mcdc/simulator.py" ]
[ "import sys\nimport h5py\nimport numpy as np\n\nfrom math import floor\n\nimport mcdc.random\nimport mcdc.mpi\n\nfrom mcdc.point import Point\nfrom mcdc.particle import Particle\nfrom mcdc.distribution import DistPointIsotropic\nfrom mcdc.constant import SMALL, VERY_SMALL, LCG_SEED, LCG_STRIDE, INF,...
[ [ "numpy.log", "numpy.squeeze", "numpy.cos", "numpy.sin", "numpy.array", "numpy.zeros" ] ]
ZimmermanGroup/conformer-rl
[ "beb98cbee6ba6efba686d7c6eebbf33fd737f279" ]
[ "tests/agents/A2C/test_A2C_agent.py" ]
[ "import conformer_rl\nimport torch\nfrom conformer_rl.agents.A2C.A2C_agent import A2CAgent\n\ndef mock_init(self):\n pass\n\ndef test_train(mocker):\n mocker.patch('conformer_rl.agents.A2C.A2C_agent.A2CAgent.__init__', mock_init)\n backward = mocker.patch('torch.Tensor.backward')\n nn = mocker.patch('co...
[ [ "torch.rand", "torch.tensor" ] ]
rjadr/SurflineTelegramBot
[ "4f9480312abfa85da0f914ac2cae6e0f3742931f" ]
[ "app.py" ]
[ "from telethon import TelegramClient, events, Button, tl\nfrom apscheduler.schedulers.asyncio import AsyncIOScheduler\nimport asyncio\nimport config\nfrom loguru import logger\nimport requests\nimport re\nimport pandas as pd\nimport math\n\nbot = TelegramClient('mysurfbot', config.API_ID, config.API_HASH).start(bot...
[ [ "pandas.json_normalize", "pandas.to_datetime" ] ]
bilardi/backtesting-tool-comparison
[ "c5a737c7a3f61717b88f06834d94b123b0c538a7" ]
[ "src/python/strategies.py" ]
[ "# initialization\nimport numpy as np\nimport pandas as pd\nfrom pandas_datareader import data as pdr\nstart='2017-10-30'\nend='2020-10-08'\namzn = pdr.DataReader('AMZN', 'yahoo', start, end)\n# simple indicators\namzn['SMA20'] = amzn['Close'].rolling(20).mean()\namzn['SMA50'] = amzn['Close'].rolling(50).mean()\nam...
[ [ "numpy.where", "pandas.date_range" ] ]
Bazs/graph_slam
[ "0f26f21280b08a883d1bc8e1095ea1f3591db30e", "0f26f21280b08a883d1bc8e1095ea1f3591db30e" ]
[ "utils/state.py", "utils/test/test_measurement_model.py" ]
[ "import numpy as np\n\n\nclass State:\n def __init__(self):\n self.array = np.zeros((3, 1), dtype='float')\n\n @property\n def x(self):\n return self.array[0]\n\n @property\n def y(self):\n return self.array[1]\n\n @property\n def th(self):\n return self.array[2]\n\n...
[ [ "numpy.zeros" ], [ "numpy.array", "numpy.allclose" ] ]
bkiefer/german-sentiment
[ "0ae89e219f0a7bbd3ae2355ad06a5feb52706e12", "0ae89e219f0a7bbd3ae2355ad06a5feb52706e12" ]
[ "bert/run_classifier.py", "fasttext/train.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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 ...
[ [ "torch.load", "torch.utils.data.DataLoader", "torch.no_grad", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "torch.device", "torch.distributed.get_rank", "torch.distributed.init_process_group", "torch.utils.data.distributed.DistributedSampler", "torch.utils.data....
kinredon/umt
[ "621ab9d3fe2ea7c223f300f9184fedc7db6da780" ]
[ "lib/datasets/kitti_cycle_city.py" ]
[ "from __future__ import print_function\nfrom __future__ import absolute_import\n# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# ----------------------------------------...
[ [ "scipy.io.loadmat", "numpy.zeros", "numpy.mean" ] ]
castillohair/dnaplotlib
[ "a382ec0d895b40c5820c5d9597ba7ef5b778a53e" ]
[ "dnaplotlib/dnaplotlib.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nDNAplotlib\n==========\n This module is designed to allow for highly customisable visualisation of DNA\n fragments. Diagrams can be in the form of conceptual SBOL compliant icons or\n make use of icons whose width is scaled to allow for easier comparison of part \n locati...
[ [ "matplotlib.patches.Ellipse", "matplotlib.pyplot.tight_layout", "matplotlib.use", "matplotlib.patches.Wedge", "matplotlib.lines.Line2D", "matplotlib.path.Path", "matplotlib.patches.Circle", "matplotlib.pyplot.gcf", "matplotlib.pyplot.close", "matplotlib.patheffects.Stroke",...
agaier/pyAFT
[ "811e884cc43ee2715ff926b2e85a3d324120fcff" ]
[ "foil_eval.py" ]
[ "import numpy as np\nimport os # creating xfoil directory\nimport subprocess # 'tail' to read xfoil output\nimport scipy\n\n\n# ---------------------------------------------------------------------------- #\ndef polyArea(x,y): # Shoelace formula\n return 0.5*np.abs(np.dot(x,np.roll(y,1))-np.dot(y,np.roll(x...
[ [ "numpy.log", "numpy.shape", "numpy.array", "numpy.roll", "numpy.random.randint" ] ]
NCAR/geocat-comp
[ "0f22e64a4a4e1fcd2409a7d05dcc2bba366c6076" ]
[ "src/geocat/comp/crop.py" ]
[ "import numpy as np\nimport typing\nimport warnings\nimport xarray as xr\nfrom .comp_util import _is_duck_array\n\n\ndef max_daylight(\n jday: typing.Union[np.ndarray, xr.DataArray, list,\n float], lat: typing.Union[np.ndarray, xr.DataArray, list,\n ...
[ [ "numpy.asarray", "numpy.sin", "numpy.tan", "numpy.transpose", "numpy.exp" ] ]
michaelpdu/Deep_Metric
[ "b7752c043a15addeb17d07bc2ed676663cc2e4f1" ]
[ "evaluations/extract_featrure.py" ]
[ "from __future__ import print_function, absolute_import\nimport time\nfrom collections import OrderedDict\n\nimport torch\nfrom utils import to_numpy\nimport numpy as np\n\nfrom utils.meters import AverageMeter\nfrom evaluations.cnn import extract_cnn_feature\n\n\ndef normalize(x):\n norm = x.norm(dim=1, p=2, ke...
[ [ "torch.cat", "torch.sqrt", "torch.FloatTensor", "torch.cuda.is_available", "torch.pow" ] ]
Mittmich/cooltools
[ "9094c0498dd7a4c790be6909f3d051cb0201112b" ]
[ "cooltools/sample.py" ]
[ "import numpy as np\nimport pandas as pd\n\nimport cooler\nimport cooler.tools\n\n\ndef sample_pixels_approx(pixels, frac):\n pixels[\"count\"] = np.random.binomial(pixels[\"count\"], frac)\n mask = pixels[\"count\"] > 0\n\n if issubclass(type(pixels), pd.DataFrame):\n pixels = pixels[mask]\n eli...
[ [ "numpy.random.choice", "numpy.asarray", "numpy.round", "numpy.bincount", "numpy.searchsorted", "numpy.random.binomial" ] ]
yanzhicong/mixmatch
[ "4903dcc10ce73f3afc9c9c1b1392cc6def7f83bc" ]
[ "pseudo_label.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.nn.softmax", "tensorflow.control_dependencies", "tensorflow.reduce_mean", "tensorflow.get_collection", "tensorflow.cast", "tensorflow.assign", "tensorflow.placeholder", "tensorflow.train.ExponentialMovingAverage", "tensorflow.one_hot", "tensorflow.to_float", ...
pauliacomi/adsutils
[ "062653b38924d419d1235edf7909078ff98a163f", "062653b38924d419d1235edf7909078ff98a163f" ]
[ "tests/characterisation/test_psd_kernel.py", "tests/characterisation/test_initial_henry.py" ]
[ "\"\"\"\nThis test module has tests relating to DFT fitting for pore size calculations.\n\nAll functions in /calculations/psd_dft.py are tested here.\nThe purposes are:\n\n - testing the user-facing API function (psd_dft)\n - testing individual low level functions against known results.\n\nFunctions are teste...
[ [ "numpy.isclose" ], [ "numpy.isclose" ] ]
HPCRL/fairscale
[ "54bd62d33014a42803bdf20b0ad6fbc02333d943" ]
[ "fairscale/nn/data_parallel/sharded_ddp.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the BSD license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nA nn.Module wrapper to go with a Sharded Optimizer in order to handle targeted gradient\nreduction automatically.\n\"\"\"\n\...
[ [ "torch.distributed.broadcast", "torch.zeros", "torch.zeros_like", "torch.distributed.reduce", "torch.no_grad", "torch.distributed.get_rank", "torch.distributed.get_world_size" ] ]
zzheng93/code_DSI_India_AutoML
[ "a95fe541bd2e93376116254dc774d8a552d335a6" ]
[ "2_automl/automl/flaml_all_gridcell/train_all_gridcell.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nimport xgboost as xgb\nimport xarray as xr\nimport pandas as pd\nimport numpy as np\nimport gc\nfrom flaml import AutoML\nimport shap\nfrom sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error\nimport sys\nimport ast\nimport logging \nimport pickle\n\n\...
[ [ "pandas.read_parquet", "sklearn.metrics.mean_absolute_error", "sklearn.metrics.r2_score", "sklearn.metrics.mean_squared_error" ] ]
williamium3000/FedLab-benchmarks
[ "9c2c49c95da6c2d464140769b913a28ea48e08f7" ]
[ "fedlab_benchmarks/leaf/dataloader.py" ]
[ "# Copyright 2021 Peng Cheng Laboratory (http://www.szpclab.com/) and FedLab Authors (smilelab.group)\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/l...
[ [ "torch.utils.data.DataLoader" ] ]
chenyu-jiang/bert
[ "099cb1421dbf23f30f61a59b2770c4f06465c7bf" ]
[ "run_pretraining_local.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "tensorflow.nn.log_softmax", "tensorflow.FixedLenFeature", "tensorflow.reduce_sum", "tensorflow.RunMetadata", "tensorflow.contrib.data.parallel_interleave", "tensorflow.get_default_graph", "tensorflow.to_int32", "tensorflow.train.MonitoredTrainingSession", "tensorflow.python.cl...
chiyukunpeng/traffic-accident-detection
[ "f0e33744d6bd2d634c22ef2d561558c4b10105d6" ]
[ "deep_sort/tracker.py" ]
[ "# vim: expandtab:ts=4:sw=4\nfrom __future__ import absolute_import\nimport numpy as np\nfrom . import kalman_filter\nfrom . import linear_assignment\nfrom . import iou_matching\nfrom .track import Track\n\nclass Tracker:\n \"\"\"\n This is the multi-target tracker.\n\n Parameters\n ----------\n metr...
[ [ "numpy.asarray", "numpy.array" ] ]
johannaSommer/adversarial_relighting
[ "6749a8b4a60e83b0907550d771643921bcfdea9e" ]
[ "attacks/utils.py" ]
[ "import matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport skimage\nimport sys\nimport torch\nimport torchvision\nimport urllib\nimport zipfile\nfrom torch.utils.data import DataLoader\n\nfrom facenet_pytorch import MTCNN, InceptionResnetV1\nfrom google_drive_downloade...
[ [ "numpy.expand_dims", "torch.load", "torch.utils.data.DataLoader", "matplotlib.image.imread", "torch.no_grad", "torch.device", "torch.pow", "torch.nn.CrossEntropyLoss", "numpy.clip", "numpy.arange", "torch.from_numpy", "torch.optim.SGD", "numpy.load", "torch....
okadalabipr/cancer_signaling
[ "a41820c273c964c5df4d24fec2d1c60ae2cdfd72" ]
[ "Kubota2012/plot_func.py" ]
[ "import matplotlib.pyplot as plt\n\ndef timecourse(sim):\n fig=plt.figure(figsize=(8, 8))\n plt.rcParams['font.family'] = 'Arial'\n plt.rcParams['xtick.direction'] = 'in'\n plt.rcParams['ytick.direction'] = 'in'\n plt.rcParams['font.size'] = 18\n plt.rcParams['lines.linewidth'] = 4\n plt.rcPara...
[ [ "matplotlib.pyplot.yticks", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.subplot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot...
mksarker/data_preprocessing
[ "dabdb7f3dbf1c4bf5ee49a39aef2cb258539b027" ]
[ "qub/crop_utils.py" ]
[ "import numpy as np\r\nfrom skimage.color import rgb2gray\r\n\r\ndef get_seq(lst):\r\n def f_(lst):\r\n lst2 = lst[:]\r\n i = 0\r\n while i < len(lst2) - 1:\r\n if lst2[i + 1] - lst2[i] != 1:\r\n del lst2[i]\r\n else:\r\n i += 1 \r\n ...
[ [ "numpy.round" ] ]
meyer-lab/CPTAC-tensor
[ "e877473ac1096b6985c8484fa9db083fc14e5d1e" ]
[ "genFigure.py" ]
[ "#!/usr/bin/env python3\n#from cptactensor.figures.common import overlayCartoon\nimport sys\nimport logging\nimport time\nimport matplotlib\n\nmatplotlib.use(\"AGG\")\n\nfdir = \"./\"\ncartoon_dir = r\"./cpactensor/figures\"\nlogging.basicConfig(format=\"%(levelname)s:%(message)s\", level=logging.INFO)\n\nif __name...
[ [ "matplotlib.use" ] ]
texastony/Motion_Detection_Obj_Recog
[ "e2eee7596277f51a1e895481b09f951f161ae8aa" ]
[ "src/main.py" ]
[ "import cv2\nimport numpy as np\nimport time\nWINDOW_NAME = 'win'\nDISP_DENOM = 2\n\ncap = cv2.VideoCapture(0)\nfgbg = cv2.createBackgroundSubtractorKNN(\n history=50, dist2Threshold=500.0, detectShadows=False)\n\ncv2.namedWindow(WINDOW_NAME, cv2.WINDOW_NORMAL)\n# cv2.startWindowThread() # Not an option on pi wi...
[ [ "numpy.empty" ] ]
momacs/pram
[ "d2de43ea447d13a65d814f781ec86889754f76fe" ]
[ "src/sim/12-comp-sir/sim-03-mc.py" ]
[ "'''\nMultiple composite SIR models.\n\nThis is the simulation of two overlapping and time-unbounded SIR models, A and B. Model B starts with a random time\ndelay and one of its parameters (gamma) random. Additional gamma flu process is added as well to further demonstrate\nhow more complicated systems can be com...
[ [ "scipy.stats.truncnorm", "scipy.stats.uniform" ] ]
albireox/lvmsurveysim
[ "8ebe8ae7a90e5f50c4ea186b947a49720b7ed9ed" ]
[ "lvmsurveysim/test/target/test_plot.py" ]
[ "#!/usr/bin/env python\n# encoding: utf-8\n#\n# @Author: José Sánchez-Gallego\n# @Date: Oct 26, 2017\n# @Filename: test_plot.py\n# @License: BSD 3-Clause\n# @Copyright: José Sánchez-Gallego\n\n\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport ...
[ [ "matplotlib.patches.Ellipse", "matplotlib.patches.Polygon" ] ]
aashizpoudel/mask_rcnn_ros
[ "547392d5b9865ed872959e45becb95da1f7a9bd6" ]
[ "nodes/mask_rcnn_node.py" ]
[ "#!/usr/bin/env python\nimport os\nimport threading\nimport numpy as np\n\nimport cv2\nfrom cv_bridge import CvBridge\nimport rospy\nfrom sensor_msgs.msg import Image\nfrom sensor_msgs.msg import RegionOfInterest\nfrom std_msgs.msg import UInt8MultiArray\nfrom std_msgs.msg import String\n\nfrom mrcnn import coco\nf...
[ [ "numpy.asscalar", "matplotlib.figure.Figure", "matplotlib.backends.backend_agg.FigureCanvasAgg", "numpy.asarray", "numpy.zeros" ] ]
pengzhiliang/MRBrainS_seg
[ "52c392edb0b3d3988cdf526002f2e6df5c8401fe", "52c392edb0b3d3988cdf526002f2e6df5c8401fe" ]
[ "train_unet.py", "dataloader/coder.py" ]
[ "#-*-coding:utf-8-*-\n'''\nCreated on Nov14 31,2018\n\n@author: pengzhiliang\n'''\n\nimport time \nimport numpy as np\nimport os\nimport os.path as osp\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom tqdm import tqdm\nfrom torch.utils.data import Dataset,...
[ [ "torch.nn.functional.softmax", "torch.max", "torch.load", "numpy.asarray", "torch.no_grad", "torch.cuda.is_available", "torch.save" ], [ "numpy.asarray", "numpy.array", "numpy.zeros" ] ]
jkverma11/OfflineSignatureVerification
[ "a2bc00c3a70a6fb34e4b211962764e7823d1e746" ]
[ "main-1.py" ]
[ "import keras\nimport os, random\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import log_loss\nfrom sklearn.preprocessing import LabelEncoder\nfrom matplotlib import ticker\nfrom sklearn.model_selection import ...
[ [ "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.metrics.log_loss", "numpy.array", "sklearn.preprocessing.LabelEncoder" ] ]
RoonakR/rational_model
[ "22a5e52dcf0c659855050a9338b66200528ec37d", "22a5e52dcf0c659855050a9338b66200528ec37d" ]
[ "utils/metrics.py", "baseline_experiments.py" ]
[ "import numpy as np\nfrom sklearn import metrics\n\n\n# for decompensation, in-hospital mortality\n\ndef print_metrics_binary(y_true, predictions, verbose=1):\n if y_true.ndim > 1:\n y_true = np.argmax(y_true, axis=1)\n predictions = np.array(predictions)\n if len(predictions.shape) == 1:\n p...
[ [ "sklearn.metrics.roc_auc_score", "sklearn.metrics.precision_recall_curve", "numpy.stack", "numpy.argmax", "sklearn.metrics.auc", "numpy.array", "numpy.sum" ], [ "sklearn.linear_model.LinearRegression", "numpy.array", "numpy.argmax", "sklearn.model_selection.train_te...
wonderfulsuccess/pyecharts
[ "2bfc0ef593867f8ce938695c2308e63f84a7c297" ]
[ "test/test_base.py" ]
[ "# coding=utf-8\nfrom __future__ import unicode_literals\n\nimport os\nimport sys\nimport json\n\nimport pandas as pd\nimport numpy as np\n\nfrom nose.tools import eq_\nfrom pyecharts import Bar, Map\nfrom test.constants import CLOTHES\nfrom test.utils import get_default_rendering_file_content\n\nTITLE = \"柱状图数据堆叠示...
[ [ "numpy.array", "numpy.random.randn", "pandas.date_range" ] ]
ajgoade/dash-sample-apps
[ "a683b7f45f8cc0c27ae82b199a60b7800b101780" ]
[ "apps/dash-nlp/local_plots.py" ]
[ "# ========== (c) JP Hwang 2020-03-17 ==========\n\nimport logging\n\n# ===== START LOGGER =====\nlogger = logging.getLogger(__name__)\nroot_logger = logging.getLogger()\nroot_logger.setLevel(logging.INFO)\nsh = logging.StreamHandler()\nformatter = logging.Formatter(\"%(asctime)s - %(name)s - %(levelname)s - %(mes...
[ [ "sklearn.manifold.TSNE", "pandas.set_option", "pandas.read_csv" ] ]
subchap/hummingbot
[ "09ed7628acdb358c0bb281d7e5e8a98f7e6d0026" ]
[ "hummingbot/strategy/uniswap_v3_lp/uniswap_v3_lp.py" ]
[ "from decimal import Decimal\nimport logging\nimport asyncio\nimport pandas as pd\nfrom hummingbot.core.clock import Clock\nfrom hummingbot.logger import HummingbotLogger\nfrom hummingbot.client.performance import PerformanceMetrics\nfrom hummingbot.strategy.market_trading_pair_tuple import MarketTradingPairTuple\n...
[ [ "pandas.DataFrame" ] ]
sbrodehl/Hashcode2k20
[ "7066df4ec4ae3781f7561092401a2c44ae74d6d5" ]
[ "Online Qualification Round/solver/statistics.py" ]
[ "from .basesolver import BaseSolver\nfrom .scoring import Markup\nimport numpy as np\nimport logging\n\n\nLOGGER = logging.getLogger(__name__)\n\n\nclass Statistics(BaseSolver):\n \"\"\"Solve the problem nice and steady!\n \"\"\"\n def __init__(self, input_str):\n super().__init__(input_str)\n\n ...
[ [ "numpy.maximum", "numpy.min", "numpy.max", "numpy.std", "numpy.mean", "numpy.zeros_like", "numpy.array", "numpy.zeros" ] ]
mdiazmel/keops
[ "52a3d2ee80a720639f52898305f85399b7b45a63", "52a3d2ee80a720639f52898305f85399b7b45a63", "52a3d2ee80a720639f52898305f85399b7b45a63", "52a3d2ee80a720639f52898305f85399b7b45a63" ]
[ "pykeops/numpy/cluster/grid_cluster.py", "pykeops/examples/pytorch/plot_generic_syntax_pytorch_LSE_vect.py", "pykeops/examples/numpy/plot_gpu_select_numpy.py", "pykeops/tutorials/kmeans/plot_kmeans_numpy.py" ]
[ "import numpy as np\n\n\ndef grid_cluster(x, size):\n r\"\"\"Simplistic clustering algorithm which distributes points into cubic bins.\n\n Args:\n x ((M,D) array): List of points :math:`x_i \\in \\mathbb{R}^D`.\n size (float or (D,) array): Dimensions of the cubic cells (\"voxels\").\n\n Retu...
[ [ "numpy.unique", "numpy.min", "numpy.arange", "numpy.max", "numpy.floor", "numpy.array", "numpy.sum" ], [ "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "torch.rand_like", "matplotlib.pyplot.subplot", "torch.rand", "torch.cuda.is_available", ...
LongNguyen1012/yauber-algo
[ "40f7d805408a788e7f363ec02d3315ff379cc069" ]
[ "yauber_algo/_algo/tests/test_featurewize_quantile.py" ]
[ "import unittest\nfrom yauber_algo.errors import *\n\n\nclass QuantileTestCase(unittest.TestCase):\n def test_quantile(self):\n import yauber_algo.sanitychecks as sc\n from numpy import array, nan, inf\n import os\n import sys\n import pandas as pd\n import numpy as np\n...
[ [ "numpy.array", "numpy.random.random" ] ]
GastonMazzei/Music-AI-experiment
[ "c8748a600ab4d7af959c71dc887a3cc72be22ac2" ]
[ "5-quiz-processing/scripts/quiz-processor.py" ]
[ "import os\n\nimport numpy as np\nimport pandas as pd\n\nfrom extras import *\n\ndef init_answ():\n return pd.read_csv('form-answers.csv')\n\ndef init_vids():\n return pd.read_csv('form-questions.csv',header=None)\n\nif __name__=='__main__':\n if True:\n # (1) Load the data and process\n os.chdir('../raw-d...
[ [ "pandas.read_csv" ] ]
zehsilva/prior-predictive-specification
[ "200291ca55469fd7d07df9ba68b82cdd51c31afc", "200291ca55469fd7d07df9ba68b82cdd51c31afc" ]
[ "gradient_optimization_experiments/HPF_Convergence/hpf_sgd_optimization.py", "posterior_visualization/aux_plt.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # HPF: matching requested expectation and variance using SGD\n\n# The notebook demonstrates how priors matching requested values of prior predictive expectation and/or variance can be found for Hierarchical Poisson Matrix Factorization model using SGD.\n\n# ## Setup \n# ...
[ [ "tensorflow.executing_eagerly", "numpy.random.seed", "tensorflow.Variable", "pandas.DataFrame", "tensorflow.math.log", "tensorflow.GradientTape", "tensorflow.keras.optimizers.Adam", "tensorflow.math.pow", "numpy.array", "tensorflow.random.set_seed", "numpy.random.randin...
surya10t/buoypy
[ "db68d5ca00af733b7f0ce8e5a332f5b9fabea8a9" ]
[ "buoypy/buoypy.py" ]
[ "\"\"\"\nBy Nick Cortale\nnickc1.github.io\n\nFunctions to query the NDBC (http://www.ndbc.noaa.gov/).\n\nThe realtime data for all of their buoys can be found at:\nhttp://www.ndbc.noaa.gov/data/realtime2/\n\nInfo about all of noaa data can be found at:\nhttp://www.ndbc.noaa.gov/docs/ndbc_web_data_guide.pdf\n\nWhat...
[ [ "pandas.read_csv", "pandas.to_datetime", "pandas.DataFrame" ] ]
leonlufkin/poker-bot
[ "60faaa4ed4c877bbb5c337ada4656649e1bdd89c" ]
[ "tic-tac-toe/game.py" ]
[ "import numpy as np\nfrom utils import TicTacToe, Config\nfrom demo_players import BasicPlayer, RandomPlayer\nfrom CFR_player import CFRPlayer\n\ndef run_game(config, verbose=True):\n if config.num_players != 2:\n raise RuntimeError(\"need exactly 2 players, have {:d}\".format(config.num_players))\n\n ...
[ [ "numpy.empty", "numpy.unique" ] ]
dengemann/meegpowreg
[ "e9cc8f2372f8b8ef4b372bfea113ed0b9646cb39" ]
[ "coffeine/spatial_filters.py" ]
[ "import copy as cp\n\nimport numpy as np\nimport pandas as pd\nfrom mne import EvokedArray\nfrom scipy.linalg import eigh, pinv\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\n\ndef shrink(cov, alpha):\n n = len(cov)\n shrink_cov = (1 - alpha) * cov + alpha * np.trace(cov) * np.eye(n) / n\n re...
[ [ "scipy.linalg.pinv", "numpy.abs", "numpy.arange", "numpy.eye", "numpy.squeeze", "numpy.linalg.norm", "scipy.linalg.eigh", "numpy.mean", "numpy.random.rand", "numpy.trace", "numpy.empty" ] ]
karibbov/TensorFlowASR
[ "2ce6e5fdb635cda4623725262939a24aaae8fdfd", "2ce6e5fdb635cda4623725262939a24aaae8fdfd" ]
[ "examples/jasper/test_jasper.py", "tensorflow_asr/models/transducer.py" ]
[ "# Copyright 2020 Huy Le Nguyen (@usimarit)\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 ...
[ [ "tensorflow.keras.backend.clear_session", "tensorflow.config.optimizer.set_experimental_options", "tensorflow.random.set_seed" ], [ "tensorflow.keras.layers.LayerNormalization", "tensorflow.zeros", "tensorflow.stack", "tensorflow.cast", "tensorflow.equal", "tensorflow.pad",...
YvanYin/SegFormer
[ "bb0bbb171195ffcd516243cf2e1f1f4a3a6bef67" ]
[ "mmseg/models/losses/cross_entropy_loss.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ..builder import LOSSES\nfrom .utils import weight_reduce_loss\n\ndef cross_entropy(pred,\n label,\n weight=None,\n class_weight=None,\n reduction='mean',\n ...
[ [ "torch.nn.functional.binary_cross_entropy_with_logits", "torch.nn.functional.cross_entropy", "torch.nonzero", "torch.arange" ] ]
gnomonsis/model_server
[ "bdd7eccde5dfa4f518f6964c103b4389cd00caaf" ]
[ "tests/functional/test_single_model_vehicle.py" ]
[ "#\n# Copyright (c) 2018-2019 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# Unless required by applic...
[ [ "numpy.append", "numpy.dtype", "numpy.ones" ] ]
WeiChengTseng/ARM
[ "9a6666e3fc93de381d8c59085cbeca35d71990ec" ]
[ "yarr/envs/rlbench_env.py" ]
[ "from typing import Type, List\n\nimport numpy as np\ntry:\n from rlbench import ObservationConfig, Environment, CameraConfig\nexcept (ModuleNotFoundError, ImportError) as e:\n print(\"You need to install RLBench: 'https://github.com/stepjam/RLBench'\")\n raise e\nfrom rlbench.action_modes import ActionMod...
[ [ "numpy.array", "numpy.expand_dims", "numpy.transpose" ] ]
tautomer/hippynn
[ "df4504a5ea4680cfc61f490984dcddeac7ed99ee" ]
[ "examples/TaSNAPExample.py" ]
[ "\"\"\"\nExample training to the SNAP database for Tantalum.\n\nThis script was designed for an exteranl dataset available at\nhttps://github.com/FitSNAP/FitSNAP\n\nFor info on the dataset, see the following publication:\nThompson, A. P., Swiler, L. P., Trott, C. R., Foiles, S. M., & Tucker, G. J. (2015).\nSpectral...
[ [ "torch.set_default_dtype", "torch.optim.lr_scheduler.ReduceLROnPlateau" ] ]
ZiyueHuang/incubator-mxnet-1
[ "566bbf74c9259d92a2321ccabb68ead048c75372" ]
[ "python/mxnet/gluon/nn/basic_layers.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.dtype" ] ]
oraisa/masters-thesis
[ "f859f560b8a8c7b535bd2a70c406f3b571ff6b9c" ]
[ "code/banana_baseline_mmds.py" ]
[ "import itertools\nimport jax\nimport argparse\nimport jax.numpy as np\nimport pandas as pd\nimport banana_model\nimport gauss_model\nimport experiments\nimport mmd\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"output\", type=str)\nargs = parser.parse_args()\n\nkey = jax.random.PRNGKey(4623878)\nkeys...
[ [ "pandas.DataFrame" ] ]
yuanliya/Adlik
[ "602074b44064002fc0bb054e17a989a5bcf22e92", "602074b44064002fc0bb054e17a989a5bcf22e92" ]
[ "model_compiler/tests/model_compiler/compilers/test_saved_model_file_to_tflite_model.py", "benchmark/tests/client/yolov3_client.py" ]
[ "# Copyright 2019 ZTE corporation. All Rights Reserved.\n# SPDX-License-Identifier: Apache-2.0\n\nfrom unittest import TestCase\nfrom tempfile import TemporaryDirectory\n\nimport tensorflow as tf\n\nimport model_compiler.compilers.saved_model_file_to_tflite_model as compiler\nfrom model_compiler.compilers.saved_mod...
[ [ "tensorflow.Graph", "tensorflow.multiply", "tensorflow.Variable", "tensorflow.compat.v1.saved_model.build_tensor_info", "tensorflow.compat.v1.saved_model.build_signature_def", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.saved_model.builder.SavedModelBuilder" ], [ ...
heartexlabs/brand-sentiment-analysis
[ "59badc2158517aadeb69dd809d6189f94205b6ab" ]
[ "src/service.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nimport sys\nimport flask\nimport json # it MUST be included after flask!\nimport heartex\nimport requests\nimport pandas as pd\n\nfrom flask import request\nfrom utils import exception_treatment, answer, log_config, log\n\n# init\nconfig_path = sys.argv[1] if len(sys.ar...
[ [ "pandas.to_datetime" ] ]
EdvinJakobsson/Neural-Style-Transfer
[ "8e62cafd14455f10a4b475716d3efd2c73134f4e" ]
[ "INetwork.py" ]
[ "from __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\n\n# from scipy.misc import imread, imresize, imsave, fromimage, toimage\nfrom utils import imread, imresize, imsave, fromimage, toimage\n\nfrom scipy.optimize import fmin_l_bfgs_b\nimport numpy as np\nim...
[ [ "numpy.amax", "numpy.expand_dims", "numpy.clip", "numpy.copy", "tensorflow.compat.v1.disable_eager_execution", "numpy.random.uniform", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
cyrusradfar/vaex
[ "6a37bd4509c9a0823b4f01075049f3331fabea77" ]
[ "tests/expression_variables_test.py" ]
[ "import vaex\nimport numpy as np\n\ndef test_expression_expand():\n ds = vaex.from_scalars(x=1, y=2)\n ds['r'] = ds.x * ds.y\n assert ds.r.expression == 'r'\n assert ds.r.variables() == {'x', 'y'}\n ds['s'] = ds.r + ds.x\n assert ds.s.variables() == {'r', 'x', 'y'}\n assert ds.s.variables(ourse...
[ [ "numpy.arctan" ] ]
rossjillian/QuadricLoss
[ "5160711b8e343135808ffa6acdf943d063ffaa3a" ]
[ "models/init.py" ]
[ "# Copyright (c) 2019 Nitin Agarwal (agarwal@uci.edu)\n\n\n# borrowed from DGCNN (https://github.com/WangYueFt/dgcnn/blob/master/pytorch/model.py)\nfrom __future__ import print_function\nimport torch\n\ndef pairwise_distance(point_cloud):\n \"\"\"\n Input: point_cloud: tensor (B, N, D)\n Output: pairwise d...
[ [ "torch.cat", "torch.bmm", "torch.rand", "torch.arange", "torch.topk", "torch.squeeze" ] ]
TropComplique/MultiPoseNet
[ "0a509a6f217e84342e54219e0ca8d2e4052127e9" ]
[ "detector/input_pipeline/heatmap_creation.py" ]
[ "import math\nimport numpy as np\nfrom scipy import signal\n\n\ndef get_heatmaps(keypoints, boxes, width, height, downsample):\n \"\"\"\n Arguments:\n keypoints: a numpy int array with shape [num_persons, 17, 3].\n It is in format (y, x, visibility),\n where coordinates `y, x` are...
[ [ "numpy.split", "numpy.log", "numpy.sqrt", "numpy.clip", "numpy.squeeze", "scipy.signal.windows.gaussian", "numpy.stack", "numpy.outer", "numpy.array", "numpy.zeros", "numpy.where" ] ]
MNagtegaal/fnnls
[ "a1edb3340454e8f1aeff3d2757ec2fdbe98b5fe1" ]
[ "src/test/generate_figure.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n#Code to generate the figure from the paper\n\nimport pytest\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import optimize\nfrom scipy import sparse\nfrom time import time\n\nfrom fnnls.fnnls import fnnls\n\n\n\nclass nnls_comparison():\n\n def __in...
[ [ "matplotlib.pyplot.legend", "numpy.arange", "numpy.linalg.norm", "matplotlib.pyplot.plot", "scipy.sparse.random", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
ScottCSteinhauser/habitat-lab
[ "4cceb55451fdc48588f1a6015c32fa5653c08050" ]
[ "habitat_baselines/agents/benchmark_gym.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\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 os\nimport os.path as osp\nfrom collections import defaultdict\nfrom typing import Any, Dict, List, Op...
[ [ "numpy.array", "torch.FloatTensor" ] ]
Rhinrei/course-starter-python
[ "69978653b64e201d52cc6cdf831062137c8f7d81", "69978653b64e201d52cc6cdf831062137c8f7d81" ]
[ "exercises/solution_02_02.py", "exercises/solution_02_05.py" ]
[ "import pandas as pd\npd.set_option('display.expand_frame_repr', False)\n\ntweets_csv = pd.read_csv(\"exercises/tweets.csv\")\ntweets_df = pd.DataFrame(tweets_csv)\nprint(tweets_df.iloc[:, 1:4])", "import pandas as pd\nfrom sklearn.feature_extraction.text import TfidfVectorizer\npd.set_option('display.expand_fram...
[ [ "pandas.set_option", "pandas.read_csv", "pandas.DataFrame" ], [ "pandas.set_option", "pandas.read_csv", "sklearn.feature_extraction.text.TfidfVectorizer", "pandas.DataFrame" ] ]
khl02007/spikeinterface
[ "a29739a2ecc1d27af0fdb7adfed895aa9fdd0be4" ]
[ "spikeinterface/sortingcomponents/peak_detection.py" ]
[ "import numpy as np\n\ntry:\n import numba\n\n HAVE_NUMBA = True\nexcept ImportError:\n HAVE_NUMBA = False\n\nfrom spikeinterface.core.job_tools import ChunkRecordingExecutor\nfrom spikeinterface.toolkit import get_noise_levels, get_channel_distances\n\nbase_peak_dtype = [('sample_ind', 'int64'), ('channel...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.nonzero" ] ]
nakamura196/toyo_sim
[ "621324a475dbc9773d4ed7c104bdb2f16e47a4ea" ]
[ "src/process_images.py" ]
[ "#!/usr/bin/python\n\n'''\nGenerates all data required to create a PixPlot viewer.\n\nDocumentation:\nhttps://github.com/YaleDHLab/pix-plot\n\nUsage:\n python utils/process_images.py --image_files=\"data/*/*.jpg\"\n\n * * *\n'''\n\nfrom __future__ import division, print_function\nfrom collecti...
[ [ "tensorflow.import_graph_def", "tensorflow.GraphDef", "sklearn.cluster.KMeans", "numpy.set_printoptions", "numpy.save", "sklearn.manifold.TSNE", "tensorflow.Session", "numpy.load", "numpy.array", "sklearn.metrics.pairwise_distances_argmin_min", "tensorflow.gfile.FastGFi...
ayushgopal/Unscripted_Personal
[ "d75b2c2a721cce64b835016d2024462863c26b5e" ]
[ "learning_1.py" ]
[ "import pandas as p\nfrom pandas import DataFrame as df\nimport matplotlib.pyplot as pl\nfrom sklearn.linear_model import LinearRegression\n\ndata=p.read_csv('cost_revenue_clean.csv')\nx=df(data,columns=['production_budget'])\ny=df(data,columns=['worldwide_gross'])\n\npl.figure(figsize=(20,10))\npl.scatter(x,y,alph...
[ [ "pandas.read_csv", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "pandas.DataFrame", "matplotlib.pyplot.ylabel", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
aardvarkkrill/kornia
[ "e36ca3d15883a1dbbb0e7413719c0965a4b63cee" ]
[ "kornia/enhance/equalization.py" ]
[ "\"\"\"In this module several equalization methods are exposed: he, ahe, clahe.\"\"\"\n\nfrom typing import Tuple\nimport math\n\nimport torch\nimport torch.nn.functional as F\n\nfrom kornia.enhance.histogram import histogram\nfrom kornia.utils.image import _to_bchw\n\n\n__all__ = [\"equalize_clahe\"]\n\n\ndef _com...
[ [ "torch.linspace", "torch.ones", "torch.empty", "torch.histc", "torch.zeros_like", "torch.tensor", "torch.where", "torch.arange", "torch.gather", "torch.cumsum", "torch.nn.functional.pad" ] ]
tcompa/BoseHubbardGutzwiller
[ "d54435757ea92d6387a90bb88507f9f4d89d3a06" ]
[ "examples/example_2.py" ]
[ "import sys\nsys.path.append('..')\n\nimport numpy\n\nfrom lib_gutzwiller_simulated_annealing import Gutzwiller\nfrom lib_gutzwiller_simulated_annealing import SA_for_gutzwiller\n\n# Physical parameters\nz = 6 # number of neighbors\nnmax = 5 # cutoff on the occupation number per site\nU = 1.0 # on-s...
[ [ "numpy.arange" ] ]
kalenkovich/mousetracking-django
[ "621e03a2c1cf31e31df2c40a7f525e51a450d916" ]
[ "experiment/models.py" ]
[ "import uuid\nfrom random import randint\nfrom math import ceil\nfrom enum import Enum\n\nimport numpy as np\nimport pandas as pd\nfrom django.contrib.sessions.models import Session\nfrom django.core.validators import MinValueValidator, MaxValueValidator\nfrom django.db import models\nfrom django.templatetags.stati...
[ [ "numpy.where" ] ]
ds-wook/PredictCreditCardDelinquency
[ "90b3adf986ee16208090a0c0092a06566ad91241" ]
[ "src/predict-delinquency/xgb_train.py" ]
[ "import argparse\n\nimport pandas as pd\n\nfrom data.dataset import load_dataset\nfrom model.gbdt import stratified_kfold_xgb\n\n\ndef define_argparser():\n parse = argparse.ArgumentParser(\"Training!\")\n parse.add_argument(\n \"--submit\", type=str, help=\"Input data save path\", default=\"../../subm...
[ [ "pandas.read_pickle", "pandas.read_csv" ] ]