repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
datpy/joiner
[ "13e7b0da28dc39a95d1f64c7d89833bc8897b8af" ]
[ "main.py" ]
[ "import sys\n\nimport pandas as pd\n\ndef main():\n file1 = sys.argv[1]\n file2 = sys.argv[2]\n join_on = sys.argv[3]\n\n df1 = pd.read_csv(file1)\n df2 = pd.read_csv(file2)\n join_fieds = join_on.split(',')\n\n df = df1.merge(df2, on=join_fieds, how='outer')\n df.to_csv(\"output.csv\")\n\nif __name__ == \"...
[ [ "pandas.read_csv" ] ]
jjdelvalle/Merit-Order-Effect
[ "880c930cdb84c456eb851db39bab9411498b1155" ]
[ "moepy/moe.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/dev-05-price-moe.ipynb (unless otherwise specified).\n\n__all__ = ['construct_dispatchable_lims_df', 'construct_pred_mask_df', 'AxTransformer', 'set_ticks', 'set_date_ticks',\n 'construct_df_pred', 'construct_pred_ts', 'calc_error_metrics', 'get_model_pred_...
[ [ "pandas.to_datetime", "numpy.array", "pandas.Timedelta", "sklearn.linear_model.LinearRegression", "numpy.round", "pandas.date_range", "pandas.Series", "numpy.average", "numpy.linspace" ] ]
kanshichao/X-Microscopy
[ "527016f46b39861be9a0fab6066904755990b961" ]
[ "UR-Net-8/main.py" ]
[ "import argparse\nimport os\nimport tensorflow as tf\nfrom Model_lib import pix2pix_generator\nfrom train import pix2pix\nfrom glob import glob\nfrom utils import *\nfrom logger import setup_logger\nfrom PIL import Image\nparser = argparse.ArgumentParser(description='')\nparser.add_argument('--dataset_name', dest='...
[ [ "tensorflow.Session", "tensorflow.app.run", "tensorflow.reset_default_graph", "tensorflow.Graph" ] ]
BlackKite0206233/OpenSfM
[ "fd2842c1d291ff6a8d33ab683c8a1ca947528cd6" ]
[ "opensfm/matching.py" ]
[ "import numpy as np\nimport cv2\nimport pyopengv\nimport logging\n\nfrom timeit import default_timer as timer\nfrom collections import defaultdict\n\nfrom opensfm import csfm\nfrom opensfm import context\nfrom opensfm import log\nfrom opensfm import multiview\nfrom opensfm import pairs_selection\nfrom opensfm impor...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.cos", "numpy.flatnonzero" ] ]
Scrier/udacity
[ "1326441aa2104a641b555676ec2429d8b6eb539f" ]
[ "Deep.Learning/2.Neural-Networks/2.Implementing-Gradient-Scale/part4.py" ]
[ "import numpy as np\n\ndef sigmoid(x):\n \"\"\"\n Calculate sigmoid\n \"\"\"\n return 1/(1+np.exp(-x))\n\ndef sigmoid_prime(x):\n \"\"\"\n # Derivative of the sigmoid function\n \"\"\"\n return sigmoid(x) * (1 - sigmoid(x))\n\nlearnrate = 0.5\nx = np.array([1, 2, 3, 4])\ny = np.array(0.5)\n\...
[ [ "numpy.array", "numpy.dot", "numpy.exp" ] ]
DiogoKramel/SailPy
[ "d8c52641f0bac3afdd7b9d31f60353efadb25929" ]
[ "callbacks/optimizationhullcall.py" ]
[ "import dash\nimport numpy as np\nfrom dash.dependencies import Input, Output, State\nimport dash_core_components as dcc\nimport dash_bootstrap_components as dbc\nimport dash_html_components as html\nfrom app import app\nimport plotly.graph_objs as go\nimport json\nimport codecs\nfrom scipy.integrate import simps\n...
[ [ "numpy.int", "numpy.float" ] ]
wojiazaiyugang/fast-reid
[ "43da387b77fec86248154cb00bd42c106e6bf94a" ]
[ "fastreid/data/data_utils.py" ]
[ "# encoding: utf-8\n\"\"\"\n@author: liaoxingyu\n@contact: sherlockliao01@gmail.com\n\"\"\"\nimport torch\nimport numpy as np\nfrom PIL import Image, ImageOps\nimport threading\n\nimport queue\nfrom torch.utils.data import DataLoader\n\nfrom fastreid.utils.file_io import PathManager\n\n\ndef read_image(file_name, ...
[ [ "numpy.asarray", "torch.cuda.current_stream", "torch.cuda.set_device", "torch.cuda.stream", "numpy.repeat", "torch.cuda.Stream", "numpy.expand_dims" ] ]
gcervantes8/OpenNMT-tf
[ "8cfe999c7b71f8d10caa6fe2af80cdf81d2b8c90", "8cfe999c7b71f8d10caa6fe2af80cdf81d2b8c90" ]
[ "opennmt/models/model.py", "opennmt/tests/config_test.py" ]
[ "\"\"\"Base class for models.\"\"\"\n\nimport abc\n\nimport tensorflow as tf\n\nfrom opennmt import optimizers, schedules\nfrom opennmt.utils import compat, exporters, losses, misc\n\n\nclass Model(tf.keras.layers.Layer):\n \"\"\"Base class for models.\"\"\"\n\n def __init__(self, examples_inputter):\n ...
[ [ "tensorflow.sequence_mask", "tensorflow.GradientTape", "tensorflow.expand_dims", "tensorflow.function", "tensorflow.executing_eagerly", "tensorflow.constant", "tensorflow.reduce_sum", "tensorflow.TensorSpec.from_spec", "tensorflow.nn.sparse_softmax_cross_entropy_with_logits" ...
Pescatore23/robpylib
[ "1ccf1a6116113447d7915be88439fde741b243a0" ]
[ "robpylib/CommonFunctions/Tools.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Feb 18 14:32:41 2019\n\n@author: firo\n\"\"\"\nimport numpy as np\nimport skimage.morphology\nfrom scipy import ndimage as ndi\nimport os\nfrom skimage import measure\nimport matplotlib.pyplot as plt\nplt.ioff()\nfrom mpl_toolkits.mplot3d.art3d import Poly3DCollectio...
[ [ "numpy.median", "numpy.fft.ifft", "scipy.ndimage.distance_transform_cdt", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.any", "numpy.fft.fft", "numpy.sort", "numpy.argsort", "numpy.sqrt", "numpy.arctan2", "matplotlib.pyplot.ioff", "numpy.abs", ...
adishavit/cvxpy
[ "f8851df71eb899cfb94dcd5adbeaf138a0bb0c53" ]
[ "cvxpy/tests/test_conic_solvers.py" ]
[ "\"\"\"\nCopyright 2019, the CVXPY developers.\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 law or agr...
[ [ "numpy.array", "numpy.random.rand", "scipy.linalg.svdvals", "numpy.random.RandomState", "numpy.random.seed", "numpy.ones", "numpy.random.randn", "numpy.linalg.eig", "numpy.all" ] ]
OregonWebSells/ReAgent
[ "866f91785ca86db32fb67744aa063fe77791ff21", "866f91785ca86db32fb67744aa063fe77791ff21" ]
[ "reagent/evaluation/ope_adapter.py", "reagent/preprocessing/postprocessor.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport logging\n\nimport torch\nfrom reagent.evaluation.cpe import (\n CpeEstimate,\n CpeEstimateSet,\n bootstrapped_std_error_of_mean,\n)\nfrom reagent.evaluation.evaluation_data_page import EvaluationDataP...
[ [ "torch.zeros", "torch.argmax", "torch.tensor", "torch.mean", "torch.dot" ], [ "torch.device", "torch.tensor", "torch.randn", "torch.clamp" ] ]
baggiponte/sktime
[ "652570e8935220597bd700ce5cd636f56318d7a6" ]
[ "setup.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Install script for sktime.\"\"\"\n\n# adapted from https://github.com/scikit-learn/scikit-learn/blob/master\n# /setup.py\n\n####################\n\n# Helpers for OpenMP support during the build.\n\n# adapted fom https://github.com/scikit-learn/scikit-learn/blo...
[ [ "numpy.get_include", "numpy.distutils.misc_util.Configuration", "numpy.distutils.ccompiler.new_compiler" ] ]
matousc89/nk-bot
[ "bde87d74ea00b6f947641242b282f2ce40cfc7b9" ]
[ "modules/covid/covid.py" ]
[ "from datetime import date, timedelta\nimport os\n\nfrom scipy import optimize\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pylab as plt\nimport matplotlib.ticker as ticker\n\ndef download_data(data_path):\n \"\"\"\n This function download data from MZCR, form single dataframe, store it and re...
[ [ "matplotlib.pylab.xticks", "matplotlib.pylab.MaxNLocator", "pandas.date_range", "matplotlib.pylab.legend", "matplotlib.ticker.ScalarFormatter", "matplotlib.pylab.close", "matplotlib.pylab.grid", "matplotlib.pylab.show", "matplotlib.pylab.figure", "numpy.exp", "matplotli...
pedrofm00/GEMSEC-Intro
[ "639b03b2d0022e909f8ad0cd3c13b155b406389a" ]
[ "GM_Cluster_Transition_Counter.py" ]
[ "#GMM Cluster Parsing for Count Transitions\n\nimport matplotlib.pyplot as plt\n\ndef reverse(coord_pair):\n store_1 = coord_pair[1]\n store_2 = coord_pair[4]\n rev_coords = '(' + store_1 + ', ' + store_2 + ')'\n return rev_coords\n\ndef count_unique_trans(pred): \n transition_dict = {}\n\n for...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xticks" ] ]
hazem1193/Pocket-detector
[ "712ef73cae00d3e42506fa3037353f702ad55a1b" ]
[ "src/accessibility_scorer.py" ]
[ "from scipy.spatial.distance import euclidean\nfrom scipy.spatial import Delaunay\n\nimport numpy as np\n\n#Calculating accessibility and neighbourhood of residues based on the idea presented in:\n#Detection of Functionally Important Regions in “Hypothetical Proteins” of Known Structure\n\nrad_siz = {'ALAN':1.65, '...
[ [ "numpy.char.mod", "numpy.ones", "scipy.spatial.Delaunay" ] ]
kaizhang1215/mmt
[ "d129a1bacef9c8b46dee24031473d26ea70816d1" ]
[ "data_loader/activitynet_dataset.py" ]
[ "# Copyright 2020 Valentin Gabeur\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agr...
[ [ "numpy.random.RandomState" ] ]
joeization/CycleGAN
[ "9635c8e3a7b1634b2e2eb5b5299f03a4e0786868" ]
[ "generator.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom cbam import cbam, cbam_channel\n\n\nclass Generator_v3(nn.Module):\n def __init__(self, img_size=64, latent_length=64, hidden_length=256):\n super(Generator_v3, self).__init__()\n self.init_size = img_size // 4\n self.latent = ...
[ [ "torch.nn.Linear", "torch.nn.Sequential", "torch.nn.Tanh", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.LeakyReLU", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
devaslooper/Code-Overflow
[ "d7d55ea0f5015bccb5c4100c4240464fcda8504a" ]
[ "Python/3_matrix_multiplication_using_numpy.py" ]
[ "import numpy as np\n\nnp.random.seed(42)\n\nA = np.random.randint(0, 10, size=(2,2))\n\nB = np.random.randint(0, 10, size=(2,3))\n\nC = np.random.randint(0, 10, size=(3,3))\n\nprint(\"Matrix A is:\\n{}, shape={}\\n\".format(A, A.shape))\n\nprint(\"Matrix B is:\\n{}, shape={}\\n\".format(B, B.shape))\n\nprint(\"Mat...
[ [ "numpy.random.seed", "numpy.random.randint", "numpy.matmul" ] ]
datamindedbe/nmbs-realtime-serverless
[ "d4250f3ab02f5209574e3025c64fb8a553c57274", "d4250f3ab02f5209574e3025c64fb8a553c57274" ]
[ "vendored/pandas/tests/sparse/test_frame.py", "vendored/pandas/tests/test_categorical.py" ]
[ "# pylint: disable-msg=E1101,W0612\n\nimport operator\n\nimport pytest\nfrom warnings import catch_warnings\nfrom numpy import nan\nimport numpy as np\nimport pandas as pd\n\nfrom pandas import Series, DataFrame, bdate_range, Panel\nfrom pandas.core.dtypes.common import (\n is_bool_dtype,\n is_float_dtype,\n ...
[ [ "pandas.SparseArray", "pandas.util.testing.assert_raises_regex", "pandas.core.sparse.api.SparseArray", "pandas.core.dtypes.common.is_float_dtype", "numpy.cumsum", "numpy.dtype", "pandas.util.testing.assert_numpy_array_equal", "pandas.Panel.from_dict", "pandas.compat.iteritems",...
gravitype/ai-ml-learning
[ "69ca5abe3f39cec26f44a568b1fcd4363b41518a" ]
[ "happy_sad.py" ]
[ "import tensorflow as tf\nimport os\nimport zipfile\nfrom os import path, getcwd, chdir\n\n# DO NOT CHANGE THE LINE BELOW. If you are developing in a local\n# environment, then grab happy-or-sad.zip from the Coursera Jupyter Notebook\n# and place it inside a local folder and edit the path to that location\npath = f...
[ [ "tensorflow.keras.preprocessing.image.ImageDataGenerator", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.optimizers.RMSprop" ] ]
z-Wind/Reinforcement_Learning
[ "e89257e5a152be5c4350e95a7faf62d66de3d45a" ]
[ "Gym/tools/utils.py" ]
[ "import random\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nfrom collections import deque\nimport cv2\nfrom matplotlib import pyplot as plt\nimport time\nimport itertools\nimport sys\n\n\nclass MemoryDataset(Dataset):\n def __init__(self, size, transforms=None):\n self.memory =...
[ [ "torch.zeros", "matplotlib.pyplot.xlabel", "torch.FloatTensor", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "numpy.ones", "numpy.random.randn", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.pause", "matplotlib.pyplot.ylabel", "...
trip2eee/nnet
[ "08c435a7b40aa0b41eb64875b39d3705cf9cffdd" ]
[ "nnet/loss/mseloss.py" ]
[ "from nnet.loss.loss import Loss\nimport numpy as np\n\nclass MSELoss(Loss):\n def __init__(self):\n super(Loss, self).__init__()\n \n def forward(self, output, target):\n # Mean Squared Error (MSE)\n # diff -> square -> mean\n diff = output - target\n square = np.square(...
[ [ "numpy.square", "numpy.prod", "numpy.ones", "numpy.mean" ] ]
speckhard/jraph
[ "36071d5e0794b1809f73f5e005eea2dfe42bbfb6" ]
[ "jraph/_src/models_test.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.random.random", "numpy.random.randint", "numpy.sum" ] ]
emadshihab/pandas
[ "8f9266a9dac8b041193bf85156d0df1660a660b1" ]
[ "pandas/core/ops/__init__.py" ]
[ "\"\"\"\nArithmetic operations for PandasObjects\n\nThis is not a public API.\n\"\"\"\nimport datetime\nimport operator\nfrom typing import Optional, Set, Tuple, Union\n\nimport numpy as np\n\nfrom pandas._libs import Timedelta, Timestamp, lib\nfrom pandas._libs.ops_dispatch import maybe_dispatch_ufunc_to_dunder_op...
[ [ "pandas.core.ops.common.unpack_zerodim_and_defer", "pandas.core.computation.expressions.evaluate", "pandas.core.ops.array_ops.comparison_op", "pandas.core.construction.extract_array", "pandas._libs.Timedelta", "pandas._libs.lib.is_scalar", "numpy.broadcast_to", "pandas.core.dtypes....
johnlees/PopPUNK-scripts
[ "aee8bb4b595fbde5138488df872cdc5027b9b11e" ]
[ "allele_dists.py" ]
[ "#!/usr/bin/env python\n\nimport argparse\nimport pandas as pd\nimport numpy as np\nfrom math import floor\nimport tqdm\n\ndef main():\n\n parser = argparse.ArgumentParser(description='Pairwise distances between MLST alleles')\n parser.add_argument('infile', type=str, help=\"Tab separated file containing alle...
[ [ "numpy.not_equal", "pandas.DataFrame", "pandas.read_csv", "numpy.zeros" ] ]
preke/ecm
[ "76cabc1a8f965dedb09f1451b53c6e5224800eef" ]
[ "seq2seq.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n# We disable pylint because we need python3 compatibility.\nfrom six.moves import xrange # pylint: disable=redefined-builtin\nfrom six.moves import zip # pylint: disable=redefined-builtin\n\nfrom ten...
[ [ "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.ops.variable_scope.get_variable", "tensorflow.python.ops.math_ops.tanh", "tensorflow.reshape", "tensorflow.python.ops.math_ops.reduce_sum", "tensorflow.python.util.nest.flatten", "tensorflow.stack", "tensorfl...
SINTEF/Thermopack
[ "63c0dc82fe6f88dd5612c53a35f7fbf405b4f3f6", "63c0dc82fe6f88dd5612c53a35f7fbf405b4f3f6" ]
[ "addon/pyExamples/global_binary.py", "pyplot/solid_envelope.py" ]
[ "#!/usr/bin/python\n# Support for python2\nfrom __future__ import print_function\n#Modify system path\nimport sys\nsys.path.append('../pycThermopack/')\n# Importing pyThermopack\nfrom pyctp import cubic\n# Importing Numpy (math, arrays, etc...)\nimport numpy as np\n# Importing Matplotlib (plotting)\nimport matplotl...
[ [ "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ], [ "matplotlib.pyplot.clf", "matplotlib.pyplot.grid", ...
valeriabriones/dvm-dos-tem
[ "8a1807661c3370a196cd6f3a46697133d4701818" ]
[ "scripts/ensemble_setup.py" ]
[ "#!/usr/bin/env python\n\n# T. Carman, Jan 20 2021 (Biden inauguration!)\n\n# A quick stab at setting up an ensemble of runs.\n\nimport os\nimport argparse\nimport textwrap\nimport sys\nimport subprocess\nimport json\nimport numpy as np\nimport netCDF4 as nc\n\ndef setup_for_driver_adjust(exe_path, input_data_path,...
[ [ "numpy.random.normal" ] ]
zrimseku/Reproducibility-Challenge
[ "94885b9a48fce34efa720d6e2a2dd577f194f85f" ]
[ "combine_results.py" ]
[ "import pandas as pd\n\n\ndef result1(print_table=True):\n # building table for result 1\n\n shs27_bfs = pd.read_csv('save_test_results/SHS27k_bfs', sep=',', header=None)\n shs27_dfs = pd.read_csv('save_test_results/SHS27k_dfs', sep=',', header=None)\n shs27_random = pd.read_csv('save_test_results/SHS27...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
Taekyoon/executors
[ "567f12c4193bb7be814f84540ea31585cd35b344" ]
[ "jinahub/indexers/searcher/FaissSearcher/tests/integration/test_train_index.py" ]
[ "__copyright__ = \"Copyright (c) 2021 Jina AI Limited. All rights reserved.\"\n__license__ = \"Apache-2.0\"\n\nimport os\nimport subprocess\n\nimport numpy as np\nimport pytest\nfrom jina import Document, DocumentArray, Flow\nfrom jina.executors.metas import get_default_metas\n\nfrom ...faiss_searcher import FaissS...
[ [ "numpy.random.random" ] ]
FelixFu520/classification
[ "2e8119c229bc978ecaecac0361bf8b573c553d43", "2e8119c229bc978ecaecac0361bf8b573c553d43" ]
[ "models/densenet.py", "dataloaders/MedMnist.py" ]
[ "# _*_coding:utf-8_*_\n# @auther:FelixFu\n# @Date: 2021.4.16\n# @github:https://github.com/felixfu520\n\nimport torch\nfrom torchvision.models.densenet import densenet169\nfrom torchvision.models.densenet import densenet121\nfrom torchvision.models.densenet import densenet161\nfrom torchvision.models.densenet impor...
[ [ "torch.nn.Linear", "torch.nn.Conv2d" ], [ "numpy.fromfile" ] ]
yushangdi/gpytorch
[ "3234046ecb672965af8765d47eb016f85b729bb0" ]
[ "gpytorch/kernels/inducing_point_kernel.py" ]
[ "#!/usr/bin/env python3\n\nimport math\nimport torch\nfrom .kernel import Kernel\nfrom ..functions import add_jitter\nfrom ..lazy import DiagLazyTensor, LazyTensor, MatmulLazyTensor, PsdSumLazyTensor, RootLazyTensor\nfrom ..distributions import MultivariateNormal\nfrom ..mlls import InducingPointKernelAddedLossTerm...
[ [ "torch.trtrs", "torch.cat", "torch.equal", "torch.cholesky" ] ]
gsajko/great_expectations
[ "6d9a0ad886207086019bc43b2bc2629ce38a4f38" ]
[ "tests/conftest.py" ]
[ "import datetime\nimport json\nimport locale\nimport logging\nimport os\nimport random\nimport shutil\nfrom typing import Dict, List\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom freezegun import freeze_time\nfrom ruamel.yaml import YAML\n\nimport great_expectations as ge\nfrom great_expectations ...
[ [ "pandas.DataFrame" ] ]
awesome-archive/OpenVINO-model-server
[ "feb7d7119f56fa0787b83393e38e8ea36762a34b" ]
[ "tests/functional/test_single_model_s3.py" ]
[ "#\n# Copyright (c) 2018-2019 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 applic...
[ [ "numpy.array" ] ]
simpeg/geoana
[ "417e23a0a689da19112e5fd361f823a2abd8785a" ]
[ "tests/test_em_fdem_magnetic_dipole.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport unittest\nimport numpy as np\nimport discretize\n# from SimPEG import Maps\n# from SimPEG.EM import FDEM\n\nfrom scipy.constants import mu_0, epsilon_0\n...
[ [ "numpy.zeros_like", "numpy.linalg.norm", "numpy.random.rand", "numpy.exp", "numpy.allclose", "numpy.sqrt", "numpy.all", "numpy.linspace", "numpy.vstack" ] ]
CM000n/VirtualChoir
[ "c19ab925c0924734b7292e8af8f6aeeca3cf10a5" ]
[ "lib/video_face_haar.py" ]
[ "import cv2\nimport numpy as np\nimport random\n\nface_cascade = cv2.CascadeClassifier('/usr/share/opencv4/haarcascades/haarcascade_frontalface_default.xml')\n \nclass FaceDetect():\n clahe = cv2.createCLAHE(clipLimit=1.5, tileGridSize=(4,4))\n min_count = 10\n interval = 10\n \n def __init__(self...
[ [ "numpy.array" ] ]
magnusross/gpcm
[ "3710ab993891f40818934622e45c9b82ddadf72e" ]
[ "tests/test_sample.py" ]
[ "import lab as B\nfrom gpcm.sample import ESS\nfrom stheno import Normal\nimport numpy as np\n\nfrom .util import approx\n\n\ndef test_ess():\n # Construct a prior and a likelihood.\n prior = Normal(np.array([[0.6, 0.3], [0.3, 0.6]]))\n lik = Normal(\n np.array([[0.2], [0.3]]),\n np.array([[1...
[ [ "numpy.array" ] ]
potter420/polars
[ "63fde060dfef475b85cc20aa8d62b180afee4191" ]
[ "py-polars/polars/internals/lazy_frame.py" ]
[ "\"\"\"\nThis module contains all expressions and classes needed for lazy computation/ query execution.\n\"\"\"\nimport os\nimport shutil\nimport subprocess\nimport tempfile\nimport typing as tp\nfrom typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, Union\n\ntry:\n from polars.polars import Py...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "matplotlib.image.imread", "matplotlib.pyplot.figure" ] ]
augustoproiete-forks/pandas-dev--pandas
[ "fcd73ad2e7482414b61d47056c6c9c220b11702c" ]
[ "pandas/sparse/array.py" ]
[ "\"\"\"\nSparseArray data structure\n\"\"\"\nfrom __future__ import division\n# pylint: disable=E1101,E1103,W0231\n\nfrom numpy import nan, ndarray\nimport numpy as np\n\nimport pandas as pd\nfrom pandas.core.base import PandasObject\nimport pandas.core.common as com\n\nfrom pandas import compat, lib\nfrom pandas.c...
[ [ "pandas.compat.numpy.function.validate_cumsum", "pandas.core.common._values_from_object", "pandas.compat.numpy.function.validate_sum", "pandas.compat.numpy.function.validate_mean", "pandas.core.common._ensure_platform_int", "pandas._sparse.IntIndex", "pandas.core.common.is_float", ...
reidarkind/astropy
[ "8930a14f69360d4db115a85ff9e0f6efa80fa2e7" ]
[ "astropy/io/misc/hdf5.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nThis package contains functions for reading and writing HDF5 tables that are\nnot meant to be used directly, but instead are available as readers/writers in\n`astropy.table`. See :ref:`table_io` for more details.\n\"\"\"\n\nimport os\nimport ...
[ [ "numpy.array" ] ]
JaroAmsterdam/wta-tools
[ "15853d109653a0512a836b0c5ed1e9b1283f5eb6" ]
[ "statistic_scripts/task_wait_time_cdf.py" ]
[ "import os\n\nimport matplotlib\nfrom pyspark.sql import SparkSession\n\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport pyspark.sql.functions as F\n\n\nimport numpy as np\nimport statsmodels.api as sm\nimport pandas as pd\n\n\nclass TaskWaitTimeCDF(object):\n\n def __init__(self, workload_name, d...
[ [ "matplotlib.use", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.step", "pandas.DataFrame", "matplotlib.pyplot.figure", "matplotlib.pyplot.margins", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplo...
abhishek-ch/incubator-airflow
[ "3358551c8e73d9019900f7a85f18ebfd88591450" ]
[ "tests/core.py" ]
[ "# -*- coding: utf-8 -*-\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...
[ [ "numpy.testing.assert_array_almost_equal" ] ]
ssulun16/Adversarial_Video_Generation
[ "6f9c5022f72983c5c46a3df3355c2b05a465706c" ]
[ "Code/d_model.py" ]
[ "import torch.nn as nn\nimport torch\n\nfrom utils import conv_out_size, Flatten\nimport constants as c\n\n\nclass DiscriminatorModel(nn.Module):\n def __init__(self):\n super(DiscriminatorModel, self).__init__()\n\n self.d_model = []\n for scale_num in xrange(c.NUM_SCALE_NETS):\n\n ...
[ [ "torch.nn.Linear", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.LeakyReLU", "torch.clamp", "torch.nn.Conv2d" ] ]
mwernerds/agile21_abstaining
[ "3aad12beeaaa8a6a52212ec310e756b67b6eb622" ]
[ "02_single_classifiers.py" ]
[ "# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>\n# Olivier Grisel <olivier.grisel@ensta.org>\n# Mathieu Blondel <mathieu@mblondel.org>\n# Lars Buitinck\n# License: BSD 3 clause\n\n# extensions and modifications (c) Martin Werner\nfrom __future__ import print_function\n\nimport l...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.neighbors.NearestCentroid", "sklearn.linear_model.Perceptron", "sklearn.feature_selection.SelectKBest", "sklearn.svm.LinearSVC", "numpy.max", "sklearn.metrics.accuracy_score", "sklearn.linear_model.SGDClassifier", "sklearn.linear_mod...
DableUTeeF/mmdetection-to-tensorrt
[ "370afa902534b17e94aa692cc30f87f128688b98" ]
[ "mmdet2trt/models/dense_heads/vfnet_head.py" ]
[ "import torch\n\nimport mmdet2trt.core.post_processing.batched_nms as batched_nms\nimport mmdet2trt.ops.util_ops as mm2trt_util\nfrom mmdet2trt.core.bbox import batched_distance2bbox\nfrom mmdet2trt.models.builder import register_wraper\nfrom mmdet2trt.models.dense_heads.anchor_free_head import AnchorFreeHeadWraper...
[ [ "torch.cat" ] ]
totticarter/faiss
[ "d9b2388c4b3dacf75fd2adc6247bdb2219ffd28c" ]
[ "faiss.py" ]
[ "# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD+Patents license found in the\n# LICENSE file in the root directory of this source tree.\n\n#@nolint\n\n# not linting this file because it imports * form swigfaiss, which\n# causes a ton of useless ...
[ [ "numpy.empty", "numpy.dtype", "numpy.zeros" ] ]
sunsetyuhi/numcalc_py
[ "b6d8749eede341e6709c21d2ba03c2bf7416b7d4" ]
[ "nonlinear_equation/bisection/bisection.py" ]
[ "#二分法による非線型方程式の解法プログラム\nimport numpy as np #数値計算用モジュール\nimport matplotlib.pyplot as plt #データ可視化用モジュール\n\n\n#解きたい方程式\ndef func_f(x):\n return x**2.0 -2.0\n\n\n#二分法(方程式の関数項、探索区間の左端、探索区間の右端、誤差範囲、最大反復回数)\ndef bisection(func_f, x_min, x_max, error=1e-10, max_loop=100):\n #初期値を表示\n num_calc = 0 #計算回数\n pri...
[ [ "matplotlib.pyplot.axhline", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.arange", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter" ] ]
BouncyButton/koi
[ "309c4c6485d61ad097fc9392c765cd186b7cb483" ]
[ "koi/trainer/base_trainer.py" ]
[ "import os\n\nimport numpy as np\nimport torch\nfrom typing import Optional, Type\n\nfrom ..config.base_config import BaseConfig\nfrom ..dataset.base_dataset import KoiDataset\nfrom ..model.base_model import GenerativeModel\nimport random\nfrom torch.utils.tensorboard import SummaryWriter\n\n\nclass Trainer:\n \...
[ [ "torch.device", "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "numpy.random.seed", "torch.manual_seed", "torch.cuda.is_available" ] ]
tkornut/ptp
[ "50c78c8f03024a71fc3d7959bfed9f238634141e" ]
[ "ptp/components/text/bow_encoder.py" ]
[ "# Copyright (C) tkornuta, IBM Corporation 2019\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applic...
[ [ "torch.cat" ] ]
daring-board/doc2vec_exprimental
[ "ef966be2ada4a3b5d5c6c273dd037a9180c04891" ]
[ "distance.py" ]
[ "import pandas as pd\nfrom gensim import models\nfrom janome.tokenizer import Tokenizer\nfrom janome.analyzer import Analyzer\nfrom janome.charfilter import *\nfrom janome.tokenfilter import *\nimport neologdn\nimport re\n\ndef split_into_words(text, tokenizer):\n # tokens = tokenizer.tokenize(text)\n normali...
[ [ "pandas.read_pickle" ] ]
airodynsystems/CenterNet
[ "c2fdffd4af42ed270542ebebee7081f27dbb2eb1" ]
[ "train.py" ]
[ "#!/usr/bin/env python\nimport os\n\nimport json\nimport torch\nimport numpy as np\nimport queue\nimport pprint\nimport random\nimport argparse\nimport importlib\nimport threading\nimport traceback\n\nfrom tqdm import tqdm\nfrom utils import stdout_to_tqdm\nfrom config import system_configs\nfrom nnet.py_factory im...
[ [ "torch.multiprocessing.Process", "torch.multiprocessing.Queue" ] ]
sayakray111/placentagen
[ "12b0643f9e0fefbd4fe26b45d88d923586ef0414" ]
[ "source/placentagen/generate_shapes.py" ]
[ "#!/usr/bin/env python\nimport numpy as np\nfrom scipy.spatial import Delaunay\n\nfrom . import pg_utilities\nfrom . import imports_and_exports\n\n\"\"\"\n.. module:: generate_shapes\n :synopsis: Contains code to generate placental shapes for generic placental models.\n\n:synopsis:Contains code to generate placent...
[ [ "numpy.copy", "numpy.resize", "numpy.sign", "numpy.where", "numpy.cos", "scipy.spatial.Delaunay", "numpy.sin", "numpy.nonzero", "numpy.sqrt", "numpy.vstack", "numpy.delete", "numpy.zeros", "numpy.linalg.det", "numpy.arctan", "numpy.hstack", "numpy.fl...
eircfb/benchmark
[ "9d75577382089b742a972800c7c892f831910d91" ]
[ "torchbenchmark/models/timm_vision_transformer/__init__.py" ]
[ "# Generated by gen_timm_models.py\nimport torch\nimport timm.models.vision_transformer\n\nfrom ...util.model import BenchmarkModel\nfrom torchbenchmark.tasks import COMPUTER_VISION\nfrom .config import TimmConfig\n\nclass Model(BenchmarkModel):\n task = COMPUTER_VISION.GENERATION\n\n def __init__(self, devic...
[ [ "torch.cuda.empty_cache", "torch.empty", "torch.jit.script", "torch.no_grad" ] ]
ricklentz/trfl
[ "ed6eff5b79ed56923bcb102e152c01ea52451d4c" ]
[ "trfl/clipping_ops.py" ]
[ "# Copyright 2018 The trfl 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 required by...
[ [ "tensorflow.compat.v1.minimum", "tensorflow.compat.v1.name_scope", "tensorflow.compat.v1.abs" ] ]
StevenHuang2020/OpencvPython
[ "42cde4880a50f7b3917027e6359485d3569bf40f" ]
[ "src/otsuAlgorithm.py" ]
[ "# python3 Steven Otsu binary segmentation\nimport cv2\nfrom ImageBase import loadImg, plotImg, grayImg, binaryImage\n# from mainImageHist import plotImagAndHist, plotImgHist\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef calculateOtsu(img):\n hist = cv2.calcHist([img], [0], None, [256], [0, 256])...
[ [ "numpy.max", "numpy.array", "numpy.isnan", "numpy.hsplit", "numpy.sum", "numpy.arange", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ] ]
1013497232/SK-FLOW
[ "a74fd828a081ad8bc05e6b2967c3cdeb48557cde" ]
[ "flowdetect/vis.py" ]
[ "import numpy as np\nfrom sklearn import manifold, decomposition\nfrom matplotlib import pyplot as plt\nfrom sklearn.externals._arff import xrange\n\n\nclass vis:\n colors = ['black', 'blue', 'green', 'yellow', 'red']\n\n def __init__(self, X, y):\n self.X = X.values[0:1000,0:28]\n self.y = y.va...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "sklearn.manifold.TSNE", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "sklearn.decomposition.PCA" ] ]
rtloftin/interactive_agents
[ "f7d57d1421000b2e8a79a9dff179b8fe7c8d3fc0" ]
[ "junk/torchscript_test.py" ]
[ "'''Test the us of TorchScript to export and import of models with graph structure'''\nfrom collections import namedtuple\nimport gym\nfrom gym.spaces import Discrete, Box\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.optim import Adam\nfrom typing import Union, Tuple, Optional\n\nSample = na...
[ [ "torch.nn.Linear", "torch.zeros", "torch.jit.freeze", "torch.nn.functional.one_hot", "torch.nn.LSTM", "torch.nn.utils.rnn.pad_sequence", "torch.nn.functional.log_softmax", "torch.jit.load", "torch.jit.save", "numpy.random.uniform", "numpy.random.randint", "torch.ten...
wyf2017/DBSM
[ "23b55406f19a0ee6059f12c3356bd87ffb55c756" ]
[ "main.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n\nimport os\nimport torch\n\nimport logging\nlogging.basicConfig(level=logging.INFO, format=' %(asctime)s - %(levelname)s - %(message)s')\nlogger = logging.getLogger(__name__)\n\n\ndef get_settings():\n\n import argparse\n parser = argparse.ArgumentParser(desc...
[ [ "torch.manual_seed", "torch.cuda.is_available", "torch.cuda.manual_seed" ] ]
luiky/HIdataSet
[ "9c57b79a6170d05dd67298e9082579ed9c553e99" ]
[ "acquisition/WorldGenerator.py" ]
[ "import random\nimport math, numpy\nimport json\nimport time\n\nfrom PySide2 import QtCore, QtGui, QtWidgets\n\nfrom human import Human, Head\nfrom robot import Robot\nfrom midPoint import MidPoint\nfrom regularobject import RegularObject\nfrom irregularobject import IrregularObject\nfrom room import Room\nfrom int...
[ [ "numpy.array", "numpy.linalg.norm" ] ]
Sanjeeev-K/Quad-rotor-Project
[ "69abf20edc822d5e15127df0d3f7f00ab2b03dbf" ]
[ "Planner/parse_world.py" ]
[ "import xml.etree.ElementTree as ET\nimport pandas as pd\nimport numpy as np\n\n'''\nParse relevant obstacle info from world file\n\ninput : path to the worl file\noutput : panda dataframe structured as follow\n\nReference | Name | Position | Size\n\nReference : Which obstacle it is\nName : Name of the part of the ...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
jpgard/ffn
[ "e7eabc6dee9c9d9151e9e7aa3efc33977a71d2a2" ]
[ "ffn/training/model.py" ]
[ "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed...
[ [ "tensorflow.trainable_variables", "tensorflow.verify_tensor_all_finite", "tensorflow.summary.scalar", "tensorflow.sigmoid", "tensorflow.summary.histogram", "tensorflow.logging.error", "tensorflow.Variable", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.placehol...
christiancosgrove/cs767hw3
[ "7c906d7b92394cc30ed94a714b199467c269cadf" ]
[ "parlai/agents/hred/hred.py" ]
[ "import argparse\nimport time\n\nimport torch.nn.init as init\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader\nfrom parlai.core.torch_generator_agent import TorchGeneratorAgent, PPLMetric\nfrom parlai.core.torch_agent import Batch\nfrom parlai.utils.misc import warn_once\n\nfrom .modules impor...
[ [ "torch.nn.init.orthogonal", "torch.utils.data.DataLoader", "torch.nn.init.normal" ] ]
MatusBako/ZZN-2018
[ "1705ab99b866eabe175f406e55e3a98c86d83039" ]
[ "example_both_tables_all_ratings.py" ]
[ "#!/usr/bin/env python3\n\nfrom matplotlib import pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom time import time\n\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.model_selection import train_test_split\n\nfrom user_processing import get_users\nfrom place_processing import get_plac...
[ [ "numpy.array", "numpy.random.seed", "sklearn.ensemble.RandomForestClassifier", "numpy.mean", "numpy.std", "matplotlib.pyplot.tight_layout", "numpy.argsort", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
wew84/cnn_bridge
[ "7cd98e204922174ea9293d8c52c30d00733a7ed2" ]
[ "bin/segmentation/deeplab_segmenter.py" ]
[ "#!/usr/bin/python\n# BSD 3-Clause License\n\n# Copyright (c) 2019, Noam C. Golombek\n# All rights reserved.\n\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n\n# 1. Redistributions of source code must retain the a...
[ [ "numpy.asarray", "tensorflow.Graph", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.ConfigProto" ] ]
CRLab/curvox
[ "7ef47a9189cb01997164ff0c88b301d1895d6cac" ]
[ "src/curvox/mesh_comparisons.py" ]
[ "import math\nimport meshlabxml\nimport os\nimport tempfile\nimport plyfile\nimport numpy as np\nimport numba\nimport binvox_rw\nimport subprocess\n\n\ndef print_hausdorff(hausdorff_distance):\n for key, value in hausdorff_distance.items():\n print('{}: {}'.format(key, value))\n\n\n@numba.njit\ndef minmax...
[ [ "numpy.logical_or", "numpy.count_nonzero", "numpy.logical_and" ] ]
msf235/network_analysis
[ "650498a7ac882bc8c7a9dcad05c3576f38129ade" ]
[ "tasks/latent_variable_receptive_field_encoding.py" ]
[ "import math\nfrom typing import Callable, Union, Dict, Tuple, Optional\nimport torch\nimport torch.utils.data\n\n# import Dataset, DataLoader\n\nclass InpData(torch.utils.data.Dataset):\n \"\"\"\"\"\"\n\n def __init__(self, X, Y):\n # self.X = torch.from_numpy(X).float()\n # self.Y = torch.from...
[ [ "torch.zeros", "torch.rand", "torch.cat", "torch.stack", "torch.linspace", "torch.randint", "torch.utils.data.DataLoader", "torch.remainder", "torch.meshgrid", "torch.exp", "torch.randn", "torch.sum" ] ]
Sergio884/proyecto-senales
[ "06dfa4483467480621ac3f1881e5c6bea5f757b1" ]
[ "src/main.py" ]
[ "from tkinter import *\nimport matplotlib.pyplot as plt\nfrom matplotlib import pyplot\nimport numpy as np\n\n# Archivos de uso común\nfrom senalDiscreta import *\nfrom manejadorDeSenales import *\n\n# Archivos que contienen las operaciones ----------------------------- AGREGAR AQUI SUS ARCHIVOS CORRESPONDIENTES A ...
[ [ "matplotlib.pyplot.setp", "matplotlib.pyplot.stem", "matplotlib.pyplot.axhline", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axvline", "matplotlib.pyplot.subplot" ] ]
HNoorazar/Kirti
[ "fb7108dac1190774bd90a527aaa8a3cb405f127d" ]
[ "remote_sensing/python/drivers/04_Savitzky_peak_plots_tables/2years/zz_right_before_SOS_renamedAug26/Grant_2017_regular_plts/d_2Yrs_regularized_Grant_SG_plots.py" ]
[ "####\n#### July 2. This is a copy of the version we had from before. plotting one year.\n#### Here we are extending it to 2 years. Since August of a given year to the end\n#### of the next year.\n####\n\n\"\"\"\nJust generate peak plots for Grant 2017 fields \nfor all cultivars; EVI and my peak finder\n\"\"\"\nimp...
[ [ "matplotlib.pyplot.savefig", "pandas.read_csv", "matplotlib.pyplot.subplots", "pandas.plotting.register_matplotlib_converters" ] ]
caoy1996/CrossLingualSumm
[ "5f8833cd976d5ae872f997e96c0716d6976228f7" ]
[ "train_xsumm.py" ]
[ "#!/usr/bin/env python3 -u\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nTrain a new model on one or across multiple GPUs.\n\"\"\"\n\nimport collections\nimport math\nimpor...
[ [ "numpy.random.seed", "torch.multiprocessing.spawn", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.set_device", "torch.cuda.is_available" ] ]
abishekChouhan/yolo_v3_tensorflow
[ "14b069e132040684b6c6280a6a6634ced5fffb28" ]
[ "del_me.py" ]
[ "import numpy as np\n\nanchors = '10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326'\n\n\nx = np.reshape(np.asarray(anchors.split(','), np.float32), [-1, 2])\ny = np.expand_dims(x*2,1)\n\nprint(np.minimum(-y/2,-x/2))\n" ]
[ [ "numpy.expand_dims", "numpy.minimum" ] ]
lovaulonze/py-wdf-reader
[ "f9632eaf35fe51634bdce71dc0a6937e1454707f" ]
[ "examples/ex9_streamline.py" ]
[ "#! /usr/bin/env python3\n\n###########################################################\n# The example shows how to get mapping data #\n# The peak ratio at 1315 cm^-1 and 1380 cm^-1 are plotted #\n# Details see Small 14, 1804006 (2018). #\n############################################...
[ [ "matplotlib.pyplot.colorbar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.image.imread", "numpy.min", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.where", "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.p...
twni2016/f-IRL
[ "a3f1ec66f29c6d659abba630f70f8ae2e59ebe1e" ]
[ "utils/collect.py" ]
[ "import numpy as np\nimport torch\nfrom utils.it_estimator import entropy as it_entropy\nfrom utils.it_estimator import kldiv\nfrom scipy.stats import multivariate_normal\n\n# Collect samples using the SAC policy\ndef collect_trajectories_policy(env, sac_agent, n=10000, state_indices=None):\n '''\n Samples n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.empty", "scipy.stats.multivariate_normal.rvs", "numpy.log", "numpy.random.choice", "numpy.logical_and", "numpy.random.uniform", "numpy.take_along_axis" ] ]
evimacs/omicron
[ "abe77fd25a93cf3d0d17661ae957373474724535" ]
[ "tests/__init__.py" ]
[ "\"\"\"Unit test package for omicron.\"\"\"\nimport asyncio\nimport json\nimport logging\nimport os\nimport socket\nimport subprocess\nimport sys\nfrom contextlib import closing\n\nimport aiohttp\nimport aioredis\nimport cfg4py\nimport pandas as pd\n\ncfg = cfg4py.get_instance()\nlogger = logging.getLogger(__name__...
[ [ "pandas.to_datetime", "pandas.read_csv" ] ]
FilipaRamos/Rl-Pusher
[ "40aa123695f7f2c96dbc11be9d92abefdf2d12c4" ]
[ "src/envs/deepPusherEnv.py" ]
[ "#!/usr/bin/env python3\nimport gym\nimport json\nimport rospy\nimport rospkg\nimport numpy as np\n\nfrom gym import utils, spaces\nfrom gym.utils import seeding\n\nfrom std_srvs.srv import Empty\nfrom nav_msgs.msg import Odometry\nfrom sensor_msgs.msg import LaserScan\nfrom gazebo_msgs.srv import SetModelState\nfr...
[ [ "numpy.square", "numpy.isinf", "numpy.isnan", "numpy.asarray", "numpy.zeros", "numpy.random.uniform", "numpy.clip", "numpy.flip", "numpy.array2string" ] ]
thdg/punch
[ "9b6072e0ee75fa802b11d5fd2be4c906f4f68378" ]
[ "soundscape.py" ]
[ "import random\n\nfrom player import Player\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.widgets import Slider, Button, RadioButtons\nfrom matplotlib.animation import FuncAnimation\n\n\ndef dist(a, b):\n values = []\n for _a, _b in zip(a, b):\n if _a is not None and _b is not None:\n ...
[ [ "matplotlib.widgets.Slider", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.widgets.RadioButtons", "matplotlib.pyplot.axes" ] ]
mayanksingh09/transformers
[ "76cadb7943c8492ec481f4f3925e9e8793a32c9d" ]
[ "tests/test_modeling_flax_common.py" ]
[ "# 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#\n# Unless requir...
[ [ "numpy.array", "torch.no_grad", "numpy.abs" ] ]
egochao/transformer_with_einsum
[ "d787cb4fa428eea65148f9ff294903b4caa05ad6" ]
[ "modules/encoder.py" ]
[ "import torch\nfrom torch import nn\nfrom .attention import CustomMultiHeadAttention\nfrom .blocks import PositionwiseFeedForward, CustomLayerNorm\nfrom .position_layers import PositionEncoding\n\n\nclass CustomEncoderLayer(nn.Module):\n def __init__(self, dim, n_head, ffn_hidden=None, dropout=0.0):\n \"\...
[ [ "torch.nn.Dropout", "torch.nn.Embedding" ] ]
cyysc1998/EDVRDarts
[ "201badbc8c6469b519647a8869c3782ebe1176cf" ]
[ "lib/procedures/search_main_v2.py" ]
[ "##################################################\n# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2019 #\n##################################################\nimport os, sys, time, torch\n\n# modules in AutoDL\nfrom log_utils import AverageMeter, time_string\nfrom models import change_key\nfrom .eval_funcs import obt...
[ [ "torch.log", "torch.mean" ] ]
Team007s/Currency-Converter
[ "b4f549a824b39cd823193997f9c7978626fac59f" ]
[ "main.py" ]
[ "#---import required modules\nimport requests\nfrom tkinter import *\nimport tkinter as tk\nfrom tkinter import ttk\nfrom matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,NavigationToolbar2Tk) \nfrom matplotlib.figure import Figure \nimport base64\nimport calc\nfrom datetime import (datetime, date)\n#---...
[ [ "matplotlib.figure.Figure", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg", "matplotlib.backends.backend_tkagg.NavigationToolbar2Tk" ] ]
GurcanDurukan/google-research
[ "85fcb6fedaeb9a91e6a27ac469773771fca41634" ]
[ "non_semantic_speech_benchmark/data_prep/audio_to_embeddings_beam_utils.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.max", "numpy.logical_or", "numpy.array", "tensorflow.io.gfile.GFile", "numpy.array_equal", "numpy.reshape", "numpy.pad", "tensorflow.expand_dims", "tensorflow.io.gfile.glob", "tensorflow.lite.Interpreter", "numpy.min", "numpy.mean", "tensorflow.io.gfile.m...
MS642/Image-Search
[ "f9d2c485db015988ada3ab0c406d51a695567528" ]
[ "image-search.py" ]
[ "import sys\nimport argparse\nimport torch\nimport glob\nimport collections\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom PIL import Image\nfrom torchvision.models import vgg16\nfrom torchvision import transforms\n\nplt.rcParams[\"font.size\"] = 16\nimages_db = collections.defa...
[ [ "matplotlib.pyplot.get_current_fig_manager", "pandas.DataFrame", "matplotlib.pyplot.Button", "matplotlib.pyplot.figure", "torch.unsqueeze", "torch.nn.functional.softmax", "matplotlib.pyplot.show", "matplotlib.pyplot.axes", "torch.sort", "matplotlib.pyplot.imshow" ] ]
wutong8023/Continual-MM
[ "0e39b1f4791f0444ed3ee4e8c6fc55bfcc2d001c" ]
[ "test/test3.py" ]
[ "\"\"\"\n\n\nAuthor: Tong\nTime: --2021\n\"\"\"\n\nimport json\nimport numpy as np\n\nwith open(\"data/webred/webred_21.json\", \"r\") as file_in:\n original_data = json.load(file_in)\n\n# process data into <x, y>\n_pair_data = []\nfor item in original_data:\n _pair_data.append([item['sentence'], item['relati...
[ [ "numpy.max", "numpy.where", "numpy.array", "numpy.size" ] ]
ymodak/agents
[ "a6ab65605a6910cb3130a500614d006c9271157b" ]
[ "tf_agents/environments/atari_preprocessing.py" ]
[ "# coding=utf-8\n# Copyright 2018 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b...
[ [ "numpy.empty", "numpy.asarray", "numpy.expand_dims", "numpy.maximum" ] ]
sneakerkg/ogb
[ "75614dcf912281c73dbb33e0b64d69f853eeffe4" ]
[ "examples/linkproppred/citation/graph_saint.py" ]
[ "import argparse\n\nimport torch\nimport numpy as np\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\n\nfrom torch_sparse import SparseTensor\nfrom torch_geometric.data import GraphSAINTRandomWalkSampler\nfrom torch_geometric.nn import GCNConv\nfrom torch_geometric.utils import to_undirect...
[ [ "torch.nn.Linear", "torch.device", "torch.sigmoid", "torch.cat", "torch.nn.ModuleList", "torch.no_grad", "torch.nn.functional.dropout", "torch.manual_seed", "torch.cuda.is_available", "numpy.clip", "torch.nn.functional.relu", "torch.log" ] ]
xiaomore/learnBert
[ "a4a84884dc3ef76bfd203bdb83c3948656b35eaf" ]
[ "tokenization.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.gfile.GFile" ] ]
lywang3081/MRDC
[ "7f8ec5060495560d6e307d89341ccf5598dcb85b" ]
[ "2_LUCIR_+DC/modified_resnet.py" ]
[ "import torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\nimport modified_linear\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\"3x3 convolution with padding\"\"\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,\n padding=1, bias=False...
[ [ "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.init.constant_", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
artemcpp/aqueduct
[ "2fc177b9e533dbe900f5878b9cc7a9c0e9eed179" ]
[ "tests/benchmarks/bench_queue_transfer.py" ]
[ "\"\"\"Counts the time of transferring an object to the queue and reading it from it.\n\nCompares different implementations: torch tensor, numpy array, with and without shared memory.\nRun: `python -m tests.perf.queue_transfer`\n\"\"\"\nimport multiprocessing as mp\nimport time\nfrom multiprocessing import Queue\n\...
[ [ "torch.from_numpy" ] ]
rciez2125/IPCCScenarioAnalysis
[ "d9d771678c795558b722412b7a455cc56a429d6d" ]
[ "IPCCCCSNPV_byType.py" ]
[ "import pandas as pd\nimport numpy as np\nimport warnings\nimport io\nimport itertools\nimport yaml\nimport math\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport os \n\n\n# read csv data\n#df = pd.read_excel('./assessment/output/fig2.9_data_table.xlsx')\ndf = pd.read_csv('./asses...
[ [ "matplotlib.use", "matplotlib.pyplot.xlim", "numpy.round", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "numpy.sum", "matplotlib.pyplot.boxplot", "numpy.linspace", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotl...
tobegit3hub/enas_model
[ "66fde22203ba022d1bea3ca333f9a4ac2bec849b" ]
[ "main.py" ]
[ "#!/usr/bin/env python\n\nimport os\nimport json\nimport logging\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.contrib import rnn\n\nfrom cell import dnn_cell\n\n\ndef main():\n trainRnnModel = TrainRnnModel()\n trainRnnModel.train()\n\n\nclass TrainRnnModel(object):\n def __init__(self):\n ...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "numpy.random.rand", "tensorflow.contrib.rnn.BasicLSTMCell", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.contrib.rnn.MultiRNNCell", "tensorflow.nn.tanh", "tensorflow.global_variables_initializer", "tensorflow.train.G...
forero/two_percent_DESI
[ "06ac4d5f1d1bb9d4659121543dbfa99dced2e6e6" ]
[ "dc17a/join_truth_targets.py" ]
[ "#!/usr/bin/env python\n\nfrom __future__ import absolute_import, division, print_function\nfrom mpi4py import MPI\n\nimport os, sys, glob, time\n\nimport numpy as np\nimport fitsio\n\ndef merge_table_data(infiles, ext=1):\n '''\n Merge the tables in HDU 1 of a set of input files\n '''\n data = [fitsio....
[ [ "numpy.hstack" ] ]
nvictus/cooltools
[ "1fec21c919cc19c9669fc941cf3b06cce51239e6", "1fec21c919cc19c9669fc941cf3b06cce51239e6" ]
[ "cooltools/snipping.py", "cooltools/lib/common.py" ]
[ "from functools import partial\nimport warnings\n\nimport numpy as np\nimport pandas as pd\nimport bioframe\n\nfrom .lib.numutils import LazyToeplitz\n\n\ndef make_bin_aligned_windows(\n binsize, chroms, centers_bp, flank_bp=0, region_start_bp=0, ignore_index=False\n):\n \"\"\"\n Convert genomic loci into ...
[ [ "numpy.concatenate", "numpy.full", "numpy.asarray", "pandas.DataFrame", "numpy.any", "numpy.argsort", "numpy.dstack" ], [ "pandas.Series" ] ]
Young2019/TextGAN-PyTorch
[ "883078215fd091dbbd0a53c99be22c147fdedaf3" ]
[ "instructor/real_data/instructor.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author : William\n# @Project : TextGAN-william\n# @FileName : instructor.py\n# @Time : Created at 2019-04-25\n# @Blog : http://zhiweil.ml/\n# @Description : \n# Copyrights (C) 2018. All Rights Reserved.\n\nimport torch\nimport torch.nn as nn\n\nimport con...
[ [ "torch.nn.NLLLoss", "torch.no_grad", "torch.load" ] ]
finani/segmentation_models.pytorch
[ "2def0690e501b6e51330aafb22f56e3f0f3ad262" ]
[ "tests/test_losses.py" ]
[ "import pytest\nimport torch\nimport segmentation_models_pytorch as smp\nimport segmentation_models_pytorch.losses._functional as F\nfrom segmentation_models_pytorch.losses import (\n DiceLoss,\n JaccardLoss,\n SoftBCEWithLogitsLoss,\n SoftCrossEntropyLoss,\n TverskyLoss,\n)\n\n\ndef test_focal_loss_...
[ [ "torch.no_grad", "torch.tensor" ] ]
DikshaSharma-glitch/mice_initial_revision
[ "7a1384f6075866ca0d5cd6ac5ddbc0f340e6eaf4" ]
[ "DataTransform_Training/DataTransformation.py" ]
[ "from datetime import datetime\nfrom os import listdir\nimport pandas\nfrom application_logging.logger import App_Logger\n\n\nclass dataTransform:\n\n \"\"\"\n This class shall be used for transforming the Good Raw Training Data before loading it in Database!!.\n\n Written By: iNeuro...
[ [ "pandas.read_csv" ] ]
RyanHTR/improved_wgan_training
[ "65fe0de54641dda12967fd63446390c224e5851a" ]
[ "tflib/ops/conv2d.py" ]
[ "import tflib as lib\nfrom sn import spectral_normed_weight\nimport numpy as np\nimport tensorflow as tf\n\n_default_weightnorm = False\ndef enable_default_weightnorm():\n global _default_weightnorm\n _default_weightnorm = True\n\n_weights_stdev = None\ndef set_weights_stdev(weights_stdev):\n global _weigh...
[ [ "numpy.square", "tensorflow.nn.conv2d", "numpy.zeros", "numpy.ones", "tensorflow.variable_scope", "tensorflow.name_scope", "numpy.sqrt", "tensorflow.nn.bias_add", "tensorflow.square", "tensorflow.get_collection" ] ]
DragonDriver/arctern
[ "bd364f7e5e234e24216a1754f8f50ac4f838f2f2" ]
[ "tests/perf_regression.py" ]
[ "import os\nimport numpy\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import MultipleLocator\n\n# pylint: disable=redefined-outer-name\n# pylint: disable=exec-used\n\ndef fetch_log_files(directory):\n log_files = []\n files = os.listdir(directory)\n for f in files:\n if os.path.splitext(...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.mean", "numpy.std", "matplotlib.pyplot.MultipleLocator", "matplotlib.p...
backpropper/s2p
[ "86f2330efa061608c703dabf00c711d09253170c" ]
[ "or_game/utils.py" ]
[ "import itertools\nimport os\nimport pickle\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\n\n\ndef get_onehot(vec_len, pos):\n v = np.zeros(vec_len)\n v[pos] = 1\n return v\n\n\ndef save_to_file(vals, folder='', file=''):\n if not os.path.exists(folder):\n os.makedirs(folde...
[ [ "numpy.concatenate", "torch.stack", "numpy.zeros", "torch.tensor", "torch.nn.functional.softmax", "torch.log", "torch.empty", "torch.argmax" ] ]
cathedralpkg/Pilgrim
[ "7ad87a662c406a1789c376a19dd7e8e357f7d557" ]
[ "src/common/Ugraph.py" ]
[ "'''\n---------------------------\n Licensing and Distribution\n---------------------------\n\nProgram name: Pilgrim\nVersion : 2021.5\nLicense : MIT/x11\n\nCopyright (c) 2021, David Ferro Costas (david.ferro@usc.es) and\nAntonio Fernandez Ramos (qf.ramos@usc.es)\n\nPermission is hereby granted, free of cha...
[ [ "numpy.array", "numpy.linalg.eigh", "numpy.linalg.norm", "numpy.zeros" ] ]
SurgicalAI/Docs-Class
[ "98634d38be427d5870e9e563b0771f7a83e23c45" ]
[ "models/hbert/__main__.py" ]
[ "import random\nimport time\n\nimport numpy as np\nimport torch\nfrom transformers import AdamW, BertTokenizer, WarmupLinearSchedule\n\nfrom common.constants import *\nfrom common.evaluators.bert_evaluator import BertEvaluator\nfrom common.trainers.bert_trainer import BertTrainer\nfrom datasets.bert_processors.aapd...
[ [ "torch.cuda.manual_seed_all", "numpy.random.seed", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.is_available", "torch.load", "torch.nn.DataParallel" ] ]
KelOdgSmile/ml-cvnets
[ "d9064fe7e7a2d6a7a9817df936432856a0500a25", "d9064fe7e7a2d6a7a9817df936432856a0500a25" ]
[ "utils/ddp_utils.py", "utils/tensor_utils.py" ]
[ "#\n# For licensing see accompanying LICENSE file.\n# Copyright (C) 2020 Apple Inc. All Rights Reserved.\n#\n\n\nimport socket\nimport torch\nimport torch.distributed as dist\nfrom utils import logger\n\n\ndef is_master(opts) -> bool:\n node_rank = getattr(opts, \"ddp.rank\", 0)\n return (node_rank == 0)\n\n\...
[ [ "torch.zeros", "torch.distributed.is_nccl_available", "torch.distributed.init_process_group", "torch.cuda.nccl.version", "torch.distributed.is_initialized", "torch.cuda.is_available", "torch.distributed.get_rank" ], [ "torch.distributed.get_world_size", "torch.mul", "to...