repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Emporiusm/webscraping-honkai3rd-zh-CN | [
"d525e96434c65be6778b66dbea2c6fcafe527cd3"
] | [
"Ver 2.0/VStats.py"
] | [
"# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\nfrom bs4 import BeautifulSoup\nimport re\nimport pandas as pd\nimport urllib.request\nfrom urllib.request import urlopen\nimport sys\nimport pickle\nimport openpyxl\nimport os\n\n\n# %%\npages = range(100)\nurl_part... | [
[
"pandas.read_pickle",
"pandas.DataFrame"
]
] |
LCX666/Spoon | [
"4b85357f6891c3272728972cdca57c260879b181"
] | [
"method/sssp/dijkstra_gpu.py"
] | [
"from time import time\r\nimport numpy as np\r\nfrom math import sqrt\r\n\r\nfrom utils.settings import INF\r\nfrom classes.result import Result\r\nfrom utils.debugger import Logger\r\n\r\nimport pycuda.autoinit\r\nimport pycuda.driver as drv\r\nfrom pycuda.compiler import SourceModule\r\nimport pycuda.gpuarray as ... | [
[
"numpy.int32",
"numpy.full"
]
] |
liuaiting/sentiment_analysis | [
"8e8c7a54ccaf5e275219503828ac303ac0338518"
] | [
"run_sa.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thur Mar 2 2017\n\n@author: Aiting Liu\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport math\nimport os\nimport sys\nimport time\n\nimport numpy as np\nimport tensorflow as tf\n\nimport da... | [
[
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.gfile.Exists",
"tensorflow.Session",
"tensorflow.train.get_checkpoint_state",
"tensorflow.gfile.GFile",
"tensorflow.ConfigProto",
"tensorflow.variable_scope",
"tensorflow.app.flags.DEFINE_f... |
renereimann/FID_Simulation | [
"40fe7f0892a5f4600d863658f748906bff050b67"
] | [
"FreeInductionDecay/simulation/coil.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom scipy import integrate\nfrom ..units import *\n\nclass Coil(object):\n r\"\"\"A coil parametrized by number of turns, length, diameter and current.\n\n You can calculate the magnetic field cause by the coil at any point in space.\n \"\"\"\n def __init... | [
[
"numpy.sin",
"scipy.integrate.simps",
"numpy.sqrt",
"numpy.cos",
"numpy.linspace"
]
] |
quadproduction/flameTimewarpML | [
"293be3ebc8bc34352569385ea21c07286316a5ea"
] | [
"bundle/model_cpu/RIFE_HDv3.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\nfrom torch.optim import AdamW\nimport torch.optim as optim\nimport itertools\nfrom model_cpu.warplayer import warp\nfrom torch.nn.parallel import DistributedDataParallel as DDP\nfrom model_cpu.IFNet_HDv3 import *\nimport torch.nn.functional as F\nfrom model_... | [
[
"torch.zeros",
"torch.device",
"torch.cat",
"torch.sigmoid",
"numpy.random.normal",
"torch.nn.functional.interpolate",
"torch.nn.ConvTranspose2d",
"torch.no_grad",
"torch.nn.parallel.DistributedDataParallel",
"torch.abs",
"torch.nn.Conv2d",
"torch.nn.PReLU",
"to... |
nelsonsaturno/keras-yolo3 | [
"5fcdd0ef4ec17c952ccbe38612d2f1d97a029937"
] | [
"tiny_model.py"
] | [
"from functools import reduce, wraps\n\nimport tensorflow as tf\nimport keras.backend as K\nfrom keras.layers import Input, Lambda\nfrom keras.models import Model\nfrom keras.layers import Conv2D, Add, ZeroPadding2D, UpSampling2D, Concatenate, MaxPooling2D\nfrom keras.layers.advanced_activations import LeakyReLU\nf... | [
[
"tensorflow.boolean_mask"
]
] |
jean1042/statistics | [
"747a93b130e341a8863383a7740800285dd0b897"
] | [
"src/spaceone/statistics/manager/resource_manager.py"
] | [
"import logging\nimport pandas as pd\nimport numpy as np\n\nfrom spaceone.core.manager import BaseManager\nfrom spaceone.statistics.error import *\nfrom spaceone.statistics.connector.service_connector import ServiceConnector\n\n_LOGGER = logging.getLogger(__name__)\n\n_JOIN_TYPE_MAP = {\n 'LEFT': 'left',\n 'R... | [
[
"pandas.DataFrame",
"pandas.merge",
"pandas.concat"
]
] |
toshi-k/kaggle-airbus-ship-detection-challenge | [
"872a160057592022488b1772b6c7a8982677d1dc"
] | [
"source/02_oriented_ssd/lib/search_best_box.py"
] | [
"import math\n\nimport numpy as np\n\nfrom lib.visualize import coord2_img\nfrom lib.predict import numpy_sigmoid, predict_boxes_numpy\n\n\ndef is_far(predict_x, predict_y, target, step):\n dist = math.sqrt((predict_x - target.x) ** 2 + (predict_y - target.y) ** 2)\n return dist > step * 1.5\n\n\ndef return_o... | [
[
"numpy.sum",
"numpy.isnan",
"numpy.arange"
]
] |
IsmailM/deepcpg | [
"b49fd08e5d02968ee2fef589c6dd840a783d5457"
] | [
"scripts/dcpg_train.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"Train a DeepCpG model to predict DNA methylation.\n\nTrains a DeepCpG model on DNA (DNA model), neighboring methylation states\n(CpG model), or both (Joint model) to predict CpG methylation of multiple cells.\nAllows to fine-tune individual models or to train them from scratch.\n\nEx... | [
[
"numpy.bincount",
"numpy.zeros",
"numpy.random.seed",
"numpy.sum",
"pandas.DataFrame",
"numpy.mean",
"numpy.ma.masked_values",
"numpy.swapaxes",
"numpy.random.uniform",
"numpy.all",
"numpy.expand_dims",
"numpy.var"
]
] |
wudenggang/mindspore | [
"2d50a43be9d17269f6adb41e51b8f7a540ebc9f1",
"2d50a43be9d17269f6adb41e51b8f7a540ebc9f1",
"2d50a43be9d17269f6adb41e51b8f7a540ebc9f1",
"95e75c3119909cc5c7c3098232851d1d7bc4ef8c"
] | [
"tests/ut/python/dataset/test_wordpiece_tokenizer.py",
"tests/st/ops/gpu/test_cast_op.py",
"tests/st/ops/cpu/test_lstm_op.py",
"model_zoo/deeplabv3/src/deeplabv3.py"
] | [
"# Copyright 2020 Huawei Technologies Co., Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"numpy.testing.assert_array_equal"
],
[
"numpy.arange"
],
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.all"
],
[
"numpy.ceil",
"numpy.sort"
]
] |
digitalepidemiologylab/text-classification | [
"8a92a9f6d67857de7de5dcb72a41f75061572e9a"
] | [
"txcl/utils/plot_helpers.py"
] | [
"\"\"\"\nPlotting helpers\n================\n\"\"\"\n\nimport os\nimport joblib\nimport logging\nimport sklearn.metrics\nimport pandas as pd\nfrom .list_runs import ListRuns\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport math\n\n\nlogger = logging.getLogger(__name__)\n\ndef plot... | [
[
"numpy.vectorize",
"numpy.log",
"pandas.DataFrame",
"numpy.exp",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.style.use",
"pandas.concat",
"pandas.read_csv"
]
] |
ali-senguel/fairo | [
"1ec5d8ecbdfc782de63a92aad9bf8534110ce762",
"1ec5d8ecbdfc782de63a92aad9bf8534110ce762",
"1ec5d8ecbdfc782de63a92aad9bf8534110ce762",
"1ec5d8ecbdfc782de63a92aad9bf8534110ce762"
] | [
"examples_and_tutorials/notebooks/active_vision/utils.py",
"droidlet/lowlevel/hello_robot/remote/remote_hello_saver.py",
"polymetis/polymetis/tests/python/polymetis/test_transformations.py",
"tools/crowdsourcing/droidlet_static_html_task/process_s3_logs.py"
] | [
"import numpy as np\n\nd3_40_colors_rgb: np.ndarray = np.array(\n [\n [31, 119, 180],\n [174, 199, 232],\n [255, 127, 14],\n [255, 187, 120],\n [44, 160, 44],\n [152, 223, 138],\n [214, 39, 40],\n [255, 152, 150],\n [148, 103, 189],\n [197, 17... | [
[
"numpy.array"
],
[
"numpy.random.seed",
"numpy.power"
],
[
"torch.rand",
"numpy.random.seed",
"torch.ones",
"torch.manual_seed",
"scipy.spatial.transform.Rotation.random",
"torch.Tensor"
],
[
"pandas.read_csv",
"pandas.set_option",
"pandas.concat"
]
] |
modudeepnlp/NLP_Tensorflow2.0 | [
"b0fcc5a1521e865b0a7b06042324c0b0d6844d06"
] | [
"ryan/CNN_Sentence_Classifer/model/data.py"
] | [
"import pandas as pd\n\nimport tensorflow as tf\nfrom gluonnlp.data import PadSequence\nfrom gluonnlp import Vocab\nfrom tensorflow.keras.preprocessing.sequence import pad_sequences\nfrom typing import Tuple\n\nfrom configs import FLAGS\n\n\nclass Corpus():\n def __init__(self, vocab, tokenizer):\n self._... | [
[
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"tensorflow.convert_to_tensor",
"tensorflow.io.decode_csv"
]
] |
AP-Atul/Torpido | [
"a646b4d6de7f2e2c96de4c64ce3113f53e3931c2"
] | [
"torpido/visual.py"
] | [
"\"\"\"\nThis file reads the video and gives ranking to frames\nthat have motion in it, saves in the dictionary with frame numbers\nthis dictionary is then saved in a joblib file defined in constants.py\n\"\"\"\n\nfrom time import sleep\n\nimport cv2\n\nimport numpy as np\n\nfrom .config.cache import Cache\nfrom .c... | [
[
"numpy.max"
]
] |
phamquiluan/table-transformer | [
"1fcbb539640e86659e825a7cfe410270f1686d8d"
] | [
"detr/models/segmentation.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nThis file provides the definition of the convolutional heads used to predict masks, as well as the losses\n\"\"\"\nimport io\nfrom collections import defaultdict\nfrom typing import List, Optional\n\nimport torch\nimport torch.nn as nn... | [
[
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.init.kaiming_uniform_",
"torch.zeros",
"torch.einsum",
"torch.nn.init.constant_",
"torch.no_grad",
"torch.nn.functional.interpolate",
"torch.nn.init.xavier_uniform_",
... |
marekstrelec/OpenNMT-py | [
"b20ebd3b42414cbfe5b1a4e4ccd1ef341d4fff71"
] | [
"onmt/translate/beam_search.py"
] | [
"\nimport sys\nimport os\nimport time\nimport torch\n\nfrom onmt.translate.decode_strategy import DecodeStrategy\n\nimport numpy as np\nfrom IPython import embed\n\n\nclass BeamSearch(DecodeStrategy):\n \"\"\"Generation beam search.\n\n Note that the attributes list is not exhaustive. Rather, it highlights\n ... | [
[
"torch.zeros",
"torch.cat",
"torch.mul",
"numpy.ceil",
"torch.arange",
"torch.full",
"torch.tensor",
"torch.zeros_like",
"torch.div",
"torch.empty",
"torch.topk"
]
] |
ykumards/pixel-cnn | [
"295076be5a658f59d0fea6fdaf3310d31dc4ad9d"
] | [
"src/trainer.py"
] | [
"import os, json, time\nfrom typing import Callable\nfrom pathlib import Path\nfrom skimage.transform import resize\nfrom progressbar import ProgressBar\nimport numpy as np\nimport imageio\nfrom PIL import Image\nimport matplotlib\n\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nimport torch\n\nimport u... | [
[
"numpy.argmin",
"numpy.load",
"numpy.min",
"numpy.mean",
"torch.exp",
"torch.sum",
"numpy.save",
"numpy.argmax",
"matplotlib.use",
"matplotlib.pyplot.rcParams.update",
"numpy.array",
"numpy.zeros",
"torch.save",
"matplotlib.pyplot.close",
"matplotlib.pyp... |
wangvation/torch-mobilenet | [
"e7b2fcacf52ea92a7c8ea413ce142a9ef2670c67"
] | [
"lib/roi_data_layer/roidb.py"
] | [
"\"\"\"Transform a roidb into a trainable roidb by adding a bunch of metadata.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport pickle\n\nfrom ..datasets.imdb import imdb\nimport numpy as np\nfrom ..utils.config import cfg\nfr... | [
[
"numpy.where",
"numpy.array",
"numpy.argsort"
]
] |
Hulihrach/RoadDetector | [
"9fedd537d7d3a5c81a60562a185fc13370af9a99"
] | [
"cannab-solution/train_inception3_unet_520.py"
] | [
"# -*- coding: utf-8 -*-\r\nimport sys\r\nfrom os import path, listdir, mkdir\r\nimport numpy as np\r\nnp.random.seed(1)\r\nimport random\r\nrandom.seed(1)\r\nimport tensorflow as tf\r\ntf.set_random_seed(1)\r\nimport timeit\r\nfrom sklearn.model_selection import KFold\r\nimport cv2\r\nfrom keras.optimizers import ... | [
[
"tensorflow.set_random_seed",
"numpy.concatenate",
"numpy.array",
"numpy.rot90",
"numpy.asarray",
"numpy.zeros",
"numpy.random.seed",
"numpy.random.shuffle",
"sklearn.model_selection.KFold"
]
] |
daikikatsuragawa/pycaret | [
"a2436a1485b325e7f99f57f99f8049177f26a8c9"
] | [
"pycaret/nlp.py"
] | [
"# Module: Natural Language Processing\n# Author: Moez Ali <moez.ali@queensu.ca>\n# License: MIT\n# Release: PyCaret 2.2.0\n# Last modified : 25/10/2020\n\nfrom typing import Optional, Dict, Any, Dict\nfrom pycaret.loggers import DashboardLogger\nfrom pycaret.loggers.mlflow_logger import MlflowLogger\nfrom pycaret.... | [
[
"sklearn.linear_model.ARDRegression",
"sklearn.gaussian_process.GaussianProcessClassifier",
"sklearn.linear_model.HuberRegressor",
"sklearn.linear_model.LinearRegression",
"sklearn.ensemble.ExtraTreesRegressor",
"sklearn.linear_model.BayesianRidge",
"sklearn.linear_model.PassiveAggress... |
KexinFeng/5525-machine-learning | [
"be0410d116ff7dfd79dd1169120f2fd33d529d08"
] | [
"csci5525-logistic-regression-and-naitive-gaussian/Problem3/LDA2dGaussGM.py"
] | [
"from sklearn.datasets import load_digits,load_boston\n\nimport numpy as np\nfrom numpy import linalg as linalg\nimport matplotlib.pyplot as plt\nimport sys, os\n\nfrom module_1 import q3a as B_classifier\nfrom module_1 import q3c as D_classifier\n\n\n\nclass PrePro():\n\n @staticmethod\n def extract_data(b_o... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.choice",
"sklearn.datasets.load_digits",
"numpy.median",
"numpy.genfromtxt",
"numpy.mean",
"numpy.std",
"matplotlib.pyplot.show",
"sklearn.datasets.load_boston"
]
] |
pbeukema/tensorflow-onnx | [
"a8d5a3cc72d24ca18d64572588ad06490940a230"
] | [
"tests/keras2onnx_applications/nightly_build/test_infogan.py"
] | [
"# SPDX-License-Identifier: Apache-2.0\n\nimport os\nimport sys\nimport unittest\nimport mock_keras2onnx\nimport onnx\nimport numpy as np\nfrom mock_keras2onnx.proto import keras\nfrom os.path import dirname, abspath\nsys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/'))\nfrom test... | [
[
"numpy.random.rand"
]
] |
Neural-Space/rasa | [
"7e7e5ec8511df9799f737196070381db7f1528d7"
] | [
"rasa/core/nlg/response.py"
] | [
"import copy\nimport logging\n\nfrom rasa.shared.core.trackers import DialogueStateTracker\nfrom typing import Text, Any, Dict, Optional, List\n\nfrom rasa.core.nlg import interpolator\nfrom rasa.core.nlg.generator import NaturalLanguageGenerator\n\nlogger = logging.getLogger(__name__)\n\n\nclass TemplatedNaturalLa... | [
[
"numpy.random.choice"
]
] |
manuelpinar/3DUnetCNN | [
"d40cf10ab2ee78c790caf4ebee6516f306797140"
] | [
"Utils/seg_extend.py"
] | [
"# -*- coding: utf-8 -*-\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Aug 5 08:55:53 2020\n\n@author: Manuel Pinar-Molina\n\"\"\"\nimport numpy as np\n\n'''\nNormalize the original data with values between 0-255\n'''\n\ndef normalize(original):\n readdata_norm = np.array(original) + abs(np.min(original))\n ... | [
[
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.absolute",
"numpy.copy",
"numpy.min",
"numpy.shape",
"numpy.where",
"numpy.argwhere"
]
] |
MeRajat/DocProduct | [
"da959cf6f636cec1fece38178de7237f6efe412a"
] | [
"Scripts/predictor.py"
] | [
"import os\nfrom collections import defaultdict\n\nimport tensorflow as tf\nimport numpy as np\nfrom time import time\nfrom tqdm import tqdm\nimport pandas as pd\nfrom multiprocessing import Pool, cpu_count\nimport faiss\n\nfrom Scripts.dataset import convert_text_to_feature\nfrom Scripts.models import MedicalQAMod... | [
[
"pandas.read_pickle",
"numpy.concatenate",
"numpy.array",
"tensorflow.data.Dataset.from_tensor_slices",
"numpy.stack",
"tensorflow.compat.v1.disable_eager_execution"
]
] |
FilTheo/Covid-19-Impact-under-Parametric-Uncertainty | [
"8830a9aa7c3fd2352a5e24d14e7cb02b7e731526"
] | [
"code/DDDM Dashboard.py"
] | [
"\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n#from pathlib import Path\n\n\nimport os\nfrom tqdm.notebook import tqdm\nfrom scipy.integrate import solve_ivp\nfrom scipy.optimize import minimize\nfrom sklearn.metrics import mean_squared_log_error, mean_squared_error\n\n\n#Building t... | [
[
"pandas.to_datetime",
"pandas.merge",
"pandas.DataFrame",
"numpy.arange",
"numpy.clip",
"pandas.read_csv"
]
] |
philipp-hess/deep-learning-for-heavy-rainfall | [
"dbec03245dd8db0c5f2f53af014b8dd8d80f245c"
] | [
"src/structural_similarity.py"
] | [
"# MS_SSIM implementation from https://github.com/VainF/pytorch-msssim\n# MSSSIM loss from https://github.com/spcl/deep-weather/blob/48748598294f02acbe029dac543e2abcb5285c09/Uncertainty_Quantification/Pytorch/models.py\n\nimport warnings\n\nimport torch\nimport torch.nn.functional as F\n\n\ndef _fspecial_gauss_1d(s... | [
[
"torch.relu",
"torch.stack",
"torch.arange",
"torch.FloatTensor",
"torch.flatten",
"torch.exp"
]
] |
CompTop/Interleaving-DR | [
"479c190d9a9315038348cec115793258f067b1ca"
] | [
"ipynb/PH_projection_pursuit.py"
] | [
"import torch\nimport bats\nimport time\nimport numpy as np\nfrom tqdm import tqdm\nfrom scipy.spatial.distance import directed_hausdorff\nfrom torch_tda.nn import RipsLayer, Rips0Layer, BottleneckLayer, WassersteinLayer, BarcodePolyFeature\nfrom torch_tda.nn import BottleneckLayerHera # torch-tda now support it\n#... | [
[
"torch.nn.Linear",
"torch.zeros",
"numpy.array",
"torch.linalg.norm",
"numpy.empty",
"torch.optim.lr_scheduler.ExponentialLR",
"scipy.sparse.linalg.LinearOperator",
"torch.mm",
"torch.nn.Parameter",
"scipy.sparse.linalg.lsmr",
"torch.tensor",
"numpy.repeat",
"to... |
chaofan-zheng/python_learning_code | [
"5d05848911d55aa49eaee4afd7ffd80536fad7aa"
] | [
"month06/Machine_learning/day01-2/05_one_hot_demo.py"
] | [
"# 05_one_hot_demo.py\n# 独热编码: 将特征转换为一个1和一串0表示的序列\nimport numpy as np\nimport sklearn.preprocessing as sp\n\nraw_samples = np.array([[1, 3, 2],\n [7, 5, 4],\n [1, 8, 6],\n [7, 3, 9]])\n# 定义独热编码器\nencoder = sp.OneHotEncoder(\n sparse=False, # 是否... | [
[
"numpy.array",
"sklearn.preprocessing.OneHotEncoder"
]
] |
nickreynolds/ML-examples | [
"dde0d909007381eb045e53d1ac8baa70d60256f1"
] | [
"tflu-kws-cortex-m/Training/test_tflite.py"
] | [
"# Copyright © 2020 Arm Ltd. All rights reserved.\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 applicab... | [
[
"numpy.concatenate",
"tensorflow.lite.python.interpreter.Interpreter",
"tensorflow.math.confusion_matrix",
"tensorflow.argmax"
]
] |
buobao/flutter_app | [
"c52cb20069bf2b0d796a822fa9309ee32c406a22"
] | [
"tensorflow/lite/testing/generate_examples_lib.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.random.choice",
"tensorflow.nn.conv2d",
"tensorflow.space_to_depth",
"tensorflow.zeros_like",
"tensorflow.lite.testing.generate_examples_report.make_report_table",
"tensorflow.greater",
"tensorflow.stack",
"numpy.random.random",
"tensorflow.assert_greater_equal",
"te... |
Yunaik/drl_env | [
"d284e79847c59daa6ccb222f30fc7e2a86375546",
"d284e79847c59daa6ccb222f30fc7e2a86375546"
] | [
"src/b3px_gym/b3px_env/parallel/parallel_env_anymal.py",
"src/b3px_gym/b3px_env/singleton/valkyrie_gym_env/PD_controller.py"
] | [
"\"\"\"This file implements the b3px_gym environment of anymal.\n\n\"\"\"\n\nimport os, inspect\ncurrentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\nparentdir = os.path.dirname(os.path.dirname(currentdir))\nos.sys.path.insert(0,parentdir)\n\nimport math\nimport time\nimport gym\n... | [
[
"numpy.array",
"numpy.asarray",
"numpy.exp",
"numpy.sqrt",
"numpy.clip"
],
[
"numpy.clip"
]
] |
Topology1225/benchmark_NN | [
"eac732d789b4135e97bb636bde53171c3d193157"
] | [
"metric/src/utils/dset_functions.py"
] | [
"import torch\n\n\nclass EncodeOnehot(object):\n def __init__(self, dset_config) -> None:\n super().__init__()\n self.nc = dset_config.classes\n\n def __call__(self, x):\n assert x is not None\n return torch.eye(self.nc)[x].type(torch.long)\n"
] | [
[
"torch.eye"
]
] |
galenxing/scVI | [
"7c3b2931b46ca0cfe73476c7d97828b60bb34d33"
] | [
"scvi/dataset/anndataset.py"
] | [
"import logging\nimport operator\nimport os\nfrom functools import reduce\n\nimport anndata\nimport numpy as np\nimport pandas as pd\nfrom scipy.sparse import csr_matrix\n\nfrom scvi.dataset.dataset import DownloadableDataset, GeneExpressionDataset\n\nlogger = logging.getLogger(__name__)\n\n\nclass AnnDatasetFromAn... | [
[
"numpy.asarray"
]
] |
armantsh/allnews-am | [
"e7e9ec5f65814851843b95d2c245cf4d6f54f4b8"
] | [
"NER/run.py"
] | [
"\"\"\"\nUsage:\n run.py train --train-src=<file> [options]\n run.py test --test-src=<file> [options]\n\nOptions:\n -h --help show this screen\n --cuda use GPU\n --seed=<int> seed [default: 0]\n --train-src=<file> ... | [
[
"torch.device",
"torch.cuda.manual_seed",
"torch.utils.data.RandomSampler",
"numpy.random.seed",
"numpy.sum",
"torch.no_grad",
"torch.utils.data.SequentialSampler",
"torch.cuda.get_device_name",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.tensor",
"torch.... |
makgyver/gossipy | [
"44a8c231545456a92ae1a8ad0ae4f5cefced41c7"
] | [
"gossipy/node.py"
] | [
"from gossipy.model.sampling import TorchModelPartition, TorchModelSampling\nimport random\nimport numpy as np\nfrom numpy.random import randint, normal, rand, binomial\nfrom numpy import ndarray\nfrom torch import Tensor\nfrom typing import Any, Optional, Union, Dict, Tuple\nfrom gossipy import CacheKey\nfrom .uti... | [
[
"numpy.random.normal",
"numpy.random.randint",
"numpy.random.rand",
"numpy.where"
]
] |
jh88/fbnet | [
"5bd12ab8c7f6befc61efd8619d71e710db794c2b"
] | [
"test_tflite_model.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom time import perf_counter as timer\n\n\ndef main():\n x = np.load('data/cifar_test_x.npy')\n y = np.load('data/cifar_test_y.npy').flatten()\n\n interpreter = tf.lite.Interpreter(model_path='data/fbnet.tflite')\n interpreter.allocate_tensors()\n\n inpu... | [
[
"tensorflow.lite.Interpreter",
"numpy.load"
]
] |
mike-shvets/tao | [
"344e58543c799c045e810bef7ac6cb366b5cb8ea"
] | [
"tao/toolkit/tao/eval.py"
] | [
"import datetime\nimport logging\nfrom collections import OrderedDict\nfrom collections import defaultdict\n\nimport itertools\nimport numpy as np\nfrom numba import jit\nfrom tqdm import tqdm\n\nfrom .tao import Tao\nfrom .results import TaoResults\n\n\n@jit\ndef bb_intersect_union(d, g):\n \"\"\"Compute inters... | [
[
"numpy.concatenate",
"numpy.ndindex",
"numpy.array",
"numpy.count_nonzero",
"numpy.logical_not",
"numpy.zeros",
"numpy.round",
"numpy.ones",
"numpy.mean",
"numpy.logical_and",
"numpy.where",
"numpy.argsort",
"numpy.cumsum",
"numpy.repeat",
"numpy.searchs... |
kethan-kumar/Custom_Database | [
"0d44ab8748631b806b3711b8ae7d68e5f6474b1d"
] | [
"businessLogic/methods/insertEntryQuery.py"
] | [
"import warnings\n\nimport pandas as pd\nfrom businessLogic.methods import ConcurrencyControl\n\nfilepath = \"C:\\\\Users\\\\kethan\\\\Documents\\\\databases\"\nfilepath_slash = \"\\\\\"\nstatus = \"\\\\status-\"\ndataDict = \"\\\\dataDict-\"\n\n\ndef verifyValuesinForeignTables(query, path, database, tableName):\n... | [
[
"pandas.read_csv"
]
] |
longtermrisk/marltoolbox | [
"cae1ba94ccb44700b66a32e0734a0f11c9c6c7fe"
] | [
"tests/marltoolbox/utils/test_exploration.py"
] | [
"import copy\n\nimport numpy as np\nimport torch\nfrom ray.rllib.models import MODEL_DEFAULTS\nfrom ray.rllib.models.torch.fcnet import FullyConnectedNetwork\nfrom ray.rllib.models.torch.torch_action_dist import TorchCategorical\nfrom ray.rllib.utils.schedules import PiecewiseSchedule\n\nfrom marltoolbox.envs.coin_... | [
[
"torch.abs",
"torch.all",
"numpy.random.randint",
"numpy.random.random",
"torch.Tensor"
]
] |
PacktPublishing/Hands-On-Reinforcement-Learning-for-Games | [
"045b8846f2558aa8fb8ac8cef5c71ee098cb9b22",
"045b8846f2558aa8fb8ac8cef5c71ee098cb9b22"
] | [
"Chapter06/Chapter_6/Chapter_6_1.py",
"Chapter05/Chapter_5/Chapter_5_5y.py"
] | [
"import torch\n\ndtype = torch.float\ndevice = torch.device(\"cpu\")\n# device = torch.device(\"cuda:0\") # Uncomment this to run on GPU\n\nbatch_size, inputs, hidden, outputs = 64, 1000, 100, 10\n\nx = torch.randn(batch_size, inputs, device=device, dtype=dtype)\ny = torch.randn(batch_size, outputs, device=device, ... | [
[
"torch.device",
"torch.randn"
],
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.zeros",
"numpy.random.random"
]
] |
ypxie/SuperRes | [
"1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1"
] | [
"train_models/train_tiny.py"
] | [
"import argparse, os, sys\nsys.path.insert(0, '..')\nproj_root = os.path.join('..')\n\nimport pdb\nimport torch\nimport random\nimport torch.backends.cudnn as cudnn\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\nfrom srdense.thinnet... | [
[
"torch.cuda.manual_seed",
"torch.from_numpy",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.load"
]
] |
IRDonch/datumaro | [
"d029e67549b7359c887bd15039997bd8bbae7c0c"
] | [
"datumaro/plugins/datumaro_format/converter.py"
] | [
"# Copyright (C) 2019-2021 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\n# pylint: disable=no-self-use\n\nimport json\nimport os\nimport os.path as osp\nimport shutil\n\nimport numpy as np\nimport pycocotools.mask as mask_utils\n\nfrom datumaro.components.annotation import (\n Annotation, Bbox, Caption... | [
[
"numpy.require"
]
] |
ntellis/spectroseti | [
"31e5023c99d4ff4551ab0931eca4991584233890"
] | [
"spectroseti/runner.py"
] | [
"# apf.py\n#\n# Nate Tellis 2017\n#\n#\n# Extends class definitions in spectra.py for the High Resolution Echelle\n# spectrometer at the WM Keck observatory.\nimport spectroseti.output\n\n__author__ = 'nate'\n\n\nimport definitions as defs\nimport apf as apf\nimport apfdefinitions as apfdefs\n#import output\nimp... | [
[
"numpy.load",
"pandas.read_fwf",
"numpy.save"
]
] |
Lennard94/IRSA | [
"67dc6162f993de99289606740ed6b5d7402df0c2"
] | [
"Command_line/Reader.py"
] | [
"import numpy as np\nimport pickle \n\n\"\"\"\nThis class reads in the data necessary for the algorithm.\n\nThe theoretical frequency spectra need to be dumped to a \npickle file and must have the dimension (n_conformer,n_freq,2),\n where the first dimension is the number of conformer\n the second dimension i... | [
[
"numpy.min",
"numpy.argsort"
]
] |
LeeGitaek/Logistic_Regression_Classifier | [
"f5ba0e0b5e0396ef268f2ec54a8bf73e3656a5de"
] | [
"utilities.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\ndef visualize_classifier(classifier , X, y):\n min_x, max_x = X[:,0].min()-1.0,X[:,0].max()+1.0\n min_y, max_y = X[:,1].min()-1.0,X[:,1].max()+1.0\n mesh_step_size = 0.01\n x_vals, y_vals = np.meshgrid(np.arange(min_x,max_x,mesh_step_size),np.arang... | [
[
"matplotlib.pyplot.pcolormesh",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter"
]
] |
shanegladson/Biting-Midges-ABM | [
"17c803178c0f5c28a44f53a4a3a0d1aa7645124d"
] | [
"Model (WIP)/Midge.py"
] | [
"from mesa import Agent\nimport random\nimport numpy as np\nimport Egg\nimport math\nfrom functools import cache\n\n\n# Returns an array of integer tuples within the given radius\n@cache\ndef getradiusarray(radius) -> np.array:\n radiusarray = []\n for x in range(-radius, radius, 1):\n for y in range(-... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.linspace"
]
] |
kadglass/RotationCurves | [
"7f52dac022ca4df666e671eeb7f0aaf65c8515c3",
"7f52dac022ca4df666e671eeb7f0aaf65c8515c3"
] | [
"GradientSmoothness-1.0.0/GradientSmoothness/test_scripts/CreateTestData.py",
"spirals/DRP_vel_map_main_multiprocess.py"
] | [
"\n\nimport numpy\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\n\n\n\n\nx_vals = numpy.linspace(0,10,1000)\n\ny_vals = numpy.linspace(0,10,1000)\n\nxx, yy = numpy.meshgrid(x_vals, y_vals)\n\nz_vals = numpy.sin(xx) + numpy.cos(yy)\n\n\nfig = plt.figure(figsize=(16,10))\naxes = fig.add_... | [
[
"numpy.sin",
"matplotlib.pyplot.figure",
"numpy.cos",
"matplotlib.pyplot.show",
"numpy.linspace",
"numpy.meshgrid"
],
[
"numpy.sqrt"
]
] |
mitja-mandic/diploma | [
"a6ec3edada41f0ceb69fffb62da0e413acb68153"
] | [
"koda/fisher_logit.py"
] | [
"import numpy as np \nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ndef p_i(vektor):\n return np.exp(vektor)/(1+np.exp(vektor))\n\ndef varianca(vektor, skupine):\n return np.diag(np.array(skupine) * (np.array(vektor) * (1 - np.array(vektor))))\n\n\n\ndef izracunaj_koeficiente(max_iteracij, matrika, ... | [
[
"numpy.array",
"numpy.reshape",
"numpy.matmul",
"numpy.exp",
"numpy.shape",
"numpy.transpose",
"numpy.linalg.solve",
"pandas.read_csv"
]
] |
AssistiveRoboticsUNH/TCG-Classifier | [
"a86fd898bcaa6ad9e06964d9d53a8b6ec1a7732d"
] | [
"hogwild/hogwildsgd.py"
] | [
"import numpy as np\nfrom sklearn.preprocessing import StandardScaler\nimport sklearn\nfrom sklearn.linear_model import SGDRegressor\nfrom sklearn.externals.joblib import Parallel, delayed\n\nfrom shared import SharedWeights, mse_gradient_step\nfrom generators import DataGenerator\n\nclass HogWildRegressor(SGDRegre... | [
[
"numpy.random.seed",
"sklearn.externals.joblib.Parallel",
"sklearn.linear_model.SGDRegressor",
"sklearn.externals.joblib.delayed"
]
] |
fujii-team/GPinv | [
"e46964991459cb43752cd344c18be0e197d439f8"
] | [
"GPinv/gpmc.py"
] | [
"# This is a modification of GPflow/gpmc.py by Keisuke Fujii.\n#\n# The original source file is distributed at\n# https://github.com/GPflow/GPflow/blob/master/GPflow/svgp.py\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#... | [
[
"tensorflow.transpose",
"tensorflow.expand_dims"
]
] |
monkeysforever/Sentiment-Analysis-using-Pretrained-Language-Models | [
"22086fb3f8b2cee9192eaf54bae3acc2ca53f9b1"
] | [
"data/dataset.py"
] | [
"from torch.utils.data import Dataset\nimport pandas as pd\n\n\nclass TextCSVDataset(Dataset):\n def __init__(self, path, text_transforms=None, label_transforms=None):\n super(TextCSVDataset, self).__init__()\n self.data = pd.read_csv(path)\n self.text_tfs = text_transforms\n self.lab... | [
[
"pandas.read_csv"
]
] |
vvartin/ga-bayesian-search | [
"e35dd1033bda5cf9903d6a21be3a978c244e6fe8"
] | [
"DataSynthesizer/DataGenerator.py"
] | [
"from numpy import random\nfrom pandas import DataFrame\n\nfrom DataSynthesizer.datatypes.utils.AttributeLoader import parse_json\nfrom DataSynthesizer.lib.utils import set_random_seed, read_json_file, generate_random_string\n\n\nclass DataGenerator(object):\n def __init__(self):\n self.n = 0\n sel... | [
[
"pandas.DataFrame",
"numpy.random.randint",
"numpy.random.uniform",
"numpy.random.choice"
]
] |
deepdoctection/deepdoctection | [
"7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036"
] | [
"tests/dataflow/test_stats.py"
] | [
"# -*- coding: utf-8 -*-\n# File: test_stats.py\n\n# Copyright 2021 Dr. Janis Meyer. 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... | [
[
"numpy.array"
]
] |
narenberg/pulse2percept | [
"ca3aaf66672ccf3c9ee6a9a9d924184cdc6f031d",
"ca3aaf66672ccf3c9ee6a9a9d924184cdc6f031d"
] | [
"pulse2percept/implants/tests/test_electrode_arrays.py",
"pulse2percept/setup.py"
] | [
"import numpy as np\nimport pytest\nimport numpy.testing as npt\nfrom collections import OrderedDict\n\nfrom pulse2percept.implants import (DiskElectrode, PointSource,\n ElectrodeArray, ElectrodeGrid)\n\n\ndef test_ElectrodeArray():\n with pytest.raises(TypeError):\n Ele... | [
[
"numpy.testing.assert_equal",
"numpy.testing.assert_almost_equal",
"numpy.mean",
"numpy.prod",
"numpy.sqrt",
"numpy.unique"
],
[
"numpy.distutils.misc_util.Configuration"
]
] |
ngam/botorch | [
"c6bc8f9a82c4959cc209335fefd8b906023edd1e"
] | [
"test/utils/test_containers.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\nfrom botorch.exceptions.errors import UnsupportedError\nfrom botorch.utils.containers import T... | [
[
"torch.rand",
"torch.cat",
"torch.equal",
"torch.split"
]
] |
pete88b/expoco | [
"29c6673cba0647bb64242628a8507fc26fbdbdfd"
] | [
"expoco/viseme_image/model.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: 11d_viseme_image_model.ipynb (unless otherwise specified).\n\n__all__ = ['prepare_for_inference', 'VisemeClassifier']\n\n# Cell\nfrom .data import *\nfrom pathlib import Path\nimport numpy as np\nimport cv2, onnxruntime\n\n# Cell\ndef prepare_for_inference(image, image_s... | [
[
"numpy.array",
"numpy.transpose",
"numpy.argmax"
]
] |
fossabot/Z-PNN | [
"691d93686b13ee8960fcfa06844c731c2b80a51e"
] | [
"utils.py"
] | [
"import math\nimport numpy as np\nimport torch\nfrom cross_correlation import xcorr_torch\nfrom spectral_tools import gen_mtf\nimport torch.nn as nn\nfrom math import floor\n\n\ndef net_scope(kernel_size):\n \"\"\"\n Compute the network scope.\n\n Parameters\n ----------\n kernel_size... | [
[
"torch.from_numpy",
"torch.unsqueeze",
"torch.nn.Conv2d",
"torch.nn.ReflectionPad2d",
"numpy.expand_dims"
]
] |
zhangliu55/ProphetNet-paddle | [
"90271830d92594910439afc603562c3c29bf378a"
] | [
"ProphetNet_paddle/torch2paddle_weight.py"
] | [
"import paddle\nimport torch\nimport numpy as np\n\n# torch_model_path = \"cnndm/finetune_cnndm_checkpoints/checkpoint9.pt\"\ntorch_model_path = \"pretrained_checkpoints/prophetnet_en.pt\"\n# torch_model_path = \"gigaword/finetune_gigaword_checkpoints/checkpoint7.pt\"\ntorch_state_dict = torch.load(torch_model_path... | [
[
"torch.load"
]
] |
aausek/PhotoBlend | [
"b302054cfea99560a6da5686e90f1e9817f08a63"
] | [
"library/library.py"
] | [
"from PIL import Image\nfrom PySide2.QtWidgets import QLabel\nfrom PySide2.QtGui import QPixmap\nimport numpy as np\nimport ctypes\nimport os.path\nimport glob\n\n\ndef call_blend(image1_name, image2_name, blend_type):\n # Loads the shared object created by the Makefile (for pip install in WSL)\n # sofile = \... | [
[
"numpy.ctypeslib.ndpointer",
"numpy.reshape",
"numpy.asarray"
]
] |
cc-ai/floods-gans | [
"787dc2a3c08483c68a687b4355c0f0f6f2711ab9"
] | [
"various_scripts/overlay_binary_mask.py"
] | [
"import os\r\nimport cv2\r\nimport numpy as np\r\n\r\n\r\ndef overlay_binary(im_path, mask_path, output_path, color=(255, 0, 0), alpha=0.3):\r\n \"\"\"\r\n Draw the binary mask on top of the input image\r\n :param im_path: path of the image being segmented\r\n :param mask_path: output of the s... | [
[
"numpy.zeros_like",
"numpy.sort"
]
] |
AlvArranzDom/nluanalyzer | [
"069521c4aa12c44d73d9550256a3d76b6e8c236f"
] | [
"nluanalyzer/converter.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n__author__ = \"Alvaro Arranz\"\n__copyright__ = \"Copyright 2020, Alvaro Arranz\"\n\nimport re\nimport time\nimport json\nimport spacy\nimport logging\nimport unicodedata\nimport numpy as np\nimport pandas as pd\nfrom collections import Counter\nfrom nltk.corpus im... | [
[
"pandas.read_excel",
"sklearn.feature_extraction.text.CountVectorizer"
]
] |
ajinkyakulkarni14/ERISHA | [
"2135ed05845ca097f616dc4548fb1a33c6fe9ad2"
] | [
"src/Tacotron2/utils.py"
] | [
"# from https://github.com/NVIDIA/tacotron2\n# modified load_wav_to_torch, resampling to match the target_sampling_rate\n\nimport numpy as np\nfrom scipy.io.wavfile import read\nimport torch\nimport librosa\n\n\ndef get_mask_from_lengths(lengths):\n max_len = torch.max(lengths).item()\n ids = torch.arange(0, ... | [
[
"scipy.io.wavfile.read",
"torch.max",
"torch.autograd.Variable",
"torch.cuda.LongTensor",
"torch.cuda.is_available"
]
] |
giantcroc/pdarts-nlp | [
"ae5ad5f76b2f7bc67fa4940e4ba4197d82b02d4d"
] | [
"model_search.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom operations import *\nfrom torch.autograd import Variable\nfrom genotypes import PRIMITIVES\nfrom genotypes import Genotype\n\n\nclass MixedOp(nn.Module):\n\n def __init__(self, C, stride, switch, p):\n super(MixedOp, self).__init_... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.Dropout",
"torch.nn.ModuleList",
"torch.nn.Conv1d",
"torch.nn.AdaptiveAvgPool1d",
"torch.randn",
"torch.nn.BatchNorm1d",
"torch.nn.functional.softmax",
"torch.nn.Embedding"
]
] |
jabarihastings/CS229-Project | [
"f6959c9b561d73928703d10b3b92c99a001d6caf"
] | [
"code/logreg.py"
] | [
"import sys\nimport util\nimport numpy as np\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.linear_model import SGDClassifier\n\ndef main():\n X, Y = util.load_dataset('../data/small/', ['incorrect', 'correct'], 96)\n\n X_train, X_tes... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.LogisticRegression"
]
] |
LeonChou5311/Counterfactual-benchmark | [
"0185de1c4fcbe4090df4f117b38a9e2e994062ea"
] | [
"lore/stability_lore_vs_anchor.py"
] | [
"import re\nimport lore\nimport datetime\n\nfrom prepare_dataset import *\nfrom neighbor_generator import *\n\nfrom anchor import anchor_tabular\nfrom statistics import mode\n\nfrom sklearn.metrics import f1_score\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.model_selection import train_test_split\n\nw... | [
[
"sklearn.model_selection.train_test_split"
]
] |
donovanr/napari | [
"580b5eab8cc40af53aef780a65adb9216d968a32",
"580b5eab8cc40af53aef780a65adb9216d968a32",
"580b5eab8cc40af53aef780a65adb9216d968a32"
] | [
"napari/layers/_shapes_layer/shapes/ellipse.py",
"napari/util/colormaps/colormaps.py",
"napari/layers/_shapes_layer/shapes/rectangle.py"
] | [
"import numpy as np\nfrom .shape import Shape\nfrom ..shape_util import (triangulate_edge, triangulate_ellipse,\n center_radii_to_corners, rectangle_to_box)\n\n\nclass Ellipse(Shape):\n \"\"\"Class for a single ellipse\n\n Parameters\n ----------\n data : np.ndarray\n Eit... | [
[
"numpy.array"
],
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.full",
"numpy.zeros",
"numpy.stack",
"numpy.arange",
"numpy.clip",
"numpy.all",
"numpy.broadcast_to",
"numpy.meshgrid",
"numpy.unique",
"numpy.convolve"
],
[
"numpy.array"... |
holales1/finalProject | [
"87f011fa426c8e597ebb3af8913f7cc6b9eaf9e9"
] | [
"app/Http/Controllers/ORB/test.py"
] | [
"from os import system\nimport sys\nfrom sentence_transformers import SentenceTransformer, util\nimport torch\nimport json\n\nwith open('myfile.json') as f:\n distros_dict = json.load(f)\n\nembedder = SentenceTransformer('distilbert-base-nli-stsb-mean-tokens')\n\n# Corpus with example sentences\ncorpus = distros... | [
[
"torch.topk"
]
] |
timothyas/pych | [
"77753f06921f8676f784d9125cedf25b5760b080"
] | [
"pych/pigmachine/oidriver.py"
] | [
"\"\"\"\nOIDriver class, which defines an object to aid in herding these experiments\nCaveats:\n - Assumes control parameter is cell centered, (see e.g. pickup where sorted)\n - obs_mask/obs_std and mymodel have to have dimension order like 'Z','Y','X'\n - get_matern_dataset calls are loaded into memory so... | [
[
"numpy.array",
"numpy.linalg.norm",
"scipy.linalg.eigh",
"numpy.linalg.qr",
"numpy.arange",
"numpy.sqrt",
"numpy.linspace"
]
] |
aimanahmedmoin1997/DataCamp | [
"c6a6c4d59b83f14854bd76ed5c0c7f2dddd6de1d"
] | [
"Data Science With Python/02-intermediate-python-for-data-science/5-case-study-hacker-statistics/simulate-multiple-walks.py"
] | [
"'''\nSimulate multiple walks\n100xp\nA single random walk is one thing, but that doesn't tell you if you have a good\nchance at winning the bet.\n\nTo get an idea about how big your chances are of reaching 60 steps, you can\nrepeatedly simulate the random walk and collect the results. That's exactly what\nyou'll d... | [
[
"numpy.random.seed",
"numpy.random.randint"
]
] |
nstair/example2 | [
"7a0e8a8046a3e12d5d88d50c0c150c8c5cf540a5"
] | [
"example2/tests/test_math.py"
] | [
"import pytest\nimport numpy as np\n\nimport example2 as e2\n\n#@pytest.mark.paramatrize('n, answer', [(0,1), (1,2)])\n\n\ndef test_one():\n assert e2.math.one(1) == 1.0\n\n\ndef test_pi():\n np.random.seed(0)\n val = e2.math.pi(500000)\n assert val == pytest.approx(3.14159, 0.01)\n"
] | [
[
"numpy.random.seed"
]
] |
narendasan/DALI | [
"084ef857b482f9de2c0e00c6d10a5bb4b9b3532c"
] | [
"docs/examples/tensorflow/demo/nvutils/image_processing.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n# Copyright (c) 2017-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 obtain a copy of the License at\n... | [
[
"tensorflow.device"
]
] |
pdpdhp/OpenAeroStruct | [
"435714696721a8191d9774bafbfcc9b9e4db6f93",
"435714696721a8191d9774bafbfcc9b9e4db6f93",
"435714696721a8191d9774bafbfcc9b9e4db6f93"
] | [
"openaerostruct/tests/test_aerostruct_point_loads.py",
"openaerostruct/examples/run_CRM.py",
"openaerostruct/tests/test_morphing_aerostruct.py"
] | [
"from __future__ import division, print_function\nfrom openmdao.utils.assert_utils import assert_rel_error\nimport unittest\nimport numpy as np\n\nfrom openaerostruct.geometry.utils import generate_mesh\n\nfrom openaerostruct.integration.aerostruct_groups import AerostructGeometry, AerostructPoint\n\nimport openmda... | [
[
"numpy.array",
"numpy.zeros"
],
[
"numpy.array",
"numpy.zeros"
],
[
"numpy.array",
"numpy.zeros"
]
] |
kidrabit/Data-Visualization-Lab-RND | [
"baa19ee4e9f3422a052794e50791495632290b36",
"baa19ee4e9f3422a052794e50791495632290b36",
"baa19ee4e9f3422a052794e50791495632290b36"
] | [
"gaze_project/feature_models/saliecny_model/original_code/pySaliencyMap/pySaliencyMap.py",
"gaze_project/3D-DBSCAN/3D_DBSCAN.py",
"SDDVR/viewpointGuiding/viewpointVoting_bonsai.py"
] | [
"#-------------------------------------------------------------------------------\r\n# Name: pySaliencyMap\r\n# Purpose: Extracting a saliency map from a single still image\r\n#\r\n# Author: Akisato Kimura <akisato@ieee.org>\r\n#\r\n# Created: April 24, 2014\r\n# Copyright: (c) Akisato Kimura ... | [
[
"numpy.uint8",
"numpy.array",
"numpy.empty",
"numpy.zeros",
"numpy.where",
"numpy.float32"
],
[
"numpy.random.normal",
"numpy.array",
"numpy.random.rand",
"numpy.random.seed",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
... |
MajronMan/agh_stuff | [
"d045e3bd47ac17880526203d9993d9b2389a9ffe"
] | [
"fourth_semester/Python/Pycasso/paint.py"
] | [
"import tkinter as tk\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\nfrom matplotlib.figure import Figure\nfrom PIL import ImageDraw\n\n\nclass Paint(object):\n DEFAULT_PEN_SIZE = 25\n DEFAULT_COLOR = 'black'\n\n def __init__(self, img_ref, data_ref):\n self.root = tk.Tk()\n ... | [
[
"matplotlib.figure.Figure",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg"
]
] |
XiaZeng0223/alps | [
"72c5f9b02424bfef6b19c8ec9675774ae827242a"
] | [
"src/train.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace 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.distributed.get_world_size",
"torch.utils.data.RandomSampler",
"numpy.squeeze",
"torch.save",
"torch.utils.data.SequentialSampler",
"torch.no_grad",
"torch.nn.parallel.DistributedDataParallel",
"numpy.seterr",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch... |
harishraman94/SMOTE | [
"7f21d5561e7da20462c70b119034c197c213826c"
] | [
"src/RandomUnderSampling/UnderSampling.py"
] | [
"import pandas as pd\r\nimport numpy as np\r\nimport csv\r\n\r\n\r\ndef underSampling(T, dataset, minorClassname, numattrs, N):\r\n majorityClassLabel = []\r\n minorityClassData = []\r\n underSampledMajorityData = []\r\n N = int(T/(N / 100))\r\n for index, eachSample in enumerate(dataset, 1):\r\n ... | [
[
"numpy.random.choice",
"numpy.nditer"
]
] |
showKstage/fut-fate | [
"77ef6fb84e9f8345aca3dda92ccc63b6a462bc20"
] | [
"python/federatedml/federatedrec/factorization_machine/hetero_factorization_machine/hetero_fm_host.py"
] | [
"#\n# Copyright 2019 The FATE 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 r... | [
[
"numpy.minimum",
"numpy.sqrt",
"numpy.maximum"
]
] |
edmundsj/xsugar | [
"08596f500b043661b9fc807803319ee8f5d6de54"
] | [
"xsugar/source/processing.py"
] | [
"from liapy import LIA\nfrom sciparse import frequency_bin_size, column_from_unit, cname_from_unit, is_scalar\nfrom spectralpy import power_spectrum\nfrom xsugar import ureg, condition_is_subset, condition_from_name\nimport numpy as np\n\ndef dc_photocurrent(data, cond):\n voltages = column_from_unit(data, ureg.... | [
[
"numpy.log10"
]
] |
IIGROUP/PoseDet-Fast-Multi-Person-Pose-Estimation-Using-Pose-Embedding | [
"edb1b50cb697e7eea576cd1d69d5c3c097234e58"
] | [
"tools/test.py"
] | [
"import argparse\nimport os, sys\nsys.path.append(os.getcwd())\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\" \nimport mmcv\nimport torch\nfrom mmcv import Config, DictAction\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner import get_dist_info, init_dist, load_checkpoint\nfrom ... | [
[
"torch.cuda.current_device"
]
] |
MushroomRL/mushroom-rl-benchmarking | [
"0cde27e84e3f37dbaa259f0faba7af800aefc589"
] | [
"mushroom_rl_benchmark/builders/policy_search/policy_gradient.py"
] | [
"import numpy as np\n\nfrom mushroom_rl.algorithms.policy_search import REINFORCE, GPOMDP, eNAC\nfrom mushroom_rl.approximators.parametric import LinearApproximator\nfrom mushroom_rl.approximators.regressor import Regressor\nfrom mushroom_rl.policy import StateStdGaussianPolicy\nfrom mushroom_rl.utils.optimizers im... | [
[
"numpy.ones"
]
] |
ziyuli/models | [
"6aaf01922f8b5c4be1f89a961ade92e2d7c11e3c"
] | [
"PaddleCV/PaddleGAN/util/utility.py"
] | [
"#copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.\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 ... | [
[
"matplotlib.use",
"numpy.concatenate",
"numpy.array",
"numpy.pad",
"numpy.random.rand",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.squeeze",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
catherio/tensorfuzz | [
"a845bf3e9cb330585b1d8f09e701bfa2fccd6500"
] | [
"lib/fuzzer.py"
] | [
"# Copyright 2018 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 to ... | [
[
"tensorflow.logging.info"
]
] |
PredectiveAI/StoryKeyGen | [
"3b3878224090e5dca8b32be31fc34c5105fd05a8"
] | [
"story_key.py"
] | [
"from os import curdir\nfrom tkinter import *\nimport os\nimport tkinter.filedialog\nimport numpy as np\nfrom styleframe import StyleFrame, utils\nimport math\nimport pandas as pd\nimport numpy as np\n\nimport csv\nimport matplotlib\nfrom tkmagicgrid import *\nfrom PIL import ImageTk, Image\nfrom tkinter import ttk... | [
[
"numpy.where",
"pandas.read_excel"
]
] |
l3alr0g/Hull-breach-analysis | [
"7ce34488ec95f93f0afb571731757a1ce569673e"
] | [
"Exp results/marjorie/TIPE.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Mar 6 18:21:06 2020\n\n@author: marjo\n\"\"\"\nimport matplotlib.pyplot as plt\n# comptage du nombre de ligne\nfichier = open('resultats_exp.txt','r') # Ouverture d'un fichier en lecture:\nlecture = fichier.readlines()\nnb_lignes = len(lecture) \nfichier.c... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot"
]
] |
redway1225/PCC-RL | [
"e292c316c23fb837255c4e142e40590d154bbe95"
] | [
"src/common/sender_obs.py"
] | [
"# Copyright 2019 Nathan Jay and Noga Rotman\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... | [
[
"numpy.array",
"numpy.mean"
]
] |
gaungalif/classify.pytorch | [
"9b9bef02ad8964baf9c85e96e9348297a65aa266"
] | [
"classify/datamodule.py"
] | [
"from logging import _FormatStyle\nimport pytorch_lightning as pl\nfrom torch.utils.data import random_split, DataLoader\n\n# Note - you must have torchvision installed for this example\nfrom torchvision.datasets import DatasetFolder, ImageFolder\nfrom torchvision import transforms\nfrom typing import *\nimport tor... | [
[
"torch.Generator",
"torch.utils.data.DataLoader"
]
] |
ntnbrtnkv/tensorflow_chessbot | [
"b649b23ce09e2cdcbafb3448676481603246994f"
] | [
"chessboard_finder.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Pass in image of online chessboard screenshot, returns corners of chessboard\n# usage: chessboard_finder.py [-h] urls [urls ...]\n\n# Find orthorectified chessboard corners in image\n\n# positional arguments:\n# urls Input image urls\n\n# optional argumen... | [
[
"numpy.max",
"numpy.pad",
"numpy.linalg.norm",
"numpy.array",
"numpy.zeros",
"numpy.set_printoptions",
"numpy.sum",
"numpy.ones",
"numpy.tile",
"numpy.mean",
"numpy.diff",
"numpy.where",
"numpy.abs",
"numpy.hstack",
"numpy.gradient"
]
] |
chankisangrawal/sotc_graphics | [
"c95bacd7199dcf0e33c8296d7cbad1ef2e9a72bd"
] | [
"phen_2019.py"
] | [
"#!/usr/bin/env python\n# python3\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n#************************************************************************\n#\n# Plot figures and output numbers for Phenology (PHEN) section.\n# For BAMS SotC 2016\n#\n#**************************... | [
[
"matplotlib.path.Path",
"matplotlib.pyplot.colorbar",
"numpy.sin",
"matplotlib.ticker.MultipleLocator",
"matplotlib.cm.colors.BoundaryNorm",
"numpy.genfromtxt",
"matplotlib.pyplot.close",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.arange",
"... |
c-schicho/TicTacToe | [
"018d2082929736ff74cc280f20ddb5631a713136"
] | [
"TicTacToe.py"
] | [
"\"\"\"\nAuthor: Christopher Schicho\nProject: Tic-Tac-Toe\nVersion: 1.0\n\"\"\"\n\nimport random\nimport numpy as np\nfrom Evaluation import Evaluation\nfrom Opponent import Opponent\n\nclass TicTacToe:\n\n def __init__(self, difficulty):\n self.evaluation = Evaluation()\n self.opponent = Opponent... | [
[
"numpy.copy",
"numpy.zeros"
]
] |
thuime/XPEsim | [
"ab97d4c3c5b32ce4804ca58ad0f0083bb9de11fc"
] | [
"sim_examples/train_mnist_mlp_noise.py"
] | [
"from __future__ import print_function, division\r\nimport numpy as np\r\nimport simulator\r\nfrom netlang import functional\r\nfrom netlang.core import compile\r\nfrom netlang.data_provider import Batch\r\nfrom netlang.dataset import mnist\r\nfrom netlang.module.activation import ReLU, Softmax\r\nfrom netlang.modu... | [
[
"numpy.load"
]
] |
jiaseny/RFDA | [
"ee124595c70cdc4531b306b8fb6b59ce075027d6"
] | [
"utils.py"
] | [
"from __future__ import division\nimport cPickle\nimport itertools as it\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nfrom math import ceil, floor\nimport numpy as np\nimport scipy as sp\nimport os\nimport pandas as pd\nimport seaborn as sns\nimport sys\nimport... | [
[
"numpy.all",
"numpy.set_printoptions",
"numpy.sum",
"matplotlib.rc"
]
] |
alexcapstick/minder_utils | [
"3bb9380b7796b5dd5b995ce1839ea6a94321021d"
] | [
"minder_utils/feature_engineering/calculation.py"
] | [
"from scipy.stats import ks_2samp\nimport pandas as pd\nimport numpy as np\nfrom typing import Union\nfrom scipy.stats import entropy as cal_entropy\nfrom minder_utils.models.outlier_detection import ZScore\nfrom sklearn.preprocessing import StandardScaler\nfrom .util import frequencies_tp, compute_week_number\nfro... | [
[
"numpy.max",
"numpy.ceil",
"numpy.zeros_like",
"pandas.merge",
"sklearn.preprocessing.StandardScaler",
"numpy.zeros",
"pandas.DataFrame",
"numpy.sum",
"numpy.log",
"numpy.where",
"numpy.linalg.eig",
"sklearn.ensemble.IsolationForest",
"numpy.abs",
"scipy.sta... |
williamy1996/Autoexpression | [
"b470d9ff67074c8b076abbc1dce359db9a36f921",
"b470d9ff67074c8b076abbc1dce359db9a36f921"
] | [
"test/exps/evaluate_competition.py",
"solnml/components/feature_engineering/transformations/selector/liblinear_based_selector.py"
] | [
"import os\nimport sys\nimport argparse\nimport numpy as np\nimport pandas as pd\nfrom lightgbm import LGBMRegressor\nfrom catboost import CatBoostRegressor\nfrom sklearn.metrics import make_scorer\n\nsys.path.append(os.getcwd())\nfrom solnml.utils.data_manager import DataManager\nfrom solnml.components.evaluators.... | [
[
"numpy.divide",
"numpy.random.shuffle",
"numpy.save",
"numpy.arange",
"numpy.abs",
"pandas.concat",
"sklearn.metrics.make_scorer",
"pandas.read_csv"
],
[
"sklearn.feature_selection.SelectFromModel",
"sklearn.svm.LinearSVC"
]
] |
leaderj1001/AssembleNet | [
"bc04b199e1e38e16e24b588e529dcba8a145747d"
] | [
"main.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom model import Model\nfrom make_graph import Graph\nfrom preprocess import load_data\nfrom config import load_config\n\nimport time\n\n\n# reference,\n# https://github.com/pytorch/examples/blob/master/imagenet/m... | [
[
"torch.no_grad",
"torch.nn.CrossEntropyLoss"
]
] |
hendrycks/ethics | [
"3e4c09259a1b4022607da093e9452383fc1bb7e3"
] | [
"probe.py"
] | [
"import numpy as np\nimport argparse\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForSequenceClassification, AutoConfig\n\ndef load_model(model, ngpus, load_path):\n config = AutoConfig.from_pretrained(model, num_labels=1)\n model = AutoModelForSequenceClassification.from_pretrained(model, ... | [
[
"torch.sigmoid",
"torch.no_grad",
"torch.tensor",
"torch.load"
]
] |
NeuroDataDesign/pyprep | [
"f97e7ec54acb5b5c80dec89d0d37e005877a8258"
] | [
"pyprep/reference.py"
] | [
"\"\"\"functions of referencing part of PREP.\"\"\"\nimport logging\n\nimport numpy as np\n\n# from pyprep.noisy import Noisydata\nfrom pyprep.find_noisy_channels import NoisyChannels\nfrom pyprep.removeTrend import removeTrend\nfrom pyprep.utilities import _union, _set_diff\n\nlogging.basicConfig(\n level=loggi... | [
[
"numpy.asarray",
"numpy.shape",
"numpy.ndim"
]
] |
VishnuBhaarath/ML-Crate | [
"e1857cce506b971d767fcf0987b095aabcf53b2e"
] | [
"Jeopardy bot/model/leaderboard.py"
] | [
"import sqlite3\nimport pandas as pd\n\n\ndef lifetime_leaderboard():\n with sqlite3.connect('jepbot.db') as conn:\n cur = conn.cursor()\n\n lb = cur.execute('''SELECT name, questions_answered, lifetime_winnings FROM user \n ORDER BY lifetime_winnings DESC''')\n\n df =... | [
[
"pandas.set_option"
]
] |
simran2905/mmf | [
"c8f47a23b85a87d14616c2f53e81693a25ea929a"
] | [
"tests/trainers/callbacks/test_lr_scheduler.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport argparse\nimport unittest\nfrom copy import deepcopy\n\nimport torch\nfrom mmf.common.registry import registry\nfrom mmf.models.base_model import BaseModel\nfrom mmf.trainers.callbacks.lr_scheduler import LRSchedulerCallback\nfrom omegaconf import OmegaC... | [
[
"torch.nn.Linear",
"torch.nn.Tanh",
"torch.nn.CrossEntropyLoss"
]
] |
zjykzj/onnx | [
"d4c0557df19787d7cd16abb38755ac61412b11bf"
] | [
"py/convert/zcls_pytorch_to_onnx.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\n@date: 2021/7/24 下午1:19\n@file: zcls_pytorch_to_onnx.py\n@author: zj\n@description: convert zcls pytorch into onnx format\n\"\"\"\n\nimport os\nimport torch\nimport argparse\n\nfrom functools import reduce\n\nfrom zcls.config import cfg\nfrom zcls.config.key_word import KEY_OUTPU... | [
[
"torch.arange",
"torch.device",
"torch.onnx.export"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.