repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
clifu/SNR
[ "8f049a60efc0ab51fd277c7d0b70ab3a8b78615f" ]
[ "Z2/confusionMatrix.py" ]
[ "from prerequisites import *\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.preprocessing import StandardScaler\nimport numpy as np\nimport re\nimport seaborn as sns\nimport pandas as pd\n\ndef print_confusion_matrix(_test_generator, _test_steps, feature='learning_rate_'):\n y_preds = dict()\n fi...
[ [ "pandas.DataFrame", "sklearn.metrics.confusion_matrix", "numpy.arange", "numpy.argmax" ] ]
elifesciences-publications/Antinucci_Dumitrescu_et_al_2020
[ "b2cf5596536aa423058abeda6f58096b5c58180d" ]
[ "exponentialFitGetTau.py" ]
[ "\"\"\"\nCreated on Wed April 17 2019\n@author: oliver.mirat\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.optimize import curve_fit\n\ndef expFunc(x, a, b, c):\n return a * np.exp( -(1/b) * x) + c\n \ndef getExponentialPart(x, y, nbPointsForFit):\n minIndex = y.argmin(axis=0)\n i...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.exp", "numpy.amin" ] ]
TJUsym/TJU_Advanced_CV_Homework
[ "2d85943390e9ba53b80988e0ab8d50aef0cd17da" ]
[ "mmdet/models/necks/bfp.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import xavier_init\n\nfrom ..plugins import NonLocal2D\nfrom ..registry import NECKS\nfrom ..utils import ConvModule\n\n\n@NECKS.register_module\nclass BFP(nn.Module):\n \"\"\"BFP (Balanced Feature Pyrmamids)\n\n BFP takes multi-level feat...
[ [ "torch.nn.functional.adaptive_max_pool2d", "torch.nn.functional.interpolate" ] ]
ryanQc1216/detr3d_eval
[ "545684053cffb1bf027d43c42b20ed245fcee119" ]
[ "tools/analysis_tools/flops_tools.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport argparse\nimport torch\nfrom mmcv import Config, DictAction\nimport torch.nn as nn\nimport ptflops\nimport thop\n\n\ndef prepare_inputs(shape_nchw):\n x = torch.zeros(shape_nchw)\n return x\n\n\nclass Net(nn.Module):\n def __init__(self,\n ...
[ [ "torch.zeros", "torch.autograd.profiler.profile", "torch.nn.Conv2d", "torch.no_grad" ] ]
cankunqiu/tensorlayer2
[ "423283ef96d6db485e431d01e360535d1803f34d" ]
[ "tensorlayer/layers/convolution/super_resolution.py" ]
[ "#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\n\nfrom tensorlayer.layers.core import Layer\n\nfrom tensorlayer import logging\n\nfrom tensorlayer.decorators import deprecated_alias\nfrom tensorlayer.decorators import private_method\n\n__all__ = [\n 'SubpixelConv1d',\n 'SubpixelConv2d...
[ [ "tensorflow.batch_to_space_nd", "tensorflow.transpose", "tensorflow.depth_to_space" ] ]
wwagner4/kaggle
[ "c006aca6a4922b6fa84b0a2c2e1b344e1e205847" ]
[ "m5fa/pyspark/analyse/analyse.py" ]
[ "import os\nimport time\nfrom pathlib import Path\nfrom typing import Tuple, Callable\n\nimport matplotlib.pyplot as plt\nimport pyspark.sql.types as t\nimport pyspark.sql.functions as f\nfrom operator import add\nfrom matplotlib.axes import Axes\nfrom matplotlib.figure import Figure\nfrom pyspark import RDD\nfrom ...
[ [ "matplotlib.pyplot.figure" ] ]
sandutsar/incubator-mxnet
[ "3ae7ddfd9c99f40a33c4cb716b3810e5463b810a" ]
[ "tests/python/gpu/test_operator_gpu.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.random.rand", "numpy.multiply", "numpy.fft.fft", "numpy.random.random", "numpy.dtype", "numpy.random.normal", "numpy.arange", "numpy.random.randint", "numpy.append", "scipy.sparse.coo_matrix", "numpy.array", "numpy.reshape", "numpy.zeros", "numpy.rand...
vasudha921/PythonClass9
[ "654e826f89ac52f973ae5ec5e1de4d96c4e17d35" ]
[ "graphs/class1.py" ]
[ "import pandas as pd\nimport csv\nimport plotly.express as px\ndf = pd.read_csv(\"class1.csv\")\nfig = px.scatter(df, x = \"Student Number\", y = \"Marks\", title = \"Class 1 marks\")\n\nwith open(\"class1.csv\", newline= \"\") as f:\n reader = csv.reader(f)\n file_data = list(reader)\n\nfile_data.pop(0)\nnew...
[ [ "pandas.read_csv" ] ]
MSWagner/Flower-Classifier-Pytorch
[ "0bf79c7263d2f1edd6b1ef2e0ae773d2e6890306" ]
[ "predict.py" ]
[ "# PROGRAMMER: Michael Wagner\n# DATE CREATED: 08.04.2020 \n# PURPOSE: Predicts a flower class.\n#\n# Use argparse Expected Call with <> indicating expected user input:\n# python predict.py <path to image> <path to checkpoint> --top_k <k most likely classes> --category_names <J...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.nn.functional.softmax" ] ]
Shaunimsorry/MLFPL
[ "32927be4d141de67e457eac317cfa6ea02757046" ]
[ "bin/roiCalculations.py" ]
[ "#This Script Aims to calculate all the ROI's of all the current players in the EPL FPL Season against all their previous appeareances for ROI calculations.\n\nimport numpy as np\nimport pandas as pd\nimport json\nimport requests as r\n\n#Formatting\npd.set_option('display.max_columns',20)\npd.set_option('display.m...
[ [ "numpy.set_printoptions", "pandas.read_csv", "pandas.set_option", "pandas.DataFrame" ] ]
DionLudjen-13/GAN-TD3
[ "3d19d28851985f73fb2a9aea9fbf88f4f8f9ee24" ]
[ "src/implement.py" ]
[ "import numpy as np\nimport torch\nimport gym\nimport argparse\nimport os\n\nimport utils\nimport TD3\nfrom datetime import datetime\nfrom GenRep import GenerativeReplay\n\n\nif __name__ == \"__main__\":\n\tprint(\"Starting...\")\n\t\n\t# Hyper parameters\n\n\t# General\n\tUSE_GENERATIVE = True\n\tNO_REPLAY = False...
[ [ "numpy.random.normal", "numpy.array", "numpy.random.seed", "numpy.save", "torch.manual_seed" ] ]
sidruns30/DeepClassifierNoveltyDetection
[ "e17ad8a31d13790bc517de7f2b2a4b50ad35e065" ]
[ "sample_data.py" ]
[ "import numpy as np\nfrom keras.preprocessing.sequence import pad_sequences\n\n\ndef phase_to_sin_cos(Y):\n \"\"\"Reparametrize sinusoid parameters:\n w, A, phi, b --> p, A_cos, A_sin, b\n\n Estimating these parameters seems to be easier in practice.\n \"\"\"\n w, A, phi, b = Y.T\n\n A_cos = A...
[ [ "numpy.random.normal", "numpy.sin", "numpy.random.uniform", "numpy.random.randint", "numpy.cos", "numpy.cumsum", "numpy.random.random", "numpy.linspace" ] ]
chulminkw/yolov3-tf2
[ "22d471b7126ffeef580316b226d13bf35155d32f" ]
[ "gen_test02.py" ]
[ "from absl import app, flags, logging\r\nfrom absl.flags import FLAGS\r\n\r\nimport tensorflow as tf\r\nimport numpy as np\r\nimport cv2\r\nfrom tensorflow.keras.callbacks import (\r\n ReduceLROnPlateau,\r\n EarlyStopping,\r\n ModelCheckpoint,\r\n TensorBoard\r\n)\r\nfrom yolov3_tf2.models import (\r\n ...
[ [ "tensorflow.config.experimental.list_physical_devices", "tensorflow.config.experimental.set_memory_growth" ] ]
Kanahiro/dbf-df-translator
[ "6603ca1ac306203bf8c95e6545685c509324a438" ]
[ "libpysal/examples/base.py" ]
[ "\"\"\"\nBase class for managing example datasets.\n\"\"\"\n\n# Authors: Serge Rey\n# License: BSD 3 Clause\n\nimport io\nimport os\nimport webbrowser\nfrom os import environ, makedirs\nfrom os.path import exists, expanduser, join\nimport zipfile\nimport requests\nimport pandas\nfrom bs4 import BeautifulSoup\nfrom ...
[ [ "pandas.DataFrame" ] ]
xyc1207/benchmarking-gnns
[ "9ba25a2825e8c155a93730d6e8f8752090292942" ]
[ "nets/TSP_edge_classification/three_wl_gnn_net.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport dgl\nimport time\n\n\"\"\"\n 3WLGNN / ThreeWLGNN\n Provably Powerful Graph Networks (Maron et al., 2019)\n https://papers.nips.cc/paper/8488-provably-powerful-graph-networks.pdf\n \n CODE adapted from https://github.com/h...
[ [ "torch.cat", "torch.stack", "torch.nn.ModuleList", "torch.tensor", "torch.nn.CrossEntropyLoss", "torch.sum" ] ]
AdaptiveBProcess/Simod
[ "8ec1a03093a958a7de13c3786659282e61609537" ]
[ "src/simod/analyzers/sim_evaluator.py" ]
[ "\"\"\"\nCreated on Fri Jan 10 11:40:46 2020\n\n@author: Manuel Camargo\n\"\"\"\nimport copy\nimport itertools\nimport multiprocessing\nimport random\nimport string\nimport time\nimport traceback\nimport warnings\nfrom multiprocessing import Pool\nfrom operator import itemgetter\n\nimport jellyfish as jf\nimport nu...
[ [ "numpy.divide", "numpy.histogram", "numpy.array", "numpy.add", "numpy.ceil", "pandas.DataFrame.from_dict", "pandas.DataFrame", "numpy.round", "numpy.sum", "numpy.seterr", "numpy.mean", "numpy.multiply", "numpy.abs", "pandas.concat", "scipy.stats.wasserst...
marcociccone/Lasagne
[ "19b9d958507e7300e355d7cd1a6bbff2c7726c07" ]
[ "lasagne/tests/layers/test_helper.py" ]
[ "import warnings\nfrom mock import Mock, PropertyMock\nimport pytest\nimport numpy\nimport theano\n\n\nclass TestGetAllLayers:\n def test_stack(self):\n from lasagne.layers import InputLayer, DenseLayer, get_all_layers\n from itertools import permutations\n # l1 --> l2 --> l3\n l1 = I...
[ [ "numpy.random.normal" ] ]
nixingyang/ShuffleBits
[ "46f1b2ff92d506dae9eba5f269c9ce9eca71dc72" ]
[ "datasets/market1501.py" ]
[ "import glob\nimport os\n\nimport numpy as np\nimport pandas as pd\nfrom scipy.io import loadmat\n\n\ndef _load_accumulated_info(root_folder_path,\n dataset_folder_name=\"Market-1501-v15.09.15\",\n image_folder_name=\"bounding_box_train\"):\n \"\"\"\n Refere...
[ [ "pandas.DataFrame", "scipy.io.loadmat", "numpy.hstack", "numpy.vstack" ] ]
ahayul/op4
[ "b8b5e2747a00af6eaa2deca999a5a19590095f95" ]
[ "selfdrive/controls/lib/lateral_planner.py" ]
[ "import os\nimport math\nimport numpy as np\nfrom common.params import Params\nfrom common.realtime import sec_since_boot, DT_MDL\nfrom common.numpy_fast import interp, clip\nfrom selfdrive.car.hyundai.values import CAR\nfrom selfdrive.ntune import ntune_common_get, ntune_common_enabled\nfrom selfdrive.swaglog impo...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.ones", "numpy.arange", "numpy.column_stack" ] ]
black938/RelationExtractionProject
[ "aeb4475adbca2ca112684fbfe47bb0b9d6f527e4" ]
[ "ServiceRelationExtraction/Attention.py" ]
[ "import logging\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nlogger = logging.getLogger(__name__)\n\nclass DotAttention(nn.Module):\n def __init__(self, dropout=0.0):\n super(DotAttention, self).__init__()\n self.dropout = dropout\n\n def forward(self, Q, K, V, mask_o...
[ [ "torch.nn.Linear", "torch.nn.functional.dropout", "torch.tensor", "torch.nn.functional.softmax", "torch.matmul", "torch.randn" ] ]
ReEn-Neom/ReEn.Neom-source-code-
[ "11ec834d5eac5a5a63c71f6b41107769dafc591c" ]
[ "Manufacture/metal/trash_classifier-master/pi_trash_classifier.py" ]
[ "import keras\nfrom picamera import PiCamera\nfrom picamera.array import PiRGBArray\n\nfrom keras.models import Model, load_model\nfrom keras.applications import mobilenet\nfrom keras.applications.mobilenet import preprocess_input\nfrom keras.preprocessing import image\nfrom keras.utils.generic_utils import CustomO...
[ [ "numpy.argmax", "numpy.asarray", "numpy.expand_dims" ] ]
junhoher/pytorch_geometric
[ "5abedb87d503ceeb8061acf74a702d4f019f778d" ]
[ "torch_geometric/datasets/tu_dataset.py" ]
[ "import os\nimport os.path as osp\nimport shutil\n\nimport torch\nfrom torch_geometric.data import InMemoryDataset, download_url, extract_zip\nfrom torch_geometric.io import read_tu_data\n\n\nclass TUDataset(InMemoryDataset):\n r\"\"\"A variety of graph kernel benchmark datasets, *.e.g.* \"IMDB-BINARY\",\n \"...
[ [ "torch.save", "torch.load" ] ]
bfclarke/kipoi
[ "992b41eee8e35b39ae61262d988db974d8583759" ]
[ "kipoi/pipeline.py" ]
[ "\"\"\"Whole model pipeline: dataloader + model\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nimport os\nfrom kipoi_utils.utils import cd\nfrom kipoi_utils.data_utils import numpy_collate_concat\nimport kipoi # for .config module\n# import h5py\nimport numpy as np\nimpor...
[ [ "numpy.array" ] ]
balefebvre/phylib
[ "e610d19c464363a16a5624a68f94a639a33eb618" ]
[ "phylib/traces/tests/test_waveform.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Tests of waveform loader.\"\"\"\n\n#------------------------------------------------------------------------------\n# Imports\n#------------------------------------------------------------------------------\n\nimport numpy as np\nfrom numpy.testing import assert_array_equal as ae\n...
[ [ "numpy.array", "numpy.testing.assert_array_equal", "numpy.allclose", "numpy.random.uniform", "numpy.arange" ] ]
TateWalker/AV-Query
[ "1985139abf858de55413da6cf1d411a4fddd21ef" ]
[ "plotAV.py" ]
[ "# plotAV.py\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os.path\ndef plotData(avData):\n\tavData = np.asarray(avData)\n\tnewAvData = np.zeros((5,len(avData)))\n\t# print(avData)\n\tfig = plt.figure()\n\tplt.subplot(2, 1, 1)\n\tcol = ''\n\n\n\tlabels = ['Center','North','East','South','West']\n\t...
[ [ "numpy.divide", "numpy.asarray", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter", "matplotlib.pyplot.show", "matplotl...
cmusatyalab/mega-nerf
[ "306e06cc316dd4f5c84d0610308bcbc208228fc3" ]
[ "scripts/render_images.py" ]
[ "import os\nimport traceback\nfrom argparse import Namespace\nfrom pathlib import Path\n\nimport cv2\nimport numpy as np\nimport torch\nimport torch.distributed as dist\nfrom PIL import Image\nfrom torch.distributed.elastic.multiprocessing.errors import record\nfrom tqdm import tqdm\n\nfrom mega_nerf.image_metadata...
[ [ "torch.nan_to_num", "torch.FloatTensor", "torch.quantile", "torch.inference_mode", "torch.autograd.detect_anomaly", "torch.load", "torch.log", "torch.distributed.barrier" ] ]
tamiya-onodera/qiskit-optimization
[ "4e6a22bb13a13e504de607a02f5afdfd33abfb7c" ]
[ "qiskit_optimization/problems/linear_expression.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019, 2021.\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...
[ [ "scipy.sparse.dok_matrix" ] ]
kamoshi/Advent-of-Code
[ "5b78fa467409e8b8c5a16efe31684b8ce493bcee" ]
[ "2021/Python/day13.py" ]
[ "import re\n\nimport numpy as np\n\n\npattern_dots = re.compile(r\"([0-9]+),([0-9]+)\")\npattern_folds = re.compile(r\"fold along ([xy])=([0-9]+)\")\n\n\ndef load():\n with open(\"../.input/day13\") as f:\n dots, folds = f.read().split(\"\\n\\n\")\n dots = [(int(x), int(y)) for x, y in pattern_dots.fin...
[ [ "numpy.flipud", "numpy.where", "numpy.fliplr" ] ]
PerryLewis01/FloodWarning
[ "6bdce9277755ef0826789eb193ddf3f7f3457ab7" ]
[ "floodsystem/geo.py" ]
[ "# Copyright (C) 2018 Garth N. Wells\n#\n# SPDX-License-Identifier: MIT\n\"\"\"This module contains a collection of functions related to\ngeographical data.\n\n\"\"\"\n#from curses.ascii import NUL\nimport numpy as np\nfrom .utils import sorted_by_key # noqa\n\nfrom .station import MonitoringStation\n\n\ndef stati...
[ [ "numpy.deg2rad", "numpy.array" ] ]
yuki-asano/python_doe_kspub
[ "d210fe50338b2132bd795b4bf52c29ad51c5e91b" ]
[ "sample_program_03_06_cross_validation.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@author: Hiromasa Kaneko\r\n\"\"\"\r\n\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\nfrom sklearn.linear_model import LinearRegression\r\nfrom sklearn.model_selection import KFold, cross_val_predict # クロスバリデーションをするときに使用\r\nfrom sklearn.metrics import r2_score, m...
[ [ "sklearn.metrics.mean_squared_error", "matplotlib.pyplot.xlim", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.gca", "pandas.DataFrame", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "sklearn.metrics.r2_score", "sklearn.metrics...
wheatma38/akshare
[ "36698393ebd85d885c99101ce80ac7b5ac6b278d" ]
[ "akshare/stock_feature/stock_em_hist.py" ]
[ "# -*- coding:utf-8 -*-\n#!/usr/bin/env python\n\"\"\"\nDate: 2021/8/28 21:26\nDesc: 东方财富网-行情首页-上证 A 股-每日行情\n\"\"\"\nimport requests\nimport pandas as pd\n\n\ndef stock_zh_a_spot_em() -> pd.DataFrame:\n \"\"\"\n 东方财富-A股-实时行情\n http://quote.eastmoney.com/center/gridlist.html#hs_a_board\n :return: 实时行情\n ...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.to_numeric" ] ]
Wootai/CNTK
[ "0ee09cf771bda9d4912790e0fed7322e89d86d87" ]
[ "bindings/python/cntk/ops/tests/ops_test_utils.py" ]
[ "# Copyright (c) Microsoft. All rights reserved.\n\n# Licensed under the MIT license. See LICENSE.md file in the project root\n# for full license information.\n# ==============================================================================\n\n\"\"\"\nUtils for operations unit tests\n\"\"\"\n\nimport numpy as np\ni...
[ [ "numpy.allclose", "numpy.atleast_1d", "numpy.asarray" ] ]
AlexanderSemenyak/webviz-config
[ "3602901f215033bddd484ea1c13013a8addaf012" ]
[ "webviz_config/generic_plugins/_table_plotter.py" ]
[ "import base64\nimport inspect\nfrom pathlib import Path\nfrom collections import OrderedDict\nfrom typing import Optional, List, Dict, Any\n\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\nfrom dash import html, dcc, Input, Output, Dash\nimport webviz_core_components as wcc\n\nfrom .. import...
[ [ "pandas.read_csv" ] ]
sunbing7/backdoor
[ "a0188ee3da1fac4b923b64a9e6238e5372dd0065" ]
[ "mnist/source/causal_analysis.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Date : 2018-11-05 11:30:01\n# @Author : Bolun Wang (bolunwang@cs.ucsb.edu)\n# @Link : http://cs.ucsb.edu/~bolunwang\n\nimport os\nimport time\n\nimport numpy as np\nimport random\nimport tensorflow\nimport keras\nfrom tensorflow import set_random_seed\nrand...
[ [ "tensorflow.set_random_seed", "tensorflow.keras.utils.to_categorical", "numpy.array", "tensorflow.keras.datasets.mnist.load_data", "numpy.asarray", "numpy.random.seed", "numpy.argmax", "numpy.expand_dims" ] ]
madhavadama/HungaBunga
[ "93270c57fe84d201f6ee32ebb19c900772bc3629" ]
[ "hunga_bunga/classification.py" ]
[ "\nimport warnings\nwarnings.filterwarnings('ignore')\n\nimport numpy as np\nfrom sklearn import datasets\nfrom sklearn.linear_model import SGDClassifier, LogisticRegression, Perceptron, PassiveAggressiveClassifier\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.ensemble import RandomForestClassifie...
[ [ "sklearn.preprocessing.StandardScaler", "sklearn.gaussian_process.kernels.DotProduct", "sklearn.gaussian_process.kernels.RBF", "sklearn.gaussian_process.kernels.WhiteKernel", "sklearn.datasets.load_iris", "sklearn.gaussian_process.kernels.ConstantKernel" ] ]
ailabteam/Daily-Working
[ "0a36b5b6e92941e2e101a151eda202cb57567f4a" ]
[ "COLAB-GOOGLE-Practices/colab google/data/L1/l1.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Feb 18 22:06:34 2019\n\n@author: DELL\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n#numOfPoint = 30\n#noise = np.random.normal(0,1,numOfPoint).reshape(-1,1)\n#x = np.linspace(30, 100, numOfPoint).reshape(-1,1)\n#N = x.shape[0]\...
[ [ "numpy.array", "numpy.dot", "numpy.zeros", "matplotlib.pyplot.xlabel", "numpy.sum", "matplotlib.pyplot.plot", "numpy.ones", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter", "pandas.read_csv" ] ]
zscr/PyGEM
[ "fa357b16660c4dbe1617c17995b6f0455c35c4d7" ]
[ "class_mbdata.py" ]
[ "\"\"\"class of mass balance data and functions associated with manipulating the dataset to be in the proper format\"\"\"\n\n# External libraries\nimport pandas as pd\nimport numpy as np\nimport calendar\nimport collections\nimport datetime\n# Local libraries\nimport pygem_input as input\nimport pygemfxns_modelsetu...
[ [ "numpy.isnan", "numpy.round", "pandas.DataFrame", "numpy.tile", "pandas.concat", "pandas.read_csv" ] ]
YasuShimizu/Nays2d_Bed_Deformation
[ "0fa821c6c6bf52bc3ebe2d96629abb257654dc82" ]
[ "uniform.py" ]
[ "from types import SimpleNamespace\r\nimport numpy as np\r\nfrom numba import jit\r\n\r\n@jit\r\ndef down(nx,ny,dn,eta,qp,snm,hs0,slope):\r\n h_max=np.max(eta)+hs0; h_min=np.min(eta)\r\n eps=qp;epsmin=qp/100.\r\n# print(eps,epsmin)\r\n while eps>epsmin:\r\n h_down=(h_max+h_min)*.5\r\n qcd=...
[ [ "numpy.max", "numpy.min", "numpy.arange", "numpy.sqrt", "numpy.abs" ] ]
PyFstat/PyFstat
[ "a9a66f8477462808e83f966f5f06fb3b9efb5a1b" ]
[ "examples/grid_examples/PyFstat_example_grid_search_F0.py" ]
[ "\"\"\"\nDirected grid search: Monochromatic source\n==========================================\n\nSearch for a monochromatic (no spindown) signal using\na parameter space grid (i.e. no MCMC).\n\"\"\"\nimport pyfstat\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\n\nlabel = \"PyFstat_example_grid_s...
[ [ "numpy.max", "numpy.sin", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout", "numpy.sqrt" ] ]
danwley/synbols-benchmarks
[ "799f85c4bf6a84e0f6b6ad05878bc21c2d40e4c9" ]
[ "active_learning/datasets/synbols.py" ]
[ "import json\nimport os\n\nimport h5py\nimport numpy as np\nfrom torch.utils.data import Dataset\n\nfrom datasets import DATA_ROOT\n\n\nclass Synbols(Dataset):\n def __init__(self, path, split, key='font', transform=None):\n self.path = path\n self.split = split\n self.x, self.y = self._load...
[ [ "numpy.load", "numpy.random.RandomState" ] ]
labdeeman7/real-nvp
[ "5fcfbbdf28417bb708e40b990b1bc9cd48c15d7a" ]
[ "train.py" ]
[ "\"\"\"Train Real NVP on CIFAR-10.\n\nTrain script adapted from: https://github.com/kuangliu/pytorch-cifar/\n\"\"\"\nimport argparse\nimport os\nimport numpy as np\nimport torch\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\nimport torch.utils.data as data\nimport torchvision\nimport torchvisio...
[ [ "torch.sigmoid", "torch.save", "torch.optim.Adam", "torch.no_grad", "numpy.save", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load", "torch.randn", "torch.nn.DataParallel" ] ]
PankajChohan9820/FAST_SRGAN
[ "7f29db8063d06cb003b2dc7a880b644c87214f6f" ]
[ "infer.py" ]
[ "from argparse import ArgumentParser\nfrom tensorflow import keras\nimport numpy as np\nimport cv2\nimport os\n\nparser = ArgumentParser()\nparser.add_argument('--image_dir', type=str, help='Directory where images are kept.')\nparser.add_argument('--output_dir', type=str, help='Directory where to output high res im...
[ [ "numpy.expand_dims", "tensorflow.keras.models.load_model", "tensorflow.keras.Input", "tensorflow.keras.models.Model" ] ]
kuffmode/msa
[ "cdbdca2ddc907a1abd2391226ece584d6b277be0" ]
[ "msapy/msa.py" ]
[ "import warnings\nfrom typing import Callable, Optional, Dict, Tuple, Union\nimport numpy as np\nimport pandas as pd\nfrom ordered_set import OrderedSet\nfrom itertools import combinations\nfrom typeguard import typechecked\nfrom tqdm import tqdm\n\nfrom msapy import utils as ut\nfrom msapy.checks import _check_val...
[ [ "pandas.DataFrame", "numpy.array", "numpy.random.default_rng", "pandas.concat" ] ]
foodwaze0/webapp
[ "897043cbbfdbad8d6c54f0556f31e4127d518fc1" ]
[ "Lib/site-packages/tensorflow/python/ops/gen_manip_ops.py" ]
[ "\"\"\"Python wrappers around TensorFlow ops.\r\n\r\nThis file is MACHINE GENERATED! Do not edit.\r\n\"\"\"\r\n\r\nimport collections as _collections\r\nimport six as _six\r\n\r\nfrom tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow\r\nfrom tensorflow.python.eager import context as _context\r\nfrom ...
[ [ "tensorflow.python.util.tf_export.kwarg_only", "tensorflow.python.eager.context.context", "tensorflow.python.eager.execute.args_to_matching_eager", "tensorflow.python.eager.execute.execute", "tensorflow.python.eager.execute.record_gradient", "tensorflow.core.framework.op_def_pb2.OpList", ...
Crazy-Chick/fast-knn-nmt
[ "7336bbe0be1240e70d3c3ac71c4e7cfb4f4ea4ff" ]
[ "fast_knn_nmt/data/utils.py" ]
[ "# encoding: utf-8\n\"\"\"\n\n\n\n@desc: \n\n\"\"\"\n\nimport numpy as np\nimport math\nfrom fairseq.data import data_utils\nfrom fairseq.tasks.translation import TranslationTask\nfrom fairseq.data.language_pair_dataset import LanguagePairDataset\n\nfrom tqdm import tqdm\nfrom multiprocessing import Pool\nfrom typi...
[ [ "numpy.zeros", "numpy.sum", "numpy.load", "numpy.save", "numpy.savez" ] ]
cumttang/ray
[ "eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c" ]
[ "python/ray/tune/examples/tune_mnist_keras.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport argparse\nimport keras\nfrom keras.datasets import mnist\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Flatten\nfrom keras.layers import Conv...
[ [ "numpy.random.uniform", "numpy.random.randint" ] ]
dodgejesse/bert_on_stilts
[ "63884f37f519fd1d6eafde43ba213a25a5575a82" ]
[ "glue/runners.py" ]
[ "import collections as col\nimport logging\nimport numpy as np\nfrom tqdm import tqdm, trange\nimport sys\n\nimport copy\n\nimport torch\nfrom torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler\nfrom torch.utils.data.distributed import DistributedSampler\n\nfrom .core import InputFe...
[ [ "numpy.concatenate", "torch.utils.data.RandomSampler", "torch.no_grad", "torch.utils.data.SequentialSampler", "torch.manual_seed", "numpy.argmax", "torch.utils.data.DataLoader", "torch.tensor", "torch.utils.data.distributed.DistributedSampler" ] ]
ivankreso/LDN
[ "76740ef77fcec851f8abc2380251a9491dc0cdc3" ]
[ "losses.py" ]
[ "import torch\nimport torch.nn.functional as F\n\n\ndef segmentation_loss(logits, aux_logits, batch, aux_loss_weight, ignore_index=-1,\n equal_level_weights=False):\n if len(aux_logits) > 0:\n main_wgt = 1 - aux_loss_weight\n else:\n main_wgt = 1\n\n num_classes = logits....
[ [ "torch.nn.functional.nll_loss", "torch.cat", "torch.nn.functional.log_softmax" ] ]
3288103265/pytorch-lightning-template
[ "5c750db9b5a9c2e483cf620f0cd819e8117f6436" ]
[ "model/resnet_generator_128.py" ]
[ "import math\nfrom model.relation_transformer import Encoder, get_rel_encoder_layer\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .norm_module import *\nfrom .mask_regression import *\n# from .sync_batchnorm import SynchronizedBatchNorm2d\nfrom torch.nn import SyncBatchNorm as Synchron...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.BatchNorm2d", "torch.sigmoid", "torch.gather", "torch.nn.init.constant_", "torch.nn.init.orthogonal_", "torch.nn.Embedding", "torch.zeros", "torch.nn.Sequential", "torch.nn.Tanh", "torch.linspace", "torch.nn.ReLU", "...
Y1fanHE/pushgp-adaptive-replacement-mutation-with-knowledge
[ "d88c483ef6fe197b2188eadd5498d7bb41d4314f" ]
[ "02/rand_goodv.py" ]
[ "'''\nAuthor: He,Yifan\nDate: 2021-12-04 20:44:01\nLastEditors: He,Yifan\nLastEditTime: 2021-12-06 15:29:07\n'''\nimport random, time, sys, numpy\nfrom pyshgp.gp.estimators import PushEstimator\nfrom pyshgp.gp.genome import GeneSpawner, Genome, VirusSpawner\nfrom pyshgp.gp.variation import (\n AdditionMutation, ...
[ [ "numpy.random.seed" ] ]
PhilippeMarcotte/muzero-general
[ "086f4815c475a479289b8b18818f93fc9485c115" ]
[ "games/per_cartpole.py" ]
[ "import datetime\nimport os\n\nimport gym\nimport numpy\nimport torch\n\nfrom games.abstract_game import AbstractGame\n\n\nclass MuZeroConfig:\n def __init__(self):\n self.seed = 0 # Seed for numpy, torch and the game\n\n ### Game\n self.observation_shape = (1, 1,\n ...
[ [ "numpy.array", "torch.cuda.is_available" ] ]
HW21/TeachSpice
[ "8cf0ba8603dd82eeb35b45e964df9ca69cd09747" ]
[ "spice/solve.py" ]
[ "\"\"\"\nSolver Class(es)\n\"\"\"\n\nimport numpy as np\nfrom typing import Dict, AnyStr, SupportsFloat\n\n\nclass MnaSystem(object):\n \"\"\"\n Represents the non-linear matrix-equation\n G*x + H*g(x) = s\n\n And the attendant break-downs which help us solve it.\n f(x) = G*x + H*g(x) - s # T...
[ [ "numpy.array", "numpy.zeros", "numpy.sum", "numpy.copy", "numpy.any", "numpy.linalg.solve", "numpy.abs" ] ]
gb-heimaf/lynx-x-ray-observatory
[ "a1e5a17cab3763975e0d3dc0840f0359de8c8087" ]
[ "soxs/events.py" ]
[ "import numpy as np\nfrom astropy.io import fits\nfrom astropy import wcs\nimport os\nfrom soxs.utils import mylog, parse_value, get_rot_mat, \\\n create_region\nfrom soxs.instrument_registry import instrument_registry\nfrom tqdm.auto import tqdm\n\n\ndef wcs_from_event_file(f):\n h = f[\"EVENTS\"].header\n ...
[ [ "numpy.bincount", "numpy.histogram", "matplotlib.pyplot.colorbar", "numpy.nan_to_num", "numpy.logical_and", "numpy.arange", "numpy.sqrt", "matplotlib.colors.PowerNorm", "numpy.array", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.diff", "scipy.ndimage.interp...
kristijanbartol/SfMLearner
[ "ec3007d82a7d2205ec5e5ffb5fc99729d31faf88" ]
[ "train.py" ]
[ "from __future__ import division\nimport tensorflow as tf\nimport pprint\nimport random\nimport numpy as np\nfrom SfMLearner import SfMLearner\nimport os\n\nflags = tf.app.flags\nflags.DEFINE_string(\"dataset_dir\", \"\", \"Dataset directory\")\nflags.DEFINE_string(\"checkpoint_dir\", \"./checkpoints/\", \"Director...
[ [ "tensorflow.set_random_seed", "tensorflow.app.run", "numpy.random.seed" ] ]
InnovArul/DIGITS
[ "c69d709e2eba01f2cf1a9556d7838933103a3b31" ]
[ "tools/create_generic_db.py" ]
[ "#!/usr/bin/env python2\n# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.\n\nimport argparse\n# Find the best implementation available\ntry:\n from cStringIO import StringIO\nexcept ImportError:\n from StringIO import StringIO\nimport lmdb\nimport logging\nimport numpy as np\nimport os\nimport ...
[ [ "numpy.around", "numpy.zeros" ] ]
jesnyder/bioMaking
[ "b38d794de255db40634767d77cad8da26787ba34" ]
[ "code/python/c0002_html_table.py" ]
[ "\r\nimport os\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\nfrom prettytable import PrettyTable\r\n\r\ndef html_table():\r\n\r\n patent_path = os.path.join('searchResults', 'patents')\r\n patent_files = os.listdir(patent_path)\r\n\r\n for file...
[ [ "pandas.read_csv" ] ]
nlpyang/NoisySumm
[ "8d5f71531f871841b9a088f8ade1c8f80fb437fc" ]
[ "src/decode_seq2seq.py" ]
[ "\"\"\"BERT finetuning runner.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport json\nimport logging\nimport argparse\nimport math\nfrom tqdm import tqdm, trange\nimport numpy as np\nimport torch\nimport random\nimport pickl...
[ [ "torch.cuda.manual_seed_all", "numpy.random.seed", "torch.no_grad", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.nn.DataParallel" ] ]
caspervdw/Shapely
[ "a0f8a31a18d5384f0a04ee8e8b2d089b37c186cc" ]
[ "shapely/io.py" ]
[ "import numpy as np\n\nfrom . import Geometry # noqa\nfrom . import lib\nfrom .decorators import requires_geos\nfrom .enum import ParamEnum\n\n\n__all__ = [\n \"from_geojson\",\n \"from_wkb\",\n \"from_wkt\",\n \"to_geojson\",\n \"to_wkb\",\n \"to_wkt\",\n]\n\n\n# Allowed options for handling WKB...
[ [ "numpy.bool_", "numpy.isscalar", "numpy.asarray", "numpy.intc" ] ]
nickrodd/GalDM
[ "6ea9ed3882ecf4235fb4a773f8370858ad9ebf1e" ]
[ "GalDM/create_mask_forJD.py" ]
[ "###############################################################################\n# create_mask_forJD.py\n###############################################################################\n#\n# Creates a Boolean mask where pixels labelled as true are masked and those\n# labelled false are unmasked.\n#\n# Note through...
[ [ "numpy.where", "numpy.radians", "numpy.zeros" ] ]
Patoaventura/Datos-COVID19
[ "5fce35aaab8bbe84d5e55293373dfe6634cd96bb" ]
[ "src/reporteDiario.py" ]
[ "'''\nMIT License\n\nCopyright (c) 2020 Sebastian Cornejo\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modi...
[ [ "pandas.read_csv" ] ]
PANDASANG1231/sagemaker_bestofU
[ "94e8a2fd904406866222393e74cabeea807802bd" ]
[ "models/pytorch/train.py" ]
[ "import os\nimport sys\nimport numpy as np\nimport pandas as pd\n\nimport torch \nimport torchvision\n\n\ndef init_weights(m):\n if isinstance(m, torch.nn.Linear):\n torch.nn.init.xavier_uniform(m.weight)\n \ndef accuracy(y_hat, y):\n return (y_hat.argmax(axis=1) == y).sum()\n\ndef evaluate_acc(...
[ [ "torch.nn.Linear", "torch.nn.init.xavier_uniform", "torch.nn.ReLU", "torch.utils.data.DataLoader", "torch.nn.CrossEntropyLoss", "torch.nn.Flatten" ] ]
lmatz/mars
[ "45f9166b54eb91b21e66cef8b590a41aa8ac9569" ]
[ "mars/tensor/expressions/arithmetic/radians.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright 1999-2018 Alibaba Group Holding Ltd.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/li...
[ [ "numpy.geterr" ] ]
jchen42703/detection-models
[ "1d672ce27621857faf230a195fb8fba6655802f5" ]
[ "detectionmodels/yolov3/utils.py" ]
[ "from tensorflow.keras.layers import Add, ZeroPadding2D, UpSampling2D, \\\n Concatenate, MaxPooling2D\nfrom tensorflow.keras.models import Model\n\nfrom detectionmodels.layers.yolo import compose, DarknetConv2D, \\\n DarknetConv2D_BN_Leaky, Spp_Conv2D_BN_Leaky\n\n\ndef resblock_body(x, num_filters, num_blocks...
[ [ "tensorflow.keras.layers.Add", "tensorflow.keras.layers.UpSampling2D", "tensorflow.keras.models.Model", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.ZeroPadding2D", "tensorflow.keras.layers.Concatenate" ] ]
huxia001/autokeras
[ "f4503bb3a3be014b452f54d8e2d187bb6419f627" ]
[ "autokeras/utils.py" ]
[ "import os\nimport pickle\nimport torch\n\nfrom torch.utils.data import DataLoader\n\nfrom autokeras import constant\n\n\ndef lr_schedule(epoch):\n lr = 1e-3\n if epoch > 180:\n lr *= 0.5e-3\n elif epoch > 160:\n lr *= 1e-3\n elif epoch > 120:\n lr *= 1e-2\n elif epoch > 80:\n ...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader" ] ]
CallumRai/Hansard
[ "4d2a5b30d44e3d5af88ae6c4e01f6f229fcf12b8" ]
[ "hansard/scripts/save_model.py" ]
[ "import torch\nimport os\nfrom transformers import GPT2Tokenizer, TFGPT2LMHeadModel\n\nif __name__ == \"__main__\":\n dir_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))\n\n # Save tokenizer\n tokenizer = GPT2Tokenizer.from_pretrained('gpt2', bos_token='<|startoftext|>',\n ...
[ [ "torch.load" ] ]
pythoro/npsolve
[ "c6993dd7a10a60a09655f0252c3ad36fe7dc3af1" ]
[ "test/test_partial.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Aug 5 20:43:48 2019\n\n@author: Reuben\n\"\"\"\n\nimport unittest\nimport numpy as np\n\nfrom npsolve.core import sb, EMIT_VECTORS, EMIT_STATE, GET_VARS, \\\n GET_STEP_METHODS, GET_PARTIALS, SET_CACHING, GET_CACHE_CLEARS, Partial\nfrom npsolve.cache import multi_...
[ [ "numpy.array", "numpy.zeros" ] ]
pymoc/pymoc_uf
[ "7f162a20ed1aa65894adb73c4bb444470914c879" ]
[ "tests/modules/test_SO_ML.py" ]
[ "import pytest\nimport sys\nimport funcsigs\nimport numpy as np\nfrom scipy import integrate\nsys.path.append('/pymoc/src/pymoc/modules')\nfrom SO_ML import SO_ML\nfrom pymoc.utils import make_array\n\n\n@pytest.fixture(\n scope=\"module\",\n params=[{\n 'y': np.asarray(np.linspace(0, 2.0e6, 51)),\n ...
[ [ "numpy.sin", "numpy.asarray", "numpy.abs", "numpy.cos", "numpy.linspace" ] ]
fixstars/tvm
[ "d0646e973b5c142e1aa361d9706e558ed4f8d4a3" ]
[ "tests/python/unittest/test_micro_model_library_format.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.array" ] ]
rpp0/emma
[ "fab81e1c66b8a88d14e68b8878ddbb5ee6528de2" ]
[ "tools/paper_tools.py" ]
[ "#!/usr/bin/python\n\n\"\"\"\nScript used to generate several plots from the paper \"Improving CEMA using Correlation Optimization\".\n\"\"\"\n\nimport argparse\nimport os\nimport pickle\nfrom emma.ai import models\nimport subprocess\nimport json\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom emma.att...
[ [ "numpy.argmin", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.min", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "numpy.mean", "numpy.amax", "numpy.argmax", "numpy.ptp", "numpy.amin", "matplotlib.pyplot.gca", "numpy.expand_dims" ] ...
jillnogold/mlrun
[ "beff7da359b697156890e4eb45cb9a1bc9f16631" ]
[ "mlrun/utils/helpers.py" ]
[ "# Copyright 2018 Iguazio\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 agreed to in ...
[ [ "pandas._libs.tslibs.timestamps.Timestamp", "pandas._libs.tslibs.timestamps.Timestamp.now", "pandas._libs.tslibs.timestamps.Timedelta" ] ]
XSMUBC/DNC-lifelong-learning
[ "55b40bad65eb3cb68c50411acf8f770bfc52e3d9" ]
[ "maindnc.py" ]
[ "import torch\nimport tensorflow as tf\nimport numpy as np\nimport statistics \nfrom torch.nn import functional as F\nimport torch.distributions as tdist\n\n\nimport visual_visdom\nimport visual_plt\nimport utils\nimport matplotlib.pyplot as plt\n\n#########################################################\n## maind...
[ [ "torch.cat", "torch.distributions.Normal", "torch.save", "torch.nn.CosineSimilarity", "torch.reshape" ] ]
plai-group/ccfs-python
[ "532fd9a13eda79361d3028d02a3a91e8b17fb5fa" ]
[ "src/training_utils/component_analysis.py" ]
[ "import numpy as np\nimport scipy.linalg as la\nfrom src.utils.ccfUtils import randomRotation\nfrom src.utils.commonUtils import sVT\nfrom src.utils.commonUtils import amerge\nfrom src.utils.commonUtils import dict2array\nfrom src.utils.commonUtils import queryIfColumnsVary\n\n\ndef isSquare(x):\n # Check if a n...
[ [ "numpy.concatenate", "numpy.full", "numpy.array", "numpy.dot", "numpy.random.rand", "numpy.zeros", "numpy.sum", "numpy.min", "numpy.logical_and", "numpy.eye", "numpy.any", "numpy.subtract", "scipy.linalg.qr", "numpy.sqrt", "numpy.absolute", "numpy.di...
Cospui/cotk
[ "9038420787f7251049534baf3b35eac538a82148" ]
[ "models/seq2seq-pytorch/test_seq2seq_pytorch.py" ]
[ "import pytest\nimport random\nfrom run import run\nfrom main import main\nimport os\nimport shutil\ncwd = os.path.abspath(os.path.dirname(__file__))\npath = os.path.split(cwd)[0]\npath = os.path.split(path)[0]\n\ndef setup_function(function):\n\timport sys\n\tsys.argv = ['python3']\n\trandom.seed(0)\n\timport nump...
[ [ "numpy.random.seed", "torch.manual_seed", "torch.cuda.manual_seed_all" ] ]
RobertMcCarter/animal-finder
[ "5ac839a65df62ab312e440ce43416727492e84d8" ]
[ "utils/excelFileUtils/convertExcelMultiCameraToListOfTaggedImagePaths.py" ]
[ "r\"\"\"\n Processes the Excel file in:\n D:\\data\\NRSI\\2140_Turtle Nesting-Wildlife-Cameras-2019\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport os\n\n# First - load all the folders\nbaseFolder = r\"D:\\data\\NRSI\\2140_Turtle Nesting-Wildlife-Cameras-2019\"\nexcelFileToValidate = os.path.join...
[ [ "pandas.read_excel" ] ]
thlautenschlaeger/mushroom-rl
[ "2847b40953b37a2bf0e9ac6241e50312a5357ded" ]
[ "examples/pendulum_sac_100Hz_options.py" ]
[ "import numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport os\n\nfrom mushroom_rl.algorithms.actor_critic import SAC\nfrom mushroom_rl.algorithms.actor_critic.deep_actor_critic.sac import OptionSAC\nfrom mushroom_rl.core import Core\nfrom mushroo...
[ [ "torch.nn.Linear", "numpy.random.seed", "numpy.mean", "torch.manual_seed", "numpy.std", "torch.squeeze", "torch.cuda.is_available", "torch.nn.init.calculate_gain" ] ]
QIN2DIM/2D-target-detection-Bleach-vs-Naruto
[ "93b5824e74535fc428407cf4053839b6ac23eab8" ]
[ "network/utils/autoanchor.py" ]
[ "# Auto-anchor utils\n\nimport random\n\nimport numpy as np\nimport torch\nimport yaml\nfrom tqdm import tqdm\n\nfrom utils.general import colorstr\n\n\ndef check_anchor_order(m):\n # Check anchor order against stride order for YOLOv5 Detect() module m, and correct if necessary\n a = m.anchor_grid.prod(-1).vi...
[ [ "torch.min", "scipy.cluster.vq.kmeans", "numpy.ones", "numpy.random.uniform", "torch.tensor" ] ]
DivyaKrishnani/road_object_detection
[ "80b39647188a94ef25be5c81f67141e25e0f6978" ]
[ "darkflow/net/yolov2/predict.py" ]
[ "import numpy as np\nimport math\nimport cv2\nimport os\nimport json\n#from scipy.special import expit\n#from utils.box import BoundBox, box_iou, prob_compare\n#from utils.box import prob_compare2, box_intersection\nfrom ...utils.box import BoundBox\nfrom ...cython_utils.cy_yolo2_findboxes import box_constructor\n\...
[ [ "numpy.max", "numpy.exp" ] ]
a1ip/bayesian-analysis-recipes
[ "c4f1e729307d5962a1e95bc99aa92617e0ad0b1c" ]
[ "models/feedforward.py" ]
[ "from .__init__ import BayesianModel\nimport theano\nimport theano.tensor as tt\nimport numpy as np\nimport pymc3 as pm\n\n\nclass ForestCoverModel(BayesianModel):\n \n def __init__(self, n_hidden):\n super(ForestCoverModel, self).__init__()\n self.n_hidden = n_hidden\n\n def create_model(sel...
[ [ "numpy.zeros" ] ]
lescailab/fenicsmpi
[ "c205d552591dc8691008537907d28b5d589610f2" ]
[ "modules/local/fenics/compute/lib/Fibers.py" ]
[ "# -*- coding: utf-8 -*-\n# Code by: Francesco Regazzoni\n\nimport dolfin as df\n\n\ndef getH1projection(f, V):\n\n mesh = V.mesh()\n uv = df.TrialFunction(V)\n vv = df.TestFunction(V)\n A = df.dot(uv, vv) + df.inner(df.grad(uv), df.grad(vv))\n L = df.dot(f, vv) + df.inner(df.grad(f), df.grad(vv))\n ...
[ [ "numpy.sin", "numpy.inner", "numpy.empty", "numpy.cross" ] ]
Axe-hyx/taichi
[ "6a907c99fbc349430363080af91726d6ba92e5b9" ]
[ "python/taichi/lang/__init__.py" ]
[ "import functools\nimport os\nfrom copy import deepcopy as _deepcopy\n\nfrom taichi.core.util import locale_encode\nfrom taichi.core.util import ti_core as _ti_core\nfrom taichi.lang import impl, types\nfrom taichi.lang.enums import Layout\nfrom taichi.lang.exception import InvalidOperationError\nfrom taichi.lang.i...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.gcf" ] ]
sanweiliti/Segmentation-MonoDepth-Pytorch
[ "d1a3de8d10c60fe9d3b86b585e0f0089555fc8a6" ]
[ "saliency_class_val.py" ]
[ "from __future__ import print_function\n\nimport argparse\nimport numpy as np\nimport torch\nimport scipy.misc as m\nimport cv2\nfrom torch.utils import data\nfrom tqdm import tqdm\nfrom joblib import Parallel, delayed\n\nfrom ptsemseg.models.fcn_seg import *\nfrom ptsemseg.models.segnet_seg import *\nfrom ptsemseg...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.min", "numpy.mean", "numpy.where", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load", "numpy.sqrt" ] ]
nschan/models
[ "5e516e834652433dc3357d7c7a28de3ca03e6535" ]
[ "research/deeplab/utils/train_utils.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 requi...
[ [ "tensorflow.shape", "tensorflow.train.latest_checkpoint", "tensorflow.where", "tensorflow.not_equal", "tensorflow.logging.info", "tensorflow.reshape", "tensorflow.train.polynomial_decay", "tensorflow.train.get_or_create_global_step", "tensorflow.train.exponential_decay" ] ]
hypnopump/se3-transformer-pytorch
[ "9d6c7c94ed59f40bc4f38375abc377dcc8b25d82" ]
[ "se3_transformer_pytorch/se3_transformer_pytorch.py" ]
[ "from math import sqrt\nfrom itertools import product\nfrom collections import namedtuple\n\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn, einsum\n\nfrom se3_transformer_pytorch.basis import get_basis\nfrom se3_transformer_pytorch.utils import exists, default, uniq, map_values, batched_index_...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.einsum", "torch.nn.ModuleDict", "torch.finfo", "torch.eye", "torch.nn.functional.pad", "torch.sum", "torch.nn.LayerNorm", "torch.is_tensor", "torch.zeros_like", "torch.nn.Embedding", "torch.nn.Par...
vene/sparseattn
[ "e89a2162bdde3a86b7dfdba22e292ea3bd3880d3" ]
[ "pytorch/torchsparseattn/test_oscar.py" ]
[ "from __future__ import division\n\nimport pytest\nfrom numpy.testing import assert_allclose\nimport numpy as np\nimport torch\nfrom torch.autograd import gradcheck, Variable\n\nfrom .oscar import OscarProxFunction, oscar_prox_jv\n\n\ndef _oscar_prox_jacobian(y_star, dout=None):\n y_star = y_star.numpy()\n di...
[ [ "torch.zeros", "torch.mv", "torch.set_default_tensor_type", "torch.autograd.gradcheck", "torch.manual_seed", "numpy.sign", "numpy.abs", "torch.randn" ] ]
marc2332/sardana
[ "48dc9191baaa63f6c714d8c025e8f3f96548ad26" ]
[ "src/sardana/pool/poolcontrollers/test/base.py" ]
[ "#!/usr/bin/env python\n\n##############################################################################\n##\n# This file is part of Sardana\n##\n# http://www.tango-controls.org/static/sardana/latest/doc/html/index.html\n##\n# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain\n##\n# Sardana is free softwar...
[ [ "numpy.array", "numpy.diff" ] ]
BaekduChoi/Halftoning
[ "9459d202c0b3b4e587e6d89af04c4bcfaa604d31" ]
[ "utils/misc.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Nov 25 16:35:06 2020\n\n@author: baekduchoi\n\"\"\"\n\n\"\"\"\n Script for miscellaneous functions used\n\"\"\"\n\nimport sys\nimport os\nsys.path.append(os.path.join(os.path.dirname(__file__),'.'))\n\nimport json\nimport torch\nfrom torch....
[ [ "torch.utils.data.ConcatDataset", "numpy.zeros", "numpy.log", "numpy.sum", "torch.nn.functional.mse_loss", "torch.utils.data.DataLoader", "torch.nn.functional.pad", "torch.nn.functional.conv2d" ] ]
JackKelly/slicedpy
[ "c2fa7eb4c7b7374f8192a43d8e617b63c9e25e62" ]
[ "slicedpy/powerstate.py" ]
[ "from __future__ import print_function, division\nfrom bunch import Bunch\nimport copy\nfrom sklearn.mixture import GMM\nimport matplotlib.dates as mdates\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom pda.channel import DEFAULT_TIMEZONE\nfrom slicedpy.normal import Normal\nfrom sli...
[ [ "numpy.concatenate", "numpy.array", "sklearn.mixture.GMM", "pandas.Timestamp", "matplotlib.pyplot.Rectangle", "numpy.linspace", "matplotlib.dates.date2num" ] ]
ammaddd/detectron2
[ "7f15a71c4d44bfe0b61bf410684b38eeaf4689a1" ]
[ "detectron2/export/flatten.py" ]
[ "import collections\nfrom dataclasses import dataclass\nfrom typing import Callable, List, Optional, Tuple\nimport torch\nfrom torch import nn\n\nfrom detectron2.structures import Boxes, Instances\nfrom detectron2.utils.registry import _convert_target_to_string, locate\n\nfrom .torchscript_patch import patch_builti...
[ [ "torch.no_grad", "torch.tensor" ] ]
ymetz/local_interpretability
[ "3b230a425687137f36e3b148f883af961375a57d" ]
[ "project/tcav_gpu_server/tcav/utils.py" ]
[ "\"\"\"\nCopyright 2018 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in w...
[ [ "tensorflow.Graph", "tensorflow.gfile.Exists", "tensorflow.Session", "tensorflow.logging.info", "numpy.mean", "tensorflow.ConfigProto", "tensorflow.gfile.MakeDirs", "numpy.std", "tensorflow.InteractiveSession" ] ]
clair513/DIY
[ "843770590a729c6aabf63367a3ab848e21ab78b9" ]
[ "Fashion MNIST Classification/ann_fashion_mnist.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nANN Implementation on Fashion MNIST [ Source: Kaggle (https://www.kaggle.com/zalando-research/fashionmnist) ] using TensorFlow 2.0.0 on CPU.\r\nTraining dataset contains 60,000 image/records & Testing dataset contains additional 10,000 records. Dataset has 10 different label/cl...
[ [ "tensorflow.keras.layers.Dropout", "tensorflow.keras.models.Sequential", "tensorflow.keras.datasets.fashion_mnist.load_data", "tensorflow.keras.layers.Dense" ] ]
nlp-greyfoss/metagrad
[ "0f32f177ced1478f0c75ad37bace9a9fc4044ba3" ]
[ "tests/tensor/test_index_fill.py" ]
[ "import numpy as np\n\nfrom metagrad.tensor import Tensor\n\n\ndef test_simple_index_fill():\n x = Tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=np.float32)\n index = Tensor([0, 2])\n x.index_fill_(1, index, -1)\n\n assert x.data.tolist() == [[-1., 2., - 1.],\n [-1., 5., ...
[ [ "numpy.arange" ] ]
YP-Learning/streamlit-fcc
[ "e5c34d195f51a29d066cfdc9b7b2e08e4424ab36" ]
[ "project8/model.py" ]
[ "import pandas as pd\nfrom sklearn.ensemble import RandomForestClassifier\nfrom joblib import dump\n\npenguins = pd.read_csv(\"./penguins_cleaned.csv\")\n\ndf = penguins.copy()\ntarget = 'species'\nencode = [ 'sex', 'island' ]\ntarget_mapper = { 'Adelie': 0, 'Chinstrap': 1, 'Gentoo': 2 }\n\nfor col in encode:\n ...
[ [ "sklearn.ensemble.RandomForestClassifier", "pandas.concat", "pandas.read_csv", "pandas.get_dummies" ] ]
kenblikylee/kcrawler
[ "1516cd74bc879f52c9cd29eb48f0763265fe4a02" ]
[ "kcrawler/juejin/books.py" ]
[ "#!/usr/local/bin/python\n\nimport requests\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport argparse\nimport time\n\nheaders = {\n 'Origin': 'https://juejin.im',\n 'Referer': 'https://juejin.im/books',\n 'Sec-Fetch-Mode': 'cors',\n 'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Bu...
[ [ "pandas.DataFrame", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
naturalis/FormicID
[ "68f257da56192e044deb192a3f26f25096617a0f" ]
[ "formicID/AntWeb/AW2_to_json.py" ]
[ "###############################################################################\n# __ _ ___ ____ #\n# / _| ___ _ __ _ __ ___ (_) ___|_ _| _ \\ #\n# | |_ / _ \\| '__| '_ ` _ \\| |/ __|| || | | | ...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
jianzhnie/MultimodalTransformer
[ "6cd4ca8034a53da361149745aecead68fbe304a0" ]
[ "mmt/data/preprocessor/tabular/numeric_encoder.py" ]
[ "'''\nAuthor: jianzhnie\nDate: 2021-11-12 15:40:06\nLastEditTime: 2022-02-24 16:25:19\nLastEditors: jianzhnie\nDescription:\n\n'''\n\nfrom typing import List\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.preprocessing import PowerTransformer, QuantileTransformer, StandardScaler\n\nfrom .base_preprocessor...
[ [ "pandas.read_csv" ] ]
pFernbach/crocoddyl
[ "cbf81a329e3abaf4ce1b4a8fab1431f93cd9a5c8" ]
[ "benchmark/quadrupedal_gaits_optctrl.py" ]
[ "import crocoddyl\nfrom crocoddyl.utils.quadruped import SimpleQuadrupedalGaitProblem\nimport pinocchio\nimport example_robot_data\nimport numpy as np\nimport os\nimport sys\nimport time\nimport subprocess\n\nT = int(sys.argv[1]) if (len(sys.argv) > 1) else int(5e3) # number of trials\nMAXITER = 1\nCALLBACKS = Fal...
[ [ "numpy.concatenate" ] ]
desihub/imaginglss
[ "09258d20015869fead9bad6020da2bc0d161f670" ]
[ "imaginglss/utils/mpl_aea.py" ]
[ "\"\"\" \n Native matplotlib support of frequently used 2d projections,\n for looking up to the sky.\n\n This file is initially developed as part of skymapper by Peter Melchior\n based on the example in matplotlib.\n\n It is later adopted by me (Yu Feng), and I will maintain a copy in\n imaginglss...
[ [ "numpy.repeat", "matplotlib.transforms.Transform.__init__", "matplotlib.axes.Axes.set_ylim", "numpy.arccos", "matplotlib.axes.Axes.cla", "matplotlib.axes.Axes.set_xscale", "numpy.radians", "numpy.sign", "numpy.cos", "matplotlib.backends.backend_agg.FigureCanvasAgg", "nu...
toolmen-lab/R3Det_piglet-detection
[ "9e256570e157ee184eb9a4dc11ebafdc1b56f121" ]
[ "libs/networks/build_whole_network_r3det.py" ]
[ "# -*-coding: utf-8 -*-\n\nfrom __future__ import absolute_import, division, print_function\n\nimport os\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nimport numpy as np\n\nfrom libs.networks import resnet, resnet_gluoncv_r3det, mobilenet_v2, xception\nfrom libs.box_utils import anchor_utils, ge...
[ [ "tensorflow.ones_like", "tensorflow.reshape", "tensorflow.stack", "tensorflow.ceil", "tensorflow.cast", "tensorflow.shape", "tensorflow.contrib.slim.l2_regularizer", "tensorflow.concat", "tensorflow.argmax", "tensorflow.train.Saver", "tensorflow.contrib.slim.get_model_v...
dabingrosewood/MasterThesisProj
[ "7e40fa2395468a1bccef429362a61ed8515ecc11" ]
[ "PonyGE2/src/fitness/supervised_learning/supervised_learning.py" ]
[ "import numpy as np\nnp.seterr(all=\"raise\")\n\nfrom algorithm.parameters import params\nfrom utilities.fitness.get_data import get_data\nfrom utilities.fitness.math_functions import *\nfrom utilities.fitness.added_math import *\nfrom utilities.fitness.optimize_constants import optimize_constants\n\nfrom fitness.b...
[ [ "numpy.isrealobj", "numpy.seterr", "numpy.shape" ] ]
AlistairChild/Percolate
[ "064ef1d16b6bc50f2ebab251c439b30386378235" ]
[ "percolate/toolkit/Transpose_spectra.py" ]
[ "\"\"\"Copyright (c) 2021 Alistair Child\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publis...
[ [ "numpy.array" ] ]