repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
jaimedelacruz/ISPy
[ "eff9aa2f06d395ce8af2cbeb26022b2eea20766d" ]
[ "ISPy/img/denoising.py" ]
[ "import numpy as np\nimport os\nimport sys\nimport warnings\n\nwith warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\", category=FutureWarning)\n# To deactivate warnings: https://github.com/tensorflow/tensorflow/issues/7778\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\n# import keras.backend.tensorfl...
[ [ "numpy.zeros_like", "numpy.nan_to_num", "numpy.zeros", "numpy.copy", "matplotlib.pyplot.title", "numpy.min", "matplotlib.pyplot.figure", "tensorflow.keras.layers.InputSpec", "numpy.std", "tensorflow.pad", "matplotlib.pyplot.imshow", "matplotlib.pyplot.subplot" ] ]
josrodand/goodreads_awards_scrapper
[ "589348a2e9b5cfde625eb3fd250ce5dbdac5c0a6" ]
[ "goodReadsScrapper.py" ]
[ "import pandas as pd\nimport time\nfrom bs4 import BeautifulSoup\nimport requests\nimport sys\nimport random\n\n\ndef get_headers():\n \"\"\"\n Genera un diccionario con los datos del header. Incluye una lista de diferentes user agent de la cual elige uno\n de manera aleatoria.\n \"\"\"\n uastrings =...
[ [ "pandas.Series" ] ]
DPBayes/PLD-Accountant
[ "6bc09ea8c39bc0530c3cf6e7f734f4d39991f2f2" ]
[ "fourier_accountant/accountant.py" ]
[ "import typing\nimport numpy as np\nimport scipy.special\nfrom fourier_accountant.plds import PrivacyLossDistribution, PrivacyException, DiscretePrivacyLossDistribution\n\n__all__ = ['get_delta_upper_bound', 'get_delta_lower_bound', 'get_epsilon_upper_bound', 'get_epsilon_lower_bound']\n\ndef _get_ps_and_Lxs(\n ...
[ [ "numpy.concatenate", "numpy.fft.rfft", "numpy.isclose", "numpy.log", "numpy.sum", "numpy.fft.irfft", "numpy.exp", "numpy.size", "numpy.clip", "numpy.all", "numpy.abs", "numpy.linspace", "numpy.maximum" ] ]
mayoyamasaki/position-rank
[ "9925e40e821ef7b191c17e73c4cebb782d25379f" ]
[ "position_rank.py" ]
[ "# coding:utf-8\nimport math\nimport stemming.porter2 as porter\nimport numpy as np\nimport copy\nfrom collections import Counter\n\n\ndef position_rank(sentence, tokenizer, alpha=0.85, window_size=6, num_keyphrase=10, lang=\"en\"):\n \"\"\"Compute position rank score.\n\n Position rank is a method for extrac...
[ [ "numpy.linalg.norm", "numpy.ones", "numpy.argsort", "numpy.zeros" ] ]
nero19960329/MegEngine
[ "4462953fba45bdfb9aaf47b406688206fa5796c3" ]
[ "imperative/python/megengine/jit/tracing.py" ]
[ "# -*- coding: utf-8 -*-\n# MegEngine is Licensed under the Apache License, Version 2.0 (the \"License\")\n#\n# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS,...
[ [ "numpy.repeat", "numpy.set_printoptions", "numpy.load", "numpy.mean", "numpy.std", "numpy.random.uniform", "numpy.transpose", "numpy.all", "numpy.squeeze", "numpy.var" ] ]
marcelampc/aerial_mtl
[ "c6a2033ec89a89ff06836014c619d66bc907d958" ]
[ "util/util.py" ]
[ "# Utilities\nimport torch\nimport shutil\nimport torchvision.utils as vutils\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nfrom ipdb import set_trace as st\nfrom torch.autograd import Variable\nfrom tqdm import tqdm\nfrom collections import OrderedDict\nfrom PIL import Image\nfrom torch import n...
[ [ "numpy.transpose", "numpy.logical_and", "numpy.zeros" ] ]
odobenuskr/2019_capstone_FlexAds
[ "e37708484d983326806c0d6a0c5ae7157ea57e59" ]
[ "src/recommendation/aws_dynamodb/add_item_to_dynamodb.py" ]
[ "from __future__ import print_function # Python 2/3 compatibility\nimport boto3\nimport pandas as pd\nimport MySQLdb\nimport sys\n\n\ndef add_item(table, user_id, product_id, product_name, aisle_name):\n table.put_item(\n Item={\n 'user_id': user_id,\n 'update_ver' : 1,\n 'product_id'...
[ [ "pandas.read_csv", "pandas.read_sql", "pandas.merge" ] ]
mohamed-khoualed/keras
[ "0f8da5a7b814cb37baba868fc11fe8b10b3d4cf8" ]
[ "keras/tests/tracking_test.py" ]
[ "# 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/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v2.Graph", "tensorflow.python.training.tracking.util.list_objects", "tensorflow.compat.v2.compat.v1.enable_eager_execution", "tensorflow.python.training.tracking.data_structures.List", "tensorflow.compat.v2.train.Checkpoint", "numpy.ones", "tensorflow.compat.v2.ones"...
liminghao1630/transformers
[ "207594be81b8e5a8589c8b11c3b236924555d806", "207594be81b8e5a8589c8b11c3b236924555d806", "207594be81b8e5a8589c8b11c3b236924555d806", "207594be81b8e5a8589c8b11c3b236924555d806" ]
[ "tests/test_modeling_bort.py", "src/transformers/modeling_tf_pytorch_utils.py", "tests/test_modeling_flax_wav2vec2.py", "tests/test_modeling_tf_xlm.py" ]
[ "# coding=utf-8\n# Copyright 2020 The HuggingFace Team. 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#\...
[ [ "torch.Size", "torch.allclose", "torch.tensor" ], [ "numpy.array", "numpy.reshape", "tensorflow.python.keras.backend.batch_set_value", "torch.from_numpy", "numpy.transpose", "numpy.isscalar", "torch.load", "numpy.squeeze", "numpy.expand_dims" ], [ "numpy...
t-sakai-kure/PNU-Classification
[ "79a5bf104a53cb6d3498918e435bd88ac5331543" ]
[ "examples/pul/upu/demo_upu.py" ]
[ "import numpy as np\n\nfrom sklearn.model_selection import GridSearchCV, StratifiedKFold\nfrom sklearn.utils.estimator_checks import check_estimator\n\nfrom pywsl.pul import pu_mr\nfrom pywsl.utils.syndata import gen_twonorm_pu\nfrom pywsl.utils.comcalc import bin_clf_err\n\n\ndef main():\n prior = .5\n x, y,...
[ [ "numpy.logspace" ] ]
alexeltsar/Gas-Simulation
[ "953b270fcc1eb938cac77cccfe42db13f70a9b67" ]
[ "Gas_classes.py" ]
[ "import numpy as np\r\nimport math, time\r\nimport random\r\nimport matplotlib.pyplot as plt\r\nfrom numpy import linalg as LA\r\nimport mpl_toolkits.mplot3d.axes3d as p3\r\nfrom matplotlib.animation import FuncAnimation\r\nimport matplotlib.patches as mpatches\r\nfrom scipy import stats\r\n\r\nimport os\r\nimport ...
[ [ "numpy.dot", "numpy.random.rand", "numpy.exp", "numpy.mean", "matplotlib.pyplot.gcf", "numpy.cos", "numpy.random.random", "numpy.sin", "numpy.linalg.norm", "matplotlib.pyplot.savefig", "numpy.nonzero", "numpy.arange", "numpy.transpose", "numpy.sqrt", "ma...
ledummy/CoMPlEx
[ "f315df7a1b13cfcbdafd9879ff93a974f2e2c38b" ]
[ "libs/curveLib/peaks.py" ]
[ "import numpy as np\nimport os\nfrom os import makedirs\nfrom os.path import split, join, splitext, exists, isfile\n\nclass peak(object):\n \n def __init__(self,z,f,baseLine = None,model = None,id=''):\n \n self.z = z\n self.f = f\n self.model = model\n self.fit = None\n ...
[ [ "numpy.max", "numpy.array", "numpy.sum", "numpy.min", "numpy.mean", "numpy.where", "numpy.var" ] ]
sunil16/raster_imagery
[ "15151c6a8785104e613d3998a095dbc1ade50f6f" ]
[ "rim/utils/imageUtils.py" ]
[ "# image utilities\nimport numpy as np\nimport collections\nfrom PIL import Image\n\n# raster\nfrom rasterio.features import rasterize\nimport rasterio\nfrom rasterio.windows import Window\n\n\ndef total_chunks_in_image(tif, window, stride):\n rst = rasterio.open(tif)\n\n res_height = rst.meta['height']\n ...
[ [ "numpy.mean" ] ]
JackHaoyingZhou/PSMFK_traid
[ "062cd252a92c532467369d25fa5c8e12d33efe45" ]
[ "TraidPSMFK.py" ]
[ "#!/usr/bin/env python\n############################################\n## /* PSM FK for Traid project */ ##########\n## \\author: Haoying Zhou\n############################################\n\nimport numpy as np\n\nclass TraidPSMFK():\n def __init__(self, joint_pos):\n ####### note: joint_pos should be a 1x...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.norm", "numpy.sin", "numpy.zeros", "numpy.eye", "numpy.transpose", "numpy.sqrt", "numpy.cos" ] ]
XT19/Sc2Brain
[ "db908ac80710b29c07d3e3978046a967315e9b2e" ]
[ "py_smart_agent.py" ]
[ "import random\nimport math\nimport os\n\nimport numpy as np\nimport pandas as pd\n\nfrom pysc2.agents import base_agent\nfrom pysc2.lib import actions\nfrom pysc2.lib import features\n\n_NO_OP = actions.FUNCTIONS.no_op.id\n_SELECT_POINT = actions.FUNCTIONS.select_point.id\n_BUILD_SUPPLY_DEPOT = actions.FUNCTIONS.B...
[ [ "pandas.read_pickle", "numpy.random.choice", "numpy.zeros", "pandas.DataFrame", "numpy.random.permutation", "numpy.random.uniform" ] ]
Fluorescence-Tools/tttrlib
[ "891db80ddc5e6a1098faa62bd336df11b060e041" ]
[ "examples/correlation/plot_correlation_cr_filter_2.py" ]
[ "\"\"\"\n===================================\nCount rate filtered correlation - 2\n===================================\nScan count rate filter and compute stack of correlation\nfunctions for different mean count rates in time windows.\nPotential application: filter aggregates, see also\nPAID correlation (Laurence??...
[ [ "numpy.array", "numpy.logspace" ] ]
LeidongX/openmc
[ "c14c2a255a25446f99cbe16cc1b9219a7ac23d09" ]
[ "openmc/data/thermal.py" ]
[ "from collections.abc import Iterable\nfrom collections import namedtuple\nfrom difflib import get_close_matches\nfrom numbers import Real\nfrom io import StringIO\nimport itertools\nimport os\nimport re\nimport tempfile\nfrom warnings import warn\n\nimport numpy as np\nimport h5py\n\nimport openmc.checkvalue as cv...
[ [ "numpy.zeros_like", "numpy.array", "numpy.empty", "numpy.asarray", "numpy.string_", "numpy.ones", "numpy.exp", "numpy.cumsum", "numpy.searchsorted", "numpy.vstack" ] ]
angshenting/NMT_GAN
[ "9464fc5df2dd006f4e13d9cc3a6be7071e28d16c" ]
[ "generate_samples.py" ]
[ "from __future__ import print_function\nimport yaml\nimport time\nimport os\nimport logging\nfrom argparse import ArgumentParser\nimport tensorflow as tf\n\nfrom utils import DataUtil, AttrDict\nfrom model import Model\nfrom cnn_discriminator import DisCNN\nfrom share_function import deal_generated_samples\nfrom sh...
[ [ "tensorflow.compat.v1.Session", "tensorflow.compat.v1.ConfigProto", "tensorflow.Graph" ] ]
krishnapalS/NiftyNet
[ "c31019b14137d5a39d59c81221fe2b8e066b38b4" ]
[ "tests/sampler_resize_v2_test.py" ]
[ "# -*- coding: utf-8 -*-\r\nfrom __future__ import absolute_import, division, print_function\r\n\r\nimport os\r\n\r\nimport tensorflow as tf\r\n\r\nfrom niftynet.engine.sampler_resize_v2 import ResizeSampler\r\nfrom niftynet.io.image_reader import ImageReader\r\nfrom niftynet.io.image_sets_partitioner import ImageS...
[ [ "tensorflow.test.main" ] ]
rakeshshrestha31/meshmvs
[ "e82cf0121ae49dd781d87d172218f41a882e3c04" ]
[ "shapenet/modeling/heads/depth_renderer.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport neural_renderer as nr\n\nimport numpy as np\nimport cv2\n\nclass DepthRenderer(nn.Module):\n def __init__(self, cfg):\n super(DepthRenderer, self).__init__()\n min_depth = cfg.MODEL.MVSNET.MIN_DEPTH\n max_depth =...
[ [ "torch.zeros", "numpy.array", "torch.inverse", "torch.bmm", "torch.from_numpy", "numpy.eye", "torch.tensor" ] ]
basilevh/dissecting-image-crops
[ "8166c47a017b2267d225c38e6e6080bd834b912f" ]
[ "model.py" ]
[ "'''\nImage crop detection by absolute patch localization.\nNeural network architecture description in PyTorch.\nBasile Van Hoorick, Fall 2020.\n'''\n\n# Library imports.\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport pickle\nimport random\nimport scipy\nimport seaborn as sns\ni...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.linspace", "torch.nn.ReLU", "torch.nn.Conv2d", "numpy.arange", "torch.zeros_like" ] ]
guanyuelee/DP-LaSE
[ "f26cbb46ba86ba0ee7c2fced982ac07307f3108e" ]
[ "models/base_generator.py" ]
[ "# python 3.7\n\"\"\"Contains the base class for generator in a GAN model.\"\"\"\n\nimport os.path\nimport sys\nimport logging\nimport numpy as np\n\nimport torch\n\nfrom . import model_settings\n\n__all__ = ['BaseGenerator', 'BaseDiscriminator']\n\n\ndef get_temp_logger(logger_name='logger'):\n \"\"\"Gets a tem...
[ [ "numpy.concatenate", "torch.cuda.is_available", "torch.load", "numpy.clip" ] ]
fzmolina/yt
[ "59fbfc2f7e5eea7bf2517fa4bd53113372f01a7c" ]
[ "yt/data_objects/data_containers.py" ]
[ "\"\"\"\nVarious non-grid data containers.\n\n\n\n\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2013, yt Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with th...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.ones_like", "numpy.empty", "numpy.zeros", "pandas.DataFrame", "numpy.ones", "numpy.min", "numpy.log10", "numpy.linspace", "numpy.unique" ] ]
pymor/pymor-deal.II
[ "520b36b42d7e58e8adaefb4c772d36d650f30c27" ]
[ "src/pymor_dealii/pymor/demo.py" ]
[ "# This file is part of the pyMOR project (http://www.pymor.org).\n# Copyright 2013-2018 pyMOR developers and contributors. All rights reserved.\n# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)\n\nfrom pymor.basic import *\n\nfrom pymor_dealii.pymor.operator import DealIIMatrixOperator...
[ [ "matplotlib.pyplot.show" ] ]
ToastCoder/predictcovid19
[ "2cc4846837c6c15084fea37ed804e762de2801da" ]
[ "src/test.py" ]
[ "#-------------------------------------------------------------------------------------------------------------------------------\n\n# COVID19 PREDICTION IN INDIA\n\n# FILE NAME: test.py\n\n# DEVELOPED BY: Vigneshwar Ravichandar\n\n# TOPICS: Regression, Machine Learning, TensorFlow\n\n#-----------------------------...
[ [ "numpy.array", "numpy.reshape", "sklearn.preprocessing.StandardScaler", "tensorflow.keras.models.load_model", "pandas.read_csv" ] ]
nolanstr/bingo_multi_stage
[ "7a88c4f5c59268d0612664be5864765db2edad51" ]
[ "tests/performance_benchmarking/parallel_archipelago_benchmarks.py" ]
[ "import timeit\n\nimport numpy as np\nfrom mpi4py import MPI\n\nfrom bingo.symbolic_regression.agraph.crossover import AGraphCrossover\nfrom bingo.symbolic_regression.agraph.mutation import AGraphMutation\nfrom bingo.symbolic_regression.agraph.generator import AGraphGenerator\nfrom bingo.symbolic_regression.agraph....
[ [ "numpy.random.seed", "numpy.linspace" ] ]
safe-dressing/safe_mpc_rss21
[ "9aa4e1d7ef827b43493fec94bbd9519f9e5a2119" ]
[ "hr_planning/ssm_gpy/gaussian_process.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nSlightly adapted from https://github.com/befelix/safe-exploration/blob/master/safe_exploration/ssm_gpy/gaussian_process.py\nCreated on Wed Sep 20 10:37:51 2017\n\n@author: tkoller\n\"\"\"\n\nimport GPy\nimport numpy as np\nfrom .gp_models_utils_casadi import gp_pred_function, _get_...
[ [ "numpy.concatenate", "numpy.delete", "numpy.array", "numpy.empty", "numpy.random.choice", "numpy.reshape", "numpy.sum", "sklearn.cluster.KMeans", "numpy.load", "numpy.shape", "numpy.nonzero", "numpy.eye", "numpy.arange", "numpy.argsort", "numpy.cumsum", ...
YouGotJaked/Witcher-Finder
[ "76c005637167507023f4754e7d3367ea369e96c3" ]
[ "ebay/__main__.py" ]
[ "from pathlib import Path\n\nimport pandas as pd\n\nfrom .scrape import get_listings, listings_to_df\nfrom .notify import email, text\n\nLISTINGS_CSV = Path(Path(__file__).parent.parent, 'data', 'csv',\n'listings.csv')\nURL = r\"https://www.ebay.com/sch/i.html?_dcat=261186&_fsrp=1&_from=R40&_armrs=1&_sacat=0&_nkw=a...
[ [ "pandas.read_csv" ] ]
dnbaker/pytorch-dilated-rnn
[ "4d7e04bf00d2f144c4435cb7ad78ecee7de81dd1" ]
[ "char_rnn/char_rnn_test.py" ]
[ "import argparse\nimport sys\nimport time\nimport math\n\nimport torch.nn as nn\nimport torch.optim as optim\n\nfrom drnn import DRNN\nfrom char_rnn.utils import *\nfrom char_rnn.model import DRNN_Char\n\n\nimport warnings\nwarnings.filterwarnings(\"ignore\") # Suppress the RunTimeWarning on unicode\n\n\nparser =...
[ [ "torch.nn.CrossEntropyLoss" ] ]
AlexanderHoogsteyn/PhaseIdentification
[ "0ef49456e16dbc5481c324b1ae7340518e1511b6" ]
[ "demos/load_based_sensetivity.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nimport sys\nfrom os.path import dirname\n\nsys.path.append(dirname(\"../src/\"))\n\nfrom PhaseIdentification.common import *\nfrom PhaseIdentification.powerBasedPhaseIdentification import *\nfrom PhaseIdentification.integratedPhaseIdent...
[ [ "matplotlib.pyplot.xlim", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show" ] ]
L-Net-1992/onnx
[ "35092895d9bf3592e58f4710d098f8131afef259" ]
[ "onnx/backend/test/case/base.py" ]
[ "# SPDX-License-Identifier: Apache-2.0\n\nfrom collections import defaultdict\nimport inspect\nfrom textwrap import dedent\nfrom typing import Dict, Text, List, Tuple, Type, Sequence, Any\n\nimport numpy as np # type: ignore\n\n\ndef process_snippet(op_name: Text, name: Text, export: Any) -> Tuple[Text, Text]:\n ...
[ [ "numpy.random.seed" ] ]
TIAO-JI-FU/3d-printing-with-moveo-1
[ "100ecfd1208fe1890f8bada946145d716b2298eb" ]
[ "Cura/Cura/cura/BuildVolume.py" ]
[ "# Copyright (c) 2019 Ultimaker B.V.\n# Cura is released under the terms of the LGPLv3 or higher.\n## Find_moveo ##\n\nfrom UM.Mesh.MeshData import MeshData\nfrom cura.Scene.CuraSceneNode import CuraSceneNode\nfrom cura.Settings.ExtruderManager import ExtruderManager\nfrom UM.Application import Application #To modi...
[ [ "numpy.max", "numpy.array", "numpy.dot", "numpy.asarray", "numpy.min" ] ]
bchaiks/3D_Bin_Packing_Heuristics
[ "f8c4ac1ec73f1b94287eb18fdcdff7bea685ec27" ]
[ "packing.py" ]
[ "import json\nimport numpy as np\ndef pack(request):\n \n data = request.get_json()\n furniture = data['furniture']\n orientations = []\n \n '''\n Test TEST TTEESSTT\n \n \n '''\n\n ##################################################################\n ####### Preliminary Function...
[ [ "numpy.array", "numpy.delete", "numpy.ones", "numpy.argsort", "numpy.append", "numpy.unique" ] ]
yli96/autokeras
[ "bcca56c5fd9c6f0d98387e1e7e430f91427286be" ]
[ "autokeras/meta_model.py" ]
[ "import tensorflow as tf\nfrom kerastuner.engine import hyperparameters as hp_module\nfrom tensorflow.python.util import nest\n\nfrom autokeras.hypermodel import block\nfrom autokeras.hypermodel import graph\nfrom autokeras.hypermodel import hyperblock\nfrom autokeras.hypermodel import node\n\n\ndef assemble(inputs...
[ [ "tensorflow.python.util.nest.flatten", "tensorflow.keras.preprocessing.text.Tokenizer" ] ]
sThalham/UDAPose
[ "d23edcce18f6e8aec4f35e0894b676d4ae19686e" ]
[ "PyraPose/preprocessing/data_linemod.py" ]
[ "\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable la...
[ [ "numpy.concatenate", "numpy.full", "numpy.array", "tensorflow.convert_to_tensor", "numpy.empty", "tensorflow.tuple", "tensorflow.keras.backend.cast_to_floatx", "numpy.random.shuffle", "tensorflow.data.Dataset.from_generator", "numpy.ndarray", "tensorflow.keras.backend.f...
15091444119/MASS
[ "d36af11551cb872d285d79fc7446a8c6223d996d" ]
[ "MASS-unsupNMT/src/model/__init__.py" ]
[ "# Copyright (c) 2019-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# NOTICE FILE in the root directory of this source tree.\n#\n\nfrom logging import getLogger\nimport os\nimport torch\n\nfrom .transformer import TransformerModel\n\n\nlogger = ge...
[ [ "torch.no_grad" ] ]
YoadTew/examples
[ "4f8f1a0e8dff3f80abb40bc71ef64e349132faec" ]
[ "distributed/rpc/rnn/main.py" ]
[ "import os\n\nimport torch\nimport torch.distributed.autograd as dist_autograd\nimport torch.distributed.rpc as rpc\nimport torch.multiprocessing as mp\nimport torch.optim as optim\nfrom torch.distributed.optim import DistributedOptimizer\n\nimport rnn\n\n\ndef _run_trainer():\n r\"\"\"\n The trainer creates ...
[ [ "torch.nn.CrossEntropyLoss", "torch.distributed.autograd.backward", "torch.multiprocessing.spawn", "torch.distributed.rpc.init_rpc", "torch.LongTensor", "torch.distributed.autograd.context", "torch.distributed.rpc.shutdown", "torch.randn" ] ]
amanchokshi/radio-dreams
[ "abfcfb2d54a48df16584dbceacbe35872180e931" ]
[ "src/radio_dreams/interferometer.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Imaginary Interferometers.\"\"\"\n\n__author__ = \"Aman Chokshi\"\n__date__ = \"2021-06-13\"\n__cite__ = \"https://github.com/amanchokshi\"\n\nimport numpy as np\nfrom numba import njit, prange\nfrom scipy.constants import c\n\n\ndef read_layout(layout_path=None):\n \"\"\"Read a...
[ [ "numpy.sin", "numpy.dot", "numpy.array", "numpy.zeros", "numpy.exp", "numpy.loadtxt", "numpy.arange", "numpy.cos", "numpy.abs", "numpy.linspace", "numpy.vstack" ] ]
roboTurt/ROB537-FinalProject
[ "32a15cb1454f16a8bfd13977670eacaf13bf3fbb" ]
[ "gym-Explore2D/gym_Explore2D/envs/explore2D_env.py" ]
[ "import gym\nimport numpy as np \nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport torch\nfrom gym import error, spaces, utils\nfrom gym.spaces import Discrete, Box\nfrom gym.utils import seeding\n\n#from stable_baselines.common.env_checker import check_env\npathToGroundTruthMap = \"./gridWorld_16x16.cs...
[ [ "numpy.full", "numpy.zeros", "numpy.where", "numpy.loadtxt", "numpy.random.randint", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
fregulationn/faster-rcnn-gcn
[ "d7c30a75adf9125a23a5d912b662c3bac7565ea3" ]
[ "lib/model/faster_rcnn/faster_rcnn_gcn_ts2.py" ]
[ "import random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport torchvision.models as models\nfrom torch.autograd import Variable\nimport numpy as np\nfrom model.utils.config import cfg\nfrom model.rpn.rpn import _RPN\nfrom model.roi_pooling.modules....
[ [ "numpy.concatenate", "torch.zeros", "torch.cat", "numpy.array", "torch.stack", "numpy.zeros", "torch.autograd.Variable", "numpy.sum", "torch.unsqueeze", "torch.from_numpy", "torch.nn.functional.cross_entropy", "numpy.argmax", "numpy.argsort", "torch.nn.funct...
oeclint/BIDMach
[ "999f6b0a2317c8869151b253e66a0cc5b0fb9841" ]
[ "scripts/benchmarks/skkmeans.py" ]
[ "import time\n\nimport numpy as np\nimport scipy.io as sio\nimport h5py\nfrom sklearn.datasets import load_svmlight_file\nfrom sklearn.cluster import KMeans\n\nprint(\"reading\")\n\nf = h5py.File('/code/BIDMach/data/MNIST8M/all.mat','r')\n\nt0 = time.time()\ndata = f.get('/all') # Get a certain dataset\nX = np.arra...
[ [ "numpy.array", "sklearn.cluster.KMeans" ] ]
roobooot/GTac_
[ "94dc67668f87cfd17575033fc880ea7e4327e6ef" ]
[ "software/GTac_Hand/raw_data_collect.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Dec 28 13:39:54 2020\n\n@author: Zeyu\n\"\"\"\n\nfrom data_gen import raw_data_checkout\n# import numpy as np\n# import matplotlib.pyplot as plt\nimport serial\nimport time\nimport pandas as pd\nimport seaborn as sns\nimport argparse\nimport os\n\nCOLUMNS = ['col',\n...
[ [ "pandas.DataFrame" ] ]
Yshuo-Li/mmediting-test
[ "ff8349a183b3d266495a53be0c8ad8e342e8b461", "ff8349a183b3d266495a53be0c8ad8e342e8b461" ]
[ "mmedit/models/backbones/encoder_decoders/encoders/resnet.py", "mmedit/models/backbones/sr_backbones/tof.py" ]
[ "import torch.nn as nn\nimport torch.utils.checkpoint as cp\nfrom mmcv.cnn import (build_activation_layer, build_conv_layer,\n build_norm_layer, constant_init, kaiming_init)\nfrom mmcv.runner import load_checkpoint\nfrom mmcv.utils.parrots_wrapper import _BatchNorm\n\nfrom mmedit.utils import g...
[ [ "torch.nn.Sequential", "torch.utils.checkpoint.checkpoint", "torch.nn.MaxPool2d" ], [ "torch.nn.functional.avg_pool2d", "torch.stack", "torch.nn.functional.interpolate", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.Tensor" ] ]
tomix86/hpcpm
[ "9fa8341249deb8c5689d0f3743f9b76d46b2dd69" ]
[ "api/hpcpm/api/app.py" ]
[ "import time\nimport datetime\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom flask import Flask, request, send_file, abort\nfrom tornado.wsgi import WSGIContainer\nfrom tornado.httpserver import HTTPServer\nfrom tornado.ioloop import IOLoop\n\nfrom hpcpm.api import log\nfrom hpcpm.api.helpers.database i...
[ [ "matplotlib.pyplot.close", "matplotlib.pyplot.subplots" ] ]
aistoume/Img2MNIST
[ "f81f2bee37a150391e2f895391390f59c4f4f5f2" ]
[ "model.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport tensorflow.contrib.slim as slim\n\nflags = tf.app.flags\nFLAGS = flags.FLAGS\n\ndef mynet(input, reuse=False):\n\twith tf.name_scope(\"model\"):\n\t\twith tf.variable_scope(\"conv1\") as scope:\n\t\t\tnet = tf.contrib.layers.conv2...
[ [ "tensorflow.contrib.layers.max_pool2d", "tensorflow.variable_scope", "tensorflow.name_scope", "tensorflow.contrib.layers.xavier_initializer_conv2d", "tensorflow.maximum", "tensorflow.pow", "tensorflow.contrib.layers.flatten", "tensorflow.square", "tensorflow.reduce_mean" ] ]
stewy33/Learning-to-Optimize
[ "b5e6fd008f12d0b702d861f6d6a99b773fd7c024" ]
[ "benchmark.py" ]
[ "import copy\n\nimport numpy as np\nimport scipy.linalg\nimport scipy.stats\nimport torch\nfrom matplotlib import pyplot as plt\n\n# from ray import tune\n# from ray.tune.suggest import ConcurrencyLimiter\n# from ray.tune.suggest.hyperopt import HyperOptSearch\n# import tqdm\nfrom torch import nn\nfrom torch.nn imp...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Parameter", "torch.ones", "torch.sum", "matplotlib.pyplot.colorbar", "numpy.nan_to_num", "torch.randint", "torch.tensor", "numpy.sqrt", "torch.zeros", "numpy.array", "matplotlib.pyplot.contourf", "numpy.zeros", "...
saicharan4771/Model-Sharing-by-Preserving-Privacy-using-Deep-Learning
[ "200c1252fdf35d6ffe951d36b7304db72cc974c6" ]
[ "Custom modules/privacy/analysis/rdp_accountant_test.py" ]
[ "# 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/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.testing.assert_allclose" ] ]
akgokce/EndoL2H
[ "da012dbf3a907000fc469c738976e8905d1dd423" ]
[ "models/networks.py" ]
[ "from __future__ import print_function\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport functools\nfrom torch.optim import lr_scheduler\n\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom PIL import Image\nimport matplotlib.pyplot as plt\n\nfrom .losses import ContentLos...
[ [ "torch.optim.lr_scheduler.StepLR", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.nn.LeakyReLU", "torch.nn.init.kaiming_normal_", "torch.cuda.is_available", "torch.nn.BCEWithLogitsLoss", "torch.nn.DataParallel", "torch.nn.init.constant_", "torch.nn.ConvTranspose2d", "...
MahmoudTamam/Human-activity-Recoginition
[ "3951efc7f34bb9fde2e77db2a84627b6bcd48a8c" ]
[ "agents/VOCACTIVITY_Agent.py" ]
[ "from agents.base import BaseAgent\nfrom graphs.models.classifier import Actvity_classifier\nfrom data_loader.voc import VOCDataLoader\nfrom tqdm import tqdm\nfrom keras.callbacks import ModelCheckpoint, TensorBoard, LearningRateScheduler\nfrom keras import metrics, optimizers\nfrom keras.optimizers import SGD, Ada...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.metrics.accuracy_score", "sklearn.metrics.classification_report", "numpy.where", "numpy.argmax", "sklearn.metrics.multilabel_confusion_matrix" ] ]
joshuataylor/great_expectations
[ "19dcead43aef9a833b3aa894a1226714a80ab840" ]
[ "tests/data_context/fixtures/post_init_project_v0.8.0_A/data/bob-ross/cluster-paintings.py" ]
[ "\"\"\"\nClusters Bob Ross paintings by features.\n\nBy Walter Hickey <walter.hickey@fivethirtyeight.com>\n\nSee http://fivethirtyeight.com/features/a-statistical-analysis-of-the-work-of-bob-ross/\n\"\"\"\n\nimport csv\nimport math\n\nimport numpy as np\nfrom scipy.cluster.vq import kmeans, whiten\n\n\ndef main():\...
[ [ "numpy.array", "numpy.delete", "scipy.cluster.vq.kmeans", "scipy.cluster.vq.whiten", "numpy.shape" ] ]
microsoft/TextGNN
[ "a3810bdd651274dff57b7d1e3243ed3b294bd240" ]
[ "src/aggregators.py" ]
[ "## GraphSage aggregators\nimport logging\n\nimport numpy as np\nimport tensorflow as tf\nfrom transformers.modeling_tf_utils import shape_list\n\nlogger = logging.getLogger(__name__)\n\n\nclass MeanAggregator(tf.keras.layers.Layer):\n\n def __init__(self, config, out_dim, activation='relu', identity_act=False, ...
[ [ "tensorflow.abs", "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.keras.layers.Activation", "numpy.ones", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.add_n", "tensorflow.reduce_max", "tensorflow.name_scope", "tensorflow.ker...
pokaxpoka/net_rand
[ "8388251cd104ab2f8fb808ccf5e9bac4f2ff2a21" ]
[ "sources/train_random.py" ]
[ "\"\"\"\nTrain an agent using a PPO2 based on OpenAI Baselines.\n\"\"\"\n\nimport time\nfrom mpi4py import MPI\nimport tensorflow as tf\nfrom baselines.common import set_global_seeds\nimport coinrun.main_utils as utils\nfrom coinrun import setup_utils, policies, wrappers, random_ppo2\nfrom coinrun.config import Con...
[ [ "tensorflow.ConfigProto", "tensorflow.Session" ] ]
liamchalcroft/nitorch
[ "0de179aff97244a82213c528f0d6393725c868c9" ]
[ "nitorch/nn/training/training.py" ]
[ "\"\"\"Tools to ease model training (like torch.ignite)\"\"\"\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nfrom nitorch.core.utils import benchmark, fold, unfold, rubiks_shuffle\nfrom nitorch.core.py import make_tuple\nfrom nitorch.nn.modules import Modul...
[ [ "torch.ones", "torch.cuda.is_available", "torch.load", "torch.nn.CrossEntropyLoss", "torch.get_rng_state", "torch.cuda.set_rng_state", "torch.random.manual_seed", "torch.autograd.grad", "torch.as_tensor", "torch.utils.tensorboard.SummaryWriter", "torch.random.initial_se...
sohaas/MLinPractice
[ "3008278dc7471dd5365a5b1735407b1826e9737e" ]
[ "plots/parameters/plot_hyperparameter.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Oct 27 19:19:38 2021\n\n@author: tjweber\n\"\"\"\n\nimport argparse, csv\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom matplotlib.legend_handler import HandlerLine2D\n\n\nMETRICS = [\"accuracy\", \"Cohen_kappa\", \"F-beta score\"...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.legend_handler.HandlerLine2D", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
desihub/nightwatch
[ "4d2261e0f6de4bb114f560b81e0c037f17fc5b1f" ]
[ "py/nightwatch/webpages/camfiber.py" ]
[ "import numpy as np\nimport fitsio\nimport os, fnmatch\nimport jinja2\nfrom jinja2 import select_autoescape\nimport bokeh\nimport desimodel.io\n\nfrom bokeh.embed import components\nfrom bokeh.layouts import gridplot, layout\n\nimport bokeh.plotting as bk\nfrom bokeh.models import ColumnDataSource\nfrom bokeh.model...
[ [ "numpy.where", "numpy.array" ] ]
carranza96/mmdetection
[ "d9d205f86acd65b441d3cd71df09934e3e2f3811" ]
[ "plots/plot.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom pandas.plotting import parallel_coordinates\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport json\nimport matplotlib.colors as mcolors\nfrom matplotlib import cm\n\nplt.style.use(['science', 'no-latex', 'grid', \"ieee\", 'muted'])\n\n# %%\n\ndf = pd.read...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.style.use", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
lucas88a/QQbot----little-witch
[ "a5575ade4e956cfc389ad2b6c874efff40552616" ]
[ "random_chaos.py" ]
[ "import matplotlib.pyplot as plt\r\nimport random\r\nfrom math import *\r\nimport Replymsg\r\nimport os\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\n\r\n\r\n# 几个非线性函数\r\n# 形式:(d/dt)^2x+a*(d/dt)x+sum(kn*x^n)+b*cos(c*x)\r\n# 取值 -1<=a,kn,γ,b<=1 x=1,y=1 steps=0.002,times=200\r\ndef duffing_gain():\r\n try:\r\n ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.cla", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axes" ] ]
ekselan/New_Twitoff
[ "90b103234ee97308e80e16f1cc7a6d935fa11788" ]
[ "web_app/classifier.py" ]
[ "# web_app/classifier.py\n\nimport os\nimport pickle\n\nfrom sklearn.datasets import load_iris\nfrom sklearn.linear_model import LogisticRegression # for example\n\nMODEL_FILEPATH = os.path.join(os.path.dirname(__file__), \"..\", \"models\", \"latest_model.pkl\")\n\ndef train_and_save_model():\n print(\"TRAINING...
[ [ "sklearn.linear_model.LogisticRegression", "sklearn.datasets.load_iris" ] ]
AdamWang00/pointnet.pytorch
[ "b92c3916cf9f84c35861790e8d9cdc6170a9afd5" ]
[ "pointnetae/dataset.py" ]
[ "import os\nimport json\nimport torch\nimport numpy as np\nfrom pointnetae.config import *\n\nclass SceneDataset(torch.utils.data.Dataset):\n def __init__(\n self,\n data_source,\n max_num_points,\n load_ram=False,\n is_testing=False,\n ):\n self.data_source = data_so...
[ [ "torch.Tensor", "numpy.load", "numpy.zeros", "numpy.arange" ] ]
zzdang/match_fashion
[ "fb08b2f42d382a947b40bf197def85ea9ddd26af" ]
[ "src/api/face_model.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom scipy import misc\nimport sys\nimport os\nimport argparse\nimport numpy as np\nimport mxnet as mx\nimport random\nimport sklearn\nfrom sklearn.decomposition import PCA\nfrom time import sleep\nfro...
[ [ "numpy.concatenate", "numpy.full", "numpy.max", "numpy.dot", "numpy.array", "torch.device", "numpy.copy", "numpy.ones", "numpy.transpose", "sklearn.preprocessing.normalize", "numpy.argmax", "numpy.expand_dims", "numpy.vstack", "numpy.fliplr" ] ]
bendichter/2nwb
[ "9876a1baf4faf56ba54fe8ff7359129450e2aca0" ]
[ "to_nwb/chang/transcripts.py" ]
[ "from __future__ import division\n\n__author__ = 'David Conant, Jesse Livezey, Ben Dichter'\n\nimport re, os\nimport numpy as np\nimport pandas as pd\nfrom pynwb.epoch import TimeIntervals\n\n\nlab_time_conversion = 1e7\n\n\ndef parse(blockpath, blockname):\n \"\"\"\n Find and parse transcript for block.\n\n ...
[ [ "numpy.array", "numpy.asarray", "numpy.ones", "numpy.where", "numpy.intersect1d", "numpy.all", "pandas.read_csv", "numpy.vstack" ] ]
RamboSofter/Tensorflow-NN-Reproduction
[ "61661dd18f93428c07ed77471836e9b9dc21e814" ]
[ "Reproduction/AlexNet.py" ]
[ "#-*-coding:utf-8-*-\nimport tensorflow as tf\n\n#输入数据\nfrom tensorflow.examples.tutorials.mnist import input_data\n#mnist =input_data.read_data_sets(\"/tmp/data/mnist\",one_hot=True)\n#本地路径\nMNIST_data_folder=\"/home/syx/PycharmProjects/NN_Rep/data/mnist\"\nmnist=input_data.read_data_sets(MNIST_data_folder,one_hot...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.train.AdamOptimizer", "tensorflow.nn.conv2d", "tensorflow.nn.relu", "tensorflow.argmax", "tensorflow.random_normal", "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "tensorflow.nn.lrn", "tensorflow....
EnricaBelfiore/sandy
[ "0ead4488265f350f4f20dda0095b25fd9eb8335d" ]
[ "tests/pert_test.py" ]
[ "import pytest\r\nfrom io import StringIO\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\nimport sandy\r\n\r\n__author__ = \"Luca Fiorito\"\r\n\r\n#####################\r\n# Test initialization\r\n#####################\r\ndef test_from_file_1_column():\r\n vals = '1\\n5\\n9'\r\n file = StringIO(vals)\...
[ [ "numpy.testing.assert_array_equal" ] ]
jpraveenkanna/People-Counter-App-at-the-Edge
[ "7db6510ef9f780550e3166327b3e90d372ddc621" ]
[ "main.py" ]
[ "#!/usr/bin/env python3\nimport os\nimport sys\nfrom openvino.inference_engine import IENetwork, IECore\nimport cv2\nimport numpy as np\nimport time\nimport socket\nimport json\nimport logging as log\nimport paho.mqtt.client as mqtt\nimport time\nimport logging \n\nfrom argparse import ArgumentParser\nfrom inferenc...
[ [ "numpy.average", "numpy.array" ] ]
miaomiaosang/bert-as-language-model
[ "93bf3d652ee15d283149a480ee07aa6bf0d52666" ]
[ "run_lm_predict.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "tensorflow.contrib.tpu.TPUEstimatorSpec", "tensorflow.contrib.tpu.TPUEstimator", "tensorflow.matmul", "numpy.exp", "tensorflow.reshape", "tensorflow.one_hot", "tensorflow.trainable_variables", "tensorflow.shape", "tensorflow.flags.DEFINE_string", "tensorflow.contrib.tpu.TP...
openvinotoolkit/mmaction2
[ "496cec37a4bae9b3d10c9d8fa46b244e4310b2fe" ]
[ "mmaction/datasets/builder.py" ]
[ "import platform\nimport random\nfrom functools import partial\nfrom copy import deepcopy\n\nimport numpy as np\nfrom mmcv.parallel import collate\nfrom mmcv.runner import get_dist_info\nfrom mmcv.utils import build_from_cfg\nfrom torch.utils.data import DataLoader\n\nfrom .dataset_wrappers import RepeatDataset\nfr...
[ [ "numpy.random.seed" ] ]
CMATER-JUCS/Covid-Chestxray-lambda-fuzzy
[ "38762bd02b730ea3d2efbeade29e9281c80b9563" ]
[ "deep CNN features/inception_extract.py" ]
[ "import os\r\nfrom os.path import basename, join, exists\r\nimport numpy as np\r\nimport math\r\nnp.random.seed(777)\r\nimport tensorflow_addons as tfa\r\nfrom tensorflow.keras import models\r\nfrom tensorflow.keras import layers\r\nfrom tensorflow.keras import models\r\nfrom tensorflow.keras import optimizers\r\nf...
[ [ "tensorflow.keras.preprocessing.image.ImageDataGenerator", "numpy.random.seed", "tensorflow.keras.applications.inception_v3.InceptionV3", "tensorflow.keras.models.Model", "tensorflow.keras.callbacks.ModelCheckpoint", "numpy.save", "tensorflow.keras.callbacks.LearningRateScheduler", ...
TianyuDu/AnnEconForecast
[ "648bb05498f333811021c07b04000d5f81ddc7f8" ]
[ "core/genetic/test_script.py" ]
[ "\"\"\"\nThis is the test script for optimizers in the genetic package.\n\"\"\"\nimport sys\nfrom typing import Dict\n\nimport numpy as np\n# from matplotlib import pyplot as plt\n\nsys.path.append(\"./\")\nfrom core.genetic.optimizer import GeneticOptimizer\nfrom core.genetic.tuner import GeneticTuner\n\n\ndef obj...
[ [ "numpy.random.random" ] ]
yaswanthpalaghat/Sentiment-analysis-on-movie-reviews
[ "bcf8ab2ba95c7677e2e4eddb0f2a3b7fe393d47f" ]
[ "vectorizer.py" ]
[ "from sklearn.feature_extraction.text import HashingVectorizer\nimport re\nimport os\nimport pickle\n\"\"\"\nvectorizer.py imports the vectorizer into the existing session, enabling it's use in the web app. \n\"\"\"\ncur_dir = os.path.dirname(__file__)\nstop = pickle.load(open(\n os.path.join(cur_dir, 'movie_sit...
[ [ "sklearn.feature_extraction.text.HashingVectorizer" ] ]
ladyson1806/NKR_lifespan
[ "119d0c8f8ce1f3a372acd7da7b3c824cd877e3fe" ]
[ "code/figure_2.py" ]
[ "import numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport scipy.stats as stats\nimport matplotlib.pyplot as plt\nimport json, os, progressbar, re, time\n\nfrom Bio import SeqIO\nfrom Bio import AlignIO\nfrom Bio.Seq import Seq\nfrom Bio.SeqRecord import SeqRecord\nfrom matplotlib_venn import venn3, ve...
[ [ "scipy.stats.zscore", "pandas.read_csv", "matplotlib.pyplot.subplots", "scipy.stats.pearsonr" ] ]
cwardell97/learn-hippo-1
[ "90280c614fb94aea82a60c2ed071db8068a37d5c" ]
[ "src/task/Schema.py" ]
[ "import numpy as np\nfrom task.utils import sample_rand_path\n\n# import pdb\nVALID_SAMPLING_MODE = ['enumerative']\nKEY_REPRESENTATION = ['node', 'time']\n# KEY_REPRESENTATION = ['node', 'time', 'gaussian']\n# VALID_SAMPLING_MODE = ['enumerative', 'probabilistic']\n# TODO: implement probabilistic sampling mode\n# ...
[ [ "numpy.random.normal", "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.tile", "numpy.shape", "numpy.eye", "numpy.argmax", "numpy.arange", "numpy.all", "numpy.linspace" ] ]
Togal-ai-Team/mmsegmentation
[ "55f50ec84865270024d847b6e2a787693b90835d" ]
[ "tools/train.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport argparse\nimport copy\nimport os\nimport os.path as osp\nimport time\nimport warnings\n\nimport mmcv\nimport torch\nimport torch.distributed as dist\nfrom mmcv.cnn.utils import revert_sync_batchnorm\nfrom mmcv.runner import get_dist_info, init_dist\nfrom mmcv...
[ [ "torch.distributed.get_rank" ] ]
ascentai/mdn_pyro
[ "084cd479ffdc95043123773977579468ecc91627" ]
[ "mdn_pyro.py" ]
[ "import matplotlib.pyplot as pl\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport pyro\nimport pyro.distributions as dist\nfrom pyro.contrib.autoguide import AutoDelta\nfrom pyro import poutine\nfrom pyro.infer import SVI\nfrom pyro.infer import TraceEnum_ELBO, co...
[ [ "torch.nn.Linear", "numpy.random.seed", "matplotlib.pyplot.xlabel", "torch.nn.Tanh", "matplotlib.pyplot.legend", "torch.transpose", "matplotlib.pyplot.figure", "torch.manual_seed", "numpy.float32", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.py...
stillyuyi/ArticlePairMatching
[ "f9cf63ad4c398d377f3d0291f552fb99f81020ef" ]
[ "src/models/CCIG/data/feature_extractor.py" ]
[ "# coding=utf-8\nfrom config import *\nimport json\nimport pandas as pd\nimport numpy as np\nimport multiprocessing as mp\nfrom functools import partial\nfrom graph_tool.all import *\nfrom ccig import *\nfrom sentence_score import *\nfrom sentence_pair_score import *\nfrom bm25 import *\n\n\nLANGUAGE = \"Chinese\"\...
[ [ "numpy.identity", "pandas.read_csv" ] ]
lorenzoschena/modulo_vki_testing
[ "dc5dfcf8ecadd2a6410744ae0ca5368a9b5110eb" ]
[ "modulo/read_db.py" ]
[ "import numpy as np\nimport os\nfrom tqdm import tqdm\n\nclass ReadData:\n \"\"\"\n A MODULO helper class for input data. ReadData allows to load the data directly before using MODULO, and\n hence assemblying the data matrix D from data, if needed.\n\n \"\"\"\n\n\n def __init__(self):\n pass\...
[ [ "numpy.concatenate", "numpy.copy", "numpy.genfromtxt", "numpy.zeros" ] ]
purva-thakre/Cirq
[ "55873b901c2720586c766ceb2c8b1b06500cc29b" ]
[ "cirq-core/cirq/ops/random_gate_channel.py" ]
[ "# Copyright 2020 The Cirq Developers\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 law o...
[ [ "numpy.sqrt" ] ]
joyantabasak13/SurfaceReconstruction
[ "b609507ddf81cbe4805d3aaf77c7612c414dd7ad" ]
[ "src/data_processing.py" ]
[ "import os\nimport open3d as o3d\nimport numpy as np\n\nif __name__ == '__main__':\n data_path = os.path.abspath(\"../data/bunny_normalized.ply\")\n cloud_ply = o3d.io.read_point_cloud(data_path) # Read the point cloud\n print(cloud_ply)\n print(np.asarray(cloud_ply.points))\n o3d.visualization.draw_...
[ [ "numpy.asarray" ] ]
SnovvyOwl/Softwarecaptsone
[ "4fb7fac4efd756f4e66abb2de1ed94692d825f53" ]
[ "fusion.py" ]
[ "from re import I, T, match\nimport numpy as np\nfrom numpy import ma\n# from torch._C import float32\nfrom modelmanager import ModelManager\nimport numpy as np\nimport torch\nimport pickle\nfrom queue import Queue\nfrom tqdm import tqdm\nimport PVRCNN.utils.common_utils\nimport PVRCNN.ops.roiaware_pool3d.roiaware_...
[ [ "torch.cat", "numpy.dot", "torch.stack", "numpy.argmin", "numpy.load", "numpy.min", "torch.ones", "numpy.where", "numpy.concatenate", "numpy.max", "numpy.argmax", "torch.tensor", "numpy.linalg.inv", "torch.zeros", "torch.cos", "numpy.array", "num...
PJZoio/High-Pricision_AD_HAT
[ "a815891fdd5c3c4c7724a3ece6a08ee07223f016" ]
[ "python/insertMariaDB.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 09 12:11:30 2021\n@author: Bernardo Carvalho\n\"\"\"\n\nimport sys\nimport numpy as np\nimport MySQLdb\n\nif len(sys.argv) > 1:\n filename = str(sys.argv[1])\nelse:\n filename = 'dados/BIODBR_20220315-163306.csv'\n\nif len(sys.argv) ...
[ [ "numpy.average", "numpy.std", "numpy.genfromtxt" ] ]
AlexShkarin/pyLabLib-v0
[ "1c3c59d4bcbea4a16eee916033972ee13a7d1af6" ]
[ "pylablib/core/utils/strpack.py" ]
[ "\"\"\"\nUtilities for packing values into bitstrings.\nSmall extension of the struct module.\n\"\"\"\n\nfrom builtins import range, bytes\n\nimport struct\nimport numpy as np\nfrom . import funcargparse\n\n\nstruct_descriptors={(\"i\",1):\"b\",(\"i\",2):\"h\",(\"i\",4):\"i\",(\"i\",8):\"q\",\n (\"u...
[ [ "numpy.concatenate", "numpy.frombuffer" ] ]
Aaronearlerichardson/Data2Bids
[ "8045d76e55048d4c44b1ec6e5f725995f0bc72e1" ]
[ "data2bids/data2bids.py" ]
[ "#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Dec 21 11:55:12 2018\r\n\r\n@author: ltetrel\r\n\"\"\"\r\nimport os\r\nimport re\r\nimport shutil\r\nimport json\r\nimport subprocess\r\nimport gzip\r\n#import sys\r\n#sys.path.insert(0, os.getcwd())\r\nimport numpy as np\r\nimport nibab...
[ [ "numpy.array", "numpy.swapaxes" ] ]
ekarais/open_spiel
[ "0e9b1b75dea3e87f0326fe1012d1b0367196b7dc" ]
[ "open_spiel/python/algorithms/eva.py" ]
[ "# Copyright 2019 DeepMind Technologies Ltd. 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 r...
[ [ "tensorflow.compat.v1.placeholder", "numpy.max", "numpy.array", "numpy.random.rand", "numpy.random.choice", "numpy.zeros", "numpy.exp", "numpy.argmax", "numpy.expand_dims" ] ]
poiuy68/TM_filtering_paper
[ "40f03a852cbb2a67a2b1d313a307c1fa27a18492" ]
[ "src/filter_words.py" ]
[ "import os, sys\nimport numpy as np\nfrom scipy.sparse import csr_matrix\nimport pandas as pd\n\nfrom data_io import texts_nwd_csr\n\n\ndef nwd_H_J_w_csr(n_wd):\n '''\n Calculate the conditional entropy H({d}|w) quantifying the importance of each word.\n ADAPTED VESION of nwd_H_J_w for csr-sparse matrices....
[ [ "numpy.zeros", "numpy.log", "numpy.sum", "pandas.DataFrame", "numpy.random.shuffle", "numpy.where", "numpy.sqrt", "scipy.sparse.csr_matrix", "numpy.log2" ] ]
vivacebelles/qcdb
[ "5bbdcb5c833277647a36bb0a5982abb56bf29b20", "5bbdcb5c833277647a36bb0a5982abb56bf29b20", "5bbdcb5c833277647a36bb0a5982abb56bf29b20", "5bbdcb5c833277647a36bb0a5982abb56bf29b20" ]
[ "tests/test_from_string.py", "tests/test_validate_and_fill_chgmult.py", "qcdb/util/np_rand3drot.py", "tests/cfour_tests/test_dfmp2_4_cfour.py" ]
[ "import sys\nimport copy\nimport pprint\n\nimport pytest\nimport numpy as np\n\nfrom utils import *\nfrom addons import *\n\nimport qcdb\nfrom qcdb.physconst import psi_bohr2angstroms\n\n\nsubject1 = \"\"\"O 0 0 0\nno_com\n\nH 1 ,, 0 \\t 0 # stuff-n-nonsense\"\"\"\n\nans1 = {'geom': [0., 0., 0., 1., 0., 0.],\n ...
[ [ "numpy.array" ], [ "numpy.array" ], [ "numpy.array", "numpy.sin", "numpy.eye", "numpy.random.uniform", "numpy.sqrt", "numpy.cos", "numpy.outer", "numpy.diag" ], [ "numpy.array" ] ]
yuxuanwu17/m6A_reader
[ "c0b48c9bc2041ba4f90cebac2a48a0a6348c5173" ]
[ "main.py" ]
[ "import numpy as np\nfrom keras import backend as K\nfrom plotting import lossplot, roc, prcurve\nfrom performance import ACC, MCC\nfrom load_data import load_data\nfrom model import build_model,compileModel,build_model_CNN\nK.set_image_data_format('channels_last')\n\nimport os\nos.environ[\"CUDA_DEVICE_ORDER\"] = ...
[ [ "numpy.array" ] ]
eddienko/zarr
[ "7431e4762ba28eefdfec5b5961cac97b6049c83a" ]
[ "zarr/creation.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, division\nfrom warnings import warn\n\n\nimport numpy as np\n\n\nfrom zarr.core import Array\nfrom zarr.storage import (DirectoryStore, init_array, contains_array, contains_group,\n default_compressor, normali...
[ [ "numpy.array", "numpy.asanyarray" ] ]
tolleybot/fast-depth
[ "f5488d8bcfbfc2f50186fb200224f06509c4ef23" ]
[ "main.py" ]
[ "import os\nimport time\nimport csv\nimport numpy as np\n\nimport torch\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.optim\ncudnn.benchmark = True\n\nimport models\nfrom metrics import AverageMeter, Result\nimport utils\n\nargs = utils.parse_command()\nprint(args)\nos.environ[\"CUDA...
[ [ "torch.no_grad", "torch.utils.data.DataLoader", "torch.load" ] ]
StanfordASL/safe_traffic_weaving
[ "e71ac6bf989046adcb2e5ae9821fa2fe3f4821e2" ]
[ "scripts/viz_nominal_traj.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import division\n\nimport numpy as np\nimport rospy\nfrom visualization_msgs.msg import Marker, MarkerArray\nfrom geometry_msgs.msg import Point\nfrom std_msgs.msg import ColorRGBA\nfrom osprey.msg import path\nfrom safe_traffic_weaving.msg import VehicleTrajectory\nfrom util...
[ [ "numpy.array" ] ]
markendr/esys-escript.github.io
[ "0023eab09cd71f830ab098cb3a468e6139191e8d", "0023eab09cd71f830ab098cb3a468e6139191e8d" ]
[ "ripley/test/python/run_readWriteOnRipley.py", "downunder/test/python/run_mappings.py" ]
[ "\n##############################################################################\n#\n# Copyright (c) 2003-2018 by The University of Queensland\n# http://www.uq.edu.au\n#\n# Primary Business: Queensland, Australia\n# Licensed under the Apache License, version 2.0\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# ...
[ [ "numpy.array", "numpy.ones", "numpy.fromfile", "numpy.append", "numpy.repeat" ], [ "numpy.log" ] ]
sandialabs/PyNucleus
[ "98b87cf779c2c1853ce16d47998b692f594a55a4" ]
[ "nl/PyNucleus_nl/__init__.py" ]
[ "###################################################################################\n# Copyright 2021 National Technology & Engineering Solutions of Sandia, #\n# LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the #\n# U.S. Government retains certain rights in this software. ...
[ [ "numpy.array", "numpy.flatnonzero" ] ]
yuanming-hu/tensorflow
[ "34bcd09c5fd4f6435517a499987b7e5044c8f2c0" ]
[ "tensorflow/python/framework/ops.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.pywrap_tensorflow.TF_Output", "tensorflow.python.eager.context.context", "tensorflow.python.framework.op_def_registry.get_registered_ops", "tensorflow.python.eager.context.Context", "tensorflow.python.pywrap_tensorflow.TF_FinishOperation", "tensorflow.python.framework.re...
kidconan/demo
[ "5589d2aa3c6caee4e077c8f1ea73c4085ebc625d" ]
[ "neuralNetworks/classifiers/seq_convertors.py" ]
[ "'''@file seq_convertors.py\nthis file contains functions that convert sequential data to non-sequential data\nand the other way around. Sequential data is defined to be data that is suetable\nas RNN input. This means that the data is a list containing an N x F tensor for\neach time step where N is the batch size a...
[ [ "tensorflow.range", "tensorflow.concat", "tensorflow.cumsum", "tensorflow.constant", "tensorflow.name_scope", "tensorflow.stack", "tensorflow.gather", "tensorflow.pad" ] ]
leoliner/BERT-CH-PERSON-OpenNER
[ "afddc976c199485c51bdbfb53757573844d9d164" ]
[ "OpenNRE/opennre/framework/data_loader.py" ]
[ "import torch\nimport torch.utils.data as data\nimport os, random, json, logging\nimport numpy as np\nimport sklearn.metrics\n\nclass SentenceREDataset(data.Dataset):\n \"\"\"\n Sentence-level relation extraction dataset\n \"\"\"\n def __init__(self, path, rel2id, tokenizer, kwargs):\n \"\"\"\n ...
[ [ "numpy.array", "torch.cat", "torch.stack", "torch.from_numpy", "torch.cuda.device_count", "torch.tensor" ] ]
TohnoYouki/MyOwn-DeepLearning-Pytorch-Architecture
[ "173b0d51529ed13d27f8a59b8c1068b7f07ad705" ]
[ "pytorch/optimizer.py" ]
[ "from torch.cuda import amp\nfrom .scheduler import SchedulerOptimizer\n\nclass OptimizationWrap():\n def __init__(self, optimizer, enable_amp = False, accumulate_step = 1):\n self.optimizer = optimizer\n if enable_amp:\n self.gradscaler = amp.grad_scaler.GradScaler()\n else: self...
[ [ "torch.cuda.amp.grad_scaler.GradScaler", "torch.cuda.amp.autocast_mode.autocast" ] ]
molML/MoleculeACE
[ "e831d2371a9b89f4853a03d5c04cc4bf59f64ee0" ]
[ "MoleculeACE/benchmark/data_processing/preprocessing/data_fetching/fetch_chembl.py" ]
[ "from chembl_webresource_client.new_client import new_client\nimport pandas as pd\nfrom progress.bar import ShadyBar\n\n\ndef retrieve_data(target_id='CHEMBL3979', waitbar=True, endpoints = [\"Ki\", \"Kd\"], relations = [\"=\"]):\n \"\"\"\n Function to retrieve the data from ChEMBL, starting from a given ChEM...
[ [ "pandas.DataFrame" ] ]
suton5/recsys137
[ "c1653b0802a855800aa09a977824cd544e204e2e" ]
[ "more_features.py" ]
[ "import spotipy\r\nimport spotipy.util as util\r\nfrom json.decoder import JSONDecodeError\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom sklearn.mixture import GaussianMixture\r\nfrom sklearn.neighbors import NearestNeighbors\r\nfrom sklearn.preprocessing import StandardScaler\r\nimport sys\r\nimport os\r\n\...
[ [ "numpy.array", "sklearn.preprocessing.StandardScaler", "sklearn.mixture.GaussianMixture", "numpy.random.multivariate_normal", "pandas.read_csv", "sklearn.neighbors.NearestNeighbors" ] ]
linyq17/mmfewshot
[ "a865ad2999a376b509a505bb2cbbbeeb149e6da5" ]
[ "docs/zh_cn/stat.py" ]
[ "#!/usr/bin/env python\nimport functools as func\nimport glob\nimport os.path as osp\nimport re\n\nimport numpy as np\n\nurl_prefix = 'https://github.com/open-mmlab/mmfewshot/blob/master/'\n\nfiles = sorted(glob.glob('../configs/*/README.md'))\n\nstats = []\ntitles = []\nnum_ckpts = 0\n\nfor f in files:\n url = ...
[ [ "numpy.unique" ] ]
prashantramnani/nn_likelihoods
[ "94e7a1d8fdf8c4e635eeaa66a7e941aa6b226f41" ]
[ "dnnreg_model_keras.py" ]
[ "import tensorflow as tf\nfrom tensorflow import keras\nimport os\nimport pandas as pd\n\n\n\n# Function asks for a dictionary as input with the following keys (and associated datatypes)\n# params = {'input_shape': 3,\n# 'output_shape': 1,\n# 'output_activation': 'sigmoid',\n# 'hidden_...
[ [ "tensorflow.keras.layers.Dense", "tensorflow.keras.regularizers.l1_l2", "tensorflow.keras.layers.Input", "tensorflow.keras.models.Model" ] ]
Nayef211/text
[ "d963bdb82b4c6c5170430fd7289b9dd0a2b9283a" ]
[ "test/datasets/common.py" ]
[ "import pickle\n\nfrom parameterized import parameterized\nfrom torch.utils.data.graph import traverse\nfrom torch.utils.data.graph_settings import get_all_graph_pipes\nfrom torchdata.datapipes.iter import Shuffler, ShardingFilter\nfrom torchtext.datasets import DATASETS\n\nfrom ..common.torchtext_test_case import ...
[ [ "torch.utils.data.graph.traverse" ] ]
hancy16/Variable-rate-generative-compression
[ "a070149744151668b93abbef9b51aac76da733f2" ]
[ "ade_train_script/compress.py" ]
[ "#!/usr/bin/python3\nimport tensorflow as tf\nimport numpy as np\nimport pandas as pd\nimport time, os, sys\nimport argparse\n\n# User-defined\nfrom network import Network\nfrom utils import Utils\nfrom data import Data\nfrom model import Model\nfrom config import config_test, directories\n\ntf.logging.set_verbosit...
[ [ "tensorflow.group", "tensorflow.train.get_checkpoint_state", "tensorflow.control_dependencies", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initializer", "tensorflow.add_to_collection", "tensorflow.train.Saver", "tensorflow.add_n", "tensorflow.ConfigP...