repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
nesl/Black-box-ECG-attack | [
"726c9009ce192708f5173433dff2bc7ca9393b1b"
] | [
"ECG_v1/attacklib/boundary_attack.py"
] | [
"import numpy as np \nfrom numpy.linalg import norm\nimport collections\nimport os, sys\nimport matplotlib.pyplot as plt\nimport pdb\nimport scipy \nimport sys\nsys.path.append(\"..\") \nfrom utils import smooth\n\n# Smooth function\ndef sm(data):\n data = data.squeeze()\n length = data.size\n temp1 = data[1:]\n... | [
[
"matplotlib.pyplot.legend",
"numpy.sqrt",
"matplotlib.pyplot.figure",
"numpy.linalg.norm",
"numpy.ones",
"numpy.std",
"numpy.size",
"numpy.random.randn",
"numpy.mean",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.close",
"numpy.append",
"matplotlib.pyplot.xlab... |
himanshur-dev/ribopy | [
"78846e4140a7aa7b4dc995f39606577efaaf0831"
] | [
"tests/other/aggregate_by_length_test.py"
] | [
"# -*- coding: utf-8 -*-\nimport unittest\nfrom unittest import mock\nfrom unittest.mock import patch\nimport os\nfrom io import StringIO, BytesIO\n\nimport numpy as np\nimport h5py\n\nfrom ribopy import create\nfrom ribopy.core.coverage import find_coverage\nfrom ribopy.core.get_gadgets import get_reference_names,... | [
[
"numpy.concatenate",
"numpy.all",
"numpy.array"
]
] |
bnavigator/distributed | [
"5ea74cd7ec3cf5b90c5e6d5a31fb7dc3888ea242"
] | [
"distributed/dashboard/utils.py"
] | [
"from distutils.version import LooseVersion\nfrom numbers import Number\n\nimport bokeh\nfrom bokeh.io import curdoc\nfrom tlz import partition\nfrom tlz.curried import first\n\ntry:\n import numpy as np\nexcept ImportError:\n np = False\n\n\nBOKEH_VERSION = LooseVersion(bokeh.__version__)\n\n\nPROFILING = Fa... | [
[
"numpy.array"
]
] |
Louis-Mozart/Louis-Mozart.github.io | [
"ffc11437fb47fa4007b47ef0bf82388de132cca1"
] | [
"louismozart_teyou_BDA1.py"
] | [
"import pandas as pd\nfrom datetime import datetime\nfrom multiprocessing import Pool\nimport seaborn as sns\nfrom matplotlib import pyplot as plt\nfrom pathlib import Path\n\n\"\"\"\nINCORRECT CODES LINES 29,43,48,147,150,163,187,226\n\"\"\"\n\n# ==================================\n# INSTRUCTIONS\n# ==============... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.figure"
]
] |
shtoneyan/basenji | [
"b220dc72069c3d8c250f36cb09799b337daac2fe"
] | [
"bin/basenji_bench_classify.py"
] | [
"#!/usr/bin/env python\nfrom optparse import OptionParser\nimport joblib\nimport os\nimport pdb\n\nimport h5py\nimport numpy as np\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import roc_auc_score, roc_curve\nfrom sklearn.model_selection import KFold\n\nimport matplotlib\nimport matplo... | [
[
"sklearn.metrics.roc_auc_score",
"numpy.linspace",
"sklearn.model_selection.KFold",
"numpy.concatenate",
"matplotlib.pyplot.plot",
"numpy.mean",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"sklearn.ensemble.RandomForestClassifier",
"numpy.save",
"numpy.st... |
dineshchitlangia/HadoopTools | [
"bab3d1173c6dfff65f88e47209eeaea31848fb4a"
] | [
"plot-jmx/plot-jmx.py"
] | [
"#!/usr/bin/env python3\n\nimport getopt\nimport glob\nimport json\nimport sys\nfrom collections import OrderedDict\nfrom enum import Enum\nfrom os.path import basename\n\nimport matplotlib.pyplot as plt\n\n\n# ---------------------------------------------------------------------------\n# Class definitions.\n#\ncla... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend"
]
] |
goncaloperes/bayesmark | [
"8c420e935718f0d6867153b781e58943ecaf2338"
] | [
"test/experiment_test.py"
] | [
"# Copyright (c) 2019 Uber Technologies, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"numpy.all",
"numpy.random.RandomState",
"numpy.zeros"
]
] |
giulatona/keras-io | [
"c9814a79182c1977ba28944174ad24dbcd517842",
"c441a1f7dd7310c773125242e16769aef8ff65f6"
] | [
"examples/vision/grad_cam.py",
"examples/structured_data/deep_neural_decision_forests.py"
] | [
"\"\"\"\nTitle: Grad-CAM class activation visualization\nAuthor: [fchollet](https://twitter.com/fchollet)\nDate created: 2020/04/26\nLast modified: 2020/05/14\nDescription: How to obtain a class activation heatmap for an image classification model.\n\"\"\"\n\"\"\"\nAdapted from Deep Learning with Python (2017).\n\n... | [
[
"numpy.expand_dims",
"numpy.maximum",
"tensorflow.keras.Input",
"tensorflow.keras.preprocessing.image.load_img",
"tensorflow.reduce_mean",
"numpy.uint8",
"tensorflow.keras.preprocessing.image.array_to_img",
"numpy.arange",
"tensorflow.keras.Model",
"numpy.max",
"tensorf... |
big-data-lab-team/spark | [
"340f5c587b16563ee8e55da89cd8f50926995815"
] | [
"experiments/notebooks/generate_figures.py"
] | [
"#!/usr/bin/env python3\nimport json\nfrom statistics import mean\nfrom matplotlib import pyplot as plt\nimport matplotlib.lines as mlines\nimport numpy as np\nimport sys\n\n\ndef load_json(fn):\n with open(fn, 'r') as f:\n return json.load(f)\n\n\nbatch = None #load_json(sys.argv[1])\npilots8 = None #loa... | [
[
"numpy.polynomial.polynomial.polyfit",
"numpy.arange",
"numpy.asarray",
"matplotlib.lines.Line2D",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"numpy.ceil",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.show"
]
] |
cricketclub/gridspace-stanford-harper-valley | [
"0bd721e877c4a85d8c13ff837e68661ea6200a98"
] | [
"experiments/src/models/recognition/tasks.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass TaskTypePredictor(nn.Module):\n\n def __init__(self, input_dim, task_type_num_classes):\n super().__init__()\n self.task_fc = nn.Linear(input_dim, task_type_num_classes)\n self.task_type_num_classes = task_type_... | [
[
"torch.mean",
"torch.sigmoid",
"torch.nn.functional.nll_loss",
"torch.nn.functional.log_softmax",
"torch.sum",
"torch.nn.Linear"
]
] |
kmhk-naka/python-esn | [
"9885ef81a66981f3942fbab954972c224fd6a8d4"
] | [
"src/logistic.py"
] | [
"from pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom esn import EchoStateNetwork as ESN\n\n\ndef logistic(x: float, alpha: float):\n return alpha * x * (1 - x)\n\n\nimage_path = Path('./images').resolve()\nimage_path.mkdir(mode=0o775, parents=True, exist_ok=True)\n\ninit_lengt... | [
[
"numpy.random.seed",
"numpy.arange",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"numpy.random.rand",
"numpy.zeros",
"matplotlib.pyplot.figure"
]
] |
a-sansanwal/DALI | [
"83aeb96792d053f60dd4252b8efa0fc8fdd9012a"
] | [
"dali/python/nvidia/dali/plugin/mxnet.py"
] | [
"# Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unles... | [
[
"numpy.ceil",
"numpy.any",
"numpy.prod"
]
] |
BossunWang/soft-intro-vae-pytorch | [
"1d240f60a99682e8409363c5829aba14869ba140"
] | [
"soft_intro_vae_3d/render/plyfile.py"
] | [
"# Copyright 2014 Darsh Ranjan\n#\n# This file is part of python-plyfile.\n#\n# python-plyfile is free software: you can redistribute it and/or\n# modify it under the terms of the GNU General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your ... | [
[
"numpy.asarray",
"numpy.vstack",
"numpy.memmap",
"numpy.dtype",
"numpy.savetxt",
"numpy.array",
"numpy.empty"
]
] |
MarmerMax/Gender-Recognizer | [
"9f11c3486442ac5661a698729b99483ead244686"
] | [
"NN.py"
] | [
"from os import walk\nimport os\nfrom python_speech_features import mfcc\nimport scipy.io.wavfile as wav\nimport tensorflow as tf\nimport numpy as np\n\ndef prepare_data(path):\n x = np.empty((0, 13), float)\n y = np.empty((0, 1), int)\n for (dirpath, dirnames, filenames) in walk(path):\n for filena... | [
[
"tensorflow.matmul",
"tensorflow.truncated_normal",
"tensorflow.constant",
"tensorflow.Variable",
"tensorflow.reduce_mean",
"numpy.reshape",
"numpy.vstack",
"tensorflow.placeholder",
"tensorflow.nn.sigmoid_cross_entropy_with_logits",
"tensorflow.global_variables_initializer... |
muazhari/Poset-Lattice | [
"962c77ee896dba670baca4d0fb29f8c4366ed7a2"
] | [
"poset_lattice.py"
] | [
"'''\nNeed improvement from the code and knowledge is used to built this.\nSorry for the readableness and the quality of code not as your expectation.\n'''\n\nimport networkx as nx\nimport matplotlib.pyplot as plt\nfrom itertools import combinations\n\n\n# return GCD from pair of nums by modulating the nums iterati... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.title"
]
] |
1483795887/ubiquant_danet | [
"fd63de3aad527aca93c1eb7aa34c9e833dceb3bd"
] | [
"DAN_Task.py"
] | [
"import torch\nimport numpy as np\nfrom scipy.special import softmax\nfrom lib.utils import PredictDataset\nfrom abstract_model import DANsModel\nfrom lib.multiclass_utils import infer_output_dim, check_output_dim\nfrom torch.utils.data import DataLoader\nfrom torch.nn.functional import cross_entropy, mse_loss\n\nc... | [
[
"numpy.hstack",
"torch.nn.Softmax",
"numpy.argmax",
"numpy.vectorize",
"scipy.special.softmax",
"numpy.vstack"
]
] |
YoshiRi/ImRegPOC | [
"97025b68979cb043fc359731886a0a62333d6f09"
] | [
"python_package/Tests/PhaseCorrelation.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n''' Phase Correlation based image matching and registration libraries\n'''\n__author__ = \"Yoshi Ri\"\n__copyright__ = \"Copyright 2017, The University of Tokyo\"\n__credits__ = [\"Yoshi Ri\"]\n__license__ = \"BSD\"\n__version__ = \"1.0.1\"\n__maintainer__ = \"Yoshi Ri\"... | [
[
"numpy.fft.fft2",
"numpy.absolute",
"numpy.fft.ifft2",
"numpy.sqrt",
"numpy.arange",
"numpy.tile",
"numpy.ma.conjugate",
"numpy.sum"
]
] |
daniel616/DL | [
"b62087bb86bcfa4cdaa692bb0ae724d416761de3"
] | [
"mmdet/models/backbones/vgg.py"
] | [
"import logging\n\nimport torch.nn as nn\n\nfrom mmcv.cnn.weight_init import constant_init, normal_init, kaiming_init\nfrom mmcv.runner import load_checkpoint\n\n\nfrom ..registry import BACKBONES\n\ndef conv3x3(in_planes, out_planes, dilation=1):\n \"3x3 convolution with padding\"\n return nn.Conv2d(\n ... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
boostcampaitech2/model-optimization-level3-cv-07 | [
"952a2fc6902a62eee602bc4f823d3bddfe7a792b"
] | [
"inference_obtu.py"
] | [
"\"\"\"Example code for submit.\n\n- Author: Junghoon Kim, Jongkuk Lim\n- Contact: placidus36@gmail.com, lim.jeikei@gmail.com\n\"\"\"\nimport argparse\nimport json\nimport os\nimport time\nfrom datetime import datetime\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torchvision.datasets import ImageF... | [
[
"torch.cuda.synchronize",
"torch.jit.load",
"torch.cuda.Event",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.rand",
"torch.cuda.is_available",
"torch.device",
"torch.autograd.profiler.profile",
"torch.argmax"
]
] |
georgedeath/bomean | [
"0dad35e0d584cf7c46c9a8cb0445f225875cfa86"
] | [
"bopt/transforms.py"
] | [
"import torch\r\nfrom scipy.stats import median_absolute_deviation\r\n\r\n\r\nclass Transform_Base(object):\r\n \"\"\"\r\n Base class for transformations based on some data.\r\n \"\"\"\r\n\r\n def __init__(self, Ytr):\r\n self.Ytr = Ytr\r\n\r\n # Transform the mean\r\n def scale_mean(self, ... | [
[
"scipy.stats.median_absolute_deviation"
]
] |
msrasmussen/lisa | [
"9c8d790d8897c817a4d9d251dbbea34aa292d883"
] | [
"lisa/notebook.py"
] | [
"# SPDX-License-Identifier: Apache-2.0\n#\n# Copyright (C) 2019, Arm Limited and contributors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# 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/L... | [
[
"matplotlib.__version__.split",
"matplotlib.pyplot.subplots",
"matplotlib.figure.Figure"
]
] |
mmenarini/MetaSense | [
"910cfdc1d05b2f8ad89ce27a9594ee73def6cd37"
] | [
"MetaSenseTransfer/scripts/plot_split.py"
] | [
"import numpy as np\nimport glob\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nsns.set_style('white')\nimport pandas as pd\nimport tqdm\nimport joblib\nfrom path import Path\nimport click\n\nMETRICS = [\"%s %s\"% (gas, metric) for gas in [\"NO2\", \"O3\"]\n for metric in [\"MAE\", \"CvMAE\", \"... | [
[
"pandas.concat",
"pandas.read_csv",
"matplotlib.pyplot.subplots",
"pandas.DataFrame"
]
] |
harewei/reinforcement_learning | [
"0f3d2fe75cc872883232df4b23969708a701e024"
] | [
"agents/A2CER.py"
] | [
"# Unlike REINFORCE, we do not wait for end of episode to train. Also, the advantage is now calculated\n# from TD error, which are derived using critic network.\n\nimport gym\nimport numpy as np\nimport tensorflow as tf\ntf.compat.v1.disable_eager_execution()\nfrom tensorflow.keras.layers import Dense, Input, Acti... | [
[
"tensorflow.keras.layers.Activation",
"numpy.random.choice",
"numpy.reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Model",
"tensorflow.keras.optimizers.Adam",
"tensorflow.compat.v1.disable_eager_execution",
"numpy.array",
"numpy.zeros",
"tensorflow.keras.layer... |
ashish2085/webcrawler | [
"dabb37be05764b762aeec97ae54e8657228a650d"
] | [
"webcrawler.py"
] | [
"from bs4 import BeautifulSoup as soup\nfrom urllib.request import urlopen as uReq\n\n#Package to read config file\nimport configparser\nimport pandas as pd\n\nclass WebCrawler:\n\n\tdef read_ini(self,file_path):\n\t config = configparser.ConfigParser()\n\t config.read(file_path)\n\t return config\n\n\t\n\... | [
[
"pandas.DataFrame"
]
] |
juliagarriga/h5py | [
"d89bcc4cec7bbce0ae89c998e61d3c7387a9c73d"
] | [
"h5py/tests/test_dtype.py"
] | [
"\"\"\"\n Tests for converting between numpy dtypes and h5py data types\n\"\"\"\n\nfrom itertools import count\nimport platform\nimport numpy as np\nimport h5py\ntry:\n import tables\nexcept ImportError:\n tables = None\n\nfrom .common import ut, TestCase\n\nUNSUPPORTED_LONG_DOUBLE = ('i386', 'i486', 'i586... | [
[
"numpy.random.seed",
"numpy.arange",
"numpy.issubdtype",
"numpy.dtype",
"numpy.all",
"numpy.typeDict.values",
"numpy.argmax",
"numpy.random.rand",
"numpy.core.records.fromarrays",
"numpy.array",
"numpy.empty",
"numpy.random.randint"
]
] |
foamliu/GST-Tacotron-v2 | [
"becca9275d2ec4a560287c63f9db28a3245cd188"
] | [
"utils.py"
] | [
"import argparse\nimport logging\n\nimport cv2 as cv\nimport librosa\nimport matplotlib.pylab as plt\nimport numpy as np\nimport pinyin\nimport torch\n\nfrom config import sampling_rate, char_to_idx, idx_to_char, ref_wav\nfrom models.layers import STFT\n\n\ndef clip_gradient(optimizer, grad_clip):\n \"\"\"\n ... | [
[
"torch.clamp",
"torch.max",
"numpy.min",
"torch.load",
"torch.zeros",
"torch.randn",
"torch.cuda.LongTensor",
"matplotlib.pylab.title",
"numpy.save",
"torch.from_numpy",
"numpy.max",
"torch.save",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.transp... |
RuthAngus/LSST-max | [
"88abfa4aedd5837c9d1f1b9e17a8fd2d1713488b"
] | [
"code/LSST_inject_and_recover.py"
] | [
"# coding: utf-8\n# # Recovering rotation periods in simulated LSST data\n# before you run this, remove the files: simulations/l45b-{0}/all_truths.txt &\n# results/l45b-{0}_{1}yr_results.txt\".format(b, yr)\n\nfrom __future__ import print_function\nimport numpy as np\n# import matplotlib.pyplot as plt\nimport panda... | [
[
"numpy.log",
"numpy.abs",
"numpy.linspace",
"numpy.arange",
"numpy.genfromtxt",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.savetxt",
"numpy.argsort",
"numpy.array",
"numpy.vstack"
]
] |
dpfried/ImageCaptioning.pytorch | [
"a2330f1e1e16c334ddb3228a4db9fdde6194d9cd"
] | [
"captioning/utils/eval_multi.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\n\nimport numpy as np\nimport json\nfrom json import encoder\nimport random\nimport string\nimport time\nimport os\nimport sys\nfrom . import misc as utils\nfrom .ev... | [
[
"numpy.linalg.eigvalsh",
"numpy.array",
"numpy.sqrt",
"numpy.clip"
]
] |
ebezzam/pyFFS | [
"29eac7a3305dcefe40b4cdc03f730fc9bd868eab"
] | [
"profile/bandlimited_interp1d_vary_width.py"
] | [
"import numpy as np\nimport pathlib as plib\nfrom pyffs import ffs_sample, ffs, fs_interp\nfrom pyffs.func import dirichlet\nimport matplotlib.pyplot as plt\nimport click\nfrom scipy.signal import resample\nfrom util import comparison_plot, plotting_setup\nimport time\n\n\n@click.command()\n@click.option(\"--n_samp... | [
[
"numpy.linspace",
"numpy.logspace",
"matplotlib.pyplot.subplots",
"numpy.sort",
"numpy.ceil",
"numpy.std",
"numpy.mean",
"matplotlib.pyplot.show"
]
] |
sujaylokesh/proj3 | [
"de86aec64b1ee142c073fb3096f50bd0310ebd88"
] | [
"src/encoders/cbow_seq_encoder.py"
] | [
"from typing import Dict, Any\n\nimport tensorflow as tf\n\nfrom .masked_seq_encoder import MaskedSeqEncoder\nfrom utils.tfutils import pool_sequence_embedding\n\n\nclass CBoWEncoder(MaskedSeqEncoder):\n @classmethod\n def get_default_hyperparameters(cls) -> Dict[str, Any]:\n encoder_hypers = { 'cbow_p... | [
[
"tensorflow.concat",
"tensorflow.constant",
"tensorflow.transpose",
"tensorflow.range",
"tensorflow.reduce_sum",
"tensorflow.pad",
"tensorflow.variable_scope"
]
] |
Saraharas/ParlAI | [
"9cb89024a5852e68c81466a70f16f692de8cff97",
"9cb89024a5852e68c81466a70f16f692de8cff97"
] | [
"projects/anti_scaling/distillation.py",
"tests/nightly/gpu/test_gpt2.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\"\"\"\nCode for distilling a transformer/generator model.\n\"\"\"\n\nimport os\nfrom abc import ABC, abstractm... | [
[
"torch.nn.functional.softmax",
"torch.nn.functional.log_softmax",
"torch.nn.Linear",
"torch.nn.functional.mse_loss",
"torch.no_grad",
"torch.stack",
"torch.clamp"
],
[
"torch.distributed.destroy_process_group"
]
] |
idaho777/creativeflow | [
"adf7a9e1cf70005560cfbf8064137fb1236bc574"
] | [
"creativeflow/blender/unpack_exr_main.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nUNPACK FLOW, BACKFLOW, DEPTH FROM MULTILAYER EXR FILES OUTPUT BY BLENDER.\n\nBackground:\n------------------------------------------------------------------------------\nIn order to extract flow and depth from Blender rendering pipeline we write\nmultilayer EXR files (https://www.ope... | [
[
"numpy.max",
"numpy.min"
]
] |
serend1p1ty/core-pytorch-utils | [
"626e4ec586656788204656779a80f374f888256b"
] | [
"tests/test_lr_scheduler.py"
] | [
"import mmcv\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom cpu.lr_scheduler import LRWarmupScheduler\nfrom fvcore.common.param_scheduler import (\n CompositeParamScheduler,\n ConstantParamScheduler,\n LinearParamScheduler,\n CosineParamScheduler,\n MultiStepParamScheduler\n)\nfrom mm... | [
[
"torch.optim.lr_scheduler.CosineAnnealingWarmRestarts",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"numpy.allclose",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.zeros",
"torch.optim.SGD"
]
] |
LandingEllipse/pds4_tools | [
"3d833575b1fe0e0ac35c6e4ecbda1630b884df55"
] | [
"pds4_tools/viewer/plot_view.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport os\nimport re\nimport copy\nimport platform\nimport functools\nimport itertools\nfrom fractions import Fraction\n\nimport numpy as np\nimport matplotlib ... | [
[
"matplotlib.rcParams.get",
"numpy.invert",
"matplotlib.figure.Figure",
"numpy.arange",
"numpy.issubdtype",
"numpy.ma.mask_or",
"matplotlib.dates.AutoDateLocator",
"matplotlib.lines._get_dash_pattern",
"numpy.ma.is_masked"
]
] |
KeithBrodie/RANSAC | [
"c77b2103a6439138ccda7641d999af0963cff669"
] | [
"ransac_core.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n RANSAC_Core Class Definition\n \n \n Copyright (c) Keith Brodie 2021\n \n MIT License\n\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass RANSAC_Core(object):\n \"\"\"RANSAC Core Object defining fitted function.\n \n This is a template, it cann... | [
[
"matplotlib.pyplot.legend",
"numpy.abs",
"matplotlib.pyplot.title",
"numpy.unique",
"numpy.arange",
"matplotlib.pyplot.subplots",
"numpy.ndarray",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.zeros_like",
"numpy.random.randn",
"matplotlib.pyplot.gri... |
Ellawin/nevergrad | [
"d4ea61d0fff9292045f72714b26972ea1e48bd88",
"850418e9e4d00ee2e4fc12d8fc7a6981b0152641"
] | [
"nevergrad/functions/iohprofiler/test_core.py",
"nevergrad/optimization/test_sequences.py"
] | [
"import pytest\nimport numpy as np\nfrom . import core\n\n\n@pytest.mark.parametrize(\"fid\", range(1, 24)) # type: ignore\ndef test_PBO(fid: int) -> None:\n func = core.PBOFunction(fid, 0, 16)\n x = func.parametrization.sample()\n value = func(x.value)\n assert isinstance(value, float), \"All output o... | [
[
"numpy.isfinite"
],
[
"numpy.testing.assert_equal",
"numpy.sqrt",
"numpy.random.seed",
"numpy.random.choice",
"numpy.arange",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_almost_equal",
"numpy.testing.assert_raises",
"numpy.random.randint"
]
] |
unkcpz/aiida-quantumespresso | [
"fbac0993bb8b6cdeba85717453debcf0ab062b5a"
] | [
"aiida_quantumespresso/parsers/dos.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nfrom aiida.parsers.parser import Parser\nfrom aiida.orm.data.array.xy import XyData\nfrom aiida.orm.data.parameter import ParameterData\nfrom aiida.common.exceptions import InvalidOperation\nfrom aiida.common.datastructures import calc_states\nfrom aiida_quantumespresso... | [
[
"numpy.isnan",
"numpy.array",
"numpy.genfromtxt"
]
] |
santiagoinfantinom/pandapower | [
"b0873a161f2bec73fce2982d55040e6afc733931"
] | [
"pandapower/test/api/test_create.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright (c) 2016-2019 by University of Kassel and Fraunhofer Institute for Energy Economics\n# and Energy System Technology (IEE), Kassel. All rights reserved.\n\n\nimport numpy as np\nimport pandapower as pp\nimport pytest\n\nimport pandas as pd\npd.set_option('display.max_rows', 50... | [
[
"pandas.set_option",
"numpy.array",
"numpy.sqrt",
"numpy.isclose"
]
] |
bhaskargautam/record-linkage | [
"01eb29f8b7fb4dd1625187232f2dafe47f24cddf"
] | [
"tests/er/test_transe.py"
] | [
"import config\nimport itertools\nimport pandas as pd\nimport numpy as np\nimport recordlinkage\nimport unittest\n\nfrom common import (\n export_embeddings,\n export_false_positives,\n export_false_negatives,\n export_result_prob,\n get_optimal_threshold,\n get_logger,\n InformationRetrievalMe... | [
[
"scipy.spatial.distance.cosine",
"pandas.MultiIndex.from_tuples"
]
] |
kira7005/pytorch-image-models | [
"096e6caef70565a4970ddc33ca6c64aac2f7b7d4"
] | [
"train.py"
] | [
"#!/usr/bin/env python3\n\"\"\" ImageNet Training Script\n\nThis is intended to be a lean and easily modifiable ImageNet training script that reproduces ImageNet\ntraining results with some of the latest networks and training techniques. It favours canonical PyTorch\nand standard Python style over trying to be able... | [
[
"torch.jit.script",
"torch.cuda.synchronize",
"torch.nn.CrossEntropyLoss",
"torch.distributed.init_process_group",
"torch.cuda.set_device",
"torch.nn.SyncBatchNorm.convert_sync_batchnorm",
"torch.no_grad",
"torch.distributed.get_rank",
"torch.distributed.get_world_size",
"t... |
mckoh/blob_creator | [
"3fb00efd91f1d0017e052858bdfe5ad432ea1e38"
] | [
"src/blob_creator/core.py"
] | [
"\"\"\"\nCore module of Blob Creator\n\nAuthor: Michael Kohlegger\nDate: 2021-09\n\"\"\"\n\nfrom shutil import rmtree\nfrom os import mkdir, remove\nfrom os.path import isdir, join\nfrom numpy import ceil\nfrom numpy.random import normal, randint\nfrom names import get_first_name\nfrom pandas import DataFrame\nfrom... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.use",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"numpy.random.normal",
"numpy.random.randint"
]
] |
cjcardinale/climlab | [
"95d64326713f27b9a3b84aabfd9e70e93e13a2f0"
] | [
"climlab/radiation/nband.py"
] | [
"from __future__ import division\nfrom builtins import range\nimport numpy as np\nfrom climlab.radiation.greygas import GreyGas\nfrom climlab import constants as const\nfrom climlab.domain import domain, axis, field\nfrom copy import copy\n\n\nclass NbandRadiation(GreyGas):\n '''Process for radiative transfer.\n... | [
[
"numpy.maximum",
"numpy.minimum",
"numpy.ones_like",
"numpy.linspace",
"numpy.reshape",
"numpy.size",
"numpy.zeros_like",
"numpy.exp",
"numpy.outer",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
cpearce/scikit-ika | [
"01f90ac3e7963e4d05f73316a7d14de0d8f08d1e"
] | [
"skika/third_party/denstream/Demonstration.py"
] | [
"import numpy as np\n\n\nclass MicroCluster:\n def __init__(self, lambd):\n self.decay_factor = 2 ** (-lambd)\n self.mean = 0\n self.variance = 0\n self.sum_of_weights = 0\n\n def insert_sample(self, sample, weight):\n if self.sum_of_weights != 0:\n # Update sum o... | [
[
"numpy.array",
"numpy.sqrt"
]
] |
stvreumi/ray | [
"40c4148d4f065802f7888017ef26c2213b45341b"
] | [
"python/ray/rllib/models/catalog.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport gym\nimport numpy as np\nimport tensorflow as tf\nfrom functools import partial\n\nfrom ray.tune.registry import RLLIB_MODEL, RLLIB_PREPROCESSOR, \\\n _global_registry\n\nfrom ray.rllib.env.a... | [
[
"numpy.product",
"tensorflow.placeholder"
]
] |
julesberman/chunkflow | [
"c6af0d036bc2f308c64c591d49c94c414c569241"
] | [
"chunkflow/flow/view.py"
] | [
"import numpy as np\n\nfrom cloudvolume import view, hyperview\nfrom .base import OperatorBase\n\n\nclass ViewOperator(OperatorBase):\n def __init__(self, name: str = 'view'):\n super().__init__(name=name)\n\n def __call__(self, chunk, seg=None):\n \"\"\"view chunk using cloudvolume view\"\"\"\n... | [
[
"numpy.issubdtype"
]
] |
kctsiolis/RepDistiller | [
"ce88f6e53fcf8ef81c5bac2d20ad31628dd279ac"
] | [
"distiller_zoo/SimBased.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass SimBasedLoss(nn.Module):\n def __init__(self):\n super(SimBasedLoss, self).__init__()\n\n def forward(self, y_s, y_t):\n y_s = F.normalize(y_s, p=2, dim=1)\n y_t = F.normalize(y_t, p=2, dim=1)\n student_... | [
[
"torch.nn.functional.normalize",
"torch.matmul",
"torch.nn.functional.mse_loss"
]
] |
fierval/EigenSiNN | [
"4ed01b47d4b13b9c9e29622475d821868499942d"
] | [
"python/layers/relu3d.py"
] | [
"import os\nfrom utils import to_cpp\nimport commondata4d as cd\nimport torch.nn as nn\n\n############ ReLU ############################\ninp = cd.inp_with_neg\nfakeloss = cd.convloss\n\nrl = nn.ReLU()\noutput = rl(inp)\noutput.backward(cd.inp)\nprint(f\"RELU output: {to_cpp(output)}\")\nprint(f\"RELU grad: {to_cpp... | [
[
"torch.nn.ReLU",
"torch.nn.LeakyReLU"
]
] |
Oadegbite/OpenCanadaData | [
"232d71d5721baf4eee848387c4addc9d7b00bc89"
] | [
"tests/TestDataset.py"
] | [
"import unittest\nfrom ocandata.repo import IdAndLocale, Dataset\nimport pandas as pd\n\npd.set_option(\"display.max_colwidth\", 80)\n\n\nclass DatasetTestCase(unittest.TestCase):\n def test_create_dataset(self):\n dataset = IdAndLocale(id=\"winter\")\n self.assertEqual(\"winter\", dataset.id)\n\n ... | [
[
"pandas.set_option",
"pandas.read_csv"
]
] |
Lavoiec/Project-Overlay-Data-Process | [
"e5c03db8567b085e3c8ca5e317b53474d70ddaa5"
] | [
"VectorSpaceModel.py"
] | [
"import pandas as pd\nimport utility_funcs as uf\nimport ProjectOverlayDataProcess as data\nimport code\n\nfrom sklearn.metrics.pairwise import cosine_similarity\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.feature_extraction.text import TfidfTransformer\nfrom sklearn.feature_extractio... | [
[
"sklearn.decomposition.TruncatedSVD",
"pandas.Series",
"sklearn.metrics.pairwise.cosine_similarity",
"pandas.DataFrame",
"sklearn.preprocessing.Normalizer",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
lcopey/node_editor | [
"04d56ae4c7f2149e46903d5dd2e46f3906ef69e6"
] | [
"code_samples/combobox_header.py"
] | [
"from PyQt5 import QtCore, QtWidgets\nfrom PyQt5.QtCore import QEvent, QObject\nimport numpy as np\n\n\nclass HeaderViewFilter(QObject):\n def __init__(self, header, parent=None, *args):\n super(HeaderViewFilter, self).__init__(parent, *args)\n self.header = header\n\n def eventFilter(self, obje... | [
[
"numpy.random.rand"
]
] |
dthadi3/XlsxWriter | [
"f1801e82240aa9c746ce14948ef95990b83162cf"
] | [
"examples/pandas_chart_line.py"
] | [
"##############################################################################\n#\n# An example of converting a Pandas dataframe to an xlsx file with a line\n# chart using Pandas and XlsxWriter.\n#\n# Copyright 2013-2020, John McNamara, jmcnamara@cpan.org\n#\n\nimport pandas as pd\nimport random\n\n# Create some s... | [
[
"pandas.DataFrame",
"pandas.ExcelWriter"
]
] |
serge-sans-paille/mmcv | [
"46a2916d7b4d7a597f8558b16f700a798616ec87"
] | [
"tests/test_cnn/test_conv_module.py"
] | [
"from unittest.mock import patch\n\nimport pytest\nimport torch\nimport torch.nn as nn\n\nfrom mmcv.cnn.bricks import CONV_LAYERS, ConvModule\n\n\n@CONV_LAYERS.register_module()\nclass ExampleConv(nn.Module):\n\n def __init__(self,\n in_channels,\n out_channels,\n ... | [
[
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.rand",
"torch.zeros"
]
] |
harrisonzhu508/MVBAgg | [
"ad2781af7faffeb18ca3613f0b619461291037d2"
] | [
"src/posteriors.py"
] | [
"import tensorflow as tf\nimport gpflow\nfrom gpflow import covariances\nfrom gpflow.posteriors import IndependentPosteriorSingleOutput\nfrom gpflow.config import default_jitter\nfrom gpflow.conditionals.util import base_conditional\n\nclass MVBAggPosterior(IndependentPosteriorSingleOutput):\n def __init__(self,... | [
[
"tensorflow.transpose",
"tensorflow.shape",
"tensorflow.expand_dims",
"tensorflow.einsum",
"tensorflow.gather"
]
] |
thomas-marquis/nlp-tools-py-lib | [
"f944172ec48544d09362ddcb0564813add42ae89"
] | [
"nlp_tools/representations.py"
] | [
"import pandas as pd\nimport numpy as np\nimport typing as t\n\nfrom nlp_tools import utils\nfrom nlp_tools.dump import dump_word_index, dump_merged_word_matrix\n\n\nclass IndexedRepresentation:\n index_columns: t.List[str] = ['lem', 'index']\n index: pd.DataFrame\n index_len: int\n data: t.Dict[str, np... | [
[
"numpy.zeros",
"pandas.DataFrame"
]
] |
hchang000/delta | [
"89320bd538e360d939c50d9f303e81554f6ce7ac"
] | [
"delta/layers/common_layers.py"
] | [
"# Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.\n# All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.o... | [
[
"tensorflow.concat",
"tensorflow.nn.max_pool",
"tensorflow.reduce_sum",
"tensorflow.contrib.slim.separable_convolution2d",
"tensorflow.nn.conv1d",
"tensorflow.nn.conv2d",
"tensorflow.squeeze",
"tensorflow.truncated_normal_initializer",
"tensorflow.contrib.layers.xavier_initiali... |
arimakaoru/CameraSystem | [
"790170da9d0e3b3b8243d7abaccf510f052663fd"
] | [
"source/PointList.py"
] | [
"# https://qiita.com/otakoma/items/04e525ac74b7191dffe6 より参照\n\nimport sys\n\nimport numpy as np\nimport cv2\n\n\nclass PointList:\n def __init__(self, npoints=4):\n self.npoints = npoints\n self.ptlist = np.empty((npoints, 2), dtype=int)\n self.pos = 0\n self.named_points = {\"l_top\... | [
[
"numpy.copy",
"numpy.argmax",
"numpy.argmin",
"numpy.sum",
"numpy.empty"
]
] |
zju3dv/NIID-Net | [
"9d60cfd1b01873ddc15da167d8cbb90783408950"
] | [
"data/intrinsics/aligned_data_loader.py"
] | [
"import random\nimport numpy as np\nimport torch.utils.data\nfrom torch.utils.data.sampler import Sampler\nfrom data.intrinsics.base_data_loader import BaseDataLoader\nfrom data.intrinsics.image_folder import *\nimport scipy.io as sio\n# from builtins import object\nimport sys\nimport h5py\n\nclass IIWTestData(obje... | [
[
"numpy.asarray",
"numpy.array",
"scipy.io.loadmat",
"numpy.transpose"
]
] |
wtrenker/glucose-chart | [
"15f153415cfae6550fb6a2ff5c42646993fb3ad7"
] | [
"Chart.py"
] | [
"'''\nCopyright 2020 William Trenker\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http:www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to ... | [
[
"matplotlib.dates.DateFormatter",
"numpy.polyfit",
"numpy.poly1d",
"matplotlib.pyplot.title",
"matplotlib.use",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.gcf",
"numpy.concatenate",
"matplotlib.dates.date2num",
"matplotlib.dates.DayLocator"
]
] |
crmin/looord | [
"a7a0c5846ebdd62ecf9c62991b9ffce533a6bf25"
] | [
"looord/commands/functions.py"
] | [
"import os\n\nimport discord\nfrom numpy import random\n\nfrom commands import constants\nfrom commands.bot_status import get_num_command, get_num_chat, get_start_time, get_uptime\nfrom commands.crawler import r6stats, r6s_server\nfrom commands.define import commands, prefix\nfrom commands.utils import get_online_m... | [
[
"numpy.random.shuffle",
"numpy.random.choice"
]
] |
MohamedWaelBishr/Quran-Sentiment-Analysis | [
"c0f90da6b0afde307a36b8cbd32311eb76bc035b"
] | [
"Quran Analysis.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Oct 28 01:50:11 2019\r\n\r\n@author: Mohamed Wael Bishr\r\n\"\"\"\r\nimport numpy as np # linear algebra\r\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\nfrom textblob import ... | [
[
"matplotlib.pyplot.imshow",
"pandas.read_csv",
"matplotlib.pyplot.tight_layout",
"pandas.DataFrame",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure"
]
] |
LeviMatus/roleML | [
"80f5d37b171ed117eaa944da17fca69cc5b85512"
] | [
"roleml/roleml_tests.py"
] | [
"import unittest\nfrom sklearn.externals import joblib\nfrom roleml import roleml\n\n\nclass TestRoleML(unittest.TestCase):\n # This is a list of 50 tuples containing responses from match-v4.\n # Position 0 is the game, position 1 is its timeline, position 2 is the result\n games_timelines_results = joblib... | [
[
"sklearn.externals.joblib.load"
]
] |
iAmCorey/IMP | [
"d7e89a330c999ed3ed2885aeea99c5aa47980feb"
] | [
"mpdemo.py"
] | [
"# -*- coding: utf-8 -*-\n# written by mark zeng 2018-11-14\nfrom multiprocessing import Process, Queue\nimport time\nimport sys\nimport numpy as np\n\nN=10000\n\nclass Worker(Process):\n def __init__(self, inQ, outQ, random_seed):\n super(Worker, self).__init__(target=self.start)\n self.inQ = inQ\... | [
[
"numpy.random.seed",
"numpy.random.randint"
]
] |
AbdulSamadSethi/Intelligent-Personal-Trainer | [
"c6266cb4bfca9d12e09966b69e43ecd856134d21"
] | [
"DTW.py"
] | [
"import pandas as pd\r\nimport math\r\nimport numpy as np\r\n\r\nfrom dtaidistance import dtw\r\nfrom dtaidistance import dtw_visualisation as dtwvis\r\nimport random\r\n\r\ndf_expert = pd.read_csv('workout_coor/out_shoulderpress_expert.csv')\r\ndf_beginner = pd.read_csv('workout_coor/out_shoulderpress_beginner_v2.... | [
[
"numpy.asarray",
"pandas.read_csv"
]
] |
zelros/cinnamon | [
"9fbac281ed3ab2a1ce61fb48d845f3a6e97d1221"
] | [
"src/cinnamon/common/dev_utils.py"
] | [
"import sys\nimport numpy as np\n\n\ndef safe_isinstance(obj, class_path_str):\n # this function is copy-paste from the code of the SHAP Python library\n # Copyright (c) 2018 Scott Lundberg\n\n \"\"\"\n Acts as a safe version of isinstance without having to explicitly\n import packages which may not ... | [
[
"numpy.unique"
]
] |
MakowToms/GeneticTree | [
"c39288c7689a41e169bb876b1ee0aa7fac43d8ec"
] | [
"tests/set_up_variables_and_imports.py"
] | [
"from tree.tree import Tree, Observation\nfrom tree.builder import Builder, FullTreeBuilder\nfrom tree.forest import Forest\nfrom tree.crosser import TreeCrosser\n\nfrom sklearn import datasets\nimport numpy as np\nimport pytest\n\nfrom sklearn.utils._testing import assert_allclose\nfrom sklearn.utils._testing impo... | [
[
"numpy.random.RandomState",
"sklearn.datasets.load_iris"
]
] |
ECNU-ICA/ECNU-SenseMaker | [
"24f829c3dfefccea5fecbbe75904858ec1fefffb"
] | [
"optimizer.py"
] | [
"import math\nimport torch\nfrom torch.optim.optimizer import Optimizer\n\n\nclass Adam_GCC(Optimizer):\n \"\"\"\n 参考链接:https://zhuanlan.zhihu.com/p/128553061\n \"\"\"\n\n def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8,\n weight_decay=0, amsgrad=False):\n if not ... | [
[
"torch.mul",
"torch.zeros_like",
"torch.max"
]
] |
danielbraithwt/University | [
"50c6a904e1c53c03bce9928975607c35fd741e33"
] | [
"Undergraduate/COMP312/Assignment5/q5.py"
] | [
"\"\"\"(q3.py) M/M/c queueing system with monitor\n and multiple replications\"\"\"\n\nfrom SimPy.Simulation import *\nimport random\nimport numpy\nimport math\n\n## Useful extras ----------\ndef conf(L):\n \"\"\"confidence interval\"\"\"\n lower = numpy.mean(L) - 1.96*numpy.std(L)/math.sqrt(len(L))\n up... | [
[
"numpy.std",
"numpy.mean"
]
] |
alfredtorres/SRN-Pytorch | [
"fa9ece3d08bfddf05822815cfc62c946664cbcd7"
] | [
"pointnet2/data/data_utils.py"
] | [
"from __future__ import (\n division,\n absolute_import,\n with_statement,\n print_function,\n unicode_literals,\n)\nimport torch\nimport numpy as np\n\n\ndef angle_axis(angle, axis):\n # type: (float, np.ndarray) -> float\n r\"\"\"Returns a 4x4 rotation matrix that performs a rotation around a... | [
[
"numpy.random.random",
"numpy.eye",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin",
"torch.from_numpy",
"torch.matmul",
"numpy.random.randn",
"numpy.random.uniform",
"numpy.array",
"numpy.outer"
]
] |
Xtuden-com/motion_imitation | [
"d04b1d1cc59bcfb2781cb399f1a3aeec9b3b3562"
] | [
"motion_imitation/robots/minitaur.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Google Research 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 requ... | [
[
"numpy.multiply",
"numpy.asarray",
"numpy.matmul",
"numpy.full",
"numpy.random.normal",
"numpy.array",
"numpy.zeros"
]
] |
lleunyoungll/GAN_BallcounterBar | [
"c128214061b9cf294701d490dbbc8b831107072e"
] | [
"lib/model.py"
] | [
"\"\"\"GANomaly\n\"\"\"\n# pylint: disable=C0301,E1101,W0622,C0103,R0902,R0915\n\n##\nfrom collections import OrderedDict\nimport os\nimport time\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport torch.nn as nn\nimport torch.utils.data\nimport tor... | [
[
"numpy.random.seed",
"torch.nn.BCELoss",
"numpy.mean",
"numpy.array",
"torch.nn.L1Loss"
]
] |
The-Academic-Observatory/observatory-reports | [
"6b59f3e1950ba2ed69c37eb64b845f3224d52cbb"
] | [
"observatory-reports/observatory/reports/charts/output_types_time_chart.py"
] | [
"# Copyright 2020 Curtin University\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agr... | [
[
"matplotlib.pyplot.ylabel"
]
] |
lupalab/neural-statistician | [
"52d3c2447d02304c2aea66112a59fad8324c1687",
"52d3c2447d02304c2aea66112a59fad8324c1687"
] | [
"faces/facesmodel.py",
"omniglot/omninets.py"
] | [
"import os\nimport sys\nimport torch\n\nfrom facesnets import (SharedConvolutionalEncoder, StatisticNetwork, InferenceNetwork,\n LatentDecoder, ObservationDecoder)\nfrom torch.autograd import Variable\nfrom torch import nn\nfrom torch.nn import functional as F, init\ntry:\n from utils impor... | [
[
"torch.nn.init.calculate_gain",
"torch.cat",
"torch.randn",
"torch.exp",
"torch.nn.init.constant"
],
[
"torch.nn.BatchNorm1d",
"torch.ones",
"torch.nn.ConvTranspose2d",
"torch.cat",
"torch.zeros",
"torch.nn.Conv2d",
"torch.sum",
"torch.nn.Linear",
"torch... |
Miedema/MCNetwork | [
"daab1fe5880c47695c6e21124f99aa6b2589aba1"
] | [
"scripts/seperateFintess_2D.py"
] | [
"#!/usr/bin/python3\nfrom tools import *\nfrom sys import argv\nfrom os.path import join\n\nimport h5py\nimport matplotlib.pylab as plt\nimport numpy as np\n\n\n###################################################### see old version at the end (easier to understand, but less generalized and not using pca) ##########... | [
[
"numpy.sum",
"numpy.histogram",
"numpy.abs",
"numpy.min",
"numpy.linalg.inv",
"numpy.linalg.eig",
"numpy.meshgrid",
"numpy.max",
"numpy.cov",
"matplotlib.pylab.subplots",
"numpy.prod",
"numpy.array",
"numpy.zeros",
"matplotlib.pylab.close",
"numpy.histog... |
jmetzen/skgp | [
"5c5671a85d07cd1d4a66146a02327451ff992df0"
] | [
"examples/plot_gp_learning_curve.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nr\"\"\"\n==========================================================\nComparing different variants of squared exponential kernel\n==========================================================\n\nThree variants of the squared exponential covariance function are compared:\n ... | [
[
"matplotlib.pyplot.legend",
"numpy.random.random",
"matplotlib.pyplot.title",
"numpy.random.seed",
"numpy.min",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.plot",
"numpy.max",
"matplotlib.pyplot.ylabel",
"numpy.mean",
"matplotlib.pyplot.fill_between",
"matplotlib... |
Spiritdude/compas_slicer | [
"58dedfbebd123258506174453d5f73d18d745819"
] | [
"src/compas_slicer/pre_processing/preprocessing_utils/compound_target.py"
] | [
"import numpy as np\nimport math\nfrom compas.datastructures import Mesh\nimport compas_slicer.utilities as utils\nimport logging\nimport networkx as nx\nfrom compas_slicer.slicers.slice_utilities import create_graph_from_mesh_vkeys\nfrom compas_slicer.pre_processing.preprocessing_utils.geodesics import get_igl_EXA... | [
[
"numpy.max",
"numpy.array",
"numpy.min"
]
] |
Orthocenter/Real-time-GesRec | [
"81803a59a5d58e271e7b80cd193d51ab0088ec7d"
] | [
"datasets/jester.py"
] | [
"import torch\nimport torch.utils.data as data\nfrom PIL import Image\nfrom spatial_transforms import *\nimport os\nimport math\nimport functools\nimport json\nimport copy\nfrom numpy.random import randint\nimport numpy as np\nimport random\n\nfrom utils import load_value_file\n\n\ndef pil_loader(path, modality):\n... | [
[
"torch.cat"
]
] |
esw0116/Super-SloMo | [
"876f0f61b8365306cdadcde976c2ddc6a8e20bf8"
] | [
"save_deblurred_result.py"
] | [
"\n#[Super SloMo]\n##High Quality Estimation of Multiple Intermediate Frames for Video Interpolation\n\nimport argparse\n\nimport torch\nimport torchvision\nimport torchvision.transforms as transforms\nimport torch.optim as optim\nimport torch.nn as nn\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom mode... | [
[
"torch.load",
"torch.zeros_like",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
yxtj/henn | [
"5093f3e637ba0bb3e48c4f890b3b469c3617f2c5"
] | [
"heutil.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 4 18:43:10 2022\n\n@author: yanxi\n\"\"\"\nfrom hesign import sign\nimport numpy as np\n\n#%% sum\n\ndef sum_list(x):\n n = len(x)\n if n > 2:\n return sum_list(x[:n//2]) + sum_list(x[n//2:])\n else:\n return sum(x)\n \n\ndef avg_list(x... | [
[
"numpy.empty"
]
] |
Roasted-Ice/StegaStamp | [
"955426381b7d8be055532d225df8070423d5eac7"
] | [
"detector.py"
] | [
"import os,time,cv2, sys, math\nimport bchlib\nimport tensorflow as tf\nimport argparse\nimport numpy as np\nfrom tensorflow.python.saved_model import tag_constants\nfrom tensorflow.python.saved_model import signature_constants\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--detector_model', type=str,... | [
[
"numpy.rot90",
"tensorflow.Graph",
"numpy.sum",
"numpy.int32",
"numpy.ones",
"tensorflow.ConfigProto",
"numpy.argmax",
"numpy.diff",
"numpy.argmin",
"tensorflow.Session",
"numpy.cross",
"numpy.float32",
"numpy.roll",
"numpy.array",
"numpy.zeros",
"te... |
Res260/rlcard | [
"c0fc9fe70c4ec1c726e5e66b62866086491f5dbf"
] | [
"examples/uno_dqn.py"
] | [
"''' An example of learning a Deep-Q Agent on Dou Dizhu\n'''\n\nimport tensorflow as tf\n\nimport rlcard\nfrom rlcard.agents.dqn_agent import DQNAgent\nfrom rlcard.agents.random_agent import RandomAgent\nfrom rlcard.utils.utils import set_global_seed\nfrom rlcard.utils.logger import Logger\n\n# Make environment\nen... | [
[
"tensorflow.Variable",
"tensorflow.global_variables_initializer",
"tensorflow.Session"
]
] |
Sangeerththan/pythonDSA | [
"d126b3a7a8acc1e202107e20a21ed96fb4ab144e"
] | [
"Algorithms/DynamicProgramming/find-number-endless-points.py"
] | [
"import numpy as np\n\ndef countEndless(input_mat, n):\n row = np.zeros((n, n))\n col = np.zeros((n, n))\n for j in range(n):\n isEndless = 1\n for i in range(n - 1, -1, -1):\n if (input_mat[i][j] == 0):\n isEndless = 0\n col[i][j] = isEndless\n for i i... | [
[
"numpy.zeros"
]
] |
ellisztamas/amajus_mating | [
"9bfdb4ebaa96178c801e5fdd8aecb6b83132b397"
] | [
"002.library/python/tests/test_mcmc.py"
] | [
"import numpy as np\nimport os\nimport pandas as pd\nfrom scipy.stats import beta\nfrom scipy.stats import gamma as gma\n\nfrom amajusmating import mcmc\n\n# FAPS objects and distance matrices are generated in a separate script.\nexec(open('003.scripts/setup_FAPS_GPS.py').read())\n\n# INITIALISE THE MODEL\nnp.rando... | [
[
"scipy.stats.beta.pdf",
"pandas.read_csv",
"numpy.random.seed",
"scipy.stats.gamma.pdf"
]
] |
kinglintianxia/KittiSeg | [
"71cf15b8482fe7e18a98c711bb6ad96960467194"
] | [
"submodules/evaluation/kitti_devkit/seg_utils.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n# THE KITTI VISION BENCHMARK SUITE: ROAD BENCHMARK\n#\n# Copyright (C) 2013\n# Honda Research Institute Europe GmbH\n# Carl-Legien-Str. 30\n# 63073 Offenbach/Main\n# Germany\n#\n# UNPUBLISHED PROPRIETARY MATERIAL.\n# ALL RIGHTS RESERVED.\n#\n# Authors: Tobias Kuehnl... | [
[
"numpy.histogram",
"numpy.linspace",
"numpy.arange",
"numpy.flipud",
"numpy.cumsum",
"numpy.concatenate",
"numpy.mean",
"numpy.where",
"matplotlib.cm.get_cmap",
"numpy.zeros",
"numpy.sum"
]
] |
clatlan/bcdi | [
"afd50b474995378556195c007dc20316dcbc32af"
] | [
"tests/utils/test_image_registration.py"
] | [
"# -*- coding: utf-8 -*-\n\n# BCDI: tools for pre(post)-processing Bragg coherent X-ray diffraction imaging data\n# (c) 07/2017-06/2019 : CNRS UMR 7344 IM2NP\n# (c) 07/2019-05/2021 : DESY PHOTON SCIENCE\n# (c) 06/2021-present : DESY CFEL\n# authors:\n# Jerome Carnis, carnis_jerome@yahoo.fr\n\nim... | [
[
"numpy.allclose",
"numpy.asarray",
"numpy.arange",
"numpy.array",
"numpy.zeros"
]
] |
bjornwallner/alphafoldv2.1.0 | [
"d145e95d2f442578a2f5a60d816ee1742720b488"
] | [
"alphafold/common/protein.py"
] | [
"# Copyright 2021 DeepMind Technologies Limited\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 applic... | [
[
"numpy.unique",
"numpy.zeros_like",
"numpy.any",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
blekhmanlab/hominid | [
"caa1c4b3cf0f0502296fb043864d1a4d9d33549e"
] | [
"hominid/box_bar_plot.py"
] | [
"\"\"\"\nRead a rvcf file with stability selection scores for taxa.\nSort the dataframe by rsq_median.\nSave box and bar plots for the top N SNPs.\n\nNote: R must have packages dplyr and ggplot2 installed.\n\nI installed rpy2 with conda, which installs R in the virtual environment directory.\nIn my case that is ~/m... | [
[
"pandas.concat",
"pandas.read_csv"
]
] |
Jaswin09/Animefy | [
"5ea01be4866a77e8a25b5342606763a754f5c3f7"
] | [
"model.py"
] | [
"import cv2\nimport numpy as np\n\n'''def read_file(filename):\n img = cv2.imread(filename)\n cv2_imshow(img)\n return img'''\ndef color_quantization(img, k):\n# Transform the image\n data = np.float32(img).reshape((-1, 3))\n\n# Determine criteria\n criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITE... | [
[
"numpy.uint8",
"numpy.float32"
]
] |
collinwu/machine-learning-adventures | [
"c534f4157571cea8e015bc257caf5d5d500e692d"
] | [
"linear_regression_training/model/train_model.py"
] | [
"import pandas as pd\nfrom pathlib import Path\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import mean_absolute_error\nfrom sklearn.externals import joblib\n\nfilepath = Path.cwd() / \"machine-learning-adventures\" / \"linear_regress... | [
[
"pandas.read_csv"
]
] |
thematrixduo/MXGNet | [
"e48c34f74d7aeb1436931af553969ca666dad962"
] | [
"train_PGM.py"
] | [
"import os\nimport argparse\nimport itertools\n\nimport numpy as np\nimport math\nimport torch.optim as optim\nfrom torchvision import datasets,transforms\nimport torch.utils\nfrom model_PGM import Model\nfrom torch.utils.data import DataLoader\nimport torch.nn.utils\n\nfrom data_utility import ToTensor\n#For prepr... | [
[
"torch.utils.data.DataLoader"
]
] |
diehlpk/muDIC | [
"b5d90aa62267b4bd0b88ae0a989cf09a51990654"
] | [
"muDIC/tests/test_dic/test_imageReader.py"
] | [
"from unittest import TestCase\n\nimport numpy as np\n\nfrom muDIC.IO import ImageStack\nfrom muDIC.IO.image_stack import ImageReader\n\n\ndef read_image_mocked(path, rotate=False):\n return np.zeros((100, 100))\n\n\ndef find_file_names_mocked(type=\".png\"):\n return ['file' + str(i).zfill(2) + type for i in... | [
[
"numpy.zeros"
]
] |
emreakoz/capstone_app_TDI | [
"22bcc0ec701fbfdf71aaee18b0e07d0d28cec733"
] | [
"emotion_predictor.py"
] | [
"from network import network\nfrom PIL import Image\nimport numpy as np\nimport os\nimport shutil\nimport glob\n\ndef image_filtering(image_name):\n height, width = 128, 128\n im = np.empty(shape=(1,128,128,3))\n img = Image.open(image_name)\n img = img.resize((height, width), Image.ANTIALIAS)\n im[0... | [
[
"numpy.array",
"numpy.empty"
]
] |
TeamOfProfGuo/DANet | [
"65f7cda4599dbdb1e44a755eb6b2a723ec244322"
] | [
"experiments/acdnet_att3/train_check.py"
] | [
"###########################################################################\n# Created by: Hang Zhang\n# Email: zhang.hang@rutgers.edu\n# Copyright (c) 2017\n###########################################################################\n\nimport os, sys\nBASE_DIR = os.path.dirname(os.path.dirname(os.getcwd()))\nsys.... | [
[
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.nn.DataParallel",
"torch.cuda.is_available",
"torch.optim.SGD",
"torch.device",
"torch.cuda.device_count",
"torch.autograd.profiler.profile"
]
] |
matthewdmorse/SRMspinanalysis | [
"4f1161a2fd418347caf9e61ae83b40869f8157b0"
] | [
"SRMspinanalysis/solver.py"
] | [
"import numpy as np\nfrom scipy.interpolate import interp1d\nfrom scipy.integrate import odeint\n\ndef compute_moments(design_params, thrust_motor_1, thrust_motor_2):\n \"\"\"Computes moment vector given thrust information from each motor and\n specific design parameters.\n\n Args:\n design_params (... | [
[
"numpy.min",
"numpy.cos",
"scipy.integrate.odeint",
"numpy.sin",
"numpy.max",
"numpy.tan",
"scipy.interpolate.interp1d",
"numpy.array"
]
] |
mlds-lab/mFlow | [
"b206fd1034aa525469f396238f5c765fc2bcd91f"
] | [
"mFlow/Blocks/imputer.py"
] | [
"\nimport sys, os\nfrom mFlow.Workflow.compute_graph import node\n\nfrom sklearn.impute import SimpleImputer\nimport pandas as pd\nimport numpy as np\n\n\n\ndef Imputer(*args, **kwargs):\n return node(function = __Imputer, args=args, kwargs=kwargs, name=\"Imputer\")\n\ndef __Imputer(df, method=\"mean\", show=Fal... | [
[
"numpy.isnan",
"sklearn.impute.SimpleImputer",
"pandas.DataFrame"
]
] |
rhyswhitley/savanna_iav | [
"4eadf29a4e9c05d0b14d3b9c973eb8db3ea7edba",
"4eadf29a4e9c05d0b14d3b9c973eb8db3ea7edba"
] | [
"src/setup_model/create_validation_ncdf.py",
"src/data_preproc/pickleit/pickle_inputs.py"
] | [
"#!/usr/bin/env python2\n\nimport pandas as pd\nimport pickle\nimport os\n\ndef main():\n\n tower_data = pd.read_csv(FILEPATH, index_col=[0], parse_dates=True)\n\n tower_fluxes = tower_data.ix[:, [\"Fe\", \"Fe_Con\", \"GPP_Con\", \"Fre_Con\", \"Fc\", \"Fc_ustar\"]]\n\n with open(SAVEPATH, 'wb') as handle:\... | [
[
"pandas.read_csv"
],
[
"pandas.date_range"
]
] |
jlparkI/outlier_robust_polyfit | [
"59ef64c5ed7c92856435eaae748f38ca0a649ea4"
] | [
"setup.py"
] | [
"from setuptools import Extension, setup\nimport numpy as np\n\nwith open(\"README.md\", \"r\") as fhandle:\n long_description = fhandle.read()\n\nsetup(\n name=\"RobustPolyfit\",\n version=\"0.0.8.1\",\n author=\"Jonathan Parkinson\",\n description=\"Outlier-robust regression for pol... | [
[
"numpy.get_include"
]
] |
ehsteve/sunpy | [
"cd9859392d58cf86d6ea96cc8f4c065bce7fcc7b"
] | [
"sunpy/coordinates/ephemeris.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nEphemeris calculations using SunPy coordinate frames\n\"\"\"\nimport numpy as np\n\nfrom astropy.coordinates import (SkyCoord, get_body_barycentric,\n ICRS, HeliocentricEclipticIAU76)\nfrom astropy.coordinates.representation import CartesianRepresent... | [
[
"numpy.reshape",
"numpy.fabs"
]
] |
brunojacobs/ulsdpb | [
"7beff2e5f086d352258cd128430ec16ebfde7d53"
] | [
"expfam/wishart.py"
] | [
"# External modules\nimport numpy as np\n\n# Own modules\nfrom expfam.misc import log_det, log_mvar_gamma, mvar_digamma\n\n\n#\n# Parameter mappings\n#\n\n\ndef dim_from_concatenated_vector(v):\n \"\"\"Returns the value of K for a (1 + K*K)-vector.\"\"\"\n return int(np.sqrt(v.shape[0] - 1))\n\n\ndef concaten... | [
[
"numpy.hstack",
"numpy.sqrt",
"numpy.reshape",
"numpy.linalg.inv",
"numpy.ravel"
]
] |
gioxc88/scipy-dash | [
"f89abda475438ed28bedd4d0d877e0fc9c272b70"
] | [
"app/utils.py"
] | [
"from functools import wraps\n\nimport numpy as np\nimport pandas as pd\n\n\ndef dash_kwarg(inputs):\n def accept_func(func):\n @wraps(func)\n def wrapper(*args):\n input_names = [item.component_id for item in inputs]\n kwargs_dict = dict(zip(input_names, args))\n r... | [
[
"pandas.Series"
]
] |
kaeldai/sonata | [
"9f5d95748d0a83ca231d955f77f5a0257c58ce1d"
] | [
"examples/300_cells/build_network.py"
] | [
"import os\nimport numpy as np\n\nfrom bmtk.builder import NetworkBuilder\nfrom bmtk.builder.bionet import SWCReader\nfrom bmtk.utils.io.spike_trains import PoissonSpikesGenerator\nfrom bmtk.builder.auxi.node_params import positions_columinar, xiter_random\n\nbuild_recurrent_edges = True\n\nprint('Building internal... | [
[
"numpy.random.uniform",
"numpy.random.randint"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.