repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
pratyushravishankar/audio-recognition | [
"403a527906601b23716cc4b0136d4bf3ddcb3bc8"
] | [
"audio_handler.py"
] | [
"import numpy as np\nimport pyaudio\nimport time\nimport librosa\nimport features as ft\n\n\nclass AudioHandler(object):\n def __init__(self):\n self.FORMAT = pyaudio.paFloat32\n self.CHANNELS = 1\n self.RATE = 44100\n self.CHUNK = 1024 * 2\n self.p = None\n self.stream ... | [
[
"numpy.frombuffer"
]
] |
nikon-petr/perceptron | [
"40509070e1d5c2407e5778af9bccde1eda284efb"
] | [
"demonstration2.py"
] | [
"import itertools\nimport random\n\nimport numpy as np\n\nif __name__ == '__main__':\n from lib.colors import Colors\n from core.net_interface import Net\n from core.net_nag_corrector import NAG\n from core.net_sgd_corrector import SGD\n from core.net_adam_corrector import Adam\n from core.net_tra... | [
[
"numpy.copy"
]
] |
hmc-cs-mdrissi/neural_nets_research | [
"2052f29a4926715ebc8b923f62a883b0cde6bdc1"
] | [
"ANC/Machine.py"
] | [
"import torch.nn as nn\nfrom torch.autograd import Variable\nfrom .Operations import *\n\nclass Machine(nn.Module):\n \"\"\"\n The Machine executes assembly instructions passed to it by the Controller.\n It updates the given memory, registers, and instruction pointer.\n The Machine doesn't have any lear... | [
[
"torch.autograd.Variable"
]
] |
rogov-dvp/medical-imaging-matching | [
"ab5dd4c4f4422c170adb2a3228fcb88fb2a5ffe4"
] | [
"src_gpu/predicting/calculate_similarity.py"
] | [
"# calculate the similarity for two images (as np arrays)\nimport sys\nsys.path.append('../')\nimport numpy as np\nimport cv2\n\nfrom models.vgg import get_vgg_model\n\ndef calculate_similarity(img_1, img_2):\n # calculate the similarity for two images (images given as np arrays)\n \n img_size = 512\n e... | [
[
"numpy.expand_dims",
"numpy.zeros",
"numpy.square"
]
] |
ditanh97/Simple-Temperature-Control-Project | [
"88f039eefce8ac0ad5f5e282045a80f421531148"
] | [
"gui/processsrc/graphWorker.py"
] | [
"from pyqtgraph import GraphicsLayoutWidget\nimport pyqtgraph\nimport numpy as np\nimport multiprocessing\nfrom multiprocessing import Process, Queue\nfrom processsrc.ringBuffer import RingBuffer\n\n\nPLOT_COLORS = ['r', 'g', 'k', 'b']\nDEFAULT_SAMPLES = 5\nMANUAL_LEGEND = ['Temperatur Proses', '%Heater Utama']\nPI... | [
[
"numpy.linspace"
]
] |
Sea-Monster/MachineLearningClassicAlgorithm | [
"2aaad1965e7e4b8659b6296dfe938181825fa259"
] | [
"c6_logistic_regression/plot_utils.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef plot_decision_boundary(model, axis):\n \"\"\"绘制不规则决策边界\"\"\"\n x0, x1 = np.meshgrid(\n np.linspace(axis[0], axis[1], int((axis[1] - axis[0]) * 100)).reshape(1, -1),\n np.linspace(axis[2], axis[3], int((axis[3] -... | [
[
"matplotlib.colors.ListedColormap",
"matplotlib.pyplot.contourf"
]
] |
neuroailab/OpenSelfSup | [
"37709c326173a981292fed12c336c82d3356cab2"
] | [
"dataset_miscs/yfcc/extract_jpgs_from_tfrs.py"
] | [
"import sys, os\nimport numpy as np\nimport argparse\nimport tensorflow as tf\nfrom tqdm import tqdm\nimport pdb\n\n\ndef get_parser():\n parser = argparse.ArgumentParser(\n description='Generate tfrecords from jpeg images')\n parser.add_argument(\n '--tfr_dir', \n default='/m... | [
[
"numpy.random.seed",
"numpy.random.permutation",
"tensorflow.python_io.tf_record_iterator",
"tensorflow.train.Example"
]
] |
StanfordASL/nn_robustness_analysis | [
"cff947c1b6c6b586a004d13387bb2fe31131dcab"
] | [
"nn_partition/nn_partition/utils/xiang.py"
] | [
"import torch\nimport numpy as np\nfrom nn_partition.models.models import (\n model_xiang_2017,\n model_xiang_2020_robot_arm,\n model_gh1,\n)\nfrom crown_ibp.bound_layers import BoundSequential\n\nfrom nn_partition.utils.expt import robust_sdp, torch2net\n\nuse_julia = False\nif use_julia:\n from nn_par... | [
[
"numpy.max",
"numpy.divide",
"numpy.array",
"torch.zeros",
"numpy.empty",
"numpy.ones",
"numpy.min",
"matplotlib.pyplot.subplots",
"numpy.multiply",
"numpy.random.uniform",
"numpy.all",
"numpy.dstack",
"matplotlib.pyplot.show",
"matplotlib.patches.Rectangle"... |
KeyueZhu/XenomatiX | [
"4299eaf23fc7ffb3c9231f2ed68b17dbf05aa9dc"
] | [
"pointnet2/test.py"
] | [
"\"\"\"\nAuthor: Benny\nDate: Nov 2019\n\"\"\"\nimport argparse\nimport os\nfrom xenomatix_utils.DataLoader import ScannetDatasetWholeScene\nfrom xenomatix_utils.xenomatix_util import g_label2color\nimport torch\nimport logging\nfrom pathlib import Path\nimport sys\nimport importlib\nfrom tqdm import tqdm\nimport p... | [
[
"numpy.isinf",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"torch.no_grad",
"numpy.mean",
"numpy.argmax",
"torch.Tensor"
]
] |
youting83/models | [
"ea959d1aa8dd8c8a71770dcaba2961a4c07184e4"
] | [
"official/vision/beta/tasks/semantic_segmentation.py"
] | [
"# Copyright 2021 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.train.latest_checkpoint",
"tensorflow.GradientTape",
"tensorflow.distribute.get_strategy",
"tensorflow.io.gfile.isdir",
"tensorflow.add_n",
"tensorflow.cast",
"tensorflow.keras.layers.InputSpec",
"tensorflow.keras.regularizers.l2",
"tensorflow.reduce_mean",
"ten... |
akio-kobayashi/acoustic_scene | [
"b4d0678474d1b0dde4478a1710aa489e2ffad875"
] | [
"dcase/eval_dcase_multi_models.py"
] | [
"#!/usr/bin/env python\n\nimport argparse\nimport os\nimport sys\nimport subprocess\nimport time\nimport numpy as np\nimport scipy.stats as stats\nfrom dcase_cnn import DCASE_CNN_2019, CNN4, CNN8\nfrom data_split import DataSplit\nfrom generator_h5 import ASCDataGenerator\nfrom keras.layers import Input\nimport ker... | [
[
"numpy.concatenate",
"scipy.stats.mode",
"sklearn.metrics.confusion_matrix",
"numpy.add",
"numpy.reshape",
"numpy.zeros",
"tensorflow.Session",
"numpy.mean",
"tensorflow.ConfigProto",
"numpy.argmax",
"sklearn.utils.extmath.weighted_mode",
"numpy.expand_dims"
]
] |
mmulich/wildbook-ia | [
"81b405e2bfaa3f6c30a546fb6dc6e6488e9b2663"
] | [
"wbia/_wbia_object.py"
] | [
"# -*- coding: utf-8 -*-\nimport logging\nimport utool as ut\nimport numpy as np # NOQA\nfrom six.moves import range\n\n(print, rrr, profile) = ut.inject2(__name__, '[_wbia_object]')\nlogger = logging.getLogger('wbia')\n\n\ndef _find_wbia_attrs(ibs, objname, blacklist=[]):\n r\"\"\"\n Developer function to h... | [
[
"numpy.array"
]
] |
glass123451/Two-Factor-Authentication-Using-Face-Recognition-and-Eye-Position-Sequence | [
"20893a7a3aa93c0d85776a88f79004689fc87084"
] | [
"methods/FacialRecognition.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Form implementation generated from reading ui file 'FacialRecognition.ui'\n#\n# Created by: PyQt5 UI code generator 5.15.2\n#\n# WARNING: Any manual changes made to this file will be lost when pyuic5 is\n# run again. Do not edit this file unless you know what you are doing.\n\n# from ... | [
[
"numpy.array",
"numpy.load",
"numpy.min",
"numpy.argmin"
]
] |
mbaroni/EGG | [
"2bb80b00513706dca4aad3da7e0d6b8d5c178dda"
] | [
"egg/core/trainers.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\nimport os\nimport pathlib\nfrom typing import List, Optional\n\ntry:\n # requires python >= 3.7\n from contextlib import nullco... | [
[
"torch.cuda.amp.autocast",
"torch.no_grad",
"torch.nn.parallel.DistributedDataParallel",
"torch.cuda.set_device",
"torch.load",
"torch.cuda.amp.GradScaler"
]
] |
vauduong/habitat-sim | [
"08f5dcae8cb9e94e0985f8134affdb0e8ce1cc2c",
"08f5dcae8cb9e94e0985f8134affdb0e8ce1cc2c"
] | [
"habitat_sim/nav/greedy_geodesic_follower.py",
"habitat_sim/sensors/noise_models/redwood_depth_noise_model.py"
] | [
"from typing import Any, Dict, List, Optional, Tuple\n\nimport attr\nimport numpy as np\n\nfrom habitat_sim import errors, scene\nfrom habitat_sim.agent.agent import Agent\nfrom habitat_sim.agent.controls.controls import ActuationSpec\nfrom habitat_sim.nav import ( # type: ignore\n GreedyFollowerCodes,\n Gre... | [
[
"numpy.deg2rad",
"numpy.allclose"
],
[
"numpy.random.randn",
"numpy.empty_like",
"torch.empty_like"
]
] |
xyla-io/almacen | [
"7b7f235dc7939777f971f1b5eadd5621e980c15e"
] | [
"processing/process_google_ads.py"
] | [
"import pandas as pd\nimport tasks\nimport json\n\nfrom . import base\nfrom typing import TypeVar, Generic, Dict, Optional\nfrom datetime import datetime\n\nT = TypeVar(tasks.FetchGoogleAdsReportTask)\nclass GoogleAdsReportProcessor(Generic[T], base.ReportProcessor[T]):\n @property\n def added_columns(self) -> Di... | [
[
"pandas.isna"
]
] |
harripj/napari | [
"7a284b1efeb14b1f812f0d98c608f70f0dd66ad2"
] | [
"napari/layers/image/experimental/_octree_multiscale_slice.py"
] | [
"\"\"\"OctreeMultiscaleSlice class.\n\nFor viewing one slice of a multiscale image using an octree.\n\"\"\"\nimport logging\nfrom typing import Callable, List, Optional\n\nimport numpy as np\n\nfrom ....components.experimental.chunk import ChunkRequest\nfrom ....types import ArrayLike\nfrom .._image_view import Ima... | [
[
"numpy.zeros"
]
] |
Witterone/Build_week_NBCCA | [
"937c6f0470268d3a255d15956047718299e74b17"
] | [
"NBCC_backup.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 23 18:26:46 2020\n\n@author: Ronin\n\"\"\"\n\nimport numpy as np\nclass NBCC:\n \"\"\" Naive Bayesian Categorical Classifier,\n Given a your 1d array of target data and 2d array of features for training\n it should be able to predict a target array based... | [
[
"numpy.array",
"numpy.unique"
]
] |
DylanBrdt/pandas | [
"c2071681b755762e411d40a4f0baf6b212078d9c"
] | [
"pandas/core/strings.py"
] | [
"import codecs\nfrom functools import wraps\nimport re\nimport textwrap\nfrom typing import TYPE_CHECKING, Any, Callable, Dict, List, Type, Union\nimport warnings\n\nimport numpy as np\n\nimport pandas._libs.lib as lib\nimport pandas._libs.missing as libmissing\nimport pandas._libs.ops as libops\nfrom pandas._typin... | [
[
"pandas.core.dtypes.common.is_string_dtype",
"numpy.where",
"pandas.core.construction.extract_array",
"numpy.dtype",
"pandas.core.dtypes.missing.isna",
"pandas._libs.lib.infer_dtype",
"pandas.core.dtypes.common.is_re",
"numpy.putmask",
"pandas.DataFrame",
"pandas.core.dtype... |
MStarmans91/WORCTutorial | [
"83fec5a1f94ba024e03920442e0ef04b9ede5efb"
] | [
"WORCTutorialSimple.py"
] | [
"# Welcome to the tutorial of WORC: a Workflow for Optimal Radiomics\n# Classification! It will provide you with basis knowledge and practical\n# skills on how to run the WORC. For advanced topics and WORCflows, please see\n# the other notebooks provided with this tutorial. For installation details,\n# see the Read... | [
[
"pandas.read_hdf"
]
] |
js0823/comp150BDL-RobustBNN | [
"3be318b9123fe517ec77b3b59596953e842eec8d"
] | [
"src/master.py"
] | [
"import model\nimport infer\nimport loaddata\nimport numpy as np\nimport theano\nfloatX = theano.config.floatX\nimport theano.tensor as T\nimport pymc3 as pm\nfrom sklearn.metrics import accuracy_score\nimport pickle\nimport time\nimport sys\n\n###################### Configurations ########################\ninferen... | [
[
"numpy.concatenate",
"numpy.uint8",
"numpy.argmax",
"sklearn.metrics.accuracy_score"
]
] |
aleksandrkrivolap/mmfashion | [
"ca7f045d02db47b3d77fe15657fa0fddcadcb4ca"
] | [
"mmfashion/models/roi_pool/roi_pooling.py"
] | [
"from __future__ import division\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\n\nfrom ..registry import ROIPOOLING\n\n\n@ROIPOOLING.register_module\nclass RoIPooling(nn.Module):\n\n def __init__(self,\n pool_plane,\n inter_channels,\n outchannels,\n... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"numpy.array",
"torch.cat",
"torch.stack",
"torch.nn.MaxPool2d",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"torch.from_numpy",
"torch.nn.ReLU",
"torch.nn.init.normal_",
"numpy.stack",
"torch.nn.functional.... |
kolbt/whingdingdilly | [
"4c17b594ebc583750fe7565d6414f08678ea7882"
] | [
"post_proc/soft_radial.py"
] | [
"'''\n# This is an 80 character line #\nWhat does this file do?\n(Reads single argument, .gsd file name)\n\n1.) Get center of mass\n\n'''\n\nimport sys\nimport os\n\n# Run locally\nsys.path.append('/Users/kolbt/Desktop/compiled/hoomd-blue/build')\nsys.path.append('/Us... | [
[
"numpy.delete",
"numpy.sin",
"numpy.where",
"numpy.arange",
"numpy.amax",
"numpy.sqrt",
"numpy.abs",
"numpy.cos"
]
] |
SiegeLordEx/datasets | [
"8e903c178eff14108a8b539ee88c6483669dbac1"
] | [
"tensorflow_datasets/audio/nsynth.py"
] | [
"# coding=utf-8\n# Copyright 2019 The TensorFlow Datasets 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 ... | [
[
"numpy.array",
"tensorflow.io.gfile.GFile",
"numpy.nan_to_num",
"tensorflow.compat.as_text",
"numpy.mean",
"numpy.abs"
]
] |
XinyuHua/xref-chinese-el | [
"c41286009f7784e2d00e0672d482ec586046fccf"
] | [
"dataloader.py"
] | [
"import numpy as np\nimport time\nimport json\nimport utils\n\nimport torch\nfrom torch.utils.data import Dataset\n\nnp.random.seed(0)\n\nDATA_PATH = './data/'\n\n\nclass ToutiaoEntityLinkingDataset(Dataset):\n\n def __init__(self, set_type, opt, char_dict, ent_dict,\n is_inference=False, is_pret... | [
[
"numpy.random.seed",
"torch.Tensor",
"torch.LongTensor",
"numpy.random.shuffle"
]
] |
DLR-SC/sqpdfo | [
"ae3213764fdd8d0d0a05bcc3d13be63d811a0a37"
] | [
"tests/bcdfo_projgrad_test.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Dec 02 15:13:04 2014\n\n@author: jaco_da\n\"\"\"\n\nimport unittest\nfrom sqpdfo.bcdfo_projgrad import bcdfo_projgrad_\nfrom sqpdfo.runtime import compare_array\nfrom numpy import array\n\n\nclass Test_bcdfo_projgrad(unittest.TestCase):\n \"\"\"\n Reminder :\... | [
[
"numpy.array"
]
] |
NOAA-ORR-ERD/geometry_utils | [
"0417a8c459fb17f101945f53d048191dc22e97c0"
] | [
"setup_old.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nsetup.py for geometry package\n\nIt's now built with the main gnome setup.py, but kept this here for easier testing in place...\nonly useful now for \"develop\" mode\n\"\"\"\n\n#from distutils.core import setup\nfrom setuptools import setup # to support \"develop\" mode\nfrom distu... | [
[
"numpy.get_include"
]
] |
yongcale/tensorflow | [
"e385282bbb27953d5186894230ddc912bd509ae9"
] | [
"tensorflow/python/ops/array_ops.py"
] | [
"# Copyright 2015 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.ops.gen_math_ops.select",
"tensorflow.python.ops.gen_array_ops.list_diff",
"tensorflow.python.ops.gen_array_ops.unique_with_counts",
"tensorflow.python.framework.tensor_util.constant_value",
"numpy.prod",
"tensorflow.python.ops.gen_array_ops.matrix_diag",
"tensorflow... |
mmajewsk/twitchslam | [
"a551d93862dc1b5af853fbc00aeaa019940d7a3b"
] | [
"data_reading.py"
] | [
"import pathlib\nimport cv2\nimport numpy as np\nimport logging\nlogging.basicConfig(format='%(asctime)s [%(levelname)s]= %(message)s')\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.DEBUG)\n\n\nclass ImageStream:\n def is_folder(self, file_path : pathlib.Path):\n return\tfile_path.is_dir(... | [
[
"numpy.array",
"numpy.linalg.inv"
]
] |
Buhua-Liu/RobustDataProfiling | [
"5cdde8a930963e4cd56d6e4a7217da2f9c1654c6"
] | [
"src/models/vgg.py"
] | [
"#!./env python\n\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\n\n__all__ = ['get_vgg', 'vgg11', 'vgg11_bn', 'vgg11_lite', 'vgg19', 'vgg19_bn']\n\nclass VGG(nn.Module):\n\n def __init__(self, features, num_classes=1000, gain=1.0, out=512):\n super(VGG, self).__init__()\n sel... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.init._calculate_fan_in_and_fan_out",
"torch.nn.Conv2d"
]
] |
mls1999725/models | [
"77b3a9d727cb7cf3a14a75d8fdb0d17bb411bd02"
] | [
"RecommenderSystems/wide_and_deep/utils/logger.py"
] | [
"import time\nfrom datetime import datetime\nimport numpy as np\nimport oneflow as flow\n\n\n__all__ = [\"make_logger\"]\n\n\ndef make_logger(rank, print_ranks):\n return Logger(rank, print_ranks)\n\n\nclass Logger(object):\n def __init__(self, rank, print_ranks):\n self.rank = rank\n self.print... | [
[
"numpy.zeros_like"
]
] |
zapatacomputing/qe-forest | [
"03db668060321eada5f2f6acf057439275089cdb"
] | [
"tests/qeforest/openfermion_conversions_test.py"
] | [
"############################################################################\n# Copyright 2017 Rigetti Computing, Inc.\n# Modified by Zapata Computing 2020.\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 m... | [
[
"numpy.zeros"
]
] |
bartsvoboda/XAI_models | [
"6db0a8be6356c4b0c07fa62a0e002a1e1cf6cc1e",
"6db0a8be6356c4b0c07fa62a0e002a1e1cf6cc1e"
] | [
"accuracy_vs_fidelity_exp/gnb_bav_exp.py",
"accuracy_vs_fidelity_exp/cart_bav_exp.py"
] | [
"import pandas as pd\nimport numpy as np \n\ndatasets = ['breast', 'campus', 'churn', 'climate',\n 'compas', 'diabetes', 'german', 'heart',\n 'adult', 'student', 'bank', 'credit']\n\nfrom sklearn.tree import DecisionTreeClassifier\nfrom interpret.glassbox import ExplainableBoostingClassifier\n... | [
[
"numpy.array",
"sklearn.model_selection.StratifiedKFold",
"numpy.zeros",
"sklearn.pipeline.make_pipeline",
"pandas.DataFrame",
"numpy.mean",
"sklearn.base.clone",
"sklearn.linear_model.LogisticRegression",
"numpy.arange",
"sklearn.tree.DecisionTreeClassifier",
"pandas.c... |
QuantumA/FATE | [
"ea1e94b6be50c70c354d1861093187e523af32f2"
] | [
"python/fate_test/fate_test/flow_test/flow_cli_api.py"
] | [
"import json\nimport os\nimport sys\nimport shutil\nimport time\nimport subprocess\nimport numpy as np\nfrom pathlib import Path\n\nfrom prettytable import PrettyTable, ORGMODE\nfrom fate_test.flow_test.flow_process import get_dict_from_file, serving_connect\n\n\nclass TestModel(object):\n def __init__(self, dat... | [
[
"numpy.random.randint"
]
] |
plang85/tinkerbell | [
"f6f86272b676f783920093cbbabb614a616dd3af"
] | [
"tinkerbell/domain/make.py"
] | [
"from . import point as pt\nfrom . import curve as cv\nimport numpy as np\nimport scipy.interpolate as spint\n\n\ndef curve_lsq_fixed_knots(points, t, k):\n \"\"\"\n Points, internal knots and order.\n \"\"\"\n points_xy = [pt.point_coordinates(points, i) for i in range(2)]\n tck = spint.splrep(*poin... | [
[
"scipy.interpolate.splrep"
]
] |
anchandm/fooof | [
"dcc93b14c4a6987ce7e394696af3221dd2a7bbd6"
] | [
"fooof/plts/utils.py"
] | [
"\"\"\"Utility functions for plotting in FOOOF.\n\nNotes\n-----\nThese utility functions should be considered private.\n They are not expected to be called directly by the user.\n\"\"\"\n\nfrom numpy import log10\n\nfrom fooof.plts.settings import DEFAULT_FIGSIZE, ALPHA_LEVELS\nfrom fooof.core.modutils import sa... | [
[
"numpy.log10"
]
] |
LS4GAN/uvcgan | [
"376439ae2a9be684ff279ddf634fe137aadc5df5"
] | [
"uvcgan/cgan/pix2pix.py"
] | [
"# LICENSE\n# This file was extracted from\n# https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix\n# Please see `uvcgan/base/LICENSE` for copyright attribution and LICENSE\n\n# pylint: disable=not-callable\n# NOTE: Mistaken lint:\n# E1102: self.criterion_gan is not callable (not-callable)\n\nimport torch\n\nf... | [
[
"torch.cat",
"torch.nn.L1Loss"
]
] |
nicolasrosa-forks/evaluating_bdl | [
"2973b0d018551de0c9f087e2ae4e6b2c22f2ce3c"
] | [
"toyClassification/MC-Dropout-MAP-02-SGDMOM/eval.py"
] | [
"# code-checked\n# server-checked\n\nfrom model import ToyNet\n\nimport torch\nimport torch.utils.data\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport torch.nn.functional as F\n\nimport numpy as np\nimport pickle\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport ma... | [
[
"matplotlib.use",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.pcolormesh",
"numpy.array",
"numpy.zeros",
"torch.nn.functional.softmax",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"matplotlib.pyplot... |
delicateear/pandas-ta | [
"e93da09d038d07f2c800847e49c635bc0139100e"
] | [
"pandas_ta/utils/_core.py"
] | [
"# -*- coding: utf-8 -*-\nimport re as re_\nfrom pathlib import Path\nfrom sys import float_info as sflt\n\nfrom numpy import argmax, argmin\nfrom numpy import nan as npNaN\nfrom pandas import DataFrame, Series\nfrom pandas.api.types import is_datetime64_any_dtype\n\n\ndef _camelCase2Title(x: str):\n \"\"\"https... | [
[
"numpy.argmax",
"pandas.api.types.is_datetime64_any_dtype",
"numpy.argmin"
]
] |
JefferyQ/c3nav | [
"132b4856a536a9ed6b7b08d216eb6c9daa2ba6f9"
] | [
"src/c3nav/mapdata/utils/geometry.py"
] | [
"import math\nfrom collections import deque, namedtuple\nfrom contextlib import suppress\nfrom itertools import chain\nfrom typing import List, Sequence, Union\n\nimport matplotlib.pyplot as plt\nfrom django.core import checks\nfrom django.utils.functional import cached_property\nfrom matplotlib.patches import Path... | [
[
"matplotlib.path.Path",
"matplotlib.patches.PathPatch",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
]
] |
sskram/HistomicsTK | [
"6d274ba3a22e24bdaff205a39df04f515b862a31"
] | [
"plugin_tests/global_cell_graph_features_test.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n###############################################################################\n# Copyright Kitware 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 ob... | [
[
"numpy.array",
"numpy.arange",
"pandas.util.testing.assert_frame_equal"
]
] |
dataronio/BTB | [
"49d2f3c00881919a23c6578cd02fcfb6f4d33354"
] | [
"btb/tuning/acquisition/base.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom abc import ABCMeta, abstractmethod\n\nimport numpy as np\n\n\nclass BaseAcquisition(metaclass=ABCMeta):\n\n def __init_acquisition__(self, **kwargs):\n pass\n\n @staticmethod\n def _get_max_candidates(candidates, n):\n k = min(n, len(candidates) - 1) # kth el... | [
[
"numpy.argpartition"
]
] |
kigawas/DL-from-scratch | [
"a80311238d398befef857ad7e459bd675c4b7363"
] | [
"networks/two_layer.py"
] | [
"import os\nos.sys.path.extend([os.pardir, os.curdir])\n\nfrom collections import OrderedDict\n\nimport numpy as np\n\nfrom common.gradient import numerical_grad\nfrom common.layer import Affine, SoftmaxWithLoss, Relu\n\n\nclass TwoLayer(object):\n '''\n >>> from common.function import softmax\n >>> n = Tw... | [
[
"numpy.sum",
"numpy.random.randn",
"numpy.zeros"
]
] |
robfalck/pyoptsparse | [
"c99f4bfe8961492d0a1879f9ecff7a2fbb3c8c1d"
] | [
"pyoptsparse/pyALPSO/pyALPSO.py"
] | [
"# /bin/env python\n\"\"\"\npyALPSO - A pyOptSparse interface to ALPSO\nwork with sparse optimization problems.\n\nCopyright (c) 2013-2014 by Dr. Gaetan Kenway\nAll rights reserved.\n\nDevelopers:\n-----------\n- Dr. Gaetan Kenway (GKK)\n\nHistory\n-------\n v. 0.1 - Initial Wrapper Creation\n\"\"\"\nfrom __f... | [
[
"numpy.minimum",
"numpy.maximum"
]
] |
JakubicekRoman/NanoGeneNet | [
"5de7c6b83059dcf831c1b141ba4660a7204b4c77"
] | [
"Train&Valid/validace_det.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 28 14:49:04 2021\n\n@author: jakubicek\n\"\"\"\n\nimport os\nimport numpy as np\nimport numpy.matlib\nimport matplotlib.pyplot as plt\nimport torch.optim as optim\nimport glob\nimport torch.nn as nn\nimport torch.nn.functional as F \nimport torch\nimport random\n... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"pandas.DataFrame",
"torch.no_grad",
"torch.nn.functional.interpolate",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"torch.cuda.empty_cache",
"numpy.arange",
"torch.tensor",
"to... |
sbairos/flink | [
"0799b5c20a127110e47439668cf8f8db2e4ecbf3"
] | [
"flink-python/pyflink/table/tests/test_pandas_udf.py"
] | [
"################################################################################\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF lice... | [
[
"pandas.Series"
]
] |
StarStar-666/yolovv3_my | [
"8d6a48b80e4856c594714e6a9dc843d8e0d32ec3"
] | [
"train.py"
] | [
"import os\nimport time\nimport shutil\nimport numpy as np\nimport tensorflow as tf\nimport core.utils as utils\nfrom tqdm import tqdm\nfrom core.dataset import Dataset\nfrom core.yolov3 import YOLOV3\nfrom core.config import cfg\nfrom tensorflow.core.framework import summary_pb2\n\nos.environ[\"CUDA_VISIBLE_DEVICE... | [
[
"numpy.mean",
"tensorflow.assign_add",
"tensorflow.control_dependencies",
"tensorflow.global_variables_initializer",
"tensorflow.no_op",
"tensorflow.trainable_variables",
"tensorflow.Variable",
"tensorflow.global_variables",
"tensorflow.train.Saver",
"tensorflow.constant",
... |
Behrouz-Babaki/covid-19-model | [
"efb45b71d4e58857c678378f237a7b765964aeb8"
] | [
"Paris_SIR_Model/model.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nSTATES = [\"S\", \"I\"]\n\ndef get_infection_probas(states, transmissions):\n \"\"\"\n - states[i] = state of i\n - transmissions = array/list of i, j, lambda_ij\n - infection_probas[i] = 1 - prod_{j: state==I} [1 - lambda_ij]... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.zeros",
"pandas.DataFrame",
"numpy.prod"
]
] |
buzem/i2dl | [
"df68adfcd86ed031f0720817b2e3bc2d41762eeb"
] | [
"exercise_11/exercise_code/rnn/classifier.py"
] | [
"import pickle\nimport torch\nimport numpy as np\nimport torch.nn as nn\nimport pytorch_lightning as pl\nimport torch.nn.functional as F\nfrom .rnn_nn import *\nfrom .base_classifier import *\n\n\nclass RNN_Classifier(Base_Classifier):\n \n def __init__(self,classes=10, input_size=28 , hidden_size=128, activa... | [
[
"torch.nn.RNN",
"torch.nn.LSTM",
"torch.nn.Linear"
]
] |
sandipan1/robo_rl | [
"3bcb7caabeba71dd747fadf2355ac42408b7f340"
] | [
"obsvail/finite_difference.py"
] | [
"import copy\nimport os\nimport pickle\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as torchfunc\nfrom osim.env import ProstheticsEnv\nfrom pros_ai import get_policy_observation\nfrom robo_rl.common import LinearNetwork, xavier_initialisation, None_grad\nfrom tensorboardX i... | [
[
"torch.manual_seed",
"numpy.array",
"torch.Tensor",
"torch.clamp"
]
] |
seanpatrickmoran/StripeCaller | [
"1a6de26cd20570087f18da09228cf714eae81f2d"
] | [
"previous_versions/version3_debug/WIP_improved_version_4.py"
] | [
"import os\nimport re\nimport numpy as np\nfrom scipy.signal import find_peaks\nfrom scipy.stats import kruskal, poisson\nimport matplotlib.pyplot as plt\nfrom AVL_tree import AVLTree\nfrom peak_utils import *\n\nstats_log = []\n_calculated_values = {}\n_poisson_stats = {}\n\nfrom multiprocessing import Pool, cpu_c... | [
[
"numpy.max",
"scipy.stats.poisson",
"numpy.array",
"matplotlib.pyplot.colorbar",
"numpy.zeros",
"numpy.median",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"numpy.save",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.ara... |
jacob975/deep_learning | [
"52a5073589cf78aeadfde8ea51f687bc497a059b"
] | [
"find_incorrectly_predicted.py"
] | [
"#!/usr/bin/python3\n'''\nAbstract:\n This is a program to show the basic result of AI testing.\nUsage:\n find_incorrectly_predicted.py [keyword fo test set]\nExample:\n find_incorrectly_predicted.py MaxLoss15\nEditor:\n Jacob975\n\n##################################\n# Python3 #\... | [
[
"numpy.array",
"numpy.mean"
]
] |
AK391/SciCo | [
"f16af4f579fdc3bdafdb5021ee528cbc7bf2f716"
] | [
"train.py"
] | [
"import argparse\nimport pytorch_lightning as pl\nfrom pytorch_lightning.loggers import CSVLogger\nfrom pytorch_lightning.callbacks import ModelCheckpoint\nfrom pytorch_lightning.plugins import DDPPlugin\nimport socket\nimport yaml\nfrom torch.utils import data\nfrom tqdm import tqdm\nimport os\nfrom transformers i... | [
[
"torch.utils.data.DataLoader"
]
] |
Kennystruct/Clash-Detection-Matrix-Automation | [
"89b9de2c2f01d9b557a2bad97685c7f80d4cc9c1"
] | [
"Python Scripts/Create_Clash_Matrix_from_Model_Data.py"
] | [
"#DEVELOPED BY: KEHINDE AYOBADE\r\n\r\n#Importing the required packages\r\nimport os\r\nfrom textwrap import fill\r\nimport pandas as pd\r\nimport numpy as np\r\nimport xlsxwriter\r\nimport itertools\r\nimport openpyxl\r\n\r\n#Import files from file path\r\nfile_path = r'C:\\Users\\m\\Documents\\PROGRAMMING SCRIPTS... | [
[
"numpy.array",
"pandas.ExcelWriter",
"pandas.DataFrame",
"pandas.read_excel",
"pandas.MultiIndex.from_arrays",
"pandas.concat"
]
] |
MatiasRepetto/astropy | [
"689f9d3b063145150149e592a879ee40af1fac06",
"689f9d3b063145150149e592a879ee40af1fac06"
] | [
"astropy/modeling/tests/test_physical_models.py",
"astropy/wcs/tests/test_profiling.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"Tests for physical functions.\"\"\"\n# pylint: disable=no-member, invalid-name\nimport pytest\nimport numpy as np\n\nfrom astropy.modeling.physical_models import BlackBody, NFW\nfrom astropy.modeling.fitting import LevMarLSQFitter\n\nfrom astro... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.isnan",
"numpy.errstate",
"numpy.ones",
"numpy.log10"
],
[
"numpy.random.rand"
]
] |
alenstar/uiKLine | [
"372d15379539815fcf59bf1f87c10adfa43cdfc9"
] | [
"func-button/klHeatmap.py"
] | [
"# coding: utf-8\n\"\"\"\n插入所有需要的库,和函数\n\"\"\"\nimport numpy as np\nfrom ctaFunction import *\n#from ctaFunction.calcFunction import *\n#from ctaFunction.visFunction import *\n\n#----------------------------------------------------------------------\ndef klHeatmap(self):\n start = self.getInputParamByName('wL... | [
[
"numpy.array"
]
] |
meonBot/models | [
"13cf3d312c597a62b03eddf12ac2984166cea79b"
] | [
"official/nlp/modeling/models/bert_pretrainer.py"
] | [
"# Copyright 2019 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.keras.layers.Input",
"tensorflow.keras.utils.register_keras_serializable"
]
] |
faradaymahe/mcu | [
"220a18fd6ba23e3b8522ef0459357d023a31cb85"
] | [
"mcu/wannier90/w90.py"
] | [
"#!/usr/bin/env python\n'''\nmcu: Modeling and Crystallographic Utilities\nCopyright (C) 2019 Hung Q. Pham. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http... | [
[
"numpy.asarray",
"numpy.argmin",
"numpy.argmax",
"numpy.linalg.inv",
"numpy.empty_like"
]
] |
neo-mashiro/MRI | [
"1305d3e5897b0e908e406927432223846ee11170"
] | [
"lab4/part3.py"
] | [
"from dipy.denoise.nlmeans import nlmeans_3d, nlmeans\nfrom dipy.denoise.noise_estimate import estimate_sigma\nimport cv2 as cv\nimport numpy as np\nimport nibabel as nib\n\n\ndef preprocess(nifti, name):\n \"\"\"Preprocess the 3D MRI image before image segmentation\"\"\"\n image = nifti.get_fdata()\n sigm... | [
[
"numpy.argmax"
]
] |
R1j1t/pytorch_DANN | [
"be21b0752d2a1f4cbac7c5a726c8f0de14f36f12"
] | [
"models/models.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport torch.nn.init as init\n\nclass GradReverse(torch.autograd.Function):\n \"\"\"\n Extension of grad reverse layer\n \"\"\"\n @staticmethod\n def forward(ctx, x, constant):\n ctx.con... | [
[
"torch.nn.Linear",
"torch.nn.init.constant_",
"torch.nn.BatchNorm2d",
"torch.nn.functional.dropout",
"torch.nn.init.kaiming_normal_",
"torch.nn.functional.log_softmax",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.functional.max_pool2d",
"torch.nn.Dropout2d"
]
] |
OliRafa/pyLDAvis | [
"10f0e3c1150e4807acda4f3b036bea3317111d0c"
] | [
"tests/pyLDAvis/test_prepare.py"
] | [
"#! /usr/bin/venv python3\n\nimport json\nimport os.path as path\nimport funcy as fp\nfrom numpy.testing import assert_array_equal\nimport numpy as np\nimport pandas as pd\nfrom pandas.testing import assert_frame_equal\n\nfrom pyLDAvis import prepare\n\nroundtrip = fp.compose(json.loads, lambda d: d.to_json(), prep... | [
[
"pandas.testing.assert_frame_equal",
"numpy.array",
"pandas.merge",
"pandas.DataFrame",
"numpy.testing.assert_array_equal"
]
] |
sunlab-osu/REDS2 | [
"2bdcfd685af86b2eafd8e69e62cbc86f0d42689b"
] | [
"model/model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom base import BaseModel\nfrom .encoder import CNNEncoder, PCNNEncoder\nfrom .embedding import WordPosEmbedding\nfrom .selector import BagAttention, BagAttention_v1\nimport pdb\n\n\nclass BaseCNNAttModel(BaseModel):\n def __init__(\n ... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.cat",
"torch.transpose"
]
] |
GilraGroup/baconian-project | [
"e84508da60877e387344133a11039edaac35c5bf"
] | [
"baconian/common/misc.py"
] | [
"import numpy as np\n\n__all__ = ['generate_n_actions_hot_code', 'repeat_ndarray', 'construct_dict_config']\n\n\ndef generate_n_actions_hot_code(n):\n res = np.arange(0, n)\n action = np.zeros([n, n])\n action[res, res] = 1\n return action\n\n\ndef repeat_ndarray(np_array: np.ndarray, repeats):\n np_... | [
[
"numpy.expand_dims",
"numpy.repeat",
"numpy.arange",
"numpy.zeros"
]
] |
schelleg/PYNQ-ComputerVision | [
"31bb6583563423d2cd2b57d5940aa6976847f7fd"
] | [
"applicationCode/unitTests/testPython/OpenCVUtils.py"
] | [
"#!/usr/bin/python3.6\n\n###############################################################################\n# Copyright (c) 2018, Xilinx, Inc.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are ... | [
[
"numpy.indices",
"numpy.ndenumerate",
"numpy.sqrt"
]
] |
biblio-techers/Qiskit-Fall-Fest-2021 | [
"17bb4f21d4c7f4723c43b87ebae21196e8aa53c9"
] | [
"qiskit/utils/mitigation/fitters.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ... | [
[
"numpy.sum",
"numpy.zeros_like",
"numpy.zeros",
"numpy.mean"
]
] |
SoufianeDataFan/ECG-authentificate | [
"4b68411d7af9bd5641448ad1bd0b88d8e403b162"
] | [
"data_processing.py"
] | [
"\"\"\"\nAuthor: Soufiane CHAMI\nFile: data_processing.py\nDescription: converts .dat files to .csv and generates an aggregated dataset.\n\"\"\"\n\nimport os\nimport glob\nimport wfdb\nimport pandas as pd\nfrom tqdm import tqdm\n\nclass Generate_csv:\n\n def __init__(self):\n self.dir = '/Users/macbook/De... | [
[
"pandas.DataFrame"
]
] |
hschilling/pyoptsparse | [
"72d784a9d74eee7b5b840b272c89d69de6cee3a5",
"72d784a9d74eee7b5b840b272c89d69de6cee3a5"
] | [
"pyoptsparse/pyFSQP/setup.py",
"test/test_large_sparse.py"
] | [
"#!/usr/local/bin/python\n\nimport os, sys\n\n\ndef configuration(parent_package=\"\", top_path=None):\n\n from numpy.distutils.misc_util import Configuration\n\n config = Configuration(\"pyFSQP\", parent_package, top_path)\n\n config.add_library(\"ffsqp\", sources=[os.path.join(\"source\", \"*.f\")])\n ... | [
[
"numpy.distutils.misc_util.Configuration"
],
[
"numpy.sum",
"numpy.testing.assert_allclose",
"numpy.ones",
"numpy.arange"
]
] |
samiulshuvo/fastmri-reproducible-benchmark | [
"5ac9ba3e7f1ad859dcf74e7019b574a6bf065eac",
"5ac9ba3e7f1ad859dcf74e7019b574a6bf065eac"
] | [
"fastmri_recon/tests/data/datasets/fastmri_pyfunc_denoising_test.py",
"fastmri_recon/evaluate/scripts/updnet_sense_inference.py"
] | [
"import pytest\nimport tensorflow as tf\n\nfrom fastmri_recon.data.datasets.fastmri_pyfunc_denoising import train_noisy_dataset_from_indexable\n\n\nfile_contrast = 'CORPD_FBK'\n\n@pytest.mark.parametrize('ds_kwargs', [\n {},\n {'inner_slices': 1},\n {'inner_slices': 1, 'rand': True},\n {'contrast': file... | [
[
"tensorflow.test.TestCase"
],
[
"tensorflow.constant",
"tensorflow.distribute.MirroredStrategy",
"tensorflow.zeros",
"tensorflow.function"
]
] |
Bonnevie/TensorNetwork | [
"38636ebae29d78af7727c8debb9571372fce9dc1"
] | [
"tensornetwork/contractors/cost_calculators.py"
] | [
"# Copyright 2019 The TensorNetwork 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... | [
[
"numpy.prod"
]
] |
PhilippSchuette/projecteuler | [
"b74f76e8f27769d5cfc4227ccfb272d0a83ef587"
] | [
"py_src/problem001.py"
] | [
"# Project Euler Problem 1 Solution\n#\n# Problem statement:\n# If we list all the natural numbers below 10 that are multiples\n# of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.\n# Find the sum of all the multiples of 3 or 5 below 1000.\n#\n# Solution description:\n# This script compares a brute ... | [
[
"numpy.round"
]
] |
mahootiha-maryam/DL-for-image-analysis | [
"2e645341a6d3c54b2dbe31a04f96c2a06a5793c9"
] | [
"image-preprocess-medical.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nWe try to review preprocessing for medical images in this file. we did these things \r\nin this code:\r\n 1-understanding the view of images (axial,coronal,saggital). When we get the data \r\n with nibabel and load it to array, we can understand every dimension of array b... | [
[
"numpy.rot90",
"numpy.max",
"numpy.array",
"matplotlib.pyplot.savefig",
"numpy.min",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.std",
"numpy.swapaxes",
"matplotlib.pyplot.tight_layout",
"numpy.clip",
"numpy.linalg.inv",
"n... |
rdelosreyes/myctapipe | [
"dad0784b60de986d5ee871e7b61a951e948998d6"
] | [
"examples/camera_display_multi.py"
] | [
"\"\"\"\nDemo to show multiple shower images on a single figure using\n`CameraDisplay` and really simple mock shower images (not\nsimulations). Also shows how to change the color palette.\n\"\"\"\n\nimport matplotlib.pylab as plt\nfrom ctapipe import io, visualization\nfrom ctapipe.reco import mock\nfrom ctapipe.re... | [
[
"matplotlib.pylab.subplots",
"matplotlib.pylab.tight_layout",
"matplotlib.pylab.show"
]
] |
Stylite-Y/XArm-Simulation | [
"654dca390e635b6294a8b5066727d0f4d6736eb1"
] | [
"model_raisim/DRMPC/Ball_3D/utils/visualization.py"
] | [
"# from BallControl import TriCal\nimport numpy as np\nimport math\nimport pickle\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport os\nimport yaml\nfrom matplotlib.collections import LineCollection\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\nimport matplotlib.animation as animati... | [
[
"numpy.concatenate",
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.xticks",
"matplotlib.collections.LineCollection",
... |
IntroGM/2017 | [
"38262fb8999efb10673ee456cbb311b9987dfa5e",
"38262fb8999efb10673ee456cbb311b9987dfa5e"
] | [
"teaching_material/docs/build/html/_static/heat_diff_answer.py",
"teaching_material/docs/build/html/_static/heat_diff_var.py"
] | [
"#!/usr/bin/python3\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.special import erf\nimport analytical_solutions\n\n### heat_diff_template.py\n\n### Assign values for physical parameters\nCp = 1250\nrho = 3300\nalpha = 4.0\nH = 0.0\n\n### Assign values for boundary and initial conditions\nT_ini ... | [
[
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.linspace"
],
[
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.ylabel",
... |
HippocampusGirl/nitransforms | [
"415170e729d19656b69e3a6be7a4f5d86509f1c4"
] | [
"nitransforms/io/fsl.py"
] | [
"\"\"\"Read/write FSL's transforms.\"\"\"\nimport os\nimport warnings\nimport numpy as np\nfrom numpy.linalg import inv\nfrom pathlib import Path\nfrom nibabel.affines import voxel_sizes\n\nfrom .base import (\n BaseLinearTransformList,\n LinearParameters,\n DisplacementsField,\n TransformFileError,\n ... | [
[
"numpy.linalg.det",
"numpy.eye",
"numpy.swapaxes",
"numpy.diag",
"numpy.linalg.inv",
"numpy.asanyarray"
]
] |
pthangeda/FiMDPEnv | [
"86445155a89304927ddf4d6714319edd50c7c4f2"
] | [
"fimdpenv/UUVEnv.py"
] | [
"import copy\nimport numpy as np\nfrom fimdp.core import ConsMDP, CounterStrategy\nfrom fimdp.energy_solvers import GoalLeaningES, BasicES\nfrom fimdp.objectives import AS_REACH, BUCHI, MIN_INIT_CONS, POS_REACH, SAFE\nfrom matplotlib import pyplot as plt\nfrom scipy.stats import vonmises\nimport matplotlib.animatio... | [
[
"numpy.array",
"numpy.linalg.norm",
"matplotlib.animation.FuncAnimation",
"numpy.sin",
"numpy.zeros",
"numpy.random.choice",
"numpy.sum",
"numpy.ones",
"scipy.stats.vonmises",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.close",
"... |
archutim/DCGAN-tensorflow | [
"f8f29f119c8e45b9fc59014c7bfe9581e975d7c8"
] | [
"utils.py"
] | [
"\"\"\"\nSome codes from https://github.com/Newmu/dcgan_code\n\"\"\"\nfrom __future__ import division\nimport math\nimport json\nimport random\nimport pprint\nimport scipy.misc\nimport cv2\nimport numpy as np\nimport os\nimport time\nimport datetime\nimport imageio\nfrom time import gmtime, strftime\nfrom six.moves... | [
[
"numpy.uint8",
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.tile",
"tensorflow.compat.v1.trainable_variables",
"numpy.random.uniform",
"numpy.arange",
"numpy.sqrt"
]
] |
lthealy/quip_paad_cancer_detection | [
"b05310b6eff7276920ca24c5c7b0b9f42ee563cd"
] | [
"training_codes/utils/step_2_paad_baseline_preact-res34_AUC_train_TCGA_SEER.py"
] | [
"'''Train CIFAR10 with PyTorch.'''\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport os\nimport argparse\n# fro... | [
[
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.nn.functional.sigmoid",
"torch.cat",
"torch.cuda.manual_seed",
"numpy.empty",
"numpy.random.seed",
"torch.autograd.Variable",
"torch.no_grad",
"torch.manual_seed",
"torch.cuda.is_available",
"numpy.argmax",
... |
oleksost/continuum | [
"682d66540bfbfa171ac73281ed2989f9338e88bf",
"682d66540bfbfa171ac73281ed2989f9338e88bf"
] | [
"tests/test_classorder.py",
"continuum/scenarios/instance_incremental.py"
] | [
"import numpy as np\nimport pytest\nfrom torch.utils.data import DataLoader\n\nfrom continuum.datasets import InMemoryDataset\nfrom continuum.scenarios import ClassIncremental\n\n\nclass InMemoryDatasetTest(InMemoryDataset):\n\n def __init__(self, *args, class_order=None, **kwargs):\n super().__init__(*ar... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.copy",
"numpy.ones",
"numpy.arange",
"torch.utils.data.DataLoader",
"numpy.unique"
],
[
"numpy.bincount",
"numpy.unique",
"numpy.zeros",
"numpy.random.RandomState"
]
] |
ZZANZU/DeepPoseKit | [
"9d748cccddc988736dd2f8476eb788d09f2a5fb0"
] | [
"deepposekit/models/loading.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2018-2019 Jacob M. Graving <jgraving@gmail.com>\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-... | [
[
"tensorflow.python.keras.saving.save.load_model"
]
] |
AshivDhondea/SORADSIM | [
"64cd69fa281ff93e359dc5fa8fb83ace977e0827"
] | [
"modules/BistaticAndDoppler.py"
] | [
"\"\"\"\nBistatic and Doppler-related functions\n\nAuthor: AshivD, RRSG, UCT.\nCreated: 13/12/16\nEdited: \n15/12/16: added the function fnMonostaticRadar_Range_Doppler\n18/12/16: added the function fnJacobianH_Doppler to calculate the Doppler-related sensitivity matrix variables.\n19/12/16: added the function fnJa... | [
[
"numpy.linalg.norm",
"numpy.add",
"numpy.dot",
"numpy.zeros",
"numpy.shape",
"numpy.subtract",
"numpy.hstack"
]
] |
CFP106022219/ReichardtFlow2 | [
"f12a886006003b83b63dccf35f5319d9b601c6c5"
] | [
"VisualSti/borst.py"
] | [
"# -*- coding: utf-8 -*-\r\nimport numpy as np\r\nimport scipy as scipy\r\nimport matplotlib.pyplot as plt\r\n\r\ndef lowpass(x,tau):\r\n mydim=x.ndim\r\n result=np.zeros_like(x)\r\n n=x.shape\r\n if tau<1:\r\n result=x\r\n if tau>1:\r\n if mydim==1:\r\n n=n[0]\r\n ... | [
[
"scipy.ndimage.convolve",
"numpy.tan",
"numpy.exp",
"numpy.mean",
"numpy.cos",
"numpy.concatenate",
"numpy.max",
"numpy.zeros_like",
"numpy.log",
"numpy.random.poisson",
"numpy.arange",
"numpy.random.randint",
"numpy.sqrt",
"numpy.transpose",
"numpy.nanm... |
yongseok3/crnn | [
"9383c4217f8b07001a7d2e90998c0255d9e12147"
] | [
"sst1_data.py"
] | [
"import cPickle\nimport numpy as np\nfrom process_sst_data import SentimentPhrase\n\ndef get_idx_from_sent(sent, word_idx_map, max_l=51, k=300, filter_h=5, pad_left=True):\n \"\"\"\n Transforms sentence into a list of indices. Pad with zeroes.\n \"\"\"\n x = []\n pad = filter_h - 1\n if pad_left:\... | [
[
"numpy.array"
]
] |
caviri/napari-manual-split-and-merge-labels | [
"b1accc8ebe37de20d50f370cdce127673d064f1c"
] | [
"napari_manual_split_and_merge_labels/_function.py"
] | [
"from typing import TYPE_CHECKING\n\nimport numpy as np\nfrom napari_plugin_engine import napari_hook_implementation\nfrom napari_tools_menu import register_function\nimport napari\n\n\n# This is the actual plugin function, where we export our function\n# (The functions themselves are defined below)\n@napari_hook_i... | [
[
"scipy.ndimage.label",
"numpy.zeros"
]
] |
laurathepluralized/multiagent-particle-envs | [
"def007c4d80fa2e49f9f63a79be6f4f08143cee4"
] | [
"multiagent/environment.py"
] | [
"import gym\nfrom gym import spaces\nfrom gym.envs.registration import EnvSpec\nimport numpy as np\nfrom multiagent.multi_discrete import MultiDiscrete\n\n# environment for all agents in the multiagent world\n# currently code assumes that no agents will be created/destroyed at runtime!\nclass MultiAgentEnv(gym.Env)... | [
[
"numpy.array",
"numpy.sin",
"numpy.zeros",
"numpy.sum",
"numpy.argmax",
"numpy.cos",
"numpy.all",
"numpy.linspace"
]
] |
themrzmaster/imbalanced-learn | [
"e1be8695b22ca58aa5443057b9ae3f2885a45d60"
] | [
"imblearn/under_sampling/_prototype_selection/_edited_nearest_neighbours.py"
] | [
"\"\"\"Class to perform under-sampling based on the edited nearest neighbour\nmethod.\"\"\"\n\n# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>\n# Dayvid Oliveira\n# Christos Aridas\n# License: MIT\n\nfrom collections import Counter\n\nimport numpy as np\nfrom scipy.stats import mode\n\nfrom... | [
[
"scipy.stats.mode",
"numpy.empty",
"sklearn.utils.safe_indexing",
"numpy.any",
"numpy.arange",
"numpy.ravel",
"numpy.all",
"numpy.unique",
"numpy.flatnonzero"
]
] |
ruotianluo/Context-aware-ZSR | [
"f9e487a4d52a51588252d960c96c04150e74c52a"
] | [
"lib/utils/misc.py"
] | [
"import os\nimport socket\nimport glob\nfrom collections import defaultdict, Iterable\nfrom copy import deepcopy\nfrom datetime import datetime\nfrom itertools import chain\n\nimport torch\n\nfrom core.config import cfg\n\n\ndef get_run_name(args):\n \"\"\" A unique name for each run \"\"\"\n if len(args.id) ... | [
[
"torch.is_tensor"
]
] |
nholeman/raster-vision | [
"f3e1e26c555feed6fa018183c3fa04d7858d91bd"
] | [
"src/rastervision/contrib/cowc/prepare_potsdam.py"
] | [
"import os\nimport glob\n\nimport rasterio\nfrom PIL import Image\nimport numpy as np\nimport click\n\nfrom object_detection.utils.np_box_list import BoxList\n\nfrom rv.utils import save_geojson, make_empty_dir\n\n\ndef png_to_geojson(geotiff_path, label_png_path, output_path, object_half_len):\n \"\"\"Convert C... | [
[
"numpy.hstack",
"numpy.argwhere",
"numpy.clip"
]
] |
fablos/haystack | [
"d59588663015be239c28979172247ebf23c36aea"
] | [
"haystack/retriever/tfidf.py"
] | [
"import logging\nfrom collections import OrderedDict, namedtuple\n\nimport pandas as pd\nfrom haystack.database.base import Document\nfrom haystack.retriever.base import BaseRetriever\nfrom sklearn.feature_extraction.text import TfidfVectorizer\n\n\nlogger = logging.getLogger(__name__)\n\n# TODO make Paragraph gene... | [
[
"pandas.DataFrame.from_dict",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
copperwire/clustering_cnn_representations | [
"66d45a131e801b0cd1aafe7601067a103fc9322c"
] | [
"scripts/image_model.py"
] | [
"#!/usr/bin/env python3\n\nfrom keras.datasets import mnist\nfrom keras.utils import to_categorical\n\nfrom keras.models import Sequential, Model\nfrom keras.layers import Dense, Conv2D, Flatten, MaxPool2D, Reshape\nfrom keras.layers import Conv2DTranspose\nfrom keras.layers import ZeroPadding2D, ZeroPadding3D\nfro... | [
[
"matplotlib.pyplot.show",
"numpy.random.normal",
"matplotlib.pyplot.subplots"
]
] |
sinterwong/human-interaction | [
"a998b9c460fe032a29e4ef803506e6c78e7f2d1d"
] | [
"Features.py"
] | [
"from os import name\nfrom typing import SupportsComplex\nimport numpy as np\n\n\nclass FeaturesManager(object):\n def __init__(self, features: np.ndarray = None, names: list = None, dims: int = 128, threshold: float = 0.938) -> None:\n super().__init__()\n self.dims = dims\n self.__features... | [
[
"numpy.concatenate",
"numpy.delete",
"numpy.dot",
"numpy.linalg.norm",
"numpy.ones",
"numpy.isneginf",
"numpy.argmax",
"numpy.expand_dims"
]
] |
SS47816/3D-PointCloud | [
"60b58d09b8c07b5359801e442f9ba70174065827"
] | [
"Homework/Homework I/src/pca_normal.py"
] | [
"# 实现PCA分析和法向量计算,并加载数据集中的文件进行验证\n\nimport os\nimport time\nimport numpy as np\nfrom pyntcloud import PyntCloud\nimport open3d as o3d\n\n\ndef PCA(data: PyntCloud.points, correlation: bool=False, sort: bool=True) -> np.array:\n \"\"\" Calculate PCA\n\n Parameters\n ----------\n data(PyntCloud.points)... | [
[
"numpy.full",
"numpy.array",
"numpy.dot",
"numpy.asarray",
"numpy.zeros",
"numpy.mean",
"numpy.loadtxt",
"numpy.linalg.svd",
"numpy.vstack"
]
] |
EM51641/VaRpy | [
"85a2282a40a897074d8f2d6b458f169cf1d28a6b"
] | [
"varpy/data/__init__.py"
] | [
"import os\nimport pandas as pd\nfrom pandas import DataFrame\n\ndef load_file(file_base: str, filename: str) -> DataFrame:\n \"\"\"\n Load data from a csv.gz file.\n Parameters\n ----------\n file_base : str\n The director to use as the root.\n filename : str\n Name of csv.gz to loa... | [
[
"pandas.to_datetime",
"pandas.to_numeric"
]
] |
ig248/dask | [
"e49cf4d8260520981d381258e03f944503fcf48e"
] | [
"dask/dataframe/io/tests/test_hdf.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pytest\n\nimport os\nfrom time import sleep\nimport pathlib\n\nimport dask\nimport dask.dataframe as dd\nfrom dask.dataframe._compat import tm\nfrom dask.utils import tmpfile, tmpdir, dependency_depth\nfrom dask.dataframe.utils import assert_eq\n\n\nskip_pandas_rc = ... | [
[
"pandas.concat",
"pandas.DataFrame",
"numpy.random.randn",
"pandas.read_hdf",
"pandas.Series",
"pandas.HDFStore"
]
] |
wllvcxz/memcnn | [
"f83311d6bc5d0518d370062b2de63cca0a4a0899"
] | [
"memcnn/models/revop.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport copy\nfrom contextlib import contextmanager\nimport warnings\n\n\nwarnings.filterwarnings(action='ignore', category=UserWarning)\n\n\nuse_context_mans = int(torch.__version__[0]) * 100 + int(torch.__version__[2]) - \\\n ... | [
[
"torch.autograd.Variable",
"torch.cat",
"torch.set_grad_enabled",
"torch.chunk"
]
] |
Oneflow-Inc/of-maskrcnn-benchmark | [
"2d198c98771b3e68c5474b6a8afa1c4543dd2399"
] | [
"maskrcnn_benchmark/modeling/backbone/fpn.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nimport os\nimport numpy as np\n\nfrom maskrcnn_benchmark.utils.tensor_saver import get_tensor_saver\n\nclass FPN(nn.Module):\n \"\"\"\n Module that adds FPN on top o... | [
[
"torch.nn.init.kaiming_uniform_",
"torch.nn.init.constant_",
"torch.nn.functional.interpolate",
"torch.nn.Conv2d",
"torch.nn.functional.max_pool2d"
]
] |
JadeCong/HandControl_MuJoCo | [
"2acab7a9d86e3042bd4798794759584e7e02d2bd",
"2acab7a9d86e3042bd4798794759584e7e02d2bd"
] | [
"drive_hand/joint_position_calculator/get_pose_new1.py",
"data_importer/data_importer/util/handpose_evaluation.py"
] | [
"from joint_position_calculator.get_angle_new1 import *\nimport numpy as np\n\n\ndef get_finger_links(key_point0, key_point1, key_point2, key_point3, key_point4):\n # construct four link vectors based on five finger keypoints(the direction is from the palm points to the fingertip)\n link1 = make_vector(key_po... | [
[
"numpy.array",
"numpy.cross"
],
[
"numpy.ones_like",
"numpy.rint",
"numpy.nanmean",
"numpy.max",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.random.randint",
"numpy.square",
"numpy.array",
"numpy.zeros",
"matplo... |
wuyou-123/wuyou-robot | [
"c8a79f0dcc3330e6e4a4a6c30051fc5c9908fe6f"
] | [
"src/main/resources/landlords/generatePoker.py"
] | [
"# coding=UTF-8\n\nimport random\nimport sys\n\nimport numpy as np\nfrom PIL import Image\n\nims = []\nfor i in sys.argv[3:]:\n ims.append(Image.open(sys.argv[1] + i + '.jpg'))\nwidth = 25\n\n# 创建空白长图\nresult = Image.new(\"RGB\", (width * len(ims) + 80, 150))\n\n# 拼接图片\nfor i, im in enumerate(ims):\n result.p... | [
[
"numpy.uint8",
"numpy.array"
]
] |
alifeee/ElecSus | [
"b21a48eb65df81887960a4d7308c02aef2eae53c"
] | [
"elecsus/libs/numberDensityEqs.py"
] | [
"# Copyright 2014 M. A. Zentile, J. Keaveney, L. Weller, D. Whiting,\n# C. S. Adams and I. G. Hughes.\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/l... | [
[
"numpy.log10"
]
] |
PAL-ML/CLIPPER | [
"c971c89a9315d27ddb007082ff209153859f5906"
] | [
"code/ExperimentModules/datasets.py"
] | [
"import tensorflow as tf\nimport tensorflow_datasets as tfds\nimport torch\nimport torch.nn as nn\nimport torchvision.models as models\nimport torchvision.transforms as transforms\n\n# Data processing\nimport PIL\nfrom PIL import Image\nimport cv2\nimport base64\nimport imageio\nimport pandas as pd\nimport numpy as... | [
[
"tensorflow.data.Dataset.from_tensor_slices",
"numpy.zeros",
"tensorflow.keras.preprocessing.image_dataset_from_directory",
"tensorflow.io.read_file",
"numpy.load",
"tensorflow.py_function",
"pandas.read_csv",
"tensorflow.image.decode_jpeg"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.