repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
yangzilongdmgy/merge_monster_3d | [
"0595e36749d32c3d5537a3f707727a137c82076e"
] | [
"mmdet3d/models/dense_heads/assigner/assign_result.py"
] | [
"# Modification 2020 RangiLyu\n# Copyright 2018-2019 Open-MMLab.\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 requi... | [
[
"torch.zeros",
"torch.cat",
"numpy.random.RandomState",
"torch.from_numpy",
"numpy.where",
"numpy.arange"
]
] |
athbaltzis/deepblast | [
"63d29fd162e537de1630d4f98f2b559b61a611e3"
] | [
"deepblast/utils.py"
] | [
"import os\nimport numpy as np\nfrom scipy.stats import multivariate_normal\nimport inspect\nfrom sklearn.metrics.pairwise import pairwise_distances\n\n\ndef sample(transition_matrix, means, covs, start_state, n_samples,\n random_state):\n n_states, n_features, _ = covs.shape\n states = np.zeros(n_s... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.log",
"numpy.zeros",
"numpy.random.RandomState",
"scipy.stats.multivariate_normal",
"sklearn.metrics.pairwise.pairwise_distances"
]
] |
magicicada/slim | [
"ce05d40f56f5263cb039973af3e187cffc1d00b4"
] | [
"slim/types/TreatmentTypes.py"
] | [
"from __future__ import annotations\n\nfrom abc import abstractmethod, ABC\nfrom decimal import Decimal\nfrom enum import Enum\nfrom typing import Dict, cast\n\nimport numpy as np\n\n# A few extra general types\nfrom slim.simulation.lice_population import LicePopulation, GenoDistrib, GenoTreatmentValue,\\\n Alle... | [
[
"numpy.array"
]
] |
valgur/GIMP-ML-Hub | [
"11bdfcc894ac53543b2178e67eaf29bf9815049f"
] | [
"models/MiDaS.py"
] | [
"import sys\n\nimport numpy as np\nimport torch\nimport torch.hub\nfrom PIL import Image\nfrom torchvision.transforms import Compose\n\nfrom _model_base import ModelBase, handle_alpha\nfrom _util import apply_colormap, to_rgb\n\n\n# Simplified transforms from\n# https://github.com/intel-isl/MiDaS/blob/master/models... | [
[
"numpy.array",
"numpy.ascontiguousarray",
"numpy.round",
"torch.no_grad",
"torch.from_numpy",
"numpy.transpose",
"torch.hub.load"
]
] |
maxinye/AIC_Weather_Forecasting | [
"e04b9b3570d7377847b35f8ba67943988e24744d"
] | [
"eval/obs_and_M_split.py"
] | [
"import pandas as pd\nfrom datetime import datetime\nimport os\n\ndef datelist(beginDate, endDate):\n date_l=[datetime.strftime(x,'%Y-%m-%d') for x in list(pd.date_range(start=beginDate, end=endDate))]\n return date_l\nbegin_date='2018-10-28'\nend_date='2018-11-03'\ndates=datelist(begin_date,end_date)\nif not... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.date_range"
]
] |
tahashmi/deepvariant | [
"84516dfacd1ed856a34507becb21848aa12e77a8"
] | [
"deeptrio/variant_caller_test.py"
] | [
"# Copyright 2017 Google LLC.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice,\n# this list of conditions and the following dis... | [
[
"numpy.testing.assert_allclose",
"numpy.log10",
"numpy.array",
"numpy.isfinite"
]
] |
surfaceanalytics/inelasticscattering | [
"da549dde788a55084c565bbc5f89ebf9cbae4263"
] | [
"model/algorithms/legacy/angular_spread_lorentzian.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 12 16:39:59 2020\n\n@author: nicholls\n\"\"\"\n\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n#%%\n\nclass AngularSpreadCalc():\n \"\"\" class for calculating how angular spread changes with iterations:\n Inputs:\n iterat... | [
[
"matplotlib.pyplot.xlabel",
"numpy.sum",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"numpy.genfromtxt",
"matplotlib.pyplot.legend",
"numpy.where",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"numpy.cos",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks"... |
omrinewman/maritime-whale | [
"ff983bc42572676c806be0d5fac6767463b22df5"
] | [
"src/process_maritime_data.py"
] | [
"# Copyright 2020 The Maritime Whale Authors. All rights reserved.\n# Use of this source code is governed by an MIT-style license that can be\n# found in the LICENSE.txt file.\n#\n# Processes wind and vessel data. Performs simple analysis.\n\nfrom match_wind_data import *\nfrom datetime import *\nfrom meet_and_pass... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.read_csv"
]
] |
jannsta1/insectvision | [
"d98a7acbcde1d5faf00131485fa85c706f313814"
] | [
"sphere/distance.py"
] | [
"import numpy as np\nfrom .transform import sph2vec, vec2sph\n\n\ndef angle_between(ang1, ang2, sign=True):\n d = (ang1 - ang2 + np.pi) % (2 * np.pi) - np.pi\n if not sign:\n d = np.abs(d)\n return d\n\n\ndef angdist(v1, v2, zenith=True):\n if v1.shape[0] == 2:\n v1 = sph2vec(v1, zenith=ze... | [
[
"numpy.dot",
"numpy.linalg.norm",
"numpy.arccos",
"numpy.einsum",
"numpy.abs",
"numpy.absolute"
]
] |
CodeLongAndProsper90/COVID | [
"b277c4b64a7c84cb2dfe1f7514b1e884a58f98a0"
] | [
"backend.py"
] | [
"################################################\n# backend.py is part of COVID.codelongandpros.repl.co\n# You should have recieved a copy of the three-clause BSD license. \n# If you did not, it is located at: \n# https://opensource.org/licenses/BSD-3-Clause\n# Made by Scott Little, with help from StackOverflow\n#... | [
[
"matplotlib.pyplot.savefig",
"numpy.zeros",
"matplotlib.pyplot.subplots"
]
] |
kbsezginel/angstrom | [
"793fd05b9bf27cab50d5c292fe63f685ea767d6d"
] | [
"angstrom/trajectory/trajectory.py"
] | [
"\"\"\"\n--- Ångström ---\nRead, manipulate and analyze molecular trajectory files.\n\"\"\"\nfrom .read import read_xyz_traj\nfrom .write import write_xyz_traj\nfrom angstrom.geometry import get_molecule_center\nfrom angstrom import Molecule\nimport numpy as np\nimport os\n\n\nclass Trajectory:\n \"\"\"\n Rea... | [
[
"numpy.array",
"numpy.shape",
"numpy.append"
]
] |
algocompretto/template-deep-learning | [
"358befe9980f4dbddb9fd9c1df3f8d0d9467e3d1"
] | [
"agents/dqn.py"
] | [
"\"\"\"\nMain agent for DQN\n\"\"\"\nimport math\nimport random\nimport shutil\n\nimport gym\nimport torch\nfrom tensorboardX import SummaryWriter\nfrom torch.backends import cudnn\nfrom tqdm import tqdm\n\nfrom agents.base import BaseAgent\nfrom graphs.losses.huber_loss import HuberLoss\nfrom graphs.models.dqn imp... | [
[
"torch.zeros",
"torch.device",
"torch.cat",
"torch.save",
"torch.no_grad",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.load",
"torch.Tensor"
]
] |
GuyLor/gumbel_max_causal_gadgets_part2 | [
"ae3b495367e6708b3bf6c169364f030f63be5422"
] | [
"sepsisSimDiabetes/MDP.py"
] | [
"import numpy as np\nfrom .State import State\nfrom .Action import Action\n\n'''\nIncludes blood glucose level proxy for diabetes: 0-3\n (lo2, lo1, normal, hi1, hi2); Any other than normal is \"abnormal\"\nInitial distribution:\n [.05, .15, .6, .15, .05] for non-diabetics and [.01, .05, .15, .6, .19] for diab... | [
[
"numpy.array",
"numpy.random.binomial",
"numpy.arange",
"numpy.random.uniform"
]
] |
caesarcc/python-code-tutorials | [
"aa48ebe695e86440b206b641501ad55d021309bf"
] | [
"machine-learning/nlp/bert-text-classification/train.py"
] | [
"# !pip install transformers\n\nimport torch\nfrom transformers.file_utils import is_tf_available, is_torch_available, is_torch_tpu_available\nfrom transformers import BertTokenizerFast, BertForSequenceClassification\nfrom transformers import Trainer, TrainingArguments\nimport numpy as np\nimport random\nfrom sklea... | [
[
"torch.cuda.manual_seed_all",
"sklearn.datasets.fetch_20newsgroups",
"numpy.random.seed",
"tensorflow.random.set_seed",
"sklearn.metrics.accuracy_score",
"torch.manual_seed",
"torch.tensor",
"sklearn.model_selection.train_test_split"
]
] |
pwhatfield/RAIL | [
"4986c10c3dd51362bde8ea1ddb3c53fb6d96cf56"
] | [
"rail/estimation/algos/sklearn_nn.py"
] | [
"\"\"\"\nExample code that implements a simple Neural Net predictor\nfor z_mode, and Gaussian centered at z_mode with base_width\nread in fromfile and pdf width set to base_width*(1+zmode).\n\"\"\"\n\nimport numpy as np\n# from numpy import inf\nimport sklearn.neural_network as sknn\nfrom sklearn.preprocessing impo... | [
[
"scipy.stats.norm.pdf",
"sklearn.preprocessing.StandardScaler",
"numpy.random.seed",
"sklearn.neural_network.MLPRegressor",
"numpy.linspace",
"numpy.vstack"
]
] |
wantysal/MoSQITooo | [
"a52f9ff120db9f9c46f4309d28d9e1568a5b4120"
] | [
"mosqito/sq_metrics/loudness/loudness_zwtv/_third_octave_levels.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@date Created on Fri May 22 2020\n@author martin_g for Eomys\n\"\"\"\n\n# Third party imports\nimport numpy as np\nfrom scipy import signal\n\n# Local application imports\nfrom mosqito.sq_metrics.loudness.loudness_zwtv._square_and_smooth import (\n _square_and_smooth,\n)\n\n\nde... | [
[
"numpy.log10",
"numpy.array",
"scipy.signal.sosfilt",
"numpy.zeros"
]
] |
stroblme/hqsp-main | [
"add585604912f0dec6d02118d4643435525a8df1"
] | [
"train.py"
] | [
"import sys\nsys.path.append(\"./stqft\")\nsys.path.append(\"./qcnn\")\n\nimport os\n#Activate the cuda env\nos.environ[\"LD_LIBRARY_PATH\"] = \"$LD_LIBRARY_PATH:/usr/local/cuda/lib64/:/usr/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-11.2/lib64:/usr/local/cuda/targets/x86_64-linux/lib/\"\n\nimport time... | [
[
"numpy.load"
]
] |
rickywu0421/fibdrv | [
"68f7b771795598f3a7339025dcd61a081c7c8e5c"
] | [
"scripts/driver.py"
] | [
"#!/usr/bin/env python3\n\nimport sys\nimport psutil\nimport subprocess\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nif (len(sys.argv) < 2):\n print(\"usage: python3 driver.py <runs>\")\n sys.exit(1)\n\ninput_file = 'fib_time'\noutput_file = \"time.png\"\nruns = int(sys.argv[1])\n\ndef outlier_filt... | [
[
"numpy.array",
"numpy.delete",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"numpy.loadtxt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots_adjust"
]
] |
YosafatM/100-days-of-Python | [
"e81ab663b7aacb7a904f27a4e6774837cf3594a1"
] | [
"Intermedio Avanzado/32 Felicitaciones/main.py"
] | [
"import pandas as pd\nimport datetime as dt\nimport smtplib as st\nimport random as rd\n\nFROM = \"pythonsender633@gmail.com\"\nPASSWORD = \"1234abc()\"\nSUBJECT = \"Happy birthday!\"\n\nLETTERS = [1, 2, 3]\nPLACEHOLDER = \"[NAME]\"\n\nPATH = \"birthdays.csv\"\nC_NAME = \"name\"\nC_EMAIL = \"email\"\nC_YEAR = \"yea... | [
[
"pandas.read_csv"
]
] |
Hotaro0237/image-editor-bot | [
"f8292fa81701b897a359ef59f02f74910166f0bf"
] | [
"image/edit_2.py"
] | [
"# By @HYPER-MOD\nfrom PIL import Image, ImageEnhance, ImageDraw\nimport numpy as np\nimport os\nimport cv2\nimport shutil\n\n\nasync def circle_with_bg(client, message):\n try:\n userid = str(message.chat.id)\n if not os.path.isdir(f\"./DOWNLOADS/{userid}\"):\n os.makedirs(f\"./DOWNLOAD... | [
[
"numpy.dstack",
"numpy.array",
"numpy.uint8",
"numpy.float32"
]
] |
wangcj05/allopy | [
"0d97127e5132df1449283198143994b45fb11214"
] | [
"tests/regret/portfolio/test_portfolio_regret_optimizer.py"
] | [
"import numpy as np\nimport pytest\n\nfrom allopy import PortfolioRegretOptimizer, RegretOptimizer, get_option\nfrom .data import Test1, Test2, assets, scenarios\nfrom .funcs import cvar_fun, obj_max_returns\n\n\n@pytest.mark.parametrize(\"config\", [Test1, Test2])\ndef test_regret_optimizer(config, main_cubes, cva... | [
[
"numpy.alltrue",
"numpy.asarray"
]
] |
jali7001/LBH_to_E_flux | [
"ad51ea46f72855db805e28fa0ca0b227b43d2683",
"ad51ea46f72855db805e28fa0ca0b227b43d2683"
] | [
"LBH_to_eflux/helper_funcs.py",
"LBH_to_eflux/observations/ssusi.py"
] | [
"import sklearn.neighbors\nfrom numpy import linalg as LA\nfrom apexpy import Apex\nimport numpy as np\n\n#Create an Apex conversion instance at the usual reference altitude\n#no epoch is specified; we will set the epoch just-in-time when we are going to\n#do an coordinate transformation\napex_reference_height = 11... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.empty",
"numpy.nansum",
"numpy.abs",
"numpy.deg2rad",
"numpy.mod",
"numpy.floor"
],
[
"numpy.logical_or",
"numpy.deg2rad",
"numpy.ones_like",
"numpy.zeros",
"numpy.ones",
"numpy.tile",
"sklearn.linear_model.... |
coinflip112/stoch_models_release | [
"cc36587af8ff61f2dac38bbc5acd8f3ec2079ec8"
] | [
"brownian_stock_simulator.py"
] | [
"import numpy as np\nfrom plotly.subplots import make_subplots\nimport plotly.graph_objects as go\n\n\nclass BrownianStockSimulator:\n plot_title = \"Simulated White noise, Brownian Motion and Stock Price\"\n plotly_template = \"plotly_white\"\n plot_width = 1500\n plot_height = 1000\n\n def __init__... | [
[
"numpy.random.normal",
"numpy.random.seed",
"numpy.exp",
"numpy.arange",
"numpy.sqrt",
"numpy.append",
"numpy.cumsum"
]
] |
JitenDhandha/CFit | [
"7e3dac0ae16091ba1294e620ab3e787f5ec34202"
] | [
"Fitting.py"
] | [
"####################################################################################\r\n# Jiten Dhandha, 2020 #\r\n# CFit is a curve fitting tool in python, based on the method of least squares. #\r\n# It comes equipped with some standard functions an... | [
[
"scipy.special.gamma",
"numpy.genfromtxt",
"numpy.exp",
"numpy.sort",
"numpy.sin",
"numpy.log",
"scipy.stats.chi2.isf",
"numpy.polyval",
"numpy.polyfit",
"numpy.sqrt",
"numpy.empty_like",
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.figure",
"nump... |
DonnieKim411/triton-inference-server | [
"933e5afe1d40c4801186dabdc2ee613e4f0769c6"
] | [
"qa/L0_infer_variable/infer_variable_test.py"
] | [
"# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list... | [
[
"numpy.dtype"
]
] |
MinHyung-Kang/Thesis | [
"846c28ec1ca0ffd8acfa3f1f6dce88cd6acb76ed"
] | [
"python/bayesian_nn_subset.py"
] | [
"import theano.tensor as T\nimport theano\nimport numpy as np\nfrom scipy.spatial.distance import pdist, squareform, cdist\nimport random\nimport time\n\n'''\n Sample code to reproduce our results for the Bayesian neural network example.\n Our settings are almost the same as Hernandez-Lobato and Adams (ICML15... | [
[
"numpy.random.choice",
"numpy.median",
"numpy.set_printoptions",
"numpy.copy",
"numpy.tile",
"numpy.exp",
"numpy.mean",
"numpy.min",
"numpy.multiply",
"numpy.full",
"numpy.linalg.norm",
"numpy.log",
"numpy.save",
"numpy.arange",
"numpy.sqrt",
"numpy.... |
mehmetilker/spacy-stanfordnlp | [
"99d636fc19aa80f19ec111e8862b39323c038093"
] | [
"spacy_stanfordnlp/language.py"
] | [
"# coding: utf8\nfrom spacy.symbols import POS, TAG, DEP, LEMMA, HEAD\nfrom spacy.language import Language\nfrom spacy.tokens import Doc\nfrom spacy.util import get_lang_class\nimport numpy\nimport re\n\n\nclass StanfordNLPLanguage(Language):\n def __init__(self, snlp, meta=None, **kwargs):\n \"\"\"Initia... | [
[
"numpy.array"
]
] |
herjy/proxmin | [
"6dadff29e3e781986f4e38c56f40dbb31a58a428"
] | [
"proxmin/nmf.py"
] | [
"from __future__ import print_function, division\nimport logging\nimport numpy as np\nfrom . import operators\nfrom . import utils\nfrom . import algorithms\n\ndef delta_data(A, S, Y, W=1):\n return W*(A.dot(S) - Y)\n\ndef grad_likelihood_A(A, S, Y, W=1):\n D = delta_data(A, S, Y, W=W)\n return D.dot(S.T)\... | [
[
"numpy.sum",
"numpy.broadcast_to"
]
] |
gehilley/GlobalSteepness | [
"62a1a5b66adb230d5bbbc004aa5d2c5b618a2fdd"
] | [
"GlobalDataset/bin/steepness_cdf.py"
] | [
"import numpy as np\nimport dem as d\nfrom numpy.fft import fft2, ifft2, ifftshift\n\ndef calc_cdf(ks_grids, area_grids, vmax=400, R2_cutoff = 0.0, area_cutoff = 2E6, density_weighting_distance = False):\n \n ks_vals = np.array([])\n n_vals = np.array([])\n R2_vals = np.array([])\n density_vals = np.... | [
[
"numpy.concatenate",
"numpy.histogram",
"numpy.array",
"numpy.zeros_like",
"numpy.max",
"numpy.fft.fft2",
"numpy.isnan",
"numpy.where",
"numpy.arange",
"numpy.power",
"numpy.argsort",
"numpy.cumsum"
]
] |
alexFilin/keras-maskrcnn | [
"fa3d7f8e81d0ffb036fde5e134dcdbf35c206fc1"
] | [
"keras_maskrcnn/bin/debug.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless ... | [
[
"numpy.max"
]
] |
Mithilesh1609/assembled-cnn | [
"e0227eecbf3a7fd4fe99a954068c85ffbed94c53"
] | [
"official/utils/logs/hooks_helper.py"
] | [
"# This code is adapted from the https://github.com/tensorflow/models/tree/master/official/r1/resnet.\n# ==========================================================================================\n# NAVER’s modifications are Copyright 2020 NAVER corp. All rights reserved.\n# ========================================... | [
[
"tensorflow.train.ProfilerHook",
"tensorflow.train.LoggingTensorHook"
]
] |
dorranh/airflow | [
"1a9a2cadcf8606cfcb729d1323dd33dfacc64633"
] | [
"tests/providers/amazon/aws/operators/test_hive_to_dynamodb.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# 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... | [
[
"pandas.DataFrame"
]
] |
oustling/dicom_profile_fitting | [
"65b148acf9e2167e0d80c723bbbfd16a5dd64c4c",
"65b148acf9e2167e0d80c723bbbfd16a5dd64c4c"
] | [
"minimize/retic_xmm_2gauss/2minimize_4mv.py",
"minimize/halves_1gauss/minimize_15mv.py"
] | [
"#!\\usr\\bin\\python\n\nfrom numpy import array\nfrom scipy.special import erf \nfrom scipy.optimize import minimize \nfrom math import pi, sin, cos, exp, sqrt\n#import dicom\n\nline_array = [] ## global\n\ndef read_line (file_name ):\n with open( file_name ) as f:\n for line in f:\n line_arra... | [
[
"numpy.array",
"scipy.optimize.minimize"
],
[
"numpy.array",
"scipy.optimize.minimize"
]
] |
hr0nix/trackdays | [
"1889d4a6c003b14b4a07c414c95b09c4770e7c73"
] | [
"trackdays/training/utils.py"
] | [
"import imageio\n\nimport tensorflow as tf\nimport numpy as np\n\nfrom PIL import Image, ImageDraw, ImageFont\n\nfrom tf_agents.replay_buffers import tf_uniform_replay_buffer\nfrom tf_agents.drivers import dynamic_step_driver\nfrom tf_agents.environments import tf_py_environment\n\n\ndef load_policy(path):\n ret... | [
[
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.compat.v2.saved_model.load"
]
] |
Luisbaduy97/COVID-YUCATAN | [
"726ae071de0bc059a42136d9c99503bc4cdfd4b3"
] | [
"datos_yuc_actualizado.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Apr 24 14:52:03 2020\n\n@author: DELL\n\"\"\"\n\n\nimport pandas as pd\n\ndata = pd.read_csv('http://187.191.75.115/gobmx/salud/datos_abiertos/datos_abiertos_covid19.zip', encoding = 'ANSI')\n\n\nres = data[data['ENTIDAD_RES'] == 31]\n\nres.to_csv('data_yuc_actualiza... | [
[
"pandas.read_csv"
]
] |
qingfengwuhen/Paddle | [
"cff5e2c173afc4431085b9382c716be7a9b91759"
] | [
"python/paddle/fluid/executor.py"
] | [
"# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"numpy.array"
]
] |
SilviaZirino/rl-baselines-zoo | [
"27e64ca3166bf9804cc14b8752c71a6c719137b3"
] | [
"utils/record_video.py"
] | [
"import os\nimport argparse\n\nimport gym\nfrom gym import envs\nimport numpy as np\n\nfrom skimage import transform\nfrom stable_baselines.common.atari_wrappers import WarpFrame\n\nfrom stable_baselines.common.vec_env import VecVideoRecorder, VecFrameStack, VecNormalize\n\nfrom .utils import ALGOS, create_test_env... | [
[
"numpy.clip"
]
] |
likelyzhao/dino | [
"ad019889b0e4c103f0471d085f79bba42c817d1b"
] | [
"vision_transformer.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# \n# http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by ... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.functional.normalize",
"torch.nn.Identity",
"torch.zeros",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.linspace",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.GELU"
... |
tkortz/carla-car-detection | [
"37c00758e4396ec3cbca140722ba7cf4fd44c836"
] | [
"detection.py"
] | [
"import sys\r\nfrom pathlib import Path, PurePath\r\nsys.path.append(\"./models/research/object_detection/\")\r\nsys.path.append(\"./models/research/\")\r\n\r\nimport os\r\nimport cv2\r\nimport numpy as np\r\nimport tensorflow as tf\r\nfrom utils import label_map_util\r\nfrom utils import visualization_utils as vis... | [
[
"numpy.array",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.import_graph_def",
"tensorflow.GraphDef",
"tensorflow.gfile.GFile",
"numpy.squeeze",
"numpy.expand_dims"
]
] |
jemorrison/prospector | [
"c34b7dd64e55dfc66c8596ea87633a73a7088730"
] | [
"prospect/likelihood/kernels.py"
] | [
"import numpy as np\n\n__all__ = [\"Kernel\", \"Uncorrelated\", \"ExpSquared\", \"Matern\"]\n\n\nclass Kernel(object):\n\n def __init__(self, parnames=[], name=''):\n \"\"\"\n :param parnames:\n A list of names of the kernel params, used to alias the intrinsic\n parameter name... | [
[
"numpy.ones",
"numpy.exp",
"numpy.abs",
"numpy.sqrt",
"numpy.diag"
]
] |
YevheniiSemendiak/pytorch-tools | [
"11f895ac7af796ca786a3d94bb46de70d7fce87a"
] | [
"pytorch_tools/losses/angular.py"
] | [
"import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .base import Loss\n\n\nclass AdaCos(Loss):\n \"\"\"PyTorch implementation of AdaCos. See Ref[1] for paper\n\n This implementation is different from the most open-source implementations in following ways:\n 1) expects... | [
[
"torch.zeros",
"torch.cos",
"torch.nn.functional.normalize",
"torch.no_grad",
"torch.nn.init.xavier_uniform_",
"torch.zeros_like"
]
] |
zchuruk/sandwichbot | [
"45879fae289c68e3a6a649958aa338e4cc307f77"
] | [
"sandwichbot/survey_processor.py"
] | [
"import csv\nimport os\nimport numpy as np\n\ndir_path = os.path.dirname(os.path.realpath(__file__))\nsurvey_path = os.path.join(dir_path, '../data/test_two_entries.csv')\n\nNUM_QUESTIONS = 8\nRESPONSE_PERSON = ['pat', 'jeremy', 'zach']\nTASTE_PROFILE_TYPES = ['deliciousness', 'heaviness', 'reliability', 'frequency... | [
[
"numpy.array"
]
] |
kcetskcaz/detr_package | [
"0f5cad16c72ec37d7b596d37e12dc32cfb5ef6aa",
"0f5cad16c72ec37d7b596d37e12dc32cfb5ef6aa"
] | [
"detr/hubconf/hubconf.py",
"detr/models/detr.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport torch\n\nfrom detr.models.backbone import Backbone, Joiner\nfrom detr.models.detr import DETR, PostProcess\nfrom detr.models.position_encoding import PositionEmbeddingSine\nfrom detr.models.segmentation import DETRsegm, PostProcessPanop... | [
[
"torch.hub.load_state_dict_from_url"
],
[
"torch.nn.Linear",
"torch.device",
"torch.cat",
"torch.stack",
"torch.nn.functional.l1_loss",
"torch.no_grad",
"torch.ones",
"torch.full_like",
"torch.nn.Conv2d",
"torch.full",
"torch.distributed.all_reduce",
"torch.... |
yamaneco28/PaDiM-Anomaly-Detection-Localization-master | [
"79de8ee6472380a2a8f556f21f3b97720697fc97"
] | [
"main.py"
] | [
"import random\nfrom random import sample\nimport argparse\nimport numpy as np\nimport os\nimport pickle\nfrom tqdm import tqdm\nfrom collections import OrderedDict\nfrom sklearn.metrics import roc_auc_score\nfrom sklearn.metrics import roc_curve\nfrom sklearn.metrics import precision_recall_curve\nfrom sklearn.cov... | [
[
"torch.nn.functional.unfold",
"torch.cat",
"numpy.mean",
"torch.cuda.is_available",
"matplotlib.pyplot.colorbar",
"numpy.zeros_like",
"matplotlib.pyplot.subplots",
"torch.manual_seed",
"torch.tensor",
"torch.utils.data.DataLoader",
"numpy.argmax",
"torch.index_selec... |
thomps9012/noraML | [
"1a1a74cc9b2170ce2cab5a339dfd9b33116cd910"
] | [
"demographics.py"
] | [
"import pandas as pd\nimport pprint\n\n\nall_client_diagnoses = pd.read_csv('2021_encounters_with_diagnoses.csv')\nprint(all_client_diagnoses.columns)\nnora_clients = all_client_diagnoses.drop_duplicates('Pid').drop(columns=['Date Of Service', 'Encounter', 'Age', 'Service Code'])\n\nnora_gender = nora_clients[nora_... | [
[
"pandas.read_csv"
]
] |
Cambricon/catch | [
"2625da389f25a67066d20fb6b0c38250ef98f8ab"
] | [
"test/cnnl/op_test/test_type.py"
] | [
"from __future__ import print_function\n\nimport sys\nimport logging\nimport os\nos.environ['ENABLE_CNNL_TRYCATCH'] = 'OFF' # pylint: disable=C0413\nfrom itertools import product\nimport unittest\nimport torch\nimport torch_mlu.core.mlu_model as ct\n\ncur_dir = os.path.dirname(os.path.abspath(__file__))\nsys.path.a... | [
[
"torch.randint",
"torch.randn"
]
] |
philipp-leitl/aapy | [
"5e4688191f3eda60b86c84721db07d8dc2323968"
] | [
"tests/test_js.py"
] | [
"import json\nfrom datetime import datetime\n\nimport jsonschema\nimport mock\nimport numpy\nimport pytest\nimport utils\n\nfrom aa import js\n\nEARLY_DATE = datetime(2001, 1, 1, 1, 1)\nLATE_DATE = datetime(2010, 2, 3, 4, 5)\nEMPTY_ARRAY = numpy.array((0,))\n\n\n@pytest.fixture\ndef json_fetcher():\n return js.J... | [
[
"numpy.array"
]
] |
reverendbedford/scikit-fem | [
"bc57d968e56e6b89a99e35eac26ef7bc81b7a46a"
] | [
"skfem/io/meshio.py"
] | [
"\"\"\"Import/export any formats supported by meshio.\"\"\"\n\nimport meshio\nimport numpy as np\nimport skfem\n\n\nMESH_TYPE_MAPPING = {\n 'tetra': skfem.MeshTet1,\n 'tetra10': skfem.MeshTet2,\n 'hexahedron': skfem.MeshHex1,\n 'hexahedron27': skfem.MeshHex2,\n 'wedge': skfem.MeshWedge1,\n 'triang... | [
[
"numpy.ascontiguousarray",
"numpy.sort",
"numpy.unique",
"numpy.nonzero"
]
] |
yudongcao/OpenFermion | [
"6d3e81f0ea382c69d6e5b376afd0e8f88df8b2fa"
] | [
"src/openfermion/transforms/_jordan_wigner_test.py"
] | [
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software... | [
[
"numpy.zeros"
]
] |
timryanb/mphys | [
"74560a163034a0006a17811ba1206bab00f1f775"
] | [
"mphys/integrated_forces.py"
] | [
"import numpy as np\nimport openmdao.api as om\n\nclass IntegratedSurfaceForces(om.ExplicitComponent):\n def setup(self):\n self.add_input('aoa',desc = 'angle of attack', units='rad',tags=['mphys_input'])\n self.add_input('yaw',desc = 'yaw angle',units='rad',tags=['mphys_input'])\n self.add_... | [
[
"numpy.sin",
"numpy.dot",
"numpy.random.rand",
"numpy.zeros",
"numpy.sum",
"numpy.cos"
]
] |
adityamanglik/Algorithm-Implementations | [
"780911ff05c1956ee005729fc8d5c916c5506838"
] | [
"Machine Learning/Sklearn Implementations/Reinforcement Learning/Upper_Confidence_Bound.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Mar 27 17:18:43 2020\n\n@author: admangli\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport math\n\ndataset = pd.read_csv('Ads_CTR_Optimisation.csv').values\n\n#%%\n\nslot_machines = 10\n\n#%% Random a... | [
[
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
Gravifer/pylabyk | [
"91922907c5ecaa832bdc6ee6cb285095905f4cac"
] | [
"demo/demo_min_max_distrib.py"
] | [
"# Copyright (c) 2020. Yul HR Kang. hk2699 at caa dot columbia dot edu.\n\nimport torch\nimport matplotlib.pyplot as plt\nfrom lib.pylabyk import numpytorch as npt\nfrom lib.pylabyk.numpytorch import npy, npys\n\n\ndef print_demo(p, fun):\n\n out = fun(p)\n\n print('-----')\n print('fun: %s' % fun.__name_... | [
[
"torch.tensor"
]
] |
ActuarialIntelligence/Base | [
"ede66e263960d1784c0dea1131706472fc33eaf3"
] | [
"src/ActuarialIntelligence.Infrastructure.PythonScripts/StreamFootageAnalyse.py"
] | [
"from keras.preprocessing.image import img_to_array\nimport imutils\nimport cv2\nfrom keras.models import load_model\nimport numpy as np\nimport geocoder\nimport streamlink\n#import mysql.connector as con\n\n#mydb = con.connect(\n# host=\"localhost\",\n# user=\"yourusername\",\n# passwd=\"yourpassword\",\n# data... | [
[
"numpy.expand_dims",
"numpy.max",
"numpy.zeros"
]
] |
tecklun/eeg-notebooks | [
"6026d8e03234523f1929e4893b746411e496068e"
] | [
"eegnb/experiments/auditory_ssaep/ssaep.py"
] | [
"\"\"\"\nGenerate Steady-State Auditory Evoked Potential (SSAEP)\n=======================================================\n\nSteady-State Auditory Evoked Potential (SSAEP) - also known as Auditory\nSteady-State Response (ASSR) - stimulus presentation.\n\n\"\"\"\n\n\nfrom time import time\n\nimport numpy as np\nfrom... | [
[
"numpy.max",
"numpy.ceil",
"numpy.random.binomial",
"numpy.random.rand",
"numpy.sin",
"numpy.zeros",
"numpy.random.seed",
"numpy.tile",
"numpy.random.randn",
"numpy.float32",
"numpy.arange"
]
] |
giuseppefutia/word2vec | [
"c8a26537fe6ac0bb9b0fe979696d1457d2bc4092"
] | [
"utils/init_parameters.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\n\n\ndef initialize_hyper_parameters(layer_acts, learning_rate):\n \"\"\"\n Initialize parameters for different levels of the network\n\n Arguments:\n layer_acts -- python array (list) containing the activation functions of each layer in the network\n lear... | [
[
"numpy.array",
"numpy.zeros",
"numpy.random.seed",
"numpy.random.randn",
"numpy.allclose"
]
] |
kavanase/aiida-vasp | [
"f9edc032fb0845622c5b0bbe7e1a5bf51205dae5"
] | [
"aiida_vasp/utils/aiida_utils.py"
] | [
"\"\"\"\nUtils for AiiDA.\n\n----------------\nUtilities for making working against AiiDA a bit easier. Mostly here due to\nhistorical reasons when AiiDA was rapidly developed. In the future most routines\nthat have now standardized in AiiDA will be removed.\n\"\"\"\n# pylint: disable=import-outside-toplevel\nimpor... | [
[
"numpy.array",
"numpy.asarray"
]
] |
ChaseMonsterAway/vedacls | [
"91657f688dcaf3f9f4c58eb40a8f5c8f34a4bd73",
"91657f688dcaf3f9f4c58eb40a8f5c8f34a4bd73"
] | [
"vedacls/models/builder.py",
"vedacls/metrics/accuracy.py"
] | [
"import logging\nimport torch.nn as nn\n\nfrom . import arch as archs\n\nlogger = logging.getLogger()\n\n\ndef build_model(cfg_model):\n if cfg_model.get('pretrained', False):\n info = \"=> building pre-trained model {}\".format(cfg_model['arch'])\n model = archs.__dict__[cfg_model.arch](pretrained... | [
[
"torch.nn.Linear"
],
[
"numpy.sum",
"numpy.argsort"
]
] |
opticverge/scikit-evolution | [
"fdd69468c0aacfba4c1ff82a6619f20abfd5f77b"
] | [
"opticverge/examples/machine_learning/regression/red_wine_quality/problem.py"
] | [
"from typing import Any, Dict\n\nimport pandas\nimport numpy as np\nfrom sklearn import datasets\n\nfrom opticverge.core.chromosome.abstract_chromosome import AbstractChromosome\nfrom opticverge.core.enum.objective import Objective\nfrom opticverge.core.log.logger import data_logger, DATA\nfrom opticverge.core.solv... | [
[
"numpy.array",
"pandas.read_csv"
]
] |
ficusoftdeveloper/bluedome | [
"3dc04fd749bee22b4f5eb94db85a5c15d7ef8ea0"
] | [
"scripts/image/crack_detection_fast.py"
] | [
"from __future__ import (absolute_import, division,print_function, unicode_literals)\r\nfrom builtins import *\r\nimport numpy as np\r\nimport cv2\r\nimport SimpleITK as sitk\r\nfrom builtins import *\r\nfrom scipy.spatial import distance\r\nimport sys\r\nimport time\r\n############### FUNCTIONS ##################... | [
[
"numpy.max",
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.squeeze",
"numpy.minimum",
"numpy.copy",
"numpy.min",
"numpy.mean",
"numpy.shape",
"numpy.where",
"numpy.arctan",
"numpy.linalg.eig",
"numpy.transpose",
"numpy.loadtxt",
"scipy.spatia... |
rddunphy/pyHSI | [
"b55c2a49568e04e0a2fb39da01cfe1f129bc86a4"
] | [
"test/test_cameras.py"
] | [
"from datetime import datetime\nimport unittest\nfrom unittest.mock import MagicMock\n\nimport numpy as np\n\nfrom pyhsi.cameras import BaslerCamera\n\n\nclass MockGrab:\n def __init__(self, data):\n self.Array = data\n\n def GrabSucceeded(self):\n return True\n\n def Release(self):\n ... | [
[
"numpy.array",
"numpy.testing.assert_array_equal"
]
] |
bchaselab/Toxopy | [
"30fc03b0dc8e83916b1550a29f14fc899c22d068"
] | [
"toxopy/dlcboxplot.py"
] | [
"\"\"\"\nToxopy (https://github.com/bchaselab/Toxopy)\n© M. Alyetama, University of Nebraska at Omaha\nLicensed under the terms of the MIT license\n\"\"\"\n\nfrom toxopy import fwarnings, trials\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\ndef dlcboxplot(file,\n va... | [
[
"matplotlib.pyplot.text",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.vlines",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
BOURSa/mmdetection3d | [
"27d0001e873b3102a828a27e1372873fcf81ed7e"
] | [
"mmdet3d/models/model_utils/vote_module.py"
] | [
"import torch\nfrom mmcv.cnn import ConvModule\nfrom torch import nn as nn\n\nfrom mmdet3d.models.builder import build_loss\n\n\nclass VoteModule(nn.Module):\n \"\"\"Vote module.\n\n Generate votes from seed point features.\n\n Args:\n in_channels (int): Number of channels of seed point features.\n ... | [
[
"torch.min",
"torch.gather",
"torch.nn.Sequential",
"torch.norm",
"torch.nn.Conv1d",
"torch.sum"
]
] |
oldshuren/Hierarchical-Localization | [
"334327956138c98af209e5ae9e13a0e222e97c2c"
] | [
"hloc/extract_features.py"
] | [
"import argparse\nimport torch\nfrom pathlib import Path\nimport h5py\nimport logging\nfrom types import SimpleNamespace\nimport cv2\nimport numpy as np\nfrom tqdm import tqdm\nimport pprint\n\nfrom . import extractors\nfrom .utils.base_model import dynamic_load\nfrom .utils.tools import map_tensor\n\n\n'''\nA set ... | [
[
"numpy.array",
"torch.no_grad",
"torch.cuda.is_available",
"torch.utils.data.DataLoader"
]
] |
tonino102008/openfast | [
"cfb401af163f4e0b6bb8588c23374e1534ad8d87"
] | [
"ExampleCases/OpFAST_WF1x1/globalDISCON.py"
] | [
"import numpy\n\nGenSpeedF = 0\nIntSpdErr = 0 \nLastGenTrq = 0 \nLastTime = 0 \nLastTimePC = 0 \nLastTimeVS = 0 \nPitCom = numpy.zeros(3)\nVS_Slope15 = 0 ... | [
[
"numpy.zeros"
]
] |
SharanRajani/SoundQX | [
"22b3fcfab394c0c7ce0819c634d666ca25dc7b54"
] | [
"test_gen_spec.py"
] | [
"from keras.models import Sequential, load_model\nfrom keras.layers.core import Dense, Dropout, Activation,Flatten\nfrom keras.layers.recurrent import LSTM, GRU, SimpleRNN\nfrom keras.layers.convolutional import Convolution2D, Convolution1D, MaxPooling2D, MaxPooling1D, AveragePooling2D\nfrom keras.layers.normalizat... | [
[
"numpy.empty",
"numpy.angle",
"numpy.reshape",
"numpy.mean",
"numpy.multiply",
"numpy.std",
"numpy.sqrt",
"numpy.int16"
]
] |
shirtsgroup/LLC_Membranes | [
"e94694f298909352d7e9d912625314a1e46aa5b6",
"e94694f298909352d7e9d912625314a1e46aa5b6",
"e94694f298909352d7e9d912625314a1e46aa5b6"
] | [
"Ben_Manuscripts/stochastic_transport/figures/pore_water_tcl.py",
"Ben_Manuscripts/transport/figures/totals.py",
"Ben_Manuscripts/transport/figures/tailvpore_hbonding.py"
] | [
"#!/usr/bin/env python\n\nimport mdtraj as md\nimport numpy as np\n\nfrom LLC_Membranes.llclib import physical, topology\n\nr = 1\n\nt = md.load('initial.gro')\nkeep = [a.index for a in t.topology.atoms if a.residue.name == 'HOH']\nres_start = keep[0]\n\n\ncom = physical.center_of_mass(t.xyz[:, keep, :], [18., 1., ... | [
[
"numpy.where"
],
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.show"
],
[
"numpy.sum",
"numpy.array",
"numpy.mean",
... |
ddayzzz/federated | [
"283ea72f555da78ff4b084c1d94731ef8f16b363",
"283ea72f555da78ff4b084c1d94731ef8f16b363"
] | [
"tensorflow_federated/python/core/impl/executors/eager_tf_executor.py",
"tensorflow_federated/python/research/adaptive_lr_decay/run_federated_stackoverflow.py"
] | [
"# Copyright 2019, The TensorFlow Federated 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 a... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.raw_ops.DestroyResourceOp",
"tensorflow.compat.v1.wrap_function",
"tensorflow.data.experimental.from_variant",
"tensorflow.nest.map_structure",
"tensorflow.executing_eagerly",
"tensorflow.device",
"tensorflow.is_tensor"
],
[
"tens... |
rcm2dev/circular_buffer_numpy | [
"25cf7567f93f866bc9456d250a4f132e3335c068"
] | [
"circular_buffer_numpy/tests/test_circular_buffer.py"
] | [
"#!/bin/env python\r\n# -*- coding: utf-8 -*-\r\n\"\"\"test Queue\r\n by Valentyn Stadnytskyi\r\n created: August 2, 2019\r\n\r\n This is a test library to evaluate the performance of the code.\r\n Queue is an abstract data structure, somewhat similar to Stacks.\r\n Unlike stacks, a queue is open at ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.random.randint"
]
] |
na018/DeepLearning | [
"f9f44bdf9afe7fa211a0899407534faf309bc0e6"
] | [
"00_MNIST-label/train.py"
] | [
"import argparse\nimport tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data\n\nfrom net.tf_net import \\\n calculate_accuracy, calculate_loss, \\\n create_simple_cnn_model, optimize_weights\nfrom net.keras_net import simple_cnn\n\n\ndef train_keras(batch_size, epochs, n_classes):\n ... | [
[
"tensorflow.keras.utils.to_categorical",
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.Session",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.placeholder",
"tensorflow.summary.merge_all",
"tensorflow.summary.FileWriter",
"tensorflow.global... |
cbschaff/nlimb | [
"f0564b00bab1b3367aaa88163e49bebc88f349bb"
] | [
"rl/algorithms/core.py"
] | [
"from deeplearning import logger, tf_util as U\nimport tensorflow as tf\nfrom rl.runner import Runner\nfrom rl.vec_env.subproc_vec_env import SubprocVecEnv\nfrom collections import namedtuple\nimport os, time\n\nclass RLExperiment(U.Experiment):\n def load_env_fn(self):\n fname = os.path.join(self.logdir,... | [
[
"tensorflow.get_default_session"
]
] |
GIS-PuppetMaster/TENSILE | [
"e19f973bb30fba69a23644389c82a4471ee5a241"
] | [
"pycode/tinyflow/Scheduler.py"
] | [
"import copy\nfrom enum import Enum\nimport multiprocessing\nimport numpy as np\nfrom functools import cmp_to_key\nimport plotly as py\nimport plotly.figure_factory as ff\nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots\nimport plotly\nfrom collections import defaultdict\nimport os\nfro... | [
[
"numpy.arange"
]
] |
gstoica27/tacred-exploration | [
"49ab2ebf54d38173ce08db372c0f940c34e1954f"
] | [
"ensemble.py"
] | [
"\"\"\"\nEnsemble the predictions from different model outputs.\n\"\"\"\nimport argparse\nimport json\nimport pickle\nimport numpy as np\nfrom collections import Counter\n\nfrom data.loader import DataLoader\nfrom utils import scorer, constant\n\ndef parse_args():\n parser = argparse.ArgumentParser()\n parser... | [
[
"numpy.array",
"numpy.argmax"
]
] |
GlobalFishingWatch/pipe-segment | [
"4992719d9244901baed7c5db88f434cb87ebb179"
] | [
"pipe_segment/stats/stats.py"
] | [
"import pandas as pd\nimport numpy as np\nimport itertools as it\nfrom collections import defaultdict\nfrom collections import Counter\nfrom six.moves import map as imap\n\n\ndef dict_subset(d, fields):\n # return a subset of the provided dict containing only the\n # fields specified in fields\n return {k:... | [
[
"pandas.DataFrame",
"numpy.nanmax",
"numpy.nanmin",
"numpy.isnan"
]
] |
Victorwz/Generative-Hippocampal-entorhinal-System | [
"5f38b0fea364c1974ebaf25f16576777a35295e3"
] | [
"generate.py"
] | [
"import os\nimport sys\nimport numpy as np\nimport torch\nimport pickle \n\nimport logging\nlog = logging.getLogger(__name__)\nlogging.basicConfig(\n format=\"%(asctime)s - %(levelname)s - %(name)s - %(message)s\",\n datefmt=\"%m/%d/%Y %H:%M:%S\",\n level=logging.INFO\n)\n\n\nclass Graph4D():\n\n def __... | [
[
"numpy.arange",
"numpy.random.randint",
"numpy.zeros"
]
] |
runauto/nni | [
"30152b04c4739f5b4f95087dee5f1e66ee893078"
] | [
"src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\n\"\"\"\nA family of functions used by CurvefittingAssessor\n\"\"\"\n\nimport numpy as np\n\nall_models = {}\nmodel_para = {}\nmodel_para_num = {}\n\ncurve_combination_models = ['vap', 'pow3', 'linear', 'logx_linear', 'dr_hill_zero_backgro... | [
[
"numpy.exp",
"numpy.log"
]
] |
jkcso/oss2021 | [
"f5c2dc76670027ec4d508b46a81345ce711ae5e8"
] | [
"notebooks/api/oss_hugo/OSS_Schedule.py"
] | [
"import pandas as pd\nfrom oss_hugo.API_Hugo_OSS import API_Hugo_OSS\n\nclass OSS_Schedule:\n def __init__(self):\n self.hugo = API_Hugo_OSS()\n\n def sessions_mapped_by_size(self):\n\n mapping = []\n for path, session in self.hugo.sessions().items():\n content = session.get... | [
[
"pandas.DataFrame"
]
] |
ZeyuSun/flare-prediction-smarp | [
"ad60163eb83b47ba39e898beb387031d349e2ed6",
"ad60163eb83b47ba39e898beb387031d349e2ed6"
] | [
"arnet/modeling/learner.py",
"arnet/fusion.py"
] | [
"import os\nimport logging\nfrom typing import Dict, Union\nfrom datetime import timedelta\n\nimport numpy as np\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport mlflow\nimport torch\nimport pytorch_lightning as pl\nimport pprint\npp = pprint.PrettyPrinter(inde... | [
[
"matplotlib.use",
"torch.cat",
"torch.stack",
"torch.isnan",
"torch.tensor"
],
[
"numpy.random.choice",
"sklearn.model_selection.GroupShuffleSplit",
"numpy.random.seed",
"sklearn.model_selection.GroupKFold",
"numpy.load",
"numpy.where",
"numpy.sort",
"pandas... |
DESIR-CodeSprint/trackA-kickoff | [
"929e23b41a278236caf59db7b9a8f3295b3a09e8"
] | [
"TrackA_python/codesprintapp/views.py"
] | [
"from flask import Flask\nfrom flask import request, session, render_template, json, Response, jsonify, make_response, send_file, redirect, url_for\nimport requests\nimport xml.etree.ElementTree as ET\nimport lxml\nimport pandas as pd\nimport re\n\napp = Flask(__name__)\n\n@app.route('/')\n\ndef index():\n\treturn ... | [
[
"pandas.DataFrame",
"pandas.set_option"
]
] |
dayunliu/SMALF | [
"34dc80d338a1f5990a41f4d5041d1a2edcbeeef5"
] | [
"code/get_data.py"
] | [
"# -*- coding: utf-8 -*-\r\nimport xlrd\r\nimport pandas as pd\r\nimport numpy as np\r\n\r\nmirna_sim_path = '../data/miRNA_sim.xlsx'\r\ndisease_sim_path = '../data/disease_sim.xlsx'\r\nmirna_disease_ass_path = '../data/miRNA_disease.csv'\r\nmirna_data_dict_path = \"../data/mirna_data_dict.npy\"\r\ndisease_data_dic... | [
[
"numpy.load"
]
] |
Suyi32/George-private | [
"1a7b3a20da309318dc0b5415547fa6a5f6c331d3"
] | [
"testbed/SubScheduler.py"
] | [
"import numpy as np\nfrom testbed.cluster_env import LraClusterEnv\nfrom testbed.PolicyGradient_CPO import PolicyGradient\n\n\nparams = {\n # 'path': \"Dynamic_large_100\",\n # 'path': \"Dynamic_large_100_limit10\",\n # 'number of containers': 81,\n 'learning rate': 0.015,\n 'node... | [
[
"numpy.array",
"numpy.empty",
"numpy.zeros",
"numpy.where",
"numpy.append"
]
] |
drdavis/humba | [
"20131ed9bc4bd0ab0af8e0da2940992221c64575"
] | [
"humba/core.py"
] | [
"\"\"\"\nmodule housing core library functionality\n\"\"\"\n\nimport numpy as np\nfrom typing import Optional, Tuple\n\nimport humba.jits as jits\n\n\ndef histogram(\n x: np.ndarray,\n bins: int = 10,\n range: Tuple[float, float] = (0, 10),\n weights: Optional[np.ndarray] = None,\n flow: bool = False... | [
[
"numpy.linspace"
]
] |
jacobhepkema/scover | [
"de3c81b61ab7fcf7bed74571ce5ac1246e6b58b7"
] | [
"bin/scover_utils.py"
] | [
"def onehot_encode_seq(sequence, m=0, padding=False):\n \"\"\"Converts a given IUPAC DNA sequence to a one-hot \n encoded DNA sequence. \n \"\"\"\n import numpy as np\n import torch\n \n valid_keys = ['a','c','g','t','u','n','r','y','s','w','k','m']\n \n nucs = {'a':0,'c':1,'g':2,'t':3,'u... | [
[
"numpy.concatenate",
"numpy.nan_to_num",
"pandas.DataFrame",
"torch.no_grad",
"numpy.sum",
"numpy.tile",
"numpy.stack",
"numpy.argmax",
"numpy.amax"
]
] |
Kappers/oscirhythm | [
"3114d5fb7a65c256959d594abd48b7574f82f01f"
] | [
"model/sin_example_gfnn.py"
] | [
"'''\nTest script for GrFNN, plotting the entrainment for a sin wave of changing frequency.\n\n@author T. Kaplan\n'''\nimport numpy as np\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport time\n\nfrom gfnn import FrequencyType, FrequencyDist, ZParams, GrFNN\nfrom plot import spect... | [
[
"matplotlib.use",
"numpy.concatenate",
"numpy.sin",
"numpy.zeros",
"matplotlib.pyplot.plot",
"numpy.arange",
"matplotlib.pyplot.pause",
"numpy.abs",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca"
]
] |
flarco/n1slutil | [
"2c9f23c2240b4d94507ae799b417060688293979"
] | [
"xutil/database/base.py"
] | [
"# Database Lib\n\"\"\"\nOracle\nPostGresSQL\nSQLite\nSQLServer\nHive\nSpark\n\"\"\"\nimport os, datetime, pandas, time, re\nfrom collections import namedtuple, OrderedDict\n\nimport jmespath\nimport sqlalchemy\nfrom multiprocessing import Queue, Process\n\nfrom xutil.helpers import (\n log,\n elog,\n slog,\n g... | [
[
"pandas.DataFrame"
]
] |
galal-hussein/opni | [
"019cd5f1a5d43bf28bfedc9d7dc4b04dca0a4c82"
] | [
"src/payload-receiver-service/app/main.py"
] | [
"# Standard Library\nimport asyncio\nimport logging\nimport math\n\n# Third Party\nimport numpy as np\nimport pandas as pd\nfrom fastapi import FastAPI, HTTPException, Request\nfrom nats.aio.client import Client as NATS\nfrom nats_wrapper import NatsWrapper\n\napp = FastAPI()\nlogging.basicConfig(level=logging.INFO... | [
[
"pandas.to_datetime",
"numpy.array_split",
"pandas.json_normalize"
]
] |
TonyBagnall/sktime | [
"837a77026be3e53511c3d6139ddad14a39351bf5"
] | [
"sktime/utils/load_data.py"
] | [
"import pandas as pd\nimport numpy as np\n\n\ndef load_from_tsfile_to_dataframe(full_file_path_and_name, replace_missing_vals_with='NaN'):\n data_started = False\n instance_list = []\n class_val_list = []\n\n has_time_stamps = False\n has_class_labels = False\n\n uses_tuples = False\n\n is_firs... | [
[
"pandas.DataFrame",
"numpy.asarray",
"pandas.Series"
]
] |
wgova/automations | [
"2406d7bb7cc805ca4b48043995a457f5d65633f6"
] | [
"clust_indices.py"
] | [
"# coding: utf-8\n\nimport warnings\nimport numpy as np\nimport pandas as pd\nfrom packaging import version\nfrom sklearn.metrics import pairwise_distances_chunked\nfrom sklearn.utils import check_X_y,check_random_state\nfrom sklearn.preprocessing import LabelEncoder\nimport functools\nfrom pyclustering.cluster.cla... | [
[
"numpy.bincount",
"numpy.concatenate",
"sklearn.preprocessing.LabelEncoder",
"numpy.fill_diagonal",
"pandas.DataFrame",
"numpy.mean",
"numpy.diagonal",
"sklearn.metrics.pairwise_distances",
"sklearn.metrics.silhouette_score",
"sklearn.metrics.calinski_harabasz_score",
"... |
gucci-j/pytorch-imdb-cv | [
"a397716b02eafdba892907fe8800656cbb2afaca"
] | [
"src/metrics.py"
] | [
"import torch\n\ndef binary_accuracy(preds, y):\n\n rounded_preds = torch.round(torch.sigmoid(preds))\n correct = (rounded_preds == y).float()\n acc = correct.sum() / len(correct)\n\n return acc"
] | [
[
"torch.sigmoid"
]
] |
WuShaogui/DeepLabV3Plus-Pytorch | [
"8d75215041937269f4e13a80bf4b87fb7b29d570"
] | [
"test.py"
] | [
"import network\nimport torch\n\nif __name__ == '__main__':\n net = network.modeling.__dict__['deeplabv3plus_resnet50']()\n print(net)\n \n input=torch.FloatTensor(2,3,512,512)\n output=net(input)\n print(output.shape)"
] | [
[
"torch.FloatTensor"
]
] |
aguirrejuan/ConvRFF | [
"fc3afecc655ddad46fb4f81dd81a76fd5f36a122"
] | [
"convRFF/utils/utils.py"
] | [
"import tensorflow as tf \nfrom tensorflow.keras.callbacks import ModelCheckpoint\n\nimport os \n\n\nclass TensorBoardFix(tf.keras.callbacks.TensorBoard):\n \"\"\"\n This fixes incorrect step values when using the TensorBoard callback with custom summary ops\n https://stackoverflow.com/questions/64642944/s... | [
[
"tensorflow.summary.experimental.set_step"
]
] |
LisanneWiengarten/Punctuation | [
"a633258305a84ca4cffa165e185d8f9920eab6e2"
] | [
"utilities.py"
] | [
"# coding: utf-8\nimport numpy as np\nimport csv\nimport codecs\nimport os\nimport glob\nfrom collections import defaultdict\n\nSPACE = \" \"\nEMPTY = \" \"\nINV_PUNCTUATION_CODES = {EMPTY:0, SPACE:0, ',':1, '.':2, '?':3, '!':4, '-':5, ';':6, ':':7, '...':8, '':0}\nPUNCTUATION_VOCABULARY = {0:SPACE, 1:',', 2:'.', 3... | [
[
"numpy.array",
"numpy.arange"
]
] |
TobiasKovats/rainbowm4 | [
"22e8eb5bc8470b3b49cb570621b2a15e750fb8e3"
] | [
"run_all_stack.py"
] | [
"#!/usr/bin/env python3\nimport os\nimport subprocess\nimport sys\nimport serial\nimport numpy as np\nimport datetime\n\niterations = 1\n\ndef run(scheme, precomp_bitslicing, use_hardware_crypto):\n os.system(\"make clean\")\n path = f\"crypto_sign/{scheme}/m4\"\n binary = f\"crypto_sign_{scheme}_m4_stack.bin\"\... | [
[
"numpy.median",
"numpy.std",
"numpy.var"
]
] |
pfnet/gym-env-mujoco150 | [
"32f9115279a507143aefa5786578a7a2325e7993"
] | [
"gym_env_mujoco150/walker2d.py"
] | [
"import numpy as np\nfrom gym import utils\nfrom gym_env_mujoco150 import mujoco_env\nimport mujoco_py\n\nclass Walker2dEnv(mujoco_env.MujocoEnv, utils.EzPickle):\n\n def __init__(self):\n mujoco_env.MujocoEnv.__init__(self, \"walker2d_150.xml\", 4)\n utils.EzPickle.__init__(self)\n\n def _step(... | [
[
"numpy.square",
"numpy.clip"
]
] |
gbrammer/dust_attenuation | [
"15144c55d594ea06c4790215f7e0e66b03fd8255"
] | [
"dust_attenuation/radiative_transfer.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport astropy.units as u\nimport pkg_resources\n\nfrom astropy.io import ascii\nfrom astropy.modeling.tabular import tabular_model\n\nfrom .baseclasses import BaseAtttauVModel\nfrom .helpers import _test_valid_x_range\n\n\n__all__ = [\"WG00\"]\n\nx_range_WG00 = [0.1,... | [
[
"numpy.array",
"numpy.ones",
"numpy.atleast_1d"
]
] |
ioanaif/awkward-1.0 | [
"22501ba218646dc24dc515c4394eb22f126d340d"
] | [
"src/awkward/_connect/_numpy.py"
] | [
"# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE\n\nfrom __future__ import absolute_import\n\nimport sys\n\nimport numpy\n\nimport awkward as ak\n\n\ndef convert_to_array(layout, args, kwargs):\n out = ak.operations.convert.to_numpy(layout, allow_missing=False)\n if arg... | [
[
"numpy.array",
"numpy.empty",
"numpy.asarray",
"numpy.zeros"
]
] |
hbutsuak95/iv_rl | [
"0f72a8f077a238237027ea96b7d1160c35ac9959",
"0f72a8f077a238237027ea96b7d1160c35ac9959",
"0f72a8f077a238237027ea96b7d1160c35ac9959",
"0f72a8f077a238237027ea96b7d1160c35ac9959"
] | [
"mbbl_envs/mbbl/env/gym_env/box2d/walker.py",
"mbbl_envs/mbbl/util/il/camera_pose_ID_solver.py",
"bsuite/models/qnet_EP.py",
"bsuite/bsuite/experiments/bandit_scale/bandit_scale_test.py"
] | [
"import sys, math\nimport numpy as np\n\nimport Box2D\nfrom Box2D.b2 import (edgeShape, circleShape, fixtureDef, polygonShape, revoluteJointDef, contactListener)\n\nimport gym\nfrom gym import spaces\nfrom gym.utils import colorize, seeding\n\n# This is simple 4-joints walker robot environment.\n#\n# There are two ... | [
[
"numpy.sign",
"numpy.array",
"numpy.abs",
"numpy.clip"
],
[
"numpy.square",
"numpy.array",
"numpy.linalg.norm",
"numpy.reshape",
"numpy.zeros",
"numpy.tile",
"numpy.mean",
"numpy.arange",
"numpy.transpose",
"numpy.abs",
"scipy.optimize.minimize",
... |
gioelelm/scanpy | [
"97391a0e7908b9644b2d6640c8e26d37bdc7811e"
] | [
"scanpy/tools/rank_genes_groups.py"
] | [
"# Author: F. Alex Wolf (http://falexwolf.de)\n\"\"\"Differential Gene Expression Analysis\n\nThis is a Beta Version of a tool for differential gene expression testing\nbetween sets detected in previous tools. Tools such as dpt, cluster,...\n\"\"\"\n\nimport numpy as np\nfrom scipy.sparse import issparse\nfrom .. i... | [
[
"scipy.sparse.issparse",
"numpy.isnan",
"numpy.empty",
"numpy.zeros",
"numpy.where",
"numpy.arange",
"numpy.abs",
"numpy.sqrt",
"numpy.argpartition",
"numpy.argsort",
"numpy.rec.fromarrays",
"numpy.flatnonzero"
]
] |
HealthML/FaST-LMM | [
"3c502ce1c693a934b5f2ff7b63a9577e892cb716",
"3c502ce1c693a934b5f2ff7b63a9577e892cb716"
] | [
"fastlmm/inference/linear_regression.py",
"fastlmm/association/LeaveOneChromosomeOut.py"
] | [
"import numpy as np\r\nimport logging\r\nimport unittest\r\nimport os\r\nimport scipy.linalg as LA\r\nimport time\r\nfrom sklearn.utils import safe_sqr, check_array\r\nfrom scipy import stats\r\n\r\nfrom pysnptools.snpreader import Bed,Pheno\r\nfrom pysnptools.snpreader import SnpData,SnpReader\r\nfrom pysnptools.k... | [
[
"numpy.array",
"numpy.dot",
"numpy.array_equal",
"numpy.zeros",
"numpy.linalg.pinv",
"numpy.ones",
"numpy.eye",
"numpy.testing.assert_array_almost_equal",
"numpy.linalg.lstsq",
"sklearn.feature_selection.f_regression",
"sklearn.utils.safe_sqr",
"sklearn.utils.check_... |
wofeicaoge/manim | [
"50b2a6ff31e3c467d086145bcb3684b75c24137d"
] | [
"from_3b1b/old/eoc/chapter8.py"
] | [
"import scipy\nfrom manimlib.imports import *\nfrom from_3b1b.old.eoc.chapter1 import Thumbnail as Chapter1Thumbnail\nfrom from_3b1b.old.eoc.chapter2 import Car, MoveCar, ShowSpeedometer, \\\n IncrementNumber, GraphCarTrajectory, SecantLineToTangentLine, \\\n VELOCITY_COLOR, TIME_COLOR, DISTANCE_COLOR\n\ndef ... | [
[
"scipy.integrate.quad"
]
] |
RoseauTechnologies/pandas | [
"e727a561aee529e9e6ce9494c05685f157ed1073"
] | [
"pandas/core/window/ewm.py"
] | [
"from __future__ import annotations\n\nimport datetime\nfrom functools import partial\nfrom textwrap import dedent\nfrom typing import TYPE_CHECKING\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs.tslibs import Timedelta\nimport pandas._libs.window.aggregations as window_aggregations\nfrom pandas._typin... | [
[
"pandas._libs.window.aggregations.ewmcov",
"pandas.core.window.numba_.generate_ewma_numba_table_func",
"pandas.util._exceptions.find_stack_level",
"pandas.core.window.online.generate_online_numba_ewma_func",
"pandas._libs.tslibs.Timedelta",
"pandas.core.dtypes.common.is_datetime64_ns_dtype... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.