repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
UNSW-CEEM/NEMPRO | [
"04cc0a21a21fdadfee1bdeadb4540ddfab366399"
] | [
"NEMPRO/historical_inputs.py"
] | [
"from nemosis import data_fetch_methods, defaults\nimport pandas as pd\n\naemo_price_names = {'energy': 'RRP',\n 'raise_regulation': 'RAISEREGRRP',\n 'raise_6_second': 'RAISE6SECRRP',\n 'raise_60_second': 'RAISE60SECRRP',\n 'raise_5_minute'... | [
[
"pandas.merge",
"pandas.to_numeric",
"pandas.DataFrame"
]
] |
ohadshapira/Machine-Learning-Collection | [
"3e73548ec3ef17ed90a654950717559252814e13"
] | [
"ML/Pytorch/Basics/custom_dataset/custom_dataset.py"
] | [
"\"\"\"\nExample of how to create custom dataset in Pytorch. In this case\nwe have images of cats and dogs in a separate folder and a csv\nfile containing the name to the jpg file as well as the target\nlabel (0 for cat, 1 for dog).\n\nProgrammed by Aladdin Persson <aladdin.persson at hotmail dot com>\n* 2020-04... | [
[
"torch.nn.CrossEntropyLoss",
"pandas.read_csv",
"torch.utils.data.DataLoader",
"torch.utils.data.random_split",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
miettij/Intelligent-fault-diagnosis | [
"f43fb5d9cdbb9838c278bf8ca8354c8bf33b8861"
] | [
"code/cwru_utils.py"
] | [
"import matplotlib.pyplot as plt\nfrom collections import OrderedDict\nimport datetime\nimport numpy as np\nfrom scipy.io import loadmat\nimport torch\nimport os\nfrom os import listdir\n\ndef get_cwru_filepaths(root_dir,health_states,motor_load):\n \"\"\"\n Utility function that fetches all data filepaths co... | [
[
"numpy.hstack",
"matplotlib.pyplot.legend",
"numpy.min",
"scipy.io.loadmat",
"matplotlib.pyplot.subplots",
"torch.from_numpy",
"numpy.max",
"numpy.copy",
"matplotlib.pyplot.close"
]
] |
ixjlyons/pygesture | [
"6f36d0341de4036ff2a99a97d5b96e62ad2159ec"
] | [
"pygesture/wav.py"
] | [
"import numpy as np\nimport scipy.io.wavfile as siowav\n\n\ndef write(filename, rate, data):\n \"\"\"\n Writes recording data to file in WAV format. It is basically a convenience\n wrapper around `scipy.io.wavfile.write` for handling normalized float data.\n\n Paramters\n ---------\n filename : st... | [
[
"scipy.io.wavfile.write",
"scipy.io.wavfile.read"
]
] |
AppleHolic/PytorchSR | [
"f56611ccf6167f8a7f8f88e882576bdd9a48800b"
] | [
"utils.py"
] | [
"import logging\nimport torch\nfrom torch.autograd import Variable\nfrom models.cbhg import CBHGNet\nfrom models.mgru import MinimalGRUNet\nfrom run import Runner\nfrom trainers.timit import TIMITTrainer\n\n\ndef get_logger(name):\n # setup logger\n logger = logging.getLogger(name)\n logger.setLevel(loggin... | [
[
"torch.nn.DataParallel",
"torch.load",
"torch.autograd.Variable"
]
] |
deep-spin/sparse_continuous_distributions | [
"7cc7bc7140738ebd4585d36e47bddd9be6ebed12"
] | [
"spcdist/tests/test_agreement.py"
] | [
"import pytest\n\nimport numpy as np\nimport torch\n\nfrom spcdist.scipy import multivariate_beta_gaussian\nfrom spcdist.torch import MultivariateBetaGaussianDiag\n\n\n@pytest.mark.parametrize('alpha', [3/2, 4/3, 2, 3])\ndef test_torch_scipy_agreement(alpha):\n mean = np.array([10, 11.1])\n scale_diag = np.ar... | [
[
"numpy.diag",
"numpy.log",
"numpy.array",
"torch.from_numpy"
]
] |
YitongXia/shape-inversion | [
"a1176778330e22546ee81dc01e93c0b1e9e7a37d"
] | [
"shape_inversion.py"
] | [
"import os\nimport os.path as osp\nfrom copy import deepcopy\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.distributed as dist\nimport torch.nn.functional as F\nimport torchvision\nfrom torch.autograd import Variable\nfrom model.treegan_network import Generator, Discriminator\n\nfrom util... | [
[
"torch.optim.Adam",
"torch.norm",
"torch.ones",
"numpy.savetxt",
"torch.load",
"torch.cat",
"torch.zeros",
"torch.randn",
"torch.mul",
"torch.no_grad",
"numpy.argmin",
"torch.where",
"torch.unique",
"torch.topk",
"torch.distributed.get_rank",
"torch.... |
SciPioneer/pipeline_experiments | [
"7e0fe6f884edfab026379cce1b5ae03b5c2489cd"
] | [
"BERT/main.py"
] | [
"import argparse\nimport torch.multiprocessing as mp\nimport math\nimport sys\nimport time\nimport os\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\nfrom torch.distributed.nn import RemoteModule\nfrom torch.utils.data import DataLoader\nimport torch.distributed.rpc as rpc\nfrom torch.dist... | [
[
"torch.nn.Sequential",
"torch.nn.CrossEntropyLoss",
"torch.distributed.nn.RemoteModule",
"torch.ones",
"torch.multiprocessing.spawn",
"torch.load",
"torch.distributed.autograd.backward",
"torch.manual_seed",
"torch.zeros",
"torch.randperm",
"torch.distributed.rpc.init_r... |
ib-da-ncirl/airport_codes | [
"4b00b1be786cfa373b7e8d520553493c6f8fb0d6"
] | [
"load_cvs_node.py"
] | [
"# The MIT License (MIT)\n# Copyright (c) 2019 Ian Buttimer\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, ... | [
[
"pandas.DataFrame"
]
] |
scottthomas586/web-scraping-challenge | [
"a88691d9c2b241b41b84660f9be61f98322ce28f"
] | [
"Mission_to_Mars/scrape_mars.py"
] | [
"# import dependancies\nfrom splinter import Browser\nfrom bs4 import BeautifulSoup as bs\nfrom webdriver_manager.chrome import ChromeDriverManager\nimport time\nimport pandas as pd \nimport pymongo \nimport requests \n\ndef init_browser():\n executable_path = {\"executable_path\": \"chromedriver\"}\n return ... | [
[
"pandas.read_html"
]
] |
emptymalei/statistical-tests | [
"8b5d4d4965c431be458271b25cca56fa8e2bf01f"
] | [
"dietbox/visual/eda.py"
] | [
"import matplotlib.pyplot as plt\nimport seaborn as sns\n\n\ndef count_plot_with_percentage(dataframe, column, ax=None):\n if ax is None:\n fig, ax = plt.subplots()\n\n total_counts = len(dataframe)\n vc = dataframe[column].value_counts()\n vc_fraction = vc / total_counts\n\n sns.countplot(x=d... | [
[
"matplotlib.pyplot.subplots"
]
] |
bioinsilico/BIPSPI | [
"d4316235e94f19c92b627ad31045e24c5403fbeb"
] | [
"trainAndTest/processOneFold.py"
] | [
"from __future__ import print_function\nimport itertools\nimport sys, os\nimport inspect\nimport numpy as np\nfrom joblib import load as joblib_load\n\nfrom .resultsManager import ResultsManager\n#from .classifiers.randomForest import trainMethod, predictMethod\nfrom .classifiers.xgBoost import trainMethod, predi... | [
[
"numpy.concatenate"
]
] |
ashiqks/Object-Segmentation-Multi-Class-Detection | [
"448db17644512c44b51481e893c7903449d0a470"
] | [
"food.py"
] | [
"\"\"\"\nMask R-CNN\nTrain on the toy Balloon dataset and implement color splash effect.\n\nCopyright (c) 2018 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\n------------------------------------------------------------\n\nUsage: import the module (see Jupyte... | [
[
"numpy.array",
"numpy.where",
"numpy.sum"
]
] |
pandyakaa/modified-adaptdl-sched | [
"753af5e71f4a814a138902d718d0648362d3d11d"
] | [
"adaptdl/adaptdl/torch/gradient_noise_scale.py"
] | [
"import functools\nimport logging\nimport numpy as np\nimport torch.distributed\nimport torch.optim\n\nfrom torch.autograd import Variable\n\n__all__ = [\"GradientNoiseScale\"]\n\nlogging.basicConfig(level=logging.INFO)\nLOG = logging.getLogger(__name__)\nLOG.setLevel(logging.INFO)\n\n\ndef _average_groups(grads1, ... | [
[
"numpy.maximum",
"numpy.isfinite",
"torch.autograd.Variable._execution_engine.queue_callback",
"numpy.array",
"numpy.isclose"
]
] |
songzijiang/FasterSeg | [
"1a14ef6dd665afd229a16ab43b532b5a406512f8"
] | [
"tools/utils/visualize.py"
] | [
"import numpy as np\nimport cv2\nimport scipy.io as sio\n\n\ndef set_img_color(colors, background, img, gt, show255=False, weight_foreground=0.55):\n origin = np.array(img)\n for i in range(len(colors)):\n if i != background:\n img[np.where(gt == i)] = colors[i]\n if show255:\n img... | [
[
"numpy.random.random",
"scipy.io.loadmat",
"numpy.nanmean",
"numpy.column_stack",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
thudzj/BayesAdapter.github.io | [
"243b8b8686e2c9f1ea0bcda5ede317ab98405845"
] | [
"reproduction/finetune_face.py"
] | [
"from __future__ import division\nimport os, sys, shutil, time, random, math\nimport argparse\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nimport numpy as np\n\nimport torch\nfrom torch.optim import SGD\nimport torch.backends.cudnn as cudnn\n\nimport torch.nn.parallel\nimport torch.distributed as dist\nim... | [
[
"torch.multiprocessing.spawn",
"torch.cat",
"numpy.all",
"torch.no_grad",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"torch.nn.CrossEntropyLoss",
"torch.norm",
"torch.distributed.init_process_group",
"torch.backends.cudnn.version",
"torch.from_numpy",
... |
fpetitzon/effective_dimension | [
"1f6384422cfc9e4d05be9c678fd6e7cf65b3bd4f"
] | [
"Sensitivity_plots/generate_data/cnn_sensitivity_lower_depth.py"
] | [
"import numpy as np\nfrom effective_dimension import Model, EffectiveDimension, ClassicalNeuralNetwork\n\n# This code file generates data to test the sensitivity of the effective dimension to different number of samples used \\\n# for the Monte Carlo estimates for the integrals in the effective dimension formula. m... | [
[
"numpy.save"
]
] |
jirheee/CS492-Team-Project | [
"99b75d40743bb54b8561cd4a3a5e369e8d15128e"
] | [
"Server/src/ml/AlphaZero_Gomoku/translate_model_from_old_to_new.py"
] | [
"import torch\n\nimport json\n\nfrom nn_architecture import PolicyValueNet\nimport argparse\nimport numpy as np\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"-y\",\"--force_yes\",action=\"store_true\",default = False)\nargs = parser.parse_args()\n\ntrained_path = r\"D:\\Dropbox\\Workspace\\03 Python\... | [
[
"torch.save",
"torch.load"
]
] |
simard-landscape-lab/orinoco | [
"03f0e6b19985873dfdf8d4b9438e9ffcdb706099"
] | [
"orinoco/nd_tools.py"
] | [
"import numpy as np\nimport scipy.ndimage as nd\nfrom scipy.ndimage import find_objects\nfrom typing import Callable\n\n\ndef get_array_from_features(label_array: np.ndarray,\n features: np.ndarray) -> np.ndarray:\n \"\"\"\n Using p x q segmentation labels (2d) and feature array wit... | [
[
"numpy.nanmax",
"numpy.unique",
"numpy.clip",
"numpy.isnan",
"numpy.nanmin",
"scipy.ndimage.measurements.label",
"numpy.ones",
"scipy.ndimage.find_objects",
"scipy.ndimage.labeled_comprehension",
"numpy.zeros"
]
] |
AxelHenningsson/contomo | [
"215c5723c5f04542eee096c4f3de11b5698cb2c9"
] | [
"contomo/projected_advection_pde.py"
] | [
"\nimport numpy as np\nimport dill as pickle\nimport matplotlib.pyplot as plt\nimport os\nfrom contomo import utils\nfrom contomo import velocity_solver\n\nclass ProjectedAdvectionPDE(object):\n \"\"\"Advection partial differential equation (PDE) projected into sinogram space.\n\n This object defines the part... | [
[
"numpy.abs",
"numpy.min",
"numpy.arange",
"numpy.linalg.norm",
"numpy.save",
"numpy.max",
"numpy.ceil",
"numpy.load",
"numpy.array",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.sum"
]
] |
byungsook/neural-flow-style | [
"7c7ac504474621685577ea43b8b805f22809ef3a"
] | [
"styler_2p.py"
] | [
"#############################################################\n# MIT License, Copyright © 2020, ETH Zurich, Byungsoo Kim\n#############################################################\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nfrom tqdm import trange\nfrom util import... | [
[
"tensorflow.clip_by_value",
"matplotlib.pyplot.imshow",
"tensorflow.concat",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.Variable",
"tensorflow.shape",
"numpy.linspace",
"tensorflow.expand_dims",
"numpy.stack",
"numpy.nan_to_num",
"numpy.concatenate",
"t... |
20chase/cartpole_rl | [
"687fc30f7e69f4850c545dce74f4e844d75fd732",
"687fc30f7e69f4850c545dce74f4e844d75fd732"
] | [
"progress_plotter.py",
"sac/play_gym.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ndef df_plot(dfs, x, ys, ylim=None, legend_loc='best'):\n plt.rcParams[\"figure.figsize\"] = (10, 5)\n plt.style.use('ggplot')\n if ylim:\n plt.ylim(ylim)\n\n plt.plot(dfs[x]/3600, dfs[ys], linewidth=1, label=ys)\n plt... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.use"
],
[
"tensorflow.ConfigProto",
"tensorflow.get_default_graph",
"tensorflow.global_varia... |
Skyblueballykid/Draftkings-2016-2017 | [
"ef41be4d98c004bf6b2eb9f4aa2779e665981086"
] | [
"XGBoost/XGBClassifier.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport sklearn as sk\nimport sklearn.multiclass as mk\nimport patsy as pt\nimport xgboost as xgboost\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensemble import AdaBoostClassifier\nfrom sklearn.metrics import accuracy... | [
[
"sklearn.model_selection.train_test_split",
"numpy.loadtxt",
"sklearn.metrics.accuracy_score"
]
] |
ThibaultLatrille/MutationSelectionDrift | [
"7b9e4fe5b181413823ddba9b637af553f977836c"
] | [
"DataEmpirical/OrthoMam/orthomam_filter.py"
] | [
"#!python3\nimport pandas as pd\nfrom collections import Counter\nimport os\n\n\ndef save_df(name, col):\n col.to_csv(\"./\" + name, index=False, header=None)\n print(\"{0} CDS saved into '{1}'\".format(len(col), name))\n\n\ndf_orthomam_cds = pd.read_csv(\"./orthomam.tsv\", sep=\"\\t\")\ncol_orthomam_cds = df... | [
[
"pandas.read_csv"
]
] |
kimjungwow/onnxruntime-riscv | [
"1ab8a95eb6675afb6d0ad9d93600ef0022e2ddb5",
"3c21abef03190648fe68a6633ac026725e6dfc58"
] | [
"onnxruntime/python/tools/quantization/E2E_example_model/object_detection/trt/yolov3/preprocessing.py",
"systolic_runner/rcnn_runner/ort_native.py"
] | [
"import os\nimport sys\nimport numpy as np\nimport re\nfrom PIL import Image\nimport cv2\nimport pdb\n\ndef yolov3_preprocess_func(images_folder, height, width, start_index=0, size_limit=0):\n '''\n Loads a batch of images and preprocess them\n parameter images_folder: path to folder storing images\n pa... | [
[
"numpy.expand_dims",
"numpy.ascontiguousarray",
"numpy.asanyarray",
"numpy.transpose",
"numpy.mod",
"numpy.repeat",
"numpy.array"
],
[
"numpy.array",
"numpy.expand_dims",
"numpy.zeros"
]
] |
hhsecond/mlflow-redisai-pytorch-demo | [
"b1bd6b670f1df6f92ec72773bccd08d13f6f5906"
] | [
"save_classifier.py"
] | [
"import torchvision.models as models\nimport mlflow.pytorch\nimport torch\nfrom torchvision import transforms\nimport PIL\n\n\nwith mlflow.start_run() as run:\n # Actual training loop would have come here\n normalize = transforms.Compose( # noqa\n [transforms.ToTensor(), # noqa\n transforms.No... | [
[
"torch.jit.script"
]
] |
mhsekhavat/neuralet | [
"c44dc8f11a250524caa1ac77a7cf65dc393f2a8e"
] | [
"coral-dev-board/inception_v4_299_quant/src/server-example.py"
] | [
"import time\nfrom multiprocessing.managers import BaseManager\nfrom queue import Queue\nimport numpy as np\nimport sys\nimport os\nimport wget \n\nfrom tflite_runtime.interpreter import load_delegate\nfrom tflite_runtime.interpreter import Interpreter\n\nHOST = '127.0.0.1'\nINPUT_PORT = 50000\nINPUT_AUTH = b'input... | [
[
"numpy.expand_dims"
]
] |
franckfotso/cbir_binary_code | [
"90475b3b92285851cc8da2c38029a43aaa28f3d0"
] | [
"libs/cvprw15/feat_tools.py"
] | [
"# Project: cbir_binary_code\n# File: feat_tools\n# Written by: Franck FOTSO\n# Licensed: MIT License\n# Copyright (c) 2017\n\nimport caffe\nimport numpy as np\nimport progressbar\nimport datetime\nimport math\n\ndef pycaffe_init_feat(use_gpu, model_prototxt, model_file):\n print ('model_prototxt: {}'.format(mod... | [
[
"numpy.load",
"numpy.zeros"
]
] |
RMeli/spyrmsd | [
"3c11da5f33892e260055041df1b6b5179790c5f8"
] | [
"tests/test_molecule.py"
] | [
"import copy\nimport os\nfrom collections import defaultdict\nfrom typing import DefaultDict, List, Tuple\n\nimport numpy as np\nimport pytest\n\nfrom spyrmsd import constants, graph, io, molecule, utils\nfrom tests import molecules\n\n\n# atoms is a list of atomic numbers and atom counts\n@pytest.mark.parametrize(... | [
[
"numpy.array",
"numpy.zeros",
"numpy.random.rand",
"numpy.allclose"
]
] |
dicastro/tfm | [
"af875dd099288494a1f02a831e42d900d6cac29b"
] | [
"gen_anchors.py"
] | [
"import random\nimport argparse\nimport numpy as np\n\nfrom annotations import parse_voc_annotation, parse_txt_annotation\nimport json\n\ndef IOU(ann, centroids):\n w, h = ann\n similarities = []\n\n for centroid in centroids:\n c_w, c_h = centroid\n\n if c_w >= w and c_h >= h:\n s... | [
[
"numpy.abs",
"numpy.ones",
"numpy.argmin",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
RTHMaK/RPGOne | [
"3f3ada7db1762781668bfb2377154fdc00e17212"
] | [
"deep_qa-master/tests/layers/backend/batch_dot_test.py"
] | [
"# pylint: disable=no-self-use,invalid-name\nimport numpy\nfrom numpy.testing import assert_almost_equal\nimport keras.backend as K\nfrom keras.layers import Input, Masking\nfrom keras.models import Model\n\nfrom deep_qa.layers.backend.batch_dot import BatchDot\nfrom deep_qa.layers.wrappers.output_mask import Outpu... | [
[
"numpy.array",
"numpy.einsum",
"numpy.random.randint"
]
] |
jackson-code/Delta | [
"ff4c1df4dc75d9ff88025d37d5cd3216a5f353ff"
] | [
"belt - 1104/isolation_forest.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 21 20:35:15 2021\n\n@author: user\n\"\"\"\nfrom sklearn.ensemble import IsolationForest\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.metrics import ConfusionMatrixDisplay\nfrom sklearn.metrics im... | [
[
"matplotlib.pyplot.legend",
"pandas.concat",
"pandas.Series",
"matplotlib.pyplot.title",
"sklearn.metrics.ConfusionMatrixDisplay",
"matplotlib.pyplot.annotate",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"pandas.Series.to_list"... |
cerad95/job-scraper | [
"3841c34d0ead57089fce192bd285faccfcf8f5da"
] | [
"src/job_searcher.py"
] | [
"import asyncio\nimport os\nfrom sys import platform as _platform\n\nimport pandas\nfrom graduateland import graduateland\nfrom gspread import spreadsheet\nfrom jindex import jindex\nfrom pip._vendor.colorama import Fore\nfrom tqdm import tqdm\n\n\nasync def fetch(session, url):\n async with session.get(url) as ... | [
[
"pandas.concat"
]
] |
sweb/pandas | [
"db051b94d50cec2a5f2a160b36d67716c47839c7"
] | [
"pandas/tests/arrays/test_timedeltas.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pytest\n\nimport pandas as pd\nfrom pandas.core.arrays import TimedeltaArrayMixin as TimedeltaArray\nimport pandas.util.testing as tm\n\n\nclass TestTimedeltaArrayConstructor(object):\n def test_non_array_raises(self):\n with pytest.raises(ValueError,... | [
[
"pandas.timedelta_range",
"pandas.util.testing.assert_numpy_array_equal",
"pandas.util.testing.assert_timedelta_array_equal",
"pandas.core.arrays.TimedeltaArrayMixin",
"pandas.Timedelta",
"numpy.dtype",
"pandas.core.arrays.TimedeltaArrayMixin._from_sequence",
"numpy.array"
]
] |
eakgun/LSTM-TimeSeries-Forecasting | [
"177a5134df87ccf08d057a65b46dfcf87c0dec76"
] | [
"TSMethods.py"
] | [
"# Time Series\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\ndef create_series(df, xcol, datecol):\r\n # Create a dataframe with the features and the date time as the index\r\n features_considered = [xcol]\r\n features = df[features_considered]\r\n features.index = df[datecol]\r\n #... | [
[
"matplotlib.pyplot.plot",
"numpy.log",
"matplotlib.pyplot.show"
]
] |
JasonZK/Soccer_OCR | [
"b26ca9068f1a10f00210d66fa4ae27dad89e71b2"
] | [
"get_goal.py"
] | [
"import os\nos.environ['KMP_DUPLICATE_LIB_OK']='True'\nimport easyocr\nimport matplotlib.pyplot as plt # plt 用于显示图片\nimport re\nfrom paddleocr import PaddleOCR, draw_ocr\nimport cv2 as cv\nimport numpy as np\nimport time\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\n\nkeyword1 = \"goal\"\n\n\n# print(BA... | [
[
"numpy.asarray"
]
] |
charmichaniyara/ga-learner-dsmp-repo | [
"b807ae5e9373e8b95426ff888e6ca6f6b3bbe2c1"
] | [
"Numpy/code.py"
] | [
"# --------------\n# Importing header files\r\nimport numpy as np\r\nimport warnings\r\n\r\nwarnings.filterwarnings('ignore')\r\n\r\n#New record\r\nnew_record=[[50, 9, 4, 1, 0, 0, 40, 0]]\r\n\r\n#Reading file\r\n#Step1\r\ndata = np.genfromtxt(path, delimiter=\",\", skip_header=1)\r\n\r\n#Code starts here\r\n\... | [
[
"numpy.std",
"numpy.array",
"numpy.genfromtxt"
]
] |
geffy/retailhero-recommender-solution | [
"9e94f313146acd87bd09fe8ab63e4f58f22b9a3e"
] | [
"src/featurizer/feature_extractor.py"
] | [
"import copy\nimport pickle\nfrom collections import defaultdict\nfrom typing import Any, List, Set, Tuple\n\nimport implicit\nfrom scipy.stats import rankdata\n\nfrom src.featurizer.client_profile import ClientProfile\nfrom src.featurizer.daily import DailyScorer, split_date\nfrom src.featurizer.nn import WrapperN... | [
[
"scipy.stats.rankdata"
]
] |
chandlerbing65nm/PVT | [
"e171519b2a1a44e36ebdf0732f274a190b50ce29"
] | [
"detection/get_flops.py"
] | [
"import argparse\n\nimport torch\nfrom mmcv import Config, DictAction\n\nfrom mmdet.models import build_detector\n\ntry:\n from mmcv.cnn import get_model_complexity_info\nexcept ImportError:\n raise ImportError('Please upgrade mmcv to >0.6.2')\n#import pvt\n#import pvt_v2\nfrom mmcv.cnn.utils.flops_counter im... | [
[
"torch.cuda.is_available"
]
] |
bsautermeister/tensorflow-handwriting-demo | [
"73292f3bfc4fd9dcdad0d6e77d72c82c87e15d7e"
] | [
"tensorflow/utils/tensor.py"
] | [
"\"\"\" Tensorflow related utility functions. \"\"\"\nfrom __future__ import absolute_import, division, print_function\n\nimport tensorflow as tf\n\n\ndef get_num_trainable_params():\n total_parameters = 0\n for variable in tf.trainable_variables():\n # shape is an array of tf.Dimension\n shape ... | [
[
"tensorflow.trainable_variables"
]
] |
StevenGrove/LearnableTreeFilterV2 | [
"3814a5a84c0a5c33d6538749eaf5aed4827366de"
] | [
"cvpods/evaluation/crowdhuman_evaluation.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport copy\nimport itertools\nimport json\nimport logging\nimport os\nfrom collections import OrderedDict\n\nimport numpy as np\nimport pycocotools.mask as mask_util\n\nimport torch\n\nfrom cvpods.data.datasets.coco import convert_to_coco_jso... | [
[
"torch.device",
"numpy.array",
"numpy.concatenate",
"torch.save"
]
] |
BGTCapital/hummingbot | [
"2c50f50d67cedccf0ef4d8e3f4c8cdce3dc87242",
"2c50f50d67cedccf0ef4d8e3f4c8cdce3dc87242"
] | [
"hummingbot/connector/exchange/okex/okex_api_order_book_data_source.py",
"hummingbot/strategy/perpetual_market_making/perpetual_market_making.py"
] | [
"#!/usr/bin/env python\n\nimport aiohttp\nimport asyncio\n\nimport json\nimport logging\nimport pandas as pd\nimport time\nfrom typing import (\n Any,\n AsyncIterable,\n Dict,\n List,\n Optional,\n)\nimport websockets\nfrom websockets.exceptions import ConnectionClosed\n\nfrom hummingbot.core.data_ty... | [
[
"pandas.DataFrame.from_records",
"pandas.Timedelta",
"pandas.Timestamp.utcnow"
],
[
"pandas.DataFrame"
]
] |
Zarand3r/corona_light | [
"96482cfb6fff8959772ccd48c10ce0588b191f18"
] | [
"models/submissions/epidemiological/version3_0/generate_submission3_0_2.py"
] | [
"############################################\n# Adapted from code written by August Chen #\n############################################\nimport pandas as pd\nimport numpy as np\nimport os\nimport csv\nimport datetime\nimport git\nimport sys\nrepo = git.Repo(\"./\", search_parent_directories=True)\nhomedir = repo.... | [
[
"numpy.array"
]
] |
puchapu/transferlearning | [
"1f14c192706db52e3982daae623b5bbabb31ab57"
] | [
"code/DeepDA/models.py"
] | [
"import torch\nimport torch.nn as nn\nfrom transfer_losses import TransferLoss\nimport backbones\n\n\nclass TransferNet(nn.Module):\n def __init__(self, num_class, base_net='resnet50', transfer_loss='mmd', use_bottleneck=True, bottleneck_width=256, max_iter=1000, **kwargs):\n super(TransferNet, self).__in... | [
[
"torch.nn.Sequential",
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.softmax",
"torch.nn.Linear",
"torch.nn.ReLU"
]
] |
jmenashe/keras-rl | [
"e94ef887f5fb45d800d458f732e707a82c8b9b7d"
] | [
"rl/policy.py"
] | [
"from __future__ import division\nimport numpy as np\n\nfrom rl.util import *\n\n\nclass Policy(object):\n \"\"\"Abstract base class for all implemented policies.\n\n Each policy helps with selection of action to take on an environment.\n\n Do not use this abstract base class directly but instead use one o... | [
[
"numpy.sqrt",
"numpy.clip",
"numpy.random.gumbel",
"numpy.ones",
"numpy.argmax",
"numpy.random.random_integers",
"numpy.random.uniform",
"numpy.sum"
]
] |
JaiWillems/celest | [
"5074b94feecc39127e5b0b0b1a683f636b725ca4"
] | [
"celest/encounter/groundposition.py"
] | [
"\n\nimport numpy as np\n\n\nclass GroundPosition(object):\n \"\"\"GroundPosition(latitude, longitude)\n\n Localize Earth surface location information.\n\n Parameters\n ----------\n latitude : float\n Lattitude of the location in decimal degrees.\n longitude : float\n Longitude of th... | [
[
"numpy.cos",
"numpy.radians",
"numpy.sqrt",
"numpy.sin"
]
] |
KenzoDezotti/cursoemvideo | [
"6eba03e67192f7384092192ed2cc1a8e59efd9b9"
] | [
"data science Izero/regressao.py"
] | [
"from matplotlib import pyplot as plt\nfrom collections import Counter\nfrom typing import List, Callable\n\n\nnum_friends = [100.0,49,41,40,25,21,21,19,19,18,18,16,15,15,15,15,14,14,13,13,13,13,12,12,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,8,8,8,8,8,8,8,8,8,8,8,8,7,7,7... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
vitaut/pytorch | [
"7bc5962329f2b4c976ce01c0601255721cc5a2e0"
] | [
"torch/ao/quantization/fx/quantization_patterns.py"
] | [
"import torch\nfrom torch.fx import GraphModule\nfrom torch.fx.graph import (\n Node,\n Graph,\n)\nfrom ..observer import (\n default_affine_fixed_qparams_observer,\n default_symmetric_fixed_qparams_observer,\n)\n\nfrom ..quantization_mappings import (\n get_static_quant_module_class,\n get_dynami... | [
[
"torch.ao.quantization.quantize.is_activation_post_process"
]
] |
Kyubyong/neurobind | [
"f872dbe76ea76f8dfa2423d99ccc44031a41591a"
] | [
"validation_check.py"
] | [
"# -*- coding: utf-8 -*-\n# /usr/bin/python2\n'''\nBy kyubyong park. kbpark.linguist@gmail.com.\nhttps://www.github.com/kyubyong/neurobind.\n'''\n\nfrom __future__ import print_function\n\nimport os\n\nfrom scipy.stats import spearmanr\n\nfrom data_load import get_batch_data, load_data\nfrom hyperparams import Hype... | [
[
"tensorflow.ConfigProto",
"scipy.stats.spearmanr",
"tensorflow.train.latest_checkpoint",
"tensorflow.train.Supervisor"
]
] |
pysepty/finvizfinance | [
"ca270e7bd07da4d4c88b152fff936024713a09ef"
] | [
"finvizfinance/screener/custom.py"
] | [
"import pandas as pd\nfrom finvizfinance.screener.overview import Overview\nfrom finvizfinance.util import webScrap, progressBar, NUMBER_COL\n\"\"\"\n.. module:: screen.custom\n :synopsis: screen custom table.\n\n.. moduleauthor:: Tianning Li <ltianningli@gmail.com>\n\"\"\"\n\ncolumns = {\n 0: 'No.',\n 1: '... | [
[
"pandas.DataFrame"
]
] |
StephenSpicer/Unit03_Sprint02_Clone | [
"be64a7f1ce6f94baa13b9f690d2e0b61a0df126b"
] | [
"module2-sql-for-analysis/titanic_to_sql.py"
] | [
"\"\"\" lets send that titanic csv on over to an sqlite db \"\"\"\n\nimport pandas as pd\nimport sqlite3\n\ndf_titanic = pd.read_csv('titanic.csv')\n\ndf_titanic = df_titanic.replace(\"'\", \" \", regex=True)\n\n\nconn = sqlite3.connect('titanic_to_sql.sqlite3')\nconn\n\ncurs = conn.cursor()\ncurs\n\ndf_titanic.to_... | [
[
"pandas.read_csv"
]
] |
danzelenak-usgs/Science_Validation | [
"b437f1c90772227f2b509bd66ea57ba27d6461e6"
] | [
"espa_validation/validate_data/file_io.py"
] | [
"\"\"\"Various methods for interacting with files\"\"\"\n\nimport sys\nimport os\nimport logging\nimport tarfile\nimport time\nimport fnmatch\nimport shutil\nimport itertools\n\n\nclass Extract:\n @staticmethod\n def unzip_gz_files(tests: list, masts: list) -> None:\n \"\"\"\n Extract files from... | [
[
"matplotlib.pyplot.imshow",
"numpy.abs",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.colorbar",
"numpy.std",
"numpy.mean",
"numpy.shape",
"matplotlib.pyplot.close",
"numpy.ma.masked_where",
"matplotlib.pyplot.hist",
"numpy.float"
]
] |
piglaker/SpecialEdition | [
"172688ef111e1b5c62bdb1ba0a523a2654201b90",
"172688ef111e1b5c62bdb1ba0a523a2654201b90"
] | [
"models/bert/modeling_bert_v4.py",
"utils/fastNLP_module.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.nn.Softmax",
"torch.cat",
"torch.zeros",
"torch.nn.Embedding",
"torch.nn.BCEWithLogitsLoss",
"torch.where",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"torch.softmax",
"torch.einsum",
"torch.from_numpy",
"torch.tensor",
"tensorflow... |
sailfish009/ReAgent | [
"cb425ca6a161b687c81a74a0cbad849cf43803f8"
] | [
"ml/rl/test/gym/world_model/test_state_embed_gym.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport json\nimport logging\nimport random\nimport unittest\nfrom typing import List\n\nimport numpy as np\nimport torch\nfrom ml.rl.json_serialize import json_to_object\nfrom ml.rl.test.base.horizon_test_base import... | [
[
"torch.manual_seed",
"torch.cuda.is_available",
"numpy.random.seed"
]
] |
dnanexus/dnanexus-example-applets | [
"04a6abebfef3039416cede58f39a8c3542468d3b"
] | [
"Tutorials/python/dash-web-app/resources/home/dnanexus/my_app.py"
] | [
"# -*- coding: utf-8 -*-\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport pandas as pd\nimport plotly.graph_objs as go\n\ndef create_app():\n app = dash.Dash(__name__)\n\n df = pd.read_csv('gdp-life-exp-2007.csv')\n app.layout = html.Div(children=[\n html... | [
[
"pandas.read_csv"
]
] |
logic-and-learning/AdvisoRL | [
"3bbd741e681e6ea72562fec142d54e9d781d097d"
] | [
"src/tester/livetester.py"
] | [
"import os, copy\nfrom datetime import datetime\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\n\nclass LiveTester:\n \"\"\"\n Plotter for one experiment.\n \"\"\"\n def __init__(self, curriculum, *,\n label=None, filebasename=None,\n s... | [
[
"matplotlib.lines.Line2D",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ioff",
"numpy.append",
"numpy.average",
"numpy.array",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.ion"
]
] |
alexnowakvila/pystruct | [
"fda06786999e3cfc168046cfce2ac976f0adfd70"
] | [
"pystruct/learners/generalized_frankwolfe_ssvm.py"
] | [
"######################\n# Authors:\n# Xianghang Liu <xianghangliu@gmail.com>\n# Andreas Mueller <amueller@ais.uni-bonn.de>\n#\n# License: BSD 3-clause\n#\n# Implements structured SVM as described in Joachims et. al.\n# Cutting-Plane Training of Structural SVMs\n\nimport warnings\nfrom time import time\nimport ... | [
[
"numpy.sum",
"numpy.arange",
"numpy.zeros",
"sklearn.utils.check_random_state"
]
] |
Eddie-Hwang/Co-Eye_Motion_Generation | [
"8e244680115fb63bc26018cb6b53bcfbd04e9683"
] | [
"Transformer/model.py"
] | [
"from Transformer.layers import EncoderLayer, DecoderLayer\nfrom Transformer.modules import PositionalEncoding\n\nimport torch.nn as nn\nimport torch\n\n\ndef get_pad_mask(seq, pad_idx):\n return (seq == pad_idx).unsqueeze(-2)\n\ndef get_subsequent_mask(seq):\n sz_b, len_s, sz_d = seq.size()\n subsequent_m... | [
[
"torch.nn.Dropout",
"torch.ones",
"torch.nn.Embedding",
"torch.nn.LayerNorm",
"torch.nn.init.xavier_uniform_"
]
] |
bgerofi/mlperf-deepcam | [
"5e6524b30372d916a224ef826988128638264723"
] | [
"src/deepCam/utils/parsing_helpers.py"
] | [
"# The MIT License (MIT)\n#\n# Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without l... | [
[
"torch.optim.lr_scheduler.MultiStepLR"
]
] |
ma-compbio/Phylo-HMRF | [
"47b1d0eb11dc1674b8cd1a0710a29ff4232c733e"
] | [
"base.py"
] | [
"from __future__ import print_function\n\nimport string\nimport sys\nimport os\nfrom collections import deque\n\nimport numpy as np\nfrom scipy.misc import logsumexp\nfrom sklearn.base import BaseEstimator, _pprint\nfrom sklearn.utils import check_array, check_random_state\nfrom sklearn.utils.validation import chec... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.full"
]
] |
ahalfpen727/Genomic-Analyses-w-Python | [
"7da10e4bb7d5ca0bdb2cf77870be8a55ad4fc082"
] | [
"scripts/single_vcf_stats.py"
] | [
"import argparse\nfrom collections import defaultdict\nimport gzip\n\nimport numpy as np\nfrom text_histogram import histogram\n\n\np = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\np.add_argument(\"vcf\", nargs=\"+\")\nargs = p.parse_args()\n\nvcf_paths = args.vcf\n\nc = defaultd... | [
[
"numpy.log2"
]
] |
pschindler/Cirq | [
"b008e8373c2025ae28eaf3b7c21b7a0b307f860e"
] | [
"cirq/contrib/quantum_volume/quantum_volume.py"
] | [
"\"\"\"Utility functions to run the Quantum Volume benchmark defined by IBM in\nhttps://arxiv.org/abs/1811.12926.\n\"\"\"\n\nfrom typing import Optional, List, cast, Callable, Dict, Tuple, Set\nfrom dataclasses import dataclass\n\nimport numpy as np\nimport pandas as pd\n\nimport cirq\nimport cirq.contrib.routing a... | [
[
"numpy.in1d",
"numpy.abs"
]
] |
Helianus/Reinforcement-Learning-Specialization-Coursera | [
"fef680e97da195aaf65c74d933d8d4a7983ac561"
] | [
"1-Fundamentals-of-Reinforcement-Learning/Bandits/ten_arm_env.py"
] | [
"#!/usr/bin/env python\n\nfrom rlglue.environment import BaseEnvironment\n\nimport numpy as np\n\nclass Environment(BaseEnvironment):\n \"\"\"Implements the environment for an RLGlue environment\n\n Note:\n env_init, env_start, env_step, env_cleanup, and env_message are required\n methods.\n ... | [
[
"numpy.random.randn"
]
] |
Pratheebhak/Digitize-Docs | [
"14521b2687011927b016f7eebef12f145b4fa894"
] | [
"source/extract.py"
] | [
"\"\"\" Extract entities from the handwritten OCR text \"\"\"\n\"\"\" Parts of code redacted due to copyright \"\"\"\n\n\nimport spacy\nimport pandas as pd\nimport re\nimport jellyfish\nfrom fuzzywuzzy import fuzz\n\n\nclass handwrittenText:\n\n nlp = spacy.load(\"en_core_web_sm\")\n\n # Load the input data i... | [
[
"pandas.read_csv"
]
] |
madtomy/udacity_image_classifier | [
"e5f6fa54ebe8f405b99905a12c29588e9aaf4d1d"
] | [
"predict.py"
] | [
"#!/usr/bin/env python3\n'''\nusage: python predict.py /path/to/image checkpoint\n\nOptions:\n- Return most likely classes: python predict.py input checkpoint --top_k 3\n- Use a mapping of categories to names: python predict.py input checkpoint --category_names cat_to_name.json\n- Use GPU for inference: python pred... | [
[
"torch.load",
"torch.topk",
"torch.from_numpy",
"torch.exp",
"torch.no_grad",
"torch.device",
"numpy.array"
]
] |
mlares/iate_audit | [
"3ae8aff2b3de853d43619c592ac8cedf0ff35591"
] | [
"pinnacle/pub_dataviz.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# PUB_DATAVIZ: Visualization tools for PINNACLE\n# Copyright (c) 2020, Marcelo Lares\n#\n# MIT License:\n# https://github.com/IATE-CONICET-UNC/pinnacle/blob/master/LICENSE\n\nfrom matplotlib import pyplot as plt\nfrom pinnacle.plot_styles import cycling_attrs, aes... | [
[
"numpy.arange",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.histogram",
"matplotlib.pyplot.figure"
]
] |
JaiWillems/SatPy | [
"a46d01d14976828eabc63b4a86c6cb97e2ae4c41"
] | [
"celest/encounter/_encounter_math_utils.py"
] | [
"\"\"\"Encounter indices utilities.\n\nThis module contains the geometric utilities necessary for analytical pass\nanalysis implementation.\n\"\"\"\n\n\nfrom typing import Literal\nimport numpy as np\n\n\ndef _cone_constraint(theta: np.array, U: np.array, X: np.array) -> np.array:\n \"\"\"Return an array of indi... | [
[
"numpy.radians",
"numpy.degrees",
"numpy.linalg.norm",
"numpy.full",
"numpy.sin",
"numpy.intersect1d",
"numpy.where",
"numpy.divide"
]
] |
amit17133129/pyMG-2016 | [
"b82a60811bb0a8b91d8793c47177a240221f9176",
"b82a60811bb0a8b91d8793c47177a240221f9176"
] | [
"project/mymultigrid.py",
"project/poisson1d.py"
] | [
"import scipy.sparse.linalg as sLA\nimport numpy as np\n\nfrom pymg.multigrid_base import MultigridBase\n\n\nclass MyMultigrid(MultigridBase):\n \"\"\"Implementation of a multigrid solver with different cycle implementations\n \"\"\"\n\n def __init__(self, ndofs, nlevels):\n \"\"\"Initialization rou... | [
[
"numpy.log2",
"numpy.zeros",
"scipy.sparse.linalg.spsolve"
],
[
"scipy.sparse.spdiags",
"numpy.array",
"numpy.zeros"
]
] |
Kait0/leaderboard | [
"e44c169d541832439f98c70b33cfe6f7d89dfa31"
] | [
"team_code/transfuser_agent.py"
] | [
"import os\nimport json\nimport datetime\nimport pathlib\nimport time\nimport cv2\nimport carla\nfrom collections import deque\n\nimport torch\nimport carla\nimport numpy as np\nfrom PIL import Image\n\nfrom leaderboard.autoagents import autonomous_agent\nfrom transfuser.model import TransFuser\nfrom transfuser.con... | [
[
"numpy.cos",
"numpy.sin",
"torch.FloatTensor",
"torch.no_grad",
"torch.stack",
"numpy.array"
]
] |
SiliconScientist/protein-surface-calculator | [
"ffc1243c2f65d359006a039fb2cdae92005916dd"
] | [
"protein_surface_calculator.py"
] | [
"import os\nimport freesasa\nimport numpy as np\n\ntaxa = ['psychro', 'thermo']\nnum_taxa = len(taxa)\n\n# Create empty arrays to contain the ratios or their averages\nratio = [[] for i in range(num_taxa)]\nratio_mean = []\n\n# Loop for each taxa\nfor i in range(num_taxa):\n # Locate folder for use use\n path... | [
[
"numpy.max",
"numpy.mean",
"numpy.min"
]
] |
nontas/menpo3d | [
"f29324b12a147f5b716ae5c3048d2c6b7a298752"
] | [
"menpo3d/io/output/mesh.py"
] | [
"import numpy as np\n\nfrom menpo.io.output.base import _enforce_only_paths_supported\nfrom menpo.shape.mesh import TexturedTriMesh\n\n\ndef obj_exporter(mesh, file_handle, **kwargs):\n r\"\"\"\n Given a file handle to write in to (which should act like a Python `file`\n object), write out the mesh data. N... | [
[
"numpy.concatenate",
"numpy.empty"
]
] |
m1m0r1/lh_calib | [
"ff16083e0250517ee7a18aab1931d2a576736bc8",
"ff16083e0250517ee7a18aab1931d2a576736bc8"
] | [
"lh_calib/simulation/debias_effect.py",
"lh_calib/predictions.py"
] | [
"import logging\nimport pandas as pd\nimport numpy as np\nimport scipy\nfrom argtools import command, argument\nfrom tqdm import tqdm\nimport sys\nsys.path.insert(0, __file__.rsplit('/', 3)[0])\nfrom lh_calib import evaluation\nfrom lh_calib import predictions\nimport itertools\n\ndef create_probs(N, alpha=1., K=2)... | [
[
"numpy.log",
"numpy.random.seed",
"numpy.ones",
"numpy.random.multinomial",
"pandas.DataFrame.from_records",
"numpy.exp",
"numpy.random.dirichlet"
],
[
"pandas.read_csv",
"numpy.clip",
"numpy.asarray",
"numpy.isnan",
"numpy.ones",
"numpy.finfo"
]
] |
Floozutter/buzzspike | [
"fadb44bcae234695e19cee9ecf27e8f7afe0515d"
] | [
"bzsp/core.py"
] | [
"from . import recog\nimport cv2\nimport numpy\nfrom numpy import ndarray\nfrom typing import Iterable\n\ndef handle_source(source: Iterable[ndarray], delay: int) -> None:\n maskname = \"\"\n show_green_chevrons = True\n show_green_boxes = True\n show_red_chevrons = True\n show_red_boxes = True\n ... | [
[
"numpy.where"
]
] |
artvalencio/coupledlogistic | [
"15015329c808e5faf606b350d8577e05a1c1b302"
] | [
"coupledlogistic/coupledlogistic.py"
] | [
"def coupledlogistic(tslength,r,A,sigma,couplingtype,verbose=False):\r\n '''Generates time-series dynamics for coupled logistic networks of parameter r\r\n --------------------------------\r\n Inputs:\r\n tslength: length of the time-series (number of points)\r\n r: logistic map free pa... | [
[
"numpy.random.random",
"numpy.full",
"numpy.ones",
"numpy.floor",
"numpy.array"
]
] |
AisahAlfiyatusR/Image_Retrieval_Heroku | [
"5db06ebe95926810601a563ebf45d6f5b2cfc89f",
"5db06ebe95926810601a563ebf45d6f5b2cfc89f"
] | [
"venv/share/doc/networkx-2.6.3/examples/subclass/plot_printgraph.py",
"venv/share/doc/networkx-2.6.3/examples/drawing/plot_weighted_graph.py"
] | [
"\"\"\"\n===========\nPrint Graph\n===========\n\nExample subclass of the Graph class.\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport networkx as nx\nfrom networkx import Graph\n\n\nclass PrintGraph(Graph):\n \"\"\"\n Example subclass of the Graph class.\n\n Prints activity log to file or standard outp... | [
[
"matplotlib.pyplot.show"
],
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
jinsanity07git/tmip-emat | [
"ff816cf50f141825078bb276d6da46d92c5028a9",
"ff816cf50f141825078bb276d6da46d92c5028a9",
"ff816cf50f141825078bb276d6da46d92c5028a9"
] | [
"emat/analysis/explore_2/explore_visualizer.py",
"emat/database/sqlite/callback.py",
"tests/test_road_test.py"
] | [
"import numpy\nimport pandas\nimport warnings\nimport functools\nfrom ...viz import colors\nfrom ...scope.box import GenericBox\nfrom ...database import Database\nfrom traitlets import TraitError\n\nfrom plotly import graph_objs as go\n\nfrom ipywidgets import Dropdown\nimport ipywidgets as widget\n\nimport logging... | [
[
"pandas.CategoricalDtype",
"pandas.DataFrame",
"numpy.ceil",
"numpy.histogram",
"numpy.sum"
],
[
"numpy.asarray",
"numpy.arange",
"pandas.Series",
"numpy.empty"
],
[
"pandas.testing.assert_frame_equal",
"pandas.DataFrame"
]
] |
ssmithTaylor/openpilot | [
"ae1083d700190eb050d1da1ce88ecd53a790a61d"
] | [
"selfdrive/debug/toyota_eps_factor.py"
] | [
"#!/usr/bin/env python3\nimport sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn import linear_model # pylint: disable=import-error\nfrom selfdrive.car.toyota.values import STEER_THRESHOLD\n\nfrom tools.lib.route import Route\nfrom tools.lib.logreader import MultiLogIterator\n\nMIN_SAMPLES = ... | [
[
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.show",
"sklearn.linear_model.LinearRegression"
]
] |
ChenddatHKU/scanpy | [
"1b290be6fd297023a0bd705e66f69254c1626fc4"
] | [
"scanpy/tools/_rank_genes_groups.py"
] | [
"\"\"\"Rank genes according to differential expression.\n\"\"\"\nfrom math import floor\nfrom typing import Iterable, Union, Optional\n\nimport numpy as np\nimport pandas as pd\nfrom anndata import AnnData\nfrom scipy.sparse import issparse, vstack\n\nfrom .. import _utils\nfrom .. import logging as logg\nfrom ..pr... | [
[
"numpy.minimum",
"numpy.sqrt",
"pandas.MultiIndex.from_tuples",
"pandas.DataFrame",
"scipy.sparse.vstack",
"numpy.exp",
"numpy.where",
"scipy.sparse.issparse",
"numpy.arange",
"numpy.diff",
"numpy.insert",
"numpy.argpartition",
"numpy.count_nonzero",
"numpy.... |
shakedmanes/neural-net-circular-gol | [
"317a3ef2d52508d86c0118b235b794f1ac6d3717"
] | [
"neural_network_circular_gol/optimizers.py"
] | [
"import numpy as np\n\n\n# Adam optimizer\nclass OptimizerADAM:\n \"\"\"\n Adaptive Momentum Stochastic Gradient Decent Optimizer.\n \"\"\"\n\n def __init__(\n self,\n learning_rate=0.001,\n decay=0.,\n epsilon=1e-7,\n beta_1=0.9,\n beta_... | [
[
"numpy.zeros_like",
"numpy.sqrt"
]
] |
ayzk/ft-caffe-public | [
"888399c2fcf90c227416576a5a265b218c6be5da"
] | [
"examples/web_demo/app.py"
] | [
"# \n# All modification made by Intel Corporation: Copyright (c) 2016 Intel Corporation\n# \n# All contributions by the University of California:\n# Copyright (c) 2014, 2015, The Regents of the University of California (Regents)\n# All rights reserved.\n# \n# All other contributions:\n# Copyright (c) 2014, 2015, th... | [
[
"numpy.dot",
"numpy.array",
"numpy.load"
]
] |
pkgw/neurosynchro | [
"f21d198e01146988944728231417ff601b706379"
] | [
"neurosynchro/cli.py"
] | [
"#! /usr/bin/env python\n# -*- mode: python; coding: utf-8 -*-\n# Copyright 2017-2018 Peter Williams and collaborators.\n# Licensed under the MIT License.\n\n\"\"\"Command-line access to neurosynchro functionality.\n\n\"\"\"\nfrom __future__ import absolute_import, division, print_function\n\nimport argparse, sys\n... | [
[
"numpy.nanmax",
"numpy.sqrt",
"numpy.isfinite",
"numpy.isnan",
"numpy.nanmin",
"numpy.sign"
]
] |
ibeauregard/tensorflow | [
"8e2be96fdc388049efe4bdbfa7a92e139ed0f4cb",
"20bc44d8fc2feee4c63dd90e49dbcdf34ed6564c"
] | [
"tensorflow/python/distribute/coordinator/cluster_coordinator.py",
"tensorflow/lite/python/lite_v2_test.py"
] | [
"# Lint as: python3\n# Copyright 2020 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... | [
[
"tensorflow.python.ops.variable_scope.variable_creator_scope",
"tensorflow.python.platform.tf_logging.error",
"tensorflow.python.eager.context.executor_scope",
"tensorflow.python.framework.ops.device",
"tensorflow.python.eager.context.context",
"tensorflow.python.eager.context.executing_ea... |
Ulysses0817/Autoencoder | [
"b7a088d884cbbeca44669027130a0c458ee7be75"
] | [
"dnn_app_utils_v2.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport h5py\nimport math\nimport os\nfrom forward import *\n#os.makedirs(\"F:\\\\ProgramData\\\\NVIDIA Corporation\\\\CUDA Samples\\\\v9.0\")\n# def sigmoid(Z):\n\t# \"\"\"\n\t# Implements the sigmoid activation in numpy\n\t\n\t# Arguments:\n\t# Z -- numpy array... | [
[
"numpy.sum",
"matplotlib.pyplot.subplot",
"numpy.argmax",
"matplotlib.pyplot.axis",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
FelixZhang7/miemiedetection | [
"ca44f33255e0bb9d6150044983a344fb9a288c08"
] | [
"mmdet/models/custom_layers.py"
] | [
"#! /usr/bin/env python\n# coding=utf-8\n# ================================================================\n#\n# Author : miemie2013\n# Created date:\n# Description :\n#\n# ================================================================\nimport torch\nimport torch as T\nimport torch.nn.functional as F\... | [
[
"torch.cat",
"torch.zeros",
"torch.where",
"torch.pow",
"torch.tile",
"torch.reshape",
"torch.randn",
"torch.from_numpy",
"torch.tensor",
"torch.rand",
"torch.arange",
"torch.nn.GroupNorm",
"torch.nn.functional.max_pool2d",
"torch.nn.functional.softplus",
... |
aminekechaou/detectron2 | [
"3772b9316f8a2e6bf55cf5868dd64214d7f7c49a"
] | [
"detectron2/data/datasets/cityscapes.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport functools\nimport json\nimport logging\nimport multiprocessing as mp\nimport numpy as np\nimport os\nfrom itertools import chain\nimport pycocotools.mask as mask_util\nfrom PIL import Image\n\nfrom detectron2.structures import BoxMode\n... | [
[
"numpy.asarray",
"numpy.nonzero",
"numpy.unique"
]
] |
baymlab/wastewater_analysis | [
"b009452669fa32c9a1a204c461725dd0a3a996c9"
] | [
"analysis/plot_sequence_diversity.py"
] | [
"#!/usr/bin/env python3\n\nimport sys\nimport os\nimport argparse\nimport matplotlib.pyplot as plt\n\ncolors = {\n 'B.1.1.7': (0.4980392156862745, 0.788235294117647, 0.4980392156862745, 1.0),\n 'B.1.351': (0.9921568627450981, 0.7529411764705882, 0.5254901960784314, 1.0),\n 'B.1.427': (0.2196078431372549, 0... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.ylabel"
]
] |
savelov/artview | [
"83c918757d6ae51cecc7589af4ab279e2c750bfe"
] | [
"artview/components/correlation.py"
] | [
"\"\"\"\nplot_radar.py\n\nClass instance used to make Display.\n\"\"\"\n# Load the needed packages\nimport numpy as np\nimport scipy\nimport os\nimport pyart\n\nfrom matplotlib.backends.qt_compat import is_pyqt5\nif is_pyqt5():\n from matplotlib.backends.backend_qt5agg import (\n FigureCanvas, NavigationT... | [
[
"numpy.linspace",
"matplotlib.figure.Figure",
"numpy.ma.log10",
"numpy.ma.getmaskarray",
"matplotlib.backends.qt_compat.is_pyqt5",
"scipy.stats.linregress",
"numpy.log10",
"numpy.ma.masked_where",
"numpy.ma.MaskedArray"
]
] |
WeichenXu123/spark-sklearn | [
"cbde36f6311b73d967e2ec8a97040dfd71eca579"
] | [
"python/spark_sklearn/test_utils.py"
] | [
"\"\"\"\nSome test utilities to create the spark context.\n\"\"\"\n\nimport numpy as np\nimport os\nimport pandas as pd\nimport random\nfrom scipy.sparse import csr_matrix\nimport time\nfrom pyspark.sql import SparkSession\nfrom pyspark.ml.linalg import Vectors\nfrom spark_sklearn.util import createLocalSparkSessio... | [
[
"numpy.array",
"pandas.util.testing.assert_almost_equal",
"numpy.random.seed"
]
] |
VisualJoyce/caffe2 | [
"28523ff1ff33f18eaf8b04cc4e0f308826e1861a"
] | [
"caffe2/distributed/store_ops_test_util.py"
] | [
"# Copyright (c) 2016-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"numpy.full"
]
] |
jasonke1225/AI-introduction | [
"0748198fc926b1e2f79d2c679ef964ffcfa4ca45"
] | [
"JasonKe-v1/preprocess.py"
] | [
"#%%\n### make sure the file in ./primevalData folder should be format {'date, open, high, low, close, volume'}\n### come from https://coinmarketcap.com/zh-tw/historical/\n### the outpur csv file will be saved in ./usefulData folder\n\nimport pandas as pd\nfrom stockstats import StockDataFrame as Sdf\nimport os\n\n... | [
[
"pandas.concat",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
besticka/acados | [
"32767a19aed01a15b5e7b83ebc6ddbd669a47954"
] | [
"examples/acados_python/test/generate_c_code.py"
] | [
"#\n# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren,\n# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor,\n# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan,\n# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl\n#\n# This file is pa... | [
[
"numpy.eye",
"numpy.ndarray",
"numpy.linalg.norm",
"numpy.array",
"numpy.zeros"
]
] |
xipingyan/opencv | [
"6a2077cbd8a8a0d8cbd3e0e8c3ca239f17e6c067"
] | [
"samples/dnn/person_reid.py"
] | [
"#!/usr/bin/env python\n'''\nYou can download a baseline ReID model and sample input from:\nhttps://github.com/ReID-Team/ReID_extra_testdata\n\nAuthors of samples and Youtu ReID baseline:\n Xing Sun <winfredsun@tencent.com>\n Feng Zheng <zhengf@sustech.edu.cn>\n Xinyang Jiang <sevjiang@tencent.... | [
[
"numpy.reshape",
"numpy.matmul",
"numpy.linalg.norm",
"numpy.finfo",
"numpy.concatenate",
"numpy.argsort",
"numpy.array"
]
] |
rafaelpossas/reinforcement-learning | [
"6e1e8057939cbcb489c714868ee650a3481b8c7c"
] | [
"TD/q_learning.py"
] | [
"import gym\nimport itertools\nimport matplotlib\nimport numpy as np\nimport pandas as pd\nimport sys\n\nif \"../\" not in sys.path:\n sys.path.append(\"../\")\n\nfrom collections import defaultdict\nfrom lib.envs.cliff_walking import CliffWalkingEnv\nfrom lib import plotting\n\nmatplotlib.style.use('ggplot')\n\ne... | [
[
"matplotlib.style.use",
"numpy.ones",
"numpy.max",
"numpy.argmax",
"numpy.zeros"
]
] |
ajz34/ML_Course_Code_Report | [
"59f02e4e6e2d85343a61162147ed6e775dc1a596"
] | [
"Gilmer_Code/chem_tensorflow.py"
] | [
"#!/usr/bin/env/python\n\nfrom typing import Tuple, List, Any, Sequence\n\nimport tensorflow as tf\nimport time\nimport os\nimport json\nimport numpy as np\nimport pickle\nimport random\n\nfrom utils import MLP, ThreadedIterator, SMALL_NUMBER\n\n\nclass ChemModel(object):\n @classmethod\n def default_params(c... | [
[
"tensorflow.reduce_sum",
"tensorflow.variables_initializer",
"tensorflow.train.AdamOptimizer",
"tensorflow.Graph",
"tensorflow.ConfigProto",
"tensorflow.clip_by_norm",
"tensorflow.name_scope",
"tensorflow.Session",
"tensorflow.square",
"tensorflow.placeholder",
"tensorf... |
reedessick/sddr | [
"f1225ad798a06bf351cf20b93c36864e5604f35a"
] | [
"sddr/plot.py"
] | [
"__doc__ = \"a method to support some basic and not-so-basic plotting functionality\"\n__author__ = \"reed.essick@ligo.org\"\n\n#-------------------------------------------------\n\nimport matplotlib\nmatplotlib.use(\"Agg\")\nfrom matplotlib import pyplot as plt\n\nimport numpy as np\n\n### non-standard libraries\n... | [
[
"matplotlib.use",
"numpy.empty_like",
"numpy.cumsum",
"numpy.ones",
"numpy.all",
"numpy.max",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.subplots_adjust",
"numpy.exp",
"numpy.sum",
"numpy.empty",
"matplotlib.pyplot.figure"
]
] |
young-geng/design-baselines-icml | [
"ce4183babac304ed5f83151a602d75de6c4740c4"
] | [
"design_baselines/coms_original/__init__.py"
] | [
"from design_baselines.data import StaticGraphTask\nfrom design_baselines.logger import Logger\nfrom design_baselines.utils import spearman\nfrom design_baselines.coms_original.trainers import ConservativeMaximumLikelihood\nfrom design_baselines.coms_original.trainers import TransformedMaximumLikelihood\nfrom desig... | [
[
"tensorflow.concat",
"numpy.concatenate",
"tensorflow.math.greater_equal",
"numpy.zeros_like",
"numpy.mean",
"tensorflow.pad",
"tensorflow.linalg.norm",
"numpy.ones_like",
"tensorflow.Variable",
"numpy.stack",
"tensorflow.gather",
"numpy.std",
"numpy.log",
"... |
angshine/pytorch3d | [
"5d9b236f41ea2175d8747f0c433b8a1c82393bed"
] | [
"pytorch3d/implicitron/tools/model_io.py"
] | [
"# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport glob\nimport logging\nimport os\nimport shutil\nimport tempfile\n\nimport torch\n\n\nlogger =... | [
[
"torch.load"
]
] |
JavisPeng/CenterNet-pytorch-detection-simple-tutorial | [
"1dd69dd26be3627079aeeb458dde35a1f3f1c5df"
] | [
"main.py"
] | [
"import torch, tqdm\nfrom models import cnet\nfrom torchvision import transforms\nfrom torch.utils.data import DataLoader\nfrom dataset import CTDataset\nfrom losses import FocalLoss, RegL1Loss\n\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\ntorch.manual_seed(41)\n\n\ndef train_epoch(epo... | [
[
"torch.load",
"torch.cat",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.unsqueeze",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
tronsgaard/tinygp | [
"11e9c869fd2a62d7c0292db3b6fa9eab46e296e5"
] | [
"tests/test_george_compat.py"
] | [
"# -*- coding: utf-8 -*-\n# mypy: ignore-errors\n\nimport numpy as np\nimport pytest\n\nfrom tinygp import GaussianProcess, kernels\n\ngeorge = pytest.importorskip(\"george\")\n\nfrom jax.config import config\n\nconfig.update(\"jax_enable_x64\", True)\n\n\n@pytest.fixture\ndef random():\n return np.random.defaul... | [
[
"numpy.log",
"numpy.sqrt",
"numpy.random.default_rng",
"numpy.sin"
]
] |
gitter-badger/aroma-1 | [
"e8e4169fa158572278f786769951831ef45a4a2f"
] | [
"aroma/features.py"
] | [
"\"\"\"Functions to calculate ICA-AROMA features for component classification.\"\"\"\nimport logging\nimport os\n\nimport nibabel as nib\nimport numpy as np\nfrom nilearn import image, masking\n\nfrom . import utils\n\nLGR = logging.getLogger(__name__)\n\n\ndef feature_time_series(mel_mix, mc):\n \"\"\"Extract m... | [
[
"numpy.hstack",
"numpy.abs",
"numpy.arange",
"numpy.cumsum",
"numpy.loadtxt",
"numpy.diff",
"numpy.nanmean",
"numpy.where",
"numpy.zeros",
"numpy.sum",
"numpy.empty"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.