repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Lawhy/Multi-task-NMT | [
"d8e6a957f3d6e870172f6aa92e9871769d863244"
] | [
"mnmt/attention/additive_attention.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom mnmt.attention import Attention\r\n\r\n\r\nclass AdditiveAttention(Attention):\r\n \"\"\"Bahdanau Attention (mlp)\"\"\"\r\n\r\n def __init__(self, encoder_hidden_dim, decoder_hidden_dim):\r\n \"\"\"\r\n Args:\r\n ... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.functional.softmax"
]
] |
shivangigarg24/VQA_ReGAT | [
"9f6fe5bcda169c268eb1c92ef00df9f61d540081"
] | [
"dataset.py"
] | [
"\"\"\"\nCopyright (c) Microsoft Corporation.\nLicensed under the MIT license.\n\nThis code is modified by Linjie Li from Jin-Hwa Kim's repository.\nhttps://github.com/jnhwkim/ban-vqa\nMIT License\n\"\"\"\nfrom __future__ import print_function\nimport os\nimport json\nimport pickle\nimport numpy as np\nimport utils... | [
[
"torch.zeros",
"numpy.array",
"torch.FloatTensor",
"torch.from_numpy",
"torch.LongTensor"
]
] |
adamltyson/cellfinder | [
"b2e64220ee6f1659b8b3ac1ca9917edd95a28539"
] | [
"cellfinder/detect/filters/plane_filters/multiprocessing.py"
] | [
"import numpy as np\nfrom tifffile import tifffile\n\nfrom cellfinder.detect.filters.plane_filters.classical_filter import (\n enhance_peaks,\n)\nfrom cellfinder.detect.filters.plane_filters.tile_walker import TileWalker\n\n\nclass MpTileProcessor(object):\n def __init__(self, thread_q, ball_filter_q):\n ... | [
[
"numpy.clip"
]
] |
cthoyt-forks-and-packages/OMOP2OBO | [
"e7822f4c59d2ebfde3d3ae06603127a936e909af"
] | [
"omop2obo/utils/data_utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nData PreProcessing Utility Functions.\n\nPandas DataFrame manipulations\n* data_frame_subsetter\n* data_frame_supersetter\n* column_splitter\n* aggregates_column_values\n* data_frame_grouper\n* normalizes_source_codes\n\nDictionary manipulations\n* merge_di... | [
[
"pandas.merge",
"pandas.concat"
]
] |
whitead/hoomd-tf | [
"d0fae8aac17c5affa2a415f66fa99bb7cd2fc9b9",
"d0fae8aac17c5affa2a415f66fa99bb7cd2fc9b9"
] | [
"htf/test-py/test_sanity.py",
"htf/simmodel.py"
] | [
"# Copyright (c) 2020 HOOMD-TF Developers\nimport unittest\n\n\nclass test_imports(unittest.TestCase):\n def test_load_hoomd(self):\n import hoomd\n\n def test_load_htf(self):\n import hoomd.htf\n\n def test_load_tf(self):\n import tensorflow as tf\n\n\nclass test_op(unittest.TestCase)... | [
[
"tensorflow.compat.v1.disable_eager_execution",
"tensorflow.device"
],
[
"tensorflow.load_op_library",
"tensorflow.function",
"tensorflow.math.multiply_no_nan",
"tensorflow.reshape",
"tensorflow.gradients",
"tensorflow.zeros_like",
"tensorflow.greater",
"tensorflow.spar... |
JasperRice/NAO-G | [
"77d5671b5d62779fab51ed78f3dd97cbed7cc4ff"
] | [
"Code/human2robot/NAO.py"
] | [
"from copy import deepcopy\nfrom math import degrees\nfrom naoqi import ALProxy\nfrom sklearn.decomposition import PCA\nfrom sklearn.preprocessing import StandardScaler\nfrom torch import nn\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport torch\n\nfrom Human import HumanInterface... | [
[
"numpy.array",
"matplotlib.pyplot.plot",
"numpy.tile",
"numpy.degrees",
"numpy.hstack",
"numpy.linspace",
"pandas.read_csv"
]
] |
datamaterials/spyns | [
"68e8412ba003e2d882373db93f322497be7bff93"
] | [
"spyns/statistics.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom typing import List\n\nimport numpy as np\nimport pandas as pd\n\nfrom spyns.data import SimulationData\n\n\ndef compute_running_average(trace_df: pd.DataFrame, estimator_name: str) -> None:\n \"\"\"Compute running average for a series of estimator samples.\n\n :param trace_df:... | [
[
"numpy.linalg.norm",
"numpy.abs"
]
] |
newopscn/ottertune | [
"1d57ad99019b669dfbfd099bae031037c66e822d"
] | [
"server/website/website/utils.py"
] | [
"#\n# OtterTune - utils.py\n#\n# Copyright (c) 2017-18, Carnegie Mellon University Database Group\n#\n'''\nCreated on Jul 8, 2017\n\n@author: dvanaken\n'''\n\nimport json\nimport logging\nimport string\nfrom collections import OrderedDict\nfrom random import choice\n\nimport numpy as np\nfrom django.utils.text impo... | [
[
"numpy.median",
"numpy.arange",
"numpy.empty",
"numpy.unique"
]
] |
hndgzkn/dicodile | [
"799f3fe244609d4699109a42956bf1ab97778e6c"
] | [
"examples/plot_text.py"
] | [
"\"\"\"\nDiCoDiLe on text images\n=======================\n\nThis example illustrates pattern recovery on a noisy text image using\nDiCoDiLe algorithm.\n\n\"\"\" # noqa\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom dicodile import dicodile\nfrom dicodile.data.images import fetch_letters_pami\nfrom d... | [
[
"numpy.array",
"numpy.pad",
"numpy.random.default_rng",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"numpy.clip",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
aws-samples/reinvent2020-predict-anomaly-in-iot-systems | [
"ac40dbf7af19d44d8d6866108dc35035d9e20a53"
] | [
"iot_device_simulator/plotter.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas\nimport argparse\nimport io\nimport base64\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument('-f', '--file', required=True, type=str,\n help='Configuration file for this simulation')\n args = ... | [
[
"pandas.read_csv",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots"
]
] |
arks22/Mask_RCNN_filament | [
"34729158e8d83cc0eeebbbe65e38153e115362fc",
"34729158e8d83cc0eeebbbe65e38153e115362fc",
"34729158e8d83cc0eeebbbe65e38153e115362fc"
] | [
"sasaki20/plot_loss.py",
"sasaki17/filament.py",
"filament/filament_fix.py"
] | [
"import os\nimport sys\nfrom glob import glob\nimport numpy as np\nimport math\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\n\nimport collections as cl\nimport json\n\nargs = sys.argv\n\nif len(args) == 2:\n JSON_FILE = args[1]\nelif len(args) == 1:\n loss_log_dir = os.path.join(os.getcwd(), \"l... | [
[
"matplotlib.pyplot.subplots"
],
[
"numpy.around",
"numpy.array",
"numpy.stack",
"numpy.asfortranarray"
],
[
"numpy.around",
"numpy.array",
"numpy.stack",
"numpy.asfortranarray"
]
] |
joeybose/Equivariant-Discrete-Flows | [
"f350d6ce149a29a7a2a44ccdfb3445ba8426f617"
] | [
"energy.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch import optim\nfrom torch.utils.data import DataLoader, TensorDataset\nimport sklearn.datasets as datasets\n\nimport math\nimport os\nimport time\nimport argparse\nimport pprint\nfrom functools import partial\nimport ipdb\n\nimport mat... | [
[
"matplotlib.use",
"torch.no_grad",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"torch.tensor",
"torch.Tensor",
"torch.mean"
]
] |
davidliwei/mageck | [
"8ac6eea1d4bdb0d6e12b6124f8ab77254eaf6efe"
] | [
"mageck/crisprFunction.py"
] | [
"#!/usr/bin/env python\n\"\"\"MAGeCK test module\nCopyright (c) 2014 Wei Li, Han Xu, Xiaole Liu lab \nThis code is free software; you can redistribute it and/or modify it\nunder the terms of the BSD License (see the file COPYING included with\nthe distribution).\n@status: experimental\n@version: $Revision$\n@autho... | [
[
"scipy.stats.nbinom.logcdf",
"scipy.stats.nbinom.sf",
"scipy.stats.nbinom.cdf",
"scipy.stats.nbinom.logsf"
]
] |
junmokane/AI602_Project | [
"59c132ae04751f9fb6cf6ebb491042cbf4de003d"
] | [
"bear/examples/sac_uncertainty.py"
] | [
"import argparse\nimport gym\nimport d4rl\nimport numpy as np\n\nfrom rlkit.envs import ENVS\nimport rlkit.torch.pytorch_util as ptu\nfrom rlkit.data_management.env_replay_buffer import EnvReplayBuffer\nfrom rlkit.envs.wrappers import NormalizedBoxEnv\nfrom rlkit.launchers.launcher_util import setup_logger\nfrom rl... | [
[
"numpy.squeeze"
]
] |
raijinspecial/gpt-neox | [
"89749e0b76938fa1ff84a3dd1cbcbe64521d861b"
] | [
"gpt_neox/.ipynb_checkpoints/datasets-checkpoint.py"
] | [
"import torch\nfrom torch.utils.data import Dataset\nfrom .data_utils import get_tokenizer, natural_sort, skip, FixedSizeOrderedDict\nimport random\nimport glob\nimport tensorflow as tf\nimport re\nimport logging\nfrom itertools import cycle\nimport os\nimport subprocess\nimport simdjson as json\nimport hub\n\nclas... | [
[
"tensorflow.io.tf_record_iterator",
"tensorflow.data.TFRecordDataset",
"tensorflow.sparse.to_dense",
"tensorflow.io.parse_single_example",
"tensorflow.data.TextLineDataset",
"torch.tensor",
"tensorflow.io.VarLenFeature"
]
] |
fvilca/cnn_tensorflow_cifar | [
"b695605a02a4d8c639141660d2ca314cf1c01623"
] | [
"cifar10_train.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.train.NanTensorHook",
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.contrib.framework.get_or_create_global_step",
"tensorflow.Graph",
"tensorflow.gfile.Exists",
"tensorflow.app.flags.DEFINE_boolean",
"tensorflow.ConfigProto",
... |
jyshangguan/sgAstroTool | [
"05392b57848598655a1d2c52fd3b1f1392243575"
] | [
"sgALMA/uvdata.py"
] | [
"# The functions working on uv data.\n#\n#\nimport numpy as np\n\ndef average_uvdata(vis, datacolumn, uvbins, units=\"klambda\", axis=\"real\",\n tmp_key=\"DATA_DESC_ID=0\", verbose=False):\n \"\"\"\n Get the averaged uv data as a function of uv distance.\n Use visstat() in casa.\n\n P... | [
[
"numpy.array",
"numpy.sqrt",
"numpy.diff"
]
] |
rrodero83-python-projects/benford-law | [
"31c33597b7825f04d7b4c3682d8a6f41685d0e76"
] | [
"benford.py"
] | [
"import sys\nimport math\nfrom collections import defaultdict\nimport matplotlib.pyplot as plt\n\n# Benford's law percentages for leading digits 1-9\nBENFORD = [30.1, 17.6, 12.5, 9.7, 7.9, 6.7, 5.8, 5.1, 4.6]\n\n\ndef load_date(filename):\n \"\"\"Open a text file & return a list of strings.\"\"\"\n with open(... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
cbesaw/ccode_replace_python | [
"abef35b599bf7d5da5b8153aa74af84a0cb92f84"
] | [
"replace_ccode_country.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nClayton Thyne CCODE DOFILE \r\nTranslated to Python\r\nCreated on Fri Jan 26 11:44:25 2018\r\n\r\n@author: OEFDataScience\r\n\"\"\"\r\n\r\n#packages\r\nimport numpy as np\r\nimport re\r\n\r\n#functions\r\n\r\ndef clthyn_scrape(file_name):\r\n #extract ccode numbers in order\... | [
[
"numpy.where",
"numpy.asarray"
]
] |
lalvincz/CD4ML-Scenarios | [
"4cf61cb1d2ba5b0e955c7a0ba78273072f3b4af9"
] | [
"cd4ml/problems/problem_base.py"
] | [
"import json\nimport logging\nfrom pathlib import Path\nfrom time import time\n\nimport numpy as np\nfrom sklearn.metrics import confusion_matrix\n\nfrom cd4ml.feature_importance import get_feature_importance\nfrom cd4ml.get_encoder import get_trained_encoder\nfrom cd4ml.logger.fluentd_logging import FluentdLogger\... | [
[
"sklearn.metrics.confusion_matrix"
]
] |
EriChen0615/Gesture_Recognition | [
"850f24dc824b24597ad4fd8b8783263f6ca3942a"
] | [
"Detector/MtcnnDetector.py"
] | [
"import cv2\nimport time\nimport numpy as np\nimport sys\n\nsys.path.append(\"../\")\nfrom Detector.nms import py_nms\n\n\nclass MtcnnDetector(object):\n\n def __init__(self,\n detectors,\n min_face_size=20,\n stride=2,\n threshold=[0.6, 0.7, 0.7],\... | [
[
"numpy.array",
"numpy.zeros",
"numpy.round",
"numpy.where",
"numpy.vstack",
"numpy.hstack",
"numpy.expand_dims",
"numpy.maximum"
]
] |
SilenceX12138/Cheetah | [
"e20cb4e2623786d9dc7540e3252b8bbf7a0b2553"
] | [
"6-GAN/models/Generator.py"
] | [
"import torch.nn as nn\nfrom utils.model import weights_init\n\n\nclass Generator(nn.Module):\n \"\"\"\n Input shape: (N, in_dim)\n Output shape: (N, 3, 64, 64)\n \"\"\"\n def __init__(self, in_dim, dim=64):\n super(Generator, self).__init__()\n\n def dconv_bn_relu(in_dim, out_dim):\n ... | [
[
"torch.nn.Linear",
"torch.nn.Tanh",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d"
]
] |
radioactive11/pandas | [
"e250e0ba74c484df1f21403f0d339d3d7834f6cd",
"e250e0ba74c484df1f21403f0d339d3d7834f6cd"
] | [
"pandas/_testing/asserters.py",
"pandas/io/parsers/arrow_parser_wrapper.py"
] | [
"from __future__ import annotations\n\nfrom typing import cast\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs.lib import (\n NoDefault,\n no_default,\n)\nfrom pandas._libs.missing import is_matching_na\nimport pandas._libs.testing as _testing\n\nfrom pandas.core.dtypes.common import (\n is_boo... | [
[
"numpy.array",
"pandas.Index",
"pandas.core.dtypes.common.is_number",
"numpy.asarray",
"pandas._libs.testing.assert_almost_equal",
"pandas.core.dtypes.common.is_interval_dtype",
"pandas.core.dtypes.missing.array_equivalent",
"pandas.core.algorithms.safe_sort",
"pandas.core.dtyp... |
sebasgraciavalderrama/data-analysis | [
"85dddc36be3c1270a76821711cfbd03b07683413"
] | [
"Series/Pandas/DataFrames/DataInputOutput/data_input_output.py"
] | [
"import pandas as pd\nimport ssl\n\nssl._create_default_https_context = ssl._create_unverified_context\n\ndf_csv = pd.read_csv('example')\nprint(df_csv)\n\ndf_csv.to_csv('My_output', index=False)\n\ndf_excel = pd.read_excel('Excel_Sample.xlsx', sheet_name='Sheet1')\nprint(df_excel)\ndf_excel.to_excel('Excel_Sample2... | [
[
"pandas.read_csv",
"pandas.read_sql",
"pandas.read_html",
"pandas.read_excel"
]
] |
AaronCritchley/fastats | [
"3c8e50fffc08ee0dd44c615f4ed93adc47c08ffe"
] | [
"tests/linear_algebra/test_qr.py"
] | [
"\nfrom unittest import TestCase\n\nimport numpy as np\nfrom numpy.testing import assert_allclose\nfrom pytest import mark\n\nfrom fastats.core.ast_transforms.convert_to_jit import convert_to_jit\nfrom fastats.linear_algebra import qr, qr_classical_gram_schmidt\nfrom fastats.scaling.scaling import standard\nfrom te... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.eye",
"numpy.linalg.qr",
"numpy.diag"
]
] |
quantify-os/quantify-core | [
"748c29b374ed91f92c264be6ce6dd110f8f79842"
] | [
"tests/analysis/test_base_analysis.py"
] | [
"# pylint: disable=invalid-name # disabled because of capital SI in module name\n# pylint: disable=missing-module-docstring\n# pylint: disable=missing-class-docstring\n# pylint: disable=missing-function-docstring\nimport logging\nimport os\nfrom pathlib import Path\n\nimport lmfit\nimport numpy as np\nimport pytest... | [
[
"numpy.linspace",
"numpy.isnan",
"numpy.cos"
]
] |
vaibhav117/sim2real4real | [
"b1f253ef359eda0c7e3b594f89c8a35f0cf925bf"
] | [
"rl_modules/image_only_replay_buffer.py"
] | [
"import threading\nimport numpy as np\n\nclass image_replay_buffer:\n def __init__(self, env_params, buffer_size):\n self.env_params = env_params\n self.size = buffer_size\n self.T = env_params['max_timesteps']\n # memory management\n self.current_size = 0\n self.n_trans... | [
[
"numpy.concatenate",
"numpy.arange",
"numpy.random.randint",
"numpy.empty"
]
] |
natedileas/advent-of-code | [
"e7d7963162966651e599d9d8f5f770137111440b"
] | [
"2020/day10.py"
] | [
"\nINPUT = open('input10.txt').read()\n\n\nTEST1 = \"\"\"\n28\n33\n18\n42\n31\n14\n46\n20\n48\n47\n24\n23\n49\n45\n19\n38\n39\n11\n1\n32\n25\n35\n8\n17\n7\n9\n4\n2\n34\n10\n3\n\"\"\"\n\nTEST2 = \"\"\"\n16\n10\n15\n5\n1\n11\n7\n19\n6\n12\n4\n\"\"\"\n\nimport math\n\n\ndef combs(blocklen): \n # return blocklen\n ... | [
[
"numpy.asarray",
"numpy.diff"
]
] |
Singed-jj/lingvo | [
"a2a4ac8bd835ffc2f95fc38ee3e9bc17c30fcc56"
] | [
"lingvo/tasks/mt/data_augmenter.py"
] | [
"# Lint as: python2, python3\n# Copyright 2018 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/... | [
[
"numpy.isclose"
]
] |
isabella232/pearu-sandbox | [
"ece92fc2a6de19a21a9918196b1c34338a04e148",
"ece92fc2a6de19a21a9918196b1c34338a04e148"
] | [
"pygdf/pygdf/index.py",
"pygdf/pygdf/tests/test_serialize.py"
] | [
"# Copyright (c) 2018, NVIDIA CORPORATION.\n\nfrom __future__ import print_function, division\n\nimport pandas as pd\nimport numpy as np\nimport pickle\nfrom numba import cuda\n\nfrom . import cudautils, utils, columnops\nfrom .buffer import Buffer\nfrom .numerical import NumericalColumn\nfrom .column import Column... | [
[
"numpy.empty",
"numpy.dtype",
"pandas.RangeIndex"
],
[
"numpy.random.random",
"pandas.Categorical",
"numpy.random.randint",
"numpy.arange"
]
] |
AbhishekSalian/Dynamic-handwritten-digit-recognizer-using-IP-WEBCAM | [
"f4ab7cab0db969681c70571ac3485d440d8d57bf"
] | [
"digit_recognition.py"
] | [
"import numpy as np\r\nimport cv2 \r\nimport urllib.request\r\nfrom collections import deque\r\nfrom keras.models import load_model\r\ncen_pts = deque(maxlen=300)\r\n#Url should be written as provided by ip webcam.\r\n#(You can use your inbuilt camera feature also) but few lines of code will change)\r\n#Make sure y... | [
[
"numpy.round",
"numpy.array",
"numpy.zeros"
]
] |
xm83/MusicObjectDetector-TF | [
"984fbc754943c849c55a57923f4223099a1ff88c"
] | [
"research/learning_to_remember_rare_events/data_utils.py"
] | [
"# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"numpy.zeros",
"scipy.misc.imresize",
"tensorflow.gfile.GFile",
"scipy.ndimage.imread",
"tensorflow.app.run",
"scipy.misc.imrotate",
"numpy.unique"
]
] |
hpparvi/Parviainen-2017-WASP-80b | [
"e0d544e0815146acbb5f1bf97a950331c6e322da"
] | [
"src/lpfsd.py"
] | [
"import sys\nfrom copy import copy\nfrom itertools import chain\nfrom numpy import *\n\nfrom scipy.signal import medfilt as MF\nfrom scipy.stats import scoreatpercentile as sap\nfrom numpy.random import normal, seed\nfrom statsmodels.robust import mad\n\nfrom george.kernels import ConstantKernel, Matern32Kernel\n\n... | [
[
"numpy.random.seed",
"numpy.random.normal",
"scipy.signal.medfilt"
]
] |
charles-blouin/Servorobots | [
"c5839f96462a6fab9cfe6440a78cf545d29f933c"
] | [
"servorobots/network/agent_mlp.py"
] | [
"# This class is replicates the mlp type network only with tensorflow. It is useful for machines without baselines\n# installed (i.e. Raspberry Pi)\n\nimport tensorflow as tf\nimport time\nimport numpy as np\n\nclass AgentMLP:\n def __init__(self, weight_file, activation):\n weight_list = {}\n exec... | [
[
"tensorflow.constant",
"tensorflow.matmul",
"tensorflow.placeholder",
"numpy.asarray"
]
] |
winnerineast/torchgan | [
"fe86d7cf6cac9b6676aa43b56eabc6b4d583bbcf"
] | [
"torchgan/losses/wasserstein.py"
] | [
"import torch\n\nfrom .functional import (\n wasserstein_discriminator_loss,\n wasserstein_generator_loss,\n wasserstein_gradient_penalty,\n)\nfrom .loss import DiscriminatorLoss, GeneratorLoss\n\n__all__ = [\n \"WassersteinGeneratorLoss\",\n \"WassersteinDiscriminatorLoss\",\n \"WassersteinGradie... | [
[
"torch.rand",
"torch.randint",
"torch.randn"
]
] |
budh333/UnSilence_VOC | [
"3ba8f302f82df2d512d453c6b76dffb50d4f64db"
] | [
"src/services/plot_service.py"
] | [
"from matplotlib.figure import Figure\nimport pandas as pd\nfrom utils.math_utils import get_square, is_square\nfrom entities.plot.histogram_options import HistogramOptions\nfrom entities.plot.label_options import LabelOptions\nfrom entities.plot.figure_options import FigureOptions\nfrom enums.plot_legend_position ... | [
[
"numpy.max",
"matplotlib.lines.Line2D",
"sklearn.metrics.confusion_matrix",
"numpy.array",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.clf",
"numpy.min",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"nu... |
KingJMS1/MathIA | [
"aae37766424f06aa1c0cbb50d8d221ccb664bb9a"
] | [
"Game.py"
] | [
"import os\nimport scipy\nimport numpy as np\nfrom ImageStatistics import UsefulImDirectory\nimport scipy as sp\nimport ast\nfrom bokeh.charts import Histogram, show\nimport pandas as pd\n\nclass Game(object):\n def __init__(self, gamefolder):\n self.gamefolder = os.path.abspath(gamefolder)\n file ... | [
[
"scipy.stats.iqr",
"numpy.median",
"numpy.mean",
"numpy.std",
"numpy.var"
]
] |
LucasFidon/TRABIT_BraTS2021 | [
"5e950f57a8580356b0b4037477c5069113f3cf31"
] | [
"src/inference/inference.py"
] | [
"# Copyright 2021 Lucas Fidon and Suprosanna Shit\n\nimport os\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\nfrom monai.inferers import SlidingWindowInferer\nfrom monai.data import Dataset, DataLoader, NiftiSaver\nfrom monai.transforms import Zoomd, CenterSpatialCropd\nfrom src.networks.factor... | [
[
"torch.zeros",
"torch.device",
"numpy.pad",
"numpy.array",
"torch.nn.functional.softmax",
"numpy.minimum",
"numpy.sum",
"torch.no_grad",
"torch.nn.functional.interpolate",
"numpy.floor_divide",
"torch.cuda.empty_cache",
"torch.tensor",
"torch.load",
"scipy.n... |
baskaransri/jraph | [
"0e024737fb6abb55b7f9ce3d6dc641c1369b60d7"
] | [
"jraph/examples/e_voting.py"
] | [
"# Copyright 2020 DeepMind Technologies Limited.\n\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# https://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.sum",
"numpy.eye",
"numpy.random.randint"
]
] |
salu133445/muspy-exp | [
"71cbad589774728fbdc5ca4de4ebbbb52a7e22e3"
] | [
"word_language_model/cross_dataset_test.py"
] | [
"# coding: utf-8\nimport argparse\nimport math\nimport os\nimport sys\nimport time\nfrom pathlib import Path\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\n\nimport data\nimport model\n\nsys.path.append(\"/home/herman/git/muspy/\")\nimport muspy\n\nLOG_DIR = Pat... | [
[
"torch.nn.NLLLoss",
"torch.device",
"numpy.concatenate",
"torch.no_grad",
"numpy.ones",
"torch.manual_seed",
"torch.cuda.is_available",
"numpy.random.randint",
"torch.utils.data.DataLoader",
"torch.load",
"numpy.append"
]
] |
RuudKapteijn/ImageRecognition | [
"f4074d185f35077cad94544364af466b1adbf727"
] | [
"yolo.py"
] | [
"# image recognition with YOLO\r\n# Ruud Kapteijn 6-sep-21\r\n# download pretrained model from https://pjreddie.com/darknet/yolo/\r\n\r\nimport cv2 as cv\r\nimport numpy as np\r\nimport argparse\r\nimport time\r\nimport matplotlib.pyplot as plt\r\n\r\nyolo = cv.dnn.readNet(\"yolov3.weights\", \"yolov3.cfg\")\r\ncla... | [
[
"numpy.argmax"
]
] |
Jerimat/MITx-6.86-MachineLearning_EdX | [
"e454e0646cd923d689d3946ea2ff3432dec920ac"
] | [
"rl/utils.py"
] | [
"from string import punctuation, digits\r\nimport csv\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nimport sys\r\n\r\nif sys.version_info[0] < 3:\r\n PYTHON3 = False\r\nelse:\r\n PYTHON3 = True\r\n\r\n\r\ndef load_data(path_data):\r\n \"\"\"Return a dictionary for the state descriptions d... | [
[
"numpy.average",
"numpy.array",
"numpy.ones",
"numpy.arange"
]
] |
MachineLearningIsEasy/python_lesson_26 | [
"0368916ebf9a23d8cbd4f0cb6721c9c3a9d89ab8"
] | [
"django_test/articles/tests.py"
] | [
"from django.test import TestCase\nfrom faker import Faker\nfrom .models import Article, Tag\nfrom mixer.backend.django import mixer\n\nimport pandas as pd\n\n# Create your tests here.\n\n# faker https://faker.readthedocs.io/en/latest/index.html\n# mixer http://klen.github.io/mixer.html\n\n# class ArticleTestCase(T... | [
[
"pandas.read_csv"
]
] |
nkanungo/AIF360 | [
"9ffee3a4f12cb5dd8150d002a949c600d2c0f6d2"
] | [
"aif360/algorithms/inprocessing/prejudice_remover.py"
] | [
"# Original work Copyright 2017 Carlos Scheidegger, Sorelle Friedler, Suresh Venkatasubramanian\n# Modified work Copyright 2018 IBM Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the ... | [
[
"numpy.array",
"numpy.savetxt",
"pandas.DataFrame",
"numpy.loadtxt",
"numpy.column_stack"
]
] |
EnigmaCurry/moderngl-window | [
"1e149631bf901b5174067a925f9911b2b48896ec"
] | [
"moderngl_window/loaders/scene/gltf2.py"
] | [
"# Spec: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#asset\nimport base64\nimport io\nimport json\nimport logging\nimport struct\nfrom collections import namedtuple\n\nimport numpy\nfrom PIL import Image\nfrom pyrr import Matrix44, quaternion\n\nimport moderngl\nimport moderngl_wind... | [
[
"numpy.frombuffer"
]
] |
amitsadaphule/ray | [
"0b9fbc1c0f767e14b80e5bbf92b898ed6c9e1cff"
] | [
"python/ray/util/sgd/torch/torch_trainer.py"
] | [
"import numpy as np\nimport logging\nimport os\nimport numbers\nimport tempfile\nimport time\nimport torch\nimport torch.distributed as dist\n\nimport ray\nfrom ray.exceptions import RayActorError\nfrom ray.tune import Trainable\nfrom ray.tune.resources import Resources\nfrom ray.tune.utils.util import merge_dicts\... | [
[
"torch.distributed.is_available",
"torch.load"
]
] |
naszilla/naszilla | [
"e8fda9846660b2b4673c66fcdfecd46d0a5f4956"
] | [
"naszilla/nas_bench_101/mutations.py"
] | [
"\nimport copy\nimport numpy as np\nfrom nasbench import api\n\nINPUT = 'input'\nOUTPUT = 'output'\nCONV3X3 = 'conv3x3-bn-relu'\nCONV1X1 = 'conv1x1-bn-relu'\nMAXPOOL3X3 = 'maxpool3x3'\nOPS = [CONV3X3, CONV1X1, MAXPOOL3X3]\n\nNUM_VERTICES = 7\nOP_SPOTS = NUM_VERTICES - 2\nMAX_EDGES = 9\n\n\ndef adj_mutate(nasbench,\... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.random.rand"
]
] |
Charbel199/Oil-Spill-Thickness-Estimation | [
"dd600f6da611461f3b8072389bc34e6285109246"
] | [
"src/model/nn_model.py"
] | [
"from data.data_loader import DataLoader\nfrom model.base_model import Model\nimport tensorflow as tf\nfrom tensorflow import keras\nimport datetime\nfrom typing import List\nimport os\nimport numpy as np\nfrom sklearn.metrics import r2_score\n\n\nclass NNModel(Model):\n def __init__(self, data_loader: DataLoade... | [
[
"tensorflow.keras.callbacks.TensorBoard",
"numpy.mean",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.models.load_model",
"numpy.std",
"tensorflow.keras.models.Sequential",
"sklearn.metrics.r2_score",
"tensorflow.keras.optimizers.Adam"
]
] |
bomtuckle/pyrolite | [
"c0af0ade14ff26b4e9fdd5a033b27e73df085c55",
"c0af0ade14ff26b4e9fdd5a033b27e73df085c55",
"c0af0ade14ff26b4e9fdd5a033b27e73df085c55"
] | [
"docs/source/_patch/sphinx_gallery_scrapers.py",
"docs/source/gallery/data/refcomp.py",
"pyrolite/util/plot/grid.py"
] | [
"import re\r\nfrom pathlib import Path\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib import _pylab_helpers\r\nfrom pyrolite.util.plot import save_figure\r\n\r\nfrom sphinx_gallery import scrapers\r\n\r\ndef alt_matplotlib_scraper(block, block_vars, gallery_conf, **kwargs):\r\n \"\"\"... | [
[
"matplotlib._pylab_helpers.Gcf.get_all_fig_managers"
],
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
],
[
"numpy.array",
"numpy.nanmin",
"numpy.hstack",
"numpy.linspace",
"numpy.nanmax",
"numpy.meshgrid",
"numpy.vstack"
]
] |
cassiereuter/lenstronomy | [
"b2ae2b6d33c0f0e3c958bf5b58101aa430062dc7"
] | [
"test/test_LensModel/test_numeric_lens_differentials.py"
] | [
"__author__ = 'sibirrer'\n\nimport pytest\nimport numpy as np\nimport numpy.testing as npt\n\nfrom lenstronomy.LensModel.lens_model import LensModel\nfrom lenstronomy.Util import util\n\n\nclass TestNumerics(object):\n \"\"\"\n tests the source model routines\n \"\"\"\n def setup(self):\n self.le... | [
[
"numpy.testing.assert_almost_equal",
"numpy.zeros_like",
"numpy.linspace"
]
] |
jcarrano-eiwa/pyopencl | [
"3128eb275c662e2c365c745dc56d335dbddf7f7d"
] | [
"pyopencl/tools.py"
] | [
"\"\"\"Various helpful bits and pieces without much of a common theme.\"\"\"\n\nfrom __future__ import division, absolute_import\n\n__copyright__ = \"Copyright (C) 2010 Andreas Kloeckner\"\n\n__license__ = \"\"\"\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and ass... | [
[
"numpy.dtype"
]
] |
Shahdsaf/neural_cotraining | [
"72593d5030428736184279a0b6b39d448faf7602"
] | [
"neural_cotraining/models/vgg.py"
] | [
"import torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nfrom torchvision.models import vgg\nfrom torchvision.models.vgg import VGG as DefaultVGG\nfrom nntransfer.models.wrappers import *\nfrom torch.hub import load_state_dict_from_url\nfrom neural_cotraining.configs.model import ClassificationMod... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.nn.AdaptiveMaxPool2d",
"numpy.random.seed",
"torch.nn.Module.__init__",
"torch.manual_seed",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.hub.load_state_dict_from_url",
"torch.nn.AdaptiveAvgPool2d",
"torch.n... |
rmaphoh/AutoMorph | [
"0c82ce322c6cd8bd80f06bbd85c5c2542e534cb8"
] | [
"M3_feature_zone/retipy/retipy/tortuosity_measures.py"
] | [
"# Retipy - Retinal Image Processing on Python\n# Copyright (C) 2018 Alejandro Valdes\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your o... | [
[
"numpy.max",
"numpy.full",
"numpy.square",
"numpy.empty",
"numpy.log",
"numpy.zeros",
"numpy.sum",
"numpy.sign",
"scipy.interpolate.CubicSpline",
"numpy.where",
"numpy.arange",
"numpy.trapz",
"numpy.all",
"numpy.convolve"
]
] |
Mikata-Project/cloudperf | [
"ea5cc3994e0cee60b554fb6b6989cc508341354f"
] | [
"cloudperf/core.py"
] | [
"from __future__ import absolute_import\nimport os\nimport importlib\nimport pkgutil\nimport cloudperf.providers\nimport cachetools\nimport pandas as pd\n\nprices_url = 'https://cloudperf-data.s3-us-west-2.amazonaws.com/prices.json.gz'\nperformance_url = 'https://cloudperf-data.s3-us-west-2.amazonaws.com/performanc... | [
[
"pandas.read_json"
]
] |
MGheini/unify-parameter-efficient-tuning | [
"3222ce2c0079566a28043e22380eb4ab6ad14389"
] | [
"tride/scripts/visualize_hid.py"
] | [
"import json\nimport argparse\nimport os\nimport time\nimport torch\nimport numpy as np\n\nfrom scipy.spatial.distance import cosine\nfrom sklearn.preprocessing import scale\nfrom sklearn.linear_model import LogisticRegression\n\nimport chart_studio\nimport chart_studio.plotly as py\n\nimport plotly.io as pio\nimpo... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.reshape",
"numpy.zeros",
"numpy.random.seed",
"numpy.memmap",
"scipy.spatial.distance.cosine",
"torch.load",
"numpy.clip"
]
] |
jdherman/evolutionary-algorithms-course | [
"1632298de66c2e27afd1be1c538da040a2d97dcf"
] | [
"L2-gradient-scipy.py"
] | [
"import numpy as np \nimport matplotlib.pyplot as plt\nfrom scipy.optimize import minimize\n\n# function\ndef f(x):\n return 2*x[0]**2 + 10*x[1]**2\n\n# gradient (normalized)\ndef fp(x):\n fx1 = 4*x[0]\n fx2 = 20*x[1]\n # mag = np.sqrt(fx1**2+fx2**2)\n return np.array([fx1, fx2])\n\nx0 = [3,3]\nres = minimize(... | [
[
"numpy.array",
"scipy.optimize.minimize"
]
] |
imgreenbird/QUANTAXIS | [
"88eac434135a92cd64bd035cd844b34020729747"
] | [
"QUANTAXIS/QAData/base_datastruct.py"
] | [
"# coding:utf-8\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016-2018 yutiansut/QUANTAXIS\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including withou... | [
[
"pandas.to_datetime",
"pandas.Timestamp",
"numpy.asarray"
]
] |
bullgom/pysnn2 | [
"dad5ae26b029afd5c5bf76fe141249b0f7b7a36c"
] | [
"nu/v2/Synapses/LearningRules/RSTDP.backup.20201018.py"
] | [
"import numpy as np\nfrom .....Ports import NEUROMODULATORS, AP, BP, ARRIVE\nfrom pydesim import Errors\nimport math\nclass RSTDP:\n \"\"\"\n negative dw when dt < 0 using STDP rule\n positive dw when dt > 0 using RSTDP rule\n\n Use small An value\n \"\"\"\n\n def __init__(\n self,\n ... | [
[
"numpy.exp"
]
] |
cebudding/Lab_Rotation_1 | [
"5a731c9bef3a5b86436c1f1ceab2b8eb04b243a4"
] | [
"utils.py"
] | [
"import torch\nfrom scipy.ndimage import zoom\nfrom sklearn.model_selection import train_test_split\nimport jrieke.datasets as datasets\nimport numpy as np\n\n\ndef pprint(*args):\n out = [str(argument) + \"\\n\" for argument in args]\n print(*out, \"\\n\")\n\n\nclass Flatten(torch.nn.Module):\n def __init... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.ceil",
"numpy.zeros",
"sklearn.model_selection.train_test_split",
"scipy.ndimage.zoom",
"numpy.unique",
"numpy.floor"
]
] |
zhaoshiying97/trading_gym | [
"d4af8d724efa17420e6ebb430f6f9d4f08c6f83a"
] | [
"trading_gym/envs/portfolio_gym/data_generator.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pdb\n\nclass DataGeneratorDF(object):\n \"\"\"input is a DataFrame with MultiIndex, considering Panal data structure is depreciated after pandas=0.24\"\"\"\n \n def __init__(self, data_df, sequence_window=2, add_cash=False, risk_free_return=0.0001):\n ... | [
[
"pandas.concat",
"pandas.DataFrame",
"pandas.MultiIndex.from_tuples",
"pandas.Series"
]
] |
kf7lsu/exatrkx-neurips19 | [
"d5495966282112daabc03999d851ea3374aa2087"
] | [
"gnn-tracking/scripts/make_graph_module.py"
] | [
"import graph_nets as gn\r\nimport sonnet as snt\r\nimport networkx as nx\r\nimport numpy as np\r\nimport setGPU\r\n\r\nimport tensorflow as tf\r\ntf.compat.v1.set_random_seed(42)\r\nfrom graph_nets import utils_np, utils_tf\r\n\r\nfrom heptrkx import load_yaml\r\nfrom heptrkx import master\r\n\r\nimport os\r\nimpo... | [
[
"numpy.random.choice",
"numpy.asarray",
"tensorflow.reset_default_graph",
"numpy.load",
"tensorflow.Session",
"numpy.arange",
"numpy.abs",
"tensorflow.compat.v1.set_random_seed",
"tensorflow.global_variables_initializer",
"numpy.isin"
]
] |
mozga-intel/incubator-mxnet | [
"7dcfedca704f39b4b9b7497dabf3fea47ad40df4"
] | [
"python/mxnet/numpy/multiarray.py"
] | [
"#!/usr/bin/env python\n\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 licenses this file\n# to you under the Apache License, Version 2.... | [
[
"numpy.array",
"numpy.issubdtype",
"numpy.dtype",
"numpy.clip"
]
] |
york-stsci/STScI-STIPS-1 | [
"16c439fcea22b2768d462b3e375257f0f050c26a"
] | [
"stips/instruments/nircam.py"
] | [
"from __future__ import absolute_import, division\n__filetype__ = \"detector\"\n\n#External Modules\nimport os\n\nimport numpy as np\n\nfrom astropy.io import fits as pyfits\n\n#Local Modules\nfrom ..astro_image import AstroImage\nfrom .instrument import Instrument\nfrom .jwst_instrument import JwstInstrument\nfrom... | [
[
"numpy.ceil",
"numpy.sqrt"
]
] |
sriharshav/instr | [
"e864d37280c2db236529934bb0f62b8b7ed7488a"
] | [
"tests/test_subpixel_corr.py"
] | [
"\"\"\"\nSimple test case for testing the grid sampling in the subpixel correlation layer compared to conventional shifting.\n\"\"\"\n\nfrom unittest import TestCase\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom model.subpixel_corr import SubpixelCorrelation\n\n\nclass TestSubpixelCo... | [
[
"torch.mul",
"torch.eq",
"torch.abs",
"torch.nn.functional.pad",
"torch.empty",
"torch.randn"
]
] |
MolSSI-SSS/QM_2017_SSS_Team5 | [
"fafb1e74eef430cefcb73a3b22be890555525259"
] | [
"project/mp2.py"
] | [
"\"\"\"\nMP2\n\"\"\"\nimport time\nimport numpy as np\nimport psi4\n\n\ndef mp2(mol, basis=\"aug-cc-pvdz\", ):\n\n print('\\nStarting MP2...')\n # Memory for Psi4 in GB\n psi4.set_memory('2 GB')\n psi4.core.set_output_file('output.dat', False)\n\n # Memory for numpy in GB\n numpy_memory = 2\n\n ... | [
[
"numpy.einsum"
]
] |
sot/Ska.Matplotlib | [
"8411edb091fceec2676a6c92943e490df51738ce"
] | [
"bin/histtest.py"
] | [
"#!/usr/bin/env python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nimport numpy as np\nfrom matplotlib import pylab\nfrom Ska.Matplotlib import hist_outline\n\nif __name__ == \"__main__\":\n binsIn = np.arange(0, 1, 0.1)\n angle = pylab.rand(50)\n\n pylab.subplot(121)\n pylab.his... | [
[
"matplotlib.pylab.axis",
"matplotlib.pylab.show",
"matplotlib.pylab.hist",
"matplotlib.pylab.subplot",
"numpy.arange",
"matplotlib.pylab.rand",
"matplotlib.pylab.plot",
"matplotlib.pylab.title"
]
] |
fsImageries/video-to-pose3D | [
"098c87ce19dc3331da03e6eac0b9744684eb66f6"
] | [
"joints_detectors/Alphapose/SPPE/src/models/hg-prm.py"
] | [
"import torch.nn as nn\n\nfrom torch.autograd import Variable\nfrom collections import defaultdict\nfrom .layers.PRM import Residual as ResidualPyramid\nfrom .layers.Residual import Residual as Residual\n\nfrom common.arguments import sppe_args\n\nopt = sppe_args()\n\n\nclass Hourglass(nn.Module):\n def __init__... | [
[
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.UpsamplingNearest2d"
]
] |
jeromewu/tensorflow | [
"c2167a7a5c99498d26d0cf4d63b5f85f446a813a"
] | [
"tensorflow/python/ops/gradients_test.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.variables.Variable",
"numpy.testing.assert_allclose",
"tensorflow.python.ops.array_ops.identity",
"numpy.dot",
"numpy.random.rand",
"tensorflow.python.ops.variable_scope.variable_scope",
"tensorflow.python.ops.math_ops.matmul",
"tensorflow.python.ops.array_op... |
shishank2311/Handwritten-Digit-and-Character-recognition | [
"ceb86fbb3922e623fe4e37be3688ab792927a78e"
] | [
"Project/testing_function.py"
] | [
"import numpy as np\r\nimport tensorflow as tf\r\nimport cv2\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\n\r\nfrom tensorflow.keras.models import load_model\r\nmodel = load_model('saved_model')\r\n\r\n\r\ndef get_prediction(img):\r\n\r\n # checking is the images is database image of real life image... | [
[
"tensorflow.keras.utils.normalize",
"numpy.array",
"matplotlib.pyplot.title",
"tensorflow.keras.models.load_model",
"numpy.argmax",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
sydnimeyer/PFCH-Final-2021 | [
"fdc3b399f405d8929a37d39d96e2c686ef03e401"
] | [
"ArticleKeywordsYear1.py"
] | [
"import xml.etree.ElementTree as etree\nimport pandas as pd\n\ndata = []\n\ntree = etree.parse('/Users/sydnimeyer/Downloads/metadata/journal-article-10.13169_worlrevipoliecon.8.4.0542.xml')\nroot = tree.getroot()\nkeywords = []\n\n#creating structure for Pandas dataframe\ndf_cols = ['publication year', 'keywords']\... | [
[
"pandas.DataFrame"
]
] |
phoenix-meadowlark/aqt | [
"74fa7c71c6761ed03d2251bbf551ed667619c4ac"
] | [
"jax/get_bounds_test.py"
] | [
"# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.std",
"numpy.testing.assert_allclose",
"numpy.testing.assert_array_equal",
"numpy.mean"
]
] |
chstetco/assistive-gym | [
"cc797c86051ed4d09688d60ce9f378b884547264"
] | [
"assistive_gym/envs/scratch_itch_mesh.py"
] | [
"import os\nfrom gym import spaces\nimport numpy as np\nimport pybullet as p\n\nfrom .scratch_itch import ScratchItchEnv\n\nclass ScratchItchMeshEnv(ScratchItchEnv):\n def __init__(self, robot, human):\n super(ScratchItchMeshEnv, self).__init__(robot=robot, human=human)\n self.general_model = True\... | [
[
"numpy.deg2rad",
"numpy.array",
"numpy.zeros"
]
] |
paulWegiel/BiorbdOptim | [
"317b58283c7bff3f7b89eebc286b6bd74294ffe5"
] | [
"examples/q_tracking_constraint/hand_spinning.py"
] | [
"import numpy as np\nimport biorbd\n\nfrom biorbd_optim import (\n Instant,\n OptimalControlProgram,\n ConstraintList,\n Constraint,\n ObjectiveList,\n Objective,\n DynamicsTypeList,\n DynamicsType,\n BoundsList,\n QAndQDotBounds,\n InitialConditionsList,\n ShowResult,\n State... | [
[
"numpy.linspace"
]
] |
CCInc/laspy | [
"999306c92162fe6e4376960ac5b4df4368d5c3c7"
] | [
"tests/test_mmap.py"
] | [
"import numpy as np\n\nimport laspy\n\n\ndef test_mmap(mmapped_file_path):\n with laspy.mmap(mmapped_file_path) as las:\n las.classification[:] = 25\n assert np.all(las.classification == 25)\n\n las = laspy.read(mmapped_file_path)\n assert np.all(las.classification == 25)\n"
] | [
[
"numpy.all"
]
] |
jeremym-cfd/glmtools | [
"0fa419d156da5965301412ccb8b5960109357d77"
] | [
"glmtools/test/test_flash_grouping.py"
] | [
"import numpy as np\n\nfrom numpy.testing import assert_equal\n\nfrom .common import get_test_dataset\n \ndef test_flash_id_sanity():\n glm, flash_ids = get_test_dataset()\n \n # Make sure the flash IDs returned are the same as the flash IDs requested\n fls = glm.get_flashes(flash_ids)\n assert_eq... | [
[
"numpy.unique",
"numpy.testing.assert_equal"
]
] |
mlc2307/pyradio | [
"94b3705faea4d019f3f62efb49aa4f502c1a556e"
] | [
"modules/modulator/modulator.py"
] | [
"from __future__ import annotations\n\nfrom typing import Union\n\nfrom scipy.signal import firwin\n\nfrom nptyping import Array\n\nimport numpy as np\n\nfrom modules.audio.settings import CHANNELS, FRAME_RATE\n\nfrom modules.modulator.constants import AM, AM_SC, NO_MOD\n\nfrom modules.modulator.error import (Inval... | [
[
"numpy.divide",
"numpy.add",
"numpy.frombuffer",
"numpy.multiply",
"numpy.abs",
"numpy.cos",
"numpy.convolve"
]
] |
frenkiboy/perceiver-pytorch | [
"b07d5154c5dee63684c59f57d02a1b405701845f"
] | [
"perceiver_pytorch/multi_modality_perceiver.py"
] | [
"from typing import Iterable, Dict, List\n\nimport torch\nfrom einops import rearrange, repeat\nfrom torch import Tensor\nfrom torch import nn\nfrom torch.nn import Identity\n\nfrom perceiver_pytorch.caching import cache_by_name_fn\nfrom perceiver_pytorch.modalities import InputModality, modality_encoding\nfrom per... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.nn.LayerNorm",
"torch.nn.Identity",
"torch.nn.ModuleList",
"torch.linspace",
"torch.meshgrid",
"torch.randn"
]
] |
LucasBoTang/Piecewise_Affine_Fitting | [
"159cf40b8abaefc3725540b39a4dc58258213f06"
] | [
"heuristics.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\nimport numpy as np\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import mean_squared_error\nimport networkx as nx\nimport utils\n\ndef solve(image, lambd):\n \"\"\"\n region fusion for piecewise regression\n \"\"\"\n # build graph wit... | [
[
"numpy.concatenate",
"numpy.array",
"sklearn.metrics.mean_squared_error",
"numpy.linalg.norm",
"sklearn.linear_model.LinearRegression",
"numpy.zeros",
"numpy.unique"
]
] |
Uppaal/LISA | [
"231cac75bdc4a64c465ad84e1edd1363c49606f0"
] | [
"src/util.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport os\nimport sys\n\n\ndef fatal_error(message):\n tf.logging.log(tf.logging.ERROR, message)\n sys.exit(1)\n\n\ndef init_logging(verbosity):\n tf.logging.set_verbosity(verbosity)\n tf.logging.log(tf.logging.INFO, \"Using Python version %s\" % sys.version)\n tf.... | [
[
"numpy.max",
"tensorflow.logging.set_verbosity",
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"tensorflow.logging.log",
"numpy.std",
"numpy.arange"
]
] |
mxnno/protoinfomax | [
"2de70a10058e5433a543624b5ce907802dd33d68"
] | [
"models/model_imax_kw_sentiment.py"
] | [
"import os\nimport sys\nsys.path.append(os.getcwd())\nimport torch\nfrom torch import nn\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\"... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.GRU",
"torch.bmm",
"torch.ones",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.Tensor",
"torch.nn.Embedding",
"torch.zeros",
"torch.max",
... |
HazyResearch/models | [
"7027d1c4e730c20d2de94998302227f23c5e19f7",
"7027d1c4e730c20d2de94998302227f23c5e19f7"
] | [
"inception/inception/compute_group_optimizer.py",
"inception/inception/slim/inception_model.py"
] | [
"# Copyright 2016 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.math_ops.less",
"tensorflow.python.ops.math_ops.unsorted_segment_sum",
"tensorflow.python.ops.array_ops.unique",
"tensorflow.python.ops.math_ops.reduce_sum",
"tensorflow.python.framework.ops.device",
"tensorflow.python.framework.ops.control_dependencies",
"tensor... |
kareido/pytorl | [
"2f2f5258425166b8bfbde985a229fecdef3752d9"
] | [
"pytorl/networks/ctrl_mlp.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass Q_MLP(nn.Module):\n \"\"\"\n simple mlp for 1-D observation input from envs like\n CartPole-v1 etc.\n \n Args:\n input_size: a 2-D tuple or equivalent Iterable, indicating the size \n of input, i.e, the... | [
[
"torch.nn.Linear"
]
] |
GKeppler/ST-PlusPlus | [
"5928c88caa04bb7d1399c527d5beeaab39a4f993"
] | [
"model/semseg/deeplabv3plus.py"
] | [
"from model.semseg.base import BaseNet\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nimport pytorch_lightning as pl\n\n\nclass DeepLabV3Plus(BaseNet):\n def __init__(self, backbone, nclass, args=None):\n super(DeepLabV3Plus, self).__init__(backbone, nclass, args)\n\n low_l... | [
[
"torch.cat",
"torch.nn.Dropout",
"torch.nn.BatchNorm2d",
"torch.nn.functional.interpolate",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Dropout2d"
]
] |
NoNameAC/TEGNet | [
"c6ac72cacd71bd0be18c48cb48127c98fae9352a"
] | [
"mitbin_test.py"
] | [
"import torch\nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport sys\nfrom dataset import MitbinDataset\nfrom model import TCN\nimport numpy as np\nimport argparse\nfrom collections import defaultdict\nfrom sklearn.metrics import roc_auc_score\nfrom sklearn.me... | [
[
"numpy.array",
"sklearn.metrics.precision_recall_curve",
"torch.autograd.Variable",
"torch.no_grad",
"sklearn.metrics.accuracy_score",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.utils.data.DataLoader",
"sklearn.metrics.auc",
"torch.nn.fun... |
DataMedSci/ProtonBeamsComposer | [
"5010b2ca79e3490b0d5fc884a5b40bc9342560e7"
] | [
"pbc/helpers.py"
] | [
"from os import mkdir, listdir, getcwd\nfrom os.path import join\nimport datetime\n\nimport numpy as np\n\n\ndef calculate_number_of_peaks_gottschalk_80_rule(peak_to_measure, spread):\n \"\"\"\n Calculate number of peaks optimal for SOBP optimization\n on given spread using Gottschalk 80% rule.\n \"\"\"... | [
[
"numpy.ceil",
"numpy.savetxt",
"numpy.loadtxt",
"numpy.arange",
"numpy.abs",
"numpy.column_stack"
]
] |
undeadinu/open_model_zoo | [
"db4757112bfe3bd66ad4977fcfec08a55ef02d1f"
] | [
"demos/python_demos/accuracy_checker/tests/test_preprocessor.py"
] | [
"\"\"\"\n Copyright (c) 2018 Intel Corporation\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law ... | [
[
"numpy.all",
"numpy.zeros",
"numpy.full_like"
]
] |
iossifovlab/gpf | [
"e556243d29666179dbcb72859845b4d6c011af2b"
] | [
"dae/dae/utils/tests/test_variant_utils.py"
] | [
"import pytest\n\nfrom typing import List, Union\n\nimport numpy as np\n\nfrom dae.utils.variant_utils import get_locus_ploidy, reverse_complement, \\\n gt2str, str2gt\nfrom dae.variants.attributes import Sex\n\n\nchroms: List[Union[int, str]] = list(range(1, 23))\nchroms.append(\"Y\")\n\ntest_data = [\n (str... | [
[
"numpy.all",
"numpy.array"
]
] |
Varun487/Raspberry_pI_facial_recognition | [
"1c95334bc4af33db73654206df90e0d947ed3211"
] | [
"RPI_face_recognition/face_recog.py"
] | [
"import face_recognition as fr\r\nimport os\r\nimport cv2\r\nimport face_recognition\r\nimport numpy as np\r\nfrom time import sleep\r\nimport os\r\n\r\ndef get_encoded_faces():\r\n \"\"\"\r\n looks through the faces folder and encodes all\r\n the faces\r\n\r\n :return: dict of (name, image encoded)\r\n... | [
[
"numpy.argmin"
]
] |
rileystephens28/crypto_accountant | [
"366ee8ee3b96e1edfb9dd94a3cf85b0edafa707b"
] | [
"tests/factories.py"
] | [
"import uuid\nimport random\nimport pandas as pd\nfrom datetime import datetime, timedelta\nfrom randomtimestamp import randomtimestamp\nfrom src.crypto_accountant.utils import check_type\nfrom src.crypto_accountant.position import Position\nfrom src.crypto_accountant.transactions.buy import Buy\nfrom src.crypto_ac... | [
[
"pandas.DataFrame",
"pandas.date_range"
]
] |
srivastavaanuj11/Feedback-using-Pose-Estimation | [
"b6e019b6d2e1bd6aea72de6fa4bea649d6d8aef3"
] | [
"tf_pose/network_base.py"
] | [
"from __future__ import absolute_import\n\nimport sys\n\nimport abc\nimport numpy as np\nimport tensorflow as tf\n\nimport tensorflow.contrib.slim as slim\n\n\nfrom tf_pose.common import to_str\nfrom tf_pose import common\n\nDEFAULT_PADDING = 'SAME'\n\n\n_init_xavier = tf.contrib.layers.xavier_initializer()\n_init_... | [
[
"tensorflow.image.resize_bilinear",
"tensorflow.constant_initializer",
"tensorflow.nn.conv2d",
"tensorflow.contrib.layers.xavier_initializer",
"numpy.load",
"tensorflow.reshape",
"tensorflow.nn.softmax",
"tensorflow.nn.avg_pool",
"tensorflow.divide",
"tensorflow.shape",
... |
boangri/neural-network | [
"6cc8f5432f3f9d1a5a1ae01857337d07ff92c574"
] | [
"neural/neuralNetwork.py"
] | [
"import numpy\nimport scipy.special\n\nclass neuralNetwork:\n '''\n Simple neural network\n '''\n def __init__(self, inputnodes, hiddennodes, outputnodes, learningrate):\n self.inodes = inputnodes\n self.hnodes = hiddennodes\n self.onodes = outputnodes\n self.lr = learningrat... | [
[
"numpy.array",
"numpy.dot",
"numpy.transpose"
]
] |
Ayrtonfoster/365_Project | [
"68640ebaa9692d4701dcc412f3db20b2f72979e5"
] | [
"Uber.py"
] | [
"#This is the start of my Uber 365 major project, lets hope it goes well!\n#11/03/18\n#Ayrton Foster \n\n\nimport math\nimport random\nimport sys\n#Start uber!\nfrom collections import namedtuple\nfrom random import randint\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom tqdm impor... | [
[
"pandas.read_csv"
]
] |
blockchainunam/identity | [
"e70316f619a9f9e247a544f9ea4ad2fff069e74d"
] | [
"openface/torch_neural_net.py"
] | [
"# Copyright 2015-2016 Carnegie Mellon 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 appli... | [
[
"numpy.array"
]
] |
ada-shen/icCNN | [
"2f57cbedaf372ccf2903eac704dbfb6b4f051a83"
] | [
"densenet_iccnn_multi_train.py"
] | [
"import re\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.checkpoint as cp\nfrom collections import OrderedDict\nfrom torch import Tensor\nfrom torch.jit.annotations import List\n\n#added\nimport torchvision.transforms as transforms\nfrom torch.utils.data import DataLoader... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.optim.lr_scheduler.StepLR",
"torch.nn.BatchNorm2d",
"torch.nn.init.kaiming_normal_",
"numpy.mean",
"torch.jit.is_scripting",
"torch.load",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel",
"numpy.concatenate",
"torch.nn.ini... |
sreev/lale | [
"ac2cbf95d95a7c83d7326fa6ac11b4678c349ff7",
"ac2cbf95d95a7c83d7326fa6ac11b4678c349ff7"
] | [
"lale/lib/autogen/passive_aggressive_regressor.py",
"lale/lib/autogen/gradient_boosting_classifier.py"
] | [
"\nfrom sklearn.linear_model.passive_aggressive import PassiveAggressiveRegressor as SKLModel\nimport lale.helpers\nimport lale.operators\nimport lale.docstrings\nfrom numpy import nan, inf\n\nclass PassiveAggressiveRegressorImpl():\n\n def __init__(self, C=1.0, fit_intercept=True, max_iter=None, tol=None, early... | [
[
"sklearn.linear_model.passive_aggressive.PassiveAggressiveRegressor"
],
[
"sklearn.ensemble.gradient_boosting.GradientBoostingClassifier"
]
] |
liliangbin/unet-match | [
"2e3c3bbf965f47a30487a1aa68d76ad530f2b070"
] | [
"model.py"
] | [
"# -*- coding:utf-8 -*-\n\nimport glob\nimport os\n\nimport SimpleITK as sitk\nimport numpy as np\nimport tensorflow as tf\nfrom keras.backend.tensorflow_backend import set_session\nfrom keras.preprocessing.image import img_to_array, load_img\nfrom matplotlib import pyplot as plt\n\n# 指定第一块GPU可用\nos.environ[\"CUDA_... | [
[
"tensorflow.Session",
"numpy.save",
"tensorflow.ConfigProto",
"numpy.squeeze",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
hust-arms/uuv_simulator-armsauv | [
"41e4c14a4c3bb19801b6bc7c2c7a3633315177be"
] | [
"uuv_control/uuv_trajectory_control/scripts/rov_mb_sm_controller.py"
] | [
"#!/usr/bin/env python\n# Copyright (c) 2016-2019 The UUV Simulator Authors.\n# All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/... | [
[
"numpy.square",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.multiply",
"numpy.abs",
"numpy.hstack"
]
] |
uzaymacar/self-supervision | [
"319c5e3dc56576b273f5785ac8f10af07ef9d628"
] | [
"language/collators.py"
] | [
"\"\"\"Data collators for self-supervised pretext tasks in language.\"\"\"\n\nimport torch\nimport numpy as np\nfrom torch.nn.utils.rnn import pad_sequence\n\n\nclass DataCollator(object):\n def __init__(self):\n pass\n\n def __call__(self, examples):\n pass\n\n def _preprocess_batch(self, ex... | [
[
"torch.zeros",
"torch.stack",
"numpy.random.choice",
"torch.nn.utils.rnn.pad_sequence",
"torch.randperm",
"torch.randint",
"torch.full",
"torch.tensor",
"torch.bernoulli"
]
] |
VladFernoaga/machine-leargning-for-motors | [
"ba224510af538be4bc54b133d385b02d20616152"
] | [
"deep_learning/pe-ann/keras_regression_pe.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn.model_selection import KFold\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.preprocessing import MinMaxScaler\nfrom... | [
[
"tensorflow.python.keras.models.Sequential",
"numpy.array",
"numpy.reshape",
"pandas.read_excel",
"sklearn.preprocessing.MinMaxScaler",
"tensorflow.python.keras.layers.Dense",
"sklearn.model_selection.train_test_split"
]
] |
omnisci/omnisci-olio.py | [
"e8b33d660b49bc7677d82845ed384e57582ef0f8"
] | [
"omnisci_olio/pymapd/connect.py"
] | [
"import json\nimport os\nimport getpass\nimport subprocess\nimport sys\nfrom sqlalchemy.engine.url import make_url, URL\nfrom pathlib import Path\nimport pandas as pd\nimport pyomnisci\n\n\ndef lookup_url_for_name(name):\n home = os.environ[\"HOME\"]\n for fname in [\n home + \"/omnisci/omnisci-urls.cs... | [
[
"pandas.read_csv"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.