repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
whj363636/CamDrop
[ "f8af8c200665145f112b59348f60fc4cf80f04ec" ]
[ "ResNet/imagenet_utils.py" ]
[ "# -*- coding: utf-8 -*-\n# File: imagenet_utils.py\n\n\nimport multiprocessing\nimport numpy as np\nimport os\nfrom abc import abstractmethod\nimport cv2\nimport tensorflow as tf\nimport tqdm\n\nfrom tensorpack import ModelDesc\nfrom tensorpack.dataflow import AugmentImageComponent, BatchData, MultiThreadMapData, ...
[ [ "tensorflow.cond", "tensorflow.get_variable", "tensorflow.zeros", "numpy.asarray", "tensorflow.stack", "tensorflow.cast", "tensorflow.equal", "tensorflow.image.resize_bicubic", "tensorflow.image.decode_and_crop_jpeg", "tensorflow.group", "tensorflow.summary.scalar", ...
PacktPublishing/Applied-Computational-Thinking-with-Python
[ "fd9982383c5b473ffa1640998540d602876816e5" ]
[ "Chapter12/ch12_csvAnalysis_3.py" ]
[ "import pandas as pd\nimport matplotlib as mlp\nimport matplotlib.pyplot as plt\nimport os\n\n#Let Python know correct directory for file.\nos.chdir('C:\\\\...')\n\ngraduates = pd.read_csv('ch12_data.csv', index_col = 0)\nprint(graduates[0:13])\n\nfig, ax = plt.subplots()\nax.bar(graduates.index, graduates['Hispani...
[ [ "pandas.read_csv", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ] ]
bryanhpchiang/symbolic-music-diffusion
[ "341daa8c0198c9adda8d540ff14202e238c36c1c" ]
[ "input_pipeline.py" ]
[ "# Copyright 2021 The Magenta Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "tensorflow.cast", "tensorflow.gather", "tensorflow.reshape", "numpy.random.randn" ] ]
hugovk/pyirf
[ "12afef58a27862abfe2a6c049b68f6d05f6fe31d" ]
[ "pyirf/perf/cut_optimisation.py" ]
[ "import os\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport astropy.units as u\nfrom astropy.table import Table, Column\nfrom gammapy.spectrum.models import PowerLaw\nfrom gammapy.stats import significance_on_off\n\nfrom .utils import save_obj, load_obj, plot_hist\n\n__all__ = [\"CutsOptimisation\", \"C...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "numpy.sqrt", "numpy.linspace", "numpy.abs", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.cumsum", "numpy.cos", "numpy.where", "numpy.array", "numpy.histogram", "numpy.sum", "numpy.zeros", ...
zhongmicai/PlantCV
[ "f2ca234100568d431fc1b99b1c0d029f3385f180" ]
[ "plantcv/plantcv/roi_objects.py" ]
[ "import cv2\nimport numpy as np\nimport os\nfrom plantcv.plantcv import print_image\nfrom plantcv.plantcv import plot_image\nfrom plantcv.plantcv import fatal_error\nfrom plantcv.plantcv import params\n\n\ndef roi_objects(img, roi_contour, roi_hierarchy, object_contour, obj_hierarchy, roi_type=\"partial\"):\n \"...
[ [ "numpy.copy", "numpy.array", "numpy.shape", "numpy.vstack" ] ]
InsaneMonster/USienaRL
[ "95eb35913b448c970b83ab941a24657156cfcd9b", "95eb35913b448c970b83ab941a24657156cfcd9b" ]
[ "benchmarks/frozen_lake_desarsa.py", "usienarl/agents/double_deep_q_learning_agent_epsilon_greedy.py" ]
[ "#\n# Copyright (C) 2019 Luca Pasqualini\n# University of Siena - Artificial Intelligence Laboratory - SAILab\n#\n#\n# USienaRL is licensed under a BSD 3-Clause.\n#\n# You should have received a copy of the license along with this\n# work. If not, see <https://opensource.org/licenses/BSD-3-Clause>.\n\n# Import pack...
[ [ "tensorflow.contrib.layers.xavier_initializer" ], [ "tensorflow.Summary", "numpy.zeros" ] ]
Lavendulaa/programming-in-python-for-data-science
[ "22836d9013d3e3d1b1074678ba7dc3ee2e66f398" ]
[ "exercises/en/exc_08_26.py" ]
[ "import pandas as pd\n\nlego = pd.read_csv('data/lego-sets.csv')\n\n# Convert the name column in the lego dataset to lowercase and\n# overwrite the dataframe by saving it as an object named lego \n\n# ____ = ____\n# ____\n\n# Filter the dataset to find all the lego sets that contain \"weetabix\" in the name column...
[ [ "pandas.read_csv" ] ]
Cxl1013/TINT
[ "479c5899713d149003096fbbc900b3c52793394d" ]
[ "tint/grid_utils.py" ]
[ "\"\"\"\ntint.grid_utils\n===============\n\nTools for pulling data from pyart grids.\n\n\n\"\"\"\n\nimport datetime\n\nimport numpy as np\nimport pandas as pd\nfrom scipy import ndimage\n\n\ndef parse_grid_datetime(grid_obj):\n \"\"\" Obtains datetime object from pyart grid_object. \"\"\"\n dt_string = grid_...
[ [ "numpy.round", "scipy.ndimage.label", "numpy.any", "numpy.prod", "numpy.array" ] ]
markamo/xtellixClient
[ "9f2cb6454fa01b2199e7beec20e878890e9b175b" ]
[ "griewank-example.py" ]
[ "import xtellixClient as xm\nimport math\nimport numpy as np\nfrom tqdm import trange\n\ndef griewank_function(x, dim):\n \"\"\"Griewank's function \tmultimodal, symmetric, inseparable \"\"\"\n sumPart = 0\n prodPart = 1\n for i in range(dim):\n sumPart += x[i]**2\n prodPart *= math.cos(fl...
[ [ "numpy.ones" ] ]
schoyc/foolbox
[ "25d995b1a50f4926e07bc51877d385c0518982f8" ]
[ "foolbox/attacks/newtonfool.py" ]
[ "import logging\n\nfrom .base import Attack\nfrom .base import call_decorator\nfrom ..utils import softmax\n\nimport numpy as np\n\n\nclass NewtonFoolAttack(Attack):\n \"\"\"Implements the NewtonFool Attack.\n\n The attack was introduced in [1]_.\n\n References\n ----------\n .. [1] Uyeong Jang et al...
[ [ "numpy.linalg.norm", "numpy.clip" ] ]
Mohamed209/Train-CRNN
[ "6d2fe08d3bc43494158c732dc5997a951aef18c9" ]
[ "ocr/train_model.py" ]
[ "# coding: utf-8\nfrom keras.callbacks import ModelCheckpoint\nfrom keras.utils import to_categorical\nimport keras.backend as K\nfrom keras import optimizers\nfrom keras.activations import relu, sigmoid, softmax\nfrom keras.models import Model\nfrom keras.layers import Dense, LSTM, GRU, Reshape, BatchNormalization...
[ [ "numpy.ones", "numpy.zeros", "tensorflow.python.client.device_lib.list_local_devices", "numpy.random.choice" ] ]
LUUTHIENXUAN/fast-autoaugment-on-a-single-gpu
[ "20b61678ff09481a8b74e71ebd5a2188a44e8022" ]
[ "FastAutoAugment/data.py" ]
[ "import logging\n\nimport numpy as np\nimport os\n\nimport math\nimport random\nimport torch\nimport torchvision\nfrom PIL import Image\n\nfrom torch.utils.data import SubsetRandomSampler, Sampler, Subset, ConcatDataset\nimport torch.distributed as dist\nfrom torchvision.transforms import transforms\nfrom sklearn.m...
[ [ "torch.utils.data.SubsetRandomSampler", "numpy.clip", "torch.utils.data.DataLoader", "torch.from_numpy", "numpy.ones", "torch.utils.data.ConcatDataset", "torch.utils.data.Subset", "torch.distributed.get_rank", "torch.distributed.get_world_size", "sklearn.model_selection.Str...
jose-dscience/stylegan2
[ "4a8e775639c8b70c4dc6653e7b2d73974e268574" ]
[ "dataset_tool.py" ]
[ "# Copyright (c) 2019, NVIDIA Corporation. All rights reserved.\n#\n# This work is made available under the Nvidia Source Code License-NC.\n# To view a copy of this license, visit\n# https://nvlabs.github.io/stylegan2/license.html\n\n\"\"\"Tool for creating multi-resolution TFRecords datasets.\"\"\"\n\nimport os, s...
[ [ "tensorflow.train.Int64List", "numpy.log2", "numpy.pad", "numpy.min", "numpy.asarray", "numpy.arange", "numpy.rint", "tensorflow.python_io.TFRecordWriter", "numpy.concatenate", "numpy.all", "numpy.max", "numpy.round", "numpy.fromstring", "numpy.load", "n...
CFM-MSG/Code_SelectiveHCN
[ "1f624c5debd03925f0732d1d732c69c46d1fc39d" ]
[ "model/agc_layer.py" ]
[ "import math\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\n\nfrom .utils import *\n\n\nclass unit_tcn(nn.Module):\n def __init__(self, in_channels, out_channels, kernel_size=9, stride=1):\n super(unit_tcn, self).__init__()\n pad = int((kernel_size - ...
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.matmul", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
ok97465/npzheader
[ "f0540c378ac83ad13ea98a1f51818b2d73714ae6" ]
[ "npzheader/parser.py" ]
[ "\"\"\"Parse numpy binary format.\"\"\"\n# ------------ Import\n# Standard library imports\nimport os.path as osp\nimport zipfile\nfrom dataclasses import dataclass\nfrom typing import Union, Dict\n\n\n# Third party imports\nimport numpy as np\nfrom scipy.io import whosmat, loadmat\n\n\n# ----------- function\n@dat...
[ [ "scipy.io.whosmat", "scipy.io.loadmat" ] ]
JonathanThangadurai/ludwig
[ "c167b33079e32983196f0c8a75ce486883180164" ]
[ "ludwig/api.py" ]
[ "# !/usr/bin/env python\n# coding=utf-8\n# Copyright (c) 2019 Uber Technologies, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENS...
[ [ "pandas.DataFrame" ] ]
elb3k/perceiver-pytorch
[ "b07d5154c5dee63684c59f57d02a1b405701845f" ]
[ "perceiver_pytorch/experimental.py" ]
[ "import torch\nfrom torch import nn, einsum\nimport torch.nn.functional as F\n\nfrom einops import rearrange, repeat\n\nfrom perceiver_pytorch.perceiver_pytorch import exists, default, cache_fn, fourier_encode, PreNorm, FeedForward, Attention\n\n# linear attention\n\nclass LinearAttention(nn.Module):\n def __ini...
[ [ "torch.nn.Dropout", "torch.linspace", "torch.cat", "torch.einsum", "torch.nn.ModuleList", "torch.randn", "torch.nn.Linear", "torch.meshgrid" ] ]
yufeiwang63/ROLL
[ "aba0b4530934946eb9c41fbe5a0d6c27775596ff", "aba0b4530934946eb9c41fbe5a0d6c27775596ff" ]
[ "test_latent_space/test_vae.py", "segmentation/test_script.py" ]
[ "import numpy as np\nimport argparse\nfrom os import path as osp\nimport torch\nimport multiworld, gym\nfrom multiworld.core.image_env import ImageEnv, unormalize_image, normalize_image\nimport rlkit.torch.pytorch_util as ptu\nfrom multiworld.envs.mujoco.cameras import sawyer_init_camera_zoomed_in, sawyer_init_came...
[ [ "matplotlib.pyplot.legend", "numpy.arange", "numpy.load", "matplotlib.pyplot.subplots", "numpy.linalg.norm", "matplotlib.pyplot.savefig", "numpy.argmin", "matplotlib.pyplot.close", "numpy.argsort", "matplotlib.pyplot.show", "numpy.sum" ], [ "numpy.hstack", "...
chummels/trident_test
[ "259339b1d46f96565d862ad8f11d6d7970a2f73d" ]
[ "tests/test_line_database.py" ]
[ "\"\"\"\nTests for Line Database classes and functions\n\n\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2016, Trident Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distribute...
[ [ "numpy.arange", "numpy.ones" ] ]
VedantMadane/text
[ "66e250ed638e8161c28c654b4d37403871d23a71" ]
[ "tensorflow_text/python/ops/bert_tokenizer.py" ]
[ "# coding=utf-8\n# Copyright 2021 TF.Text Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.python.eager.monitoring.Counter", "tensorflow.python.ops.string_ops.string_lower", "tensorflow.python.ops.array_ops.expand_dims", "tensorflow.python.ops.string_ops.regex_replace" ] ]
wangwei14/tensorflow_learn
[ "d2d6e10a52c31fd177295375639a88d06f045bee", "d2d6e10a52c31fd177295375639a88d06f045bee" ]
[ "aymericdamien/linear_regression.py", "rnnlm/test_PTB.py" ]
[ "'''\nA linear regression learning algorithm example using TensorFlow library.\nAuthor: Aymeric Damien\nProject: https://github.com/aymericdamien/TensorFlow-Examples/\n'''\n\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy\nimport matplotlib.pyplot as plt\nrng = numpy.random\n\n# Para...
[ [ "matplotlib.pyplot.legend", "tensorflow.multiply", "tensorflow.pow", "numpy.asarray", "tensorflow.placeholder", "matplotlib.pyplot.plot", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.Session", "matplotlib.pyplot.show" ...
nash911/PyDL
[ "b0b6f599184c0046f503b9ee1703dc3dfe9a89f2", "b0b6f599184c0046f503b9ee1703dc3dfe9a89f2" ]
[ "pydl/tests/test_pool.py", "pydl/tests/test_batchnorm.py" ]
[ "# ------------------------------------------------------------------------\n# MIT License\n#\n# Copyright (c) [2021] [Avinash Ranganath]\n#\n# This code is part of the library PyDL <https://github.com/nash911/PyDL>\n# This code is licensed under MIT license (see LICENSE.txt for details)\n# ------------------------...
[ [ "numpy.ones_like", "numpy.pad", "numpy.sum", "numpy.min", "numpy.testing.assert_almost_equal", "numpy.max", "numpy.ceil", "numpy.mean", "numpy.floor", "numpy.random.uniform", "numpy.array", "numpy.zeros", "numpy.isinf", "numpy.empty" ], [ "numpy.ones...
weinixuehao/Recursive-CNNs
[ "2f5c66c07b5f7d0c0cbd59da310eb48bf2c91cad" ]
[ "train_model.py" ]
[ "''' Document Localization using Recursive CNN\n Maintainer : Khurram Javed\n Email : kjaved@ualberta.ca '''\n\nfrom __future__ import print_function\n\nimport argparse\n\nimport torch\nimport torch.utils.data as td\n\nimport dataprocessor\nimport experiment as ex\nimport model\nimport trainer\nimport utils\n\npars...
[ [ "torch.manual_seed", "torch.utils.data.DataLoader", "torch.cuda.manual_seed", "torch.cuda.is_available" ] ]
maxilse/hi-ml
[ "7902a6e1387a74ef0d861109450a5c93674de764" ]
[ "hi-ml-azure/src/health_azure/utils.py" ]
[ "# ------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.\n# -----------------------------------------------------------...
[ [ "torch.distributed.is_available", "torch.distributed.is_initialized", "torch.distributed.barrier", "pandas.DataFrame.from_dict" ] ]
FelixFu520/segmentation
[ "66503244826110e19446cf274f49d6e018e57f2c" ]
[ "data/Data_preprocess.py" ]
[ "import numpy as np\nimport os\nimport cv2\nimport re\nfrom itertools import chain\nfrom glob import glob\n\n\ndef gen_mean_std(root_path=\"/root/data/segmentation/VOCtrainval_11-May-2012/VOCdevkit/VOC2012/JPEGImages\", txt_path=\"\"):\n \"\"\"\n 功能:获得 1、root_path路径下所有图片\n 2、txt_path文件中所有图片路径(TODO...
[ [ "numpy.sum", "numpy.sqrt" ] ]
snap-stanford/ConE
[ "f765c3d72dcdb9ae2a0b86db6f4c5c0e39a73a63" ]
[ "codes/utils/manifolds/euclidean.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) 2018-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom .manifold import Manifold\nimport torch as th\nimport numpy as np\n\n\nclass EuclideanMan...
[ [ "numpy.sqrt" ] ]
michaelStettler/BVS
[ "947f1e505ccc3ebcf1926c8f52924d823bd1e101", "947f1e505ccc3ebcf1926c8f52924d823bd1e101", "947f1e505ccc3ebcf1926c8f52924d823bd1e101" ]
[ "tests/v1_and_BotUpSaliency/utils/draw_on_grid.py", "tests/CNN/t02b_compare_PCA_idx.py", "utils/evaluate_model.py" ]
[ "import numpy as np\n\n\ndef draw_on_grid(img):\n \"\"\"\n draw_on_grid will replicate what would be the input image look like from the gabor filter activations (input).\n It will draw a line corresponding to each orientation into a small box for each x, y coordinate of the input image.\n\n This functio...
[ [ "numpy.expand_dims", "numpy.min", "numpy.max", "numpy.argmax", "numpy.shape", "numpy.array", "numpy.zeros" ], [ "numpy.amax", "numpy.expand_dims", "numpy.random.seed", "numpy.set_printoptions", "numpy.std", "numpy.shape", "numpy.argsort" ], [ "nu...
RyosukeDTomita/cyclone_track
[ "91238a7a8af2e23b3ae697c35f3b6c40516dc80a" ]
[ "cyclonetrack/biquadratic.py" ]
[ "# coding: utf-8\n\"\"\"\nCopied by https://github.com/tenomoto/pytrack/blob/master/biquadratic.py interpolate(), https://github.com/tenomoto/pytrack/blob/master/grid.py __set_stencil().\n\"\"\"\nimport numpy as np\n\n\ndef set_stencil(g, i0, j0):\n ny, nx = g.shape\n ia = (i0 + nx - 1) % nx\n ib = (i0 + 1...
[ [ "numpy.zeros", "numpy.zeros_like" ] ]
marc-rigter/dsac
[ "6023ebacd7c8be1764f41567c4cbe6f79fab1c26" ]
[ "rlkit/torch/dsac/networks.py" ]
[ "\"\"\"\nGeneral networks for pytorch.\n\nAlgorithm-specific networks should go else-where.\n\"\"\"\nimport numpy as np\nimport torch\nfrom torch import nn as nn\nfrom torch.nn import functional as F\n\nfrom rlkit.torch import pytorch_util as ptu\n\n\ndef softmax(x):\n return F.softmax(x, dim=-1)\n\n\nclass Quan...
[ [ "torch.nn.Sequential", "torch.nn.functional.softmax", "torch.cat", "numpy.arange", "torch.nn.Sigmoid", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.nn.Identity", "torch.nn.ReLU" ] ]
iriziotis/biopython
[ "171697883aca6894f8367f8f20f1463ce7784d0c" ]
[ "Bio/Affy/CelFile.py" ]
[ "# Copyright 2004 by Harry Zuzan. All rights reserved.\n# Copyright 2016 by Adam Kurkiewicz. All rights reserved.\n# This file is part of the Biopython distribution and governed by your\n# choice of the \"Biopython License Agreement\" or the \"BSD 3-Clause License\".\n# Please see the LICENSE file that should have ...
[ [ "numpy.zeros", "numpy.empty" ] ]
leelew/MetReg
[ "b38e28326374e30521eab70625b9c22105688d8d", "b38e28326374e30521eab70625b9c22105688d8d", "b38e28326374e30521eab70625b9c22105688d8d" ]
[ "tests/test_pcmci.py", "MetReg/data/data_loader.py", "MetReg/models/dl/layers/constrain.py" ]
[ "# Imports\nfrom CausalityTest import Granger\nimport numpy as np\nimport matplotlib\nfrom matplotlib import pyplot as plt\n# matplotlib inline\n# use `%matplotlib notebook` for interactive figures\n# plt.style.use('ggplot')\nimport sklearn\nimport h5py\nimport pandas as pd\n\nimport tigramite\nfrom tigramite impor...
[ [ "numpy.array", "pandas.read_csv", "matplotlib.pyplot.show" ], [ "tensorflow.data.Dataset.from_tensor_slices" ], [ "tensorflow.keras.layers.AveragePooling2D", "tensorflow.reshape", "tensorflow.concat", "tensorflow.keras.layers.MaxPooling2D" ] ]
SomaKishimoto/AwA-Pose
[ "b9877d538af25d07a6e2f9fa0b5aa2fdf544db99", "b9877d538af25d07a6e2f9fa0b5aa2fdf544db99" ]
[ "code/deep-high-resolution-net.pytorch/lib/models/pose_hrnet.py", "code/cocoapi/PythonAPI/pycocotools/cocoeval_atrw.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Bin Xiao (Bin.Xiao@microsoft.com)\n# ------------------------------------------------------------------------------\n\nfrom __future__ import absolute_import\...
[ [ "torch.nn.Sequential", "torch.load", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.init.normal_", "torch.nn.Upsample", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ], [ "numpy.logical_not", "numpy.spacing", "numpy.unique", "numpy....
yjbang/math6380
[ "045bf9dd877b4b387580459fd747a4e428cbe8ff" ]
[ "GCE/GCEloss.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\nimport numpy as np\n\nclass GCELoss(nn.Module):\n\n def __init__(self, q=0.7, k=0.5, trainset_size=50000, num_classes=2):\n super(GCELoss, self).__init__()\n self.q = q\n self.k = k\n self.weight = tor...
[ [ "torch.mean", "torch.nn.functional.softmax", "torch.ones", "torch.sum", "torch.from_numpy", "torch.unsqueeze", "torch.cuda.is_available", "torch.nn.functional.one_hot", "torch.gt" ] ]
mazx4960/CTFs
[ "f262e733afe79eed3482781a0aff2ba36acc9e72" ]
[ "2020/X-MAS CTF/Programming/many paths/paths.py" ]
[ "from pwn import *\nimport math\nimport numpy as np\n\n\nurl = 'challs.xmas.htsp.ro'\nport = 6053\n\nconn = remote(url, port)\n\ndef exponentiation(bas, exp): \n t = np.identity(N, dtype=np.int64); \n while(exp > 0): \n if (exp % 2 != 0): \n t = (t.dot(bas)) % 666013; \n \n bas = (b...
[ [ "numpy.asarray", "numpy.dot", "numpy.identity" ] ]
TeaPearce/Bayesian_NN_Ensembles
[ "cb1f4cfc7c4095905ce5d7f23707fea4e0679af9" ]
[ "regression/hyperparams.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\n\n\"\"\"\ncontains params to run experiments on\n\"\"\"\n\ndef get_hyperparams(data_set, activation_fn,hidden_size,is_deep_NN=False):\n\t# create a dict of hyperparams\n\thyp = {}\n\thyp = \t{'batch_size': 64, 'optimiser_in': 'adam', 'learning_rate': 0.001}\n\n\tif data...
[ [ "numpy.sqrt" ] ]
SimonLaub/AI_Intro
[ "08f1dcf4a99d8e1311cd334d3fdd900ea70c0c57" ]
[ "ReinforcementLearning/PiEstimate.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Apr 18 12:47:56 2020\n@author: Sila\n\"\"\"\n\n# Monte Carlo methods, or Monte Carlo experiments, are a broad class of computational algorithms\n# that rely on repeated random sampling to obtain numerical results.\n\nimport numpy as np\nimport math\nimport random\nim...
[ [ "numpy.linspace", "numpy.cos", "numpy.sin", "matplotlib.pyplot.plot", "matplotlib.pyplot.axes", "matplotlib.pyplot.show" ] ]
ZhuangweiKang/tods
[ "fe3f55f8ccb306dd292c668e0f1154f1afdfa556", "fe3f55f8ccb306dd292c668e0f1154f1afdfa556" ]
[ "tods/detection_algorithm/core/KDiscord.py", "tods/tests/test_PyodCOF.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Autoregressive model for multivariate time series outlier detection.\n\"\"\"\nimport numpy as np\nfrom sklearn.utils import check_array\nfrom sklearn.utils.validation import check_is_fitted\n\nfrom .CollectiveBase import CollectiveBaseDetector\nfrom pyod.models.knn import KNN\n\nfrom...
[ [ "numpy.asarray", "sklearn.utils.check_array", "sklearn.utils.validation.check_is_fitted" ], [ "pandas.testing.assert_frame_equal", "pandas.DataFrame" ] ]
Linda-liugongzi/DIGITS-digits-py3
[ "6df5eb6972574a628b9544934518ec8dfa9c7439", "6df5eb6972574a628b9544934518ec8dfa9c7439" ]
[ "plugins/view/textClassification/digitsViewPluginTextClassification/view.py", "digits/tools/pb/label_image.py" ]
[ "# Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.\n\n\nimport os\n\nimport numpy as np\n\nfrom digits.utils import subclass, override\nfrom digits.extensions.view.interface import VisualizationInterface\nfrom .forms import ConfigForm\nfrom flask_babel import lazy_gettext as _\n\n\nCONFIG_TEMPLAT...
[ [ "numpy.max", "numpy.exp" ], [ "tensorflow.Graph", "tensorflow.image.resize_bilinear", "tensorflow.import_graph_def", "tensorflow.read_file", "tensorflow.gfile.GFile", "numpy.squeeze", "tensorflow.cast", "tensorflow.image.decode_png", "tensorflow.expand_dims", "t...
pandera-labs/pandera
[ "c494ee76691199a878e0594f2b4ad3741af26ef8" ]
[ "tests/core/test_schemas.py" ]
[ "\"\"\"Testing creation and manipulation of DataFrameSchema objects.\"\"\"\n# pylint: disable=too-many-lines,redefined-outer-name\n\nimport copy\nfrom datetime import datetime, timedelta\nfrom functools import partial\nfrom typing import Any, Callable, Dict, List, Tuple, Type, Union\n\nimport numpy as np\nimport pa...
[ [ "pandas.Series", "pandas.Index", "pandas.DataFrame", "pandas.MultiIndex.from_arrays", "pandas.Timedelta", "pandas.testing.assert_frame_equal", "pandas.DataFrame.from_dict", "pandas.isna", "pandas.Timestamp" ] ]
joennlae/halutmatmul
[ "69340d3386298401d421b0e67dcb0649534b0c12" ]
[ "maddness/python/maddness/util/hash_function_helper.py" ]
[ "# type: ignore\nimport copy\nimport numba\nimport numpy as np\n\n\n@numba.njit(fastmath=True, cache=True, parallel=False)\ndef _cumsse_cols(X):\n # TODO: can be optimized with numpy\n N, D = X.shape\n cumsses = np.empty((N, D), X.dtype)\n cumX_column = np.empty(D, X.dtype)\n cumX2_column = np.empty(...
[ [ "numpy.square", "numpy.maximum", "numpy.asarray", "numpy.copy", "numpy.argmin", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.empty" ] ]
Rohitpandit021/jina
[ "f3db4d5e480375d8dc3bceda814ac1963dee76d7" ]
[ "tests/distributed/test_simple_hub_pods/hub-mwu/mwu_encoder.py" ]
[ "from typing import Any\n\nimport numpy as np\n\nfrom jina.executors.encoders import BaseEncoder\n\n\nclass MWUEncoder(BaseEncoder):\n def __init__(self, greetings: str, *args, **kwargs):\n super().__init__(*args, **kwargs)\n self._greetings = greetings\n self.logger.success(f'look at me! {g...
[ [ "numpy.random.random" ] ]
meyer-lab/valentBind
[ "e8c6e568b1e63dd6c735a9b0aa5585ac9f158b1b" ]
[ "examples/figure4.py" ]
[ "import numpy as np\nfrom valentbind import polyc, polyfc\nfrom matplotlib import gridspec, rcParams, pyplot as plt\nimport matplotlib.cm as cm\nfrom matplotlib.patches import Ellipse\nimport seaborn as sns\n\ndef getSetup(figsize, gridd):\n \"\"\" Establish figure set-up with subplots. \"\"\"\n sns.set(style...
[ [ "numpy.log", "matplotlib.patches.Ellipse", "matplotlib.pyplot.clabel", "numpy.meshgrid", "numpy.logspace", "numpy.arange", "matplotlib.pyplot.Normalize", "matplotlib.cm.ScalarMappable", "matplotlib.gridspec.GridSpec", "numpy.array", "matplotlib.pyplot.figure" ] ]
vishalbelsare/deep-scientific-discovery
[ "41e8480314a9f4001c43521b0ec2a7cf1ab28347" ]
[ "hsic.py" ]
[ "import torch\nimport numpy as np\nfrom sklearn.metrics import pairwise_distances as pdist\n\n\ndef pairwise_distances(x):\n x_distances = torch.sum(x**2, -1).reshape((-1, 1))\n return -2*torch.mm(x, x.t()) + x_distances + x_distances.t()\n\n\ndef kernelMatrixGaussian(x, sigma=1):\n pairwise_distances_ = p...
[ [ "torch.mm", "numpy.maximum", "torch.ones", "torch.zeros", "torch.sum", "torch.eye", "torch.exp" ] ]
noklam/trains
[ "8ec6bba4d91104a2bdd2e537bec21078529540e0", "8ec6bba4d91104a2bdd2e537bec21078529540e0" ]
[ "examples/pipeline/step2_data_processing.py", "trains/external/kerastuner.py" ]
[ "import pickle\nfrom trains import Task, StorageManager\nfrom sklearn.model_selection import train_test_split\n\n\n# Connecting TRAINS\ntask = Task.init(project_name=\"examples\", task_name=\"pipeline step 2 process dataset\")\n\n# program arguments\n# Use either dataset_task_id to point to a tasks artifact or\n# u...
[ [ "sklearn.model_selection.train_test_split" ], [ "pandas.DataFrame" ] ]
matthew-gaddes/InSAR-Tools
[ "03141faeca9322f0616bf74445c40f93a2b77d92" ]
[ "insar_tools/plotting.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Jun 29 17:02:02 2017\r\n\r\nA collection of functions for plotting synthetic interferograms\r\n\r\n@author: eemeg\r\n\"\"\"\r\n\r\n\r\n#%%\r\n\r\n\r\ndef xticks_every_nmonths(ax_to_update, day0_date, time_values, include_tick_labels, \r\n ...
[ [ "matplotlib.gridspec.GridSpecFromSubplotSpec", "numpy.min", "numpy.arange", "numpy.ndarray.flatten", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.subplots", "numpy.cumsum", "numpy.sin", "numpy.max", "numpy.size", "matplotlib.pyplot.subplot", "matplotlib.gridspec...
minmie/nlp-tutorial
[ "e2aab7758f6477cc5d69785353da1863434caea5" ]
[ "3-2.TextLSTM/TextLSTM-Torch.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"“TextLSTM-Torch.ipynb”的副本\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1K75NsbkuejOzp2tfsXGDJxP-nQl9V0DC\n\"\"\"\n\n'''\n code by Tae Hwan Jung(Jeff Jung) @graykode, modify by wmathor\n'''\nimport torch\nimpo...
[ [ "torch.nn.CrossEntropyLoss", "torch.LongTensor", "torch.Tensor", "torch.nn.LSTM", "torch.zeros", "torch.utils.data.TensorDataset", "numpy.eye", "torch.utils.data.DataLoader", "torch.nn.Linear" ] ]
FiniteStateInc/clearcode-toolkit
[ "521c3a2ab9d9fa6d7b9059227c6af9d09b031c33" ]
[ "src/finitestate/firmware/ghidra/lsh_hash.py" ]
[ "\"\"\"\n lsh_hash.py\n\n Algorithm for performing function hashing over IR representations\n\"\"\"\nimport hashlib\nimport numpy as np\n\nfrom . import model\n\n# type aliases\nVector = np.ndarray\n\n\n# ### FUNCTION HASHING FUNCTIONS #####\ndef gen_planes(num_planes: int = 100) -> Vector:\n \"\"\"\n G...
[ [ "numpy.dot" ] ]
dev2l0per/Cartoonify
[ "20c769220e0256a0c1ae1ff50a05993beb8db555" ]
[ "src/utils/utils.py" ]
[ "import torch.nn as nn\n\ndef initialize_weights(model):\n # Initializes weights according to the DCGAN paper\n for m in model.modules():\n if isinstance(m, (nn.Conv2d, nn.ConvTranspose2d, nn.BatchNorm2d)):\n nn.init.normal_(m.weight.data, 0.0, 0.02)" ]
[ [ "torch.nn.init.normal_" ] ]
Joey61Liuyi/TAS
[ "19699f2a12c8c7ab09f9aef0562cd58ea79c2826" ]
[ "exps/basic-main.py" ]
[ "#####################################################\n# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2019.01 #\n#####################################################\nimport sys, time, torch, random, argparse\nfrom PIL import ImageFile\n\nImageFile.LOAD_TRUNCATED_IMAGES = True\nfrom copy import deepcopy\nfrom pathli...
[ [ "torch.load", "torch.utils.data.DataLoader", "torch.cuda.empty_cache", "torch.set_num_threads", "torch.cuda.is_available", "torch.nn.DataParallel" ] ]
marenan/Vitis-Tutorials
[ "047afda718ccf98467ca9f9563ceb12418c50474", "047afda718ccf98467ca9f9563ceb12418c50474" ]
[ "Machine_Learning/Design_Tutorials/09-mnist_pyt-master/files/target.py", "Machine_Learning/Design_Tutorials/08-tf2_flow/files/application/app_mt.py" ]
[ "'''\n Copyright 2020 Xilinx Inc.\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 agreed to in writ...
[ [ "torch.utils.data.DataLoader" ], [ "numpy.argmax", "numpy.empty" ] ]
baoduydinh1710/dressing-in-order
[ "11d449a6707d4d77756615b144b3f96ae7869841" ]
[ "utils/pose_utils.py" ]
[ "import numpy as np\nfrom scipy.ndimage.filters import gaussian_filter\nfrom skimage.draw import circle, line_aa, polygon\nimport json\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nfrom collections import defaultdict\nimport skimage.measure, ski...
[ [ "numpy.matrix", "pandas.read_csv", "numpy.expand_dims", "matplotlib.use", "numpy.arange", "numpy.linalg.norm", "numpy.mean", "numpy.array", "numpy.exp", "numpy.zeros" ] ]
spietz/face-image-landmarker
[ "add808772bc852a28e6be992a146cc770a463931" ]
[ "models/my_model.py" ]
[ "from base.base_model import BaseModel\nimport tensorflow as tf\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.applications.vgg16 import VGG16\nfrom tensorflow.keras.layers import Input, Flatten, Dense\n\nclass MyModel(BaseModel):\n def __init__(self, config):\n super(MyModel, self).__init__(c...
[ [ "tensorflow.keras.layers.Dense", "tensorflow.keras.applications.vgg16.VGG16", "tensorflow.keras.Model", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Input" ] ]
selflein/fasth
[ "72c4cd47fc4b92203d6313803508104511881816" ]
[ "test_case.py" ]
[ "\"\"\"\n\tSee 'README.md' for details. \n\n Expected output from 'python test_case.py': \n\n Compiling our c++/cuda code, this usually takes 1-2 min. \n Finished compilation, took: 0.0701s\n\n ---------- Assertions ----------\n Multiplication:\t\t\tPASSED!\n Inverse Multiplica...
[ [ "torch.mean", "torch.set_default_tensor_type", "torch.cuda.synchronize", "torch.zeros", "torch.manual_seed", "numpy.std", "numpy.mean", "torch.allclose" ] ]
andrewtarzia/stk
[ "0d3e1b0207aa6fa4d4d5ee8dfe3a29561abb08a2", "0d3e1b0207aa6fa4d4d5ee8dfe3a29561abb08a2" ]
[ "tests/molecular/topology_graphs/vertex/placement/cases/macrocycle/fixtures/utilities.py", "src/stk/molecular/topology_graphs/cage/two_plus_three/six_plus_nine.py" ]
[ "import stk\nimport numpy as np\nfrom functools import partial\nfrom scipy.spatial.distance import euclidean\n\n\ndef get_fg_position(id, building_block):\n functional_group, = building_block.get_functional_groups(id)\n return building_block.get_centroid(\n atom_ids=functional_group.get_placer_ids(),\n...
[ [ "numpy.array" ], [ "numpy.sqrt" ] ]
vishalbelsare/MoguNumerics
[ "4b6b55b562c3fe318552dd48f6b630d618bbbfc2" ]
[ "mogu/voterank/schemes.py" ]
[ "import numpy as np\nfrom scipy.stats import norm\n\ndef diffscore(npos, nneg):\n return npos-nneg\n\ndef fracscore(npos, nneg):\n return npos/np.array(npos+nneg, dtype=float)\n\ndef wilsonscore(npos, nneg, alpha=0.1):\n num = npos+nneg\n p = fracscore(npos, nneg)\n z = norm.ppf(1.-0.5*alpha)\n de...
[ [ "scipy.stats.norm.ppf", "numpy.array", "numpy.sqrt" ] ]
aiir-team/code_TSA_SVC_luxembourg
[ "c3efd636a82ac8279f5b525b2b117eac76d7f1a0" ]
[ "code_TSA_SVC_report_version/draft2/new_on3.py" ]
[ "import re\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport string\nimport seaborn as sns\nimport nltk\n\n\n\n\ndata = pd.read_csv('../dataset/downloadedB.csv', delimiter='\\t', header=None, names=[\"id1\", \"id2\", \"sentiment\", \"tweet\"])\ndata = data.drop(data[(data['tweet'] ==...
[ [ "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.feature_extraction.text.CountVectorizer", "numpy.vectorize", "sklearn.svm.SVC", "sklearn.metrics.accuracy_score" ] ]
MichaelGMZ/MRes-2020DS-Project2
[ "740f89ecf140b1665697c6b1e76106ecc675e793" ]
[ "PyCodes/LoadCSV.py" ]
[ "# %%\r\n# ----------------------------------------------------------------\r\n# There are two types of raw data format, .xlsx and .csv\r\n# These series of scripts deal with .csv only\r\n# All imports data initialized paths goes here\r\n# ----------------------------------------------------------------\r\nimport o...
[ [ "pandas.read_csv" ] ]
saksham-kaushal/tardis
[ "ad91bef1a4dc40b247dfc11951bb4e517a09545f", "ad91bef1a4dc40b247dfc11951bb4e517a09545f" ]
[ "tardis/montecarlo/tests/test_cmontecarlo.py", "tardis/plasma/tests/test_complete_plasmas.py" ]
[ "\"\"\"\nUnit tests for methods in `tardis/montecarlo/src/cmontecarlo.c`.\n* `ctypes` library is used to wrap C methods and expose them to python.\n\n\nProbable Reasons for Failing Tests:\n-----------------------------------\n\n1. Change made in C struct declarations:\n - Reflect the changes done in C structs, int...
[ [ "numpy.testing.assert_equal", "numpy.sqrt", "numpy.linspace", "numpy.ctypeslib.as_array", "numpy.reshape", "numpy.testing.assert_array_equal", "numpy.testing.assert_almost_equal", "pandas.HDFStore", "numpy.testing.assert_allclose", "numpy.array", "numpy.histogram" ], ...
wwqqqqq/tf-pose-estimation
[ "f5d34265d04e810706fd02b043d2bcebae990a6b" ]
[ "tf_pose/estimator.py" ]
[ "import logging\nimport math\n\nimport slidingwindow as sw\n\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nimport time\n\nfrom tf_pose import common\nfrom tf_pose.common import CocoPart\nfrom tf_pose.tensblur.smoother import Smoother\n\ntry:\n from tf_pose.pafprocess import pafprocess\nexcept ModuleN...
[ [ "tensorflow.import_graph_def", "tensorflow.nn.pool", "tensorflow.gfile.GFile", "tensorflow.equal", "tensorflow.global_variables", "tensorflow.placeholder", "numpy.ndarray", "tensorflow.report_uninitialized_variables", "tensorflow.zeros_like", "numpy.copy", "tensorflow.S...
aldopareja/fourier_feat
[ "e2d813c78f1d4b831bcf6bcc9ba2def275f248f0", "e2d813c78f1d4b831bcf6bcc9ba2def275f248f0" ]
[ "model_free_analysis/drqv2_crff_analysis/wavelet/dmc/mlp.py", "sac_dennis_rff/actor.py" ]
[ "from pathlib import Path\nimport pandas as pd\nfrom params_proto.neo_hyper import Sweep\n\nfrom drqv2_crff.config import Args, Agent\nfrom model_free_analysis import RUN\n\nhyperparams = pd.read_csv('pretrain_hyperparams.csv')\nhyperparams = hyperparams[hyperparams['env_name'].isin(['dmc:Cheetah-run-v1',\n ...
[ [ "pandas.read_csv" ], [ "torch.tanh", "torch.nn.functional.softplus", "torch.distributions.constraints.interval", "torch.distributions.Normal" ] ]
ReDeiPirati/tensor2tensor
[ "39f44893b82a5052c9eddba760fc4094d3d706bb", "39f44893b82a5052c9eddba760fc4094d3d706bb" ]
[ "tensor2tensor/mesh_tensorflow/mtf_model.py", "tensor2tensor/mesh_tensorflow/mtf_layers_test.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir...
[ [ "tensorflow.convert_to_tensor", "tensorflow.logging.warning", "tensorflow.device", "tensorflow.global_variables", "tensorflow.contrib.tpu.python.tpu.tpu_estimator.TPUEstimatorSpec", "tensorflow.contrib.summary.always_record_summaries", "tensorflow.get_default_graph", "tensorflow.to...
RICE-EIC/Double-Win-Quant
[ "c245c161608348bfb32c74b09afc1376bc3bc5d4" ]
[ "CIFAR/utils.py" ]
[ "import apex.amp as amp\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision import datasets, transforms\nfrom torch.utils.data.sampler import SubsetRandomSampler\nimport numpy as np\n\ncifar10_mean = (0.4914, 0.4822, 0.4465)\ncifar10_std = (0.2471, 0.2435, 0.2616)\n\nmu = torch.t...
[ [ "torch.max", "numpy.random.choice", "torch.zeros", "numpy.arange", "torch.min", "torch.nn.functional.cross_entropy", "torch.utils.data.DataLoader", "torch.zeros_like", "torch.sign", "torch.tensor", "torch.no_grad" ] ]
BlancRay/facedection
[ "e32430b24e08fe3a5f354e56ed0b68489c859694" ]
[ "dlibmodel/face_dlib.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport PIL.Image\nimport dlib\nimport numpy as np\nimport time\n\nfrom pkg_resources import resource_filename\n\n\ndef pose_predictor_model_location():\n return resource_filename(__name__, \"shape_predictor_68_face_landmarks.dat\")\n\n\ndef pose_predictor_five_point_model_location():\...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.empty" ] ]
jinlinyi/SparsePlanes
[ "fb063dc48f4e2e1a03dd47702275e1b8a4f5c223" ]
[ "sparsePlane/tools/local_refinement_sift.py" ]
[ "import cv2\nimport pickle\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pycocotools.mask as mask_util\nimport quaternion\nimport os\nimport time\n\nfrom scipy.special import huber\nfrom detectron2.data import DatasetCatalog, MetadataCatalog\nfrom sparseplane.data import PlaneRCNNMapper\nfrom sparsep...
[ [ "numpy.dot", "matplotlib.pyplot.imshow", "numpy.clip", "numpy.linalg.inv", "numpy.vstack", "numpy.linalg.norm", "numpy.arccos", "numpy.ones", "numpy.round", "numpy.random.randint", "numpy.cross", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.fi...
tony92151/pedestrian_generator
[ "7c01594a32f271687a49c89dec396b89775bec32", "7c01594a32f271687a49c89dec396b89775bec32" ]
[ "libs/datasets_inference.py", "04_Detectron2/eval_MR_FPN2.py" ]
[ "import torch.utils.data as data\nimport os\nimport torch\nimport tqdm\nimport imghdr\nimport random\nfrom PIL import Image\nimport glob\nimport json\nimport numpy as np\nimport math\n#from detectron_pro import mask_img,mask_img_composite\nfrom tqdm import tqdm\nimport cv2\n\nclass ImageDataset(data.Dataset):\n ...
[ [ "numpy.array", "numpy.zeros", "numpy.ones" ], [ "numpy.logspace", "numpy.maximum", "numpy.where", "numpy.insert" ] ]
charlottenosam/21cmfish
[ "c189e6cb448bf5b2970a2e5f0ca5673918f15276" ]
[ "py21cmfish/power_spectra.py" ]
[ "# define functions to calculate PS, following py21cmmc\nimport py21cmfast as p21c\nimport os, sys\nimport numpy as np\nfrom powerbox.tools import get_power\n\ndef get_k_min_max(lightcone, n_chunks=24):\n \"\"\"\n Get the minimum and maximum k in 1/Mpc to calculate powerspectra for\n given size of box and ...
[ [ "numpy.log", "numpy.sqrt", "numpy.linspace", "numpy.isnan", "numpy.median", "numpy.ones", "numpy.log10", "numpy.floor", "numpy.zeros" ] ]
yliess86/BayeTorch
[ "fbd4447bdf2b9402b3c7df83e776f08ae940b313" ]
[ "bayetorch/models/frequentist/vgg.py" ]
[ "from torch import Tensor\n\nimport torch\nimport torch.nn as nn\n\n\nclass VGG11(nn.Module):\n def __init__(self, n_classes: int = 10) -> None:\n super(VGG11, self).__init__()\n self.n_classes = n_classes\n \n self.conv1 = nn.Conv2d( 3, 64, 3, padding=1)\n self.conv2 = nn.Co...
[ [ "torch.nn.Linear", "torch.nn.Conv2d" ] ]
ZhouKai90/face_attributes_mxnet
[ "3313177d2e946044b517df9347b8ff301074856b" ]
[ "demo/fa_predictor.py" ]
[ "import cv2\nimport mxnet as mx\nimport numpy as np\nfrom mxnet import ndarray as nd\n\nIMG_WIDTH = 112\nIMG_HIGHT = 112\n\nclass FaceAttributesPredictor:\n def __init__(self, prefix, epoch=0, ctxId=0):\n self.ctx = mx.gpu(ctxId)\n self.prefix = prefix\n self.epoch = epoch\n\n sym, ar...
[ [ "numpy.argmax", "numpy.zeros" ] ]
kouohhashi/ratel_voice
[ "b64c7272e50c977f5b4295a4be9ac352251d37c6" ]
[ "jupyter/prediction.py" ]
[ "import os\nos.environ['TF_CPP_MIN_LOG_LEVEL']='2'\n\n# This is a little hack. if we don't turn off stderr, we get error.\n# python-shell catch the error.\nimport sys\nstderr = sys.stderr\nsys.stderr = open('/dev/null', 'w')\n\nimport numpy as np\nfrom data_generator import AudioGenerator\nfrom keras import backend...
[ [ "numpy.expand_dims" ] ]
oknuutti/visnav-py
[ "bc03a5bb99e39ecd8cd48f8aa971d8287cabda5c" ]
[ "visnav/calibration/ssi_table.py" ]
[ "\r\nimport numpy as np\r\n\r\n\r\n# from \"Odele Coddington, Judith L. Lean, Doug Lindholm, Peter Pilewskie, Martin Snow, and NOAA CDR Program (2015):\r\n# NOAA Climate Data Record (CDR) of Solar Spectral Irradiance (SSI), NRLSSI Version 2.\r\n# NOAA National Centers for Environmental Information.\"\r\...
[ [ "numpy.array" ] ]
yng87/Gasyori100knock
[ "cdf5e375e8f882420ceb54d170d9c015dcd50722" ]
[ "Question_01_10/005.py" ]
[ "import numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n\ndef RGB2HSV(img):\n img_cp = img.copy()\n img_cp = img_cp / 255.0\n\n Max = np.max(img_cp, axis=2)\n Min = np.min(img_cp, axis=2)\n arg_min = np.argmin(img_cp, axis=2)\n # BGR\n B = img_cp[:,:,0].copy()\n G = img_cp[:,:,1].c...
[ [ "numpy.abs", "numpy.min", "numpy.stack", "numpy.max", "numpy.argmin", "numpy.shape", "numpy.where", "numpy.zeros" ] ]
cnzeki/PSENet
[ "c7e0785404e12866171e9da678736abae9cdb8cb", "c7e0785404e12866171e9da678736abae9cdb8cb", "c7e0785404e12866171e9da678736abae9cdb8cb" ]
[ "DB/train.py", "DB/backbones/resnet.py", "DB/data/make_seg_detector_data.py" ]
[ "#!python3\nimport argparse\nimport time\n\nimport torch\nimport yaml\n\nfrom trainer import Trainer\n# tagged yaml objects\nfrom experiment import Structure, TrainSettings, ValidationSettings, Experiment\nfrom concern.log import Logger\nfrom data.data_loader import DataLoader\nfrom data.image_dataset import ImageD...
[ [ "torch.distributed.init_process_group", "torch.cuda.set_device" ], [ "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.Linear", "torch.nn.ReLU", "torch.utils.model_zoo.load_url" ], [ "numpy...
HACKONDEX/faiss
[ "438b64cd8b04d94c6dbd21204af9197cd5cab2fd" ]
[ "faiss/python/__init__.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n#@nolint\n\n# not linting this file because it imports * from swigfaiss, which\n# causes a ton of useless warnings.\n\nimport numpy ...
[ [ "numpy.dtype", "numpy.frombuffer", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
epcw/housing_equity
[ "074da171880fb445765662a98a816d13779f160f" ]
[ "jupyter-utilities/seattle_census_block_groups.py" ]
[ "import pandas as pd\nimport geopandas as gp\n\npath = '../shapefiles/WACensusBlocks2010/tl_2019_53_tabblock10.shp'\ngdf = gp.read_file(path)\n\ntracts_df = pd.read_csv('../sandbox-singlepage/data/seattle_census_tracts.csv', dtype={'TRACT': str})\n\nstate = '53' # WA = 53\ncounty = '033' # King = 033\n\nseattle_g...
[ [ "pandas.read_csv" ] ]
gbrammer/eazy-py
[ "c56433beaa6cc24d72ed5a6ccf1db63781b50c58" ]
[ "eazy/photoz.py" ]
[ "import os\nimport time\nimport warnings\nimport numpy as np\n\nfrom collections import OrderedDict\n\ntry:\n from tqdm import tqdm\n HAS_TQDM = True\nexcept:\n HAS_TQDM = False\n \ntry:\n from grizli.utils import GTable as Table\nexcept:\n from astropy.table import Table\n\nimport astropy.io.fits...
[ [ "numpy.diag", "numpy.dot", "numpy.minimum", "numpy.sqrt", "numpy.linspace", "numpy.random.multivariate_normal", "numpy.squeeze", "numpy.cumsum", "numpy.max", "numpy.zeros_like", "numpy.argmin", "numpy.mean", "numpy.exp", "numpy.where", "numpy.trapz", ...
raja21068/Research-on-data-mining-of-permission-induced-risk-for-android-IoT-devices
[ "522d3a0d0fde7dd2f51565e57e1bf30d8c7d9712" ]
[ "I-Random-Forest/irf/tests/test_irf_ensemble.py" ]
[ "from irf.ensemble import wrf, wrf_reg\nimport numpy as np\ndef test1():\n X = np.random.normal(size=(100,10))\n y = np.random.choice([0, 1], size=(100,))\n for tt in [wrf, wrf_reg]:\n rf = wrf(\n n_jobs=10,\n n_estimators=400,\n max_depth=None,\n bootstra...
[ [ "numpy.random.normal", "numpy.random.choice" ] ]
pragneshrana/Reinforcement-Learning
[ "6d891ff42437eec828e97cbbd2ad53fb112aad9e", "6d891ff42437eec828e97cbbd2ad53fb112aad9e" ]
[ "Assignment_2/code/Q2/code/rlpa2/vishamC.py", "Assignment_3/Q2_Cartpole_DQN/CODE_N_RESULT/without_target_reply_DQ.py" ]
[ "from gym import Env\nfrom gym.envs.registration import register\nfrom gym.utils import seeding\nfrom gym import spaces\nimport numpy as np\nfrom math import sqrt\n\n\nclass vishamC(Env):\n metadata = {\n 'render.modes': ['human', 'rgb_array'],\n 'video.frames_per_second': 50\n }\n\n def __in...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.clip" ], [ "tensorflow.compat.v1.train.import_meta_graph", "tensorflow.compat.v1.subtract", "numpy.mean", "tensorflow.compat.v1.train.Saver", "tensorflow.compat.v1.summary.merge_all", "tensorflow.compat.v1.train.AdamOptimizer", ...
T-head-Semi/csi-nn2
[ "bca6d703fa9d87d6f47c1182f0c3834f5d75b935", "bca6d703fa9d87d6f47c1182f0c3834f5d75b935", "bca6d703fa9d87d6f47c1182f0c3834f5d75b935" ]
[ "tests/python_ref/sin.py", "tests/python_ref/and.py", "tests/python_ref/softrelu.py" ]
[ "#!/usr/bin/python\n#-*- coding:utf-8 -*-\n\nimport sys\nimport struct\nimport numpy as np\nimport tensorflow as tf\n\ndef sin_f32():\n para = []\n # init the input data and parameters\n in_dim = int(np.random.randint(1, high=5, size=1))\n in_shape = []\n for i in range(0, in_dim):\n in_shap...
[ [ "numpy.random.uniform", "tensorflow.sin", "tensorflow.Session", "numpy.random.randint" ], [ "numpy.random.randint" ], [ "numpy.random.normal", "numpy.random.randint" ] ]
Fytch/lehrfempp
[ "c804b3e350aa893180f1a02ce57a93b3d7686e91" ]
[ "examples/lecturedemos/convergencestudies/linquadfelshaped_plot.py" ]
[ "import sys\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ninput_file = os.path.abspath(sys.argv[1])\noutput_folder = os.path.dirname(input_file)\n\ndata = np.genfromtxt(input_file, delimiter=',')\nmeshwidth = data[:,0]\nndofs_o1 = data[:,1]\nndofs_o2 = data[:,2]\nH1_err_o1 = data[:,3]\nH1_err_o...
[ [ "matplotlib.pyplot.legend", "numpy.log", "matplotlib.pyplot.gca", "matplotlib.pyplot.title", "matplotlib.pyplot.loglog", "numpy.genfromtxt", "matplotlib.pyplot.gcf", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
milos-lazic/CMSIS_5
[ "61b74b70bd961af9e2a8bb6bc1632c1014e7c42e" ]
[ "CMSIS/DSP/Testing/summaryBench.py" ]
[ "# Process the test results\n# Test status (like passed, or failed with error code)\n\nimport argparse\nimport re \nimport TestScripts.NewParser as parse\nimport TestScripts.CodeGen\nfrom collections import deque\nimport os.path\nimport numpy as np\nimport pandas as pd\nimport statsmodels.api as sm\nimport statsmod...
[ [ "pandas.read_csv", "pandas.Series" ] ]
svenharris/pandas
[ "ee808033bd5c546e7439a06d2ed37b57c9e66844" ]
[ "pandas/core/frame.py" ]
[ "\"\"\"\nDataFrame\n---------\nAn efficient 2D container for potentially mixed-type time series or other\nlabeled data series.\n\nSimilar to its R counterpart, data.frame, except providing automatic data\nalignment and a host of useful data manipulation methods having to do with the\nlabeling information\n\"\"\"\nf...
[ [ "pandas.util._validators.validate_bool_kwarg", "pandas.core.common.dict_compat", "pandas.compat.lzip", "numpy.where", "pandas.core.dtypes.common.is_named_tuple", "pandas.compat.OrderedDict", "pandas.core.common.standardize_mapping", "pandas.core.dtypes.cast.maybe_convert_platform",...
darrenjhsu/Boltzmann_Generator
[ "a0e7694b1451e1390139d4e1fcef55765e1e13e9" ]
[ "deep_boltzmann/models/double_well.py" ]
[ "import numpy as np\n\nclass DoubleWell(object):\n\n params_default = {'a4' : 1.0,\n 'a2' : 6.0,\n 'a1' : 1.0,\n 'k' : 1.0,\n 'dim' : 1}\n\n def __init__(self, params=None):\n # set parameters\n if params is None...
[ [ "matplotlib.pyplot.gca", "numpy.zeros", "numpy.sum", "numpy.linspace" ] ]
anthonytongUCB/modin
[ "e0dc8fb3cf8f7477a5a3c1a5d4cbdb5e2538eeb0" ]
[ "modin/backends/pandas/query_compiler.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport pandas\n\nfrom pandas.compat import string_types\nfrom pandas.core.dtypes.cast import find_common_type\nfrom pandas.core.dtypes.common import (\n is_list_like,\n is_num...
[ [ "pandas.core.dtypes.common.is_list_like", "pandas.core.dtypes.common.is_numeric_dtype", "pandas.concat", "pandas.Series", "pandas.Float64Index", "pandas.DataFrame", "pandas.Index", "pandas.core.index.ensure_index", "numpy.dtype", "pandas.core.dtypes.cast.find_common_type", ...
ari-holtzman/transformers
[ "ab90353f1abfd15f8d21f99395658d060679a08c" ]
[ "examples/hans/hans_processors.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...
[ [ "tensorflow.TensorShape" ] ]
Imdrail/GPy
[ "6923d1718494dacb751469ab5bae49e826ef8c56" ]
[ "GPy/kern/_src/ODE_UYC.py" ]
[ "# Copyright (c) 2013, GPy authors (see AUTHORS.txt).\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\nfrom .kern import Kern\nfrom ...core.parameterization import Param\nfrom ...core.parameterization.transformations import Logexp\nimport numpy as np\nfrom .independent_outputs import index_to_slices\...
[ [ "numpy.abs", "numpy.sqrt", "numpy.exp", "numpy.zeros", "numpy.sum" ] ]
smbadiwe/NLP_with_CNN
[ "333838087913d73148ef0fe8e58825d14c423f0a" ]
[ "data_helpers.py" ]
[ "import numpy as np\nimport re\nfrom sklearn.datasets import fetch_20newsgroups\nfrom sklearn.datasets import load_files\n\n\ndef clean_str(string):\n \"\"\"\n Tokenization/string cleaning for all datasets except for SST.\n Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process_dat...
[ [ "numpy.asarray", "numpy.arange", "sklearn.datasets.load_files", "numpy.dtype", "numpy.array", "sklearn.datasets.fetch_20newsgroups" ] ]
Lan-lab/sc-GC
[ "f089c0667a0c3bb4148ef56d89909eb9614867d3" ]
[ "Scanpy/Basic_scanpy_analysis.py" ]
[ "import scvelo as scv\r\nimport numpy as np\r\nimport pandas as pd\r\nimport scanpy as sc\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt \r\nimport seaborn as sns\r\nsc.settings.set_figure_params( frameon=True,color_map='Spectral_r') \r\nsc.settings.verbosity = 3 \r\nplt.rcParams[\"axes.grid\"] = False\...
[ [ "pandas.read_csv", "numpy.sum", "numpy.percentile" ] ]
vyarem/DMP-projection
[ "3b2ca974e5393587bf2110a7c900b4877727e0af" ]
[ "dmp-vanilla/dmp_model.py" ]
[ "\"\"\"dmp_model.py\n\nThis file contains the dmp_model class, which contains the parameters\nand equations which characterize the model. \n\nThis class is not intended to be initialized by itself. Currently it\nis inherited by classes for solving/simulating the model.\n\"\"\"\nimport numpy as np\nimport scipy as s...
[ [ "numpy.array", "numpy.minimum", "numpy.maximum", "numpy.meshgrid", "numpy.linspace", "scipy.interpolate.interp2d", "numpy.exp", "numpy.where", "numpy.zeros" ] ]
plugns/central-control-system
[ "166c7e2ed88f8b388606097302774859b5f75033" ]
[ "Modules/module_plot.py" ]
[ "import matplotlib.pyplot as plt\n\n\ndef plot_distance(xRobot,xObstacle,yRobot,yObstacle):\n x = (xRobot, xObstacle)\n y = (yRobot, yObstacle)\n ## plotting the points\n plt.plot(x, y, color='green', linestyle='dashed', linewidth=3, marker='o', markerfacecolor='blue', markersize=15)\n plt.plot(x, y)...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
ekarais/RLFM
[ "479679e39b4fdd230b5a67c2005dd2fb001e7169", "479679e39b4fdd230b5a67c2005dd2fb001e7169" ]
[ "code/misc/test.py", "code/report-specific/single_agent_random_interval_mcc/old_code/environments.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nimport sys\nsys.path.append('.')\nimport pandas as pd\nimport numpy as np\nimport warnings\nimport agents\nfrom agents import Seller, Buyer\nfrom environments import MarketEnvironment\n\n\nimport info_settings\nimport matchers\n\n# Utility functions\ndef get_state(agent_id...
[ [ "numpy.load", "pandas.DataFrame" ], [ "pandas.Series", "pandas.DataFrame" ] ]
erpmaroc/Depexo-Prestashop-Like
[ "53d01dea6fd56c8ef21394f301df51cf699cd4d7" ]
[ "DepexoTools/BANE.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"\nThis module contains all of the BANE specific code\nThe function filter_image should be imported from elsewhere and run as is.\n\"\"\"\nfrom __future__ import division\n# standard imports\nfrom astropy.io import fits\nimport copy\nimport logging\nimport multiprocessing\nimport mul...
[ [ "numpy.isfinite", "numpy.squeeze", "scipy.interpolate.RegularGridInterpolator", "numpy.ceil", "numpy.std", "numpy.mean", "numpy.ravel_multi_index", "numpy.ravel", "numpy.array" ] ]
kun-woo-park/Mobile_Stereo_Net_RealSense
[ "993e21f35bf4d8b8e060849301d42784f77e53d3" ]
[ "utils/metrics.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom utils.experiment import make_nograd_func\nfrom torch.autograd import Variable\nfrom torch import Tensor\n\n\ndef check_shape_for_metric_computation(*vars):\n assert isinstance(vars, tuple)\n for var in vars:\n assert len(var.size()) == 3\n ass...
[ [ "torch.stack", "torch.abs", "torch.nn.functional.l1_loss", "torch.tensor" ] ]
Brechard/Robot-Simulator
[ "201256fdae6d6d1bd7221832ed4646afbe0779aa" ]
[ "old_ARS_2018/bot/kalman.py" ]
[ "\"\"\" Kalman Filter \"\"\"\nimport numpy as np\n\n__author__ = \"Olve Drageset, Andre Gramlich\"\n\n\ndef kalman_filter(mu_t_minus_1, sigma_t_minus_1, u_t, z_t):\n \"\"\"\n Given as input a previous believed pose, previous covariance matrix, control input, and sensor correction on pose,\n determi...
[ [ "numpy.identity", "numpy.array", "numpy.matmul", "numpy.transpose" ] ]
naitik-dodia/keras-preprocessing
[ "436ceff1eef05fb4cee87e171a199991e47ce335" ]
[ "tests/image/numpy_array_iterator_test.py" ]
[ "import numpy as np\nimport pytest\n\nfrom PIL import Image\n\nfrom keras_preprocessing.image import numpy_array_iterator\nfrom keras_preprocessing.image import utils\nfrom keras_preprocessing.image.image_data_generator import ImageDataGenerator\n\n\n@pytest.fixture(scope='module')\ndef all_test_images():\n img_...
[ [ "numpy.random.random", "numpy.unique", "numpy.arange", "numpy.random.rand", "numpy.array", "numpy.vstack" ] ]
Rita-ritally/Tacotron2-CN-TTS
[ "f67f060750fe12a014e35857d6ff6e279d41d68a" ]
[ "synthesizer/train.py" ]
[ "from synthesizer.utils.symbols import symbols\r\nfrom synthesizer.utils.text import sequence_to_text\r\nfrom synthesizer.hparams import hparams_debug_string\r\nfrom synthesizer.feeder import Feeder\r\nfrom synthesizer.models import create_model\r\nfrom synthesizer.utils import ValueWindow, plot\r\nfrom synthesizer...
[ [ "tensorflow.summary.scalar", "tensorflow.Variable", "tensorflow.ConfigProto", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.Summary", "tensorflow.norm", "numpy.isnan", "tensorflow.train.Coordinator", "tensorflow.global_variables_initializer", "tensorflow.s...
noirmist/res_ae
[ "0ad7ba3e76709e725c552e1848cfbbfdf42e492b" ]
[ "resae/Bottleneck_en.py" ]
[ "# Copyright (C) 2018 Zhixian MA <zx@mazhixian.me>\n\"\"\"A class to contruct the bottleneck for encodeing\n\nupdates\n=======\n[2018-01-26]: Init, summary todo.\n[2018-01-28]: Add odd_flag\n\nnotes\n=====\n1. batch norm only at the end of a bottleneck?\n\nreferences\n==========\nhttp://blog.csdn.net/helei001/artic...
[ [ "tensorflow.summary.histogram", "tensorflow.contrib.layers.avg_pool2d", "tensorflow.contrib.layers.conv2d", "tensorflow.name_scope", "numpy.random.randint" ] ]
YinpeiDai/NAUM
[ "d8328b8c10ab26b069bfa12176d7b39c260acafc" ]
[ "Non_DL_models/LR/run_model.py" ]
[ "'''\nbog-of-words + logistic regression\n'''\nimport numpy as np\nimport json, os, pickle\nimport tensorflow as tf\n\nfrom ..input_data import DatasetManager\nfrom .model import LogisticRgression\nfrom utils import F1_score\n\n\nclass Run_LR_BOW:\n def __init__(self, **kwargs):\n self.save_dir = kwargs['...
[ [ "tensorflow.train.Saver", "tensorflow.global_variables_initializer", "numpy.squeeze", "tensorflow.ConfigProto" ] ]
willbradshaw/killifish-igseq
[ "0a6fb7f77d8d52932994c28e79d2eccdf9ad2bde" ]
[ "analysis/input_files/igor/pygor/pygor/counters/coverage/coverage.py" ]
[ "# Author: Quentin Marcou\n#\n# This source code is distributed as part of the IGoR software.\n# IGoR (Inference and Generation of Repertoires) is a versatile software to\n# analyze and model immune receptors generation, selection, mutation and all\n# other processes.\n# Copyright (C) 2017 Quentin Marco...
[ [ "numpy.asarray", "pandas.read_csv" ] ]
tmannen/fast-depth
[ "8189b6c7832a6fd65977872d5bb7dd9437cbe098" ]
[ "dataloaders/nyu.py" ]
[ "import numpy as np\nimport dataloaders.transforms as transforms\nfrom dataloaders.dataloader import MyDataloader\n\niheight, iwidth = 480, 640 # raw image size\n\nclass NYUDataset(MyDataloader):\n def __init__(self, root, split, modality='rgb'):\n self.split = split\n super(NYUDataset, self).__ini...
[ [ "numpy.asfarray", "numpy.random.uniform" ] ]
jz462/large_scale_visual_relationship_understanding
[ "7363b997f4cabae39759ce70b7f52c7a1d8d8d41" ]
[ "lib/modeling/VGG16.py" ]
[ "import os\nimport numpy as np\nimport logging\nfrom collections import OrderedDict\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom core.config import cfg\nimport nn as mynn\nimport utils.net as net_utils\nimport torchvision.models as models\n\nlogger = logging.getLogger(__name__)\n\...
[ [ "torch.load" ] ]