repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
delos/microhalo-models | [
"aaebc1a1fffbff8c6fd561d9936229e637926f5b"
] | [
"examples/annihilation-suppression/profiles.py"
] | [
"import numpy as np\r\nfrom scipy.special import spence\r\n\r\nlog2 = np.log(2)\r\nlog4 = np.log(4)\r\n\r\nsupported_params = [\r\n [1,3,1], # NFW\r\n [1,3,1.5], # Moore\r\n [2,3,0], # cored\r\n]\r\n\r\ndef density_norm(params):\r\n if params == [1,3,1]:\r\n return 1.\r\n elif params == [1,3,1.5]:\r\n... | [
[
"numpy.divide",
"numpy.array",
"numpy.log",
"numpy.exp",
"numpy.power",
"numpy.sqrt",
"numpy.arcsinh",
"scipy.special.spence"
]
] |
xmatthias/PyTables | [
"da01cf8908c2d8c2b07e8a35685f0811807453f6"
] | [
"tables/tests/common.py"
] | [
"\"\"\"Utilities for PyTables' test suites.\"\"\"\n\nimport os\nimport re\nimport sys\nimport locale\nimport platform\nimport tempfile\nfrom pathlib import Path\nfrom time import perf_counter as clock\nfrom packaging.version import Version\n\nimport unittest\n\nimport numexpr as ne\nimport numpy as np\n\nimport tab... | [
[
"numpy.all"
]
] |
Abdurehman458/libfacedetection.train.TF2 | [
"14e29bffb7a611b7df463561c90825305bddd18e"
] | [
"src/multibox_loss.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom utils import match, log_sum_exp\nfrom eiou import eiou_loss\n\nGPU = True\n\nclass MultiBoxLoss(nn.Module):\n \"\"\"SSD Weighted Loss Function\n Compute Targets:\n 1) Produce Confidence Targ... | [
[
"torch.LongTensor",
"torch.nn.functional.cross_entropy",
"torch.Tensor",
"torch.nn.functional.smooth_l1_loss"
]
] |
buaacjw/Epidemic-Modeling-survey | [
"d0065a2dd4c43eb1fe724d1facde2ec577ecfa94"
] | [
"visual/visual_graph.py"
] | [
"import networkx as nx\nimport matplotlib.pyplot as plt\nfrom compartment.Graph import Graph\nfrom compartment.Model import Model\n\n\ndef visual_graph(graph: Graph):\n G = nx.MultiDiGraph()\n edge_list = []\n for node_name in graph.name2node.keys():\n node = graph.name2node[node_name]\n for ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
lod531/regPyHDFE | [
"7e44f7b859e902d5cb1a53f16f9576d08b507645"
] | [
"exploratory/utils.py"
] | [
"import numpy as np\nimport pandas as pd\n\ndef sklearn_to_df(sklearn_dataset):\n df = pd.DataFrame(sklearn_dataset.data, columns=sklearn_dataset.feature_names)\n df['target'] = pd.Series(sklearn_dataset.target)\n return df\n\ndef add_intercept(X):\n # X has to be a 2D numpy array\n # appends interce... | [
[
"pandas.DataFrame",
"numpy.ones",
"pandas.Series"
]
] |
zhisbug/Megatron-LM | [
"b31e1296354e979722627a6c4dedafe19b51fa97"
] | [
"megatron/training.py"
] | [
"# coding=utf-8\n# Copyright (c) 2020, 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#\n# http://www.apache.org/licenses/LICENSE-2.0... | [
[
"torch.no_grad",
"torch.cuda.LongTensor",
"torch.cuda.IntTensor",
"torch.cuda.current_device",
"torch.cuda.empty_cache",
"torch.distributed.all_reduce",
"torch.cuda.memory_stats",
"torch.cuda.FloatTensor",
"torch.distributed.barrier",
"torch.cuda.DoubleTensor"
]
] |
tcapelle/lrp | [
"26398ff91bbefd383624a74afb29e91074420df1"
] | [
"Plot.py"
] | [
"import networkx as nx\nimport matplotlib.pyplot as plt\n\ndef Plot_grafo(G,arcos,s): #grafo, si dibuja los arcos\n M=G.order()\n pos={}\n plt.figure(figsize=(10,10))\n t=0\n\n for n in G:\n pos[n]=(G.node[n]['x'],G.node[n]['y'])\n if G.node[n]['tipo']=='terminal':\n nx.draw_... | [
[
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
prise-3d/models-comparisons | [
"9152c705000cb0fb43928a61ca77318a30505c77"
] | [
"models.py"
] | [
"# models imports\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.ensemble import RandomForestClassifier, VotingClassifier\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.ensemble import GradientBoostingClassifier\nfrom sklearn.f... | [
[
"sklearn.ensemble.VotingClassifier",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.svm.SVC",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.GridSearchCV",
"sklearn.ensemble.GradientBoostingClassifier"
]
] |
j-bac/id-concentration | [
"372bacc846d3d5dd5f99178863fa214fb8d3b292"
] | [
"estimators/_DANCo.py"
] | [
"### Credits to Gabriele Lombardi\n### https://fr.mathworks.com/matlabcentral/fileexchange/40112-intrinsic-dimensionality-estimation-techniques\n### for the original MATLAB implementation\n\n### Credits to Kerstin Johnsson\n### https://cran.r-project.org/web/packages/intrinsicDimension/index.html\n### for the R imp... | [
[
"numpy.sin",
"numpy.array",
"numpy.arccos",
"numpy.isnan",
"numpy.argmin",
"numpy.log",
"scipy.special.i0",
"numpy.sum",
"numpy.mean",
"numpy.argmax",
"numpy.arange",
"numpy.cos",
"numpy.abs",
"scipy.optimize.minimize",
"scipy.special.i1"
]
] |
skydooms/tpu | [
"4553e1ed26763769768b9ba6744431908f7e37c0"
] | [
"models/experimental/resnet50_keras/resnet50_ctl_tf1.py"
] | [
"# Copyright 2018 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... | [
[
"tensorflow.compat.v1.distribute.cluster_resolver.TPUClusterResolver",
"tensorflow.compat.v1.keras.losses.sparse_categorical_crossentropy",
"tensorflow.compat.v1.distribute.experimental.TPUStrategy",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.compat.v1.global_variables",
"tensorflow.c... |
kewitz/SAET2014 | [
"1601cb22ca7d221f42c7ba9759504a3ce13ccd27"
] | [
"File.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nThe MIT License (MIT)\nCopyright (c) 2014 Leonardo Kewitz\n\nExemplo de leitura e processamento de um arquivo CSV no Python. Neste exemplo\num arquivo obtido no analisador de espéctro é lido, convertido e plotado.\n\"\"\"\n\n# Importa bibliotecas necessárias.\nfrom numpy import *\n... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.xticks"
]
] |
ThanapolKong/Streamlit | [
"f8f3d990f012e2d3d516e5de8ad96f1ad4b63763"
] | [
"streamlit_app.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2018-2019 Streamlit 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 requi... | [
[
"pandas.to_datetime",
"numpy.histogram",
"pandas.read_csv"
]
] |
danielt17/Reverse-cyclic-redundancy-check-CRC- | [
"78c907706534c36d632651a46ebf7a67446ffbb8"
] | [
"Utils.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri May 6 21:19:29 2022\r\n\r\n@author: DanielT17\r\n\"\"\"\r\n\r\n# %% Imports\r\n\r\n\r\nfrom collections import Counter\r\nfrom math import ceil\r\nimport numpy as np\r\n\r\n# %% Functions\r\n\r\ndef Swap(a,b):\r\n '''\r\n Description: \r\n This func... | [
[
"numpy.zeros"
]
] |
treeson-li/onsets_frames_transcription | [
"2cebfe738ea23258b3223094ab25d4e130ac2caf"
] | [
"onsets_frames_transcription_create_dataset_maps.py"
] | [
"# Copyright 2019 The Magenta Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o... | [
[
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.gfile.Open",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.app.run"
]
] |
Ambistic/CellTissue | [
"c7fce7bb9443a4dfc3b632d8f40aa598388f9d80"
] | [
"cbmos/solvers/adams_bashforth.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n\"\"\"\nimport numpy as np\nfrom scipy.integrate._ivp.ivp import OdeResult\nimport matplotlib.pyplot as plt\n\nplt.style.use('seaborn')\n\n\ndef solve_ivp(fun, t_span, y0, t_eval=None, dt=0.01):\n\n t0, tf = float(t_span[0]), float(t_span[-1])\n\n t = ... | [
[
"scipy.integrate._ivp.ivp.OdeResult",
"numpy.minimum",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.style.use",
"numpy.hstack",
"numpy.vstack"
]
] |
nigma/pywt | [
"1b5ed1d5d2cc355fd0e7af591826d1be40522cee"
] | [
"demo/dwt_multidim.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport pprint\n\nimport numpy\n\nimport pywt\n\ndata = numpy.ones((4, 4, 4, 4)) # 4D array\nresult = pywt.dwtn(data, 'db1') # sixteen 4D coefficient arrays\npprint.pprint(result)\n"
] | [
[
"numpy.ones"
]
] |
zjdcts/H-FC | [
"60a00322d77ae07519174a3eb0b02270aa8578c1"
] | [
"nnunet/training/network_training/BTS_Netv4_6_TrainerV2.py"
] | [
"# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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# ... | [
[
"numpy.array",
"torch.cuda.amp.autocast",
"numpy.random.RandomState",
"numpy.round",
"torch.cuda.is_available",
"sklearn.model_selection.KFold",
"numpy.vstack"
]
] |
kaitlyndlee/plio | [
"99f0852d8eb92efeba72f366077bd023a7da7cdd"
] | [
"plio/io/io_jsc.py"
] | [
"import os\n\nimport numpy as np\nimport pandas as pd\nfrom pandas.core.common import array_equivalent\n\nfrom plio.utils.utils import file_search\n\n\n# This function reads the lookup tables used to expand metadata from the file names\n# This is separated from parsing the filenames so that for large lists of files... | [
[
"numpy.array",
"pandas.DataFrame",
"pandas.core.common.array_equivalent",
"pandas.concat",
"numpy.in1d",
"pandas.read_csv",
"numpy.unique"
]
] |
XinYao1994/HOPE | [
"99b41b457b67d3e5d6dd182f8aa2ce4ea66e4a68"
] | [
"plot/btree/point/lookuplat_mem_email_btree.py"
] | [
"import sys\nimport os\nsys.path.append(os.path.abspath('./plot/'))\nfrom option import *\nimport matplotlib as mpl\nmpl.use('Agg')\nimport matplotlib.pyplot as plot\nimport matplotlib.ticker as ticker\nimport matplotlib.cm as cm\nimport numpy as np\n\nimport csv\n\nNAMES = [\"Uncompressed\", \"Single\", \"Double\"... | [
[
"matplotlib.use",
"matplotlib.pyplot.savefig",
"numpy.array",
"matplotlib.pyplot.figure"
]
] |
sharkweek/lasso-python | [
"727957a8b9cf04240b25d18ab730153b9ab8db24"
] | [
"lasso/plotting/plotting.py"
] | [
"\n\nimport os\nimport io\nimport uuid\nimport json\nimport numpy as np\nfrom base64 import b64encode\nfrom zipfile import ZipFile, ZIP_DEFLATED\nfrom typing import Union, Tuple\n\n\ndef _read_file(filepath: str):\n '''This function reads file as str\n\n Parameters\n ----------\n filename : str\n ... | [
[
"numpy.logical_not",
"numpy.sum"
]
] |
cgross95/ann-benchmarks | [
"5502f2930e1dd88c193178eb8a0a91f487e26e0c"
] | [
"ann_benchmarks/datasets.py"
] | [
"import h5py\nimport numpy\nimport os\nimport random\nimport csv\n\nfrom urllib.request import urlopen\nfrom urllib.request import urlretrieve\n\nfrom ann_benchmarks.distance import dataset_transform\n\n\ndef download(src, dst):\n if not os.path.exists(dst):\n # TODO: should be atomic\n print('down... | [
[
"numpy.product",
"numpy.array",
"numpy.zeros",
"sklearn.random_projection.GaussianRandomProjection",
"numpy.fromfile",
"scipy.sparse.lil_matrix",
"sklearn.feature_extraction.text.TfidfTransformer"
]
] |
gehilley/NondimensionalWeathering | [
"8b59a00d59c026e1b3a3b8f7c3c6fe51a272c21a"
] | [
"weathering_model/utils.py"
] | [
"def pack_values(values, packing_geometry=None):\n \"\"\"\n pack_values: packs and unpacks values into vectors suitable for ODE integrators:\n\n Parameters:\n -----------\n values : ndarray of values to unpack / pack. Array is n x m if values are to be packed.\n packing_geometry : A tuple of the ... | [
[
"numpy.max",
"numpy.array",
"numpy.reshape",
"matplotlib.pylab.savefig",
"matplotlib.pylab.ylabel",
"matplotlib.pylab.semilogy",
"matplotlib.pylab.show",
"matplotlib.pylab.figure",
"matplotlib.pylab.xlabel",
"numpy.prod",
"numpy.power",
"matplotlib.pylab.title",
... |
agarwal29796/napari | [
"aa815ea0430232cb91f7d8111da68c5a880841d3"
] | [
"napari/layers/image/image.py"
] | [
"\"\"\"Image class.\n\"\"\"\nfrom __future__ import annotations\n\nimport types\nimport warnings\nfrom typing import TYPE_CHECKING, Union\n\nimport numpy as np\nfrom scipy import ndimage as ndi\n\nfrom ...utils import config\nfrom ...utils.colormaps import AVAILABLE_COLORMAPS\nfrom ...utils.events import Event\nfro... | [
[
"numpy.divide",
"numpy.max",
"numpy.array",
"numpy.less",
"numpy.concatenate",
"numpy.greater",
"numpy.zeros",
"numpy.full",
"numpy.round",
"numpy.copy",
"numpy.ones",
"numpy.greater_equal",
"numpy.any",
"numpy.where",
"numpy.subtract",
"numpy.clip",... |
arturtoshev/ncsnv2 | [
"5e0159360e5893a0cac83defc2a83fa0ff633137"
] | [
"models/__init__.py"
] | [
"import torch\nimport numpy as np\n\nfrom sgllmc import anneal_Levy_Langevin_dynamics as anneal_Langevin_dynamics\nfrom sgllmc import anneal_Levy_Langevin_dynamics_inpainting as anneal_Langevin_dynamics_inpainting\nfrom sgllmc import anneal_Levy_Langevin_dynamics_interpolation as anneal_Langevin_dynamics_interpolat... | [
[
"numpy.linspace",
"numpy.log"
]
] |
neomatrix369/embeddings-for-trees | [
"022fe30df4ece0162c16aaa42a59c93240eae180"
] | [
"utils/common.py"
] | [
"import os\nimport random\nfrom os import mkdir\nfrom os.path import exists\nfrom shutil import rmtree\nfrom tarfile import open as tar_open\nfrom typing import List\n\nimport dgl\nimport numpy as np\nimport torch\nfrom tqdm.auto import tqdm\n\nSOS = '<SOS>'\nEOS = '<EOS>'\nPAD = '<PAD>'\nUNK = '<UNK>'\nNAN = 'NAN'... | [
[
"torch.device",
"numpy.append",
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.is_available",
"numpy.cumsum"
]
] |
Wilscos/recommender-systems-bibliometric-analysis | [
"bbba45340bf4d494278784ca1376e443f47d5012"
] | [
"utils.py"
] | [
"import os\nimport json\nimport numpy as np\nimport re\nimport pandas as pd\nfrom config import DATA_PATH, PDF_PATH\n\n\ndef read_data():\n if not os.path.isdir(DATA_PATH):\n os.mkdir(DATA_PATH)\n\n papers_df = pd.read_csv(f'{DATA_PATH}/df.csv')\n papers_df.drop('Unnamed: 0', axis=1, inplace=True)\n... | [
[
"pandas.read_csv"
]
] |
cnheider/ray | [
"9b33f3a7b7d799378decc2b7ef065e279599825d"
] | [
"python/ray/rllib/models/action_dist.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nfrom ray.rllib.utils.reshaper import Reshaper\n\n\nclass ActionDistribution(object):\n \"\"\"The policy action distribution of an agent.\n\n Args:\n ... | [
[
"tensorflow.exp",
"tensorflow.shape",
"numpy.log",
"numpy.sum",
"tensorflow.multinomial",
"tensorflow.reduce_max",
"tensorflow.log",
"tensorflow.squeeze",
"tensorflow.reduce_sum",
"tensorflow.split",
"tensorflow.square",
"tensorflow.nn.sparse_softmax_cross_entropy_w... |
future-xy/dlrm | [
"aae60757350c467c63893229e149223b6996400e"
] | [
"torchrec_dlrm/data/dlrm_dataloader.py"
] | [
"#!/usr/bin/env python3\n# 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 argparse\nimport os\nfrom typing import List\n\nfrom torch import dis... | [
[
"torch.distributed.get_world_size",
"torch.distributed.get_rank"
]
] |
nismod/microsimulation | [
"37ce2843f10b83a8e7a225c801cec83b85e6e0d0"
] | [
"scripts/check.py"
] | [
"\nimport pandas as pd\n\nyears = range(2011,2051)\n\nlad = \"E07000041\"\nprojs = [\"ppp\", \"hhh\"]\n\nfor year in years:\n filep = \"./data/ssm_\" + lad + \"_MSOA11_\" + projs[0] + \"_\" + str(year) + \".csv\"\n fileh = \"./data/ssm_\" + lad + \"_MSOA11_\" + projs[1] + \"_\" + str(year) + \".csv\"\n dfp = pd.... | [
[
"pandas.read_csv"
]
] |
RSRamKumar/Master_thesis | [
"3704862da452cffa33cee1ed4e40fd835c28eeb5"
] | [
"python scripts/drugbank_to_chembl_english_names.py"
] | [
"\r\n#!/usr/bin/env python3\r\n\r\n# Import relevant libraries for HTTP request and JSON formatting\r\nimport requests\r\nimport json\r\nimport re\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom bs4 import BeautifulSoup\r\nimport time\r\n\r\ndef scraping_drug_names_from_DrugBank_website(drugbank_id):\r\n na... | [
[
"pandas.read_csv"
]
] |
CheungBH/mmpose | [
"d3cfde961a0ffe60ff018dfb6999ad84fa9818c5"
] | [
"mmpose/models/detectors/bottom_up.py"
] | [
"import math\nimport warnings\n\nimport cv2\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv.image import imwrite\nfrom mmcv.visualization.image import imshow\n\nfrom mmpose.core.evaluation import (aggregate_results, get_group_preds,\n get_multi_stage_outputs)\nfrom mmpos... | [
[
"torch.cat",
"numpy.mean",
"torch.flip"
]
] |
muyangren1234/Task-oriented_Sensing_Quality | [
"af2c35cd2315fd76acdbf91ec8b03351bc4bd9b9"
] | [
"ball_recognition/classification/combine_csv.py"
] | [
"import csv\nimport os\nimport numpy as np\nimport random\n#import requests\n\ndeployment_name=[\"Garage\", \"Aisle_rug\", \"Bridge\",\"Hall\", \"Aisle\", \"Livingroom_rug\",\"Livingroom_base\",\"Garage_k\",\"Outdoor\"]\ndeployment_name=[\"Lab_beam\",\"Aisle_beam\"]\nsensor_list =[1,2,3,4,5,6]\nloc_n = 5\n\nwrite_c... | [
[
"numpy.zeros"
]
] |
NguyenVanVu0499/baitap_bigdata | [
"bab1359e63264d9dfad90c62babff541ad3a2bd5"
] | [
"services/upload/src/char_classification/data_provider.py"
] | [
"import tensorflow.keras as keras\nimport numpy as np\n\nfrom services.upload.src.char_classification import data_utils\n\n\nclass Datasets(object):\n def __init__(self):\n self.all_data = []\n\n # Input data\n self.digits_data = data_utils.get_digits_data('./data/digits.npy')\n self.... | [
[
"tensorflow.keras.utils.to_categorical",
"numpy.random.shuffle"
]
] |
KawashiroNitori/blind-watermark | [
"38270b9a0cdf574935254f3182a155344eb35b1f"
] | [
"decode.py"
] | [
"# coding=utf-8\r\nimport cv2\r\nimport numpy as np\r\nimport random\r\nimport os\r\nfrom argparse import ArgumentParser\r\nALPHA = 5\r\n\r\n\r\ndef build_parser():\r\n parser = ArgumentParser()\r\n parser.add_argument('--original', dest='ori', required=True)\r\n parser.add_argument('--image', dest='img', ... | [
[
"numpy.real",
"numpy.fft.fft2",
"numpy.zeros"
]
] |
tforgaard/pytorch_geometric_temporal | [
"d3a6a55119cb8cc38cb6d941ba8f74879d02c4b8"
] | [
"torch_geometric_temporal/nn/attention/mtgnn.py"
] | [
"from __future__ import division\n\nimport numbers\nfrom typing import Optional\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport torch.nn.functional as F\n\n\nclass Linear(nn.Module):\n r\"\"\"An implementation of the linear layer, conducting 2D convolution.\n For details see this pap... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.cat",
"torch.nn.init.uniform_",
"torch.nn.ModuleList",
"torch.arange",
"torch.einsum",
"torch.nn.functional.dropout",
"torch.nn.init.xavier_uniform_",
"torch.nn.init.ones_",
"torch.nn.functional.relu",
"torch.nn.Conv2d",
... |
dumpmemory/pytorch-lightning-template | [
"a698876ad51c9a7a4ca3bd60b930f03eaf3f4d90"
] | [
"special/kfold/data/standard_data.py"
] | [
"# Copyright 2021 Zhongyang Zhang\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agr... | [
[
"numpy.array",
"numpy.zeros",
"sklearn.model_selection.train_test_split",
"numpy.load",
"torch.from_numpy",
"sklearn.model_selection.KFold"
]
] |
yejianfeng2014/tacotron | [
"0dccf1f330c8f8f146347d4a4ca2d53a0780fb64"
] | [
"eval.py"
] | [
"# -*- coding: utf-8 -*-\n#/usr/bin/python2\n'''\nBy kyubyong park. kbpark.linguist@gmail.com. \nhttps://www.github.com/kyubyong/tacotron\n'''\n\nfrom __future__ import print_function\n\nfrom hyperparams import Hyperparams as hp\nimport numpy as np\nfrom data_load import load_data\nimport tensorflow as tf\nfrom tra... | [
[
"tensorflow.train.latest_checkpoint",
"numpy.zeros",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.summary.FileWriter",
"numpy.fromstring",
"numpy.expand_dims"
]
] |
ggrrll/ndlib | [
"375d00d69180dc2a38f3690b4bc2cdce40fd86de"
] | [
"ndlib/models/epidemics/SEISModel.py"
] | [
"from ..DiffusionModel import DiffusionModel\nimport numpy as np\nimport future.utils\n\n__author__ = \"Elisa Salatti\"\n__license__ = \"BSD-2-Clause\"\n\n\nclass SEISModel(DiffusionModel):\n \"\"\"\n Model Parameters to be specified via ModelConfig\n\n :param beta: The infection rate (float value in... | [
[
"numpy.random.random_sample"
]
] |
srenoes/pyogrio | [
"9398a7f1dae001cc04c7c52c5e4c67882fea20f5"
] | [
"pyogrio/tests/test_raw_io.py"
] | [
"import json\nimport os\n\nimport numpy as np\nfrom numpy import array_equal\nimport pytest\n\nfrom pyogrio import list_layers\nfrom pyogrio.raw import read, write\n\n\ndef test_read(naturalearth_lowres):\n meta, geometry, fields = read(naturalearth_lowres)\n\n assert meta[\"crs\"] == \"EPSG:4326\"\n asser... | [
[
"numpy.array_equal",
"numpy.empty"
]
] |
mattip/builder | [
"2d91252afc7407170182cffffe1f578b368a2ac2"
] | [
"analytics/circleci_analyze.py"
] | [
"#!/usr/bin/env python3.7\nfrom datetime import datetime, time\nimport json\nimport requests\nimport itertools\nimport sqlite3\nimport os\nimport sys\nfrom typing import Callable, Dict, Generator, List, MutableSet, Optional\n\n\ndef get_executor_price_rate(executor):\n (etype, eclass) = executor['type'], executo... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.corrcoef"
]
] |
lixiaohaao/CMARL | [
"5581638b62443302d38a89a7ebb3d31b63bf236e"
] | [
"dqn_agent.py"
] | [
"\"\"\"\nCreated on Wednesday Jan 16 2019\n\n@author: Seyed Mohammad Asghari\n@github: https://github.com/s3yyy3d-m\n\"\"\"\n\nimport numpy as np\nimport random\nimport sympy as sp\nimport tensorflow as tf\n\n\nfrom brain import Brain\nfrom uniform_experience_replay import Memory as UER\nfrom prioritized_experienc... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.zeros",
"numpy.amax",
"numpy.argmax",
"numpy.abs"
]
] |
gunhoo/Drone-Tracking | [
"fcb56dde7af18d36b306873b626a86520e34aab9"
] | [
"rasp based system/dense_main.py"
] | [
"import glob\nimport sys\nimport pyaudio\nimport wave\nimport numpy as np\nimport tensorflow as tf\nimport librosa\nfrom socket import *\nfrom header import *\n\nif len(sys.argv) < 4:\n print(\"Compile error : python main.py [nodeNum] [posX] [posY]\")\n exit(1)\n\nFORMAT = pyaudio.paInt16\nNODE = sys.argv[1]\... | [
[
"numpy.concatenate",
"tensorflow.train.AdamOptimizer",
"numpy.zeros",
"tensorflow.argmax",
"tensorflow.reset_default_graph",
"tensorflow.Session",
"tensorflow.train.Saver",
"sklearn.metrics.accuracy_score",
"tensorflow.placeholder",
"numpy.arange",
"numpy.hstack",
"... |
Blosc/bloscpack | [
"5efdadf5b6f61e995df1817943afb9629ce28c89"
] | [
"test/test_numpy_io.py"
] | [
"# -*- coding: utf-8 -*-\n# vim :set ft=py:\n\n\nimport numpy as np\nimport numpy.testing as npt\nfrom unittest import mock\nimport pytest\n\n\nfrom bloscpack.abstract_io import (pack,\n )\nfrom bloscpack.args import (BloscArgs,\n calculate_nchunks,\n ... | [
[
"numpy.array",
"numpy.isfortran",
"numpy.testing.assert_array_equal",
"numpy.asfortranarray",
"numpy.arange",
"numpy.dtype"
]
] |
LovecraftianHorror/rust_text_classifier | [
"d062ebf1da2d593a7261bba970642bcc9bd93a06"
] | [
"lib/classifier/__init__.py"
] | [
"from __future__ import annotations\n\nimport pickle\nfrom pathlib import Path\nfrom typing import List, Tuple\n\nfrom numpy import float64\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.linear_model import SGDClassifier\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.pip... | [
[
"sklearn.model_selection.GridSearchCV",
"sklearn.linear_model.SGDClassifier",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
kishorekolli/deep_racer_guru | [
"0a0a56103f395f958e8177ee0bd5ae1481f93d98"
] | [
"src/analyze/util/heatmap.py"
] | [
"#\n# DeepRacer Guru\n#\n# Version 3.0 onwards\n#\n# Copyright (c) 2021 dmh23\n#\nimport math\nimport typing\nimport numpy as np\n\nfrom src.graphics.track_graphics import TrackGraphics\nfrom src.utils.colors import get_color_for_data, ColorPalette\n\n\nclass HeatMap:\n #\n # PUBLIC interface\n #\n\n de... | [
[
"numpy.array"
]
] |
chakkritte/EEEA-Net | [
"260c2a5c673a806315fc5b529b9c9112c48ca8ae"
] | [
"Transfer/Simplebaseline/lib/models/backbones/ResNet.py"
] | [
"import torch\nimport torch.nn as nn\n\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50']\n\n\nmodel_urls = {\n 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',\n 'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth',\n 'resnet50': 'https://download.pytorc... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.flatten",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
changleilei/bert4keras | [
"48626f05ace6559c5c318a2f453c2296ababa8cd"
] | [
"bert4keras/layers.py"
] | [
"#! -*- coding: utf-8 -*-\n# 自定义层\n\nimport numpy as np\nimport tensorflow as tf\nfrom bert4keras.backend import keras, K, is_tf_keras\nfrom bert4keras.backend import sequence_masking\nfrom bert4keras.backend import recompute_grad\nfrom keras import initializers, activations\nfrom keras.layers import *\n\n\ndef int... | [
[
"numpy.log",
"tensorflow.reverse_sequence",
"tensorflow.split",
"tensorflow.reduce_logsumexp",
"tensorflow.einsum"
]
] |
thduynguyen/sixd_toolkit | [
"972015e860967ddff38ca74dc7d36f929d05724d"
] | [
"conversion/brachmann_convert_gt.py"
] | [
"# Author: Tomas Hodan (hodantom@cmp.felk.cvut.cz)\n# Center for Machine Perception, Czech Technical University in Prague\n\n# Note: The last RGB-D image of the Benchvise sequence of the Hinterstoisser's\n# dataset was removed, because Brachmann et al. do not provide the extended\n# ground truth poses for it.\n\nim... | [
[
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.imshow",
"numpy.eye"
]
] |
i-need-sleep/REDQ | [
"d237f58075773d576482c34d39751cccbbb59f86"
] | [
"train_redq_sac_exp1-2-2.py"
] | [
"import gym\r\nimport numpy as np\r\nimport torch\r\nimport time\r\nimport sys\r\nfrom redq_modified.algos.redq_sac import REDQSACAgent\r\nfrom redq_modified.algos.core import mbpo_epoches, test_agent\r\nfrom redq_modified.utils.run_utils import setup_logger_kwargs\r\nfrom redq_modified.utils.bias_utils import log_... | [
[
"torch.manual_seed",
"torch.cuda.is_available",
"numpy.random.seed"
]
] |
RamiSketcher/AMMI-RL | [
"6d51587ff4d5dc14cba87fca561bd7b340b44586"
] | [
"rl/algorithms/mbrl/mopac.py"
] | [
"import os, subprocess, sys\nimport argparse\nimport importlib\nimport datetime\nimport random\n\nimport time\nimport wandb\n\nimport numpy as np\nimport torch as T\nimport torch.nn.functional as F\n\n# T.multiprocessing.set_sharing_strategy('file_system')\n\nfrom rl.algorithms.mbrl.mbrl import MBRL\nfrom rl.algori... | [
[
"torch.cat",
"numpy.random.seed",
"numpy.mean",
"torch.manual_seed",
"numpy.std",
"torch.tensor",
"torch.Tensor"
]
] |
yushdotkapoor/Crypto-Siphon | [
"75da6842be8224ac283ba43489a9e1bec38e08c1"
] | [
"robinhood_starter.py"
] | [
"#robinhood_starter.py\n# Copyright Yush Raj Kapoor\n# Created 08/13/2021\n\n\n\nimport robin_stocks.robinhood as rs\nimport os\nfrom time import sleep\nfrom robin_obfuscate import *\nimport math\nimport pyrebase\nimport sys\nimport time\nfrom threading import Timer\nimport signal\nfrom numpy import *\nfrom playsou... | [
[
"pandas.DataFrame"
]
] |
henrysky/astroNN | [
"a8358137f09bf964ec34faa2a19d2efc1d7c3557"
] | [
"tests/test_apogee_tools.py"
] | [
"import unittest\n\nimport numpy as np\nimport numpy.testing as npt\nfrom astroNN.apogee import (\n gap_delete,\n apogee_default_dr,\n bitmask_decompositor,\n chips_split,\n bitmask_boolean,\n apogee_continuum,\n aspcap_mask,\n combined_spectra,\n visit_spectra,\n)\nfrom astroNN.apogee.ap... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.mean"
]
] |
QinJinghui/MSFFRN | [
"b55774c01374e6718cd1fd324d1fcaeb5002d00f"
] | [
"src/trainer.py"
] | [
"from decimal import Decimal\n\nimport torch\nimport torch.nn.utils as utils\nfrom tqdm import tqdm\n\nimport utility\n\n\nclass Trainer:\n def __init__(self, args, loader, my_model, my_loss, ckp):\n self.args = args\n self.scale = args.scale\n\n self.ckp = ckp\n self.loader_train = l... | [
[
"torch.device",
"torch.set_grad_enabled"
]
] |
OscarWang114/blueoil | [
"f1835b6f82b4c54725a0be0744708612399edb45"
] | [
"lmnet/lmnet/networks/optical_flow_estimation/data_augmentor.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2019 The Blueoil 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... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.sin",
"numpy.random.rand",
"scipy.ndimage.rotate",
"scipy.ndimage.shift",
"numpy.random.randn",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.cos",
"scipy.ndimage.zoom"
]
] |
jpyne17/surname-origin | [
"39587995b6f6dd1beef47819f0b7a2a78a325a5b"
] | [
"src/utils.py"
] | [
"import glob\nimport os\nimport string\nimport unicodedata\nfrom collections import OrderedDict\nimport torch\n\n\nclass TextFileLoader:\n \"\"\"This class finds name text files in a given directory, and can then process them into a dict.\n\n Args:\n text_files_dir (str): Filepath to directory with nam... | [
[
"torch.zeros"
]
] |
sharif-42/All_About_DS | [
"c8fa254bb27943ff23f15c9f4175f51a596f30d0"
] | [
"Libraries/Matplotlib/graph_ploting.py"
] | [
"\"\"\"\nhttps://towardsdatascience.com/introduction-to-matplotlib-in-python-5f5a9919991f\n\"\"\"\n\nimport matplotlib.pyplot as plt\n\n# Draw Line Graph\nx_values = [0, 1, 2, 3, 4, 5, 6, 7, 8]\nsquares = [0, 1, 4, 9, 16, 25, 36, 49, 64]\nsquares_ = [10, 15, 14, 19, 17, 25, 36, 49, 74]\n\nplt.plot(x_values, squares... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.show",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.bar"
]
] |
colin-zhou/fast-ta | [
"0862dc4ea230c3645d26803fde908a3e7b1733da"
] | [
"tests/tests.py"
] | [
"import numpy as np\nimport csv\nimport ta\nimport pandas\nimport matplotlib.pyplot as plt\nimport os\nimport sys\nsys.path.insert(1, os.path.join(sys.path[0], '..'))\nimport fast_ta\nimport argparse\n\n# ARGPARSE CODE\nparser = argparse.ArgumentParser(description='Fast-TA lib testing tool.')\nparser.add_argument('... | [
[
"numpy.array",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"pandas.Series",
"matplotlib.pyplot.clf"
]
] |
lzmch/framequery | [
"48ed133dec90a9d2b8f4bef4b40f3a1909a0457f"
] | [
"tests/test__postgres_conformance.py"
] | [
"\"\"\"Tests to ensure that framequery and postgres understand the same SQL\"\"\"\nfrom __future__ import print_function, division, absolute_import\n\nimport decimal\n\nimport dask.dataframe as dd\nimport pandas as pd\nimport pandas.util.testing as pdt\n\nimport framequery as fq\nimport framequery.util as util\n\n\... | [
[
"pandas.DataFrame",
"pandas.util.testing.assert_frame_equal"
]
] |
osuzdalev/manim-1 | [
"adab2430645637a5e7e73832d3a6ff9e7d390159"
] | [
"manim/camera/mapping_camera.py"
] | [
"\"\"\"A camera that allows mapping between objects.\"\"\"\n\n__all__ = [\"MappingCamera\", \"OldMultiCamera\", \"SplitScreenCamera\"]\n\n\nimport numpy as np\n\nfrom ..camera.camera import Camera\nfrom ..mobject.types.vectorized_mobject import VMobject\nfrom ..utils.config_ops import DictAsObject\n\n# TODO: Add an... | [
[
"numpy.apply_along_axis"
]
] |
skinnider/REINVENT | [
"6eec5cd18badad8cc5d73a096d11a3cfb753b17b"
] | [
"model.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom utils import Variable\n\nclass MultiGRU(nn.Module):\n \"\"\" Implements a three layer GRU cell including an embedding layer\n and an output linear layer back to the size of the vocabul... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.prod",
"torch.set_grad_enabled",
"torch.nn.functional.log_softmax",
"torch.multinomial",
"torch.cuda.is_available",
"torch.nn.functional.softmax",
"torch.ge",
"torch.nn.Embedding",
"torch.nn.GRUCell",
"torch.... |
Kminassch/CoScal | [
"af936dd6881c26019e03aec7edacb278e46017cf"
] | [
"local_client/normal.py"
] | [
"# -*- coding: utf-8 -*-\r\nimport os\r\nfrom time import sleep\r\nimport pandas as pd\r\nimport numpy as np\r\n\r\n# read data\r\ndataset = pd.read_csv('Alibaba_requests_up_5min_6core.csv')\r\n\r\nrequests_data = dataset['requests']\r\nrequests_data = requests_data.values\r\nstate_cur = []\r\n\r\n# pull requests v... | [
[
"numpy.array",
"pandas.read_csv",
"numpy.mean",
"pandas.DataFrame"
]
] |
dudeperf3ct/end-to-end-images | [
"1dbd815d38795fc6d6f2d5f27d416abb1da5c63c"
] | [
"model.py"
] | [
"import copy\nimport torch\nimport torch.nn as nn\n\nimport timm\n\n\ndef set_parameter_requires_grad(\n model, feature_extracting: bool, num_ft_layers: int\n):\n \"\"\"\n Freeze the weights of the model is feature_extracting=True\n Fine tune layers >= num_ft_layers\n Batch Normalization: https://ker... | [
[
"torch.nn.Linear",
"torch.load"
]
] |
cia05rf/async-scrape | [
"af0ecfd345ce8f34c07317b8681008e6caa114ad"
] | [
"async_scrape/libs/async_scrape.py"
] | [
"\nimport asyncio\nimport nest_asyncio\nimport aiohttp\nimport sys\nimport logging\nimport contextlib\nimport pandas as pd\nfrom time import sleep\n\nfrom aiohttp.client_exceptions import ServerDisconnectedError, ClientConnectionError\n\nfrom .base_scrape import BaseScrape\n\n\nclass AsyncScrape(BaseScrape):\n d... | [
[
"pandas.DataFrame"
]
] |
idunnam/Thesis | [
"a567a25aa037c949de285158804a6ee396fc0e6c"
] | [
"plot_scripts/temperature_timeline_new.py"
] | [
"\"\"\"\nThis code is used to pick and visualize the twenty-year warming period of +4deg +/- 10years for each individual model. \n\"\"\"\n\nimport xarray as xr \nimport matplotlib.pyplot as plt \nimport numpy as np\nimport seaborn as sns\n\n#===================== PLOT rolling mean 4 plot timeline + STD ============... | [
[
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots"
]
] |
bundgus/radiothermostat-logging-control-python | [
"3898b90dfbaea93594ff8ac68ac81b57f8a43b70"
] | [
"dynamodb-query-plotly-tstat_log_embed.py"
] | [
"import boto3\nimport decimal\nimport json\nfrom boto3.dynamodb.conditions import Key\nimport pandas as pd\nimport plotly.offline as offline\nfrom plotly.graph_objs import *\nfrom plotly import tools\nimport datetime\nfrom pytz import timezone\nfrom datetime import timedelta\n\nhours_of_history = 24 * 2\n\n\n# Help... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
DiegoLigtenberg/Workspace-MasterThesis-MSS | [
"e8183031b6223051049f48e0da2bc2824e60239e"
] | [
"mss/postprocessing/generator.py"
] | [
"from audioop import minmax\nfrom math import prod\nfrom mss.preprocessing.preprocesssing import MinMaxNormalizer\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n# from auto_encoder_vanilla import VariationalAutoEncoder\n# from mss.models.auto_encoder import AutoEncoder\nfrom mss.models.auto_encoder_other i... | [
[
"numpy.max",
"tensorflow.math.squared_difference",
"tensorflow.convert_to_tensor",
"numpy.array",
"numpy.zeros_like",
"numpy.square",
"numpy.min",
"scipy.io.wavfile.write",
"numpy.mean",
"numpy.abs",
"numpy.log10",
"tensorflow.cast"
]
] |
mthh/gaspar | [
"92e92e195713906f5bb33dc3686a24701fb8cb23"
] | [
"server_app.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport asyncio\nimport binascii\nimport json\nimport logging\nimport math\nimport os\nimport numpy as np\nimport geopandas as gpd\nimport rasterio as rio\nimport rtree\nimport shlex\nimport spacy\nimport subprocess\nimport sys\nimport tempfile\nimport uuid\nimport u... | [
[
"numpy.nan_to_num"
]
] |
inzi/MobileNet-SSD-RealSense | [
"b9fcc4ade65a8c28496a4a87915157c3e3c17177"
] | [
"main.py"
] | [
"import sys, os\nif sys.version_info.major < 3 or sys.version_info.minor < 4:\n print(\"Please using python3.4 or greater!\")\n sys.exit(1)\nimport numpy as np\nimport cv2, io, time, argparse, re\nfrom os import system\nfrom os.path import isfile, join\nfrom time import sleep\nimport multiprocessing as mp\nfr... | [
[
"numpy.isfinite",
"numpy.zeros"
]
] |
fojor/object-cut | [
"2e9102ef7d21e056110a94931a91a75ae6a2114a"
] | [
"inference/src/utils/run.py"
] | [
"import time\nimport warnings\nimport cv2\nimport numpy as np\nimport torch\n\nfrom PIL import Image, ImageOps\nfrom torch.autograd import Variable\nfrom scipy import ndimage\nfrom torchvision import transforms\n\nfrom src.utils.data_loader import RescaleT, ToTensorLab\nfrom src.utils import log\n\n\ndef _load_img(... | [
[
"numpy.uint8",
"numpy.copyto",
"torch.min",
"numpy.zeros",
"torch.max",
"torch.autograd.Variable",
"torch.no_grad",
"numpy.ones",
"scipy.ndimage.gaussian_filter",
"torch.cuda.is_available",
"torch.load",
"numpy.absolute"
]
] |
TiankunZhou/dxtbx | [
"9a45d44ccc78dae7b4a33bd938df67d1bac56867"
] | [
"format/FormatHDF5EigerNearlyNexus.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport sys\nimport uuid\n\nimport h5py\nimport numpy as np\n\nfrom iotbx.detectors.eiger import EIGERImage\nfrom scitbx import matrix\n\nfrom dxtbx.format.FormatHDF5 import FormatHDF5\nfrom dxtbx.format.FormatPilatusHelpers import determine_eiger_... | [
[
"numpy.string_"
]
] |
atward424/ASCVD_ML | [
"39404dd5f50a527576b91e8f53f5157f76382712"
] | [
"debug_permutation_importance.py"
] | [
"from __future__ import absolute_import\r\nfrom typing import Tuple, List, Callable, Any\r\n\r\nimport numpy as np # type: ignore\r\nfrom sklearn.utils import check_random_state # type: ignore\r\nimport matplotlib.pyplot as plt\r\n\r\nimport pickle\r\nfrom sklearn.ensemble import RandomForestClassifier, GradientB... | [
[
"numpy.array",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"sklearn.impute.IterativeImputer",
"sklearn.utils.metaestimators.if_delegate_has_method",
"matplotlib.pyplot.subplots",
"sklearn.metrics.scorer.check_scoring",
"numpy.mean",
"numpy.std",
"pandas.get_dummies",
... |
razamu15/scikit-learn | [
"6e2ad76ccda5d86444f74a34d98bfbfe6f345b1c"
] | [
"sklearn/impute/tests/test_impute.py"
] | [
"import pytest\n\nimport numpy as np\nfrom scipy import sparse\nfrom scipy.stats import kstest\n\nimport io\n\nfrom sklearn.utils._testing import assert_allclose\nfrom sklearn.utils._testing import assert_allclose_dense_sparse\nfrom sklearn.utils._testing import assert_array_equal\nfrom sklearn.utils._testing impor... | [
[
"sklearn.linear_model.RidgeCV",
"numpy.repeat",
"numpy.dot",
"sklearn.linear_model.ARDRegression",
"numpy.median",
"sklearn.impute.IterativeImputer",
"numpy.min",
"numpy.mean",
"sklearn.linear_model.BayesianRidge",
"sklearn.tree.DecisionTreeRegressor",
"numpy.random.ran... |
ab-sin-the/RL-based-CO | [
"7972d10bac68d91e056bd8a8b842ba8ebdef188e"
] | [
"main/main.py"
] | [
"import sys\nsys.path.append('../utils')\nimport utils\nimport numpy as np\nimport random\nimport math\nfrom tqdm import tqdm\n# To read input\n#benchmark: sites.nlsde.buaa.edu.cn/~kexu/benchmarks/graph-benchmarks.htm\ndef read(file):\n with open(file, 'r') as input:\n n = int(next(input))\n E = np... | [
[
"numpy.array",
"numpy.zeros"
]
] |
yuan776/scikit-multilearn | [
"5ad32df237e6a9746fd5ec2f9543dcd011e8cdd2"
] | [
"yyskmultilearn/adapt/mltsvm.py"
] | [
"# Authors: Grzegorz Kulakowski <grzegorz7w@gmail.com>\n# License: BSD 3 clause\nfrom yyskmultilearn.base import MLClassifierBase\n\nimport numpy as np\nimport scipy.sparse as sp\nfrom scipy.linalg import norm\nfrom scipy.sparse.linalg import inv as inv_sparse\nfrom scipy.linalg import inv as inv_dense\n\n\nclass M... | [
[
"numpy.max",
"scipy.sparse.issparse",
"numpy.dot",
"numpy.zeros",
"scipy.sparse.hstack",
"numpy.ones",
"numpy.nonzero",
"numpy.identity",
"numpy.where",
"scipy.sparse.identity",
"numpy.hstack",
"scipy.linalg.norm",
"numpy.diag"
]
] |
HeRCLab/tvm | [
"bd14a4d36e0d364ef9bd34b2ee96cc09ce64d4b3"
] | [
"python/tvm/contrib/cudnn.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.full",
"numpy.array"
]
] |
cor-e-software/nbeatsx | [
"6e0f6dd7c9ff196ac9b71f059fc52c2df3adfb56"
] | [
"src/utils/pytorch/ts_loader.py"
] | [
"import numpy as np\nimport pandas as pd\nimport random\nimport torch as t\nimport copy\nfrom src.utils.pytorch.ts_dataset import TimeSeriesDataset\nfrom collections import defaultdict\n\n\nclass TimeSeriesLoader(object):\n def __init__(self,\n ts_dataset:TimeSeriesDataset,\n mode... | [
[
"torch.nonzero",
"torch.nn.ConstantPad1d",
"torch.Tensor"
]
] |
bioidiap/bob.ip.tensorflow_extractor | [
"14ab1f878a352e1075c31d94c715b4f7556e7afb"
] | [
"bob/ip/tensorflow_extractor/MTCNN.py"
] | [
"# code and model from https://github.com/blaueck/tf-mtcnn\nimport pkg_resources\nimport tensorflow as tf\nimport multiprocessing\nimport bob.io.image\n\n\nMODEL_PATH = pkg_resources.resource_filename(__name__, \"data/mtcnn/mtcnn.pb\")\n\n\nclass MTCNN:\n\n \"\"\"MTCNN v1 wrapper. See\n https://kpzhang93.gith... | [
[
"tensorflow.compat.v1.Session",
"tensorflow.Graph",
"tensorflow.import_graph_def"
]
] |
gkbal/PlasmaPy | [
"e000129f3c2d41e5ab77c1b1df8f1b2e9ab09fbd"
] | [
"plasmapy/plasma/sources/tests/test_plasmablob.py"
] | [
"import astropy.units as u\nimport numpy as np\nimport pytest\n\nfrom plasmapy.formulary import magnetostatics\nfrom plasmapy.particles.exceptions import InvalidParticleError\nfrom plasmapy.plasma.sources import plasma3d, plasmablob\nfrom plasmapy.utils.exceptions import CouplingWarning\n\n\n@pytest.mark.parametriz... | [
[
"numpy.allclose",
"numpy.array",
"numpy.isclose",
"numpy.linspace"
]
] |
ohsu6072/quantarhei | [
"713dc77e0b99a8edca0989e0e3fe2d102516d486"
] | [
"examples/demo_018_ModifiedRedfieldTheory_1.py"
] | [
"# -*- coding: utf-8 -*-\n\n#\n# Demo settings\n#\n_show_plots_ = False\n\n\nimport numpy\n\nimport quantarhei as qr\nfrom quantarhei.models.modelgenerator import ModelGenerator\n\nprint(\"\"\"\n*******************************************************************************\n* ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot"
]
] |
rowanshah/Qiskit-Quantum-Approach-To-Rendezvous-Probelem | [
"3d6f08d7e2d05146a70f7a29a28d4878a565c782"
] | [
"Solution/Plots/PlotAccuracy.py"
] | [
"#%%\n#Accuracy Test script\nimport numpy as np\nfrom qiskit import IBMQ, BasicAer, Aer\nfrom qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute\nfrom qiskit.providers.ibmq import least_busy\nimport matplotlib.pyplot as plt\ndef oracle(maze, alice_room, bob_room, q_oracle, q_oracle_ancilla):\... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks"
]
] |
hbrunie/cctbx_project | [
"2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5"
] | [
"xfel/clustering/singleframe.py"
] | [
"\"\"\" Module for working with single images in a serial crystallography\ndataset\"\"\"\nfrom __future__ import absolute_import, division, print_function\nfrom libtbx import easy_pickle\nimport numpy as np\nimport math\nimport logging\nfrom cctbx.array_family import flex\nfrom six.moves import cPickle as pickle\nf... | [
[
"numpy.log",
"matplotlib.pyplot.xlabel",
"numpy.mean",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"numpy.cumsum",
"scipy.stats.sem",
"matplotlib.pyplot.show",
"numpy.sqrt",
"pandas.Series"
]
] |
SeanNaren/fairscale | [
"2d3d5a7bb7340963383afd5b4e9a0b53e1238c35"
] | [
"benchmarks/experimental/benchmark_dataset.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport torch\nfrom torch.utils.data import Dataset\n\n# TODO(sidgoyal): Refactor benchmarks to remove this file eventually.\n\n\ndef collate_sentences_lm(samples):\n\n if len(samples) == 0:\n return {}\n\n id = torch.LongTensor... | [
[
"torch.randint",
"torch.LongTensor",
"torch.stack"
]
] |
lefatoum2/opencv | [
"f7cab121fe2954c67b343b3b7805e1c092812093"
] | [
"samples/dnn/dasiamrpn_tracker.py"
] | [
"\"\"\"\nDaSiamRPN tracker.\nOriginal paper: https://arxiv.org/abs/1808.06048\nLink to original repo: https://github.com/foolwood/DaSiamRPN\nLinks to onnx models:\nnetwork: https://www.dropbox.com/s/rr1lk9355vzolqv/dasiamrpn_model.onnx?dl=0\nkernel_r1: https://www.dropbox.com/s/999cqx5zrfi7w4p/dasiamrpn_kerne... | [
[
"numpy.array",
"numpy.array_equal",
"numpy.reshape",
"numpy.zeros",
"numpy.ascontiguousarray",
"numpy.hanning",
"numpy.copy",
"numpy.ones",
"numpy.tile",
"numpy.exp",
"numpy.mean",
"numpy.transpose",
"numpy.argmax",
"numpy.sqrt",
"numpy.maximum"
]
] |
ntyukaev/training_extensions | [
"c897d42e50828fea853ceda0795e1f0e7d6e9909"
] | [
"ote_cli/ote_cli/tools/utils/demo/visualization.py"
] | [
"\"\"\"\nVisualisation module.\n\"\"\"\n\n# Copyright (C) 2021 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\... | [
[
"numpy.asarray",
"numpy.zeros"
]
] |
luiztauffer/pandasVIS | [
"800c25c1f4aef29062a095149cedd5011262d2af"
] | [
"pandasvis/main.py"
] | [
"from PySide2 import QtCore\nfrom PySide2.QtCore import Qt\nfrom PySide2.QtWidgets import (QWidget, QApplication, QTreeWidgetItem, QLabel,\n QMainWindow, QFileDialog, QAction, QVBoxLayout,\n QGridLayout, QPushButton, QTreeWidgetItemIterator,\n ... | [
[
"pandas.read_csv",
"numpy.random.rand",
"numpy.zeros",
"numpy.arange"
]
] |
manpen/nemo-eva | [
"079680f04da049720eb6b5817c086bc9866f5154"
] | [
"src/helpers/tail_estimation.py"
] | [
"import sys\nimport time\nimport argparse\nimport os\nimport warnings\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n# =========================================\n# ========== Auxiliary Functions ==========\n# =========================================\n\ndef add_uniform_noise(data_sequence, p = 1):\n ... | [
[
"numpy.random.choice",
"numpy.where",
"numpy.cumsum",
"numpy.logspace",
"numpy.histogram",
"numpy.log",
"matplotlib.pyplot.subplots",
"numpy.nanmin",
"numpy.arange",
"numpy.sqrt",
"numpy.log10",
"numpy.array",
"numpy.zeros",
"numpy.round",
"numpy.diff",
... |
Art-Ev/AequilibraE-GUI | [
"0c6ea37dcb5079cca499a4e17f0f96586c887be7"
] | [
"common_tools/numpy_model.py"
] | [
"\"\"\"\n -----------------------------------------------------------------------------------------------------------\n Package: AequilibraE\n\n Name: NumPy Model\n Purpose: Loads numpy to a GUI in an efficient fashion\n\n Original Author: Pedro Camargo (c@margo.co)\n Contributors:\n Last edited by: Pe... | [
[
"numpy.issubdtype",
"numpy.iinfo",
"numpy.isnan"
]
] |
remmyzen/nqs-tensorflow2 | [
"2af5d5ebb108eac4d2daa5082bdef11c8107bd1b"
] | [
"model/mlp/realpos/mlp_realpos.py"
] | [
"from model.mlp import MLP\nimport tensorflow as tf\nimport copy\nfrom functools import partial\nimport numpy as np\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\n\nclass MLPRealPos(MLP):\n \"\"\"\n This class is used to define a multilayer perceptron with real and \n positiv... | [
[
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"numpy.mean",
"matplotlib.pyplot.colorbar",
"tensorflow.GradientTape",
"tensorflow.random.set_seed",
"matplotlib.pyplot.savefig",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"m... |
v-goncharenko/moabb | [
"c652c77d06209d8583b653dbb8bf6282c6f37eb4"
] | [
"moabb/pipelines/features.py"
] | [
"import numpy as np\nimport scipy.signal as signal\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\n\nclass LogVariance(BaseEstimator, TransformerMixin):\n def fit(self, X, y):\n \"\"\"fit.\"\"\"\n return self\n\n def transform(self, X):\n \"\"\"transform\"\"\"\n assert... | [
[
"numpy.diff",
"numpy.var",
"scipy.signal.hilbert"
]
] |
samesense/mahdi_epi | [
"ec002df1d6b0dbdd4be8675e48971ed604ee9014"
] | [
"src/scripts/limit_exac_genes.py"
] | [
"import pandas, sys\ndat_file, vcf_file, out_file = sys.argv[1:]\ndf_pre = pandas.read_excel(dat_file)\ngenes = set(df_pre['Gene Symbol'].values)\n\nwith open(vcf_file) as f, open(out_file, 'w') as fout:\n for line in f:\n if line[0] == '#':\n print(line.strip(), file=fout)\n else:\n ... | [
[
"pandas.read_excel"
]
] |
qyz55/M2PG | [
"797822e54cc627ebeeb908b239c80e94cd279dcd"
] | [
"src/modules/mixers/hqmix_noabs.py"
] | [
"import torch as th\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\nclass HQMixerFF(nn.Module):\n def __init__(self, args):\n super(HQMixerFF, self).__init__()\n self.args = args\n self.n_agents = args.n_agents\n activation_func=nn.LeakyReLU()\n s... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LeakyReLU",
"torch.nn.ReLU",
"numpy.prod",
"torch.nn.BatchNorm1d"
]
] |
TokyAxel/nevergrad | [
"063909c3f70d6b12c097c9146243287c6ea5fa1d"
] | [
"nevergrad/parametrization/core.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\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 uuid\nimport warnings\nimport numpy as np\nimport nevergrad.common.typing as tp\nfrom nevergrad.common i... | [
[
"numpy.equal",
"numpy.array",
"numpy.random.randint",
"numpy.random.RandomState"
]
] |
ZYVE255/ebm-optimizer | [
"9b1cf6014f987ef4b8d65d4a5659c704b6ea15c4"
] | [
"Bell_EBM/StarPlanetSystem.py"
] | [
"# Author: Taylor Bell\n# Last Update: 2019-02-15\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport astropy.constants as const\nimport scipy.integrate\nimport scipy.optimize as spopt\nimport warnings\nimport time\n\nfrom .Star import Star\nfrom .Planet import Planet\nfrom .KeplerOrbit import KeplerOrbi... | [
[
"numpy.ones_like",
"matplotlib.pyplot.xlim",
"numpy.rint",
"numpy.where",
"numpy.expm1",
"matplotlib.pyplot.gcf",
"numpy.zeros_like",
"numpy.log",
"numpy.sqrt",
"numpy.append",
"matplotlib.pyplot.gca",
"scipy.optimize.minimize",
"numpy.array",
"numpy.argsort... |
gohsyi/secure_connectivity | [
"cf2575f29aa82b4d77695079be578973a660016f"
] | [
"models/a2c/runner.py"
] | [
"import numpy as np\n\nfrom models.a2c.utils import discount_with_dones\n\n\nclass Runner(object):\n \"\"\"\n We use this class to generate batches of experiences\n\n __init__:\n - Initialize the runner\n\n run():\n - Make a mini batch of experiences\n \"\"\"\n\n def __init__(self, env, d_mo... | [
[
"numpy.array",
"numpy.copy",
"numpy.squeeze"
]
] |
sethmerkel/qiskit-ignis | [
"92ba61a329cf9e1a871d8bcc7eace2d2b5951253"
] | [
"qiskit/ignis/verification/accreditation/qotp.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio... | [
[
"numpy.flip",
"numpy.random.RandomState"
]
] |
andsor/pysimoa | [
"8734c062fa4a21b94d0e27ef460f3d8f8c3684da"
] | [
"simoa/test/test_mser.py"
] | [
"# -*- coding: utf-8 -*-\n\n'''\n\n Copyright 2015 The pysimoa Developers\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\... | [
[
"numpy.random.rand"
]
] |
prakamya-mishra/Road-Network-Mapping-from-Aerial-Images | [
"743be76a241fc41bcf61bd7519f0796370e39d34"
] | [
"roadforesttest.py"
] | [
"import pandas as pd\nimport houghtest\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.metrics import confusion_matrix\nimport cv2\nimport numpy as np\nimport pickle\n\ndef main(img_path_or):\n\ttrai... | [
[
"numpy.array"
]
] |
ababino/babino2020masks | [
"06964ecc268fe573140a67bbf13e78495858de84"
] | [
"babino2020masks/counterfactual.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: 02_counterfactual.ipynb (unless otherwise specified).\n\n__all__ = []\n\n# Cell\nfrom .lasso import *\nimport statsmodels.api as sm\nfrom fastcore.all import *\nfrom statsmodels.sandbox.regression.predstd import wls_prediction_std\nimport numpy as np\n\n# Cell\n@patch\nd... | [
[
"numpy.hstack",
"numpy.exp"
]
] |
AnTao97/UnsupervisedPointCloudSegmentation | [
"9bcf0bdf3b1ae62421d9202eb7c0b014d6a69c02"
] | [
"classification.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n@Author: An Tao\n@Contact: ta19@mails.tsinghua.edu.cn\n@File: reconstruction.py\n@Time: 2020/1/2 10:26 AM\n\"\"\"\n\nimport os\nimport sys\nimport time\nimport shutil\nimport numpy as np\nimport torch\nimport torch.optim as optim\nfrom torch.optim.lr_schedule... | [
[
"numpy.concatenate",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.optim.SGD",
"sklearn.metrics.balanced_accuracy_score",
"numpy.mean",
"sklearn.metrics.accuracy_score",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
LinLidi/Machine-Learning-Algorithm-Practice | [
"5af09d0da4f714e8f4c288e5a7a42fe6cb229677"
] | [
"K_Means/K_Means_v1.py"
] | [
"# -*- coding: utf-8 -*-\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef loadDataSet(fileName):\n '''\n :param fileName: dataset file\n :return:data map(list)\n '''\n dataMat = []\n with open(fileName,'r')as f:\n all_data = f.readlines()\n for line in all_data:\n curLi... | [
[
"numpy.max",
"numpy.random.rand",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"numpy.min",
"numpy.shape",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.nonzero",
"numpy.power",
"matplotlib.pyplot.show"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.