repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
wsyjwps1983/autosklearn
[ "2e29ebaca6bc26fa838f7c3b8b13960c600884e4" ]
[ "test/test_pipeline/implementations/test_imputation.py" ]
[ "import unittest\n\nimport numpy as np\nfrom scipy import sparse\n\nfrom sklearn.utils.testing import assert_equal\nfrom sklearn.utils.testing import assert_array_equal\nfrom sklearn.utils.testing import assert_raises\nfrom sklearn.utils.testing import assert_false\nfrom sklearn.utils.testing import assert_true\n\n...
[ [ "numpy.median", "numpy.mean", "sklearn.tree.DecisionTreeRegressor", "numpy.empty", "numpy.arange", "scipy.sparse.csr_matrix", "scipy.sparse.issparse", "numpy.array", "numpy.zeros", "sklearn.random_projection.sparse_random_matrix", "scipy.sparse.csc_matrix", "numpy.r...
russelldj/pyvista
[ "f489eedb2da2841cfd8ba99cf87528bfafa3a888" ]
[ "pyvista/core/pointset.py" ]
[ "\"\"\"Sub-classes and wrappers for vtk.vtkPointSet.\"\"\"\nimport pathlib\nimport logging\nimport os\nimport warnings\n\nimport numpy as np\nimport vtk\nfrom vtk import (VTK_HEXAHEDRON, VTK_PYRAMID, VTK_QUAD,\n VTK_QUADRATIC_HEXAHEDRON, VTK_QUADRATIC_PYRAMID,\n VTK_QUADRATIC_QUAD, V...
[ [ "numpy.empty", "numpy.asarray", "numpy.zeros", "numpy.sum", "numpy.any", "numpy.arange", "numpy.issubdtype" ] ]
Amanda-Barbara/PaddleOCR2Pytorch
[ "7f2c85f23b13981a48a37cb90160dcd69cf21260" ]
[ "tools/infer/predict_rec.py" ]
[ "import os\nimport sys\n\n__dir__ = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(__dir__)\nsys.path.append(os.path.abspath(os.path.join(__dir__, '../..')))\nfrom PIL import Image\nimport cv2\nimport numpy as np\nimport math\nimport time\nimport torch\nfrom pytorchocr.base_ocr_v20 import BaseOCRV20\ni...
[ [ "numpy.concatenate", "numpy.array", "numpy.uint8", "numpy.asarray", "numpy.zeros", "numpy.reshape", "torch.no_grad", "numpy.ones", "numpy.tile", "numpy.triu", "torch.from_numpy", "torch.cuda.is_available", "numpy.tril", "numpy.expand_dims" ] ]
gouzil/Learn-DeepFM
[ "138971145617ace4c8bb5ff153a2c38723e181f7" ]
[ "code/Visualize.py" ]
[ "import os\nimport time\nfrom visualdl import LogReader\nimport matplotlib.pyplot as plt\n\n# reader = None\n\n# 开启visualDL_log才能输出可视化图像 [!请修改]\nfile_dir = \"../PaddleRec/models/rank/deepfm/visualDL_log/\"\n\nnow_time = time.strftime('%Y-%m-%d',time.localtime(time.time()))\n\nos.makedirs(f\"./Visualize/img/{now_tim...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ] ]
NgoJunHaoJason/CZ3002
[ "2d6cf58652fc9ef9da93237ca00e9ca55b24ae23" ]
[ "camera/face_detection/face_detector.py" ]
[ "'''\nWrapper for face detection model\n'''\nimport cv2\nimport mxnet as mx\nimport numpy as np\n\nfrom . import config\n\n\nclass FaceDetector:\n '''\n Interface for face detection model.\n\n Must implement the predict() method. \n predict() must accept an image (np.ndarray) as argument.\n '''\n ...
[ [ "numpy.array", "numpy.minimum", "numpy.tile", "numpy.where", "numpy.argsort", "numpy.squeeze", "numpy.maximum" ] ]
TiagoMarta/data_fusion_Vineyard-Segmentation
[ "de54e149d36027bb314b5890ea4a1e71ba472d17" ]
[ "dataset/transforms.py" ]
[ "'''\n\n\nOriginal implementation: https://github.com/pytorch/vision/blob/main/references/segmentation/transforms.py\n\n\nhttps://medium.com/mlearning-ai/understanding-torchvision-functionalities-for-pytorch-part-2-transforms-886b60d5c23a\n\n'''\n\n\nimport random\n\nimport numpy as np\nimport torch\nfrom torchvis...
[ [ "numpy.array" ] ]
eyalbd2/Deep_RL_Course
[ "d550bb27f23056e7bfd7fd0995e126a156042e83" ]
[ "Taxi/deep_q_learner.py" ]
[ "\r\n# Imports\r\nimport torch\r\nfrom itertools import count\r\nfrom torch.autograd import Variable\r\nimport numpy as np\r\nfrom utils import *\r\n\r\n\r\nUSE_CUDA = torch.cuda.is_available()\r\ndtype = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor\r\n\r\n\r\ndef deep_Q_learning(env, ...
[ [ "numpy.array", "torch.norm", "torch.save", "torch.from_numpy", "torch.cuda.is_available", "torch.tensor" ] ]
r-xue/pyuvdata
[ "667abc1a8a8a4fefd91f68a1cb15d4f62cd9fb60" ]
[ "pyuvdata/tests/test_uvcal.py" ]
[ "# -*- mode: python; coding: utf-8 -*\n# Copyright (c) 2018 Radio Astronomy Software Group\n# Licensed under the 2-clause BSD License\n\n\"\"\"Tests for uvcal object.\n\n\"\"\"\nfrom __future__ import absolute_import, division, print_function\n\nimport nose.tools as nt\nimport os\nimport numpy as np\nimport copy\n\...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.random.rand", "numpy.angle", "numpy.absolute", "numpy.ones", "numpy.min", "numpy.allclose", "numpy.where", "numpy.arange", "numpy.append", "numpy.unique" ] ]
perillaroc/porter
[ "4b128e9925adc5b89f76249544422e10f767e115" ]
[ "porter/grib_tool/grib_to_image.py" ]
[ "# coding: utf-8\nimport json\n\nimport nuwe_pyeccodes\nimport numpy as np\nfrom scipy.interpolate import RegularGridInterpolator\nfrom PIL import Image\n\n\nfrom porter.grib_tool.base.grib_tool import GribTool\nfrom porter.grib_tool.base.regular_lonlat_grid import RegularLonLatGrid\n\n\nclass GribToImageConverter(...
[ [ "numpy.max", "scipy.interpolate.RegularGridInterpolator", "numpy.min" ] ]
canyon289/Theano-PyMC
[ "1a9b04bfe480b758ddfa54ba49c88bee3bec419c", "1a9b04bfe480b758ddfa54ba49c88bee3bec419c" ]
[ "tests/tensor/nnet/test_bn.py", "tests/d3viz/models.py" ]
[ "from collections import OrderedDict\n\nimport numpy as np\nimport pytest\n\nimport theano\nimport theano.tensor as tt\nfrom tests import unittest_tools as utt\nfrom theano.tensor.nnet import bn\n\n\ndef test_BNComposite():\n try:\n orig = theano.config.compute_test_value\n\n theano.config.compute_...
[ [ "numpy.random.rand", "numpy.nan_to_num", "numpy.random.seed", "numpy.random.randn", "numpy.random.random" ], [ "numpy.zeros", "numpy.random.RandomState" ] ]
goodluck4s/bert-
[ "3e715b24b66ad61e67f943a3a9da6513ea29c274" ]
[ "create_pretraining_data.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "tensorflow.logging.set_verbosity", "tensorflow.train.Features", "tensorflow.gfile.Glob", "tensorflow.python_io.TFRecordWriter", "tensorflow.logging.info", "tensorflow.gfile.GFile", "tensorflow.app.run" ] ]
Nitin-Mane/ALL-PyTorch-Segmentation-2021
[ "0f3c7b129629cc2863c502898bcfa3c45077af85" ]
[ "Classes/ResUNetPlusPlus/data_generator.py" ]
[ "\"\"\"\nData Generator\n\"\"\"\nimport os\nimport numpy as np\nimport cv2\nfrom tensorflow.keras.utils import Sequence\n\ndef parse_image(img_path, image_size):\n image_rgb = cv2.imread(img_path, 1)\n h, w, _ = image_rgb.shape\n if (h == image_size) and (w == image_size):\n pass\n else:\n ...
[ [ "numpy.array", "numpy.expand_dims" ] ]
jie311/vedadet
[ "aaf3b3bc3c7944aba1cc28138165d403023a9152" ]
[ "vedacore/image/photometric.py" ]
[ "import cv2\nimport numpy as np\n\n\ndef imnormalize(img, mean, std, to_rgb=True):\n \"\"\"Normalize an image with mean and std.\n\n Args:\n img (ndarray): Image to be normalized.\n mean (ndarray): The mean to be used for normalize.\n std (ndarray): The std to be used for normalize.\n ...
[ [ "numpy.where", "numpy.right_shift", "numpy.full_like" ] ]
mmendiet/Reinforcement-Learning-Basics
[ "bd14293f484a34dffec28d00cb0f8728756b7f9b" ]
[ "playground/grid_world5.py" ]
[ "# maze example\nimport collections\nimport numpy as np\nimport matplotlib\nfrom matplotlib import pyplot as plt\nimport sys\nfrom collections import defaultdict\nimport random\nimport math\nimport torch\nfrom statistics import mean\nimport torch.nn.functional as F\n\nclass GridWorld:\n \"\"\" Grid World environ...
[ [ "torch.nn.Linear", "torch.stack", "numpy.asarray", "numpy.zeros", "torch.nn.Softmax", "numpy.log", "numpy.set_printoptions", "numpy.random.rand", "matplotlib.pyplot.plot", "torch.from_numpy", "torch.nn.ReLU", "numpy.where", "matplotlib.pyplot.show", "torch.l...
samulic/cmmd
[ "5a12b11c65c8fc7d765a637e45b09bb93a10b043" ]
[ "src/data/utils.py" ]
[ "import cv2\nimport numpy as np\nimport png\nimport os\nimport pydicom\n\n\ndef get_png_filename(row):\n \"\"\" 'D1-0000_L_A-R_mass_malignant|triple negative.png'\n \"\"\"\n fname = get_filename(row)\n fname += \".png\" # if not row['PatientName'] in PIDS_TO_CHECK else '-wrong.png'\n return fname\n ...
[ [ "numpy.quantile", "numpy.argmax", "numpy.sum" ] ]
raghavnauhria/whatmt
[ "c20483a437c82936cb0fb8080925e37b9c4bba87", "c20483a437c82936cb0fb8080925e37b9c4bba87" ]
[ "pytorch/test/onnx/export_onnx_tests_generator.py", "pytorch/torch/_tensor_str.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom torch.autograd import Variable\nfrom onnx import numpy_helper\n\nimport io\nimport onnx\nimport os\nimport shutil\nimport torch\nimport traceback\n\nimport...
[ [ "torch.randn", "torch.onnx._export" ], [ "torch.get_default_dtype", "torch.cat", "torch.no_grad", "torch._C._get_default_device", "torch.isfinite", "torch.cuda.current_device", "torch.ceil" ] ]
Kiritox0x/trp_assistant_bot
[ "9776d3b6fc6ebccb5d6b8c0ea68c9b145dc4e06a" ]
[ "generate_fake_email.py" ]
[ "import os\nimport pandas as pd\nimport numpy as np\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'trp_assistant_bot.settings')\nimport django\nfrom django.core import exceptions\ndjango.setup()\nfrom open_course.models import Teacher, Assistant, Classroom\n\nclass GenerateFakeData:\n\t@classmethod\n\tdef genera...
[ [ "pandas.read_excel", "numpy.isnan" ] ]
PoShaung/program-smoothing-fuzzing
[ "60d1c2cd1ee460dcc6facdab92e96df7f44fdb3a" ]
[ "fuzzers/Neuzz/neuzz-cnn/nn.py" ]
[ "import os\nimport sys\nimport glob\nimport math\nimport socket\nimport numpy as np\nfrom collections import Counter\nfrom utils import utils\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset, DataLoader\nfrom torch.optim.lr_scheduler import LambdaLR\nfrom...
[ [ "torch.nn.Linear", "torch.cat", "numpy.random.choice", "numpy.sign", "torch.squeeze", "torch.cuda.is_available", "numpy.where", "torch.nn.MaxPool1d", "torch.sum", "torch.nn.Conv1d", "torch.autograd.Variable", "torch.autograd.grad", "torch.utils.data.DataLoader",...
grice/RNAtools
[ "0161c0fb72c70951a126381a0ea721609c05eb5a" ]
[ "RNAtools/scripts/arcsRNA.py" ]
[ "# GPL 2.0\n#\n# written by Gregg Rice, gmr@unc.edu, rice.gregg@gmail.com\n# copywrite 2013-2015\n# all rights reserved\n#\n\n##################################################################################\n# render one or two CT secondary structures with helices shown as semicircular arcs\n# This simple version...
[ [ "matplotlib.use", "matplotlib.path.Path", "matplotlib.font_manager.FontProperties", "matplotlib.pyplot.annotate", "matplotlib.ticker.MultipleLocator", "numpy.zeros_like", "matplotlib.patches.PathPatch", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylim", "matplotlib.tick...
shirtsgroup/cg_openmm
[ "879c42b5d4cd3adf3821a845785d5022a280a441", "f71dbd7393c83386a73c4cee4b059bd17a56f12a" ]
[ "cg_openmm/thermo/calc.py", "examples/run_replica_exchange/run_replica_exchange.py" ]
[ "import os\nimport numpy as np\nfrom cg_openmm.parameters.reweight import *\nimport matplotlib.pyplot as plt\nfrom openmmtools.multistate import MultiStateReporter\nfrom openmmtools.multistate import ReplicaExchangeAnalyzer\nimport pymbar\nfrom pymbar import timeseries\nfrom scipy import interpolate\nfrom sklearn.u...
[ [ "matplotlib.pyplot.errorbar", "numpy.min", "numpy.mean", "numpy.max", "numpy.zeros_like", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "numpy.random.randint", "matplotlib.pyplot.tight_layout", "numpy.argmax", "numpy.array", "numpy.zeros", "numpy.pe...
HaloKim/BertSum
[ "7d95375ef0283277c9e9580f13ed7df79a1deddd" ]
[ "src/train.py" ]
[ "#!/usr/bin/env python\n\"\"\"\n Main training workflow\n\"\"\"\nfrom __future__ import division\n\nimport argparse\nimport glob\nimport os\nimport random\nimport signal\nimport time\n\nimport torch\n#from pytorch_pretrained_bert import BertConfig\nfrom transformers import BertConfig\n\nimport distributed\nfrom ...
[ [ "torch.cuda.manual_seed", "torch.manual_seed", "torch.multiprocessing.get_context", "torch.cuda.set_device", "torch.load" ] ]
jpierel14/sncosmo
[ "dea2c4ad71a4e004d2fd5d55ec4264523a4b21bc" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nimport fnmatch\nimport glob\nimport os\nimport re\nimport sys\n\nfrom setuptools import setup\nfrom setuptools.extension import Extension\n\n\n# Need a recursive glob to find all package data files if there are\n# subdirector...
[ [ "numpy.get_include" ] ]
nielslaukens/advent-of-code
[ "5775bdf0cfa365ff5622ec0c63070b1d29340faf", "5775bdf0cfa365ff5622ec0c63070b1d29340faf" ]
[ "2021/13_2.py", "2021/15_1.py" ]
[ "import numpy\n\nfrom tools.numpy_tools import ndarray_auto_extending_assign, str_highlight_value\n\ndots = []\nfold_instructions = []\nwith open(\"13.input.txt\", \"r\") as f:\n state = 'dots'\n for line in f.readlines():\n line = line.strip()\n if state == 'dots':\n if line == \"\":...
[ [ "numpy.sum", "numpy.array", "numpy.flip" ], [ "numpy.concatenate", "numpy.swapaxes", "numpy.nditer" ] ]
WuJie1010/Fine-Grained-Image-Captioning
[ "340bc1868634f3bf0fdd62d439fec32ee1b45407" ]
[ "misc/rewards_BDR.py" ]
[ "\"\"\"\nBatch Discriminative Reward\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport time\nimport misc.utils as utils\nfrom collections import OrderedDict\nimport torch\nfrom torch.autograd import Variable\nimpor...
[ [ "torch.stack", "numpy.zeros", "numpy.mean", "torch.LongTensor", "numpy.repeat" ] ]
tovacinni/kaolin
[ "0236fbce9c44bd9818de1603aeae38c5f3ac58f5", "0236fbce9c44bd9818de1603aeae38c5f3ac58f5" ]
[ "tests/python/kaolin/render/spc/test_rayops.py", "tests/python/kaolin/ops/conversions/test_tetmesh.py" ]
[ "# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES.\n# 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...
[ [ "torch.zeros", "torch.rand", "torch.tensor", "torch.allclose", "torch.equal", "torch.cumprod", "torch.cumsum" ], [ "torch.zeros", "torch.allclose", "torch.equal", "torch.tensor" ] ]
zhn1010/SSAN
[ "3435a18f5ee0fa4e73808f8eacf3538c2abd354f" ]
[ "model/modeling_bert.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may...
[ [ "torch.nn.Linear", "torch.einsum", "torch.ones", "torch.nn.BCEWithLogitsLoss", "torch.sum", "torch.sigmoid", "torch.nn.Softmax", "tensorflow.train.list_variables", "torch.nn.Bilinear", "numpy.transpose", "torch.empty", "torch.nn.Embedding", "torch.zeros", "t...
fredrikgyll/ssd.pytorch
[ "0a41a1074d38cefbdf491615461371f1b4eb7daf" ]
[ "data/pollendb1.py" ]
[ "\"\"\"POLLEN Dataset Classes\n\nOriginal author: Francisco Massa\nhttps://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py\n\nUpdated by: Ellis Brown, Max deGroot\n\"\"\"\nimport os.path as osp\nimport pickle\n\nimport cv2\nimport numpy as np\nimport torch\nimport torch.utils.data as data\n\nf...
[ [ "numpy.array", "numpy.expand_dims" ] ]
konkon8/changepointseg
[ "223de6c7a103d29744414f25bae07ca9ee9e5b38" ]
[ "cpseg_functions.py" ]
[ "import cpseg_functions as cps\n\nimport numpy as np\nimport pandas as pd\n\nfrom PIL.Image import fromarray\nfrom skimage.measure import label, regionprops_table\nfrom skimage.morphology import disk, remove_small_objects, skeletonize\nfrom skimage.segmentation import clear_border\nfrom skimage.metrics import mean_...
[ [ "numpy.max", "numpy.square", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.nonzero", "numpy.shape", "numpy.mean", "numpy.where", "numpy.any", "numpy.arange", "numpy.copysign", "numpy.ravel", "numpy.hstack", "numpy.maximum" ] ]
yafei-liu/cs231n.github.io
[ "411057406046c115306e1ee87dd0353a2dc4572c" ]
[ "assignments/2020/assignment2/cs231n/classifiers/fc_net.py" ]
[ "from builtins import range\nfrom builtins import object\nimport numpy as np\n\nfrom ..layers import *\nfrom ..layer_utils import *\n\n\nclass TwoLayerNet(object):\n \"\"\"\n A two-layer fully-connected neural network with ReLU nonlinearity and\n softmax loss that uses a modular layer design. We assume an ...
[ [ "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.random.randn", "numpy.arange" ] ]
rajveerbains/greyatom-python-for-data-science
[ "30e2c4c933f8b4f192df8c1781f55fb0a94c9e0f" ]
[ "numpy-simple-task/code.py" ]
[ "# --------------\n# Importing header files\r\nimport numpy as np\r\nimport warnings\r\n\r\nwarnings.filterwarnings('ignore')\r\n\r\n#New record\r\nnew_record=[[50, 9, 4, 1, 0, 0, 40, 0]]\r\n\r\n#Reading file\r\ndata = np.genfromtxt(path, delimiter=\",\", skip_header=1)\r\ncensus=np.concatenate((data,new_reco...
[ [ "numpy.concatenate", "numpy.std", "numpy.genfromtxt", "numpy.mean" ] ]
hayesla/ndcube
[ "fb810fe9ad62e69125f78e153711c0a07d7bd9b8" ]
[ "ndcube/ndcube.py" ]
[ "import abc\nimport textwrap\nimport warnings\nfrom copy import deepcopy\nfrom collections import namedtuple\nfrom collections.abc import Mapping\n\nimport astropy.nddata\nimport astropy.units as u\nimport numpy as np\nfrom astropy.units import UnitsError\n\ntry:\n # Import sunpy coordinates if available to regi...
[ [ "numpy.array", "numpy.zeros", "numpy.where", "numpy.arange", "numpy.meshgrid" ] ]
nicovandenhooff/advent-of-code-2021
[ "22cfd668fc700dc717314adf64dfb7fcc31c35b5" ]
[ "problems/day-04-giant-squid/solution.py" ]
[ "# Advent of Code 2021\n# Day 4: Part 1 and Part 2\n# Author: Nico Van den Hooff\n\n\nimport numpy as np\n\n\ndef read_data(path):\n\n with open(path, \"r\") as f:\n lines = []\n matrix = []\n bingo_boards = []\n\n # bingo numbers\n numbers = [int(num) for num in f.readline().s...
[ [ "numpy.all", "numpy.where", "numpy.array" ] ]
epiproject/FaST-LMM-HPC
[ "5d6df81268aeff19015194ab0718a9163b8d33af" ]
[ "fastlmmhpc/association/single_snp_select.py" ]
[ "import numpy as np\nimport logging\nfrom fastlmmhpc.association import single_snp\nfrom sklearn.cross_validation import KFold\nimport pandas as pd\nimport os\nimport time\n\nimport pysnptools.util as pstutil\nfrom fastlmmhpc.inference import FastLMM\nfrom fastlmmhpc.util.mapreduce import map_reduce\nfrom fastlmmhp...
[ [ "numpy.logspace", "numpy.argmin" ] ]
warifp/getaltname
[ "8795a987a45c242cc959311cb6165a0efeda1e9f" ]
[ "gsan/crtsh.py" ]
[ "import json\n\nimport click\nimport pandas as pd\nimport requests\n\nfrom gsan.clean_df import strip_chars\n\n\ndef get_crtsh(domain, timeout=30):\n try:\n crt_req = requests.get(f\"https://crt.sh/?dNSName={domain}&output=json\", timeout=timeout).json()\n except requests.exceptions.ConnectionError:\n ...
[ [ "pandas.DataFrame", "pandas.read_json" ] ]
knaidoo29/TheoryCL
[ "c4c938d27f849bc547de83fe5ed6c2058ac0f3a8" ]
[ "TheoryCL/growth/linear_growth_class.py" ]
[ "import numpy as np\nimport camb as cb\nfrom scipy import integrate\nfrom scipy.interpolate import interp1d\nfrom . import linear_growth_functions as lgf\n\n\nclass CosmoLinearGrowth:\n\n \"\"\" A class for computing, storing and interpolating cosmological linear growth functions:\n\n - rz: comoving distance....
[ [ "numpy.log10", "scipy.interpolate.interp1d" ] ]
larajuse/DMAE
[ "48fafdd257a8e172c66a67d2311120c481488513" ]
[ "examples/scripts/visualization/moons.py" ]
[ "## -*- coding: utf-8 -*-\n\"\"\"\nExample script of clustering circles data with DMAE.\n\"\"\"\n# Author: Juan S. Lara <julara@unal.edu.co>\n# License: MIT\n\nfrom dmae.layers import DissimilarityMixtureAutoencoderCov, DissimilarityMixtureEncoderCov\nfrom dmae.initializers import InitKMeans, InitIdentityCov\nfrom ...
[ [ "sklearn.kernel_approximation.RBFSampler", "tensorflow.keras.layers.Input", "tensorflow.losses.mse", "sklearn.cluster.KMeans", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "tensorflow.keras.optimizers.Adam", "sklearn.datasets.make_moons", "tensorflow.keras....
KATO-Hiro/AtCoder
[ "cbbdb18e95110b604728a54aed83a6ed6b993fde" ]
[ "ABC/abc051-abc100/abc087/c.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\n# AtCoder Beginner Contest\r\n# Problem C\r\n\r\nimport numpy as np\r\n\r\nif __name__ == '__main__':\r\n # Input\r\n N = int(input())\r\n route = np.zeros([2, N], dtype=int)\r\n\r\n # HACK: More smarter.\r\n for i in range(2):\r\n line = [int(i) for i in input(...
[ [ "numpy.zeros" ] ]
oesteban/sdcflows
[ "17feeb3056448067ff7a1f80a7717f7a5b1194a0", "17feeb3056448067ff7a1f80a7717f7a5b1194a0" ]
[ "sdcflows/utils/epimanip.py", "sdcflows/workflows/fit/syn.py" ]
[ "\"\"\"\nManipulation of EPI data.\n\n.. testsetup::\n\n >>> tmpdir = getfixture('tmpdir')\n >>> tmp = tmpdir.chdir() # changing to a temporary directory\n >>> nb.Nifti1Image(np.zeros((90, 90, 60)), None, None).to_filename(\n ... tmpdir.join('epi.nii.gz').strpath)\n\n\"\"\"\n\n\ndef get_trt(in_meta,...
[ [ "numpy.zeros_like", "numpy.clip", "numpy.percentile", "scipy.ndimage.measurements.center_of_mass", "scipy.ndimage.watershed_ift" ], [ "numpy.dtype" ] ]
mesdaghi/conkit
[ "01468761352bd3ac5078e5e9fef6f73c8c49036e" ]
[ "conkit/core/sequencefile.py" ]
[ "# coding=utf-8\n#\n# BSD 3-Clause License\n#\n# Copyright (c) 2016-19, University of Liverpool\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of source code must ...
[ [ "numpy.full", "numpy.array", "numpy.zeros" ] ]
Erotemic/dtool_ibeis
[ "6c28c82248760383333adcd42ab8fbf1efaed425" ]
[ "dtool_ibeis/base.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport re\nimport functools\nimport operator as op\nimport utool as ut\nimport numpy as np\nimport copy\nimport six\n(print, rrr, profile) = ut.inject2(__name__, '[depbase]')\n\n\nclass StackedConfig(ut.Dic...
[ [ "numpy.array", "numpy.unique" ] ]
hqbao/dlp_tf
[ "e8fe3281470faebbe8e36caf55025c270e84c44f", "e8fe3281470faebbe8e36caf55025c270e84c44f" ]
[ "face_detection_4tiers/datagen.py", "facenet/test.py" ]
[ "import tensorflow as tf\nimport numpy as np\nfrom skimage import io, transform\nfrom random import randint\nfrom scipy.stats import multivariate_normal\nfrom utils import comiou2d, comloc2d\n\n\ndef contrast(image):\n\t'''\n\t'''\n\n\timage = image - 127\n\timage = image*(randint(100, 150)/100)\n\timage = image + ...
[ [ "numpy.mean", "tensorflow.one_hot", "tensorflow.math.less_equal", "tensorflow.cast", "numpy.max", "numpy.concatenate", "tensorflow.concat", "tensorflow.transpose", "numpy.flipud", "tensorflow.constant", "tensorflow.math.argmax", "numpy.transpose", "tensorflow.sq...
estoneman/ssl-metrics-github-issues
[ "d0eb84d957d3a37886d4f5aa48b015075ae107cf" ]
[ "ssl_metrics_github_issues/graphing.py" ]
[ "from textwrap import wrap\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.figure import Figure\n\nfrom ssl_metrics_github_issues.polynomialMath import findBestFitLine\n\n\ndef graph(\n title: str,\n xLabel: str,\n yLabel: str,\n xData: list,\n yData: list,\n maximumDegree:...
[ [ "numpy.polyder", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplot" ] ]
samuelpeet/conehead
[ "0e18ef6b80104aeb97ab58fc33efa776ad9b6e10" ]
[ "conehead/kernel.py" ]
[ "# kernel.py\n#\n# Energy deposition kernel data for varian 6MV source created with EDKnrc.\n#\n# Simulation details:\n#\n# Histories - 20000000\n# Num cones - 48\n# Angles - 3.75 degree spacing\n# Num spheres - 24\n# Medium - H20521ICRU\n# ECUT - 0.521\n# PCUT - 0.010\n#\nimport numpy as np\n\n\nclass Polyenergeti...
[ [ "numpy.array", "numpy.linspace", "numpy.cumsum" ] ]
yougoforward/MyDetectron2018713
[ "d0093705b985391da056422cb6f3312d51bbf04f" ]
[ "myscipts/faster_rcnn_demo/gui.py" ]
[ "#!/usr/bin/python2\n# -*- coding: utf-8 -*-\n\n# Form implementation generated from reading ui file 'camara_ui.ui'\n#\n# Created by: PyQt5 UI code generator 5.5.1\n#\n# WARNING! All changes made in this file will be lost!\n\n\nfrom PyQt5 import QtCore, QtGui, QtWidgets\nimport sys\nimport cv2\nimport numpy as np\n...
[ [ "numpy.concatenate", "numpy.array" ] ]
QZabre/vendor-oss-pyqtgraph
[ "0e5c359e76746be6f4311cbce2dd25c2f2169d65" ]
[ "pyqtgraph/graphicsItems/PlotItem/PlotItem.py" ]
[ "# -*- coding: utf-8 -*-\nimport sys\nimport warnings\nimport weakref\nimport numpy as np\nimport os\nfrom ...Qt import QtGui, QtCore, QT_LIB\nfrom ... import pixmaps\nfrom ... import functions as fn\nfrom ...widgets.FileDialog import FileDialog\nfrom .. PlotDataItem import PlotDataItem\nfrom .. ViewBox import View...
[ [ "numpy.arange", "numpy.clip" ] ]
schmmd/allennlp
[ "fbc28cefe03b1ea3ff65300d475d34f5f9629a5c", "fbc28cefe03b1ea3ff65300d475d34f5f9629a5c" ]
[ "allennlp/modules/token_embedders/bert_token_embedder.py", "allennlp/tests/modules/token_embedders/bert_embedder_test.py" ]
[ "\"\"\"\nA ``TokenEmbedder`` which uses one of the BERT models\n(https://github.com/google-research/bert)\nto produce embeddings.\n\nAt its core it uses Hugging Face's PyTorch implementation\n(https://github.com/huggingface/pytorch-pretrained-BERT),\nso thanks to them!\n\"\"\"\nfrom typing import Dict\nimport loggi...
[ [ "torch.cat", "torch.stack", "torch.split", "torch.zeros_like", "torch.nn.functional.pad" ], [ "torch.LongTensor" ] ]
shadowcz007/Model-Swap-Face_v2
[ "49c68e4bea7468714437d18615a1c0a8799068dc" ]
[ "main.py" ]
[ "import argparse\r\nimport torch\r\nimport numpy as np\r\nimport sys\r\nimport os,shutil\r\nimport dlib\r\nsys.path.append(\".\")\r\nsys.path.append(\"..\")\r\nfrom configs import data_configs, paths_config\r\nfrom datasets.inference_dataset import InferenceDataset\r\nfrom torch.utils.data import DataLoader\r\nfrom...
[ [ "torch.cat", "numpy.array", "torch.no_grad", "torch.save", "torch.multiprocessing.set_start_method", "torch.utils.data.DataLoader", "torch.load" ] ]
Notilyze/Faster-R-CNN-Object-Detection
[ "d1c6e52b8686ceb71ebf9f7e1c4c48efc3b6040b" ]
[ "kbardool/keras-frcnn-master/kbardool_14_test_frcnn_boost.py" ]
[ "from __future__ import division\nimport os\nimport cv2\nimport numpy as np\nimport sys\nimport pickle\nfrom optparse import OptionParser\nimport time\nfrom keras_frcnn import config\nfrom keras import backend as K\nfrom keras.layers import Input\nfrom keras.models import Model\nfrom keras_frcnn import roi_helpers\...
[ [ "numpy.max", "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.random.randint", "numpy.transpose", "numpy.argmax", "numpy.expand_dims" ] ]
eddacicek/zenfiles
[ "877be0427e453504dc9f6a1f64d87497dfa0b17b" ]
[ "nba-pipeline/steps/encoder.py" ]
[ "import os\nimport pandas as pd\nimport numpy as np\nfrom typing import Any, Type, Union, List\nimport pickle\nfrom sklearn import preprocessing\n\nfrom zenml.materializers.base_materializer import BaseMaterializer\nfrom zenml.artifacts import ModelArtifact\nfrom zenml.steps.step_output import Output\nfrom zenml.io...
[ [ "sklearn.preprocessing.LabelEncoder", "sklearn.preprocessing.OneHotEncoder" ] ]
arafin-lab/model_inversion_experiments
[ "4029ae8683b9056013e6424d8931afe79afa618e" ]
[ "cyphercat/attacks.py" ]
[ "# Pytorch imports\nimport torch\n# Cyphercat imports\nfrom .train import train, train_attacker\nfrom .metrics import eval_membership_inference, eval_attack_model\n# Device to run on\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\n\ndef ml_leaks1(target=None, shadow_model=None, attac...
[ [ "torch.cuda.is_available", "torch.LongTensor" ] ]
milanoscookie/sfa
[ "a460d0a6e65ed4d32955c637d123f991f07351e0", "a460d0a6e65ed4d32955c637d123f991f07351e0" ]
[ "sfa/plot/table_hierarchical_clustering.py", "sfa/topology.py" ]
[ "\nimport numpy as np\nimport scipy.spatial.distance as distance\nimport scipy.cluster.hierarchy as sch\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\n\nimport seaborn as sns\n\nfrom .table_condition import ConditionTable\n\n\nclass HierarchicalClusteringTable(Conditi...
[ [ "scipy.cluster.hierarchy.dendrogram", "scipy.cluster.hierarchy.linkage", "numpy.array", "scipy.spatial.distance.pdist", "scipy.cluster.hierarchy.set_link_color_palette", "matplotlib.pyplot.rc_context", "numpy.arange" ], [ "pandas.DataFrame" ] ]
devpouya/GeneralizedEasyFirstParser
[ "5006b6c73244f7db2fb099ed40ea1cae5bae0aae" ]
[ "src/h01_data/oracle.py" ]
[ "from utils import constants\nfrom utils.data_structures import BaseStack, BaseBuffer\nimport numpy as np\n\nimport itertools\n\n\ndef break_two_way(heads):\n for i in range(len(heads)):\n for j in range(len(heads)):\n if heads[i] == j and heads[j] == i:\n heads[i] = i\n retur...
[ [ "numpy.argwhere" ] ]
fangq/pandas
[ "a1e919384d49226e162d29eeb9b21f441896a921" ]
[ "pandas/core/arrays/datetimelike.py" ]
[ "from __future__ import annotations\n\nfrom datetime import (\n datetime,\n timedelta,\n)\nimport operator\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Literal,\n Sequence,\n TypeVar,\n Union,\n cast,\n overload,\n)\nimport warnings\n\nimport numpy as np\n\nfrom panda...
[ [ "pandas.core.dtypes.common.is_string_dtype", "numpy.array_equal", "pandas.core.dtypes.common.is_unsigned_integer_dtype", "pandas.core.ops.common.unpack_zerodim_and_defer", "pandas.util._exceptions.find_stack_level", "pandas.core.ops.invalid.invalid_comparison", "pandas.compat.numpy.fun...
shyamrav/gatk-sv
[ "bf3704bd1d705339577530e267cd4d1b2f77a17f" ]
[ "src/svtk/svtk/adjudicate/labelers.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n\n\"\"\"\n\n\"\"\"\n\nimport numpy as np\n\n\nclass TrainingLabeler:\n def __init__(self):\n pass\n\n def label(self, metrics):\n return metrics.apply(self.label_row, axis=1)\n\n def label_row(self, row):\n return 'Unlabeled'\n\n\ncla...
[ [ "numpy.log10" ] ]
satyanshukla/Deep4Cast
[ "52d41f82f1b9ac3c7417ffbfabc32cc9d8505bfb" ]
[ "deep4cast/forecasters.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Time series forecasting module.\n\nThis module provides access to forecasters that can be fit multivariate time\nseries given as numpy arrays.\n\n\"\"\"\nfrom inspect import getargspec\n\nimport numpy as np\nimport keras.optimizers\n\nfrom .models import SharedLayerModel\nfrom .topol...
[ [ "numpy.array", "numpy.isnan", "numpy.random.seed", "numpy.nanpercentile", "numpy.mean", "numpy.where", "numpy.nanmean", "numpy.swapaxes", "numpy.squeeze", "numpy.nanstd" ] ]
Deep-Learning-and-Aging/Scalars-based-models-and-XWAS-pipeline
[ "f6913ce4ec1f6aed358ba27fdf575257f712c132" ]
[ "aging/model/load_and_save_environment_data.py" ]
[ "import pandas as pd\nimport glob\nfrom string import ascii_uppercase\nfrom functools import partial\n\n## Environmental Variables + Medical condition\nfrom ..processing.base_processing import read_ethnicity_data\nfrom ..environment_processing.base_processing import path_features , path_predictions, path_inputs_env...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
LRY89757/hello-dian.ai
[ "3072dd2c6ece5c91977a2e8d36978f5dcbcdd3be" ]
[ "lab1/nn/tensor.py" ]
[ "import numpy as np\n\n\nclass Tensor(np.ndarray):\n \"\"\"Derived Class of np.ndarray.\"\"\"\n def __init__(self, *args, **kwargs):\n self.grad = None\n\n\ndef tensor(shape):\n \"\"\"Return a tensor with a normal Gaussian distribution.\"\"\"\n return random(shape)\n\n\ndef from_array(arr):\n ...
[ [ "numpy.random.normal" ] ]
GrohLab/ssm
[ "a27c0d47837f676db9f7cf48924a653d148c5635" ]
[ "ssm/transitions.py" ]
[ "from functools import partial\nfrom warnings import warn\n\nimport autograd.numpy as np\nimport autograd.numpy.random as npr\nfrom autograd.scipy.special import logsumexp\nfrom autograd.scipy.stats import dirichlet\nfrom autograd import hessian\n\nfrom ssm.util import one_hot, logistic, relu, rle, ensure_args_are_...
[ [ "sklearn.mixture.GaussianMixture" ] ]
bauyrzha/DSCI510-finalproject
[ "266cfa1f6ef7fd6dfabbce8782411767243f7f8a" ]
[ "src/scraper.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sat Nov 20 21:04:10 2021\r\n\r\n@author: Yerke\r\n\"\"\"\r\n\r\n#import necessary libraries\r\nfrom bs4 import BeautifulSoup\r\nimport requests\r\nimport pandas as pd\r\nimport sys\r\nimport http.client\r\nimport json\r\nimport time\r\n\r\n#my api_key. You will recei...
[ [ "pandas.DataFrame.from_dict", "pandas.DataFrame", "pandas.read_csv" ] ]
enessenel/novosparc
[ "9e9048ed996d3e751232d78447b410ccd726782b" ]
[ "novosparc/geometry/_geometry.py" ]
[ "from __future__ import print_function\n\n###########\n# imports #\n###########\n\nimport numpy as np\nfrom matplotlib.image import imread\n\n#############\n# functions #\n#############\n\ndef construct_target_grid(num_cells):\n \"\"\"Constructs a rectangular grid. First a grid resolution is randomly\n chosen...
[ [ "numpy.array", "matplotlib.image.imread", "numpy.random.uniform", "numpy.arange", "numpy.random.randint", "numpy.sqrt" ] ]
Helicopt/fastPyMOTMetrics
[ "2233db5781dcf3097fabf444c978f31b92b815c7" ]
[ "motmetrics/distances.py" ]
[ "\"\"\"py-motmetrics - metrics for multiple object tracker (MOT) benchmarking.\n\nChristoph Heindl, 2017\nToka, 2018\nhttps://github.com/cheind/py-motmetrics\nFast implement by TOKA\n\"\"\"\n\nimport numpy as np\n\ndef norm2squared_matrix(objs, hyps, max_d2=float('inf')):\n \"\"\"Computes the squared Euclidean d...
[ [ "numpy.empty", "numpy.atleast_2d" ] ]
stonebig/spyder
[ "3556172888d8bb5dcc5f735676868a0d78d7d604" ]
[ "spyder/widgets/variableexplorer/tests/test_dataframeeditor.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright © Spyder Project Contributors\n# Licensed under the terms of the MIT License\n\n\"\"\"\nTests for dataframeeditor.py\n\"\"\"\n\nfrom __future__ import division\n\n# Third party imports\nfrom pandas import DataFrame, date_range\nfrom qtpy.QtGui import QColor\nimport pytest\n\...
[ [ "pandas.DataFrame", "pandas.date_range" ] ]
giovp/scvi-tools
[ "9b9370aa502b308f84e3129a7c940a9bea06426b" ]
[ "scvi/external/cellassign/_model.py" ]
[ "import logging\nfrom typing import Optional, Union\n\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom anndata import AnnData\nfrom pytorch_lightning.callbacks import Callback\nfrom pytorch_lightning.callbacks.early_stopping import EarlyStopping\n\nimport scvi\nfrom scvi import _CONSTANTS\nfrom scvi.dat...
[ [ "numpy.max", "torch.cat", "numpy.log", "torch.no_grad", "numpy.min", "numpy.mean", "numpy.std", "torch.Tensor" ] ]
healeycodes/country-borders
[ "2928109edb4e2b1dacd20455f1d63a339f6ca330" ]
[ "graph.py" ]
[ "import pandas as pd\nimport networkx as nx\nimport matplotlib.pyplot as plt\n\n\ndef show(from_verts, to_verts):\n df = pd.DataFrame(\n {'from': from_verts, 'to': to_verts})\n G = nx.from_pandas_edgelist(df, 'from', 'to')\n\n # TODO: check https://stackoverflow.com/a/54876985 for why the graph is s...
[ [ "pandas.DataFrame", "matplotlib.pyplot.show" ] ]
tonkolviktor/lords-ai
[ "56911ccecf51c72d55a3e53785150918f67d2691" ]
[ "lords_ai/deep_agent.py" ]
[ "# In the Deepmind paper they use RMSProp however then Adam optimizer\n# improves training time\nimport logging\nimport datetime\nimport gym\nimport numpy as np\nimport tensorflow as tf\nimport itertools\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nimport multiprocessing\n\nfrom lords_ai.q_mo...
[ [ "tensorflow.keras.losses.Huber", "numpy.array", "tensorflow.convert_to_tensor", "numpy.random.choice", "tensorflow.GradientTape", "numpy.random.rand", "tensorflow.expand_dims", "tensorflow.multiply", "numpy.sum", "tensorflow.argmax", "numpy.mean", "tensorflow.reduce...
LaudateCorpus1/transform
[ "afee306046b8f656355b0170793ee64423f30e23", "afee306046b8f656355b0170793ee64423f30e23" ]
[ "tensorflow_transform/coders/example_proto_coder.py", "tensorflow_transform/tf2_utils.py" ]
[ "# Copyright 2017 Google Inc. 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 required by appl...
[ [ "numpy.array", "tensorflow.train.FloatList", "tensorflow.train.Int64List", "numpy.vectorize", "numpy.asarray", "numpy.float32", "tensorflow.train.Example", "numpy.int64" ], [ "tensorflow.python.framework.ops.executing_eagerly_outside_functions", "tensorflow.nest.pack_se...
unleashlive/yolact
[ "a558730abf9e54cdafa8fa6e39f3b496bb227ed1" ]
[ "yolact/scripts/plot_loss.py" ]
[ "import re, sys, os\nimport matplotlib.pyplot as plt\n\nfrom yolact.utils.functions import MovingAverage\n\nwith open(sys.argv[1], 'r') as f:\n\tinp = f.read()\n\npatterns = {\n\t'train': re.compile(r'\\[\\s*(?P<epoch>\\d+)\\]\\s*(?P<iteration>\\d+) \\|\\| B: (?P<b>\\S+) \\| C: (?P<c>\\S+) \\| M: (?P<m>\\S+) \\|( S...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
bfkwong/Latex-Book-Parser
[ "07ed107b785c7297eb4a41bbf337bc006a14f00c" ]
[ "PynbParser.py" ]
[ "import sys\nimport re\nimport json\nimport urllib\nimport os\nimport base64\nimport requests\nimport mistletoe\nimport pandas as pd\nfrom mistletoe.latex_renderer import LaTeXRenderer\n\nOUTPUT_IMG_CNT = 0\nOPERATING_PATH = \"\"\nCHAPTER_TOP = True\n\nsectionRE = r'\\\\section{(?P<title>[\\s\\S]*?)}(?P<post>[\\s\\...
[ [ "pandas.read_csv" ] ]
janreerink/CarND-Capstone
[ "9b020cbc476ab61753cab421df1a18db7b88d6da" ]
[ "ros/src/tl_detector/tl_detector.py" ]
[ "#!/usr/bin/env python\nimport rospy\nfrom std_msgs.msg import Int32\nfrom geometry_msgs.msg import PoseStamped, Pose\nfrom styx_msgs.msg import TrafficLightArray, TrafficLight\nfrom styx_msgs.msg import Lane\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge\nfrom light_classification.tl_classifier...
[ [ "scipy.spatial.KDTree", "numpy.array", "numpy.dot" ] ]
Weilando/bachelor_playground
[ "e1455029384f05a48ea5d792f76aa5d232fc1ddc" ]
[ "test/test_pruning.py" ]
[ "from unittest import TestCase, main as unittest_main\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.utils.prune as prune\n\nimport pruning.magnitude_pruning as mp\n\n\nclass TestPruning(TestCase):\n \"\"\" Tests for the pruning logic.\n Call with 'python -m test.test_pruning' from project root '~'.\...
[ [ "torch.nn.Linear", "torch.nn.utils.prune.custom_from_mask", "torch.nn.MaxPool2d", "torch.nn.Conv2d", "torch.tensor", "torch.ones_like" ] ]
marblet/DeepRobust
[ "276a7048aded2cf3a190d3851ffd4587b7d1dd49" ]
[ "examples/image/test_fgsm.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F #233\nimport torch.optim as optim\nfrom torchvision import datasets,models,transforms\nfrom PIL import Image\nimport argparse\n\nfrom deeprobust.image.attack.fgsm import FGSM\nfrom deeprobust.image.netmodels.CNN import Net\nfr...
[ [ "matplotlib.pyplot.savefig", "torch.load", "matplotlib.pyplot.imshow" ] ]
skoudoro/pc4cancerimmune3D
[ "751b70a944a2205271460ce5231bfa4ab142ef5b" ]
[ "bin/substrates.py" ]
[ "# substrates Tab\n\nimport os, math\nfrom pathlib import Path\nfrom shutil import copyfile\nfrom ipywidgets import Layout, Label, Text, Checkbox, Button, BoundedIntText, HBox, VBox, Box, \\\n FloatText, Dropdown, interactive\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import BoundaryNorm\nfrom mat...
[ [ "numpy.array", "matplotlib.pyplot.xlim", "matplotlib.ticker.MaxNLocator", "matplotlib.collections.PatchCollection", "numpy.broadcast", "matplotlib.colors.to_rgb", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.fabs", "numpy.issca...
anhlbt/faceidsys
[ "630efe78830360565958621c80d247a6055c7cb4", "630efe78830360565958621c80d247a6055c7cb4" ]
[ "libfaceid/tacotron/models/helpers.py", "libfaceid/tacotron/train.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tensorflow.contrib.seq2seq import Helper\n\n\n# Adapted from tf.contrib.seq2seq.GreedyEmbeddingHelper\nclass TacoTestHelper(Helper):\n def __init__(self, batch_size, output_dim, r):\n with tf.name_scope('TacoTestHelper'):\n self._batch_size = batch_size\n ...
[ [ "tensorflow.shape", "tensorflow.equal", "tensorflow.TensorShape", "tensorflow.name_scope", "tensorflow.tile" ], [ "tensorflow.train.Coordinator", "tensorflow.summary.scalar", "tensorflow.summary.histogram", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow...
meteoDaniel/pvlib-python
[ "03bb14384d896b45b485ea88d70521f878d1e23a" ]
[ "pvlib/bifacial.py" ]
[ "\"\"\"\nThe ``bifacial`` module contains functions for modeling back surface\nplane-of-array irradiance under various conditions.\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\n\n\ndef pvfactors_timeseries(\n solar_azimuth, solar_zenith, surface_azimuth, surface_tilt,\n axis_azimuth,\n ti...
[ [ "pandas.DataFrame", "numpy.array" ] ]
Jianxiang-Wang/Pytorch-code-for-classification-of-public-dataset-or-custom-dataset
[ "c888a29cf58fba11c748405cbaf2bedfeb64b85e" ]
[ "models/pnasnet.py" ]
[ "'''PNASNet in PyTorch.\n\nPaper: Progressive Neural Architecture Search\n'''\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass SepConv(nn.Module):\n '''Separable Convolution.'''\n def __init__(self, in_planes, out_planes, kernel_size, stride):\n super(SepConv, self).__in...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.functional.avg_pool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.Conv2d", "torch.nn.functional.relu", "torch.nn.functional.max_pool2d", "torch.randn" ] ]
fidanyan/phonopy
[ "560ee340c4ae337dfac8018119ed129ae3b0c8b1" ]
[ "phonopy/structure/symmetry.py" ]
[ "# Copyright (C) 2011 Atsushi Togo\n# All rights reserved.\n#\n# This file is part of phonopy.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the above copyr...
[ [ "numpy.array", "numpy.zeros_like", "numpy.dot", "numpy.linalg.norm", "numpy.zeros", "numpy.rint", "numpy.nonzero", "numpy.eye", "numpy.abs", "numpy.linalg.inv", "numpy.floor" ] ]
jcapriot/geosci-labs
[ "044a73432b9cb1187924f7761942ab329259d875", "044a73432b9cb1187924f7761942ab329259d875" ]
[ "geoscilabs/seismic/drawGaussianSeismogram.py", "geoscilabs/dcip/DCsphere.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nb = 2.5\nx = np.linspace(0, 20, 200)\n\nf = np.exp(-((x - b) ** 2) / 2)\nfig, ax = plt.subplots(1, 1, figsize=(9, 3))\nax.plot(x, f, \"k\")\nax.set_ylim([-0.5, 1.5])\nax.set_xticks(np.linspace(0, 20, 21))\nax.fill_between(x, f, np.zeros_like(f), color=\"k\")\n...
[ [ "numpy.zeros_like", "numpy.linspace", "numpy.exp", "matplotlib.pyplot.subplots" ], [ "numpy.zeros_like", "scipy.special.legendre" ] ]
AbraInsight/nncf_pytorch
[ "5e8d72d5e2f0c30da05d95cd9c3b3d8832ac8572" ]
[ "nncf/pruning/filter_pruning/algo.py" ]
[ "\"\"\"\n Copyright (c) 2020 Intel Corporation\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 http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agr...
[ [ "torch.cat", "torch.no_grad" ] ]
xksteven/ethics_amti
[ "e4f2f8d5456bda37f4eae7fffa5d271a727985dc" ]
[ "examples/validate_obligations/create_tasks.py" ]
[ "# simple task generator double check the max Assignments\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport json\nfrom sklearn.utils import shuffle\n\nparser = argparse.ArgumentParser(description='Create tasks to validate.')\nparser.add_argument('--hits', type=int, default=100, help='how many valida...
[ [ "pandas.read_csv", "numpy.arange", "sklearn.utils.shuffle" ] ]
loijord/numpyviz
[ "f3cf6939bd91507118480de41ee7e488463658c9" ]
[ "recipe3.py" ]
[ "\"\"\"this is an example that demonstrates how to multiply three polynomials\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom numpyviz import VisualArray\n\narr = np.array([[[r'$x^2y$', r'$xy^2$'],[r'$xy^2$', r'$y^3$']],\n [[r'$x^3$', r'$x^2y$'],[r'$x^2y$', r'$xy^2$']]])\nva = Visu...
[ [ "matplotlib.pyplot.show", "numpy.array", "numpy.where" ] ]
lbl-anp/becquerel
[ "988497cf97dddead0beba6170cbab4b70017f97f" ]
[ "becquerel/parsers/spe.py" ]
[ "\"\"\"Read in an Ortec SPE file.\"\"\"\n\nimport datetime\nimport os\nimport warnings\nimport dateutil.parser\nimport numpy as np\nfrom ..core import calibration\nfrom .parsers import BecquerelParserError, BecquerelParserWarning\n\n\ndef read(filename, verbose=False):\n \"\"\"Parse the ASCII SPE file and return...
[ [ "numpy.allclose", "numpy.append" ] ]
suryagutta/AV-Thermal-Pseudo-Multimodal
[ "c0c443a7d7028ff1e819db16de1efc6eaa4bbda1" ]
[ "lib/model/unit/test_batch.py" ]
[ "\"\"\"\nCopyright (C) 2018 NVIDIA Corporation. All rights reserved.\nLicensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).\n\"\"\"\nfrom __future__ import print_function\nfrom utils import get_config, get_data_loader_folder, pytorch03_to_pytorch04\nfrom trainer ...
[ [ "torch.manual_seed", "torch.cuda.manual_seed", "torch.randn", "torch.load" ] ]
timsetsfire/ScratchNet
[ "da09f42a567068200c6016835bef7d05fcc80345" ]
[ "scratchnet/datasets.py" ]
[ "import numpy as np\n\ndef make_spiral(n_samples, n_features, n_classes):\n N = n_samples // n_classes # number of points per class\n D = n_features # dimensionality\n K = n_classes # number of classes\n X = np.zeros((N*K,D)) # data matrix (each row = single example)\n y = np.zeros(N*K, dtype='uint8'...
[ [ "numpy.sin", "numpy.zeros", "numpy.random.randn", "numpy.arange", "numpy.cos", "numpy.linspace" ] ]
tacaswell/DataBroker
[ "2995b2b974b156330364797b103a898b88489362" ]
[ "databroker/assets/tests/test_fs_mutate.py" ]
[ "from __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nimport pytest\nfrom itertools import chain, product\nimport os.path\nimport uuid\nimport numpy as np\n\nfrom ..handlers_base import HandlerBase\n\n\ndef _verify_shifted_resource(last_res, new_res):\n ...
[ [ "numpy.sum", "numpy.ones", "numpy.load", "numpy.prod" ] ]
berndverst/pycon-indonesia-app
[ "c5b3170b17bf1548b1d04a8a95a2f5e2ccfa44ff" ]
[ "model/ner_model.py" ]
[ "import numpy as np\nimport os\nimport tensorflow as tf\n\n\nfrom .data_utils import minibatches, pad_sequences, get_chunks\nfrom .general_utils import Progbar\nfrom .base_model import BaseModel\n\n\nclass NERModel(BaseModel):\n \"\"\"Specialized class of Model for NER\"\"\"\n\n def __init__(self, config):\n ...
[ [ "tensorflow.matmul", "numpy.mean", "tensorflow.reshape", "tensorflow.nn.embedding_lookup", "tensorflow.shape", "tensorflow.concat", "tensorflow.nn.bidirectional_dynamic_rnn", "tensorflow.argmax", "tensorflow.Variable", "tensorflow.variable_scope", "tensorflow.nn.dropout...
JiahuaWU/fastai
[ "13a2df812d875abf0558004283392ab40d9bdea1" ]
[ "fastai/vision/models/cadene_models.py" ]
[ "#These models are dowloaded via the repo https://github.com/Cadene/pretrained-models.pytorch\n#See licence here: https://github.com/Cadene/pretrained-models.pytorch/blob/master/LICENSE.txt\nfrom torch import nn\nfrom ..learner import model_meta\nfrom ...core import *\n\npretrainedmodels = try_import('pretrainedmod...
[ [ "torch.nn.Sequential" ] ]
wangtong106/deep_srl
[ "544217ccb68c363abe98a2a5835ca1d215864841" ]
[ "python/neural_srl/shared/numpy_utils.py" ]
[ "import math\nimport numpy\n\ndef orth_normal_initializer(factor=1.0, seed=None):\n ''' Reference: Exact solutions to the nonlinear dynamics of learning in\n deep linear neural networks\n Saxe et al., 2014. https://arxiv.org/pdf/1312.6120.pdf\n Adapted from the original implementation b...
[ [ "numpy.full", "numpy.dot", "numpy.zeros", "numpy.random.RandomState", "numpy.linalg.qr", "numpy.diag" ] ]
zzg-971030/PaddleNLP
[ "d84c2bbf31e0ede4f2d1dd1e7579951072c83143" ]
[ "examples/language_model/transformer-xl/train.py" ]
[ "import os\nimport time\nimport yaml\nimport logging\nimport argparse\nimport numpy as np\nfrom pprint import pprint\nfrom attrdict import AttrDict\n\nimport paddle\nimport paddle.nn as nn\nimport paddle.distributed as dist\n\nfrom mem_transformer import MemTransformerLM\nfrom reader import get_lm_vocab, get_lm_dat...
[ [ "numpy.exp", "numpy.log" ] ]
LaudateCorpus1/streetlearn
[ "ccf1d60b9c45154894d45a897748aee85d7eb69b" ]
[ "streetlearn/python/environment/streetlearn.py" ]
[ "# Copyright 2018 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.array", "numpy.dot", "numpy.random.randint" ] ]
nahuel-coliva/a-MLLibrary
[ "fd20ae1f205993f648393bda1db699a801a00656" ]
[ "myscripts/prediction_mapes.py" ]
[ "#!/usr/bin/env python3\nimport numpy as np\nimport os\nimport pandas as pd\nimport re\n\n_output_fold = '../../zz_old/coliva/outputs/extrapolation_vgg19'\n\ndef get_prediction_mapes(output_fold):\n # Initialize results dataframes\n dfs = {}\n\n # Loop over devices\n for device in os.listdir(output_fold...
[ [ "pandas.DataFrame" ] ]
PaNOSC-ViNYL/xoppylib
[ "4c5358a255d94c63d9b0126cdb02482d2eef292d" ]
[ "xoppylib/xoppy_calc_xcrystal.py" ]
[ "\nfrom xraylib import Crystal_GetCrystalsList\nimport numpy\nimport os, platform, six\n\nfrom xoppylib.xoppy_xraylib_util import bragg_calc\nfrom xoppylib.xoppy_util import locations\n\ndef xoppy_calc_xcrystal(\n CRYSTAL_MATERIAL = 32,\n MILLER_INDEX_H = 1,\n MILLER_INDEX_K = 1,\n MILLER_INDEX_L = 1,\n...
[ [ "numpy.loadtxt" ] ]
m3at/backlight
[ "a80ccbe6193e1fc4c169df2ebc2bf49876d4d39d" ]
[ "src/backlight/trades/trades.py" ]
[ "import pandas as pd\nfrom collections import namedtuple\nfrom functools import lru_cache\nfrom typing import Any, Type, List, Iterable, Optional # noqa\n\nfrom backlight.datasource.marketdata import MarketData\n\n\nTransaction = namedtuple(\"Transaction\", [\"timestamp\", \"amount\"])\n\n\ndef _max(s: pd.Series) ...
[ [ "pandas.concat", "pandas.Series" ] ]
naymaraq/aws-cv-task2vec
[ "7cc1088c2604fd9662c24dec60cf5bd42eb9f740" ]
[ "task2vec.py" ]
[ "# Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in th...
[ [ "numpy.concatenate", "torch.nn.functional.sigmoid", "numpy.array", "torch.cat", "numpy.ones_like", "torch.nn.CrossEntropyLoss", "numpy.exp", "numpy.eye", "torch.utils.data.DataLoader", "torch.nn.BCEWithLogitsLoss", "torch.nn.functional.softmax", "torch.zeros_like", ...
ChenWang8750/WTAM_net
[ "b5c01b9ebc2514cf6fc8ce45c0944b79f0c2a54d" ]
[ "models/net_modules/modules.py" ]
[ "import numpy as np\n\nimport torch\nimport torch.nn as nn\n\n###############################################################################\n# basic modules\n###############################################################################\ndef default_conv(in_channels, out_channels, kernel_size, bias=True, dilatio...
[ [ "torch.zeros", "torch.cat", "torch.nn.Softmax", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.nn.Sigmoid", "torch.nn.BatchNorm2d", "torch.no_grad", "torch.autograd.Variable", "torch.nn.ReplicationPad2d", "torch.bmm", "torch.ones", "torch.nn.ReLU", ...
karanbali/Chart-OCR
[ "d2da29a7c478d57b669c1afca8423d3b96e38180" ]
[ "Project/DeepRule/test_pipe_type_web.py" ]
[ "#!/usr/bin/env python\nimport os\nimport json\nimport torch\nimport pprint\nimport argparse\n\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport cv2\nfrom tqdm import tqdm\nfrom config import system_configs\nfrom nnet.py_factory import NetworkFactory\nfrom db.datasets import datasets\nimport importlib\nimport jso...
[ [ "matplotlib.use", "torch.no_grad", "torch.cuda.is_available" ] ]
kylejyx/TTSurv
[ "986d7bcc8943455a2cc8c9a385b3e4b4aaf751c6" ]
[ "collect_results.py" ]
[ "import os\nimport pandas as pd\nimport numpy as np\nimport sys\n\nnetwork = sys.argv[1]\nprint(f\"Results for {network}\")\nif ('Surv' in network or 'nnet' in network):\n names=[]\n values_cv = []\n values_ct = []\n values_i = []\n values_mean = []\n values_std = []\n values_t = []\n result...
[ [ "numpy.argmin", "pandas.DataFrame", "numpy.mean", "numpy.std", "numpy.argmax" ] ]
wuyx517/glow-tts
[ "d9c15b83ee7866d6e1884bac33cca0e6679ecfd9" ]
[ "data_utils.py" ]
[ "import random\nimport numpy as np\nimport torch\nimport torch.utils.data\n\nimport commons \nfrom utils import load_wav_to_torch, load_filepaths_and_text\nfrom text import text_to_sequence, cmudict, pinyin2phone\nfrom text.symbols import symbols\n\n\nclass TextMelLoader(torch.utils.data.Dataset):\n \"\"\"\n ...
[ [ "torch.IntTensor", "torch.squeeze", "numpy.load", "torch.rand_like" ] ]
Khushmeet/experiments-with-dl
[ "8da586d3506a72f595d7b54e12a09d2e2d421f67" ]
[ "input_data.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"Functions for downloading and reading MNIST data.\"\"\"\nimport gzip\nimport os\nfrom six.moves.urllib.request import urlretrieve\nimport numpy\nSOURCE_URL = 'http://yann.lecun.com/exdb/mnist/'\n\n\ndef maybe_download(filename, work_directory):\n \"\"\"Download the data from Yann'...
[ [ "numpy.zeros", "numpy.random.shuffle", "numpy.multiply", "numpy.arange", "numpy.frombuffer", "numpy.dtype" ] ]
luanps/pyserini
[ "3f7cc9d62d6713ded61f27908e826b094e99b39f" ]
[ "pyserini/search/faiss/_prf.py" ]
[ "import numpy as np\nfrom typing import List, Dict\nfrom pyserini.search.faiss import PRFDenseSearchResult, AnceQueryEncoder\nfrom pyserini.search.lucene import LuceneSearcher\nimport json\n\n\nclass DenseVectorPrf:\n def __init__(self):\n pass\n\n def get_prf_q_emb(self, **kwargs):\n pass\n\n ...
[ [ "numpy.array", "numpy.mean", "numpy.vstack" ] ]
pjsg/red-pitaya-notes
[ "85faf2ed717c1bb08d350376fe4b366fdc5c56a6" ]
[ "helpers/setup.py" ]
[ "from setuptools import setup\nimport os\nimport py2exe\nimport matplotlib\n\nincludes = [\n 'sip',\n 'PyQt5',\n 'PyQt5.uic',\n 'PyQt5.QtCore',\n 'PyQt5.QtDesigner',\n 'PyQt5.QtGui',\n 'PyQt5.QtNetwork',\n 'PyQt5.QtMultimedia',\n 'PyQt5.QtPrintSupport',\n 'PyQt5.QtWebSockets',\n 'PyQt5.QtWidgets',\n 'Py...
[ [ "matplotlib.get_py2exe_datafiles" ] ]