repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
carsecond/AeroPy
[ "81685f364abd9536fc62dce114f14bef191dab8c" ]
[ "aeropy/structural/stable_solution.py" ]
[ "import numpy as np\nfrom scipy.optimize import minimize\n\n\nclass mesh_1D():\n def __init__(self, alpha=[1, 1], alpha_nodes=[0, 1], mesh_n=10, x2=0):\n self.n = mesh_n\n self.x_p = np.linspace(0, 1, mesh_n)\n self.dx_p = 1./(mesh_n-1)\n self.alpha = alpha\n self.alpha_nodes =...
[ [ "numpy.resize", "numpy.linspace", "numpy.eye", "numpy.matmul", "scipy.optimize.minimize", "numpy.array", "numpy.zeros", "numpy.trapz" ] ]
drkwdck/Codec
[ "5cf7f2b3070f50a84b5e37d9333c34b23295f563" ]
[ "MetricsCalculator.py" ]
[ "import numpy as np\n\n\nclass MetricsCalculator:\n @staticmethod\n def PSNR(original: np.ndarray, compressed: np.ndarray) -> float:\n mse = np.mean((original - compressed) ** 2)\n if mse == 0:\n return 100\n max_pixel = 255.0\n psnr = 20 * np.log10(max_pixel / np.sqrt(m...
[ [ "numpy.mean", "numpy.sqrt" ] ]
tatarize/svgpathtools
[ "3bd88b02b482491e13707602352c00dfa51d10f4" ]
[ "test/test_parsing.py" ]
[ "# Note: This file was taken mostly as is from the svg.path module (v 2.0)\nfrom __future__ import division, absolute_import, print_function\nimport unittest\nfrom svgpathtools import *\nimport svgpathtools\nimport numpy as np\n\n\ndef construct_rotation_tf(a, x, y):\n a = a * np.pi / 180.0\n tf_offset = np.i...
[ [ "numpy.array_equal", "numpy.cos", "numpy.sin", "numpy.tan", "numpy.identity", "numpy.array" ] ]
gafzan/AlgorithmicTradingStrategies
[ "80e7f97bf75b22de52130de5ad247342488b27f4" ]
[ "database/bloomberg.py" ]
[ "\"\"\"\nbloomberg.py\n\"\"\"\ntry:\n import pdblp\nexcept ModuleNotFoundError:\n print(\"No Bloomberg acces found (when importing 'pdblp')\")\n\ntry:\n from xbbg import blp\nexcept ModuleNotFoundError:\n print(\"No Bloomberg acces found (when importing 'xbbg')\")\n\nimport pandas as pd\nfrom datetime i...
[ [ "pandas.concat", "pandas.to_datetime", "pandas.DataFrame", "pandas.pivot_table" ] ]
snwnde/yasa
[ "71c0a8245c61b328a82ab1197c34b673333120a3" ]
[ "yasa/spectral.py" ]
[ "\"\"\"\nThis file contains several helper functions to calculate spectral power from\n1D and 2D EEG data.\n\"\"\"\nimport mne\nimport logging\nimport numpy as np\nimport pandas as pd\nfrom scipy import signal\nfrom scipy.integrate import simps\nfrom scipy.interpolate import RectBivariateSpline\nfrom .io import set...
[ [ "numpy.sqrt", "numpy.asarray", "scipy.signal.stft", "numpy.squeeze", "numpy.ma.masked_outside", "numpy.in1d", "pandas.DataFrame", "numpy.round", "numpy.max", "numpy.mean", "scipy.optimize.curve_fit", "numpy.divide", "scipy.signal.welch", "numpy.hstack", ...
GHzytp/PyLorentz
[ "dedfc5d2eea231f523028abe4b3ba1c806bbff1f" ]
[ "PyTIE/TIE_helper.py" ]
[ "\"\"\"Helper functions for TIE. \n\nAn assortment of helper functions that load images, pass data, and generally \nare used in the reconstruction. Additionally, a couple of functions used for \ndisplaying images and stacks.\n\nAuthor: Arthur McCray, ANL, Summer 2019.\n\"\"\"\n \nimport matplotlib.pyplot as plt \ni...
[ [ "matplotlib.pyplot.imshow", "numpy.sqrt", "numpy.max", "numpy.arange", "numpy.fft.ifftshift", "matplotlib.pyplot.axis", "numpy.zeros", "numpy.min", "matplotlib.pyplot.savefig", "scipy.ndimage.rotate", "scipy.ndimage.filters.median_filter", "numpy.array", "numpy....
bayc/floris-1
[ "00fc1600e42fe8e92728e74ae47d8ba9da2e7360" ]
[ "examples/example_0005_adjust_floris.py" ]
[ "# Copyright 2019 NREL\n\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n# this file except in compliance with the License. You may obtain a copy of the\n# License at http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, soft...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "numpy.linspace" ] ]
gbegkas/Detectron
[ "8d53dcdc2d1282938636f8dd45859101214730ff" ]
[ "misc/max_auc.py" ]
[ "import json\r\nimport argparse\r\nimport sys\r\nimport os\r\nfrom matplotlib import pyplot as plt\r\n\r\ndef parse_args():\r\n parser = argparse.ArgumentParser(description='Test a Fast R-CNN network')\r\n parser.add_argument(\r\n '--path',\r\n dest='auc_file',\r\n help='json with auc',\r...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
ElDeveloper/pandas
[ "dc430c58654b9d0b943fb78dc493ba600511591f" ]
[ "pandas/core/common.py" ]
[ "\"\"\"\nMisc tools for implementing data structures\n\"\"\"\n\nimport re\nimport collections\nimport numbers\nimport codecs\nimport csv\nimport types\nfrom datetime import datetime, timedelta\nfrom functools import partial\n\nfrom numpy.lib.format import read_array, write_array\nimport numpy as np\n\nimport pandas...
[ [ "pandas.compat.BytesIO", "pandas.Series", "pandas.tslib.array_to_datetime", "numpy.asarray", "numpy.issubdtype", "pandas.core.index.Int64Index", "numpy.dtype", "numpy.all", "numpy.concatenate", "pandas.compat.map", "pandas.lib.maybe_convert_objects", "numpy.iinfo", ...
sumantu-powale/team-4K
[ "b72c6cffdc16202c29b8acc6f31611c80e157fec" ]
[ "Team-4K-Bayesian_Matting/getKernel.py" ]
[ "import numpy as np\n\n\"\"\"Function to get kernel area\"\"\"\n\ndef getKernel(kernel_size, x_pos, y_pos, min_pix, Trimap):\n\n foreground_tri = (Trimap == 1) # foreground alpha\n background_tri = (Trimap == 0) # background alpha\n num_fore = 0\n num_back = 0\n M, N, Ch = np.shape(Trimap)\n\n while num_for...
[ [ "numpy.fix", "numpy.shape" ] ]
ajlee21/core-accessory-interactome
[ "e2d8344e8c8abb1d0bda845ce2292b08ae590c51" ]
[ "archive/sra_experiment/nbconverted/2_correlation_genes.py" ]
[ "\n# coding: utf-8\n\n# # Correlation analysis\n# Explore the relationships between core and accessory genes\n\n# In[1]:\n\n\nget_ipython().run_line_magic('load_ext', 'autoreload')\nget_ipython().run_line_magic('autoreload', '2')\n\nimport pandas as pd\nimport os\nimport seaborn as sns\nimport numpy as np\nimport m...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "numpy.random.seed", "matplotlib.pyplot.subplots", "pandas.DataFrame", "numpy.ones", "numpy.concatenate", "matplotlib.pyplot.ylabel" ] ]
nickp60/annofilt
[ "bb199309d697616fbfa5426052d197a7659b7342" ]
[ "annofilt/get_complete_genomes.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n@author: Nick Waters\n\"\"\"\n\nimport os\nimport sys\nimport subprocess\nimport argparse\nimport shutil\nimport pandas as pd\nimport urllib.request\n\n\nfrom . import shared_methods as sm\n\n\ndef get_args(): # pragma nocover\n parser = argparse.Argumen...
[ [ "pandas.read_csv" ] ]
NuclearEngideer/openmc
[ "ffe0f0283a81d32759e4f877909bbb64d5ad0d3d" ]
[ "openmc/mesh.py" ]
[ "from abc import ABC\nfrom collections.abc import Iterable\nfrom numbers import Real, Integral\nimport warnings\nfrom xml.etree import ElementTree as ET\n\nimport numpy as np\n\nimport openmc.checkvalue as cv\nimport openmc\nfrom ._xml import get_text\nfrom .mixin import IDManagerMixin\nfrom .surface import _BOUNDA...
[ [ "numpy.reshape", "numpy.asarray", "numpy.prod", "numpy.array", "numpy.sum", "numpy.empty" ] ]
NOAA-ORR-ERD/post_gnome
[ "0d4ac24c0afd64d1044c50d56090081537ce2928" ]
[ "src/post_gnome/plotting/examples/contour_particles_at_time.py" ]
[ "from post_gnome.plotting import geo_plots\nimport matplotlib.pyplot as plt\nimport datetime\n\n\nplt.clf()\n\nax = geo_plots.add_map(bbox=(-125.2,-124.2,47.7,48.3), bna='coast_wa.bna') \n\n#add particles at one time\nt = datetime.datetime(2016,8,18,12)\n\nfilename = 'WA_particles.nc'\nax = geo_plots.contour_partic...
[ [ "matplotlib.pyplot.clf", "matplotlib.pyplot.show" ] ]
DavidNemeskey/pytorch_lm
[ "5ef28d863db5da5d88f3d7a6860b75065894c96a" ]
[ "pytorch_lm/lr_schedule.py" ]
[ "#!/usr/bin/env python3\n# vim: set fileencoding=utf-8 :\n\n\"\"\"LR schedules.\"\"\"\n\nfrom bisect import bisect_right\n\nfrom torch.optim.lr_scheduler import _LRScheduler, ExponentialLR, ReduceLROnPlateau\n\n\nclass ConstantLR(_LRScheduler):\n \"\"\"Keeps the learning rate constant.\"\"\"\n def get_lr(self...
[ [ "torch.optim.lr_scheduler.ExponentialLR" ] ]
caseybackes/mathcharcnn
[ "c66a2e609f2cc1ac2550b890fbf14f9e3de7f95f" ]
[ "src/my_cnn.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import (\n Dense,\n Dropout,\n Activation,\n Flatten,\n Conv2D,\n MaxPooling2D,\n)\nimport pickle\nimport numpy as np\n\n\ndef build_model(num_categories, filter_size=(3, 3)):\n # - - - THE SI...
[ [ "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.Flatten" ] ]
sergiobat/ppuda
[ "9b2a4b3dd6cced4d3db79a0a3262b69c49ab0781" ]
[ "ppuda/deepnets1m/genotypes.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nSome functionality in this script is based on the DARTS code: https://github.com/quark0/darts (Apache Li...
[ [ "torch.randn", "torch.nn.functional.softmax", "torch.rand" ] ]
Kamlesh-Prajapati/Deep-Surveillance-System
[ "beb19225c9822aa831f29bc8bad7e4d814cb50c0" ]
[ "settings/TrainSettings.py" ]
[ "import tensorflow as tf\nimport settings.DataSettings as dataSettings\n\n'''\n Following two variables control the shape of input\n data as the shape: [BATCH_SIZE*UNROLLED_SIZE, w, h, c].\n BATCH_SIZE: number of Videos in a batch.\n UNROLLED_SIZE: number of Frames in a Video.\n For the ConvNet p...
[ [ "tensorflow.train.AdamOptimizer" ] ]
sankhesh/tomviz
[ "7116f4eb75b30534a24462f4ddfb1694fe41c308" ]
[ "tomviz/python/AutoTiltAxisShiftAlignment.py" ]
[ "import numpy as np\nfrom scipy.interpolate import interp1d\nimport tomviz.operators\n\n\nclass AutoTiltAxisShiftAlignmentOperator(tomviz.operators.CancelableOperator):\n\n def transform(self, dataset):\n \"\"\"Automatic align the tilt axis to the center of images\"\"\"\n self.progress.maximum = 1\...
[ [ "numpy.amax", "numpy.sqrt", "numpy.linspace", "numpy.double", "numpy.roll", "numpy.arange", "numpy.sin", "scipy.interpolate.interp1d", "numpy.argmax", "numpy.interp", "numpy.zeros", "numpy.lib.pad", "numpy.asfortranarray", "numpy.fft.ifft", "numpy.sum", ...
numba/roc-examples
[ "752391b1f014df8e8f6919279ffa382d278f3b4b" ]
[ "numba_roc_examples/pandas_eval/test_eval_engine.py" ]
[ "from __future__ import print_function, division, absolute_import\n\nfrom numba import unittest_support as unittest\n\nimport pandas as pd\nimport numpy as np\nfrom timeit import default_timer as timer\nfrom numba_roc_examples.pandas_eval import eval_engine\n\neval_engine.register()\n\n\ndef _best_time(fn):\n ts...
[ [ "pandas.util.testing.assert_frame_equal", "numpy.arange", "numpy.testing.assert_allclose" ] ]
agschweingruber/icp
[ "b12996146cfb8cbce9da8d16f77169d428b5af98" ]
[ "training/src/models/loss.py" ]
[ "import torch\nfrom src.utils import pop_feature\n\n\nclass SequentialLoss:\n def __init__(self, categorical_feature_idcs, class_weights, target_names,\n norm_seq_len):\n self.categorical_feature_idcs = categorical_feature_idcs\n self.target_names = target_names\n self.norm_s...
[ [ "torch.nn.BCEWithLogitsLoss", "torch.nn.MSELoss" ] ]
robinlin1973/vnpy
[ "ab036f6bb48b4f788eec496deac377a8bce2ae83" ]
[ "docker/dockerTrader/ctaStrategy/strategy/strategyKingKeltner.py" ]
[ "# encoding: UTF-8\n\n\"\"\"\n基于King Keltner通道的交易策略,适合用在股指上,\n展示了OCO委托和5分钟K线聚合的方法。\n\n注意事项:\n1. 作者不对交易盈利做任何保证,策略代码仅供参考\n2. 本策略需要用到talib,没有安装的用户请先参考www.vnpy.org上的教程安装\n3. 将IF0000_1min.csv用ctaHistoryData.py导入MongoDB后,直接运行本文件即可回测策略\n\"\"\"\n\nfrom __future__ import division\n\nfrom ..ctaBase import *\nfrom ..ctaTempla...
[ [ "numpy.zeros" ] ]
ericlearning/generative-cyclegan
[ "15f0c331ec2a5b69ca77c872d08b821a710e82db" ]
[ "trainers/trainer_lsgan_cyclegan.py" ]
[ "import os\nimport copy\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport pandas as pd\nimport torch.optim as optim\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\nfrom torch.optim.lr_scheduler import CosineAnnealingLR, StepLR\nfrom utils import set_lr, get_lr, generate_noise, plot_multiple_...
[ [ "torch.nn.L1Loss" ] ]
SantiagoMille/micom
[ "8f3488a0d4261aacfa5707cfb5fcffa322485b47" ]
[ "micom/elasticity.py" ]
[ "\"\"\"Calculate elasticity coefficients.\n\nFunctions to calculate elasticity coefficients for various community\nquantities.\n\"\"\"\n\nfrom functools import partial\nimport pandas as pd\nimport numpy as np\nfrom tqdm.auto import tqdm\nfrom cobra.util import get_context\nfrom micom.util import reset_min_community...
[ [ "pandas.concat", "numpy.abs", "pandas.Series", "numpy.sign", "numpy.exp" ] ]
codema-dev/cso-network-gas
[ "a8036f8a219684992c9932da6bab3440916d90aa" ]
[ "get_average_consumptions.py" ]
[ "# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.10.2\n# kernelspec:\n# display_name: 'Python 3.9.1 64-bit (''cso-network-gas'': conda)'\n# metadata:\n# interpreter:\n# ...
[ [ "pandas.concat" ] ]
m3at/chainer-mask-rcnn
[ "83366fc77e52aa6a29cfac4caa697d8b45dcffc6" ]
[ "chainer_mask_rcnn/models/utils/proposal_target_creator.py" ]
[ "# Modified works:\n# --------------------------------------------------------\n# Copyright (c) 2017 - 2018 Kentaro Wada.\n# Licensed under The MIT License [see LICENSE for details]\n# --------------------------------------------------------\n\n# Original works:\n# --------------------------------------------------...
[ [ "numpy.random.choice", "numpy.concatenate", "numpy.round", "numpy.append", "numpy.argmax", "numpy.array", "numpy.where" ] ]
wangbingnan136/Multimodal-Toolkit
[ "568d0f5de1d370914a0f00f230a36d7985ba401f" ]
[ "multimodal_transformers/model/tabular_transformers.py" ]
[ "from torch import nn\nfrom transformers import (\n BertForSequenceClassification,\n RobertaForSequenceClassification,\n DistilBertForSequenceClassification,\n AlbertForSequenceClassification,\n XLNetForSequenceClassification,\n XLMForSequenceClassification\n)\n\nfrom transformers.models.bert.mode...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.ReLU" ] ]
marcscho/amllab
[ "147921ec4e42eae9fc4bdd457d2f7f37aefd04e2" ]
[ "batch_scripts/scoring_step.py" ]
[ "import os\nimport pickle\nimport joblib\nimport argparse\nimport pandas as pd\nfrom azureml.core.run import Run\nfrom azureml.core.model import Model\nfrom sklearn.preprocessing import LabelEncoder\n\n# load arguments\nparser = argparse.ArgumentParser(\"preprocess\")\nparser.add_argument(\"--intermediate-data-path...
[ [ "sklearn.preprocessing.LabelEncoder", "pandas.read_csv" ] ]
gavswe/unimod-mapper
[ "2adb0c55c798d89b04c933a2b12c536462c7e6d2" ]
[ "tests/test_mass_combos.py" ]
[ "#!/usr/bin/env python\n# encoding: utf-8\nfrom pathlib import Path\nimport pandas as pd\n\nimport unimod_mapper\n\n\n# test_dir = Path(unimod_mapper.__file__).parent.parent / \"tests\"\n# package_dir = test_dir.parent\n\n\n# def test_mass_to_combos():\n# # the order of the files shouldn't change the unimodIDs\...
[ [ "pandas.DataFrame" ] ]
djrlj694/nyc-taxi-analysis
[ "0d62cc56594ef9260580c9e6c203e9fbde6fee24" ]
[ "src/python/packages/file/sqlite.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nsqlite.py - A module defining a class (`SQLiteFile`) for reading a SQLite\ndatabase file (`*.sqlite` or `.db`).\n\"\"\"\nimport sqlite3\nfrom dataclasses import dataclass\nfrom typing import List\n\nimport pandas as pd\n\nfrom .data import DataFile\nfrom .jinja2 import Jinja2File\n\...
[ [ "pandas.read_sql_query" ] ]
brechtlaperre/Tsyganenko
[ "3122b21fd0476aea5e4fcc4fe9cc520c6468265d" ]
[ "src/DA/domain.py" ]
[ "from math import ceil\nimport os\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport click\nimport sys\n\nsys.path.append('.')\n\nfrom src.data.preprocess import read_and_parse\n\ndef accumulate_values(res...
[ [ "matplotlib.pyplot.tight_layout", "pandas.read_csv", "numpy.sqrt", "numpy.multiply", "pandas.Timestamp", "numpy.min", "numpy.arange", "numpy.abs", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.savefig", "matplotlib.pyplot.colorbar", "numpy.max", "matplotlib.p...
suryatmodulus/transformers
[ "eb5bdcdfa51f743887ee1d9c7f230444d7a8b23c" ]
[ "examples/pytorch/summarization/run_summarization_no_trainer.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n# Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ...
[ [ "torch.no_grad", "torch.utils.data.DataLoader", "numpy.where" ] ]
sanatb97/SokobanAI
[ "209a5efab50373786157827fded5acfee556db64" ]
[ "hungarian.py" ]
[ "#!/usr/bin/python\n\"\"\"\nCopyright (c) 2010 Thom Dedecko\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, mo...
[ [ "numpy.ones", "numpy.array", "numpy.where", "numpy.sum", "numpy.zeros" ] ]
kirarpit/ray
[ "bcc379556b135ee2e472b0e4b388c9e1f8274dc9" ]
[ "python/ray/rllib/tests/test_catalog.py" ]
[ "import gym\nimport numpy as np\nimport unittest\nfrom gym.spaces import Box, Discrete, Tuple\n\nimport ray\n\nfrom ray.rllib.models import ModelCatalog\nfrom ray.rllib.models.model import Model\nfrom ray.rllib.models.preprocessors import (NoPreprocessor, OneHotPreprocessor,\n ...
[ [ "numpy.array" ] ]
kammerje/webbpsf
[ "a3628dcb40e378121cf36872f44f29b195c2c2cf" ]
[ "webbpsf/tests/test_roman.py" ]
[ "import os\nimport numpy as np\nimport pytest\nfrom webbpsf import roman, measure_fwhm\nfrom astropy.table import Table\nfrom numpy import allclose\n\n\nGRISM_FILTERS = roman.GRISM_FILTERS\nPRISM_FILTERS = roman.PRISM_FILTERS\n\ndef detector_substr(detector):\n \"\"\"\n change detector string to match file fo...
[ [ "numpy.mean", "numpy.allclose" ] ]
changliuroger/scikit-learn
[ "0da7c3c8d3ba62e742d63f3bed26947a72e9803d" ]
[ "sklearn/metrics/pairwise.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Mathieu Blondel <mathieu@mblondel.org>\n# Robert Layton <robertlayton@gmail.com>\n# Andreas Mueller <amueller@ais.uni-bonn.de>\n# Philippe Gervais <philippe.gervais@inria.fr>\n# La...
[ [ "numpy.dot", "numpy.sqrt", "numpy.asarray", "numpy.concatenate", "numpy.fill_diagonal", "numpy.var", "numpy.exp", "scipy.sparse.issparse", "numpy.clip", "numpy.arange", "numpy.diag_indices_from", "numpy.zeros", "scipy.spatial.distance.cdist", "scipy.sparse.c...
MatthieuDartiailh/vispy
[ "09d429be361a148b0614a192f56d4070c624072c" ]
[ "examples/howto/rotate-cube.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# vispy: gallery 50\n\"\"\"\nThis example shows how to display 3D objects.\nYou should see a colored outlined spinning cube.\n\"\"\"\n\nimport numpy as np\nfrom vispy import app, gloo\nfrom vispy.util.transforms import perspective, translate, rotate\n\n\nvert = \"\"\...
[ [ "numpy.arange", "numpy.eye", "numpy.array" ] ]
hyz-xmaster/swa_object_detection
[ "8c82c4c178f0b6bba077ff9d906a81bf8e04789c" ]
[ "mmdet/core/utils/swa_hook.py" ]
[ "import os.path as osp\nfrom copy import deepcopy\n\nimport torch\nfrom mmcv.runner import HOOKS, Hook\nfrom mmcv.runner.checkpoint import save_checkpoint\nfrom mmcv.runner.log_buffer import LogBuffer\n\nfrom mmdet.core import DistEvalHook, EvalHook\n\n\n@HOOKS.register_module()\nclass SWAHook(Hook):\n r\"\"\"SW...
[ [ "torch.tensor" ] ]
UCL-RITS/DashPy-kpi
[ "3fc85fe18017cf8dcda4e0ed389774c73396b1f7" ]
[ "DashPykpi/kpistats.py" ]
[ "from __future__ import print_function\nimport os\nfrom github3 import login\nimport pandas as pd\nimport numpy as np\nimport codecs\nimport getpass\nimport json\nimport requests\nfrom tinydb import TinyDB, Query\nfrom bokeh.charts import Area, defaults\nfrom bokeh.models import HoverTool, ColumnDataSource\nfrom bo...
[ [ "numpy.array" ] ]
cclauss/dgl
[ "6589969e45eeb694366bf530f9a195bd78a456df" ]
[ "python/dgl/backend/mxnet/tensor.py" ]
[ "from __future__ import absolute_import\n\nimport numpy as np\nimport mxnet as mx\nimport mxnet.ndarray as nd\n\ndef data_type_dict():\n return {'float16' : np.float16,\n 'float32' : np.float32,\n 'float64' : np.float64,\n 'uint8' : np.uint8,\n 'int8' : np.int8,\n...
[ [ "numpy.split", "numpy.cumsum", "numpy.nonzero", "numpy.unique" ] ]
hontlong/vue-admin-template
[ "2c476a169c47a85f785aea6d9b1dbd94c02a7edc" ]
[ "server/extract_cnn_vgg16_keras.py" ]
[ "# extract_cnn_vgg16_keras.py\n# -*- coding: utf-8 -*-\n\n# keras/tensorflow 使用flask部署服务的常见错误的解决办法\n# http://www.luyixian.cn/news_show_381268.aspx\n# 非常重要,需要如此才能嵌入flask中使用\n# 当前仅能在非dev模式下使用,\n# dev会二次load,会有找不到模块的错误。当前没办法解决。\n\nimport os\n\nimport numpy as np\nimport tensorflow.compat.v1 as tf # 这个是需要的\nfrom kera...
[ [ "tensorflow.compat.v1.get_default_graph", "numpy.expand_dims", "numpy.linalg.norm", "tensorflow.compat.v1.Session", "numpy.concatenate", "numpy.zeros" ] ]
ThomasTNO/mpyc
[ "11ea79be06a676a8b2ae2d81d94621ec35c638e8" ]
[ "demos/ridgeregression.py" ]
[ "\"\"\"Demo Linear and Ridge Regression.\n\nMPyC demo accompanying the paper 'Efficient Secure Ridge Regression from\nRandomized Gaussian Elimination' by Frank Blom, Niek J. Bouman, Berry\nSchoenmakers, and Niels de Vreede, presented at TPMPC 2019 by Frank Blom.\nSee https://eprint.iacr.org/2019/773 (or https://ia....
[ [ "numpy.dot", "numpy.min", "numpy.diagflat", "numpy.reshape", "numpy.tril_indices", "numpy.triu_indices", "numpy.concatenate", "numpy.max", "numpy.transpose", "numpy.empty" ] ]
michaelnt/pycircuit
[ "ef3110c1c3789c1e5f30c35e3f5dd15ed4bd349e" ]
[ "pycircuit/sim/simulation.py" ]
[ "# -*- coding: latin-1 -*-\n# Copyright (c) 2008 Pycircuit Development Team\n# See LICENSE for details.\n\nimport numpy as np\nfrom pycircuit.utilities import Parameter, ParameterDict, isiterable\nimport types\nfrom copy import copy\n\nclass Simulation(object):\n \"\"\"Base class for simulations\n \n A Sim...
[ [ "numpy.log10", "numpy.diff", "numpy.linalg.norm", "numpy.linspace" ] ]
ObukhovVladislav/python-adv
[ "ffab71d28e54d2c9b9c53c5fec453873242291f3" ]
[ "210222/step_3.py" ]
[ "from random import randint\nfrom time import perf_counter\n\nimport numpy as np\nfrom random import randint\nfrom time import perf_counter\n\nimport numpy as np\n\nnums = [randint(1, 1000) for _ in range(10 ** 5)]\n\nnums_by_7 = [num for num in nums]\nstart = perf_counter()\nprint(sum(nums_by_7), perf_counter() - ...
[ [ "numpy.array" ] ]
sahilm89/stack_overflow_random
[ "ad2e5361305eb53367452ebe6dd7dd1125700817" ]
[ "trial2.py" ]
[ "import pandas as pd\nimport Tkinter\nimport tkFileDialog\nimport matplotlib\n\nmatplotlib.use(\"TkAgg\")\n\nclass App():\n def __init__(self):\n self.root = Tkinter.Tk()\n self.root.geometry(\"500x100\")\n self.root.wm_title(\"Main\")\n\n labelframe = Tkinter.LabelFrame(self.root, te...
[ [ "matplotlib.use" ] ]
Joeper214/blueoil
[ "5aeb6634770011753b8d5ae283b91b7a0050101e", "5aeb6634770011753b8d5ae283b91b7a0050101e" ]
[ "tests/converter/test_optimizer.py", "blueoil/cmd/output_event.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2018 The Blueoil 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...
[ [ "numpy.random.uniform", "numpy.array", "numpy.zeros", "numpy.random.rand" ], [ "pandas.DataFrame" ] ]
phschaad/dace
[ "1c2abdf775c45c3b1c6ef7886007c917cebcd176" ]
[ "tests/fpga/pipeline_scope.py" ]
[ "# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.\nimport copy\nimport dace\n\n\ndef make_sdfg(dtype, name=\"pipeline_test\"):\n\n n = dace.symbol(\"N\")\n k = dace.symbol(\"K\")\n m = dace.symbol(\"M\")\n\n sdfg = dace.SDFG(name)\n\n pre_state = sdfg.add_state(name + \"_pr...
[ [ "numpy.arange", "numpy.empty" ] ]
ksomf/workbook
[ "12fcac2c08e235ffa9c1706d6fee4f65d97d63b9" ]
[ "alexeygrigorev_zoomcamp/capstone_project/train.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as pl\nimport seaborn as sns\nimport tensorflow as tf\n\nimport re\nimport json\n\nfrom functools import partial\nfrom itertools import filterfalse\nfrom wordcloud import WordCloud\nfrom t...
[ [ "pandas.read_csv", "pandas.to_datetime", "numpy.asarray", "tensorflow.keras.layers.Dense", "tensorflow.keras.Sequential", "tensorflow.saved_model.save", "pandas.to_timedelta", "tensorflow.keras.layers.Normalization", "pandas.value_counts", "tensorflow.keras.layers.Dropout",...
lzmisscc/emoran
[ "f7360ac21b0c8657244d75ec927020fb26c41fea" ]
[ "tools/dataset.py" ]
[ "import random\nimport torch\nfrom torch.utils.data import Dataset\nimport torchvision.transforms as transforms\nfrom torch.utils.data import sampler\nimport lmdb\nimport six\nimport sys\nfrom PIL import Image\nimport numpy as np\n\n\nclass lmdbDataset(Dataset):\n\n def __init__(self, root=None, transform=None, ...
[ [ "torch.arange" ] ]
leherbert/Informer2020
[ "45d4a656550e90399b3934a8f51e7ebc5a32e745" ]
[ "models/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom utils.masking import TriangularCausalMask, ProbMask\nfrom models.encoder import Encoder, EncoderLayer, ConvLayer\nfrom models.decoder import Decoder, DecoderLayer\nfrom models.attn import FullAttention, ProbAttention, AttentionLayer\nfrom...
[ [ "torch.device", "torch.nn.Linear", "torch.nn.LayerNorm" ] ]
Will-Smith11/BettyBot
[ "2b9f6b62b1d6394fbb974b39ba93ad3c02023a7e" ]
[ "BettyBot/EntireGameScreen.py" ]
[ "import numpy as np\nimport cv2\nfrom mss import mss\nimport time\n\n# location of the screen grab image\nbbox = {'top': 57, 'left': 0, 'width': 420, 'height': 750}\n#resizing pct of img\nheight_percent = 53\nwidth_percent = 60\nsct = mss()\nlast_time = time.time()\n\ndef convert_Gray(original_image):\n processe...
[ [ "numpy.array" ] ]
mrjleo/fastforward
[ "3178257a7095dc2f23528ce0a509280b2c0f6a00" ]
[ "fast_forward/index.py" ]
[ "import abc\nimport time\nimport pickle\nimport logging\nfrom enum import Enum\nfrom pathlib import Path\nfrom queue import PriorityQueue\nfrom collections import OrderedDict, defaultdict\nfrom typing import Callable, Dict, Iterable, Iterator, List, Sequence, Set, Tuple, Union\n\nimport numpy as np\nfrom tqdm impor...
[ [ "numpy.dot", "numpy.max", "numpy.append", "numpy.mean", "numpy.average", "numpy.array" ] ]
sudo-rajarshi/covid19indialive.com
[ "1ad5677b9c2f6a5ad8b250ba2ee39ff231fac10b" ]
[ "track.py" ]
[ "import pandas as pd\nimport numpy as np\nimport requests\nfrom datetime import datetime\nimport ftplib\nimport time as ts\nimport os\n\ndir_path = os.path.dirname(os.path.realpath(__file__))\n\n# # State Data\napi_url_data = 'https://api.covid19india.org/data.json'\n\nr_data = requests.get(api_url_data)\ndata_time...
[ [ "pandas.DataFrame", "numpy.append", "numpy.add", "numpy.array", "numpy.divide" ] ]
teamwong111/Data-mining-course
[ "719ea546f7f0f3904e888ac94c19d02daff32a9b" ]
[ "svm-digital-recognition/code/test.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\nimport tensorflow as tf\nimport itertools\nimport matplotlib.pyplot as plt\nimport _pickle as pickle\nfrom sklearn.metrics import accuracy_score, confusion_matrix, classification_report\nimport data\nimport mydata\n\n'''步骤五:评估模型'''\n# 加载模型\nwith open('.\\\\saved_model\\...
[ [ "numpy.unique", "numpy.array", "sklearn.metrics.confusion_matrix", "sklearn.metrics.accuracy_score" ] ]
anuranrc/Paddle
[ "21fa3eb0688459d3b71141d316e8358d31882b8d" ]
[ "paddle/py_paddle/util.py" ]
[ "# Copyright (c) 2016 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 req...
[ [ "numpy.fromfile" ] ]
marcgonzmont/SurfaceInspection
[ "8b8171be69eb617898801a2072fd3451b279e377" ]
[ "main.py" ]
[ "import sys\r\nfrom os.path import basename\r\nimport argparse\r\nimport numpy as np\r\nimport glob\r\nimport cv2\r\nfrom myPackage import tools as tl\r\nfrom myPackage import image_processing as imp\r\nfrom myPackage import Gabor_filter as gf\r\n\r\nif __name__ == '__main__':\r\n parser = argparse.ArgumentParse...
[ [ "numpy.arange", "numpy.set_printoptions", "numpy.mean", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
casperbh96/Statistical_Significance_Testing
[ "bfddbfc48bb9ad7f97183ec2b6f104bb2c101903" ]
[ "src/significance.py" ]
[ "import numpy as np\nfrom scipy import stats\nfrom scipy.stats import levene, f_oneway\n\ndef gaussian_test(col, values):\n stat1, p1 = stats.shapiro(values)\n stat2, p2 = stats.normaltest(values)\n\n print(f\"Gaussian: {col}\\n\\t{p1:5f} (Shapiro-Wilk)\\n\\t{p2:5f} (D'Agostino's)\")\n\n\ndef correlation_t...
[ [ "scipy.stats.f_oneway", "scipy.stats.normaltest", "numpy.eye", "scipy.stats.pearsonr", "scipy.stats.shapiro", "scipy.stats.levene", "scipy.stats.spearmanr", "numpy.random.RandomState" ] ]
bsridatta/robotfashion
[ "594853c59a536a83e5c81d3a825dcfa72f7ac03b" ]
[ "robotfashion/robotfashion/data/deepfashion2.py" ]
[ "import os\nimport json\n\nimport numpy as np\nimport torch as t\n\nfrom .util import has_correct_folder_structure, maybe_download_and_unzip_data\n\nfrom torchvision.datasets import VisionDataset\nfrom PIL import Image\n\n\nclass DeepFashion2(VisionDataset):\n train_mode = \"train\"\n val_mode = \"val\"\n ...
[ [ "numpy.zeros", "torch.tensor" ] ]
bhazelton/lunarsky
[ "4453fca33ad51e7eb1a02ee7f154cd698e5048ca" ]
[ "lunarsky/tests/test_time.py" ]
[ "\nimport numpy as np\nfrom astropy.coordinates import ICRS\nfrom astropy.time import TimeDelta\nimport pytest\n\nfrom lunarsky import MoonLocation, SkyCoord, Time\n\n\n@pytest.mark.parametrize('lat', np.linspace(-89, 89, 5))\n@pytest.mark.parametrize('lon', np.linspace(0, 360, 5))\ndef test_sidereal_time_calculati...
[ [ "numpy.linspace" ] ]
bennimmo/elastiknn
[ "544c8f22eb37067d632c479e2a1a23d0be4e5bca" ]
[ "elastiknn-benchmarks/python/preprocess.py" ]
[ "import array\nimport gzip\nimport json\nimport os\nimport sys\nfrom io import BytesIO\nfrom itertools import islice\nfrom math import *\nfrom random import Random\nfrom time import time\nfrom typing import List\n\nimport PIL\nimport boto3\nimport h5py\nfrom PIL import Image\nfrom botocore.exceptions import ClientE...
[ [ "sklearn.neighbors.NearestNeighbors" ] ]
rahulbhadani/hcipy
[ "b52726cb9502b5225ddff9d7b1ff417f2350cda8" ]
[ "hcipy/mode_basis/zernike.py" ]
[ "import numpy as np\nfrom math import sqrt, floor\nfrom scipy.special import binom\n\ndef noll_to_zernike(i):\n\t'''Get the Zernike index from a Noll index.\n\n\tParameters\n\t----------\n\ti : int\n\t\tThe Noll index.\n\t\n\tReturns\n\t-------\n\tn : int\n\t\tThe radial Zernike order.\n\tm : int\n\t\tThe azimuthal...
[ [ "numpy.cos", "numpy.sin" ] ]
evcano/seisflows
[ "d7c52827891c11f4b9681418b91bd4ab6a264e9b" ]
[ "seisflows/preprocess/pyatoa.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nThis is the base class seisflows.preprocess.Pyatoa\n\nThis is a main Seisflows class, it controls the preprocessing.\nThis class uses the Python package Pyatoa to perform preprocessing, and\nmisfit measurement.\n\n..warning::\n This might break if no residuals are written for a gi...
[ [ "numpy.savetxt", "numpy.loadtxt" ] ]
AmazingSean/spotify_top_tracks_analysis
[ "f1f58751abf77cacd55ca7271f8a285614b0a8d3" ]
[ "data/billboard_data_process.py" ]
[ "import pandas as pd\nimport numpy as np\nimport sys\n\nimport spotipy\nimport spotipy.util as util\nfrom spotipy.oauth2 import SpotifyClientCredentials\n\nfrom pandarallel import pandarallel\n\n\ndef get_features_with_id(id, sp):\n \"\"\"\n Get audio features provided by Spotify Web API.\n \"\"\"\n ...
[ [ "pandas.read_csv", "numpy.mean" ] ]
ikngtty/solve_maze
[ "9e3f4bd2b35057b14ccb0fe6a58e6cb4f9958cd6" ]
[ "mylib/maze.py" ]
[ "\"\"\"Use A-star algorithm.\"\"\"\nimport heapq as hq\nimport typing\n\nimport scipy.spatial as spatial\n\nfrom . import util\n\n\ndef is_passable(pixel) -> bool:\n \"\"\"\n Judge whether we can pass through the pixel or not.\n\n Parameters\n ----------\n pixel\n The value of the pixel in the...
[ [ "scipy.spatial.distance.euclidean" ] ]
AjitPant/AprilTag_Detection
[ "fd93d0803d0f4b5f7a862f77f2db26a189ebeedb" ]
[ "detection/inference/data_validator.py" ]
[ "import numpy as np\nimport pickle\nimport cv2\nimport glob\nimport os\nimport argparse\nfrom multiprocessing import Process, Manager\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport itertools\n\n\n\n\ndef process(args):\n corners, ids, counter = pickle.load( open( args.pkl_path, \"rb\" ) )[:...
[ [ "numpy.array", "matplotlib.pyplot.show", "numpy.mean" ] ]
weareno1/cupy
[ "ac52cce00b69d97b5d99bd1f91caed720b32b2d3", "5cf50a93bbdebe825337ed7996c464e84b1495ba" ]
[ "tests/cupyx_tests/scipy_tests/sparse_tests/test_csc.py", "tests/cupy_tests/core_tests/test_ndarray_ufunc.py" ]
[ "import unittest\n\nimport numpy\ntry:\n import scipy.sparse\n scipy_available = True\nexcept ImportError:\n scipy_available = False\n\nimport cupy\nfrom cupy import testing\nfrom cupyx.scipy import sparse\n\n\ndef _make(xp, sp, dtype):\n data = xp.array([0, 1, 3, 2], dtype)\n indices = xp.array([0, ...
[ [ "numpy.array", "numpy.dtype" ], [ "numpy.add", "numpy.array", "numpy.sin" ] ]
darrenf0209/PFNL
[ "e8316b4e2460bac8785a878e0814c3221f47fd8c" ]
[ "modules/videosr_ops.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.ops import control_flow_ops\n# re-do slim\nimport tf_slim as slim\n\n# OLD\n#slim = tf.contrib.slim\n\n\ndef im2uint8(x):\n if x.__class__ == tf.Tensor:\n return tf.cast(tf.clip_by_value(x, 0.0, 1.0) * 255.0, tf.uint8)\n else:\n ...
[ [ "tensorflow.device", "tensorflow.concat", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.cast", "tensorflow.equal", "tensorflow.unsorted_segment_sum", "tensorflow.where", "tensorflow.add_n", "tensorflow.python.ops.control_flow_ops.with_depe...
rodrigcd/NB3_robot
[ "d68e8de4a169c7bbaa949ebd09307ff0557fa61d" ]
[ "neural_network_lecture/demo_model.py" ]
[ "import numpy as np\nimport demo_dl as dl\nimport data_funcs as df\n\nbatch_size = 20\nnum_epochs = 500\nsamples_per_class = 100\nnum_classes = 4\nhidden_units = 100\n\ndata, target = df.gen_spiral_data(samples_per_class, num_classes, 0.2, 'double')\nraw_data = df.plot_scatter(data, target)\nraw_data.figure.savefig...
[ [ "numpy.argmax", "numpy.mean" ] ]
de-code/tensorflow
[ "988c3e6d21f1791b9485d0ec448dfbcecad0754d" ]
[ "tensorflow/python/data/ops/dataset_ops.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.data.util.nest.map_structure_up_to", "tensorflow.python.ops.gen_dataset_ops.window_dataset", "tensorflow.python.data.util.structure.type_spec_from_value", "tensorflow.python.ops.gen_dataset_ops.batch_dataset_v2", "tensorflow.python.ops.gen_dataset_ops.dataset_cardinality", ...
starcksophie/fastmri-reproducible-benchmark
[ "9d1f17011f0be911f2da5300063bfeecea86876d" ]
[ "fastmri_recon/helpers/reconstruction.py" ]
[ "import numpy as np\n\nfrom modopt.opt.linear import Identity\nfrom modopt.opt.proximity import SparseThreshold, LinearCompositionProx\n\nfrom ..data.data_utils import from_test_file_to_mask_and_kspace\nfrom .fourier import FFT2\nfrom .utils import crop_center\n\n\ndef reco_z_filled(kspace, fourier_op):\n x_fina...
[ [ "numpy.ones_like", "numpy.abs", "numpy.empty_like", "numpy.squeeze", "numpy.zeros_like", "numpy.array" ] ]
christopher-besch/manim
[ "959af957fee395014bb86bddac7ccb1429428236" ]
[ "manim/mobject/numbers.py" ]
[ "\"\"\"Mobjects representing numbers.\"\"\"\n\n__all__ = [\"DecimalNumber\", \"Integer\", \"Variable\"]\n\nfrom typing import Optional, Sequence\n\nimport numpy as np\n\nfrom .. import config\nfrom ..constants import *\nfrom ..mobject.svg.tex_mobject import MathTex, SingleStringMathTex\nfrom ..mobject.types.vectori...
[ [ "numpy.round" ] ]
guobinufl/PianoTimerPy
[ "81e8d0ae1bc966f68f0a183b8a7fccaae3bedca4" ]
[ "PianoKey.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nfrom numpy.fft import fft\nfrom numpy import hanning\nimport scipy.io.wavfile as wavfile\nimport pyaudio\nfrom datetime import datetime\nimport re\nimport os.path\n#import scipy.signal as signal\n\nclass PianoKeyFreq(object):\n def __init__(self):\n se...
[ [ "matplotlib.pyplot.imshow", "numpy.asarray", "matplotlib.pyplot.plot", "numpy.int", "numpy.max", "numpy.round", "numpy.hanning", "scipy.io.wavfile.read", "matplotlib.pyplot.gca", "numpy.hstack", "numpy.arange", "numpy.argmax", "matplotlib.pyplot.subplot", "n...
chawins/aml
[ "f62254ff92ff67bab427cb44fe470a5f39975cbe" ]
[ "train_adv.py" ]
[ "\"\"\"\nA run script to start adversarial training.\n\"\"\"\n\nimport os\nfrom os.path import basename\n\nimport keras\nfrom keras import backend as K\nfrom keras.models import save_model\nfrom lib.attacks import symb_iter_fgs, symbolic_fgs\nfrom lib.keras_utils import *\nfrom lib.tf_utils import tf_test_error_rat...
[ [ "tensorflow.python.platform.flags.DEFINE_bool" ] ]
TLouf/pandas
[ "e045034e5c89b932a526d6c9e691d3031784c377" ]
[ "pandas/core/indexes/base.py" ]
[ "from __future__ import annotations\n\nfrom datetime import datetime\nimport functools\nfrom itertools import zip_longest\nimport operator\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Hashable,\n Literal,\n Sequence,\n TypeVar,\n cast,\n final,\n overload,\n)\nimport war...
[ [ "numpy.all", "pandas.core.indexes.multi.MultiIndex", "pandas.core.indexes.range.RangeIndex", "pandas.util._decorators.deprecate_nonkeyword_arguments", "pandas.core.dtypes.common.ensure_object", "numpy.where", "pandas.core.dtypes.common.is_interval_dtype", "pandas.core.reshape.merge...
sisilmehta2000/pytorch
[ "fdc74e2373b242e5e68ac334234ccb41008018ad" ]
[ "test/onnx/test_models.py" ]
[ "from torchvision.models.alexnet import alexnet\nfrom torchvision.models.inception import inception_v3\nfrom torchvision.models.densenet import densenet121\nfrom torchvision.models.resnet import resnet50\nfrom torchvision.models.vgg import vgg16, vgg16_bn, vgg19, vgg19_bn\nfrom torchvision.models.googlenet import g...
[ [ "torch.randint", "torch.empty", "torch.quantization.prepare_qat", "torch.randn", "torch.onnx.utils._trace", "torch._C._jit_pass_lint", "torch.onnx.select_model_mode_for_export", "torch.cuda.is_available", "torch.quantization.QConfig" ] ]
Soldelli/MAD
[ "3c4e85cc792236fec2c94e5095f3bc793bf07529" ]
[ "baselines/VLG-Net/lib/data/__init__.py" ]
[ "import logging\n\nimport torch\n\nfrom lib.utils.comm import get_world_size\nfrom lib.utils.imports import import_file\nfrom . import datasets as D\nfrom .samplers import DistributedSampler\nfrom .collate_batch import BatchCollator\n\ndef build_dataset(dataset_list, dataset_catalog, cfg, is_train=True, is_for_peri...
[ [ "torch.utils.data.sampler.SequentialSampler", "torch.utils.data.sampler.RandomSampler", "torch.utils.data.sampler.BatchSampler" ] ]
RichardBruskiewich/RTX
[ "ce126fdc5df6b5b13cc3ac2857ffee23954a0a7f" ]
[ "code/ARAX/ARAXQuery/Overlay/fisher_exact_test.py" ]
[ "#!/bin/env python3\n# This class will perform fisher's exact test to evalutate the significance of connection between\n# a list of source nodes with certain qnode_id in KG and each of the target nodes with specified type.\n\n# relative imports\nimport scipy.stats as stats\nimport traceback\nimport sys\nimport os\n...
[ [ "scipy.stats.fisher_exact" ] ]
xinetzone/self-driving-dash
[ "66860074099c90e620e21bc30b26efd366cc8f1a" ]
[ "callbacks/record.py" ]
[ "import datetime\nimport pandas as pd\nfrom dash.dependencies import Input, Output\nfrom dash.exceptions import PreventUpdate\n\nfrom utils.client import plot_frame, Canvas\nfrom tools.frame import Shape\n\nfrom utils.client import frame2pandas, simulate_shape\nfrom app import app\nfrom layouts.record import layout...
[ [ "pandas.DataFrame.from_records" ] ]
hbin0701/c3vqg-official
[ "2600940d9a3255f9f4b616313aed968b17d71432" ]
[ "utils/vocab.py" ]
[ "\"\"\"Creates a vocabulary using iq_dataset for the vqa dataset.\n\"\"\"\n\nfrom collections import Counter\nfrom train_utils import Vocabulary\n\nimport argparse\nimport json\nimport logging\nimport nltk\nimport numpy as np\nimport re\n\n\ndef process_text(text, vocab, max_length=20):\n \"\"\"Converts text int...
[ [ "numpy.array" ] ]
JannisBush/xs-leaks-browser-web
[ "15ed76a87c1c30e15cd7d0b070e2853d17d322bc" ]
[ "analysis/helper_dyn.py" ]
[ "from database_connector import connect, postgresql_to_dataframe\nimport pandas as pd\nfrom pandas.api.types import CategoricalDtype\nimport datetime\nimport textdistance\nimport difflib\nimport hashlib\nimport pickle\n\nfrom dil_preprocess import get_url_data, basic_pruning\nfrom dil_predict import init, predict_t...
[ [ "pandas.option_context", "pandas.api.types.CategoricalDtype", "pandas.DataFrame" ] ]
123prashanth123/Fault-Detection-System
[ "fa59ca81ce4627a42648e654b55cdc505cde2103" ]
[ "References and Tests/Patch Pattern Recognition/Processor.py" ]
[ "import cv2\nimport platform\nfrom torch.utils.data import Dataset\nfrom torch.utils.data import DataLoader as DL\n\nimport utils as u\nfrom Models import build_model\n\n# ******************************************************************************************************************** #\n\n# Dataset Template \nc...
[ [ "torch.utils.data.DataLoader" ] ]
CaileanCarter/ST-literature-search
[ "af73a8098f336fbb3bf16eef44eae0b254aa7a17" ]
[ "litsearch.py" ]
[ "\"\"\"\nThese are PubMed search results for 'escherichia coli sequence type' from 2000 to 2021, \nwith the first 10,000 of 14,383 results saved to file 'escherichi-set.csv'.\n\n\"\"\"\n\n#TODO: make webpage as UI using flask?\n\nimport re\nfrom collections import Counter\nfrom sys import argv\n\nimport numpy as np...
[ [ "pandas.read_csv", "pandas.DataFrame", "pandas.DataFrame.from_dict" ] ]
weihezhai/HatefulMemesChallenge
[ "04f52643c0864d1efb6c0a9c674db42764f6834c", "04f52643c0864d1efb6c0a9c674db42764f6834c", "04f52643c0864d1efb6c0a9c674db42764f6834c" ]
[ "ERNIE-Vil/reader/vcr_finetuning.py", "data_utils/ocr.py", "VL-BERT/common/visual_linguistic_bert.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\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# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless require...
[ [ "numpy.concatenate", "numpy.random.RandomState", "numpy.random.randint" ], [ "numpy.maximum", "numpy.minimum", "numpy.pad", "numpy.clip", "numpy.asarray", "numpy.abs", "numpy.concatenate", "numpy.zeros_like", "numpy.array" ], [ "torch.nn.Dropout", "t...
girisagar46/main
[ "da358985b38dc4b776129b02f84694577e6f6190" ]
[ "mindsdb/libs/ml_models/pytorch/models/fully_connected_net/fully_connected_net.py" ]
[ "\n\nfrom mindsdb.config import *\nfrom mindsdb.libs.constants.mindsdb import *\n\nimport math\nimport torch\nimport torch.nn as nn\nfrom mindsdb.libs.ml_models.pytorch.libs.base_model import BaseModel\n\n\n\nclass FullyConnectedNet(BaseModel):\n\n\n def setup(self, sample_batch):\n \"\"\"\n Here w...
[ [ "torch.nn.Linear", "torch.nn.LeakyReLU" ] ]
dimasad/numpy
[ "85188530bffae563eb274b9c12b77981cfa4e1d2" ]
[ "numpy/lib/utils.py" ]
[ "from __future__ import division, absolute_import, print_function\n\nimport os\nimport sys\nimport types\nimport re\nimport warnings\n\nfrom numpy.core.numerictypes import issubclass_, issubsctype, issubdtype\nfrom numpy.core import ndarray, ufunc, asarray\n\n__all__ = [\n 'issubclass_', 'issubsctype', 'issubdty...
[ [ "numpy.core.asarray" ] ]
mamdamin/MVCNN-PyTorch-Airways
[ "47b420ede0aed20e2abbd209aa262cf5ee35af25" ]
[ "custom_dataset.py" ]
[ "from torch.utils.data.dataset import Dataset\nimport os\nimport pandas as pd\nimport re\nfrom PIL import Image\n#import cv2\nimport sys\nimport tensorflow as tf\nimport numpy as np\n#from augment import augmentImages\n\nclass MultiViewDataSet(Dataset):\n \n \n def find_classes(self, dir):\n classes...
[ [ "pandas.read_csv", "numpy.stack" ] ]
nitamago/deepfix
[ "5e478d2998abf46afb78eeed8f1a14e18aaeb640" ]
[ "neural_net/model.py" ]
[ "\"\"\"\nCopyright 2017 Rahul Gupta, Soham Pal, Aditya Kanade, Shirish Shevade.\nIndian Institute of Science.\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/l...
[ [ "tensorflow.clip_by_value", "tensorflow.nn.rnn_cell.BasicLSTMCell", "tensorflow.nn.rnn_cell.DropoutWrapper", "tensorflow.all_variables", "tensorflow.ones_like", "tensorflow.placeholder", "tensorflow.zeros_like", "tensorflow.contrib.legacy_seq2seq.embedding_attention_seq2seq", "...
batermj/DeepVideoAnalytics
[ "daad116b87370fce1799b7948af73b92f617cf41" ]
[ "repos/insightface/src/common/face_preprocess.py" ]
[ "\nimport cv2\nimport numpy as np\nfrom skimage import transform as trans\n\ndef parse_lst_line(line):\n vec = line.strip().split(\"\\t\")\n assert len(vec)>=3\n aligned = False\n if int(vec[0])==1:\n aligned = True\n image_path = vec[1]\n label = int(vec[2])\n bbox = None\n landmark = None\n #print(vec...
[ [ "numpy.maximum", "numpy.minimum", "numpy.transpose", "numpy.array", "numpy.zeros" ] ]
seyuboglu/weakly-supervised-petct
[ "fa96a07734afade475f6a1e1587ec14965fe2de3" ]
[ "pet_ct/data/manual.py" ]
[ "\"\"\"\nProcess subclass that reads reports and outputs a labels csv.\n\"\"\"\n\nimport os\nimport copy\nfrom collections import defaultdict, OrderedDict\n\nimport pandas as pd\nfrom tqdm import tqdm, tqdm_notebook\nimport json\nimport numpy as np\nimport networkx as nx\nimport torch\nimport logging\nfrom torch.ut...
[ [ "pandas.concat", "pandas.read_csv", "torch.utils.data.DataLoader", "pandas.DataFrame", "numpy.mean", "numpy.prod", "pandas.DataFrame.from_dict", "numpy.array" ] ]
rylezhou/sunet-pytorch
[ "46473f4ba6ce442335f318b45aee50a357af92bf" ]
[ "inference/ensemble_predictions.py" ]
[ "# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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# ...
[ [ "numpy.unique", "numpy.savez_compressed", "numpy.mean", "numpy.load", "numpy.vstack" ] ]
l-bat/tensorflow
[ "f7bf8594bb102cf6ad7e8ab4193ea5a25e2b8ce2" ]
[ "tensorflow/python/ops/structured/structured_array_ops.py" ]
[ "# Lint as python3\n# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2....
[ [ "tensorflow.python.ops.structured.structured_tensor.StructuredTensor.from_fields", "tensorflow.python.ops.array_ops.concat", "tensorflow.python.ops.array_ops.shape", "tensorflow.python.ops.ragged.row_partition.RowPartition.from_uniform_row_length", "tensorflow.python.ops.array_ops.get_positive...
shippingwang/PaddleVideo
[ "48e6bb5f67ad44f7ef3c5cd683e8e7b8c50f0918" ]
[ "paddlevideo/loader/dataset/frame.py" ]
[ "# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.array" ] ]
TalSchuster/FewRel
[ "af68f52b13977ca29808c38a54995363f76cdcad" ]
[ "models/d.py" ]
[ "import sys\nimport FewRel.fewshot_re_kit as fewshot_re_kit\nimport torch\nfrom torch import autograd, optim, nn\nfrom torch.autograd import Variable\nfrom torch.nn import functional as F\n\nclass Discriminator(nn.Module):\n \n def __init__(self, hidden_size=230, num_labels=2):\n nn.Module.__init__(sel...
[ [ "torch.nn.Dropout", "torch.nn.Linear", "torch.nn.ReLU", "torch.nn.Module.__init__" ] ]
henniekim/filelist
[ "a0f791000d76c23e65564ff426aae13c8875a1b0" ]
[ "makeFileList.py" ]
[ "import numpy as np\n\nfilelist = '/datahdd/workdir/donghyun/filelist/result/filelist.csv'\nframelist = '/datahdd/workdir/donghyun/filelist/result/framelist.csv'\nnewFilePath = '/datahdd/workdir/donghyun/filelist/result/'\ndelimiter = ','\n\nfileName = np.genfromtxt(filelist, delimiter=delimiter, usecols=0, dtype=N...
[ [ "numpy.savetxt", "numpy.append", "numpy.insert", "numpy.genfromtxt" ] ]
hungnt55/RaRecognize
[ "be3ae11de56da0aa6a33fdf50bfc5bf601ff8a01" ]
[ "code/predict_1k.py" ]
[ "from tqdm import tqdm\nimport pandas as pd\nimport numpy as np\nimport sys\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.svm import LinearSVC\nfrom sklearn.model_selection import t...
[ [ "pandas.read_csv", "numpy.savetxt", "numpy.load", "numpy.array", "sklearn.feature_extraction.text.TfidfVectorizer", "numpy.isin" ] ]
yuzeh/metagrok
[ "27f71441653611de939f1fe43e7aee6a7cdf1981" ]
[ "metagrok/config.py" ]
[ "import numpy as np\nimport torch\n\nfrom metagrok.constants import DTYPE\nfrom metagrok import np_json as json\n\n# Load the project config. This contains directories for everything\ntry:\n _config = json.load('config.json')\nexcept IOError:\n raise Exception('`config.json` file not found')\nexcept ValueError:\n...
[ [ "torch.cuda.is_available" ] ]
Vignesh-95/astronomical-observation-classification-neural-network
[ "11615afbffe22a54e8fb940f8dc49b56b4cf47bc" ]
[ "neuralNetwork.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nsns.set_style('whitegrid')\n\nSMALL_SIZE = 10\nMEDIUM_SIZE = 12\n\nplt.rc('font', size=SMALL_SIZE)\nplt.rc('axes', titlesize=MEDIUM_SIZE)\nplt.rc('axes', labelsize=MEDIUM_SIZE)\nplt.rcParams['f...
[ [ "numpy.asarray", "tensorflow.cast", "matplotlib.pyplot.rc", "numpy.mean", "pandas.read_csv", "numpy.arange", "numpy.std", "tensorflow.Session", "tensorflow.argmax", "pandas.get_dummies", "tensorflow.matmul", "tensorflow.nn.sigmoid", "tensorflow.placeholder", ...
Somraz/Spam-Emails-Classifier
[ "79553e46640229ca2e3d65163da1d2c0a0bfa776" ]
[ "Classifier.py" ]
[ "import re\r\nimport csv\r\nimport os\r\nimport pandas as pd\r\nfrom string import punctuation\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\nfrom sklearn.naive_bayes import MultinomialNB\r\nfrom nltk import stem\r\nfrom nltk.corpus import stopwords\r\nfrom sklearn.metrics import accuracy_score\r...
[ [ "sklearn.naive_bayes.MultinomialNB", "pandas.concat", "sklearn.metrics.confusion_matrix", "sklearn.feature_extraction.text.CountVectorizer" ] ]
grotheer/pyAFQ
[ "3a531b5bdc3d53f4a76d5d604a26fde488e1aaf6" ]
[ "AFQ/viz/fury_backend.py" ]
[ "import tempfile\nimport os\nimport os.path as op\nimport logging\n\nimport numpy as np\nimport IPython.display as display\n\nimport AFQ.viz.utils as vut\n\ntry:\n from dipy.viz import window, actor, ui\n from fury.colormap import line_colors\nexcept ImportError:\n raise ImportError(vut.viz_import_msg_erro...
[ [ "numpy.round", "numpy.array" ] ]
eddy-geek/interpret
[ "d75e1b1f53b6fbd78611a08b856bfe59dc1d8e2f" ]
[ "python/interpret-core/interpret/glassbox/ebm/bin.py" ]
[ "# Copyright (c) 2019 Microsoft Corporation\n# Distributed under the MIT software license\n\nimport math\nfrom collections import Counter\nfrom itertools import count, repeat, groupby\nfrom warnings import warn\nfrom multiprocessing.sharedctypes import RawArray\nimport numpy as np\nimport numpy.ma as ma\nfrom sklea...
[ [ "numpy.nanmax", "numpy.expand_dims", "sklearn.utils.validation.check_is_fitted", "numpy.nanmin", "numpy.max", "pandas.isna", "numpy.place", "numpy.where", "pandas.notna", "numpy.ones_like", "numpy.unique", "numpy.full", "numpy.insert", "numpy.count_nonzero",...