repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
killertux/cwbbus
[ "a57580a72ad2c5ead7b78e9381ccf80fbe8f6e31" ]
[ "cwbbus/datareader.py" ]
[ "from os import makedirs, path\nfrom typing import Union\n\nimport pandas as pd\n\nfrom .filetype import FileType\n\n\nclass DataReader(object):\n\tdef __init__(self):\n\t\t\"\"\"\n\t\tStores all dataframes and provides methods to feed data into the dataframes.\n\t\t\"\"\"\n\t\tself.bus_lines = pd.DataFrame(columns...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.read_json" ] ]
HarvsG/rightmove_floorscraper
[ "85033bcda1878e44cb648ab742fac6f7e66cd62e" ]
[ "package/rightmove_floorscraper/__init__.py" ]
[ "#!/usr/bin/env python3\n\n# Dependencies\nfrom lxml import html, etree\nimport requests\nimport numpy as np\nimport pandas as pd\nimport datetime as dt\n\nclass _GetDataFromURL(object):\n \"\"\"This \"private\" class does all the heavy lifting of fetching data from the\n URL provided, and then returns data t...
[ [ "pandas.to_numeric", "pandas.DataFrame", "pandas.concat" ] ]
sahiljain11/ICML2019-TREX
[ "82694f2dfe6e3bb0668948ffc531fcde20cdf45b" ]
[ "audio_atari/baselines/baselines/common/custom_reward_wrapper.py" ]
[ "import gym\nimport numpy as np\nfrom baselines.common.vec_env import VecEnvWrapper\nfrom baselines.common.running_mean_std import RunningMeanStd\nfrom baselines.common.trex_utils import preprocess\n#import matplotlib.pyplot as plt\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass A...
[ [ "torch.nn.Linear", "torch.load", "torch.no_grad", "torch.cuda.is_available", "torch.nn.Conv2d", "numpy.array" ] ]
yf225/jax-alpa
[ "22219884fdec81e8325cfe0de0cc0c627291f0a1" ]
[ "jax/experimental/jax2tf/jax2tf.py" ]
[ "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.math.equal", "tensorflow.logical_and", "tensorflow.identity", "tensorflow.__version__.split", "tensorflow.linalg.eigh", "tensorflow.function", "tensorflow.compiler.tf2xla.python.xla.conv", "tensorflow.bitwise.right_shift", "tensorflow.math.greater_equal", "tenso...
aakashsingh1210/greyatom-python-for-data-science
[ "c4df27416cfffa574107ba1a7a5dc96ba6d92172" ]
[ "data-visualization/code.py" ]
[ "# --------------\n#Importing header files\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\n#Reading the file\ndata=pd.read_csv(path)\n\n#Code starts here\n\n# Step 1 \n#Reading the file\n\n\n#Creating a new variable to store the value counts\nloan_status=data['Loan_Status'].value_coun...
[ [ "matplotlib.pyplot.xticks", "pandas.read_csv", "matplotlib.pyplot.subplots", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ] ]
DCichon/straxen
[ "ffcf06ad86471caf11cc831f2ff68d70b59464af" ]
[ "straxen/analyses/pulse_plots.py" ]
[ "import os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport strax\nimport straxen\n\n\n@straxen.mini_analysis(requires=('raw_records',), warn_beyond_sec=5)\ndef plot_pulses_tpc(context, raw_records, run_id, time_range=None,\n plot_hits=False, plot_median=False,\n ...
[ [ "matplotlib.pyplot.legend", "matplotlib.backends.backend_pdf.PdfPages", "numpy.median", "matplotlib.pyplot.close", "numpy.where", "matplotlib.pyplot.fill_between" ] ]
joeljgeo/landlab
[ "1d2651c76a8a36a7a132f139638192df1823f8fb" ]
[ "landlab/data_record/tests/conftest.py" ]
[ "import pytest\nimport numpy as np\nfrom landlab import RasterModelGrid\nfrom landlab.data_record import DataRecord\n\ngrid = RasterModelGrid((3,3))\n\n@pytest.fixture\ndef dr_time():\n time=[0.]\n data_vars={'mean_elevation' : (['time'], np.array([100]))}\n attrs={'time_units' : 'y'}\n return DataRecor...
[ [ "numpy.array" ] ]
dmsuehir/mlt
[ "896654099af010a8afd80b613b0b6ec96633e401" ]
[ "mlt-templates/tf-dist-mnist/main.py" ]
[ "#\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2018 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle...
[ [ "tensorflow.summary.scalar", "tensorflow.keras.layers.Flatten", "tensorflow.app.flags.DEFINE_string", "tensorflow.summary.image", "tensorflow.nn.top_k", "numpy.asarray", "tensorflow.keras.datasets.mnist.load_data", "tensorflow.keras.models.Model", "tensorflow.name_scope", "...
g5t/scipp
[ "d819c930a5e438fd65e42e2e4e737743b8d39d37" ]
[ "python/tests/nexus_helpers.py" ]
[ "from typing import List, Union, Iterator\nimport h5py\nimport numpy as np\nfrom contextlib import contextmanager\n\nh5root = Union[h5py.File, h5py.Group]\n\n\ndef find_by_nx_class(nx_class_name: str, root: h5root) -> List[h5py.Group]:\n \"\"\"\n Find groups in the HDF5 file or group which have the\n reque...
[ [ "numpy.array" ] ]
gabloa/probability
[ "7a0ce5e5beff91051028258dfbc7bc6cf0c4998d" ]
[ "tensorflow_probability/python/distributions/zipf_test.py" ]
[ "# Copyright 2018 The TensorFlow Probability 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 by a...
[ [ "numpy.vectorize", "numpy.ceil", "scipy.stats.zipf.logcdf", "scipy.stats.zipf.cdf", "numpy.floor", "numpy.ones_like", "tensorflow.compat.v2.test.main", "numpy.ndenumerate", "numpy.arange", "scipy.stats.zipf.logpmf", "tensorflow.compat.v1.set_random_seed", "tensorflo...
freewind-2016/mmcv
[ "ba30d98a7b2ac20f49aa6a88fecb5fbb97f438e8" ]
[ "mmcv/runner/base_runner.py" ]
[ "# Copyright (c) Open-MMLab. All rights reserved.\nimport copy\nimport logging\nimport os.path as osp\nimport warnings\nfrom abc import ABCMeta, abstractmethod\n\nimport torch\nfrom torch.optim import Optimizer\n\nimport mmcv\nfrom ..parallel import is_module_wrapper\nfrom .checkpoint import load_checkpoint\nfrom ....
[ [ "torch.cuda.is_available", "torch.cuda.current_device" ] ]
whzup/quadpy
[ "ca8bd2f9c5a4ae30dc85d8fb79217602bd42525e" ]
[ "quadpy/disk/_albrecht.py" ]
[ "import numpy\nimport sympy\nfrom mpmath import mp\n\nfrom ..helpers import article, fsd, pm, untangle, z\nfrom ._helpers import DiskScheme\n\n_citation = article(\n authors=[\"J. Albrecht\"],\n title=\"Formeln zur numerischen Integration über Kreisbereiche\",\n journal=\"ZAMM\",\n volume=\"40\",\n n...
[ [ "numpy.array", "numpy.arange", "numpy.vectorize", "numpy.vander" ] ]
adujardin/OpenIBL
[ "5ab80d65afa42ca22210c4c08983fdc156696bab" ]
[ "ibl/evaluators.py" ]
[ "from __future__ import print_function, absolute_import\nimport time\nfrom collections import OrderedDict\nimport numpy as np\nfrom sklearn.preprocessing import normalize\nfrom sklearn.metrics import pairwise_distances\n\nimport torch\nimport torch.nn.functional as F\nimport torch.distributed as dist\nimport torch....
[ [ "torch.distributed.all_gather", "torch.empty_like", "torch.distributed.get_world_size", "torch.distributed.get_rank", "torch.distributed.broadcast", "torch.nn.functional.normalize", "torch.no_grad", "numpy.argsort", "numpy.in1d", "torch.cat", "torch.pow" ] ]
joedomino874/hummingbot
[ "cb3ee5a30a2feb0a55ceca9d200c59662d7e3057" ]
[ "test/hummingbot/strategy/cross_exchange_market_making/test_cross_exchange_market_making.py" ]
[ "import logging\nimport pandas as pd\nfrom typing import List\nimport unittest\n\nfrom decimal import Decimal\nfrom math import floor, ceil\nfrom nose.plugins.attrib import attr\n\nfrom hummingbot.core.clock import Clock, ClockMode\nfrom hummingbot.core.data_type.limit_order import LimitOrder\nfrom hummingbot.core....
[ [ "pandas.Timestamp" ] ]
springcoil/lime
[ "fb1288ad50989d2effd569cb7f6b526a56d5c0a7" ]
[ "lime/lime_tabular.py" ]
[ "\"\"\"\nFunctions for explaining classifiers that use tabular data (matrices).\n\"\"\"\nimport collections\nimport json\nimport copy\nimport numpy as np\nimport sklearn\nimport sklearn.preprocessing\nfrom . import lime_base\nfrom . import explanation\n\n\nclass TableDomainMapper(explanation.DomainMapper):\n \"\...
[ [ "numpy.sqrt", "numpy.zeros", "numpy.searchsorted", "numpy.argsort", "numpy.random.choice", "numpy.exp", "numpy.random.normal", "numpy.max", "numpy.min", "sklearn.preprocessing.StandardScaler", "numpy.std", "numpy.array", "numpy.percentile", "numpy.mean" ] ...
sdonatti/nnabla
[ "ac4a42e62dd358f16bd79c08a9a9f3d83c0100c9" ]
[ "python/src/nnabla/experimental/graph_converters/batch_normalization_linear.py" ]
[ "import nnabla as nn\nimport numpy as np\n\nfrom .identity import IdentityConverter\nfrom .helpers import GraphInfo\n\n\nclass BatchNormalizationLinearConverter(IdentityConverter):\n \"\"\"\n The parameters of the batch normalization replaced simple scale and bias.\n\n Args:\n black_list (list): Bla...
[ [ "numpy.sqrt", "numpy.squeeze" ] ]
Oichii/resnet3D_pulse
[ "d123abfdb14eedc972ab1e0c4c3026fe8c4074af" ]
[ "ResNet_test.py" ]
[ "import os\nimport glob\nimport json\nimport torch\nimport torchvision.transforms as transforms\nimport torch.nn as nn\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.signal import resample, find_peaks\nfrom pulse_sampler import PulseSampler\nfrom pulse_dataset import PulseDataset\nfrom NegPearsonL...
[ [ "torch.utils.data.DataLoader", "torch.std", "torch.nn.L1Loss", "torch.no_grad", "torch.sqrt", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "torch.cat", "matplotlib.pyplot.savefig", "numpy.abs", "matplotlib.pyplot.xlim", ...
will-hossack/Poptics
[ "4093876e158eb16421dfd4e57818210b11381429" ]
[ "examples/analysis/SpotDiagramExample.py" ]
[ "\"\"\"\n Example Programme to for a Spot Digram using high level SpotAnalysis class\n\n\n\"\"\"\n\nfrom poptics.lens import DataBaseLens\nfrom poptics.vector import Angle,Unit3d\nfrom poptics.wavelength import getDefaultWavelength\nfrom poptics.analysis import SpotAnalysis\nfrom poptics.tio import getFloat\nimpo...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.show" ] ]
Iolaum/Gauss
[ "3b4873f7e21a0e5a0074646438e398f3c3ba3868" ]
[ "scripts/ali/ali01_testing/aa01_non_numerical.py" ]
[ "# coding: utf-8\n__author__ = 'Antonis'\n\n'''\nPython script for Kaggle Competition\n\nThis script focuses on reading the train dataset and getting information for non-numerical values.\nTo run the script you need to have the \"train.csv\" file inside the /dataset folder in the project root.\n'''\n\nimport pandas...
[ [ "pandas.read_csv", "numpy.unique" ] ]
SnorlaxSE/handtracking-Application
[ "5af03d9a1797040274ca2a306a7873cd48ea12af" ]
[ "detectVideo.py" ]
[ "from PyQt5 import QtWidgets, QtCore, QtGui\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtCore import QTimer\nimport qdarkstyle\nimport sys\nimport time\n \nfrom utils import detector_utils as detector_utils\nimport tensorflow as tf\nimport datetime\nimport argp...
[ [ "numpy.where" ] ]
FedericoGarza/sktime
[ "b21cdd81453abd34c72b42d4b2273b49d29eba30" ]
[ "sktime/performance_metrics/forecasting/probabilistic/_classes.py" ]
[ "#!/usr/bin/env python3 -u\n# -*- coding: utf-8 -*-\n# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)\n\nimport numpy as np\n\n# TODO: add formal tests\nimport pandas as pd\nfrom sklearn.utils import check_array, check_consistent_length\n\nfrom sktime.datatypes import check_is_scitype, conver...
[ [ "numpy.vstack", "pandas.Series", "pandas.DataFrame", "sklearn.utils.check_array", "sklearn.utils.check_consistent_length", "numpy.average" ] ]
jennydaman/nighres
[ "9ced74e61db02261e4753a69b03f4479bfdc26b6" ]
[ "nighres/io/io_mesh.py" ]
[ "import nibabel as nb\nimport numpy as np\n\n# TODO: compare with Nilearn functions and possibly extend\n\ndef load_mesh(surf_mesh):\n '''\n Load a mesh into a dictionary with entries\n \"points\", \"faces\" and \"data\"\n\n Parameters\n ----------\n surf_mesh:\n Mesh to be loaded, can be a...
[ [ "numpy.ones", "numpy.append", "numpy.zeros", "numpy.squeeze", "pandas.read_csv", "numpy.savetxt", "pandas.DataFrame", "numpy.arange", "numpy.shape", "numpy.isnan", "numpy.array", "numpy.concatenate", "numpy.loadtxt", "numpy.split" ] ]
thanhan/active-hcomp15
[ "7c82a3fc013e3d677073acfbabcffbed72d546d9" ]
[ "util.py" ]
[ "import xml.etree.ElementTree as ET\nimport numpy as np\n\nfrom sklearn.naive_bayes import MultinomialNB\nfrom sklearn.svm import SVC\nfrom sklearn.linear_model import SGDClassifier\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.metrics import confusion_matrix\n\nimport matplotlib.pyplot...
[ [ "numpy.ones", "matplotlib.pyplot.legend", "numpy.random.shuffle", "numpy.zeros", "sklearn.linear_model.SGDClassifier", "sklearn.feature_extraction.text.TfidfVectorizer", "matplotlib.pyplot.xlim", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.ylabel", "ma...
Rodrigo-Tenorio/nessai
[ "2b4175da61b3a7250d1154a126ad93481836df0d" ]
[ "tests/test_reparameterisations/test_rescale.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nTest the Rescale class.\n\"\"\"\nimport numpy as np\nimport pytest\nfrom unittest.mock import create_autospec\n\nfrom nessai.livepoint import numpy_array_to_live_points\nfrom nessai.reparameterisations import Rescale\n\n\n@pytest.fixture()\ndef reparam():\n return create_autospe...
[ [ "numpy.ones", "numpy.zeros", "numpy.testing.assert_array_equal", "numpy.arange", "numpy.testing.assert_array_almost_equal", "numpy.log", "numpy.array_equal" ] ]
daniosro/DMSP
[ "c5ad5b200c2eece611ab6b326a9a93cc3fd421d1" ]
[ "code/figures/enz_deg/modelling/d34s_DMSP_enz_deg.py" ]
[ "# %% \nimport git\nimport pandas as pd\nimport numpy as np\n\n# Find home directory for repo\nrepo = git.Repo(\"./\", search_parent_directories=True)\nhomedir = repo.working_dir\n\n#Import plotting features\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nfrom matplotlib.col...
[ [ "pandas.read_csv", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.ticker.FormatStrFormatter", "matplotlib.pyplot.subplot", "numpy.linspace" ] ]
lukaszplk/bagging
[ "39d2019b8b1cc26399e6470f1a18d4c084ab0056" ]
[ "main.py" ]
[ "# For this basic implementation, we only need these modules\nfrom sklearn.datasets import load_breast_cancer\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.ensemble import BaggingClassifier\n\n# Load the well-known Breast Cancer dataset\n# Split...
[ [ "sklearn.tree.DecisionTreeClassifier", "sklearn.datasets.load_breast_cancer", "sklearn.model_selection.train_test_split", "sklearn.ensemble.BaggingClassifier" ] ]
RamonPujol/OTSun
[ "0a587980b8465bcc886811de246718e08e6dab06" ]
[ "tests/test_4.py" ]
[ "import sys\r\nimport otsun\r\nimport os\r\nimport FreeCAD\r\nfrom FreeCAD import Base\r\nimport Part\r\nimport numpy as np\r\nnp.random.seed(1)\r\n\r\nimport random\r\nrandom.seed(1)\r\n\r\nimport logging\r\nlogger = otsun.logger\r\nlogger.setLevel(logging.ERROR)\r\n\r\n# create console handler and set level to de...
[ [ "numpy.random.seed", "numpy.arange", "numpy.array", "numpy.trapz", "numpy.concatenate" ] ]
jamiecook/AequilibraE
[ "b1013d59cbeaf6fc4e1a944cf31f20460a2a4156" ]
[ "aequilibrae/paths/all_or_nothing.py" ]
[ "\"\"\"\n -----------------------------------------------------------------------------------------------------------\n Package: AequilibraE\n\n Name: Traffic assignment\n Purpose: Implement traffic assignment algorithms based on Cython's network loading procedures\n\n Original Author: Pedro Camargo (c...
[ [ "numpy.sum", "numpy.nansum", "numpy.array_equal" ] ]
TanmayKumar-EngStud/Natural_Language_Processing
[ "7545e7f9273fd2e2a623d1f8e027b7981cf6ed0b" ]
[ "Latent Dirichlet Allocation/Latent Dirichlet Allocation.py" ]
[ "from sklearn.feature_extraction.text import CountVectorizer\nimport pandas as pd\nimport os\nos.system('clear')\n# This program is to understand the concept of Topic modelling using \n# Latent Dirichlet Allocation\n\nfile = open('shakesphere.txt','r')\n\ncVector = CountVectorizer(max_df=0.95, min_df=2, stop_words=...
[ [ "pandas.DataFrame", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.decomposition.LatentDirichletAllocation" ] ]
FANJIYU0825/federated-learning
[ "5772ca0a321a222eae5d5e29b70fb4a468c28374" ]
[ "main.py" ]
[ "import sys\nsys.path.insert(0,\"/content/federated-learning/\")\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport copy\nimport numpy as np\nfrom torchvision import datasets, transforms\nimport torch\n\nfrom utils.sampling import mnist_iid, mnist_noniid, cifar_iid\nfrom utils.opti...
[ [ "matplotlib.use" ] ]
Liang813/graphics
[ "71ab1775228a0a292427551350cbb62bfa8bd01a" ]
[ "tensorflow_graphics/projects/points_to_3Dobjects/utils/tf_utils.py" ]
[ "# Copyright 2020 The TensorFlow 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "numpy.ones", "tensorflow.gather", "tensorflow.reshape", "tensorflow.squeeze", "tensorflow.reduce_sum", "tensorflow.math.atan2", "tensorflow.meshgrid", "tensorflow.shape", "tensorflow.expand_dims", "tensorflow.cast", "tensorflow.debugging.assert_greater_equal", "ten...
insomnia94/OnAVOS
[ "1e34ba504519a6b6659e96b3a6e0427860afce1e" ]
[ "crf/crf_youtube.py" ]
[ "#!/usr/bin/env python3\n\nimport pydensecrf.densecrf as dcrf\nfrom pydensecrf.utils import unary_from_softmax\nfrom scipy.ndimage import imread\nfrom scipy.misc import imsave, imresize\nimport pickle\nimport numpy\nimport glob\nimport os\nfrom joblib import Parallel, delayed\nimport sys\n\nimgs_path = \"/data/corp...
[ [ "scipy.misc.imsave", "scipy.misc.imresize", "numpy.argmax", "numpy.ascontiguousarray", "scipy.ndimage.imread" ] ]
miguelmorin/pandas
[ "ce4ab828d882a0c50f2f63921621ccae0d14b5ae" ]
[ "pandas/core/groupby/groupby.py" ]
[ "import types\nfrom functools import wraps, partial\nimport numpy as np\nimport datetime\nimport collections\nimport warnings\nimport copy\nfrom textwrap import dedent\n\nfrom pandas.compat import (\n zip, range, lzip,\n callable, map\n)\n\nfrom pandas import compat\nfrom pandas.compat.numpy import function a...
[ [ "numpy.diff", "pandas.core.reshape.concat.concat", "numpy.asarray", "pandas._libs.reduction.SeriesBinGrouper", "pandas.core.resample.get_resampler_for_grouping", "pandas.core.dtypes.common.is_datetime64_any_dtype", "pandas.core.dtypes.missing._isna_ndarraylike", "pandas.core.window...
jhlee900958/PhySG
[ "8aaeaeea53595e039782ddad74491176f943be68" ]
[ "code/evaluation/eval.py" ]
[ "import sys\nsys.path.append('../code')\nimport argparse\nimport GPUtil\nimport os\nfrom pyhocon import ConfigFactory\nimport torch\nimport numpy as np\nimport cvxpy as cp\nfrom PIL import Image\nimport math\n\nimport utils.general as utils\nimport utils.plots as plt\nfrom utils import rend_util\nfrom utils import ...
[ [ "torch.utils.data.DataLoader", "torch.ones", "numpy.ones", "torch.load", "torch.svd", "torch.no_grad", "torch.diag", "numpy.median", "torch.set_default_dtype", "torch.cuda.is_available", "numpy.power", "numpy.clip", "torch.from_numpy", "torch.arange", "t...
akeaveny/robo-gym-robot-servers
[ "072ddf11292190f9770591853f66902e094c5df4" ]
[ "ur_robot_server/scripts/objects_controller.py" ]
[ "#!/usr/bin/env python\nimport rospy\nfrom std_msgs.msg import Bool\nfrom geometry_msgs.msg import Pose, Twist, TransformStamped\nfrom gazebo_msgs.msg import ModelState\nfrom scipy import signal, interpolate \nimport numpy as np \nimport copy\nimport os\nimport random\n\nimport tf, tf.msg\nimport json\n\nmove = Fal...
[ [ "numpy.random.uniform", "scipy.interpolate.splev", "scipy.interpolate.splprep", "numpy.full", "numpy.linspace", "scipy.signal.sawtooth" ] ]
marcobaga/leap
[ "975fa34aad4e3e578feea4dee3db45c061c29cdb" ]
[ "railrl/state_distance/tdm_networks.py" ]
[ "import numpy as np\nimport torch\n\nfrom railrl.state_distance.policies import UniversalPolicy\nfrom railrl.torch.networks import TanhMlpPolicy, FlattenMlp\nfrom railrl.torch.sac.policies import TanhGaussianPolicy\n\n\nclass TdmQf(FlattenMlp):\n def __init__(\n self,\n env,\n ve...
[ [ "torch.cat", "torch.abs", "torch.norm" ] ]
philhchen/OpenNMT-evidential-softmax
[ "87709ce1cf7bda783aed4a64c096fa23282e7aa9" ]
[ "onmt/modules/structured_attention.py" ]
[ "import torch.nn as nn\nimport torch\nimport torch.cuda\nfrom onmt.utils.logging import init_logger\n\n\nclass MatrixTree(nn.Module):\n \"\"\"Implementation of the matrix-tree theorem for computing marginals\n of non-projective dependency parsing. This attention layer is used\n in the paper \"Learning Stru...
[ [ "torch.rand", "torch.diag" ] ]
qtwang/SEAnet
[ "0cd38ff770bae8c4fe4f8d5f227a645b8c4c0ec9" ]
[ "util/data.py" ]
[ "# coding = utf-8\n\nimport os\nimport struct\nimport platform\nimport subprocess\nfrom os.path import isfile\nfrom pathlib import Path\nfrom ctypes import CDLL, c_char_p, c_long\nfrom _ctypes import dlclose\n\nimport torch\nimport numpy as np\nfrom torch.utils.data import Dataset\n\nfrom util.conf import Configura...
[ [ "numpy.sum", "numpy.fromfile", "torch.no_grad", "numpy.asarray", "torch.from_numpy", "numpy.array", "numpy.random.randint" ] ]
ellenjkr/LattesQualis
[ "4fa149ea9e1c58e12b03bd1b88474a0cc2c6d534" ]
[ "lattes_qualis/Backup/lattes_qualis/lattes_qualis.py" ]
[ "import pandas as pd\nfrom autor import Author\nfrom excel import ExcelFile\nfrom individuos import Student, Egress\nfrom verifica_autores import em_lista_autores, trata_exceçoes\nfrom valores import ND, quadrennium\nfrom PyscopusModified import ScopusModified\nfrom pprint import pprint\nfrom excecoes import exceco...
[ [ "pandas.read_csv", "pandas.DataFrame", "pandas.concat" ] ]
saulgold/miflora
[ "dc19d812dda1fc90b43e3e3bd72841fd62ca4003" ]
[ "plot_utils.py" ]
[ "#https://blog.heptanalytics.com/flask-plotly-dashboard/\nimport plotly\nimport plotly.graph_objs as go\nimport pandas as pd\nimport numpy as np\nimport json\nfrom config_utils.config import load_configs\nimport pydevd_pycharm\nimport os\n#pydevd_pycharm.settrace('192.168.0.68', port=1025, stdoutToServer=True, stde...
[ [ "pandas.read_csv" ] ]
lzlniu/Pubmed-Ref-Cite
[ "f6866a8882fcf36cf05056d4d1002a8213bf31f6" ]
[ "logcite.py" ]
[ "import sys\nimport numpy as np\nimport pandas as pd\n\nprint(\"input file:\", sys.argv[1])\nprint(\"output file:\", sys.argv[2])\ncitations = pd.read_csv(sys.argv[1], sep='\\t', header=None)\nalpha=float(sys.argv[3])\nprint(\"alpha:\", alpha)\npd.concat([citations[0], 1+np.log(alpha+citations[1])], axis=1, join=\"...
[ [ "pandas.read_csv", "numpy.log" ] ]
TaoWangzj/PCFAN
[ "f6ddc8fd2e72a45431891acf0b25135499c84485" ]
[ "utils.py" ]
[ "\"\"\"\npaper: Pyramid Channel-based Feature Attention Network for image dehazing \nfile: utils.py\nabout: all utilities\nauthor: Tao Wang\ndate: 12/01/2021\n\"\"\"\n\n# --- Imports --- #\nimport time\nimport torch\nimport torch.nn.functional as F\nimport torchvision.utils as utils\nfrom math import log10\nfrom sk...
[ [ "torch.nn.functional.mse_loss", "torch.split", "torch.autograd.Variable", "torch.no_grad", "torch.squeeze" ] ]
zy-zhou/MLCS
[ "478c95efb63d6c285a22c469fa7773e8f801052a" ]
[ "Utils.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sat Jul 6 18:51:41 2019\r\n\r\n@author: Zhou\r\n\"\"\"\r\nimport json\r\nfrom math import exp\r\nimport numpy as np\r\nimport torch\r\nimport torch.nn.functional as F\r\nfrom nltk.translate.bleu_score import sentence_bleu, SmoothingFunction\r\nfrom nltk.translate.me...
[ [ "torch.distributions.Multinomial", "torch.nn.functional.softmax", "torch.lt", "torch.div", "torch.topk", "torch.arange", "torch.nn.functional.cross_entropy", "numpy.mean", "torch.nn.functional.binary_cross_entropy_with_logits" ] ]
Shalmalee15/Differential_Reddening
[ "af2655484f0fc346e3967cf738b19bd4991c9842" ]
[ "my_reddening_code.py" ]
[ "# This is a part of the program which removes the effect of the Differential Reddening from the main sequence of the masive star clusters. \n# Reference: A. Milone et al (2012)\n# The steps: 1. Plot a CMD, 2. Rotate the main sequence using theta = A_Filter_1/(A_Filter_I - A_Filter_II); A = Absorption Coefficients ...
[ [ "numpy.sin", "matplotlib.pyplot.figure", "matplotlib.pyplot.gca", "pandas.DataFrame", "numpy.cos", "numpy.median", "matplotlib.pyplot.xlim", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.ylim", "numpy.loadtxt", ...
GProulx/ml-agents
[ "78a218b4254a74c5580aa3451ee9e391d65122ff" ]
[ "ml-agents/mlagents/trainers/sac/optimizer.py" ]
[ "import logging\nimport numpy as np\nfrom typing import Dict, List, Optional, Any, Mapping\n\nfrom mlagents.tf_utils import tf\n\nfrom mlagents.trainers.sac.network import SACPolicyNetwork, SACTargetNetwork\nfrom mlagents.trainers.models import LearningRateSchedule, EncoderType, ModelUtils\nfrom mlagents.trainers.c...
[ [ "numpy.ones", "numpy.tile", "numpy.cumsum", "numpy.log", "numpy.prod" ] ]
casassg/tfx
[ "07690d4581e44485b05be1c95cc1502c7b952911" ]
[ "tfx/orchestration/experimental/core/task_manager_test.py" ]
[ "# Copyright 2020 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.test.main" ] ]
Dev514/scikit-learn
[ "a13bad38182cab956b073dd1a48821e32180fd6c" ]
[ "sklearn/manifold/tests/test_t_sne.py" ]
[ "import sys\nfrom io import StringIO\nimport numpy as np\nfrom numpy.testing import assert_allclose\nimport scipy.sparse as sp\nimport pytest\n\nfrom sklearn.neighbors import NearestNeighbors\nfrom sklearn.neighbors import kneighbors_graph\nfrom sklearn.exceptions import EfficiencyWarning\nfrom sklearn.utils._testi...
[ [ "numpy.ones", "scipy.spatial.distance.pdist", "sklearn.metrics.pairwise.pairwise_distances", "sklearn.manifold._t_sne._kl_divergence_bh", "numpy.log", "numpy.fill_diagonal", "sklearn.manifold._barnes_hut_tsne.gradient", "numpy.meshgrid", "numpy.isfinite", "sklearn.manifold....
jacob-parnell-rozetta/pegasus
[ "ae08e41b32b1429e9f24b8a3b97dbb4d17bd2546" ]
[ "pegasus/data/datasets.py" ]
[ "# Copyright 2020 The PEGASUS 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 by applicable law ...
[ [ "tensorflow.data.Options", "tensorflow.gfile.Glob", "tensorflow.io.FixedLenFeature", "tensorflow.constant", "tensorflow.data.Dataset.from_tensor_slices" ] ]
ksteimel/allennlp
[ "dcd8d9e9671da5a87de51f2bb42ceb3abdce8b3b" ]
[ "allennlp/models/multitask.py" ]
[ "from collections import defaultdict\nimport inspect\nfrom typing import Any, Dict, List, Set, Union, Mapping\n\nfrom overrides import overrides\nimport torch\n\nfrom allennlp.data import Vocabulary, TextFieldTensors\nfrom allennlp.modules import Backbone\nfrom allennlp.models.model import Model\nfrom allennlp.mode...
[ [ "torch.nn.ModuleDict", "torch.index_select", "torch.LongTensor" ] ]
dpiponi/jax
[ "c40f5a991b50edee7820830f783218f7128feccc" ]
[ "jax/lax/lax_control_flow.py" ]
[ "# coding=utf-8\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl...
[ [ "numpy.array", "numpy.shape", "numpy.ndim" ] ]
clolsonus/dmd
[ "b57441cab716b996c386c5e5b32358434e1e9166" ]
[ "curt_mypydmd3.py" ]
[ "#!/usr/bin/env python3\n\nimport argparse\nimport cv2\nimport json\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport skvideo.io # pip install scikit-video\n\nfrom pydmd import DMD\n\nparser = argparse.ArgumentParser(description='virtual choir')\nparser.add_argument('video', help...
[ [ "matplotlib.pyplot.plot", "numpy.flipud", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.abs", "matplotlib.pyplot.pcolor", "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "numpy.max", "numpy.array", "matplotlib.pyplot.colorbar", ...
akharche/numba-dppy
[ "f12dac64b149bd72f305f341ff64b796bbb648c1" ]
[ "numba_dppy/tests/njit_tests/dpnp/test_numpy_array_ops.py" ]
[ "################################################################################\n# Numba-DPPY\n#\n# Copyright 2020-2021 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# Y...
[ [ "numpy.empty", "numpy.reshape", "numpy.random.random", "numpy.testing.assert_allclose", "numpy.array" ] ]
nane121/HacktoberFest2020
[ "29eb99754ee93f643d4b0bd7e18570079e718d59" ]
[ "ML from sratch/logistic_regression.py" ]
[ "import numpy as np\n\nclass LogisticRegression:\n \n \n def __init__(self, lr = 0.001, n_iters = 1000):\n self.lr = lr\n self.n_iters = n_iters\n self.weights = None\n self.bias = None\n \n def fit(self, X, y):\n #init parameters\n n_samples, n_features = X....
[ [ "numpy.sum", "numpy.dot", "numpy.zeros", "numpy.exp" ] ]
beyond007008/test
[ "ba4302a8d65ac8b63627bcfa8e3b23871fa2c390" ]
[ "tensorflowTUT/tensorflow8_feeds.py" ]
[ "# View more python learning tutorial on my Youtube and Youku channel!!!\n\n# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg\n# Youku video tutorial: http://i.youku.com/pythontutorial\n\n\"\"\"\nPlease note, this code is only for python 3+. If you are using python 2+, please modify...
[ [ "tensorflow.placeholder", "tensorflow.multiply", "tensorflow.Session" ] ]
PortfolioCollection/Character-Recogniser
[ "f826d6d932a5f19580ff0cdc6cd40e3a7e05ae35" ]
[ "-KNN Approach-/KNN_Tester.py" ]
[ "#--------Hopping-------#\nimport os\nimport sys\nsys.path.append('../_Core Functions_')\nimport Hop\n#----CUSTOM CLASSES-----#\nimport Extractor\nimport KNN_Trainer\n#---SUPPORT LIBRARIES---#\nimport numpy as np\nimport time\nimport re\nimport time\n\ndef test_image(answer_array,index,filename):\n image = Extra...
[ [ "numpy.zeros" ] ]
CTPLab/IID_representation_learning
[ "b9dc13536963f9af332b039f7cc772e2f1090c62" ]
[ "restyle/models/encoders/map2style.py" ]
[ "import numpy as np\nfrom torch import nn\nfrom torch.nn import Conv2d, Module\n\nfrom models.stylegan2.model import EqualLinear\n\n\nclass GradualStyleBlock(Module):\n def __init__(self, in_c, out_c, spatial):\n super(GradualStyleBlock, self).__init__()\n self.out_c = out_c\n self.spatial =...
[ [ "numpy.log2", "torch.nn.LayerNorm", "torch.nn.Conv2d", "torch.nn.Sequential", "torch.nn.InstanceNorm2d", "torch.nn.LeakyReLU" ] ]
Rishabhdhyani/Emotion-Age-Gender-Detector
[ "7aa5dc722e1102e8ffcfcb33f06b35194cccc523" ]
[ "demo.py" ]
[ "from pathlib import Path\nimport cv2\nimport dlib\nimport numpy as np\nimport argparse\nfrom contextlib import contextmanager\nfrom wide_resnet import WideResNet\nfrom keras.utils.data_utils import get_file\n\npretrained_model = \"https://github.com/yu4u/age-gender-estimation/releases/download/v0.5/weights.28-3.73...
[ [ "numpy.arange", "numpy.shape" ] ]
CarsonSlovoka/query_attendance
[ "eb94258a4ef0258d05c2bec06656b1b054ed0232" ]
[ "query_attendance.py" ]
[ "\"\"\"\nprepared:\n 1. chromedriver.exe: download from https://chromedriver.chromium.org/downloads\n #. put ``chromedriver.exe`` to {executable}/Scripts/\n\nUSAGE::\n employee_id_1234 password --action=1 --debug=0\n\"\"\"\nfrom os.path import abspath, dirname\nfrom os import path, startfile\nfrom time imp...
[ [ "pandas.DataFrame" ] ]
loveagri/a_journey_into_math_of_ml
[ "e081b67d51a8dc74daa55bb0de35de86acdaa536" ]
[ "04_transformer_tutorial_2nd_part/BERT_tutorial/Sentiment_Training.py" ]
[ "from torch.optim import Adam\nfrom torch.utils.data import DataLoader\n\nfrom dataset.sentiment_dataset_v2 import CLSDataset\nfrom models.bert_sentiment_analysis_v2 import *\nfrom sklearn import metrics\nfrom metrics import *\n\nimport tqdm\nimport pandas as pd\nimport numpy as np\nimport configparser\nimport os\n...
[ [ "torch.utils.data.DataLoader", "numpy.sum", "pandas.read_pickle", "numpy.zeros", "sklearn.metrics.roc_curve", "sklearn.metrics.auc", "pandas.DataFrame", "numpy.cos", "numpy.power", "numpy.array", "numpy.sin" ] ]
rouzbeh-afrasiabi/Image-Classifier
[ "01518aff07c37f09c6e3a860c7ead92a0e607c71" ]
[ "utils.py" ]
[ "import argparse\nimport os\nimport sys\nimport torch\nimport json\nfrom datetime import datetime\nimport numpy as np\n\ncwd = os.getcwd()\ncurrent_time = datetime.now().strftime('%Y-%m-%d-%H-%M-%S')\n\n\nclass Bunch(object):\n def __init__(self, adict):\n self.__dict__.update(adict) \n \ndef check_file(file...
[ [ "torch.cuda.is_available" ] ]
TomDonoghue/psychopy_templates
[ "3c3cbd75eee512c16be992957ee6ee242ab3666e" ]
[ "offline/offline_functions_template.py" ]
[ "\"\"\"\nTHIS IS A TEMPLATE FOR AN OFFLINE EXPERIMENT.\nPARTS IN ALL CAPS ARE NOTES ON THE TEMPLATE, AND NEED UPDATING TO RUN.\n\nClasses & Functions to run the .... experiment.\n\nNotes:\n- Here, set up to use LSL for sending event markers. This can be changed.\n- The default set up is to use LSL for sending event...
[ [ "numpy.vstack", "numpy.zeros" ] ]
smit-s/arviz
[ "6a51574efc2dfa652d489091121a3c46da64d12e" ]
[ "arviz/data/io_pymc3.py" ]
[ "\"\"\"PyMC3-specific conversion code.\"\"\"\nimport logging\nimport warnings\nfrom typing import Dict, List, Any, Optional, Iterable, Union, TYPE_CHECKING\nfrom types import ModuleType\n\nimport numpy as np\nimport xarray as xr\nfrom .. import utils\nfrom .inference_data import InferenceData, concat\nfrom .base im...
[ [ "numpy.stack", "numpy.where", "numpy.atleast_1d" ] ]
tlatkowski/tf-feature-selection
[ "86a62e28211f854944822b4aefffae582fa060d8" ]
[ "methods/selection.py" ]
[ "import tensorflow as tf\n\n\ndef fisher(data, num_instances: list, top_k_features=2):\n \"\"\"\n Performs Fisher feature selection method according to the following formula:\n D(f) = (m1(f) - m2(f) / (std1(f) - std2(f))\n\n :param data:\n :param num_instances:\n :param top_k_features:\n :retur...
[ [ "tensorflow.nn.moments", "tensorflow.nn.top_k", "tensorflow.name_scope", "tensorflow.abs", "tensorflow.convert_to_tensor", "tensorflow.square", "tensorflow.split" ] ]
josemariamoreira/BrainSpace
[ "d7e8e65c6463a81146e7fcfcca902feef04d329d" ]
[ "brainspace/mesh/mesh_operations.py" ]
[ "\"\"\"\nBasic functions on surface meshes.\n\"\"\"\n\n# Author: Oualid Benkarim <oualid.benkarim@mcgill.ca>\n# License: BSD 3 clause\n\n\nimport warnings\nimport numpy as np\n\nfrom vtk import (vtkDataObject, vtkThreshold, vtkGeometryFilter,\n vtkAppendPolyData)\n\nfrom .array_operations import get...
[ [ "numpy.logical_and", "numpy.issubdtype", "numpy.unique", "numpy.count_nonzero" ] ]
JaviAibar/DeepSpeechUnity
[ "b65dd29a6c71e4c274f521aa8b3a4c0af1240f90" ]
[ "Transcripter_Data/StreamingAssets/Dependencies/client.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\n\nimport argparse\nimport numpy as np\nimport shlex\nimport subprocess\nimport sys\nimport wave\nimport ffmpeg\nimport json\nimport os\nfrom pathlib import Path\n\nfrom deepspeech import Model, version...
[ [ "numpy.frombuffer" ] ]
AITrading2020/zipline_1.3.0_pro
[ "8825c3ea029b3e75b10084b98aa4fa7609e68a75" ]
[ "zipline/utils/factory.py" ]
[ "#\n# Copyright 2016 Quantopian, 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...
[ [ "pandas.Timestamp" ] ]
amanchokshi/mwa-satellites
[ "f9e8de353e7eddf28ed715c01d7d3fb5336f0f18" ]
[ "paper_plots/presentation/waterfall.py" ]
[ "import os\nimport sys\nimport time\nimport argparse\nimport numpy as np\n\nsys.path.append(\"../../decode_rf_data\")\nimport matplotlib.pyplot as plt\nfrom colormap import spectral\nimport rf_data as rf\n\nparser = argparse.ArgumentParser(\n description=\"\"\"\n Will plot waterfall plots\n \"\"\"\...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.median", "matplotlib.pyplot.rcParams.update", "numpy.arange" ] ]
Shmarkus/facenet
[ "ff3eaecc389e0636463ccb318b395c5f99eb39b4" ]
[ "tmp/visualize.py" ]
[ "\"\"\"Visualize individual feature channels and their combinations to explore the space of patterns learned by the neural network\nBased on http://nbviewer.jupyter.org/github/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/deepdream/deepdream.ipynb\n\"\"\"\n# MIT License\n#\n# Copyright (c) 2016 Da...
[ [ "tensorflow.compat.v1.placeholder", "numpy.random.uniform", "tensorflow.compat.v1.Session", "numpy.random.shuffle", "numpy.random.seed", "tensorflow.compat.v1.reduce_mean", "tensorflow.compat.v1.global_variables", "tensorflow.compat.v1.gradients", "tensorflow.compat.v1.expand_d...
idelbrid/gpytorch
[ "092d523027a844939ba85d7ea8c8c7b7511843d5" ]
[ "gpytorch/lazy/kronecker_product_lazy_tensor.py" ]
[ "#!/usr/bin/env python3\n\nimport torch\nimport operator\nfrom .lazy_tensor import LazyTensor\nfrom .non_lazy_tensor import lazify\nfrom ..utils.broadcasting import _matmul_broadcast_shape\nfrom ..utils.memoize import cached\nfrom functools import reduce\n\n\ndef _prod(iterable):\n return reduce(operator.mul, it...
[ [ "torch.Size" ] ]
syuoni/eznlp
[ "9d1397d8e9630c099295712cbcffa495353a3268" ]
[ "eznlp/model/decoder/sequence_tagging.py" ]
[ "# -*- coding: utf-8 -*-\nfrom typing import List\nfrom collections import Counter\nimport torch\n\nfrom ...wrapper import TargetWrapper, Batch\nfrom ...utils import ChunksTagsTranslator\nfrom ...nn.utils import unpad_seqs\nfrom ...nn.modules import CombinedDropout, CRF\nfrom ...nn.init import reinit_layer_\nfrom ....
[ [ "torch.stack", "torch.nn.utils.rnn.pad_sequence", "torch.tensor", "torch.nn.Linear" ] ]
frederikschubert/atari-representation-learning
[ "35743d4e2c765c8be4b771271b2c738c8859af92" ]
[ "scripts/run_rl.py" ]
[ "import multiprocessing\n\nmultiprocessing.set_start_method(\"spawn\", True)\nimport os\nimport sys\nimport time\nfrom collections import deque\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport wandb\n\nfrom a2c_ppo_acktr import algo, utils\nfrom a2c_ppo_acktr.model import NNBase, Policy\nfrom a2c_...
[ [ "torch.FloatTensor", "torch.nn.Linear", "torch.load", "torch.nn.init.constant_", "torch.no_grad", "numpy.median", "torch.cuda.is_available", "numpy.max", "numpy.min", "numpy.sqrt", "numpy.mean" ] ]
ubc-vision/mist
[ "ef8ab358e83dc306f356910578c5a7c1f8d193d8" ]
[ "datasets/mnist.py" ]
[ "import os\nimport torch\nimport torch.utils.data\nimport numpy as np\nimport skimage.io\nimport skimage.transform\n\nMNIST_CLASSES = (\n \"0\",\n \"1\",\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\"\n)\n\nclass MNISTMetaData():\n def __init__(self):\n ...
[ [ "numpy.load", "torch.from_numpy", "numpy.genfromtxt", "torch.cat", "torch.clamp" ] ]
Jun-bitacademy/PyPortfolioOpt
[ "a1ffaf403b1a7ba992480838993986241d067d52" ]
[ "From_Colab/Strategies/def_Momentum1mo_eff.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport FinanceDataReader as fdr\nfrom pykrx import stock\nimport datetime\nimport requests\n# from datetime import timedelta # 마이크로초 전, 마이크로초 후 를 구하고 싶다면 timedelta\nfrom dateutil.relativedelta import relativedelta # 몇달 전, 몇달 후, 몇년 전, 몇년 후 를 ...
[ [ "numpy.array", "pandas.DataFrame", "pandas.concat" ] ]
vishalbelsare/graphsim
[ "1ecd23608fe562d5f363cae2323c1916e82ba4e9" ]
[ "graphsim/iter/SimRank.py" ]
[ "\"\"\"\nSimRank similarity measure.\n\"\"\"\n#!/usr/bin/env python\n# Copyright (C) 2015 by\n# Xiaming Chen <chen_xm@sjtu.edu.cn>\n# All rights reserved.\n# BSD license.\nimport itertools\n\nimport numpy as np\nimport networkx as nx\nfrom typedecorator import params, returns\n\n__author__ = \"Xiaming Chen\"\n__ema...
[ [ "numpy.allclose", "numpy.copy" ] ]
tencent-youtu-visionseed/yt-visionseed-sdk-python
[ "647252c80d27d6ded8cf83434b2ee69a2c829895" ]
[ "example/example-plot.py" ]
[ "# -*- coding:utf-8 -*-\n# author: chenliang @ Youtu Lab, Tencent\nfrom visionseed import YtVisionSeed, YtDataLink\nimport serial\nimport matplotlib\nimport matplotlib.pyplot as plt\n\n\nvs = YtVisionSeed( serial.Serial(\"/dev/ttyACM0\",115200,timeout=0.5) )\n\nclass Chart:\n def __init__(self, maxlen=100, title...
[ [ "matplotlib.pyplot.ion", "matplotlib.pyplot.subplots" ] ]
urasakikeisuke/seamseg
[ "2b3a6d8aaaa895df4949e263e97c2f8b83332b88" ]
[ "seamseg/utils/panoptic.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport torch\n\nfrom .bbx import invert_roi_bbx\nfrom .misc import Empty\nfrom .roi_sampling import roi_sampling\n\n\nclass PanopticPreprocessing:\n def __init__(self,\n score_threshold=0.5,\n overlap_threshold=0.5,\n ...
[ [ "torch.zeros_like", "torch.argsort", "torch.tensor" ] ]
martins0n/etna
[ "51e9cec5183da2499ca247b0e2db215507246ceb" ]
[ "tests/test_transforms/test_missing_values/test_impute_transform.py" ]
[ "from copy import deepcopy\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom etna.datasets import TSDataset\nfrom etna.models import NaiveModel\nfrom etna.transforms.missing_values import TimeSeriesImputerTransform\nfrom etna.transforms.missing_values.imputation import _OneSegmentTimeSeriesImputerTr...
[ [ "pandas.infer_freq", "pandas.Series", "pandas.date_range", "pandas.DataFrame", "numpy.testing.assert_array_equal", "numpy.arange", "numpy.testing.assert_array_almost_equal", "numpy.all", "pandas.concat", "numpy.array", "numpy.where", "pandas.Timestamp" ] ]
cle-ros/RoutingNetworks
[ "0f1fe1221c67a224a02bca6247d3c4488ede0a04" ]
[ "PytorchRouting/DecisionLayers/Decision.py" ]
[ "\"\"\"\nThis file defines class DecisionModule.\n\n@author: Clemens Rosenbaum :: cgbr@cs.umass.edu\n@created: 6/7/18\n\"\"\"\nimport abc\nimport copy\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch.distributions.distribution import Distribution\n\nfrom .PolicyStorage import Appr...
[ [ "torch.zeros", "torch.ones", "torch.nn.Module.__init__", "torch.max" ] ]
janmalec/openmc
[ "4a4ac4c351d41fe153ca3341820cc507e484ce50" ]
[ "tests/regression_tests/deplete/example_geometry.py" ]
[ "\"\"\"An example file showing how to make a geometry.\n\nThis particular example creates a 3x3 geometry, with 8 regular pins and one\nGd-157 2 wt-percent enriched. All pins are segmented.\n\"\"\"\n\nfrom collections import OrderedDict\nimport math\n\nimport numpy as np\nimport openmc\n\n\ndef density_to_mat(dens_...
[ [ "numpy.linspace", "numpy.zeros" ] ]
khieu/cifar10_challenge
[ "332682fbf07f1ecae2cd3d4bb07ee7e1c6fb3c18" ]
[ "run_natural_instances.py" ]
[ "\"\"\"Evaluates a model against examples from a .npy file as specified\r\n in config.json\"\"\"\r\nfrom __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nfrom datetime import datetime\r\nimport json\r\nimport math\r\nimport os\r\nimport sys\r\nim...
[ [ "numpy.save", "numpy.load", "numpy.abs", "tensorflow.train.latest_checkpoint", "numpy.amin", "tensorflow.train.Saver", "tensorflow.Session", "numpy.amax", "numpy.concatenate" ] ]
MiCigo/matplotlib-tutorial
[ "31b7a8fd8ec334fa16609a894558ce23be035787" ]
[ "basic-train/basic-2.py" ]
[ "# -*- coding: utf-8 -*-\n'''\n@Description: code\n@Author: MiCi\n@Date: 2020-03-07 22:46:46\n@LastEditTime: 2020-03-12 10:47:55\n@LastEditors: MiCi\n'''\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef basic_label_2():\n x = np.linspace(-3, 3, 50)\n y1 = x*2 + 1\n y2 = x**2\n # label属性设定...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.xticks", "matplotlib.pyplot.gca", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.yticks", "matplotlib.pyplot.ylim", "matplotlib.pyplot.text", "matplotlib.pyplot.plot", "nu...
generoso/mlflow
[ "715e07e2c45109ef179d220f4e25848e92f79102" ]
[ "mlflow/types/schema.py" ]
[ "import json\nfrom enum import Enum\n\nimport numpy as np\nimport pandas as pd\nimport string\nfrom typing import Dict, Any, List, Union, Optional\n\nfrom mlflow.exceptions import MlflowException\nfrom mlflow.utils.annotations import deprecated\n\n\ndef _pandas_string_type():\n try:\n return pd.StringDtyp...
[ [ "numpy.dtype", "pandas.StringDtype" ] ]
pierre-haessig/matplotlib
[ "0d945044ca3fbf98cad55912584ef80911f330c6" ]
[ "examples/pylab_examples/ginput_manual_clabel.py" ]
[ "#!/usr/bin/env python\n# -*- noplot -*-\n\nfrom __future__ import print_function\n\"\"\"\nThis provides examples of uses of interactive functions, such as ginput,\nwaitforbuttonpress and manual clabel placement.\n\nThis script must be run interactively using a backend that has a\ngraphical user interface (for exam...
[ [ "numpy.sqrt", "numpy.zeros_like", "matplotlib.pyplot.ginput", "numpy.sort", "matplotlib.pyplot.clabel", "matplotlib.pyplot.draw", "matplotlib.pyplot.axis", "matplotlib.pyplot.gca", "matplotlib.pyplot.clf", "matplotlib.pyplot.title", "matplotlib.pyplot.contour", "mat...
ejgenc/Data-Analysis_Istanbul-Health-Tourism
[ "34b9838690ca640c6a7a60f63eb2f51983ec46ef" ]
[ "src/data_visualization/visualize_bivariate_analysis_htourism_center_count_at_district_level.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n------ What is this file? ------\n\nThis script targets one file:\n - geographic_distribution_of_htourism_centers.shp\n \nThe script produces a small-multiples scatterplot visualization of htourism center count\nper distict.\n\nReturns a small multiples view of two scatterplo...
[ [ "matplotlib.pyplot.figure", "numpy.array_equal", "scipy.stats.pearsonr", "matplotlib.pyplot.style.context" ] ]
bhumikapaharia/xarray
[ "39e586f96b8f23d3703a781c59c2ee01eb9d598a" ]
[ "xarray/tests/test_dask.py" ]
[ "import operator\nimport pickle\nimport sys\nfrom contextlib import suppress\nfrom distutils.version import LooseVersion\nfrom textwrap import dedent\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport xarray as xr\nimport xarray.ufuncs as xu\nfrom xarray import DataArray, Dataset, Variable\nfrom xa...
[ [ "numpy.ones", "pandas.MultiIndex.from_arrays", "numpy.maximum", "numpy.random.randn", "numpy.testing.assert_array_equal", "numpy.arange", "numpy.random.RandomState", "numpy.array", "numpy.sin", "pandas.Index" ] ]
chenyu-2020/PaddleNLP
[ "14c3209118b2cadcce9a8f66b760c9cddb3a02ad" ]
[ "examples/machine_reading_comprehension/SQuAD/run_squad.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n# Copyright 2018 The HuggingFace Inc. team.\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.ap...
[ [ "numpy.random.seed" ] ]
ivyshihwork/python
[ "f0324c0d61f98948316f79886084adb44752b9b2" ]
[ "games/06_us-states-game/test.py" ]
[ "import os\nimport pandas\nimport csv\n\ndirname = os.path.dirname(__file__)\nstate_file = os.path.join(dirname, '50_states.csv')\n\nstate_coors = pandas.read_csv(state_file)\nstate='ohio'\n\nstate_info = state_coors[state_coors.state.str.lower() == state]\n# state_name = state_info.values[0,0].lower()\n# state_x =...
[ [ "pandas.read_csv" ] ]
munrojm/pymatgen
[ "95514da2c1f4bd0ee897e657de768ca987fe05e9" ]
[ "pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py" ]
[ "# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\n\"\"\"\nThis module contains some utility functions and classes that are used in the chemenv package.\n\"\"\"\n\n__author__ = \"David Waroquiers\"\n__copyright__ = \"Copyright 2012, The Materials Pro...
[ [ "numpy.sum", "scipy.spatial.ConvexHull", "numpy.argwhere", "numpy.any", "numpy.argsort", "numpy.cross", "numpy.isclose", "numpy.copy", "numpy.ones_like", "scipy.interpolate.UnivariateSpline", "numpy.allclose", "numpy.argmin", "numpy.abs", "numpy.where", ...
ehsanvds/Imitation_Learning
[ "7a27d4c83d93299f504b3c44364d1f387d788d7b" ]
[ "main.py" ]
[ "\"\"\"\r\nImitation Learning\r\n@author: Ehsan\r\n\"\"\"\r\nimport numpy as np\r\nimport pandas as pd\r\nimport tensorflow as tf\r\nimport os\r\nimport general_functions\r\nimport network_functions\r\n\r\n#%% set parameters\r\nmeasure_path = r'...\\All_measurements_truncated.csv'\r\nimage_dir = r'...\\images'\r\nw...
[ [ "tensorflow.keras.optimizers.Adam", "tensorflow.shape", "tensorflow.config.experimental.list_physical_devices", "pandas.read_csv", "tensorflow.keras.Model", "pandas.Categorical", "tensorflow.convert_to_tensor", "tensorflow.data.Dataset.zip", "tensorflow.data.Dataset.from_tensor...
Alex-Greenen/SpectralNeuralAnimation
[ "0f5569f6f78705b11350ff18ccecb1205c642ffd" ]
[ "HighFrequency/Vizualise.py" ]
[ "from ProcessData.Skeleton import Skeleton\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport torch\nfrom typing import Tuple\n\nfrom HighFrequency.LossType import HighFrequencyLossType\nfrom HighFrequency.DataBase import DataBase\nfrom ProcessData.Utils import *\n...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "torch.split", "matplotlib.pyplot.xticks" ] ]
westonsteimel/polars
[ "67c2cb78f4ce228142dfadd4b8e6f1ebd0399acd" ]
[ "py-polars/polars/functions.py" ]
[ "from typing import Union, TextIO, Optional, List, BinaryIO\nimport numpy as np\nfrom pathlib import Path\nfrom .frame import DataFrame\nfrom .series import Series\nfrom .lazy import LazyFrame\nimport pyarrow as pa\nimport pyarrow.parquet\nimport pyarrow.csv\nimport pyarrow.compute\nimport builtins\nimport urllib.r...
[ [ "numpy.arange", "numpy.array" ] ]
matthieuvigne/pinocchio
[ "01f211eceda3ac2e5edc8cf101690afb6f3184d3" ]
[ "doc/d-practical-exercises/src/robot_hand.py" ]
[ "from math import pi\n\nimport numpy as np\nfrom numpy.linalg import norm, pinv\n\nimport pinocchio as se3\nfrom pinocchio.utils import cross, zero, rotate, eye\nfrom display import Display\n\n\nclass Visual(object):\n '''\n Class representing one 3D mesh of the robot, to be attached to a joint. The class con...
[ [ "numpy.vstack", "numpy.matrix", "numpy.hstack", "numpy.linalg.pinv", "numpy.linalg.norm" ] ]
jolibrain/pytorch-CycleGAN-and-pix2pix
[ "43465d660d445e020067979fa8d592a1b480c869" ]
[ "models/cycle_gan_semantic_model.py" ]
[ "import torch\nimport itertools\nfrom util.image_pool import ImagePool\nfrom .base_model import BaseModel\nfrom . import networks\nfrom torch.autograd import Variable\nimport numpy as np\nfrom .modules import loss\nfrom util.util import gaussian\n\nclass CycleGANSemanticModel(BaseModel):\n #def name(self):\n ...
[ [ "torch.nn.modules.CrossEntropyLoss", "torch.nn.L1Loss" ] ]
shivamvats/stable-baselines3
[ "d67a3bc800389212f94f274c4cf6036c78923105" ]
[ "stable_baselines3/sac/sac.py" ]
[ "from typing import Any, Dict, List, Optional, Tuple, Type, Union\n\nimport gym\nimport numpy as np\nimport torch as th\nfrom torch.nn import functional as F\n\nfrom stable_baselines3.common.buffers import ReplayBuffer\nfrom stable_baselines3.common.noise import ActionNoise\nfrom stable_baselines3.common.off_policy...
[ [ "torch.nn.functional.mse_loss", "torch.min", "torch.ones", "torch.no_grad", "numpy.prod", "numpy.mean" ] ]
crotsu/LearningPython
[ "53b8e0a268a9bb7e912fd34f1fd33c90efb85c8d" ]
[ "3dplot.py" ]
[ "from mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nx = np.arange(-3, 3, 0.25)\ny = np.arange(-3, 3, 0.25)\nX, Y = np.meshgrid(x, y)\nZ = 6*X*X + 4*X*Y + 3*Y*Y\n\nfig = plt.figure()\nax = Axes3D(fig)\nax.plot_wireframe(X,Y,Z) \n\nxx = np.linspace(-3, 3, 100)\nyy = np.lin...
[ [ "numpy.zeros", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.meshgrid", "numpy.linspace" ] ]
tiancity-NJU/Person-Reid
[ "153e5695acca533229793ef96d0e7cb01dbc243d" ]
[ "reid/models/inception.py" ]
[ "from __future__ import absolute_import\r\n\r\nimport torch\r\nfrom torch import nn\r\nfrom torch.nn import functional as F\r\nfrom torch.nn import init\r\n\r\n\r\n__all__ = ['InceptionNet', 'inception']\r\n\r\n\r\ndef _make_conv(in_planes, out_planes, kernel_size=3, stride=1, padding=1,\r\n bias=Fals...
[ [ "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.Linear", "torch.nn.init.constant", "torch.nn.BatchNorm1d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.functional.normalize", "torch.nn.init.normal", "torch.nn.functional.relu", "torch.nn.Conv2d", "torch.nn.Sequential"...
aesim-tech/simba-python-examples
[ "704591ea48155e83bb79b40ad66de197be4c580b" ]
[ "1. Run Simulation/1. Run Simulation.py" ]
[ "#%% Load modules\r\nfrom aesim.simba import DesignExamples\r\nimport matplotlib.pyplot as plt\r\n\r\n#%% Load project\r\nflybackConverter = DesignExamples.DCDC_Flyback()\r\n\r\n#%% Get the job object and solve the system\r\njob = flybackConverter.TransientAnalysis.NewJob()\r\nstatus = job.Run()\r\n\r\n#%% Get resu...
[ [ "matplotlib.pyplot.subplots" ] ]
emrejilta/web-scraper
[ "a2b60fe125a317c5ab444bbefc3a5da83dc40f4c" ]
[ "scraper.py" ]
[ "#!/usr/bin/env python3\n\nfrom bs4 import BeautifulSoup\nimport requests\nimport pandas as pd\n\nurl = \"https://redis.io/commands\"\n\n# Gets the entire html\ncontent = requests.get(url).text\n\n# Parse the html content\nsoup = BeautifulSoup(content, \"lxml\")\n\n# D\nsection = soup.find_all(\"section\", attrs={\...
[ [ "pandas.DataFrame" ] ]
zhaominyiz/RFDA-PyTorch
[ "4e172d49d96fbf3626c15a8b85103450ec9b1312" ]
[ "test_yuv_RF.py" ]
[ "# @ author: Minyi Zhao\nimport os\nos.environ['CUDA_VISIBLE_DEVICES'] = \"0\"\nimport time\nimport yaml\nimport argparse\nimport torch\nimport os.path as op\nimport numpy as np\nfrom collections import OrderedDict\nfrom tqdm import tqdm\n\nimport utils\nimport dataset\nfrom net_rfda import RFDA\nfrom skimage.metri...
[ [ "torch.load", "torch.no_grad", "numpy.clip", "numpy.array", "torch.cat" ] ]
zabaras/MH-MDGM
[ "6b3d0e0b8662da9d5ef62813113b444c18b70b49" ]
[ "Inversion/Channel/mdgm_mcmc.py" ]
[ "import numpy as np \nfrom forward import Prediction\nimport matplotlib.pyplot as plt\nimport os\nimport scipy\nfrom matplotlib import ticker,cm\nfrom latent import latent_c\n\nclass inference(object):\n def __init__(self,step,burn_in,dim,obs,sigma,true_permeability,true_pressure,obs_position,scale,device):\n ...
[ [ "numpy.sqrt", "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.reshape", "numpy.random.seed", "numpy.random.randn", "matplotlib.pyplot.subplots", "numpy.exp", "matplotlib.ticker.ScalarFormatter", "numpy.amin", "numpy.log", "numpy.power", "numpy.random.rand", ...