repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
mccutcheonlab/PPP_analysis
[ "08df6fe199d08ac807870adf8c2dbfc5cf81b44d" ]
[ "customized_scripts/ebbs_heatmap.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Sep 13 13:37:11 2019\n\n@author: jmc010\n\"\"\"\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nimport matplotlib.lines as mlines\n\nimport numpy as np\n\n# install at an anaconda command prompt using: conda instal...
[ [ "numpy.meshgrid", "matplotlib.pyplot.figure", "numpy.std", "numpy.arange", "numpy.shape", "numpy.array", "matplotlib.colors.to_rgb", "matplotlib.gridspec.GridSpec", "numpy.linspace", "matplotlib.gridspec.GridSpecFromSubplotSpec", "numpy.mean" ] ]
iqbal-lab-org/pandora_paper_roc
[ "bb21c76faefa8021c86c3be9d77b8b5999fe2ef5" ]
[ "pipeline/scripts/calculate_recall_per_sample_vs_nb_of_samples.py" ]
[ "from pathlib import Path\nimport sys\nsys.path.append(str(Path().absolute()))\nimport logging\nlog_level = \"INFO\"\nlogging.basicConfig(\n filename=str(snakemake.log),\n filemode=\"w\",\n level=log_level,\n format=\"[%(asctime)s]:%(levelname)s: %(message)s\",\n datefmt=\"%d/%m/%Y %I:%M:%S %p\",\n)\...
[ [ "pandas.concat" ] ]
kendoo-solutions/amazon-sagemaker-workshop
[ "359a25dfb11fe98155347b0f8f194049548649c7" ]
[ "Modules/3 - Distributed Training with TensorFlow Notebook/utils.py" ]
[ "\"\"\"Converts MNIST data to TFRecords file format with Example protos.\"\"\"\nimport os\nimport tensorflow as tf\nfrom PIL import Image\nimport numpy as np\nfrom matplotlib.pyplot import imshow\n\ndef gen_image(arr):\n try:\n two_d = (np.reshape(arr, (28, 28)) * 255).astype(np.uint8)\n img = Imag...
[ [ "numpy.reshape", "numpy.asarray", "tensorflow.train.Int64List", "tensorflow.python_io.TFRecordWriter", "tensorflow.train.BytesList" ] ]
Dakror/OpenMDAO
[ "3650622e0e96bed6979991bd096186c85050738f" ]
[ "openmdao/devtools/memory.py" ]
[ "\"\"\"Various debugging functions.\"\"\"\n\nimport sys\nimport os\nimport functools\nimport gc\n\ntry:\n import resource\n\n def max_mem_usage():\n \"\"\"\n Return the maximum resident memory used by this process and its children so far.\n\n Returns\n -------\n The max resi...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
asaelbarilan/deepvoice3_pytorch
[ "47118312309994a4a6c17e3918355f2ace947492" ]
[ "arabic_speech_corpus.py" ]
[ "from concurrent.futures import ProcessPoolExecutor\r\nfrom functools import partial\r\nimport numpy as np\r\nimport os\r\nimport audio\r\nfrom hparams import hparams\r\n\r\n\r\ndef build_from_path(in_dir, out_dir, num_workers=1, tqdm=lambda x: x):\r\n '''Preprocesses the LJ Speech dataset from a given input pat...
[ [ "numpy.abs" ] ]
amnaabbassi/shapash
[ "6c867c8b1724f2737369557f8db056cb0027999b" ]
[ "tests/unit_tests/utils/test_explanation_metrics.py" ]
[ "import unittest\nimport numpy as np\nimport pandas as pd\nfrom sklearn.linear_model import LinearRegression\nfrom shapash.utils.explanation_metrics import _df_to_array, \\\n _compute_distance, _compute_similarities, _get_radius, find_neighbors, \\\n shap_neighbors, get_min_nb_features, get_distance\n\n\nclas...
[ [ "numpy.append", "pandas.DataFrame", "sklearn.linear_model.LinearRegression", "numpy.array_equal", "numpy.array", "numpy.random.randint" ] ]
roizhv22/IML.HUJI
[ "b6efdf4ca21ef5cf33da222d74330a19e2177527" ]
[ "exercises/ex4/sub/decision_stump.py" ]
[ "from __future__ import annotations\nfrom typing import Tuple, NoReturn\n\nimport IMLearn.metrics\nfrom ...base import BaseEstimator\nimport numpy as np\nfrom itertools import product\n\n\nclass DecisionStump(BaseEstimator):\n \"\"\"\n A decision stump classifier for {-1,1} labels according to the CART algori...
[ [ "numpy.ones", "numpy.sign", "numpy.argsort", "numpy.abs", "numpy.sort", "numpy.where" ] ]
gist-ailab/FSCE
[ "94ba3f4737d5e40af795db49b8c6914526c912b6" ]
[ "fsdet/modeling/meta_arch/rcnn.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport logging\nimport numpy as np\nimport torch\nfrom torch import nn\n\nfrom fsdet.structures import ImageList\nfrom fsdet.utils.logger import log_first_n\n\nfrom ..backbone import build_backbone\nfrom ..postprocessing import detector_postpr...
[ [ "numpy.concatenate", "torch.device", "torch.Tensor" ] ]
June01/kinetics-i3d
[ "6f7d7101971a48a4c1bbfc7374d76d3071fd7e3b" ]
[ "feat_extractor(2019.7.25)/extract_feature_7.25.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport tensorflow as tf\nimport sonnet as snt\n\nfrom PIL import Image, ImageOps\nimport cv2\n\nimport numpy as np\n\nimport os\n\nimport i3d\n\nimport sys\n\ninp1 = sys.argv[1]\ninp2 = sys.argv[2]\n\n# In[2]:\n\n\n# Proprecessing for image(scale and crop)\nd...
[ [ "tensorflow.placeholder", "tensorflow.logging.info", "numpy.var", "numpy.stack", "numpy.reshape", "tensorflow.variable_scope", "tensorflow.global_variables", "numpy.arange", "numpy.hstack", "tensorflow.train.Saver", "numpy.array", "tensorflow.GPUOptions", "tenso...
guodashun/training-curve-vis
[ "eea830e3c981c136d2181d91c0534d6b6fcea902" ]
[ "boxplot.py" ]
[ "import seaborn as sns\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nclass BoxPlot:\n def __init__(\n self,\n title,\n x_label,\n y_label,\n ):\n self.title = title\n self.x_label = x_label\n self.y_label = y_label\n self.d...
[ [ "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ] ]
oliver-contier/nipype
[ "47e149bbd6a9e865e9242e50fb7ca1a18adfc640" ]
[ "nipype/pipeline/engine/utils.py" ]
[ "# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"Utility routines for workflow graphs\"\"\"\nimport os\nimport sys\nimport pickle\nfrom collections import defaultdict\nimport re\nfrom copy import deepcopy\nfrom glob i...
[ [ "numpy.array", "numpy.log10", "numpy.unique", "numpy.argsort" ] ]
ankitasuman009/greyatom-python-for-data-science
[ "6ff5094885aaa3280c1b17d721d0c0ac07462cce" ]
[ "visualization/code.py" ]
[ "# --------------\n#Importing header files\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\n#Reading the file\ndata=pd.read_csv(path)\nprint(data.iloc[25, 1])\n# df = pd.DataFrame(data)\n#Code starts here\nloan_status = data['Loan_Status'].value_counts()\nloan_status.plot(kind = 'bar')...
[ [ "pandas.Series", "matplotlib.pyplot.xticks", "pandas.read_csv", "pandas.DataFrame", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ] ]
yumaloop/predwm
[ "9cf757b5f8b13cff8da325838c8685700162754d" ]
[ "carracing/prednet/rnn.py" ]
[ "import numpy as np\nfrom collections import namedtuple\nimport json\nimport tensorflow as tf\n\n# hyperparameters for our model. I was using an older tf version, when HParams was not available ...\n\n# controls whether we concatenate (z, c, h), etc for features used for car.\nMODE_ZCH = 0\nMODE_ZC = 1\nMODE_Z = 2\...
[ [ "tensorflow.reduce_logsumexp", "tensorflow.reshape", "tensorflow.variable_scope", "tensorflow.contrib.rnn.DropoutWrapper", "tensorflow.nn.dynamic_rnn", "numpy.copy", "tensorflow.Variable", "tensorflow.split", "tensorflow.global_variables_initializer", "tensorflow.device", ...
Tony-Tan/Reinforcement_Leanring_An_Introduction
[ "285b93b0108bb3401623149129fad4ec863db0d5" ]
[ "environment/k_arm_bandit.py" ]
[ "import copy\n\nimport numpy as np\nfrom environment.basic_classes import Space\n\n\n# class bandit:\n# def __init__(self, value_mean=0.0, value_var=1.0):\n# \"\"\"\n# bandit, reward is produced by a normal distribution with mean and variance;\n# :param value_mean: mean\n# :param...
[ [ "numpy.random.normal", "numpy.ones" ] ]
haleqiu/DROID-SLAM
[ "b7e09308d7672d22b28cd23ed401e2b4a4b9bf8d" ]
[ "droid_slam/factor_graph.py" ]
[ "import torch\nimport lietorch\nimport numpy as np\n\nimport matplotlib.pyplot as plt\nfrom lietorch import SE3\nfrom modules.corr import CorrBlock, AltCorrBlock\nimport geom.projective_ops as pops\n\n\nclass FactorGraph:\n def __init__(self, video, update_op, device=\"cuda:0\", corr_impl=\"volume\", max_factors...
[ [ "torch.ones_like", "torch.as_tensor", "torch.argsort", "torch.zeros_like", "numpy.argsort", "torch.cuda.amp.autocast", "torch.arange", "torch.any", "torch.meshgrid", "torch.abs", "torch.zeros", "torch.unique", "torch.cat", "torch.mean" ] ]
malk271828/pytorch-toolbelt
[ "d8a7d25c887c5f1c9a6c8e07e8b887bc6fc4617c" ]
[ "pytorch_toolbelt/inference/ensembling.py" ]
[ "from torch import nn, Tensor\nfrom typing import List, Union\n\n__all__ = [\"ApplySoftmaxTo\", \"ApplySigmoidTo\", \"Ensembler\", \"PickModelOutput\"]\n\n\nclass ApplySoftmaxTo(nn.Module):\n def __init__(self, model: nn.Module, output_key: Union[str, List[str]] = \"logits\", dim=1, temperature=1):\n \"\"...
[ [ "torch.nn.ModuleList" ] ]
estherrolf/torchgeo
[ "c69bd1559b45e5d2bdbadd795bb32d6c0f1ffb48" ]
[ "torchgeo/datamodules/oscd.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n\"\"\"OSCD datamodule.\"\"\"\n\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport kornia.augmentation as K\nimport pytorch_lightning as pl\nimport torch\nfrom einops import repeat\nfrom torch.utils.data im...
[ [ "torch.utils.data.DataLoader", "torch.stack", "torch.flatten", "torch.tensor", "torch.utils.data._utils.collate.default_collate" ] ]
uc-eqgeo/rnc2-earthquakes
[ "cfa6a68ab4bb3fee7a06683683f131d6413c53d1" ]
[ "src/rsqsim_api/rsqsim_api/io/read_utils.py" ]
[ "import os\n\nimport meshio\nimport numpy as np\nimport pandas as pd\nimport ezdxf\n\ncatalogue_columns = [\"t0\", \"m0\", \"mw\", \"x\", \"y\", \"z\", \"area\", \"dt\"]\n\n\ndef read_binary(file: str, format: str, endian: str = \"little\"):\n \"\"\"\n Reads integer values from binary files that are output of...
[ [ "numpy.load", "numpy.fromfile", "numpy.zeros", "pandas.read_csv", "pandas.DataFrame", "numpy.hstack", "numpy.array", "numpy.unique", "numpy.loadtxt" ] ]
w1ll1am-davis/lecture0
[ "0c1ae34c69c9ff236457f52897af14839a4839e8" ]
[ "ocr/generate_samples.py" ]
[ "import time\nfrom pathlib import Path\nfrom random import choice\n\nimport cv2\nimport numpy as np\nfrom PIL import Image\nfrom PIL import ImageDraw\nfrom PIL import ImageFont\nfrom skimage.morphology import square, dilation\n\n\ndef get_grid_char_img(fonts_paths):\n font_name = choice(fonts_paths)\n size = ...
[ [ "numpy.random.uniform", "numpy.ones", "numpy.zeros", "numpy.random.normal", "numpy.array", "numpy.random.randint" ] ]
SherwynBraganza31/csc514-crypto
[ "b4b9641c37041e465e652f5d84398101746d518b" ]
[ "Number_Theory/mod_inv.py" ]
[ "from Number_Theory.optimized_gcd import *\nimport numpy as np\n\n##################################################################\n# Function : mod_inv\n# Utilizes the extended gcd function defined in optimized_gcd.py\n# to find the modular inverse of a mod(n) when a and n are\n# relatively prime.\n#\n# Throws a...
[ [ "numpy.linalg.inv", "numpy.linalg.det", "numpy.matrix.round", "numpy.nditer" ] ]
STAR-Center/selfSupervisedDescriptor
[ "f1fee51aee64914faf0a0af78cf9854a7230552c" ]
[ "data/3dmatch/desc2txt.py" ]
[ "import sys\nimport numpy as np\nsys.path.append('../..')\nfrom data.datagenerator import DataGenerator\n\nif __name__ == '__main__':\n if(len(sys.argv) != 3):\n print('Usage: python thisfile.py desc.bin desc.txt')\n sys.exit(1)\n\n pc_mat = DataGenerator.load_point_cloud(sys.argv[1], 3+32)\n\n ...
[ [ "numpy.savetxt" ] ]
ZhiangChen/tornado_gp
[ "224a5c4fdc867d9da2eeafbad21738d60f074fbd" ]
[ "average_results.py" ]
[ "\"\"\"\naverage results\nZhiang Chen, Oct 2\n\"\"\"\n\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ntraining = True\nif training:\n npy_files = [f for f in os.listdir('results') if 'true' not in f]\nelse:\n npy_files = [f for f in os.listdir('results') if 'true' in f]\n\n\nresults_all = ...
[ [ "numpy.load", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "numpy.mean" ] ]
kaijieshi7/pytorch-loss
[ "24bd6716cc5f347b634041e4582cc728d0adccd6" ]
[ "pytorch_loss/label_smooth.py" ]
[ "#!/usr/bin/python\n# -*- encoding: utf-8 -*-\n\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.cuda.amp as amp\n\n\n\n##\n# version 1: use torch.autograd\nclass LabelSmoothSoftmaxCEV1(nn.Module):\n '''\n This is the autograd version, you can also try the LabelSmoothSoftm...
[ [ "torch.sum", "torch.empty_like", "torch.randint", "torch.randn", "torch.manual_seed", "torch.no_grad", "numpy.random.seed", "torch.nn.LogSoftmax", "torch.cuda.amp.custom_fwd", "torch.nn.Conv2d", "torch.abs", "torch.log_softmax", "torch.softmax" ] ]
cvoelcker/spn-pytorch-experiments
[ "495d1fddf00f76fe28e926f7e558b26089e5428e" ]
[ "src/models/models.py" ]
[ "\"\"\"\nContains classes for the comparison of models on the MNIST dataset.\nMain models:\n- MLPNet: Feed forward NN with linear layers\n- SPNNet: Same as MLPNet but replaces certain layers with SPNLayer\n- SPNNeuron: Defines the SPN architecture of a single neuron in a SPNLayer\n\"\"\"\nimport logging\nimport tim...
[ [ "torch.logsumexp", "torch.nn.init.kaiming_normal_", "torch.ones", "torch.stack", "torch.nn.Linear", "torch.nn.BatchNorm1d", "numpy.random.permutation", "torch.nn.init.xavier_normal_", "torch.rand", "torch.nn.ModuleList", "torch.device" ] ]
tamuhey/pymatgen
[ "cf1793f0af59844ea9222d973212e3ab83e58209" ]
[ "pymatgen/analysis/structure_analyzer.py" ]
[ "# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\nfrom __future__ import division, unicode_literals\n\nimport warnings\nimport ruamel.yaml as yaml\nimport os\n\n\"\"\"\nThis module provides classes to perform topological analyses of structures.\n\"\"\...
[ [ "numpy.sum", "numpy.any", "numpy.cross", "numpy.fill_diagonal", "scipy.spatial.Voronoi", "matplotlib.pyplot.figure", "numpy.reshape", "matplotlib.pyplot.title", "matplotlib.pyplot.barh", "numpy.where", "numpy.mean", "numpy.ceil", "numpy.zeros", "numpy.max", ...
cjs220/alre_experiments
[ "bb1969e1650368357b8e76d3b4f262dedd47f752" ]
[ "util/general.py" ]
[ "import time\nfrom typing import Dict, Callable\nimport os\nimport random\nimport pprint\n\nimport numpy as np\nimport pandas as pd\nfrom joblib import Parallel, delayed\nfrom matplotlib.figure import Figure\nfrom pandas.core.generic import NDFrame\nimport tensorflow as tf\n\n\ndef disable_tensorflowgpu():\n os....
[ [ "pandas.Timestamp.now", "numpy.random.seed", "tensorflow.random.set_seed" ] ]
bdonkey/Advanced-Deep-Learning-with-Keras
[ "e8d72b3ac9c7bf746ebf4502a6208f90b025d617" ]
[ "chapter5-improved-gan/lsgan-mnist-5.2.1.py" ]
[ "'''Trains LSGAN on MNIST using Keras\n\nLSGAN is similar to DCGAN except for the MSE loss used by the \nDiscriminator and Adversarial networks.\n \n[1] Radford, Alec, Luke Metz, and Soumith Chintala.\n\"Unsupervised representation learning with deep convolutional\ngenerative adversarial networks.\" arXiv preprint...
[ [ "numpy.reshape" ] ]
RobertCsordas/modules
[ "efdb8790b074862581e035c9ab5bf889440a8023" ]
[ "models/conv.py" ]
[ "import torch\nfrom layers import Conv2d, Linear\n\nclass ConvModel(torch.nn.Module):\n def __init__(self, in_channels: int, out_channels: int, dropout: bool = True):\n super().__init__()\n\n self.features = torch.nn.Sequential(\n Conv2d(in_channels, 32, 3, padding=1),\n torch...
[ [ "torch.nn.MaxPool2d", "torch.nn.ReLU", "torch.nn.Dropout" ] ]
mealworm/gammapy
[ "a838b2ca347dd6321f8da4e4097a33150d7b9be6" ]
[ "gammapy/utils/fits.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\n.. _utils-fits:\n\nGammapy FITS utilities\n======================\n\n.. _utils-fits-tables:\n\nFITS tables\n-----------\n\nIn Gammapy we use the nice `astropy.table.Table` class a lot to represent all\nkinds of data (e.g. event lists, spectra...
[ [ "numpy.arange", "numpy.append" ] ]
flowersw/compose
[ "d51a397988f4a9b78a489260b541d02d59a4d290" ]
[ "docs/source/examples/demo/turbofan_degredation/__init__.py" ]
[ "import os\nimport pandas as pd\nfrom demo import utils\n\nURL = r'https://ti.arc.nasa.gov/c/6/'\nPWD = os.path.dirname(__file__)\n\n\ndef _download_data():\n output = os.path.join(PWD, 'download')\n utils.download(URL, output)\n\n\ndef _data():\n path = os.path.join(PWD, 'download', 'train_FD004.txt')\n ...
[ [ "pandas.read_csv", "pandas.date_range" ] ]
johanDDC/ttax
[ "eae0a307cf5099e3f97540231b4428291a6766ec", "eae0a307cf5099e3f97540231b4428291a6766ec" ]
[ "ttax/random_.py", "ttax/ops_test.py" ]
[ "import numpy as np\nimport jax\nimport jax.numpy as jnp\n\nfrom ttax.base_class import TT\nfrom ttax.base_class import TTMatrix\n\n\ndef tensor(rng, shape, tt_rank=2, batch_shape=None, dtype=jnp.float32):\n \"\"\"Generate a random `TT-Tensor` of the given shape and `TT-rank`.\n \n :param rng: JAX PRNG key\n :t...
[ [ "numpy.array", "numpy.ones", "numpy.append", "numpy.insert" ], [ "numpy.einsum", "numpy.dot", "numpy.random.seed", "numpy.random.rand" ] ]
mjseong0414/SPA_Radar_mmdet3d
[ "ae4eee101a5665b72586d3d5db06832bf45b3b33" ]
[ "tools/test.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport argparse\nimport mmcv\nimport os\nimport torch\nimport warnings\nfrom mmcv import Config, DictAction\nfrom mmcv.cnn import fuse_conv_bn\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner import (get_dist_info, init_dist, lo...
[ [ "torch.cuda.current_device" ] ]
Magnety/tuFramework
[ "b31cb34d476ef306b52da955021f93c91c14ddf4" ]
[ "tuframework/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_noDeepSupervision.py" ]
[ "# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ...
[ [ "torch.cuda.is_available" ] ]
mohcineelharras/yolo-mask
[ "3a163b3534dae9507d4b2e39170b0fe6abcd5e8d" ]
[ "train.py" ]
[ "\"\"\"\nRetrain the YOLO model for your own dataset.\n\"\"\"\n\nimport numpy as np\nimport keras.backend as K\nfrom keras.layers import Input, Lambda\nfrom keras.models import Model\nfrom keras.optimizers import Adam\nfrom keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping\n\nfro...
[ [ "numpy.array", "numpy.random.shuffle", "numpy.random.seed", "numpy.zeros" ] ]
AthanatiusC/Python-face-recognition-V2
[ "cbb3908448e2575e2cd10294add8ec58ced43be0" ]
[ "register/register.py" ]
[ "\"\"\"Demo code shows how to estimate human head pose.\nCurrently, human face is detected by a detector from an OpenCV DNN module.\nThen the face box is modified a little to suits the need of landmark\ndetection. The facial landmark detection is done by a custom Convolutional\nNeural Network trained with TensorFlo...
[ [ "numpy.array", "numpy.reshape" ] ]
Busdriver26/walkingin
[ "6401127fc2e3159bc19892c1d6b74246535cd880" ]
[ "main.py" ]
[ "print('{:*^80}'.format(\" WALKING IN \"))\nprint(\"AUTHOR: BU5DR1V3R , INSPIRED BY ULTRA GUO.\")\nprint(\"Version -0.03, 2020/12/14\")\nprint(\"Make sure that your pic is in the same folder of this .exe\")\n\ntry:\n from PIL import Image, ImageDraw, ImageFont\nexcept:\n print(\"There is no PIL found in your ...
[ [ "numpy.array", "matplotlib.cm.get_cmap", "numpy.full" ] ]
yugangzhang/SciAnalysis
[ "06f20143ad40bbd6756fcdb5d2aade8823bffb9a" ]
[ "examples/history/make_map_sequence.py" ]
[ "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n\n# This generates a map (2D false-color plot or 3D height plot) for a set of\n# experiments (that are presumptively defined in some (x,y) space). The code\n# assumes you've already used SciAnalysis to process your data, such that you\n# have XML files in your \"resul...
[ [ "numpy.arctan2", "numpy.average", "numpy.argsort", "numpy.column_stack", "numpy.asarray", "numpy.cos", "numpy.arange", "numpy.std", "numpy.max", "numpy.power", "numpy.min", "numpy.isnan", "numpy.sin", "numpy.meshgrid", "numpy.linspace" ] ]
frankwhzhang/Paddle
[ "131b1dc3240e53ea295cc49323bb2a7e7dcc717f" ]
[ "python/paddle/fluid/tests/unittests/test_bilinear_interp_op.py" ]
[ "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.allclose", "numpy.ones", "numpy.transpose", "numpy.zeros", "numpy.random.random", "numpy.array", "numpy.random.randint" ] ]
xxheyu/CL-Face-Anti-spoofing
[ "b6c427151572bfafd41355a3942a361a6579d19a" ]
[ "util.py" ]
[ "from __future__ import print_function\n\nimport math\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torchvision.utils as vutils\nimport matplotlib.pyplot as plt\nplt.switch_backend('agg') \n\n\nclass TwoCropTransform:\n \"\"\"Create two crops of the same image\"\"\...
[ [ "torch.no_grad", "numpy.asarray", "torch.cuda.is_available", "matplotlib.pyplot.ylabel", "numpy.transpose", "torch.save", "matplotlib.pyplot.title", "matplotlib.pyplot.hist", "torch.Tensor", "matplotlib.pyplot.axis", "numpy.max", "numpy.min", "matplotlib.pyplot....
gpetretto/pymatgen
[ "68a7c51fa3e2a2392534d29eae1c9045e8ff9e73" ]
[ "pymatgen/io/cif.py" ]
[ "# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\nfrom __future__ import division, unicode_literals, print_function\n\nimport math\nimport re\nimport os\nimport textwrap\nimport warnings\nfrom collections import OrderedDict, deque\n\nimport six\nfrom ...
[ [ "numpy.array", "numpy.floor" ] ]
marcograss/Lean
[ "7b826eb38631b0e72a06c56706624d2a21279b09" ]
[ "Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py" ]
[ "# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.\n# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy ...
[ [ "numpy.eye", "pandas.Series", "pandas.DataFrame", "numpy.linalg.det", "numpy.abs", "numpy.expand_dims", "numpy.array", "numpy.dot" ] ]
sijunhe/tensorflow
[ "d7e858192d1de827bc03705ac62e1bd38daf06d8" ]
[ "tensorflow/python/autograph/impl/conversion_test.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.autograph.core.config.DoNotConvert", "tensorflow.python.autograph.impl.conversion.convert_entity_to_ast", "tensorflow.python.autograph.impl.conversion.is_whitelisted_for_graph", "tensorflow.python.platform.test.main", "tensorflow.python.autograph.pyct.compiler.ast_to_source"...
makinarocks/IGNN
[ "5d4fd69951c10cda452773ac92f98440ffebd453" ]
[ "graphclassification/models.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom layers import ImplicitGraph\nfrom torch.nn import Parameter\nfrom utils import get_spectral_rad, SparseDropout\nimport torch.sparse as sparse\nfrom torch_geometric.nn import global_add_pool\n\n\nclass IGNN(nn.Module):\n def __init__(self...
[ [ "torch.nn.functional.log_softmax", "torch.nn.Linear", "torch.nn.functional.dropout" ] ]
quanpn90/SpeechGAN
[ "b2aa923ac40474bd7a6fa2acfd290eb2770e0972" ]
[ "onmt/models/relative_transformer.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom onmt.models.transformer_layers import PositionalEncoding, PrePostProcessing\nfrom onmt.models.transformer_layers import EncoderLayer, DecoderLayer\nfrom onmt.models.transformers import TransformerEncoder, TransformerDecoder, Transformer, ...
[ [ "torch.empty", "torch.set_printoptions", "torch.no_grad", "torch.arange", "torch.nn.ModuleList", "torch.LongTensor", "torch.cat", "torch.Tensor" ] ]
noppakorn/ddc-dashboard-scraping
[ "80fd2df7beea4b5d48c051f07d78f0e1aaf03ef6" ]
[ "src/get_dashboard_link.py" ]
[ "from selenium import webdriver\nfrom selenium.webdriver.common.by import By\nimport os\nimport time\nimport json\nimport pandas as pd\nimport sys\n\nchrome_options = webdriver.ChromeOptions()\nchrome_options.add_argument(\"--headless\")\nchrome_options.add_argument(\"--no-sandbox\")\nchrome_options.add_argument(\"...
[ [ "pandas.date_range" ] ]
christinahedges/exoplanet
[ "55d2252c71191044613fabb9c8bd3062aca3bc1b" ]
[ "src/exoplanet/distributions/eccentricity.py" ]
[ "# -*- coding: utf-8 -*-\n\n__all__ = [\"kipping13\", \"vaneylen19\"]\n\nimport numpy as np\nimport pymc3 as pm\nimport theano.tensor as tt\n\nfrom ..citations import add_citations_to_model\nfrom .base import UnitUniform\n\n\ndef kipping13(\n name, fixed=False, long=None, lower=None, upper=None, model=None, **kw...
[ [ "numpy.sqrt" ] ]
Z223I/deephyper
[ "4fd1054dc22f15197567bdd93c6e7a95a614b8e2" ]
[ "deephyper/nas/space/op/op1d.py" ]
[ "import tensorflow as tf\nfrom tensorflow import keras\n\nfrom . import Operation\n\n\nclass Dense(Operation):\n \"\"\"Multi Layer Perceptron operation.\n\n Help you to create a perceptron with n layers, m units per layer and an activation function.\n\n Args:\n units (int): number of units per layer...
[ [ "tensorflow.keras.initializers.glorot_uniform", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.MaxPooling1D", "tensorflow.keras.layers.Conv1D", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.BatchNormalization" ] ]
modelearth/flowsa
[ "d4dcf5ef8764b4ef895080a54d0546668daf0e1a" ]
[ "scripts/write_NAICS_from_useeior.py" ]
[ "# write_NAICS_from_useeior.py (scripts)\n# !/usr/bin/env python3\n# coding=utf-8\n\n\"\"\"\n3 scripts:\n\nA script to get NAICS names and a NAICS 2-3-4-5-6 crosswalk.\n\n- from useeior amd store them as .csv.\n- Depends on rpy2 and tzlocal as well as having R installed and useeior installed.\n\nLoops through the s...
[ [ "pandas.read_csv", "pandas.read_excel", "pandas.DataFrame", "pandas.merge", "pandas.concat" ] ]
PingHuskar/hackerrank
[ "1bfdbc63de5d0f94cd9e6ae250476b4a267662f2" ]
[ "mathematics/linear-algebra-foundations/linear-algebra-foundations-4-matrix-multiplication.py" ]
[ "# Mathematics > Linear Algebra Foundations > Linear Algebra Foundations #4- Matrix Multiplication\n# Matrix Multiplication of 2x2 Matrices\n#\n# https://www.hackerrank.com/challenges/linear-algebra-foundations-4-matrix-multiplication/problem\n#\n\nimport numpy as np\n\na = np.matrix([[1,2,3], [2,3,4], [1,1,1]])\nb...
[ [ "numpy.matrix" ] ]
huberthomas/bdcn
[ "15eb45d48d2f65e19bc397a4e231d7b986827ebd" ]
[ "test_ms.py" ]
[ "import numpy as np\nimport torch\nimport torch.optim as optim\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport time\nimport re\nimport os\nimport sys\nimport cv2\nimport bdcn\nfrom datasets.dataset import Data\nimport argparse\nimport cfg\n\n\ndef test(model, args):\n test_root = cfg.config_t...
[ [ "torch.utils.data.DataLoader", "torch.load", "torch.autograd.Variable", "numpy.array", "torch.sigmoid", "numpy.loadtxt" ] ]
windyrobin/TorchSeg
[ "304871d578c8f1bb3eb2c896c26528b437001268" ]
[ "model/bisenet/cityscapes.bisenet.R18.speed/infer.py" ]
[ "#!/usr/bin/env python3\n# encoding: utf-8\nimport os\nimport cv2\nimport argparse\nimport numpy as np\n\nimport torch\nimport torch.multiprocessing as mp\n\nfrom config import config\nfrom utils.pyt_utils import ensure_dir, link_file, load_model, parse_devices\nfrom utils.visualize import print_iou, show_img\nfrom...
[ [ "torch.no_grad", "torch.cuda.get_device_name", "numpy.zeros" ] ]
liyi193328/warp_seq2seq
[ "e5cbed8305aa27a76eab3e4250e0d30d96058f96" ]
[ "seq2seq/features/extend_ids.py" ]
[ "#encoding=utf-8\n\nimport tensorflow as tf\n\ndef should_continue(t, timestaps, *args):\n return tf.less(t, timestaps)\n\ndef get_extend_source_ids(source_words, source_ids, source_unk_id, oringin_vocab_size):\n new_source_ids = []\n source_oov_words_list = []\n\n unk_num_list = []\n extend_source_ids = []\n ...
[ [ "tensorflow.equal", "tensorflow.gather", "tensorflow.shape", "tensorflow.reshape", "tensorflow.unstack", "tensorflow.scatter_nd", "tensorflow.range", "tensorflow.cond", "tensorflow.cast", "tensorflow.while_loop", "tensorflow.less", "tensorflow.TensorArray", "ten...
askprash/pyCycle
[ "e0845d7e320b6cb47367734c26ec3410c9fa5bf7" ]
[ "pycycle/elements/compressor.py" ]
[ "import numpy as np\nfrom collections.abc import Iterable\nimport itertools\n\nimport openmdao.api as om\n\nfrom pycycle.thermo.cea import species_data\nfrom pycycle.thermo.thermo import Thermo\nfrom pycycle.flow_in import FlowIn\nfrom pycycle.passthrough import PassThrough\nfrom pycycle.constants import AIR_ELEMEN...
[ [ "numpy.log" ] ]
lichangao1826/ml-contest
[ "6c5350a0006d79b536df52215d18a989875135e1" ]
[ "infer/data_fountain_529_ner.py" ]
[ "from paddlenlp.transformers import PretrainedTokenizer\nfrom paddlenlp.datasets import MapDataset\nfrom paddlenlp.data import Stack, Tuple, Pad\nfrom paddle import nn\nfrom dotmap import DotMap\nfrom functools import partial\nfrom utils.utils import create_data_loader, load_label_vocab\nimport numpy as np\nimport ...
[ [ "numpy.array" ] ]
PaulCzaban/Time-Travel-Rephotography.github.io
[ "5d0ce32a48dfd7156a0f8dfddf0eadbb55b0be52" ]
[ "models/gaussian_smoothing.py" ]
[ "import math\nimport numbers\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\n\nclass GaussianSmoothing(nn.Module):\n \"\"\"\n Apply gaussian smoothing on a\n 1d, 2d or 3d tensor. Filtering is performed seperately for each channel\n in the input using a depthwise convolution....
[ [ "torch.sum", "torch.arange", "torch.exp" ] ]
RoughStochVol/BFGHS17
[ "f3221e6356c016f0bf54279efcdcbafad28ad1d0" ]
[ "code/BlackScholes.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# ------------------------------------------------------------------------------\n# BLACK-SCHOLES FRAMEWORK\n\n# ------------------------------------------------------------------------------\n# IMPORTS\n\nimport numpy as np\nfrom numpy import inf\nfrom math import...
[ [ "scipy.integrate.quad", "scipy.stats.norm.pdf", "numpy.random.randn", "scipy.optimize.brentq", "numpy.maximum", "numpy.std", "numpy.average", "scipy.stats.norm.cdf" ] ]
CBI-PITT/bil_api
[ "5be7e9d84556dcadade944f4f0c536c4b5798cfa" ]
[ "BrAinPI/old/zarrVDS.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Nov 9 16:26:33 2021\n\n@author: alpha\n\"\"\"\n\nimport os, glob, zarr, warnings\nimport numpy as np\n\nfrom numcodecs import Blosc\ncompressor = Blosc(cname='zstd', clevel=9, shuffle=Blosc.BITSHUFFLE)\n\n# ## Open fullres fmost CH1\n# location = r\"/CBI_Hive/globus...
[ [ "numpy.squeeze" ] ]
GuilhermeBaldo/segqnas
[ "5826a98f1037480e52b69a04d4f8550f2cadf920" ]
[ "evaluation.py" ]
[ "\"\"\" Copyright (c) 2020, Daniela Szwarcman and IBM Research\n * Licensed under The MIT License [see LICENSE for details]\n\n - Distribute population eval using MPI.\n\"\"\"\n\nimport time\n\nimport numpy as np\nfrom mpi4py import MPI\n\nfrom cnn import train\nfrom util import init_log\n\n\nclass EvalPopula...
[ [ "numpy.empty" ] ]
marwahaha/QSpectra
[ "328a4f78af1473d65c011eb99b903c7f0ef1db32" ]
[ "qspectra/dynamics/liouville_space.py" ]
[ "import itertools\nimport numpy as np\nfrom scipy.sparse import lil_matrix, csr_matrix\nfrom .base import DynamicalModel, SystemOperator\nfrom ..operator_tools import (SubspaceError, n_excitations,\n full_liouville_subspace)\nfrom ..utils import memoized_property\n\ndef liouville_subspa...
[ [ "numpy.ix_", "numpy.empty", "numpy.zeros", "scipy.sparse.csr_matrix", "numpy.asanyarray", "numpy.arange", "numpy.prod", "numpy.sqrt", "numpy.kron", "numpy.mean" ] ]
VitusP/Fair-SMOTE
[ "046c82936af08d9041b3d7fe9f575273a110dc82" ]
[ "Fair-SMOTE/Adult_Sex_Race.py" ]
[ "\n# coding: utf-8\n\n# In[ ]:\n\n\nimport pandas as pd\nimport random,time,csv\nimport numpy as np\nimport math,copy,os\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.tree import DecisionTreeRegressor\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import classificat...
[ [ "pandas.read_csv", "sklearn.preprocessing.MinMaxScaler", "pandas.concat", "sklearn.linear_model.LogisticRegression", "numpy.where", "sklearn.model_selection.train_test_split" ] ]
chiragyadav/char_cnn
[ "e891aebbd7a6abf1e2c141f444eebfa63738b81c" ]
[ "model.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\n\nclass TextCNN(object):\n \"\"\"\n A CNN for text classification.\n Uses an embedding layer, followed by a convolutional, max-pooling and softmax layer.\n \"\"\"\n\n def __init__(\n self, sequence_length, num_classes, vocab_size,\n ...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.reshape", "tensorflow.nn.l2_loss", "tensorflow.name_scope", "tensorflow.concat", "tensorflow.nn.dropout", "tensorflow.nn.max_pool", "tensorflow.device", "tensorflow.constant", "tensorflow.expand_dims", "tens...
scottstanie/apertools
[ "f959d03038e77444204c1ff224ddd8357db3fc04" ]
[ "apertools/utils.py" ]
[ "#! /usr/bin/env python\n\"\"\"Author: Scott Staniewicz\nutils.py: Miscellaneous helper functions\nEmail: scott.stanie@utexas.edu\n\"\"\"\nfrom __future__ import division, print_function\nimport contextlib\nimport datetime\nimport copy\nimport errno\nimport sys\nimport os\nimport subprocess\nimport numpy as np\nimp...
[ [ "numpy.sum", "numpy.dtype", "numpy.ma.masked_equal", "numpy.issubdtype", "numpy.any", "numpy.abs", "numpy.asanyarray", "numpy.exp", "numpy.lib.stride_tricks.as_strided", "numpy.log10", "numpy.angle", "numpy.prod", "numpy.array", "numpy.iscomplexobj", "nu...
dreamingleo/glow
[ "8f9649bf1e1244692f2e14bdf57720f683d82618" ]
[ "torch_glow/tests/nodes/quantized_conv2d_test.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport torch\n\nfrom tests.utils import jitVsGlow\nimport pytest\n\n\ndef test_quantized_conv2d():\n \"\"\"Basic test of the PyTorch quantized onv2d Node on Glow.\"\"\"\n\n def test_f(a, w, b):\n qu = torch.nn.quanti...
[ [ "torch.nn.quantized.Quantize", "torch.nn.quantized.Conv2d", "torch.randn", "torch.tensor", "torch.nn.quantized.DeQuantize", "torch.zeros" ] ]
SmartWarehouse-UAntwerpen/habitat-api
[ "c4e86bbb945060254355a0c70a25ecf5246a1a12" ]
[ "habitat_baselines/eval_habitat_agent_in_ros.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\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# LICENSE file in the root directory of this source tree.\n\n# this script is a prototype implementation of t...
[ [ "torch.load", "numpy.reshape", "torch.tensor", "numpy.cos", "torch.zeros", "numpy.sin" ] ]
WeichenXu123/koalas
[ "224cbe4a1c7a2b12976069762379d0e77e46750b" ]
[ "databricks/koalas/tests/test_frame_plot.py" ]
[ "import base64\nfrom io import BytesIO\n\nimport matplotlib\nfrom matplotlib import pyplot as plt\nimport pandas as pd\nimport numpy as np\n\nfrom databricks import koalas\nfrom databricks.koalas.config import set_option, reset_option\nfrom databricks.koalas.plot import TopNPlot, SampledPlot\nfrom databricks.koalas...
[ [ "pandas.date_range", "pandas.DataFrame", "numpy.random.rand", "matplotlib.pyplot.close", "matplotlib.use" ] ]
raybellwaves/geopandas
[ "592abf7f596ef4cf9b78c2706f69e83d8005821f" ]
[ "geopandas/base.py" ]
[ "from warnings import warn\n\nimport numpy as np\nimport pandas as pd\nfrom pandas import DataFrame, Series\n\nfrom shapely.geometry import box\nfrom shapely.geometry.base import BaseGeometry\nfrom shapely.ops import cascaded_union\n\nfrom .array import GeometryArray, GeometryDtype\n\n\ndef is_geometry_type(data):\...
[ [ "numpy.asarray", "pandas.Series", "pandas.DataFrame" ] ]
kongjy/pycroscopy
[ "fd02ac735a1194d2a5687183fafe00368ed8a3ca" ]
[ "pycroscopy/io/translators/time_series.py" ]
[ "\"\"\"\nCreated on Feb 9, 2016\n\n@author: Chris Smith\n\"\"\"\n\nfrom __future__ import division, print_function, absolute_import, unicode_literals\n\nimport os\n\nimport numpy as np\nfrom skimage.measure import block_reduce\nimport h5py\n\nfrom .df_utils.dm_utils import read_dm3\nfrom pyUSID.io.image import read...
[ [ "numpy.mean", "numpy.arange", "numpy.sqrt", "numpy.zeros" ] ]
ddoron9/deepface
[ "3b6dd0628cb4b0a32d1ccd836e2d765e187c1485" ]
[ "deepface/commons/realtime.py" ]
[ "import os\nfrom tqdm import tqdm\nimport numpy as np\nimport pandas as pd\nimport cv2\nimport time\nimport re\n\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\nfrom deepface import DeepFace\nfrom deepface.extendedmodels import Age\nfrom deepface.commons import functions, realtime, distance as dst\n\ndef an...
[ [ "pandas.DataFrame", "numpy.argmax", "numpy.squeeze" ] ]
laekov/akg
[ "5316b8cb2340bbf71bdc724dc9d81513a67b3104" ]
[ "tests/common/test_run/avgpool_run.py" ]
[ "# Copyright 2019 Huawei Technologies Co., Ltd\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required...
[ [ "numpy.mean", "numpy.full", "numpy.zeros" ] ]
billbrod/spatial-frequency-preferences
[ "4a83fe209bbbf8130f297bcc6e17cb79b36006c2" ]
[ "sfp/plotting.py" ]
[ "#!/usr/bin/python\n\"\"\"high-level functions to make relevant plots\n\"\"\"\nimport matplotlib as mpl\n# we do this because sometimes we run this without an X-server, and this backend doesn't need\n# one. We set warn=False because the notebook uses a different backend and will spout out a big\n# warning to that e...
[ [ "numpy.ones", "pandas.Series", "matplotlib.pyplot.tight_layout", "numpy.asarray", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.imshow", "numpy.log", "matplotlib.pyplot.plot", "numpy.vstack", "matplotlib.pyplot.figure", "matplotlib.pyplot.gca", "sklearn.li...
dkurt/nncf
[ "1329d9b13cab84e45064a064e59b8f2c7e52d140", "1329d9b13cab84e45064a064e59b8f2c7e52d140" ]
[ "examples/tensorflow/common/object_detection/architecture/darknet.py", "nncf/tensorflow/pruning/filter_pruning/algorithm.py" ]
[ "\"\"\"\n Copyright (c) 2022 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...
[ [ "tensorflow.keras.layers.Concatenate", "tensorflow.keras.layers.Activation", "tensorflow.keras.backend.softplus", "tensorflow.keras.layers.ZeroPadding2D", "tensorflow.keras.layers.experimental.SyncBatchNormalization", "tensorflow.keras.layers.Add" ], [ "tensorflow.zeros", "tens...
Ch-V3nU/Projects
[ "a0e737c1b3fe0cae48f2a42ee388e8f7c8e39817" ]
[ "Sudoku Solver/Recognizer.py" ]
[ "import cv2\nimport numpy as np\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras.preprocessing.image import img_to_array\n\n\n\nclass OCR():\n\tdef __init__(self):\n\t\tself.loaded_model = None\n\t\tself.load_models()\n\t\t\n\tdef load_models(self):\n\n\t\tself.loaded_model = load_model(\"digi...
[ [ "tensorflow.keras.preprocessing.image.img_to_array", "numpy.expand_dims", "tensorflow.keras.models.load_model" ] ]
nbiederbeck/pyirf
[ "87abc94fed4f078e185cf930f92198fd40f6f571" ]
[ "pyirf/statistics.py" ]
[ "import numpy as np\n\nfrom .utils import is_scalar\n\n\ndef li_ma_significance(n_on, n_off, alpha=0.2):\n \"\"\"\n Calculate the Li & Ma significance.\n\n Formula (17) doi.org/10.1086/161295\n\n This functions returns 0 significance when n_on < alpha * n_off\n instead of the negative sensitivities t...
[ [ "numpy.sqrt", "numpy.errstate", "numpy.log", "numpy.isnan", "numpy.array" ] ]
Mbompr/deepr
[ "1fb28e15aeeac6ef2d8e5b678feb380f2b1951f2" ]
[ "deepr/hooks/num_params.py" ]
[ "\"\"\"Log Number of Parameters after session creation\"\"\"\n\nfrom typing import Tuple, List\nimport logging\n\nimport tensorflow as tf\n\nfrom deepr.utils import mlflow\n\n\nLOGGER = logging.getLogger(__name__)\n\n\nclass NumParamsHook(tf.train.SessionRunHook):\n \"\"\"Log Number of Parameters after session c...
[ [ "tensorflow.trainable_variables", "tensorflow.global_variables" ] ]
diego-mazon/statsmodels
[ "af8b5b5dc78acb600ffd08cda6bd9b1ca5200e10" ]
[ "statsmodels/tsa/tests/test_arima.py" ]
[ "from statsmodels.compat.python import lrange\nfrom statsmodels.compat.platform import PLATFORM_OSX, PLATFORM_WIN\n\nfrom io import BytesIO\nimport pickle\nimport os\nimport warnings\n\nimport numpy as np\nfrom numpy.testing import (assert_almost_equal, assert_, assert_allclose,\n assert_r...
[ [ "numpy.ones", "pandas.Series", "numpy.diff", "numpy.random.seed", "numpy.asarray", "numpy.ones_like", "numpy.log", "pandas.period_range", "numpy.testing.assert_almost_equal", "numpy.genfromtxt", "numpy.mean", "pandas.date_range", "numpy.zeros", "pandas.read_...
hmmmq/BreastTumorIdentificationSystem
[ "ccb80ba11308ba14d92060f54a1d524c9e8561fd" ]
[ "faster_rcnn/backbone/resnet50_fpn_model.py" ]
[ "import os\nfrom collections import OrderedDict\n\nimport torch\nimport torch.nn as nn\nfrom torch.jit.annotations import List, Dict\nfrom torchvision.ops.misc import FrozenBatchNorm2d\n\nfrom .feature_pyramid_network import FeaturePyramidNetwork, LastLevelMaxPool\n\n\nclass Bottleneck(nn.Module): # conv block 和 id...
[ [ "torch.nn.MaxPool2d", "torch.nn.init.kaiming_normal_", "torch.nn.Linear", "torch.load", "torch.nn.AdaptiveAvgPool2d", "torch.flatten", "torch.nn.Conv2d", "torch.nn.Sequential", "torch.nn.ReLU" ] ]
lilhope/odnl
[ "e302a800a98a31309de0e8a0ee97a2351bea35de" ]
[ "rcnn/symbol/proposal_target.py" ]
[ "\"\"\"\nProposal Target Operator selects foreground and background roi and assigns label, bbox_transform to them.\n\"\"\"\n\nfrom __future__ import print_function\nimport mxnet as mx\nimport numpy as np\nfrom distutils.util import strtobool\n\nfrom rcnn.io.rcnn import sample_rois\n\nDEBUG = False\n\n\nclass Propos...
[ [ "numpy.round", "numpy.hstack", "numpy.all", "numpy.zeros" ] ]
gecrooks/quantumflow
[ "9d521afdec54898f52f504cf805bd994ba09b61b" ]
[ "quantumflow/circuits.py" ]
[ "# Copyright 2016-2018, Rigetti Computing\n#\n# This source code is licensed under the Apache License, Version 2.0 found in\n# the LICENSE.txt file in the root directory of this source tree.\n\n\"\"\"\n.. contents:: :local:\n.. currentmodule:: quantumflow\n\n\nCircuit objects\n###############\n.. autoclass:: Circui...
[ [ "numpy.random.normal" ] ]
hazevedosa/human-trust-transfer
[ "eaf96f3a4410d011af6557eb6c03560372fd2959" ]
[ "code/BidirectionalTrustModel.py" ]
[ "# imports\nimport torch\nfrom torch.autograd import Variable\nfrom torch import nn\nfrom torch.nn import Parameter\n\nimport numpy as np\nfrom numpy.linalg import norm\n\nimport scipy.io as sio\n\nimport pickle\n\nusecuda = True\nusecuda = usecuda and torch.cuda.is_available()\n\ndtype = torch.FloatTensor\n\nif us...
[ [ "torch.sum", "numpy.ones", "torch.ones", "numpy.zeros", "torch.exp", "torch.cuda.is_available", "numpy.random.rand" ] ]
JonWiggins/pandas
[ "951239398789b077689371d30906cab5b9248f4e" ]
[ "pandas/tests/extension/test_sparse.py" ]
[ "\"\"\"\nThis file contains a minimal set of tests for compliance with the extension\narray interface test suite, and should contain no other tests.\nThe test suite for the full functionality of the array is located in\n`pandas/tests/arrays/`.\n\nThe tests in this file are inherited from the BaseExtensionTests, and...
[ [ "numpy.random.uniform", "numpy.ones", "pandas.Series", "numpy.array", "pandas._testing.assert_produces_warning", "numpy.dtype", "pandas.DataFrame", "numpy.asarray", "numpy.errstate", "pandas.core.dtypes.common.is_object_dtype", "pandas._testing.assert_sp_array_equal", ...
online-ml/creme
[ "60872844e6052b5ef20e4075aea30f9031377136" ]
[ "river/drift/kswin.py" ]
[ "import collections\nimport itertools\nimport random\nimport typing\n\nfrom scipy import stats\n\nfrom river.base import DriftDetector\n\n\nclass KSWIN(DriftDetector):\n r\"\"\"Kolmogorov-Smirnov Windowing method for concept drift detection.\n\n Parameters\n ----------\n alpha\n Probability for t...
[ [ "scipy.stats.ks_2samp" ] ]
KarlKangYu/dcnn-pos-deps-head
[ "2ac6c16ea217517e4af79a84a4b0e223b2f62cd0" ]
[ "vdcnn.py" ]
[ "import tensorflow as tf\r\nimport numpy as np\r\nimport math\r\n\r\n# weights initializers\r\nhe_normal = tf.contrib.keras.initializers.he_normal()\r\n#he_normal = tf.contrib.layers.variance_scaling_initializer()\r\nregularizer = tf.contrib.layers.l2_regularizer(1e-4)\r\n\r\ndef Convolutional_Block(inputs, shortcu...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.reshape", "tensorflow.variable_scope", "tensorflow.contrib.keras.initializers.he_normal", "tensorflow.matmul", "tensorflow.squeeze", "tensorflow.name_scope", "tensorflow.concat", "tensorflow.contrib.layers.variance_...
waikato-datamining/cntk
[ "1b626407ef750dfbd4ad66fe9aed28487f2a4441" ]
[ "2.6/faster_rcnn/FasterRCNN/FasterRCNN_eval.py" ]
[ "# Copyright (c) Microsoft. All rights reserved.\n\n# Licensed under the MIT license. See LICENSE.md file in the project root\n# for full license information.\n# ==============================================================================\n\nimport os\nimport numpy as np\nimport cntk\nfrom cntk import input_varia...
[ [ "numpy.array", "numpy.hstack", "numpy.where" ] ]
boyuruan/Anomaly-ReactionRL
[ "590fbc89dfa761be324c35e0dcf5d08f6086df77" ]
[ "estimators/A3C/estimators.py" ]
[ "import tensorflow as tf\n\ndef build_shared_network(X, add_summaries=False):\n \"\"\"\n \n Args:\n X: Inputs\n add_summaries: If true, add layer summaries to Tensorboard.\n \n Returns:\n Final layer activations.\n \"\"\"\n\n # Three convolutional layers\n in_layer = tf....
[ [ "tensorflow.summary.scalar", "tensorflow.reduce_max", "tensorflow.reshape", "tensorflow.variable_scope", "tensorflow.squeeze", "tensorflow.get_variable_scope", "tensorflow.summary.merge", "tensorflow.train.get_global_step", "tensorflow.nn.softmax", "tensorflow.reduce_sum", ...
meierw/hackathon-2020-01
[ "0b80b5ae336759a8fa7af2f8a98520cd7e9c0ee4" ]
[ "01-rotation_correction/train_paper_rotation.py" ]
[ "'''Training the page orientation model'''\n\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os\nfrom tensorflow import keras\nfrom datetime import datetime\n\nimport cv2\nimport numpy as np\nimport helper\n\n# TODO:\n# - Train to identify rotation of found pieces of ...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dense" ] ]
henriqueribeiro/pandas
[ "996f361f8e6986ea1c65ccb164a4c585e1f4a027" ]
[ "pandas/core/indexes/datetimes.py" ]
[ "# pylint: disable=E1101\nfrom __future__ import division\nimport operator\nimport warnings\nfrom datetime import time, datetime, timedelta\n\nimport numpy as np\nfrom pytz import utc\n\nfrom pandas.core.base import _shared_docs\n\nfrom pandas.core.dtypes.common import (\n _INT64_DTYPE,\n _NS_DTYPE,\n is_d...
[ [ "pandas.core.common.values_from_object", "pandas.core.arrays.datetimelike.validate_tz_from_dtype", "pandas._libs.tslibs.parsing.parse_time_string", "pandas.tseries.offsets.Hour", "pandas.core.dtypes.concat._concat_compat", "numpy.asarray", "pandas.core.indexes.base.Index.join", "pa...
anleva/CliffordAttractorWithNumba
[ "f51b9472754b602b7c4f33ffc7c34d443fe23954" ]
[ "src/clifford_attractor_numpy.py" ]
[ "import numpy as np\r\n\r\n\r\n\"\"\"\r\nCLIFFORD ATTRACTORS\r\nEach new point (x_n+1, y_n+1) is determined based on the preceding point (x_n, y_n), and the parameters a, b, c and d. \r\nx_n+1 = sin(a * y_n) + c * cos(a x_n)\r\ny_n+1 = sin(b * x_n) + d * cos(b y_n)\r\n\"\"\"\r\n\r\n\r\ndef sample_histogram(a=0.98, ...
[ [ "numpy.zeros", "numpy.abs", "numpy.cos", "numpy.floor", "numpy.random.normal", "numpy.sin" ] ]
RishabhMaheshwary/unilm
[ "fecf168c067e2c6f8f344f09a076b7557cba9452" ]
[ "layoutlmft/examples/run_funsd.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n\nimport logging\nimport os\nimport math\nimport sys\nfrom dataclasses import dataclass, field\nfrom typing import Optional\nimport torch\nimport numpy as np\nfrom datasets import ClassLabel, load_dataset, load_metric\nimport torch\nfrom PIL import Image, ImageDraw, ImageFont...
[ [ "matplotlib.colors.ListedColormap", "matplotlib.pyplot.figure", "numpy.argmax", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.close", "numpy.mean", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.scatter" ] ]
Vishu26/Hydrological-Cycle
[ "b6db5f1526340cf1a79e27d185559b75a191b260" ]
[ "Mac/graph2.py" ]
[ "from grap2 import Ui_Form\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtGui import *\nfrom sys import argv\nfrom PyQt5.QtWidgets import *\nimport matplotlib as mpl\n\nmpl.use('Qt5Agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nclass mas2(QWidget, Ui_Form):\n\n def __init__(self):\n\n super(mas2...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "numpy.log", "matplotlib.pyplot.subplots" ] ]
stefanrer/bot-emotion2
[ "a09a51bb3355eec29c9fc09d1080877a64ef89fb" ]
[ "response_selectors/rule_based_response_selector/server.py" ]
[ "#!/usr/bin/env python\n\nimport logging\nimport numpy as np\nimport time\n\nfrom flask import Flask, request, jsonify\nfrom os import getenv\nimport sentry_sdk\n\n\nsentry_sdk.init(getenv(\"SENTRY_DSN\"))\n\nlogging.basicConfig(format=\"%(asctime)s - %(name)s - %(levelname)s - %(message)s\", level=logging.INFO)\nl...
[ [ "numpy.argmax" ] ]
kdop-dev/ipysheet
[ "997377df6ab5d1c5cfcca66f164ec0931fceec1c" ]
[ "ipysheet/test_all.py" ]
[ "import numpy as np\nimport pandas as pd\nimport ipysheet\nimport pytest\nfrom ipysheet.utils import transpose\nimport ipywidgets as widgets\nimport ipykernel.kernelbase\nfrom .utils import adapt_value\n\n\nclass _KernelMock(ipykernel.kernelbase.Kernel):\n @property\n def session(self):\n return self\n...
[ [ "pandas.DataFrame", "numpy.random.randn", "pandas.Categorical", "numpy.int64", "numpy.arange", "numpy.all", "numpy.array", "pandas.Timestamp", "pandas.isna" ] ]
papamarkou/bnn_mcmc_examples
[ "297cdb1e74335860989bebdb4ff6f6322b6adc06" ]
[ "bnn_mcmc_examples/examples/mlp/hawks/prior/benchmark_pred_accuracy_via_mean.py" ]
[ "# %% Load packages\n\nimport numpy as np\nimport torch\n\nfrom sklearn.metrics import accuracy_score\n\nfrom bnn_mcmc_examples.examples.mlp.hawks.constants import num_chains\nfrom bnn_mcmc_examples.examples.mlp.hawks.dataloaders import test_dataloader\nfrom bnn_mcmc_examples.examples.mlp.hawks.prior.constants impo...
[ [ "numpy.empty", "torch.argmax" ] ]
mdovgialo/mne-python
[ "8ccc3999da6c15efa03840230c13aeb7bab5618d" ]
[ "mne/stats/tests/test_permutations.py" ]
[ "# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n#\n# License: BSD (3-clause)\n\nfrom numpy.testing import assert_array_equal, assert_allclose\nimport numpy as np\nfrom scipy import stats, sparse\n\nfrom mne.stats import permutation_cluster_1samp_test\nfrom mne.stats.permutations import (permutation_t_...
[ [ "scipy.stats.ttest_1samp", "numpy.random.default_rng", "numpy.random.randn", "numpy.random.seed", "numpy.testing.assert_array_equal", "scipy.sparse.eye", "numpy.testing.assert_allclose", "numpy.linspace" ] ]
mathemusician/pytorch-lightning
[ "15fa5389387b3a220bc044dd30eb0be1e8f64944" ]
[ "tests/strategies/test_ddp_fully_sharded_with_full_state_dict.py" ]
[ "import os\nfrom typing import Any, Dict, Optional\nfrom unittest import mock\n\nimport pytest\nimport torch\n\nfrom pytorch_lightning import Trainer\nfrom pytorch_lightning.callbacks import ModelCheckpoint\nfrom pytorch_lightning.plugins import FullyShardedNativeMixedPrecisionPlugin\nfrom pytorch_lightning.strateg...
[ [ "torch.nn.ReLU", "torch.nn.Linear" ] ]
christopherlovell/hyperion
[ "f65c253abf0bdf174a9302666bc2fec57f7ae7da" ]
[ "hyperion/dust/tests/test_mean_opacities.py" ]
[ "from __future__ import print_function, division\n\nimport matplotlib.pyplot as plt\n\nimport numpy as np\nfrom numpy.testing import assert_allclose\nimport pytest\n\nfrom ..optical_properties import OpticalProperties\nfrom ..mean_opacities import MeanOpacities\nfrom ...util.functions import virtual_file, B_nu\nfro...
[ [ "numpy.array", "matplotlib.pyplot.figure", "matplotlib.pyplot.close", "numpy.testing.assert_allclose" ] ]
ThomasRot/rational_activations
[ "1fa26d1ee5f3c916eda00c899afa96eccb960143" ]
[ "rational/utils/histograms_numpy.py" ]
[ "import numpy as np\n\n\nclass Histogram():\n \"\"\"\n Input Histograms, used to retrieve the input of Rational Activations\n \"\"\"\n def __init__(self, bin_size=0.001, random_select=False):\n self.bins = np.array([])\n self.weights = np.array([], dtype=np.uint32)\n self.bin_size =...
[ [ "numpy.histogram", "numpy.nanmean", "numpy.arange", "numpy.log10", "numpy.array", "numpy.around", "numpy.pad" ] ]
nthndy/BayesianTracker
[ "443f984ce830373e140f744a27179debdf34ae58" ]
[ "btrack/models.py" ]
[ "from typing import List, Optional\n\nimport numpy as np\nfrom pydantic import BaseModel, root_validator, validator\n\nfrom . import constants\nfrom .optimise.hypothesis import H_TYPES, PyHypothesisParams\n\n__all__ = [\"MotionModel\", \"ObjectModel\", \"HypothesisModel\"]\n\n\ndef _check_symmetric(\n x: np.ndar...
[ [ "numpy.allclose", "numpy.reshape", "numpy.asarray" ] ]
NowacekLab/Duke-Whale-TagDataVis
[ "89f5f1af5fa558ddfec41ac6dad6e7239be4b3be" ]
[ "src/app/scripts_dev/dives.py" ]
[ "\"\"\"\nFind dives\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport scipy as sp\nimport plotly.graph_objects as go\nimport plotly.express as px\nfrom plotly.subplots import make_subplots\n\ndef plotDives(calc_file_path, new_file_path, is_export, min_length = 60, required_depth = None, max_depth = None, i...
[ [ "numpy.diff", "pandas.read_csv", "numpy.max", "numpy.min", "numpy.array", "numpy.std", "numpy.where" ] ]
Linyou/maskrcnn-benchmark
[ "5b26da7e56018dc27d0d2d8ab131d140e00c2a64" ]
[ "maskrcnn_benchmark/structures/bbox_4_point.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Apr 29 18:56:23 2019\n\n@author: pengming\n\"\"\"\n\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\n\n# transpose\nFLIP_LEFT_RIGHT = 0\nFLIP_TOP_BOTTOM = 1\n\nfrom .bounding_box import BoxList as bbox2\n...
[ [ "torch.min", "torch.stack", "torch.as_tensor", "torch.max", "torch.device" ] ]
i-jones/captum
[ "567ec6fc67ab85ce07d075b25428be22bb65e31b" ]
[ "captum/influence/_core/similarity_influence.py" ]
[ "#!/usr/bin/env python3\n\nimport warnings\nfrom functools import partial\nfrom typing import Any, Callable, Dict, List, Optional, Tuple, Union\n\nimport captum._utils.common as common\nimport torch\nfrom captum._utils.av import AV\nfrom captum.attr import LayerActivation\nfrom captum.influence._core.influence impo...
[ [ "torch.utils.data.DataLoader", "torch.linalg.norm", "torch.argsort", "torch.mm", "torch.gather", "torch.norm", "torch.topk", "torch.numel", "torch.cat", "torch.Tensor" ] ]