repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
bryant1410/detectron2
[ "a24863f6a753631599d69adca45654734b2ae7c3" ]
[ "detectron2/utils/visualizer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport colorsys\nimport numpy as np\nfrom enum import Enum, unique\nimport cv2\nimport matplotlib as mpl\nimport matplotlib.colors as mplc\nimport matplotlib.figure as mplfigure\nimport pycocotools.mask as mask_util\nimport torch\nfrom matplot...
[ [ "numpy.split", "numpy.sqrt", "numpy.asarray", "numpy.max", "torch.unique", "torch.device", "matplotlib.colors.to_rgb", "numpy.unique", "matplotlib.backends.backend_agg.FigureCanvasAgg", "numpy.clip", "numpy.stack", "numpy.frombuffer", "numpy.argmax", "numpy....
squarefaceyao/CAU-No.455-Lab
[ "25ee9c063eeb426236911e0637da39d92f492cb6" ]
[ "utils/load_cau_ara.py" ]
[ "#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n'''=================================================\n@Project -> File :Endeavour -> cau_ara\n@IDE :PyCharm\n@Author :Mr. Y\n@Date :2021-09-28 17:00\n@Desc :加载数据,\n=================================================='''\nimport torch\nfrom torch import tensor\...
[ [ "torch.Generator", "pandas.read_csv", "numpy.expand_dims", "torch.cat", "torch.zeros", "sklearn.preprocessing.OneHotEncoder", "torch.from_numpy", "torch.tensor", "numpy.argmax", "torch.no_grad", "torch.cuda.is_available", "numpy.array" ] ]
SkylineEC/faster-rcnn.pytorch
[ "5aee52dbb48ba34cadb4f824b605fcf27aee9068" ]
[ "trainval_net copy.py" ]
[ "# --------------------------------------------------------\n# Pytorch multi-GPU Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick\n# --------------------------------------------------------\nfrom __future__ import absolu...
[ [ "torch.optim.Adam", "torch.LongTensor", "numpy.random.seed", "torch.load", "torch.cat", "torch.randperm", "torch.utils.data.DataLoader", "torch.arange", "torch.FloatTensor", "torch.cuda.is_available", "torch.optim.SGD", "torch.nn.DataParallel", "torch.autograd.V...
weijiaheng/Robust-f-divergence-measures
[ "93d9efe616b777602fa40e966c58ba7a280fae5e" ]
[ "CIFAR-10/Estimate/loss.py" ]
[ "import numpy as np\n\nfrom keras import backend as K\n\n\ndef crossentropy(y_true, y_pred):\n # this gives the same result as using keras.objective.crossentropy\n y_pred /= K.sum(y_pred, axis=-1, keepdims=True)\n y_pred = K.clip(y_pred, K.epsilon(), 1.0 - K.epsilon())\n return -K.sum(y_true * K.log(y_p...
[ [ "numpy.linalg.inv" ] ]
bcdev/xcube
[ "9d275ef3baef8fbcea5c1fbbfb84c3d0164aecd3", "9d275ef3baef8fbcea5c1fbbfb84c3d0164aecd3", "9d275ef3baef8fbcea5c1fbbfb84c3d0164aecd3" ]
[ "test/core/test_reproject.py", "xcube/core/gen2/local/helpers.py", "xcube/core/reproject.py" ]
[ "import unittest\n\nimport numpy as np\n# noinspection PyUnresolvedReferences\nfrom matplotlib import pyplot as plt\nfrom numpy.testing import assert_array_almost_equal\n\nfrom test.sampledata import create_highroc_dataset\nfrom xcube.core.reproject import reproject_xy_to_wgs84\n\nnan = np.nan\n\n\nclass ReprojectT...
[ [ "numpy.array", "numpy.testing.assert_array_almost_equal" ], [ "numpy.product" ], [ "numpy.issubdtype", "numpy.dtype", "numpy.linspace" ] ]
ntlind/python_utilities
[ "09767502907005ed84c634c2c77bd9ab4ad7b68d" ]
[ "tests/test_timeseries.py" ]
[ "import pandas as pd\n\nfrom python_utilities import timeseries, testing # noqa\n\n\ndef test_update_time():\n def check_answer():\n assert (result == pd.to_datetime(answer)).all()\n\n test_series = pd.to_datetime(testing.get_test_example()[\"datetime\"])\n\n result = timeseries.update_time(test_ser...
[ [ "pandas.to_datetime", "pandas.Series" ] ]
AdamBear/PaddleSpeech
[ "aa6ba1f38d54dc694f4303e7057a162d802636a8" ]
[ "paddlespeech/t2s/exps/new_tacotron2/preprocess.py" ]
[ "# Copyright (c) 2021 PaddlePaddle 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 re...
[ [ "numpy.array", "numpy.abs", "numpy.save" ] ]
NimaVahdat/SNN-Framework-
[ "59c3b307b6930647f187a0e105cc7f191d8dd6c0" ]
[ "cnsproject/decision/decision.py" ]
[ "\"\"\"\r\nModule for decision making.\r\n\r\n\"\"\"\r\nimport torch\r\nfrom typing import Union, Sequence, Iterable, Optional\r\nfrom abc import ABC, abstractmethod\r\n\r\nimport numpy as np\r\n\r\nclass AbstractDecision(ABC):\r\n \"\"\"\r\n Abstract class to define decision making strategy.\r\n\r\n \"\"\...
[ [ "torch.ones", "torch.max", "torch.zeros", "torch.min", "torch.flatten", "torch.topk" ] ]
siddhant-pradhan/private-pgm
[ "f60734e444175e78e748e5aaab63ba7c3354a7f3", "f60734e444175e78e748e5aaab63ba7c3354a7f3" ]
[ "examples/hdmm.py", "src/mbi/graphical_model.py" ]
[ "from mbi import mechanism, FactoredInference\nimport benchmarks\nimport numpy as np\nfrom scipy.sparse.linalg import lsmr\nimport argparse\nfrom ektelo.matrix import Identity, EkteloMatrix, Kronecker\n\n\"\"\"\nRun HDMM with and without graphical-model inference on the adult dataset.\n\nMcKenna, Ryan, Gerome Mikla...
[ [ "numpy.load", "scipy.sparse.linalg.lsmr", "numpy.mean", "numpy.abs" ], [ "numpy.log", "numpy.arange", "numpy.random.shuffle", "pandas.DataFrame", "numpy.modf", "numpy.isscalar", "numpy.exp" ] ]
jordan-melendez/gp_project
[ "0172ff2a867ca2188f938a7fe7faa316c766a141" ]
[ "gp_project/new_model.py" ]
[ "import numpy as np\nimport scipy as sp\nimport scipy.stats\nfrom scipy.stats import multivariate_normal\nimport pandas as pd\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom scipy.linalg import cholesky\nfrom functools import partial\nfrom kronecker import gaussian...
[ [ "numpy.log", "pandas.read_csv", "numpy.sqrt", "numpy.eye", "numpy.ones", "matplotlib.pyplot.plot", "numpy.random.normal", "numpy.linalg.cholesky", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
axbaretto/xgboost
[ "86a4a21156afa90d3467646ee836526fc2daa5c9" ]
[ "tests/python/test_basic.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\nimport xgboost as xgb\nimport unittest\nimport itertools\nimport json\n\ndpath = 'demo/data/'\nrng = np.random.RandomState(1994)\n\n\nclass TestBasic(unittest.TestCase):\n\n def test_basic(self):\n dtrain = xgb.DMatrix(dpath + 'agaricus.txt.train')\n dt...
[ [ "numpy.matrix", "numpy.abs", "numpy.random.randn", "numpy.array", "numpy.sum", "numpy.random.RandomState" ] ]
burke86/lightkurve
[ "fda3e92544ccc3c6b38d003b2980a232fbcbbd0b" ]
[ "lightkurve/search.py" ]
[ "\"\"\"Defines tools to retrieve Kepler data from the archive at MAST.\"\"\"\nfrom __future__ import division\nimport os\nimport glob\nimport logging\nimport re\nimport warnings\nfrom requests import HTTPError\n\nfrom memoization import cached\nimport numpy as np\nfrom astropy.table import join, Table, Row\nfrom as...
[ [ "numpy.unique", "numpy.asarray", "numpy.atleast_1d", "numpy.array", "numpy.where" ] ]
ClarkZinzow/dask
[ "3903843aba6b248ce4d9c8c6ef696b16ae4a6351" ]
[ "dask/dataframe/tests/test_utils_dataframe.py" ]
[ "import re\n\nimport numpy as np\nimport pandas as pd\nimport dask.dataframe as dd\nfrom dask.dataframe._compat import tm\nfrom dask.dataframe.core import apply_and_enforce\nfrom dask.dataframe.utils import (\n shard_df_on_index,\n meta_nonempty,\n make_meta,\n raise_on_meta_error,\n check_meta,\n ...
[ [ "pandas.PeriodIndex", "pandas.Series", "pandas.RangeIndex", "pandas.DataFrame", "numpy.dtype", "pandas.Index", "pandas.DatetimeIndex", "pandas.Int64Index", "numpy.float32", "pandas.MultiIndex", "pandas.Categorical", "pandas.UInt64Index", "pandas.Timedelta", ...
Darktex/imgaug
[ "2bbe47eff8c2ec8b9ee1360474de25a786a9ec9a" ]
[ "test/augmenters/test_imgcorruptlike.py" ]
[ "from __future__ import print_function, division, absolute_import\n\nimport sys\n# unittest only added in 3.4 self.subTest()\nif sys.version_info[0] < 3 or sys.version_info[1] < 4:\n import unittest2 as unittest\nelse:\n import unittest\n# unittest.mock is not available in 2.7 (though unittest2 might contain ...
[ [ "numpy.allclose", "numpy.array_equal", "numpy.asarray", "numpy.arange", "numpy.tile", "numpy.copy", "numpy.sum" ] ]
HomerW/CSGNet
[ "4ecc7f3e836867118dba3d5f220ed5e74a536b93" ]
[ "old/vae_tree_reduced.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\nimport numpy as np\nfrom globals import device\n\nclass MLP(nn.Module):\n def __init__(self, ind, hdim, odim):\n super(MLP, self).__init__()\n self.l1 = nn.Linear(ind, hdim)\n self.l2 = nn.Linear(hdim, hdim)\n ...
[ [ "torch.randn_like", "numpy.log", "torch.full", "torch.cat", "torch.nn.Embedding", "torch.exp", "torch.nn.Linear", "torch.stack", "torch.nn.functional.softplus", "torch.argmax" ] ]
liuyenting/mito-analysis
[ "34d58d34a9b6a47d0c1c7dfff12edf58e25fd8e3" ]
[ "src/events/spatial_graph.py" ]
[ "import logging\n\nimport networkx as nx\nimport numpy as np\nimport pandas as pd\n\n__all__ = [\"SpatialGraph\"]\n\nlogger = logging.getLogger(__name__)\n\n\nclass SpatialGraph(object):\n \"\"\"\n Args:\n nodes (str): nodes in a frame\n segments (str): edges between nodes\n points (str):...
[ [ "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.axis" ] ]
rafaelrojasmiliani/gsplines
[ "663b10f6d53b498a1e892d9eb32a345153de36d2" ]
[ "gsplines/functionals/problem1010utils.py" ]
[ "from numpy import power, cos, sin, exp\n\ndef compute_Qd3_block(_tau, _alpha, _res):\n k = 0.35355339059327379*pow(_alpha, 0.25)*pow(1.0/(1.0 - _alpha), 0.25)\n _res[0, 0] = 96.0*pow(k, 5)*exp(2*_tau*k)*pow(sin(_tau*k), 2) + 64.0*pow(k, 5)*exp(2*_tau*k)*sin(_tau*k)*cos(_tau*k) + 32.0*pow(k, 5)*exp(2*_tau*k)*...
[ [ "numpy.exp", "numpy.cos", "numpy.sin" ] ]
auderson/pandas
[ "3e3bb9028b48aa7e42592b1d4a518197f4dbf6de" ]
[ "pandas/core/groupby/groupby.py" ]
[ "\"\"\"\nProvide the groupby split-apply-combine paradigm. Define the GroupBy\nclass providing the base-class of operations.\n\nThe SeriesGroupBy and DataFrameGroupBy sub-class\n(defined in pandas.core.groupby.generic)\nexpose these user-facing objects to provide specific functionality.\n\"\"\"\nfrom __future__ imp...
[ [ "numpy.sqrt", "pandas.core.window.ExpandingGroupby", "numpy.asarray", "numpy.minimum.accumulate", "pandas._libs.lib.generate_slices", "pandas.core.sorting.get_group_index_sorter", "pandas.core.sample.preprocess_weights", "numpy.concatenate", "numpy.dtype", "pandas.core.dtyp...
Aaron9477/detection_and_decision
[ "bc694246e4dc940eaf0387a6a3c4872d57983746" ]
[ "train_mobile.py" ]
[ "#! /usr/bin/env python\n#!coding=utf-8\n\"\"\"\nRetrain the YOLO model for your own dataset.\n\"\"\"\n\nimport numpy as np\nimport keras.backend as K\nfrom keras.layers import Input, Lambda\nfrom keras.models import Model\nfrom keras.optimizers import Adam\nfrom keras.callbacks import TensorBoard, ModelCheckpoint,...
[ [ "numpy.random.shuffle", "numpy.array", "numpy.zeros", "numpy.random.seed" ] ]
matiasleize/fR-MCMC
[ "820dc6297a63485b1c84a960c042f806f9c800af" ]
[ "Software/tests/test_mcmc/old_stuff/Paper/EXP/AGN_nuisance/AGN_4params_less_z/MCMC_BAO_LCDM_valores_medios_2params.py" ]
[ "\"\"\"\nCreated on Wed Feb 5 13:04:17 2020\n\n@author: matias\n\"\"\"\n\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom scipy.optimize import minimize\nimport emcee\nimport corner\nfrom scipy.interpolate import interp1d\n\n\nimport sys\nimport os\nfrom os.path import join as osjoin\nfrom pc_path i...
[ [ "numpy.savez", "numpy.array", "scipy.optimize.minimize", "numpy.random.seed" ] ]
HyperSuprime-Cam/fgcm
[ "b6fff6f774b4a59903680bcf995ed72c9de661ba" ]
[ "scripts/applyFgcmZeropoints.py" ]
[ "#!/usr/bin/env python\n\nfrom __future__ import division, absolute_import, print_function\n\nimport matplotlib\nmatplotlib.use(\"Agg\") # noqa E402\n\nimport os\nimport sys\nimport argparse\nimport fgcm\nimport yaml\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description='Code to apply FGC...
[ [ "matplotlib.use" ] ]
hmajid2301/EmotionCommotion
[ "7f32c092e9cb461bacfa033fb1bbc9ef565ee79a" ]
[ "EmotionCommotion/backend/youtubeFeatureCombiner.py" ]
[ "import pandas as pd\nimport glob\n\n# Load session labels\nsessions = pd.read_csv('./data/emmotion_labels.csv')\n\n# Load first feature\ndf = pd.read_csv('./features/youtube_standardized/youtube_amplitude_standardized.csv')\n\n# Add other features\nfor filename in glob.glob('./features/youtube_standardized/*.csv')...
[ [ "pandas.merge", "pandas.read_csv" ] ]
hamedsteiner/Unsupervised_SIRR
[ "acdd728d4ff32080fed04e7cd8ae9fb6b7187232" ]
[ "Other_separators/separator_h2.py" ]
[ "############ Dialated: H3\n## added file name for saving images\n\n## for Huawei samples + VGG Loss\n\n\n## For Exp2\n\n\n'''\nDate: Jan, 2021 \nAuthor: Hamed Rahmnai\n'''\n\nfrom collections import namedtuple\nimport time\nimport numpy as np\nfrom skimage import exposure\n\nimport torch\nimport torch.nn as nn\ni...
[ [ "torch.nn.SmoothL1Loss", "torch.nn.MSELoss", "torch.ones", "numpy.random.seed", "torch.zeros", "numpy.isnan", "torch.load", "torch.optim.AdamW", "numpy.argmin", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "torch.clamp", "torch.nn.L1Loss", "torch...
Github-JY/MyCode
[ "e7b04169fe6b0807d378f2d5f6d131efe6da7937" ]
[ "models/losses/YOLOF_LOSS.py" ]
[ "# -*- coding: utf-8 -*-\r\n# @Time : 21-7-20 20:01\r\n# @Author : MingZhang\r\n# @Email : zm19921120@126.com\r\n\r\n\r\nimport numpy as np\r\nimport traceback\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport math\r\n\r\n\r\nclass YOLOFLoss(nn.Module):\r\n def __init__(...
[ [ "torch.max", "torch.cat", "torch.zeros", "torch.cuda.amp.autocast", "torch.nn.BCEWithLogitsLoss", "torch.no_grad", "torch.where", "torch.topk", "torch.nn.L1Loss", "torch.nn.CrossEntropyLoss", "torch.arange", "torch.prod", "numpy.math.log", "torch.atan", ...
kovacspe/Sinz2018_NIPS
[ "c0aad625e516bed57f3ee52b39195c8817527d66" ]
[ "nips2018/movie/data.py" ]
[ "from collections import OrderedDict\nfrom pprint import pformat\n\nimport numpy as np\nfrom attorch.dataset import H5SequenceSet\n\nimport datajoint as dj\nfrom nips2018.utils import ComputeStub\nfrom .transforms import Subsequence\nfrom ..utils.data import h5cached\nfrom ..utils.logging import Messager\n\ndj.conf...
[ [ "numpy.random.randn", "numpy.float64", "numpy.ones" ] ]
ishine/TensorFlowTTS-1
[ "dd04992f2b05d2845f862f86cfae006b91e3e870" ]
[ "examples/fastspeech2/train_fastspeech2Gan.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2020 Minh Nguyen (@dathudeptrai)\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...
[ [ "numpy.rot90", "tensorflow.math.add", "tensorflow.keras.optimizers.schedules.PolynomialDecay", "matplotlib.pyplot.tight_layout", "tensorflow.shape", "tensorflow.keras.losses.MeanSquaredError", "matplotlib.pyplot.figure", "tensorflow.reshape", "tensorflow.config.run_functions_ea...
lim0606/multisensory-embodied-3D-scene-environment
[ "649d3a4c66dc268703389b5c147979813bbd9aa9" ]
[ "utils/rl.py" ]
[ "'''\nmiscellaneous functions\n'''\nimport os\nimport errno\nimport time\nimport math\nimport gzip\nimport numpy as np\nimport pickle as pkl\n\nfrom PIL import Image\n\nimport gym\nimport matplotlib.pyplot as plt\n\nfrom utils.learning import logging\nfrom utils.transformers import quaternion_from_matrix, rotation_...
[ [ "matplotlib.pyplot.gca", "numpy.abs", "numpy.load", "numpy.cos", "numpy.save", "numpy.sin", "numpy.stack", "numpy.random.normal", "numpy.argmax", "numpy.mean", "matplotlib.pyplot.close", "numpy.random.uniform", "numpy.array", "numpy.zeros", "matplotlib.p...
Ourwlsg/stomatal-index
[ "0895cf21346d8b7662f2b9f1d2c725f65f21a397" ]
[ "FRcnn_pytorch/lib/datasets/pascal_voc_rbg.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom ...
[ [ "numpy.zeros", "numpy.mean" ] ]
dwave-examples/graph-partitioning-dqm
[ "ec5c88ccdb601afd81ac3d2ae317cba143337bdc" ]
[ "demo.py" ]
[ "# Copyright 2021 D-Wave Systems Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.draw", "matplotlib.pyplot.close", "numpy.zeros" ] ]
wexnert/pomegranate
[ "e8f0f1071e54abc4abce693810c91b47d19fccc1" ]
[ "setup.py" ]
[ "from setuptools import setup\nfrom setuptools import Extension\nfrom setuptools.command.build_ext import build_ext as _build_ext\n# https://stackoverflow.com/a/11181607/541202\n# import __builtin__ as __builtins__\n\ntry:\n from Cython.Build import cythonize\nexcept ImportError:\n use_cython = False\n ext...
[ [ "numpy.get_include" ] ]
RAY185/ASP
[ "ad524d30251e9f72edb276fec0bcff2869162f96" ]
[ "py/HW2/option_models/bsm.py" ]
[ " # -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Sep 19 22:56:58 2017\r\n\r\n@author: jaehyuk\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport scipy.stats as ss\r\nimport scipy.optimize as sopt\r\n\r\ndef bsm_formula(strike, spot, vol, texp, intr=0.0, divr=0.0, cp_sign=1):\r\n div_fac = np.exp(-texp*divr)\r...
[ [ "numpy.log", "numpy.sqrt", "scipy.stats.norm.cdf", "numpy.fmax", "scipy.optimize.brentq", "numpy.exp" ] ]
AdityaNG/Self-Driving-RC-Car
[ "92a49d5a47b1894fdfc5de87b506037395d67277" ]
[ "self_drive/player.py" ]
[ "\"\"\"\n\tPlace this file within the generatd data folder\n\n\tdata_folder/\n\t\t- data.csv\n\t\t- player.py \t<== Like such\n\t\t- images/\n\t\t\t- 1589202544.57268.jpg\n\t\t\t- 1589202545.33127.jpg\n\t\t\t...\n\t\t\t- 1589203451.23581.jpg\n\"\"\"\n\nimport cv2\nimport os\nimport numpy as np\nimport traceback\nim...
[ [ "numpy.copy", "numpy.array", "numpy.zeros_like", "numpy.zeros" ] ]
alake16/tracker-v2
[ "3274c612b1ba22e5752cfe6e762d0af4a76981d5" ]
[ "allocations.py" ]
[ "''' allocations.py\nThis module handles the inputs for the tickers and respective allocations for the tracker to follow\nand analyze.\n\nTODO:\n\t* write method for consuming ticker and allocation input from csv\n\t\t* parse that data into appropriate data structure to be used by data and other modules\n\n'''\nimp...
[ [ "pandas.read_csv" ] ]
shreyas23/pytorch-CycleGAN-and-pix2pix
[ "d880b958f582ad6915d8b2dd660b853ebb954712" ]
[ "util/visualizer.py" ]
[ "import numpy as np\nimport os\nimport ntpath\nimport time\nfrom . import util\nfrom . import html\nfrom scipy.misc import imresize\n\n\n# save image to the disk\ndef save_images(webpage, visuals, image_path, aspect_ratio=1.0, width=256):\n image_dir = webpage.get_image_dir()\n short_path = ntpath.basename(im...
[ [ "numpy.array" ] ]
wssun/TranCS
[ "2cac445eb07e43b8ecc7ce0e4ee97ee89fc6a147" ]
[ "src/test.py" ]
[ "import os\nimport numpy as np\nimport argparse\nimport logging\nfrom tqdm import tqdm\nimport torch\n\nlogger = logging.getLogger(__name__)\nlogging.basicConfig(level=logging.INFO, format=\"%(message)s\")\n\nimport configs, DataLoader\nfrom utils import normalize\nfrom DataLoader import *\nimport models.TranCS as ...
[ [ "numpy.dot", "numpy.expand_dims", "numpy.negative", "torch.load", "torch.utils.data.DataLoader", "torch.no_grad", "numpy.mean", "torch.cuda.is_available", "numpy.argsort", "numpy.vstack" ] ]
opendilab/DI-treetensor
[ "fe5f681123c3d6e8d7507fba38586d2edf12e693" ]
[ "test/torch/tensor/test_operation.py" ]
[ "import torch\n\nimport treetensor.torch as ttorch\nfrom .base import choose_mark\n\n\n# noinspection DuplicatedCode,PyUnresolvedReferences\nclass TestTorchTensorOperation:\n\n @choose_mark()\n def test_split(self):\n t1 = torch.tensor([[59, 82],\n [86, 42],\n ...
[ [ "torch.Size", "torch.randint", "torch.tensor" ] ]
EdisonLeeeee/graphadv
[ "bff372768b4082af95de9e576c7083ba42773666", "bff372768b4082af95de9e576c7083ba42773666" ]
[ "graphadv/attack/untargeted/dice.py", "graphadv/utils/graph_utils.py" ]
[ "import random\nimport numpy as np\nfrom graphadv.attack.untargeted.untargeted_attacker import UntargetedAttacker\nfrom graphgallery import tqdm\n\n\nclass DICE(UntargetedAttacker):\n def __init__(self, adj, labels, seed=None, name=None, **kwargs):\n super().__init__(adj, labels=labels, seed=seed, name=na...
[ [ "numpy.random.choice" ], [ "tensorflow.boolean_mask", "tensorflow.clip_by_value", "scipy.sparse.coo_matrix", "tensorflow.concat", "tensorflow.math.count_nonzero", "tensorflow.greater_equal", "numpy.asarray", "tensorflow.reduce_sum", "tensorflow.maximum", "tensorflow...
srakhe/python-scripts
[ "ae29aba12fb28cacda423878483b85854ecc9e23" ]
[ "instabot/unfollower.py" ]
[ "from selenium import webdriver\nfrom selenium.webdriver.common.keys import Keys\nimport numpy as np\nimport time\nimport os\n\n# Instagram user credentials:\ninstagram_username = os.environ['INSTA_USERNAME']\ninstagram_password = os.environ['INSTA_PASSWORD']\n\n# All the X-Paths used: (Change if something stops wo...
[ [ "numpy.setdiff1d" ] ]
pritamqu/SSL-ECG
[ "cc460bbe786ab168a924851afd871b09ca14a360" ]
[ "implementation/utils.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jun 15 20:49:02 2020\n\n@author: pritam\n\"\"\"\n\nimport os\nimport tensorflow as tf\nimport numpy as np\nimport csv\nfrom sklearn import metrics\nimport signal_transformation_task as stt\nfrom mlxtend.evaluate import confusion_matrix\nimport time\n\nwindow_size = 2...
[ [ "numpy.diag", "numpy.asarray", "numpy.all", "numpy.round", "sklearn.metrics.f1_score", "numpy.unique", "numpy.arange", "numpy.full", "tensorflow.keras.preprocessing.sequence.pad_sequences", "numpy.zeros", "tensorflow.compat.v1.losses.sigmoid_cross_entropy", "tensorf...
StellaAthena/TopographicVAE
[ "0ed83446867fcaec4d3ca92736504b6d8ed649cc" ]
[ "tvae/experiments/nontvae_mnist.py" ]
[ "import os\nimport torch\nfrom torch import optim\nfrom torch.optim.lr_scheduler import StepLR\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom tvae.data.mnist import Preprocessor\nfrom tvae.containers.tvae import VAE\nfrom tvae.models.mlp import MLP_Encoder, MLP_Decoder\nfrom tvae.containers.enc...
[ [ "torch.nn.ConvTranspose3d", "torch.nn.functional.pad", "torch.optim.lr_scheduler.StepLR" ] ]
jinkookchoi/bert-classifier
[ "c55e93e103904d276d74d75c382335fc5080c276" ]
[ "single_label/bert_trainer.py" ]
[ "from copy import deepcopy\n\nimport numpy as np\nimport torch\nimport torch.nn.utils as torch_utils\n\nfrom ignite.engine import Engine\nfrom ignite.engine import Events\nfrom ignite.metrics import RunningAverage\nfrom ignite.contrib.handlers.tqdm_logger import ProgressBar\n\nfrom utils import get_grad_norm, get_p...
[ [ "torch.argmax", "torch.no_grad", "torch.save" ] ]
championway/pygoturn
[ "98c604d1e850c7080176d2cb00cf37dfab076494" ]
[ "src/test.py" ]
[ "import os\nimport time\nimport argparse\nimport re\n\nimport torch\nimport numpy as np\nimport cv2\n\nfrom model import GoNet\nfrom helper import NormalizeToTensor, Rescale, crop_sample, bgr2rgb\nfrom boundingbox import BoundingBox\n\nargs = None\nparser = argparse.ArgumentParser(description='GOTURN Testing')\npar...
[ [ "torch.device", "numpy.array", "torch.cuda.is_available", "torch.load" ] ]
msmcs-robotics/hover_poc
[ "c3c5038c3faa85fe710ad24fc59b22a49ba0bbb5" ]
[ "caput/drone.py" ]
[ "'''\nRPi Pinouts\n\nI2C Pins \n\nGPIO2 -> SDA\nGPIO3 -> SCL\n'''\n\nfrom curses import baudrate\nfrom matplotlib.widgets import Widget\nimport tensorflow_hub as hub\nimport cv2\nimport numpy\nimport tensorflow as tf\nimport pandas as pd\nimport serial\nimport time\n\n# Serial Variables\nserial_device = \"/dev/ttyU...
[ [ "tensorflow.convert_to_tensor", "pandas.read_csv", "tensorflow.expand_dims" ] ]
jfcann/va-transformer
[ "bbf04612770c95d38915f41045cf9f9acb5dad21" ]
[ "pretraining_sc.py" ]
[ "import os\nimport sys\n\nimport tqdm\nimport numpy as np\nimport pandas as pd\nfrom pprint import pprint\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom utils import model_methods\nfrom utils.data_utils import *\nfrom utils.arguments import Arguments\nfrom utils....
[ [ "pandas.read_csv", "torch.utils.data.DataLoader", "torch.utils.tensorboard.SummaryWriter" ] ]
hhentschke/numeric_precision
[ "994c8b7a4223d0e7ab3677a3f3a23eae923669b0" ]
[ "src/models/metrics_for_keras.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 25 14:25:54 2019\nA collection of deep learning 'metrics' for Keras with tensorflow backend.\n@author: hh\n\"\"\"\n\nimport keras.backend as K\nimport tensorflow as tf\n\ndef contorted_binary_crossentropy(target, output, from_raw=True):\n ...
[ [ "tensorflow.convert_to_tensor", "tensorflow.clip_by_value", "tensorflow.keras.metrics.binary_accuracy", "tensorflow.exp", "tensorflow.math.log", "tensorflow.nn.sigmoid_cross_entropy_with_logits" ] ]
AustenLamacraft/QuaRL
[ "1764f0ccd0ba90d44e799b6ac908df76be14a52e" ]
[ "continuum/nets/pairdrift.py" ]
[ "\"\"\" Defines neural net class PairDrift. \"\"\"\n\n\nimport torch\nimport torch.nn as nn\n\n\nclass MakeFeatures(nn.Module):\n \"\"\" Returns features to be used by PairDrift. \"\"\"\n def __init__(self, in_dim, out_dim):\n super(MakeFeatures, self).__init__()\n self.single = nn.Linear(in_dim...
[ [ "torch.nn.Linear", "torch.eye", "torch.zeros", "torch.nn.Hardtanh" ] ]
r-pad/zephyr
[ "c8f45e207c11bfc2b21df169db65a7df892d2848" ]
[ "python/zephyr/test.py" ]
[ "import os\nimport numpy as np\nimport torch\nimport torch.cuda\nimport random\n\nfrom pytorch_lightning import Trainer\n\nfrom zephyr.models import getModel\nfrom zephyr.datasets import getDataloader\nfrom zephyr.options import getOptions, checkArgs\n\ndef main(args):\n assert len(args.dataset_root) == 1\n n...
[ [ "torch.manual_seed", "numpy.random.seed" ] ]
peachfuzz11/courses
[ "ab83c506bf4a29366cd5fdf6709d809d563f4808" ]
[ "project/mysite/courses/data/dataloader.py" ]
[ "import os\n\nimport numpy\nimport scipy\nfrom scipy.io import netcdf\n\ndata_dir = os.path.dirname(os.path.abspath(__file__))\n\n\nclass CourseDataLoader:\n\n @staticmethod\n def load_netcdf(file):\n return netcdf.NetCDFFile(os.path.join(data_dir, file))\n\n @staticmethod\n def load_dat(file):\n...
[ [ "numpy.genfromtxt" ] ]
ikramersh/pandas
[ "91b6aa1b8f1ee1f91b90e99fe7543ed86d267c4f" ]
[ "pandas/core/generic.py" ]
[ "from __future__ import annotations\n\nimport collections\nfrom datetime import timedelta\nimport functools\nimport gc\nimport json\nimport operator\nimport pickle\nimport re\nfrom typing import (\n TYPE_CHECKING,\n Any,\n AnyStr,\n Callable,\n Hashable,\n Literal,\n Mapping,\n Sequence,\n ...
[ [ "pandas.util._validators.validate_bool_kwarg", "pandas.util._validators.validate_inclusive", "pandas.core.dtypes.inference.is_hashable", "numpy.all", "pandas.compat.numpy.function.validate_prod", "pandas.core.internals.construction.mgr_to_mgr", "numpy.asanyarray", "pandas.core.dtyp...
mihamerstan/context_encoder_pytorch
[ "0af2caa49ec884bcf01659467d00901e82c570d1" ]
[ "train_shrinking.py" ]
[ "from __future__ import print_function\nfrom __future__ import division\nfrom builtins import range\nfrom past.utils import old_div\nimport argparse\nimport os\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport tor...
[ [ "torch.load", "torch.manual_seed", "torch.nn.BCELoss", "torch.FloatTensor", "torch.no_grad", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "torch.nn.MSELoss", "torch.autograd.Variable" ] ]
jblondin/arrow
[ "319effd98e6d1d4282751471ebefaf325b0df09f" ]
[ "python/pyarrow/tests/test_array.py" ]
[ "# -*- coding: utf-8 -*-\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2....
[ [ "numpy.isnan", "numpy.arange", "numpy.asarray", "numpy.uint8", "numpy.int8", "numpy.dtype", "numpy.datetime64", "numpy.testing.assert_array_equal", "numpy.int16", "numpy.repeat", "numpy.array" ] ]
rajatgarg149/Stock-Trading-using-RRL
[ "eb7cdbc8f3750c47f5e57a64b0464f22f5d6dda6" ]
[ "getNumericalGradient.py" ]
[ "import numpy as np\n\ndef getNumericalGradient( J, theta ):\n\tnumgrad = np.zeros(np.size(theta))\n\tperturb = np.zeros(np.size(theta))\n\te = 1e-4\n\tfor p in range(0,len(theta)):\n\t\tperturb[p] = e\n\t\tloss1 , grad1 = J(theta - perturb)\n\t\tloss2 , grad2 = J(theta + perturb)\n\t\t#print loss1 , loss2\n\t\tnum...
[ [ "numpy.size" ] ]
roiyeho/drl-book
[ "1db635fd508e5b17ef8bfecbe49a79f55503a1f1" ]
[ "chapter08/ddpg_agent.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tensorflow import keras\nimport tensorflow.keras.layers as layers\nimport os\n\nclass DDPGAgent:\n def __init__(self,\n n_actions,\n actor_learning_rate=0.0001,\n critic_learning_rate=0.0001,\n gamm...
[ [ "tensorflow.keras.models.load_model", "numpy.expand_dims", "numpy.random.choice", "tensorflow.keras.losses.MeanSquaredError", "tensorflow.keras.models.save_model", "tensorflow.keras.layers.Dense", "tensorflow.math.log", "tensorflow.keras.optimizers.Adam", "tensorflow.GradientTa...
MichaelBroughton/OpenFermion-FQE
[ "b0c041d3284d9ce6523295b2a4cf17a8e6b37190", "b0c041d3284d9ce6523295b2a4cf17a8e6b37190" ]
[ "tests/unittest_data/fqe_data_loader.py", "tests/comparisons.py" ]
[ "import os\nimport copy\n\nimport numpy\nfrom fqe.fqe_data import FqeData\nfrom fqe import get_diagonalcoulomb_hamiltonian\nimport tests.unittest_data as fud\n\n\nclass FqeDataLoader:\n \"\"\" FqeDataLoader provides an interface to load reference data for\n unit testing.\n \"\"\"\n\n def __init__(self, ...
[ [ "numpy.fromfile" ], [ "numpy.allclose", "numpy.array_equal" ] ]
antonikaras/uav_mavros_simulation
[ "cf3752dc83dcd486d0704b696dd6ab7941b71e66" ]
[ "scripts/ArucoNavigationServers.py" ]
[ "#! /usr/bin/env python2\n\nimport rospy\nimport mavros\nimport cv2 as cv\nimport numpy as np\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge, CvBridgeError\nfrom nav_msgs.msg import Odometry\nfrom mavros_msgs.msg import PositionTarget as PT\nfrom geometry_msgs.msg import Vector3, TwistStamped\nf...
[ [ "numpy.array" ] ]
hanjin-jung-93/path_for_colab
[ "77d337f6243475b3265af25ca84e4702ed99be79" ]
[ "keras_centernet/models/networks/hourglass.py" ]
[ "\"\"\"Hourglass Network for Keras.\n# Reference paper\n- [Objects as Points]\n (https://arxiv.org/pdf/1904.07850.pdf)\n# Reference implementation\n- [PyTorch CenterNet]\n (https://github.com/xingyizhou/CenterNet/blob/master/src/lib/models/networks/large_hourglass.py)\n- [Keras Stacked_Hourglass_Network_Keras]\n ...
[ [ "numpy.float32" ] ]
Dani-97/tbcnn
[ "1e19e20099188dea42c97f09de39a0fadbcba92f" ]
[ "progress.py" ]
[ "import os\nimport tensorflow.compat.v1 as tf\n\ntf.disable_v2_behavior()\n\nsummary_writer = None\n\ndef start_tensorboard():\n print('Use `python3 -m tensorboard.main --logdir=./logs/` to visualize accuracy and AUC graphs in real time')\n\ndef init_run(_logDir, graph=None):\n global summary_writer\n logD...
[ [ "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.summary.FileWriter", "tensorflow.compat.v1.summary.merge", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.summary.scalar" ] ]
LaudateCorpus1/dm_robotics
[ "647bc810788c74972c1684a8d2e4d2dfd2791485" ]
[ "py/manipulation/props/rgb_objects/rgb_object_test.py" ]
[ "# Copyright 2020 DeepMind Technologies Limited.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.testing.assert_array_equal" ] ]
FlexMeasures/flexmeasures
[ "a4367976d37ac5721b8eb3ce8a2414595e52c678", "a4367976d37ac5721b8eb3ce8a2414595e52c678" ]
[ "flexmeasures/ui/views/analytics.py", "flexmeasures/cli/data_edit.py" ]
[ "from typing import List, Optional, Union, Tuple, Dict\nfrom datetime import datetime, timedelta\nimport io\nimport csv\nimport json\nimport math\n\nimport pandas as pd\nfrom flask import session, current_app, make_response\nfrom bokeh.plotting import Figure\nfrom bokeh.embed import components\nfrom bokeh.util.stri...
[ [ "pandas.to_timedelta", "pandas.DataFrame" ], [ "pandas.Timestamp", "pandas.isnull" ] ]
Klanly/StyleFlowPytorch
[ "4552108ea1de69e9e9c027909738bbc755ab5cf6" ]
[ "stylegan2/external_models/lpips.py" ]
[ "\"\"\"\nCode adapted from https://github.com/richzhang/PerceptualSimilarity\n\nOriginal License:\nCopyright (c) 2018, Richard Zhang, Phillip Isola, Alexei A. Efros, Eli Shechtman, Oliver Wang\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted pr...
[ [ "torch.nn.Sequential", "torch.mean", "torch.Tensor", "torch.nn.ModuleList", "torch.sum", "torch.utils.model_zoo.load_url" ] ]
deephealthproject/backend
[ "4bf6899c1308cbd42231ff9e29fe68b3ccb881e5" ]
[ "deeplearning/tasks/classification.py" ]
[ "import json\nimport random\nfrom os.path import join as opjoin\nfrom pathlib import Path\n\nimport numpy as np\nimport pyecvl.ecvl as ecvl\nimport pyeddl.eddl as eddl\nfrom celery import shared_task\nfrom pyeddl._core import eddl as eddl_core\nfrom pyeddl.tensor import Tensor\n\nfrom backend import settings\nfrom ...
[ [ "numpy.append", "numpy.zeros", "numpy.mean", "numpy.empty" ] ]
drnextgis/ipyleaflet
[ "6f0735c969c518f9262281ba5539054b14e0d5d4" ]
[ "ipyleaflet/xarray_ds.py" ]
[ "def ds_x_to_json(ds, widget):\n return ds2json(\n ds,\n widget.zonal_speed,\n widget.meridional_speed,\n widget.latitude_dimension,\n widget.longitude_dimension,\n widget.units\n )\n\ndef ds2json(ds, u_var, v_var, lat_dim='latitude', l...
[ [ "numpy.diff" ] ]
leotimus/project-it703e20
[ "cabaec4c44572f8fd1988992d2d28768429bc13a" ]
[ "Data handling/synthetic.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Nov 19 12:35:52 2020\r\n\r\n@author: EU\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom tqdm import tqdm\r\nimport os\r\n\r\nwriting_path = (r'\\\\cs.aau.dk\\Fileshares\\IT703e20\\(NEW)CleanDatasets\\\\')\r\nreading_path = (r'\\\\cs.aau.dk\\Fil...
[ [ "pandas.concat", "pandas.to_datetime", "pandas.DateOffset", "pandas.factorize", "pandas.DataFrame", "pandas.cut", "numpy.array_split", "pandas.to_numeric", "pandas.qcut" ] ]
HSE-asavchenko/doctr
[ "b875cb717943c4e2d1ebe73dac308b54a530cbab", "b875cb717943c4e2d1ebe73dac308b54a530cbab" ]
[ "doctr/models/recognition/crnn/tensorflow.py", "doctr/datasets/svhn.py" ]
[ "# Copyright (C) 2021, Mindee.\n\n# This program is licensed under the Apache License version 2.\n# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.\n\nfrom copy import deepcopy\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport tensorflow as tf\nfrom tens...
[ [ "tensorflow.fill", "tensorflow.transpose", "tensorflow.constant", "tensorflow.reshape", "tensorflow.strings.split", "tensorflow.squeeze", "tensorflow.keras.layers.LSTM" ], [ "numpy.array", "numpy.zeros", "numpy.stack" ] ]
rsav/splinart
[ "45d90915f34a65f6f3e3851e81e24eda20d1107c" ]
[ "tests/test_shape.py" ]
[ "import splinart as spl\nimport numpy as np\nimport pytest\nfrom pytest import approx\n\ndef test_circle_1():\n theta, path = spl.circle([0, 0], 1, npoints=2) # create a splinned circle with center [0,0] radius 1 and 2 points\n print(theta)\n assert theta == approx([0, 2*np.pi]) # the resulting vector of t...
[ [ "numpy.array", "numpy.linspace" ] ]
AntonioCheca/tfg
[ "f72ae8b89245ae4408de66787ee91d6263e88e73" ]
[ "src/graficas.py" ]
[ "import matplotlib.pyplot as plt\nimport math\nimport numpy as np\n\ndef Read_Two_Column_File(file_name):\n with open(file_name, 'r') as data:\n x = []\n y = []\n for line in data:\n p = line.split()\n x.append(float(p[0]))\n y.append(float(p[1]))\n\n retu...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
s2t2/tweet-analyzer-py
[ "0a398fc47101a2d602d8c4116c970f1076a58f27", "0a398fc47101a2d602d8c4116c970f1076a58f27", "0a398fc47101a2d602d8c4116c970f1076a58f27", "0a398fc47101a2d602d8c4116c970f1076a58f27" ]
[ "app/bot_impact_v4/daily_active_edge_friend_grapher.py", "start/botcode_v2/networkClassifierHELPER.py", "app/botcode_v2/classifier.py", "app/nlp_v2/bert_score_uploader.py" ]
[ "\n\nimport os\n\nfrom pandas import DataFrame, read_csv\nfrom networkx import DiGraph, write_gpickle, read_gpickle\nfrom memory_profiler import profile\n\nfrom app.decorators.number_decorators import fmt_n\nfrom app.job import Job\nfrom app.bq_service import BigQueryService\nfrom app.file_storage import FileStorag...
[ [ "pandas.read_csv", "pandas.DataFrame" ], [ "numpy.intersect1d", "numpy.exp", "numpy.unique" ], [ "matplotlib.pyplot.title", "numpy.quantile", "numpy.cumsum", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot....
amirgeva/retroupy
[ "1ee19b36a72c5f592cce150d1d0382a00ccdc4a0" ]
[ "tools/showraw.py" ]
[ "import sys\nimport cv2\nimport numpy as np\n\n\ndef load(filename):\n data = open(filename, 'rb').read()\n w = (data[1] << 8) | data[0]\n h = (data[3] << 8) | data[2]\n image = np.zeros((h, w, 3), dtype=np.uint8)\n i = 4\n for y in range(h):\n for x in range(w):\n msb = data[i]\...
[ [ "numpy.zeros" ] ]
liangcat/WxJumpHelper
[ "65da8a7005356994a4ad368a1c100e415e6902d1" ]
[ "main.py" ]
[ "#!/usr/bin/env python\nfrom matplotlib.widgets import Cursor\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nimport subprocess\nimport random\nimport matplotlib.patches as patches\n\nclick_data = []\n\ndef call_cmd(cmd):\n s = subprocess.check_output(cmd.split())\n return s.decode(\"utf-8...
[ [ "matplotlib.pyplot.gca", "matplotlib.widgets.Cursor", "matplotlib.patches.Rectangle", "matplotlib.pyplot.subplots", "matplotlib.pyplot.gcf", "matplotlib.image.imread", "matplotlib.pyplot.get_current_fig_manager", "matplotlib.pyplot.close", "matplotlib.pyplot.show", "matplot...
HeloiseS/FUSS
[ "c7d5bbe6821eccb2a15d952a8899108098626474", "c7d5bbe6821eccb2a15d952a8899108098626474" ]
[ "FUSS/toymodel/envellope.py", "FUSS/tests/test_statistics.py" ]
[ "\"\"\"\nTOYMODEL - fstevance1@sheffield.ac.uk - 22/11/2017\n\nThis module defines the tools required to create a toy model that simulates the polarisation resulting form oblate\nphotospheres.\n\"\"\"\n\nfrom __future__ import division\nimport numpy as np\nfrom numpy.random import uniform\nfrom itertools import com...
[ [ "numpy.random.uniform", "numpy.average", "numpy.sqrt" ], [ "numpy.arange" ] ]
attila-petho/DuckPropagation
[ "a2cacc95af3e0767c590a50f6633d3bff363f5ec" ]
[ "src/utils/wrappers.py" ]
[ "import gym\nimport numpy as np\nfrom gym import spaces\nfrom gym_duckietown.simulator import NotInLane\nfrom matplotlib import pyplot as plt\nimport seaborn\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n# Constants\n\nsensitivity_yellow = 100\nsensitivity_white = 70\ncolorcode_yellow = [255,255,0]\nco...
[ [ "numpy.dot", "numpy.expand_dims", "numpy.abs", "numpy.clip", "numpy.isnan", "numpy.power", "numpy.linalg.norm", "numpy.dstack", "numpy.cos", "numpy.sin", "numpy.max", "numpy.array" ] ]
stweil/ocrd_cis
[ "e8c20e67ca78682059e20445c9a10849b9bdd7ba" ]
[ "ocrd_cis/ocropy/ocrolib/lineest.py" ]
[ "\n\nimport os\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.ndimage import interpolation,filters,measurements\n\ndef scale_to_h(img,target_height,order=1,dtype=np.dtype('f'),cval=0):\n h,w = img.shape\n scale = target_height*1.0/h\n target_width = int(scale*w)\n output = interpolat...
[ [ "numpy.amax", "matplotlib.pyplot.imshow", "numpy.dtype", "matplotlib.pyplot.plot", "numpy.mean", "scipy.ndimage.filters.gaussian_filter", "numpy.arange", "numpy.eye", "numpy.argmax", "matplotlib.pyplot.figure", "numpy.median", "scipy.ndimage.filters.minimum_filter",...
simon555/TensorflowTutorial
[ "653be9fddb3f5834b37acec766e38024209750d5" ]
[ "7_tensorboard/tensorboard.py" ]
[ "#!/usr/bin/env python\n\nimport tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data\n\ndef init_weights(shape, name):\n return tf.Variable(tf.random_normal(shape, stddev=0.01), name=name)\n\n# This network is the same as the previous one except with an extra hidden layer + dropout\ndef ...
[ [ "tensorflow.matmul", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.summary.FileWriter", "tensorflow.train.RMSPropOptimizer", "tensorflow.cast", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.random_normal", "tensorflow.summary....
pistarlab/pistarlab
[ "56dacb90e72b03c19d16d549bfe8365b58ddb714" ]
[ "scripts/check_tf.py" ]
[ "import tensorflow as tf; \nprint(tf.__version__)\nprint(tf.reduce_sum(tf.random.normal([1000, 1000])))\nprint(tf.config.list_physical_devices('GPU'))\n" ]
[ [ "tensorflow.random.normal", "tensorflow.config.list_physical_devices" ] ]
JasonDRowley/crunchwrap
[ "b027175274a0e7e693c33714955a89674dd4788c" ]
[ "crunchwrap_rounds_csv.py" ]
[ "# _____ _ \n# / ____| | | \n# | | _ __ _ _ _ __ ___ | |__ __ __ _ __ __ _ _ __ \n# | | | '__|| | | || '_ \\ / __|| '_ \\\\ \\ /\\ / /| '__|/ _` || '_ \\ \n# | |____ | ...
[ [ "pandas.concat", "pandas.read_csv" ] ]
mkheirkhah/CNO-RL
[ "264def52bfd25ca89209ad04a908c3c599dcca02" ]
[ "rl_a3c.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport tflearn\n\nGAMMA = 0.99\n# A_DIM = 6\nENTROPY_WEIGHT = 0.5\nENTROPY_EPS = 1e-6\n\n\nclass ActorNetwork(object):\n \"\"\"\n Input to the network is the state, output is the distribution\n of all actions.\n \"\"\"\n\n def __init__(self, sess, state_d...
[ [ "numpy.log", "tensorflow.multiply", "tensorflow.summary.scalar", "tensorflow.Variable", "tensorflow.train.RMSPropOptimizer", "tensorflow.get_collection", "tensorflow.gradients", "tensorflow.placeholder", "tensorflow.subtract", "tensorflow.summary.merge_all", "tensorflow...
pdebuyl/NarrowEscapeSimulator
[ "09d2ced13ea767b6fc0abff549e91cced8e99f2c" ]
[ "narrow_escape/escape_drawing.py" ]
[ "import matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport numpy as np\nfrom itertools import product, combinations\nfrom .escape_utility import sphere_vol_to_r, cube_vol_to_r\n\n\ndef draw_sphere(v, ax):\n r = sphere_vol_to_r(v)\n u = np.linspace(0, 2 * np.pi, 100)\n v = np.linspace...
[ [ "numpy.abs", "numpy.linspace", "numpy.cos", "numpy.sin", "numpy.size" ] ]
Dookas/Robust-Multitask-RL
[ "1f23ad0b624e8d859b74fbe023e0c85564ed50e1" ]
[ "code/dqn/network.py" ]
[ "import math\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom memory_replay import Transition\n\nuse_cuda = torch.cuda.is_available()\n\nFloatTensor = torch.cuda.FloatTensor if use_cuda else torch.FloatTensor...
[ [ "torch.cat", "torch.zeros", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.functional.smooth_l1_loss", "torch.cuda.is_available", "torch.nn.BatchNorm2d", "torch.autograd.Variable" ] ]
francescougolini/data_clues
[ "f9accd21a94bf537c8a6934b65b840feecd5f282" ]
[ "data_clues/similarity_checker.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) 2021 Francesco Ugolini <contact@francescougolini.com>\n\nimport pandas\nimport Levenshtein\nfrom data_clues.utilities import advanced_unique_values\n\n__all__ = ['SimilarityChecker']\n\n\n@pandas.api.extensions.register_dataframe_accessor(\"dc_similarity\")\nclass Similarit...
[ [ "pandas.api.extensions.register_dataframe_accessor", "pandas.DataFrame" ] ]
jains8844/poliastro
[ "b11bc0c72934dbaff950af2d111396596e83311a" ]
[ "src/poliastro/core/angles.py" ]
[ "import numpy as np\n\nfrom ._jit import jit\n\n\n@jit\ndef _kepler_equation(E, M, ecc):\n return E_to_M(E, ecc) - M\n\n\n@jit\ndef _kepler_equation_prime(E, M, ecc):\n return 1 - ecc * np.cos(E)\n\n\n@jit\ndef _kepler_equation_hyper(F, M, ecc):\n return F_to_M(F, ecc) - M\n\n\n@jit\ndef _kepler_equation_p...
[ [ "numpy.cosh", "numpy.arctan", "numpy.sqrt", "numpy.cos", "numpy.sinh", "numpy.sin", "numpy.tan", "numpy.tanh", "numpy.arcsinh" ] ]
stephtdouglas/lightkurve
[ "0f0a51f85975993295a692d78f006a9b77afe1b9" ]
[ "lightkurve/tests/test_search.py" ]
[ "\"\"\"Test features of lightkurve that interact with the data archive at MAST.\n\nNote: if you have the `pytest-remotedata` package installed, then tests flagged\nwith the `@pytest.mark.remote_data` decorator below will only run if the\n`--remote-data` argument is passed to py.test. This allows tests to pass\nif ...
[ [ "numpy.testing.assert_array_equal", "numpy.testing.assert_almost_equal" ] ]
Lechatelia/detection
[ "cd4e716b0470bde842c20c00f18cffa20c2673c1" ]
[ "mmdet/ops/dcn/deform_conv.py" ]
[ "import math\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Function\nfrom torch.autograd.function import once_differentiable\nfrom torch.nn.modules.utils import _pair, _single\n\nfrom mmdet.utils import print_log\nfrom . import deform_conv_cuda\n\n\nclass Deform...
[ [ "torch.sigmoid", "torch.nn.modules.utils._single", "torch.Tensor", "torch.cat", "torch.zeros_like", "torch.nn.modules.utils._pair", "torch.chunk", "torch.nn.functional.pad" ] ]
S-HuaBomb/Contrib
[ "10596814bb98c9e2499e4240e56207dc3b547959", "10596814bb98c9e2499e4240e56207dc3b547959" ]
[ "PSENet/predict.py", "GCC-paddle/gcc/models/emb/graphwave.py" ]
[ "#encoding=utf8\n# Copyright (c) 2021 PaddlePaddle 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...
[ [ "numpy.array", "numpy.expand_dims" ], [ "numpy.linspace" ] ]
HySynth/HySynth
[ "b33b34ff5db138b5d007d0dcd32d53c9f8964b62", "b33b34ff5db138b5d007d0dcd32d53c9f8964b62" ]
[ "tests/test_pwl/test_simulation/test_dataset_generation.py", "data/synthetic_data/single_dim/two_states.py" ]
[ "import math\n\nimport pytest\nimport numpy as np\n\nfrom data.synthetic_data.automata_library import two_mode_p1_m1_ha\nfrom hysynth.pwl.simulation import generate_pwl_dataset, generate_timeseries_dataset\nfrom hysynth.pwl.simulation.dataset_generation import save_dataset, load_dataset\n\n\n@pytest.fixture()\ndef ...
[ [ "numpy.isclose" ], [ "numpy.random.normal" ] ]
JasenWangLab/oneflow
[ "16d261ea52a56c28db8e79dbbc79032b4804d09e", "0131e6ec282a426c2de98825de5fab95c853d8cf" ]
[ "oneflow/python/test/ops/test_dim_gather_dynamic.py", "oneflow/python/test/ops/test_group_norm_op.py" ]
[ "\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap...
[ [ "numpy.take_along_axis", "numpy.unravel_index", "numpy.ones_like", "numpy.random.random", "numpy.allclose", "numpy.ravel_multi_index", "numpy.zeros", "numpy.random.randint" ], [ "numpy.square", "numpy.random.random", "numpy.allclose", "numpy.sqrt", "numpy.po...
Pavan1199/Python-Signal-Processing-Project
[ "9f9b71c1e44f858ec3dbec8275079e30b6c0d47a" ]
[ "PYTHON PROJECT 1/Main Questions/Ques No 1,2,3,4.py" ]
[ "import matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom comb_step_ramp import comb_step_ramp\r\n\r\n'original function'\r\n\r\nt = np.arange(-10, 10,0.01)\r\na=[]\r\ncomb_step_ramp(t,a)\r\nprint(a)\r\nplt.subplot(2,2,1)\r\nplt.step(t,a)\r\nplt.axhline(0, color='black')\r\nplt.axvline(0, color='black')\r\nplt...
[ [ "matplotlib.pyplot.axhline", "matplotlib.pyplot.axvline", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.step", "matplotlib.pyplot.subplot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
svrakitin/numba
[ "830a2c7ccc410f270677b0b241f9b8acc2598101", "830a2c7ccc410f270677b0b241f9b8acc2598101", "3d688932f919dbf5821f0cb8a210ce24abe39e9e" ]
[ "numba/cuda/tests/cudapy/test_macro.py", "numba/tests/test_ir.py", "numba/cuda/tests/cudapy/test_transpose.py" ]
[ "import numpy as np\nfrom numba import cuda, float32\nfrom numba.core.errors import MacroError\nfrom numba.cuda.testing import unittest, SerialMixin\nfrom numba.cuda.testing import skip_on_cudasim\n\nGLOBAL_CONSTANT = 5\nGLOBAL_CONSTANT_2 = 6\nGLOBAL_CONSTANT_TUPLE = 5, 6\n\n\ndef udt_global_constants(A):\n sa =...
[ [ "numpy.array" ], [ "numpy.abs", "numpy.arange", "numpy.zeros", "numpy.sqrt" ], [ "numpy.arange", "numpy.dtype", "numpy.testing.assert_array_equal", "numpy.recarray", "numpy.zeros", "numpy.random.randint" ] ]
jarovaisanen/ADTLib
[ "eeef9dcb5e041b47b0136f704c4991e086cce764" ]
[ "ADTLib/utils/__init__.py" ]
[ " # -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri May 26 15:10:50 2017\n\n@author: CarlSouthall\n\"\"\"\n\nimport os\nimport inspect\nimport madmom\nimport numpy as np\nimport subprocess\nfrom subprocess import check_output,CalledProcessError\nfrom fpdf import FPDF\nimport ADTLib\nimport tensorflow.compat.v1 as tf\...
[ [ "numpy.expand_dims", "tensorflow.compat.v1.concat", "tensorflow.compat.v1.random_normal", "numpy.concatenate", "numpy.mean", "tensorflow.compat.v1.nn.rnn_cell.LSTMCell", "tensorflow.compat.v1.train.Saver", "tensorflow.compat.v1.nn.bidirectional_dynamic_rnn", "tensorflow.compat....
aLeX1443/ig-markets-api-python-library
[ "86d3903f3d5144a8a160e4f685b11cf1dcbe522b" ]
[ "trading_ig/rest.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\n\"\"\"\nIG Markets REST API Library for Python\nhttp://labs.ig.com/rest-trading-api-reference\nOriginal version by Lewis Barber - 2014 - http://uk.linkedin.com/in/lewisbarber/\nModified by Femto Trader - 2014-2015 - https://github.com/femtotrader/\n\"\"\" # noqa\n\...
[ [ "pandas.concat", "pandas.json_normalize", "pandas.to_datetime", "pandas.DataFrame" ] ]
Abdul-Zamani/geometry_analysis
[ "dcd6bb8cc54a75b5de300f6db338e220c020a5fd" ]
[ "geometry_analysis/molecule.py" ]
[ "\"\"\"\nmolecule.py\nA python package for the MolSSI Software Summer School.\n\nContains a molecule class\n\"\"\"\n\n#module w.o. 2 fxns\n\nimport numpy as np\n#only import fxns that you need! you need .measure (the directory we're in)\n#if you didnt import, you would need to do measure.thing\nfrom .measure import...
[ [ "numpy.random.random" ] ]
PhilippThoelke/neural-automaton
[ "b3586ce3c3ac7884bbec85290e940d047a1f7a2c" ]
[ "automaton/game_of_life/train.py" ]
[ "from automaton.game_of_life.model import NeuralAutomaton\n\nimport os\nfrom os.path import abspath, dirname, join, exists\nfrom matplotlib import pyplot as plt\n\nimport torch\nfrom torch import nn, optim\n\ndef tick(state):\n kernel = torch.ones((1, 1, 3, 3), device=state.device)\n kernel[:,:,1,1] = 0\n\n ...
[ [ "matplotlib.pyplot.tight_layout", "torch.ones", "matplotlib.pyplot.subplots", "torch.rand", "matplotlib.pyplot.show", "torch.nn.MSELoss", "torch.save" ] ]
wpfhtl/Drone-Detection-1
[ "d3aeb2f731739475b1b63e74337876ea14de08ac" ]
[ "tools/motion_stablization/stabalize_motion.py" ]
[ "import os\nfrom glob import glob\n\nimport numpy as np\nimport cv2\nfrom tqdm import tqdm\n\nSMOOTHING_RADIUS = 50\n\nOUTPUT_BASE = ''\n\nVIDEO_FILES_FOLDER = ''\nVIDEO_FILES_OUTPUT_FOLDER = os.path.join(OUTPUT_BASE, 'videos')\n\nSTABALIZED_FRAMES_OUTPUT_FOLDER = os.path.join(OUTPUT_BASE, 'frames')\n\n# not writte...
[ [ "numpy.lib.pad", "numpy.convolve", "numpy.cumsum", "numpy.cos", "numpy.ones", "numpy.arctan2", "numpy.sin", "numpy.copy", "numpy.zeros", "numpy.where" ] ]
njunge94/timeseries-thesis
[ "82b2cdc273e4dabcca0f3d8ae33c281691c3c7ed" ]
[ "utils/data_utils.py" ]
[ "import pandas as pd\n\ndef load_login_data(logindata_filepath):\n #reading in the login data\n #passing a list of datatypes for the columns\n login_dtypes = {\"ID\": int, \"RES_ID\": int, \"DATE_SAVED\": str, \"DATE_LAST_MODIFIED\": str, \"CUST_CODE\": str, \n \"IS_ARRIVED\": str, \"LOCATIO...
[ [ "pandas.read_csv" ] ]
myungsub/CAIN
[ "46d8442b4291d894fb30276c4a8f3cee07ed52ee", "2e727d2a07d3f1061f17e2edaa47a7fb3f7e62c5" ]
[ "model/cain_noca.py", "generate.py" ]
[ "import math\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\n\nfrom .common import *\n\nclass Encoder(nn.Module):\n def __init__(self, in_channels=3, depth=3):\n super(Encoder, self).__init__()\n self.device = torch.device('cuda')\n \n self.shuffler = PixelShuffle(1/2**dep...
[ [ "torch.device" ], [ "torch.cuda.manual_seed", "torch.load", "torch.manual_seed", "torch.no_grad", "torch.device", "torch.nn.DataParallel" ] ]
disasterarchy/Thermal_Lookout
[ "404eb395fc605c790ed9acdd802ad56fb7f1347e" ]
[ "uvcR-radiometry.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom uvctypes import *\nimport time\nimport cv2\nimport numpy as np\ntry:\n from queue import Queue\nexcept ImportError:\n from Queue import Queue\nimport platform\nimport atexit\n\nBUF_SIZE = 2\nq = Queue(BUF_SIZE)\n\ndef py_frame_callback(frame, userptr):\n\n ...
[ [ "numpy.right_shift", "numpy.uint8", "numpy.dtype" ] ]
dornasabet/deep_utils
[ "b1b936f4780ea7dc52224f53f5116288c5b0a804" ]
[ "deep_utils/utils/opencv/main.py" ]
[ "import numpy as np\nfrom deep_utils.utils.box_utils.boxes import Point\n\n\nclass VideoWriterCV:\n def __init__(self, save_path, width, height, fourcc=\"XVID\", fps=30, colorful=True, in_source='Numpy'):\n import cv2\n point = Point.point2point((width, height), in_source=in_source, to_source=Point...
[ [ "numpy.array" ] ]
toddrme2178/physt
[ "d4211798e8338301a1885369f57bad261e26f3f3", "d4211798e8338301a1885369f57bad261e26f3f3" ]
[ "physt/histogram_base.py", "physt/plotting/common.py" ]
[ "\"\"\"HistogramBase - base for all histogram classes.\"\"\"\nfrom collections import OrderedDict\nfrom typing import List, Optional, Iterable, Mapping, Any, Tuple, Union\n\nimport numpy as np\n\nfrom .binnings import as_binning\n\n\nAxisIdentifier = Union[int, str]\n\n\nclass HistogramBase:\n \"\"\"Histogram ba...
[ [ "numpy.product", "numpy.can_cast", "numpy.sqrt", "numpy.allclose", "numpy.asarray", "numpy.issubdtype", "numpy.dtype", "numpy.finfo", "numpy.copy", "numpy.zeros_like", "numpy.any", "numpy.isscalar", "numpy.iinfo", "numpy.zeros" ], [ "numpy.arange" ...
DingdingLuan/PycharmProjects
[ "055944cd4bf66637e40d81d8ccf05216006dc0a3" ]
[ "TDLI2018/wendroff.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nnx = 200\nu = np.zeros(nx)\ntotal_length = 1\n\ndx = total_length / float (nx)\nx = np.arange(0, total_length, dx)\n\ntmax = 0.5\ntime = 0.0\n\ndt = 0.5* dx\n\nu[x<0.5] = 1.0\nu[x>=0.5] = 0.0\n\nplt.plot(x,u)\nplt.ylim((-1,2))\nplt.xlabel('x')\nplt.ylabel('u')...
[ [ "numpy.arange", "matplotlib.pyplot.ylim", "matplotlib.pyplot.cla", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.roll", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.pause", "matplotlib.pyplot.ylabel" ] ]
saurabh3949/mxnet
[ "e25074a469b45f2cbde68e2a0c8963daea93b66b", "e25074a469b45f2cbde68e2a0c8963daea93b66b" ]
[ "tests/python/gpu/test_kvstore_gpu.py", "tests/nightly/test_kvstore.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.arange", "numpy.zeros_like", "numpy.random.randint" ], [ "numpy.random.random", "numpy.zeros", "numpy.abs" ] ]
eivtho/PyLaia
[ "1b2e864247f1bfb8d95ac1910de9c52df71c017a", "1b2e864247f1bfb8d95ac1910de9c52df71c017a" ]
[ "tests/data/transforms/vision/vision_transforms_test.py", "laia/models/htr/conv_block.py" ]
[ "import math\n\nimport numpy as np\nimport pytest\nimport torch\nfrom PIL import Image\n\nfrom laia.data.transforms.vision import Convert, Invert, ToImageTensor\n\n\ndef test_invert():\n t = Invert()\n x = Image.new(\"L\", (30, 40), color=0)\n y = t(x)\n assert y.size == x.size\n assert y.mode == x.m...
[ [ "numpy.asarray" ], [ "torch.nn.functional.dropout", "torch.nn.MaxPool2d", "torch.zeros_like", "torch.nn.BatchNorm2d" ] ]