repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
krypticmouse/MouseBit
[ "efa1f5e21c128e5fa60226f4964c9ac224dcffaf" ]
[ "mousebit/image.py" ]
[ "import cv2\nimport torch\nfrom torchvision import datasets, transforms\nfrom torch.utils.data import DataLoader, Dataset\nfrom sklearn.model_selection import train_test_split\n\nclass ImageClassificationDataset(Dataset):\n def __init__(self, image_paths, targets, transform, img_dtype = torch.float32, y_dtype = ...
[ [ "torch.tensor", "torch.utils.data.DataLoader" ] ]
ezherdeva/responsible-ai-toolbox
[ "70895df616ca6f78ec83740e7705f641ef32c127" ]
[ "raiutils/tests/test_fetch_dataset.py" ]
[ "# Copyright (c) Microsoft Corporation\n# Licensed under the MIT License.\n\nimport zipfile\n\nimport pandas as pd\nimport pytest\n\nfrom raiutils.dataset import fetch_dataset\n\n\nclass TestFetchDataset(object):\n\n def test_fetch_dataset(self):\n outdirname = 'responsibleai.12.28.21'\n zipfilenam...
[ [ "pandas.read_csv" ] ]
Bucchiman/Jetson_Style_Transfer
[ "c9b33d13259e43639e931f481d78324538d7e15e" ]
[ "src/live.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# FileName: \tlive_record\n# CreatedDate: 2021-10-17 16:22:30 +0900\n# LastModified: 2021-10-30 02:26:57 +0900\n#\n\n\nimport sys\nimport keras\nfrom keras.preprocessing.image import img_to_array\nimport numpy as np\nimport cv2\nimport keras_contrib\n\nimport lay...
[ [ "numpy.uint8", "numpy.array", "numpy.expand_dims" ] ]
n01deas/rasa
[ "79f0feeb02919142eb06b8c52da5632f1c25c251" ]
[ "tests/core/test_policies.py" ]
[ "import asyncio\nfrom unittest.mock import patch\n\nimport numpy as np\nimport pytest\n\nimport rasa.utils.io\nfrom rasa.utils import train_utils\nfrom rasa.core import training\nfrom rasa.core.actions.action import (\n ACTION_DEFAULT_ASK_AFFIRMATION_NAME,\n ACTION_DEFAULT_ASK_REPHRASE_NAME,\n ACTION_DEFAU...
[ [ "tensorflow.Session", "numpy.random.randn", "numpy.random.choice" ] ]
chngzyk/PeekingDuck
[ "4be8dfe100cea965c8d0bcad4691aab266d68ebf" ]
[ "peekingduck/pipeline/nodes/model/mtcnnv1/mtcnn_files/detector.py" ]
[ "# Copyright 2021 AI Singapore\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 ...
[ [ "numpy.where", "tensorflow.convert_to_tensor" ] ]
TCLResearchEurope/tensor2tensor
[ "2917c2db5f72847c1668ccb76ca6d5d8c33209d5" ]
[ "tensor2tensor/rl/trainer_model_based.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir...
[ [ "tensorflow.Summary", "tensorflow.logging.set_verbosity", "tensorflow.expand_dims", "tensorflow.gfile.Copy", "tensorflow.Graph", "tensorflow.gfile.Exists", "tensorflow.Session", "tensorflow.logging.info", "tensorflow.reshape", "tensorflow.map_fn", "tensorflow.app.run", ...
StanczakDominik/PIC3
[ "583262cff0edfaee48b9540505bcd68983ec53ec" ]
[ "pythonpic/tests/test_current_deposition.py" ]
[ "# coding=utf-8\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom matplotlib import pyplot as plt\n\nfrom pythonpic.algorithms.current_deposition import current_deposition\nfrom pythonpic.classes import Particle, PeriodicTestGrid, NonperiodicTestGrid\nfrom pythonpic.classes import TestSpecies as Species...
[ [ "numpy.array", "numpy.isclose", "numpy.zeros_like", "numpy.zeros", "pandas.DataFrame", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.allclose", "numpy.arange", "matplotlib.pyplot.show" ] ]
64081784/pynvme
[ "ea26de6fb62b36cac7cce333cd8fb06e46c9bc66" ]
[ "scripts/trace/recorder.py" ]
[ "#\n# BSD LICENSE\n#\n# Copyright (c) Crane Chu <cranechu@gmail.com>\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the abov...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter" ] ]
mingming-tang/yolo-v1-1
[ "d4a030d0576ed5afe2182faabf6c79e75a82d369" ]
[ "train.py" ]
[ "import os\r\nimport argparse\r\nimport datetime\r\nimport tensorflow as tf\r\nimport yolo.config as cfg\r\nfrom yolo.yolo_net import YOLONet\r\nfrom utils.timer import Timer\r\nfrom utils.pascal_voc import pascal_voc\r\n\r\nslim = tf.contrib.slim\r\n\r\n\r\nclass Solver(object):\r\n\r\n def __init__(self, net, ...
[ [ "tensorflow.train.create_global_step", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.global_variables", "tensorflow.train.exponential_decay", "tensorflow.ConfigProto", "tensorflow.summary.merge_all", "tensorflow.summary.FileWriter", "tensorflow.global_variables_in...
apcarrik/qiskit-terra
[ "456d036ade0e66f391f8932a944a1dd73d6354dd" ]
[ "qiskit/circuit/library/grover_operator.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.max" ] ]
TMORI135/openpilot
[ "bc986477eb34f554933caafeac71538c57fb6838" ]
[ "selfdrive/controls/lib/latcontrol_lqr.py" ]
[ "import math\nimport numpy as np\n\nfrom selfdrive.controls.lib.drive_helpers import get_steer_max\nfrom common.numpy_fast import clip\nfrom common.realtime import DT_CTRL\nfrom cereal import log\n\n\nclass LatControlLQR():\n def __init__(self, CP):\n self.scale = CP.lateralTuning.lqr.scale\n self.ki = CP.la...
[ [ "numpy.sign", "numpy.array" ] ]
giovannistanco/iot-trust-task-alloc
[ "47e0c8186db32ecd563241d05ebdaaf23713a83f" ]
[ "analysis/graph/correctly_evaluted.py" ]
[ "#!/usr/bin/env python3\n\nimport os\nfrom pprint import pprint\nfrom ipaddress import IPv6Address\nfrom more_itertools import pairwise\nimport itertools\nimport pathlib\n\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\n\nfrom analysis.parser.edge_challenge_response import main as parse_cr\nfro...
[ [ "matplotlib.dates.DateFormatter", "matplotlib.pyplot.cm.get_cmap", "matplotlib.pyplot.figure" ] ]
zjzh/holoviews
[ "e1234a60ae0809ac561c204b1998dff0452b2bf0", "e1234a60ae0809ac561c204b1998dff0452b2bf0" ]
[ "holoviews/tests/element/test_ellipsis.py", "holoviews/tests/plotting/plotly/test_layoutplot.py" ]
[ "\"\"\"\nUnit tests of Ellipsis (...) in __getitem__\n\"\"\"\nimport numpy as np\nimport holoviews as hv\nfrom holoviews.element.comparison import ComparisonTestCase\n\n\n\nclass TestEllipsisCharts(ComparisonTestCase):\n\n def test_curve_ellipsis_slice_x(self):\n sliced = hv.Curve([(i,2*i) for i in range(...
[ [ "numpy.random.rand" ], [ "numpy.array", "numpy.random.rand" ] ]
yucenli/pplbench
[ "bb77bc3404126687588cf135d4a38afda1176b0e" ]
[ "pplbench/ppls/pymc3/logistic_regression.py" ]
[ "# Copyright(C) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport numpy as np\nimport pymc3 as pm\nimport xarray as xr\nfrom pymc3.backends.base import MultiTrace\n\nfrom .base_pymc3_impl import BasePyMC3Implementation\n\n\nclass LogisticRegression(BasePyMC3Implementation):\n def __init__(\n ...
[ [ "numpy.arange" ] ]
nickaj/xup_vitis_network_example
[ "c0fdfc702fb1b77a4a17fefde99509e289c1c4c8" ]
[ "Notebooks/vnx_utils.py" ]
[ "# Copyright (c) 2020-2021, Xilinx, Inc.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice,\n# ...
[ [ "numpy.dtype", "numpy.zeros" ] ]
ykivva/Consistency_LS
[ "11ad36c8ddad7dec2bbc3e49850186dba8e7985c" ]
[ "modules/unet_mirrored.py" ]
[ "import os, sys, math, random, itertools\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torchvision import datasets, transforms, models\nfrom torch.optim.lr_scheduler import MultiStepLR\nfrom torch.utils.checkpoint import checkpoint\n\nfrom models import Trainabl...
[ [ "torch.cat", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.GroupNorm", "torch.nn.Upsample", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.tensor", "torch.nn.functional.pad", "torch.randn" ] ]
yangpuhai/CSG
[ "984ff01d5e3455ede8e98142e8f610d1d84d4477" ]
[ "TRADE_CSG/models/TRADE.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch.optim import lr_scheduler\nfrom torch import optim\nimport torch.nn.functional as F\nimport random\nimport numpy as np\n\nimport os\nimport json\nimport copy\n\nfrom utils.masked_cross_entropy import *\nfrom utils.config import *\...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.GRU", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.CrossEntropyLoss", "torch.nn.Softmax", "torch.gather", "torch.tensor", "numpy.transpose", "torch.Tensor", "torch.zeros", "torch.save", "torch.nn.functional.softm...
wenke727/LSTR
[ "9f230e39fcacf300d9156eb649630a6f4621d5d5" ]
[ "test/images.py" ]
[ "import os\nimport torch\nimport cv2\nimport json\nimport time\nimport numpy as np\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\n\nfrom torch import nn\nimport matplotlib.pyplot as plt\nfrom copy import deepcopy\nfrom tqdm import tqdm\nfrom config import system_configs\n\nfrom utils import ...
[ [ "torch.cuda.synchronize", "numpy.zeros", "torch.no_grad", "numpy.ones", "torch.from_numpy", "torch.tensor", "torch.nn.functional.softmax", "numpy.linspace" ] ]
janged/explainx
[ "73d106134473ac5c3f2d9c16f9391f33a63b8929" ]
[ "lib/PDASH_utils.py" ]
[ "from __future__ import print_function\nimport numpy as np\nfrom sklearn.preprocessing import OneHotEncoder\nfrom cvxopt.solvers import qp\nfrom cvxopt import matrix, spmatrix\nfrom numpy import array, ndarray\nfrom scipy.spatial.distance import cdist\n\n\n# solve_qp adapted from https://github.com/stephane-caron/q...
[ [ "numpy.dot", "numpy.max", "numpy.random.normal", "numpy.linalg.norm", "numpy.transpose", "numpy.append", "numpy.vstack", "numpy.square", "numpy.array", "numpy.zeros", "numpy.identity", "numpy.hstack", "scipy.spatial.distance.cdist", "sklearn.preprocessing.On...
Business-Wizard/AlphaZero_Connect4
[ "e8b3eb593e0d2d23b21de28f5b1839f89357e74c" ]
[ "src/evaluator_c4.py" ]
[ "#!/usr/bin/env python\n\nimport os.path\nimport torch\nimport numpy as np\nfrom alpha_net_c4 import ConnectNet\nfrom connect_board import board as cboard\nimport encoder_decoder_c4 as ed\nimport copy\nfrom MCTS_c4 import UCT_search, do_decode_n_move_pieces, get_policy\nimport pickle\nimport torch.multiprocessing a...
[ [ "numpy.array", "torch.no_grad", "torch.multiprocessing.set_start_method", "torch.cuda.is_available", "numpy.random.uniform", "torch.load", "torch.multiprocessing.cpu_count" ] ]
PaipaPsyche/MNRAS_SCC
[ "217ba7ea1c1f4e1160e2d6e092387dd2c6d84969" ]
[ "div_test/vol_comp.py" ]
[ "\"\"\"\nCreated on Wed Feb 13 16:13:48 2019\n\n@author: David Paipa\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport collections as cl\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\nfrom operator import itemgetter\n#from astropy.convolution import Gaussian2DKernel,convolve\n#import s...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.load", "matplotlib.pyplot.close", "numpy.save", "matplotlib.pyplot.figure", "numpy.amax", "matplotlib.pyplot.ylabel", "numpy.log10", "matplotlib.pyplot.subplot" ...
yfletberliac/Actor-with-Variance-Estimated-Critic
[ "294ef39d05f31067907bb6ff9405183d4a530244" ]
[ "stable_baselines/common/vec_env/vec_normalize.py" ]
[ "import pickle\nimport warnings\n\nimport numpy as np\n\nfrom stable_baselines.common.vec_env.base_vec_env import VecEnvWrapper\nfrom stable_baselines.common.misc_util import RunningMeanStd\n\n\nclass VecNormalize(VecEnvWrapper):\n \"\"\"\n A moving average, normalizing wrapper for vectorized environment.\n\n...
[ [ "numpy.sqrt", "numpy.zeros" ] ]
Czaki/tsp_spanning
[ "3f0e5f338f17996c5f634824ed61282d2ea2487c" ]
[ "tsp_spanning/__init__.py" ]
[ "\"\"\"\nThis is tsp_spanning module. Currently its contains :py:func:`tsp` function \nand wrappers which simplify usage on list of points\n\n.. py:function:: tsp(np.ndarray[np.float64_t, ndim=2] distances, int end=-1)\n\n Function to calculate tsp path with spanning tree.\n Returned path always start with po...
[ [ "numpy.array", "numpy.ones", "numpy.fill_diagonal", "numpy.sqrt" ] ]
awx1/analysis_nba
[ "8d2b975034281fe2507f1e4724736cf5f5cae35d" ]
[ "final_copy.py" ]
[ "from py_ball import league, image, boxscore\nimport matplotlib.pyplot as plt\nimport time\nimport pandas as pd\nimport sys\nimport requests_cache\n\nHEADERS = {'Host': 'stats.nba.com',\n 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0',\n 'Accept': ...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
Lanselott/second.pytorch
[ "a2d94abe8fc145c01e95c2f4c877f796a5329194" ]
[ "second/pytorch/train_multi_frame.py" ]
[ "import copy\nimport json\nimport os\nfrom pathlib import Path\nimport pickle\nimport shutil\nimport time\nimport re \nimport fire\nimport numpy as np\nimport torch\nfrom google.protobuf import text_format\n\nimport second.data.kitti_common as kitti\nimport torchplus\nfrom second.builder import target_assigner_buil...
[ [ "numpy.concatenate", "torch.device", "torch.cuda.synchronize", "numpy.random.seed", "numpy.sum", "torch.no_grad", "numpy.mean", "torch.cuda.device_count", "torch.cuda.is_available", "torch.tensor", "torch.utils.data.DataLoader", "torch.load", "numpy.stack", ...
forever208/hand_object_detector
[ "bf5014060c5c7e7a12317881f01c8b7a541bd449" ]
[ "lib/datasets/voc_eval.py" ]
[ "# --------------------------------------------------------\n# Fast/er R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Bharath Hariharan\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.zeros", "numpy.minimum", "numpy.round", "numpy.sum", "numpy.argmin", "numpy.where", "numpy.finfo", "numpy.arange", "numpy.sort", "numpy.argsort", "numpy.cumsum", "numpy.argmax", "numpy.maximum" ...
KaiFabi/NeuroEvolution
[ "2ecbff626547e3745ba51135f43bce606f93f404" ]
[ "src/stats.py" ]
[ "\"\"\"Module holds method to compute loss and accuracy for provided network and dataloader.\n\"\"\"\nimport torch\n\n\n@torch.no_grad()\ndef comp_loss_accuracy(model, criterion, dataloader, device) -> tuple[float, float]:\n \"\"\"Compute loss and accuracy for provided model and dataloader.\n\n Args:\n ...
[ [ "torch.no_grad", "torch.argmax" ] ]
rsmedleystevenson/pyamg
[ "72c3b43e0d14223e3849cb7e5f0bc8817b342373" ]
[ "pyamg/util/tests/test_linalg.py" ]
[ "from numpy import matrix, array, abs, ravel, zeros_like, dot\nfrom scipy import rand, linalg, mat, random\nfrom scipy.sparse import csr_matrix\nfrom scipy.linalg import svd, eigvals\n\nfrom pyamg.util.linalg import approximate_spectral_radius,\\\n infinity_norm, norm, condest, cond,\\\n ishermitian, pinv_arr...
[ [ "scipy.linalg.eigvals", "numpy.matrix", "numpy.array", "numpy.zeros_like", "scipy.linalg.norm", "numpy.dot", "numpy.testing.assert_almost_equal", "scipy.rand", "scipy.linalg.svd", "scipy.mat", "numpy.testing.assert_array_almost_equal", "scipy.random.seed", "scip...
slumnitz/pysal
[ "35a577111118c83234d8aab26e4a999657af5bcd" ]
[ "pysal/contrib/viz/mapping.py" ]
[ "\"\"\"\nChoropleth mapping using PySAL\n\nToDo:\n * map_line_shp, map_point_shp should take a shp object not a shp_link\n * Same for map_poly_shp(_lonlat)\n\n\"\"\"\n\n__author__ = \"Sergio Rey <sjsrey@gmail.com>\", \"Dani Arribas-Bel <daniel.arribas.bel@gmail.com\"\n\n\nfrom warnings import warn\nimport pan...
[ [ "matplotlib.colors.BoundaryNorm", "numpy.sort", "matplotlib.patches.Rectangle", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.axes", "matplotlib.pyplot.axis", "numpy.array", "matplotlib.cm.get...
hustzxd/pytorch1.0-yolo2
[ "0346c137c0153642e8731a77cd437d4193074928" ]
[ "darknet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nfrom region_loss import RegionLoss\nfrom cfg import *\n\n\n# from layers.batchnorm.bn import BN2d\n\nclass MaxPoolStride1(nn.Module):\n def __init__(self):\n super(MaxPoolStride1, self).__init__()\n\n def forward...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.nn.SmoothL1Loss", "torch.nn.functional.pad", "torch.nn.functional.avg_pool2d", "torch.nn.Softmax", "torch.nn.MaxPool2d", "torch.IntTensor", "torch.nn.function...
damianfraszczak/rpasdt
[ "57039dea485f89d97aafc39ea52f595e35633826" ]
[ "src/rpasdt/gui/mathplotlib_components.py" ]
[ "import typing\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport networkx as nx\nfrom matplotlib.backends.backend_qt5agg import (\n FigureCanvasQTAgg as FigureCanvas,\n NavigationToolbar2QT as NavigationToolbar,\n)\nfrom PyQt5.QtCore import pyqtSignal\nfrom PyQt5.QtWidgets import QVBoxLayout, QWid...
[ [ "matplotlib.use", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.backends.backend_qt5agg.NavigationToolbar2QT", "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg" ] ]
chen0040/keras-chinese-resume-parser-and-analyzer
[ "59b89e8197a329c9387c84da92e32495fa9c8ea8" ]
[ "demo/dl_based_parser_train.py" ]
[ "import numpy as np\n\nfrom keras_cn_parser_and_analyzer.library.dl_based_parser import ResumeParser\n\n\ndef main():\n random_state = 42\n np.random.seed(random_state)\n\n output_dir_path = './models'\n training_data_dir_path = './data/training_data'\n\n classifier = ResumeParser()\n batch_size =...
[ [ "numpy.random.seed" ] ]
dcsgfl/acceleratefl
[ "9c928ff06dd4dd02eb27cb71d7d539ba4527ec58" ]
[ "data/dataset.py" ]
[ "import sys\nimport torch\nimport random\n\nimport numpy as np\n\n# Train and Test flag\nTRAIN = 1\nTEST = 0\n\nclass Dataset:\n def __init__(self) -> None:\n self.generated_dist_train = False\n self.generated_dist_test = False\n # raise NotImplementedError(\"ERROR: __init__ unimplemented\")...
[ [ "numpy.concatenate", "numpy.where", "torch.tensor", "numpy.random.shuffle" ] ]
tarokimuraorg/ThanksLaBot
[ "cf2accdb3f1effa3c4a1c24bdb587d7a5e6e9cd0" ]
[ "labs/SDGsLab.py" ]
[ "# coding: utf-8\n\nimport pandas as pd\nimport random as rd\nimport os\n\ndef data():\n \n file_name = 'labs/data/public/sdgs/targets.csv'\n \n if (os.path.exists(file_name)):\n \n items = pd.read_csv(file_name,encoding=\"utf-8\")\n\n indices = []\n targets = []\n \n ...
[ [ "pandas.read_csv" ] ]
24werewolf/python_video_stab
[ "f5f26f1874996d38fdb37937d47e5d69ed748f2c" ]
[ "tests/test_frame_queue.py" ]
[ "import pytest\nimport numpy as np\n\nfrom vidstab.frame_queue import FrameQueue\n\n\ndef test_reset_queue():\n frame_queue = FrameQueue(max_len=10, max_frames=20)\n frame_queue.i = 42\n\n frame_queue.reset_queue(max_len=30, max_frames=40)\n\n assert frame_queue.max_len == 30\n assert frame_queue.max...
[ [ "numpy.zeros" ] ]
jotaporras/ts_mcfrl
[ "c8c77a8fbd58e80e926e6705320ca8bc1979efdd" ]
[ "python/src/visualization/test_shipping_allocation_result_viz.py" ]
[ "from unittest import TestCase\nimport pandas as pd\n\nfrom visualization import shipping_allocation_result_viz\n\n\nclass Test(TestCase):\n def test_consolidate_episode(self):\n # Given\n randomvalid_validations = [\n pd.read_csv(\n f\"data/results/randomvalid_validation/...
[ [ "pandas.read_csv" ] ]
HiLab-git/PyMIC
[ "abf5c43de43668b85f4c049c95a8f1b7cf1d9f16" ]
[ "pymic/net_run/agent_cls.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division\n\nimport copy\nimport csv\nimport os\nimport sys\nimport time\nimport random\nimport scipy\nimport torch\nimport torchvision\nfrom torchvision import datasets, models, transforms\nimport numpy as np\nimport torch.nn as nn\nimport torch.optim...
[ [ "torch.device", "numpy.asarray", "torch.nn.Softmax", "torch.max", "torch.nn.Sigmoid", "torch.save", "torch.no_grad", "numpy.argmax", "torch.load", "torch.mean", "torch.nn.DataParallel" ] ]
szalata/Counterfactual-Recurrent-Network
[ "230ecca7cf4eda4e8ba5e172529dd42ccb4beea8" ]
[ "CRN_encoder_evaluate.py" ]
[ "# Copyright (c) 2020, Ioana Bica\n\nimport logging\nimport numpy as np\n\nfrom CRN_model import CRN_Model\nfrom utils.evaluation_utils import write_results_to_file, load_trained_model, get_processed_data\n\n\n\ndef fit_CRN_encoder(dataset_train, dataset_val, model_name, model_dir, hyperparams_file,\n ...
[ [ "numpy.random.choice", "numpy.mean" ] ]
y18810919727/Control_Exp1001
[ "f9fa0a46d838915de9c5f16c315c6c9eaba07f62" ]
[ "Control_Exp1001/common/penaltys/demo_penalty.py" ]
[ "\n# -*- coding:utf8 -*-\nimport numpy as np\n\nfrom Control_Exp1001.common.penaltys.base_penalty_cal import BasePenalty\n\n\n# 最简单的奖赏计算\nclass DemoPenalty(BasePenalty):\n\n def cal_penalty(self, y_star, y, u, c, d):\n weight_matrix = self.weight_matrix\n y_size = np.prod(y_star.shape)\n\n t...
[ [ "numpy.prod" ] ]
x-zho14/pytorch_ard
[ "5a9b790f33bf0340b2b3a2108c45d97786a2be86" ]
[ "examples/models.py" ]
[ "import sys\nsys.path.append('../../')\nimport torch_ard as nn_ard\nfrom torch import nn\nimport torch.nn.functional as F\nimport torch\n\nclass DenseModelARD(nn.Module):\n def __init__(self, input_shape, output_shape, hidden_size=150, activation=None):\n super(DenseModelARD, self).__init__()\n sel...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.init.calculate_gain", "torch.nn.functional.max_pool2d", "torch.nn.functional.tanh" ] ]
celiafish/scikit-xray
[ "660a37821d58544b6443c5b8cd9c96daef577ed2" ]
[ "skxray/core/constants/tests/test_xrs.py" ]
[ "# ######################################################################\n# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #\n# National Laboratory. All rights reserved. #\n# #\n# @author: Li Li (l...
[ [ "numpy.linalg.norm" ] ]
paulculmsee/opennem
[ "9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1" ]
[ "scripts/energy_diffs.py" ]
[ "#!/usr/bin/env python\nimport logging\nfrom datetime import datetime, timedelta\nfrom itertools import groupby\n\nimport pandas as pd\n\nfrom opennem.api.export.map import StatType\nfrom opennem.api.stats.schema import OpennemData, OpennemDataSet, ScadaDateRange\nfrom opennem.core.compat.utils import translate_id_...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
dupriest/ControlApp---EyeReader
[ "74f959363671d1c593b8647f8ee49e00ec28134f" ]
[ "ControlApp.py" ]
[ "import easygui\nimport os\nimport sys\nimport datetime\nimport shutil\nimport Tkinter,tkFileDialog\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib.transforms import Bbox\nfrom matplotlib.path import Path\nfrom pandas import DataFrame\nfrom pandas import Series\nimport json\n\n\nclass EyeReader...
[ [ "matplotlib.pyplot.annotate", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "pandas.DataFrame", "matplotlib.pyplot.yticks", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axis", "matplotlib.pyplot.clf", "matplotlib.pyplot.gca", "matp...
yoonkt200/ml-theory-python
[ "7643136230fd4f291b6e3dbf9fa562c3737901a2", "7643136230fd4f291b6e3dbf9fa562c3737901a2" ]
[ "02-regression/01-linear-regression/OLS.py", "deprecated/03-matrix-factorization/banila-MF/MF.py" ]
[ "# Linear Regression : It is only for study\n# Copyright : yoonkt200@gmail.com\n# Apache License 2.0\n# =============================================================================\n\nimport numpy as np\n\n\nclass OLS():\n def __init__(self, x_data, y_data):\n self._x_data = x_data\n self._y_data ...
[ [ "numpy.square", "numpy.sum", "numpy.array", "numpy.mean" ], [ "numpy.where", "numpy.random.normal", "numpy.array", "numpy.zeros" ] ]
Alyssonmach/9-Data-Science-Apps-with-Python
[ "16461fe2748e5cb055ed80a6374c0c39690d454a" ]
[ "app8_classification_penguins/penguins_model.py" ]
[ "import pandas as pd\npenguins = pd.read_csv('penguins_cleaned.csv')\n\n# Ordinal feature encoding\n# https://www.kaggle.com/pratik1120/penguin-dataset-eda-classification-and-clustering\ndf = penguins.copy()\ntarget = 'species'\nencode = ['sex','island']\n\nfor col in encode:\n dummy = pd.get_dummies(df[col], pr...
[ [ "sklearn.ensemble.RandomForestClassifier", "pandas.concat", "pandas.read_csv", "pandas.get_dummies" ] ]
predator4hack/JdeRobot_Programming_tests
[ "b9bb5bf2d3afec3815d50933882a03df90b293e2" ]
[ "python_challenge/game_of_life.py" ]
[ "import json\nimport time\nimport numpy as np\n\nclass GameOfLife:\n\tON = 1\n\tOFF = 0\n\tvals = [ON, OFF]\n\n\tdef __init__(self):\n\t\twith open('config.json') as config_fd:\n\t\t\tconfig = json.load(config_fd)\n\t\tself.width = np.clip(config['width'], 8, 30)\n\t\tself.height = np.clip(config['height'], 8, 30)\...
[ [ "numpy.sum", "numpy.random.choice", "numpy.zeros", "numpy.clip" ] ]
psaboia/selfconsistency
[ "9b722c82a35ba3b8909345976fd056111fb9c0f8" ]
[ "nets/resnet_v1.py" ]
[ "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n#...
[ [ "tensorflow.variable_scope", "tensorflow.reduce_mean", "tensorflow.squeeze", "tensorflow.nn.relu" ] ]
ckhui/cogdl
[ "93bea17c2dc7084857cd0a4af8178c174965127c", "93bea17c2dc7084857cd0a4af8178c174965127c" ]
[ "cogdl/models/nn/pyg_gat.py", "cogdl/models/nn/pyg_grand.py" ]
[ "import torch.nn.functional as F\nfrom torch_geometric.nn.conv import GATConv\n\nfrom .. import BaseModel, register_model\n\n\n@register_model(\"pyg_gat\")\nclass GAT(BaseModel):\n @staticmethod\n def add_args(parser):\n \"\"\"Add model-specific arguments to the parser.\"\"\"\n # fmt: off\n ...
[ [ "torch.nn.functional.dropout" ], [ "torch.nn.functional.dropout", "torch.FloatTensor", "torch.ones", "torch.mm", "torch.nn.BatchNorm1d", "torch.bernoulli", "torch.nn.functional.nll_loss", "torch.exp", "torch.pow" ] ]
SivaKesava1/SelfStarter
[ "b6bef80832b69b79504ffb929781dfe4e8137677" ]
[ "PrefixList.py" ]
[ "import argparse\nimport collections\nimport copy\nimport json\nimport os\nimport pprint\nimport re\n\nimport pandas as pd\nimport plotly\nimport plotly.graph_objs as go\nfrom docopt import docopt\nfrom matplotlib import cm\nfrom matplotlib.colors import rgb2hex\nfrom munkres import Munkres\nfrom operator import it...
[ [ "pandas.DataFrame" ] ]
caiyongji/tf2.3.1-py3.7.9-full-built
[ "ace4efcbf05b2b494388739718a18c13eab83c71" ]
[ "Lib/site-packages/tensorflow_probability/python/internal/_jax/vectorization_util.py" ]
[ "# Copyright 2019 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.zeros" ] ]
jrhartog/aqms-ir
[ "416a7085b82b9344cb91a6f0db2ff96cdb28d0dc" ]
[ "aqms_ir/util.py" ]
[ "import numpy as np\nimport logging\n\ntry:\n from obspy.signal.invsim import paz_to_freq_resp\nexcept:\n from obspy.signal.invsim import pazToFreqResp as paz_to_freq_resp\ntry:\n from obspy.signal.invsim import paz_2_amplitude_value_of_freq_resp\nexcept:\n from obspy.signal.invsim import paz2AmpValueOf...
[ [ "numpy.max", "numpy.argmin", "numpy.subtract", "numpy.argmax", "numpy.sqrt", "numpy.abs" ] ]
RobinBaumann/TF-AtlasNetV2
[ "32bd962407becacc9b9bee6c76c96216818e4c89" ]
[ "atlasnet_v2/encoders.py" ]
[ "\"\"\"\nCreated by Robin Baumann <mail@robin-baumann.com> on April 27, 2020.\n\"\"\"\nfrom tensorflow.keras import layers\n\nfrom .utils import tf_utils\n\n\nclass PointNetEncoder(layers.Layer):\n \"\"\"\n Encoder Network based on PointNet.\n \"\"\"\n\n def __init__(self, n_latent=1024):\n \"\"\"\n Const...
[ [ "tensorflow.keras.layers.GlobalMaxPooling1D" ] ]
kirthevasank/dragonfly_chemist
[ "31e06cfeed228022749586e452e407e5ee0b55a1" ]
[ "synth/rexgen_direct/core_wln_global/nntrain_direct.py" ]
[ "from __future__ import print_function\nimport tensorflow as tf\nfrom .nn import linearND, linear\nfrom .mol_graph import atom_fdim as adim, bond_fdim as bdim, max_nb, smiles2graph_list as _s2g\nfrom .models import *\nfrom .ioutils_direct import *\nimport math, sys, random\nfrom collections import Counter\nfrom opt...
[ [ "tensorflow.reshape", "tensorflow.to_float", "tensorflow.global_variables_initializer", "tensorflow.trainable_variables", "tensorflow.FIFOQueue", "tensorflow.train.Saver", "tensorflow.ConfigProto", "tensorflow.variable_scope", "tensorflow.nn.sigmoid", "tensorflow.train.Adam...
fuhailin/HybridBackend
[ "113383c5870b7180fa67c194208a27f76bdbf3f0" ]
[ "hybridbackend/tensorflow/training/detect_end.py" ]
[ "# Copyright 2021 Alibaba Group Holding Limited. 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# Unle...
[ [ "tensorflow.python.ops.math_ops.cast", "tensorflow.python.saved_model.model_utils.mode_keys.is_predict", "tensorflow.python.training.session_run_hook.SessionRunArgs", "tensorflow.python.saved_model.model_utils.mode_keys.is_eval", "tensorflow.python.saved_model.model_utils.mode_keys.is_train", ...
Ben-Mertz/RotorSE
[ "b0a48e09c432f4475a5cdd682661ab0510d5a240" ]
[ "src/rotorse/geometry_tools/geometry.py" ]
[ "from __future__ import print_function\nimport sys\nimport numpy as np\nfrom scipy.optimize import minimize\nfrom scipy.interpolate import pchip, Akima1DInterpolator, PchipInterpolator\n\nfrom rotorse.geometry_tools.geom_tools import calculate_length, curvature\nfrom rotorse.geometry_tools.cubicspline import Natura...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.asarray", "numpy.argmin", "numpy.zeros", "numpy.float", "scipy.interpolate.PchipInterpolator", "numpy.interp", "numpy.shape", "numpy.diff", "numpy.gradient", "numpy.tanh", "numpy.abs", "numpy.append", "numpy.ave...
jhkim-spa/FVNet
[ "bf236f50eca0f24049000b080edd497a0a92566d" ]
[ "mmdet3d/datasets/pipelines/transforms_3d.py" ]
[ "import numpy as np\nfrom mmcv import is_tuple_of\nfrom mmcv.utils import build_from_cfg\nimport torch\nfrom copy import deepcopy\n\nfrom mmdet3d.core import VoxelGenerator\nfrom mmdet3d.core.bbox import box_np_ops\nfrom mmdet.datasets.builder import PIPELINES\nfrom mmdet.datasets.pipelines import RandomFlip\nfrom ...
[ [ "torch.cat", "numpy.random.choice", "numpy.random.rand", "numpy.trunc", "torch.ones", "numpy.where", "numpy.cos", "numpy.concatenate", "numpy.random.normal", "numpy.sin", "numpy.logical_and", "numpy.nonzero", "numpy.linalg.inv", "numpy.array", "numpy.zer...
jacobgnewman/Denote
[ "219f50fc8183e6dde3194cf738d77ee90641cf4e" ]
[ "Calc Tool/LinearAlgebra/temp.py" ]
[ "import numpy as np\n\n'''\n\nThis file will serve as the skeleton of all the linalg + numerical methods\n\nthe battle between np arrays vs lists\n\n'''\n\ntestm=[[1,2,3],[4,5,6],[7,8,9]]\ntrym=[[4,5,6],[7,8,9],[1,2,3]]\ntestnp= np.arange(1,10).reshape(3,3)\ntestnpp=np.ones(3)\n\n\ndef printMatrix(matrix):\n ret...
[ [ "numpy.ones", "numpy.arange" ] ]
utiasSTARS/urdfpy
[ "dd0d0f3b04e5a0e7df8ff5f0adb687625b886c5d" ]
[ "urdfpy/urdf.py" ]
[ "from collections import OrderedDict\nimport copy\nimport os\nimport time\n\nfrom lxml import etree as ET\nimport networkx as nx\nimport numpy as np\nimport PIL\nimport trimesh\nimport six\n\nfrom .utils import (parse_origin, unparse_origin, get_filename, load_meshes,\n configure_origin)\n\n\ncla...
[ [ "numpy.tile", "numpy.cos", "numpy.outer", "numpy.fromstring", "numpy.sin", "numpy.linalg.norm", "numpy.eye", "numpy.arange", "numpy.array", "numpy.matmul", "numpy.zeros", "numpy.allclose", "numpy.argsort", "numpy.clip", "numpy.array2string", "numpy.d...
zfy611/light-web-crawler
[ "7fb32429cd6895738e0d59a7cb4cde3799aa40c1" ]
[ "projects/landmarkComment.py" ]
[ "import json\nimport time\nimport re\nfrom selenium import webdriver\nimport pandas as pd\nfrom pandas import DataFrame\nimport numpy as np\nfrom selenium.webdriver.common.keys import Keys\n\ncitynames = ['陕西','安徽', '北京']\n\ndef get_place_top5_comments(city_name):#爬取'city_name'城市的top5的景点评论信息\n # path = 'D:\\Soft...
[ [ "numpy.concatenate", "pandas.DataFrame", "numpy.array" ] ]
ChongChan2017/Face-Detection
[ "a59bdb2dc26affb5c5ba15b63fe8230961668df3" ]
[ "src/models/nn2.py" ]
[ "# MIT License\n# \n# Copyright (c) 2016 Chong Chan\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, ...
[ [ "tensorflow.nn.dropout", "tensorflow.reshape" ] ]
ouc-ocean-group/LDPS
[ "81a609d6330a43f05ae0c6513f99d167dcecb49b" ]
[ "lib/module/base.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass ConvBlock(nn.Module):\n def __init__(\n self, inplanes, planes, kernel_size=3, stride=1, padding=1, dilation=1, groups=1, bias=False, relu=True\n ):\n super(ConvBlock, self).__init__()\n self.conv = nn.Conv2d(\n inplanes,\n ...
[ [ "torch.cat", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.Conv2d", "torch.nn.PReLU" ] ]
remtav/pytorch-segmentation
[ "85ff5b27ede3f311f130ae4c9618f6d4ab44019f" ]
[ "src/models/net_multi.py" ]
[ "from .common import ActivatedBatchNorm\nfrom .encoder import create_encoder\nfrom .decoder import create_decoder\nfrom .spp import create_spp, create_mspp\nfrom .tta import SegmentatorTTA\nimport torch.nn as nn\nfrom collections import OrderedDict\nfrom .efficientunet.layers import *\n\nclass EncoderDecoderNet(nn....
[ [ "torch.nn.Conv2d", "torch.nn.MaxPool2d" ] ]
efrat-safanov/vilio_with_captions
[ "87da7bded10325587ba74ac8d64cbde45773acb3" ]
[ "ernie-vil/batching/finetune_batching.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://w...
[ [ "numpy.expand_dims", "numpy.array", "numpy.zeros" ] ]
lfeng1999/varibad
[ "840f4bd56ccee96a6c162265d18ec54db8b77a1e" ]
[ "environments/mujoco/ant_dir.py" ]
[ "import random\n\nimport numpy as np\n\nfrom environments.mujoco.ant import AntEnv\n\n\nclass AntDirEnv(AntEnv):\n \"\"\"\n Forward/backward ant direction environment\n \"\"\"\n\n def __init__(self, max_episode_steps=200):\n self.set_task(self.sample_tasks(1)[0])\n self._max_episode_steps ...
[ [ "numpy.concatenate", "numpy.square", "numpy.array", "numpy.dot", "numpy.sin", "numpy.linalg.norm", "numpy.cos", "numpy.clip", "numpy.isfinite" ] ]
keflavich/plfit
[ "a5f2f56f4a1f1a11b8e29b5033a6ebc23d1c078e" ]
[ "plfit/tests/distribution_sanity_check.py" ]
[ "from __future__ import print_function\nimport numpy as np\nimport plfit\nimport pylab as plt\n\nnel = 2000\nalpha = 2.5\nxmin = 1.0\n\ndata_prob = np.random.rand(nel)\ndata = plfit.plexp_inv(data_prob, xmin, alpha)\ninds = np.argsort(data)\ndata_prob = data_prob[inds]\ndata = data[inds]\n\nxdata = np.logspace(-2,2...
[ [ "numpy.random.rand", "numpy.logspace", "numpy.argsort" ] ]
BXuan694/universalAdversarialPerturbation
[ "ebca90f76b5d45715c98a1ff0b6f11df753b51c6" ]
[ "testdeepfool.py" ]
[ "import torchvision.transforms as transforms\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nimport torchvision.models as models\nfrom PIL import Image\nfrom deepfool import deepfool\nimport os\nfrom transform_file import transform\n\nnet = models.resnet34(pretrained=True)\nnet.eval()\n\nim_orig...
[ [ "numpy.int", "matplotlib.pyplot.title", "torch.ones", "matplotlib.pyplot.figure", "matplotlib.pyplot.show" ] ]
vtu81/auto_LiRPA
[ "294152077c0abfafb5d62fee39335e60eff087b4" ]
[ "tests/test_state_dict_name.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom auto_LiRPA import BoundedModule\nfrom testcase import TestCase\n\n\nclass FeatureExtraction(nn.Module):\n def __init__(self):\n super().__init__()\n self.conv1 = nn.Conv2d(1, 8, 4, stride=2, padding=1)\n self.conv2 =...
[ [ "torch.nn.Linear", "torch.nn.Conv2d", "torch.empty", "torch.randn" ] ]
NejcKle/ssd_keras
[ "df7259df85757fdf6baa812b6c415ecfd6963980" ]
[ "data_generator/object_detection_2d_data_generator.py" ]
[ "'''\nA data generator for 2D object detection.\n\nCopyright (C) 2018 Pierluigi Ferrari\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n...
[ [ "numpy.concatenate", "numpy.array", "numpy.asarray", "numpy.any", "numpy.random.uniform", "numpy.arange", "numpy.stack" ] ]
laurenzberger/training-data-analyst
[ "3e2ef4668c5088ab50ad50a4f29673c88fb1bcd3" ]
[ "blogs/lightning/ltgpred/trainer/boxdef.py" ]
[ "#!/usr/bin/env python\n\"\"\"Create dataset for predicting lightning using Dataflow.\n\nCopyright Google Inc.\n2018 Licensed under the Apache License, Version 2.0 (the \"License\"); you may\nnot use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/lice...
[ [ "numpy.sum", "numpy.arange" ] ]
mitulrm/FaceRFCN
[ "5e1fdaf197b3a93c22a82d9476a3f9a1c804e398" ]
[ "KerasRFCN/Losses.py" ]
[ "\"\"\"\nKeras RFCN\nCopyright (c) 2018\nLicensed under the MIT License (see LICENSE for details)\nWritten by parap1uie-s@github.com\n\"\"\"\n\nimport tensorflow as tf\nimport keras.backend as K\n############################################################\n# Loss Functions\n#######################################...
[ [ "tensorflow.reduce_min", "tensorflow.range", "tensorflow.size", "tensorflow.concat", "tensorflow.where", "tensorflow.gather_nd", "tensorflow.argmax", "tensorflow.nn.top_k", "tensorflow.constant", "tensorflow.squeeze", "tensorflow.reduce_sum", "tensorflow.stack", ...
Cogito2012/OpenTAL
[ "a7ab938a52b3fb82163eb1ba5403888359eb7e6a" ]
[ "AFSD/anet/eval.py" ]
[ "import argparse\nimport numpy as np\nfrom AFSD.evaluation.eval_detection import ANETdetection\n\nparser = argparse.ArgumentParser()\nparser.add_argument('output_json', type=str)\nparser.add_argument('gt_json', type=str,\n default='datasets/activitynet/annotations/activity_net_1_3_new.json', narg...
[ [ "numpy.linspace" ] ]
sjain-stanford/pytorch
[ "ba818991afb4ef6189fa4ed57dd204173e9c7b74" ]
[ "test/test_python_dispatch.py" ]
[ "# Owner(s): [\"module: __torch_dispatch__\"]\n\nimport tempfile\nimport torch\nfrom copy import deepcopy\nfrom torch.library import Library\nfrom torch.testing._internal.common_utils import TestCase, run_tests\nfrom torch.testing._internal.logging_tensor import LoggingTensor, LoggingTensorReentrant, LoggingTensorM...
[ [ "torch.testing._internal.logging_tensor.capture_logs", "torch.ones", "torch.utils._python_dispatch.push_torch_dispatch_mode", "torch.load", "torch.sum", "torch.Storage", "torch.mul", "torch.utils._pytree.tree_map", "torch.abs", "torch.autograd.grad", "torch.testing._int...
kdmayer/PV_Pipeline_Updated
[ "8ff5c0f14a5182af4a9add05f8b0400c7d0c8617" ]
[ "src/pipeline_components/tile_creator.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Jun 28 11:07:41 2019\r\n\r\n@author: Kevin\r\n\"\"\"\r\nimport numpy as np\r\nimport pickle\r\nfrom shapely.geometry import Point\r\n\r\n\r\nclass TileCreator(object):\r\n\r\n def __init__(self, configuration, polygon):\r\n\r\n self.output_path = config...
[ [ "numpy.deg2rad" ] ]
rsj123/PassGAN
[ "02f18a7b83c0ca8deb76c7c2cfacc5aeb99e7999" ]
[ "train.py" ]
[ "import os, sys\nsys.path.append(os.getcwd())\n\nimport time\nimport pickle\nimport argparse\nimport numpy as np\nimport tensorflow as tf\n\nimport utils\nimport tflib as lib\nimport tflib.ops.linear\nimport tflib.ops.conv1d\nimport tflib.plot\nimport models\n\ndef parse_args():\n parser = argparse.ArgumentParse...
[ [ "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.global_variables_initializer", "numpy.array", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.train.Saver", "tensorflow.random.uniform", "numpy.random.shuffle", "tensorflow.compat.v1.Session", "numpy.argmax", ...
zhaify/Paddle
[ "1eb151752e3c87d7b516e2db2c24cf92c49e8172" ]
[ "python/paddle/fluid/data_feeder.py" ]
[ "# Copyright (c) 2018 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 ...
[ [ "numpy.array" ] ]
carloswm85/2020-cs241
[ "5cbc7912f47c79ae4c11d9326d38daeb6d0e0f70" ]
[ "CS241 w12/prove12b/prove12b.py" ]
[ "import pandas as pd\nimport seaborn as sns\nimport matplotlib as plt\nimport os\n\nplayers = pd.read_csv('basketball_players.csv')\nprint(players)\nprint()\nprint(players.columns)\nprint()\n\nprint('>>> MEAN and MEDIAN POINTS FROM basketball_players.csv')\nmean = players['points'].mean()\nprint(mean)\nmedian = pla...
[ [ "pandas.read_csv", "pandas.merge" ] ]
Madhusakth/RADIATE-Adaptive-CS
[ "a29531dd554ee08adf7c5135c066aa90c4be0941" ]
[ "vehicle_detection/train.py" ]
[ "\nimport argparse\n\n\nimport json\nimport numpy as np\nimport os\nimport random\nfrom detectron2.engine import DefaultTrainer, hooks\nfrom utils.trainer import Trainer\nfrom utils.rotated_trainer import RotatedTrainer\nfrom detectron2.config import get_cfg\nfrom detectron2.utils.visualizer import ColorMode\nfrom ...
[ [ "numpy.max", "numpy.array", "numpy.sin", "numpy.matmul", "numpy.min", "numpy.cos", "numpy.deg2rad" ] ]
KeondoPark/votenet_nocuda
[ "92aa1ea67910b9298b209a5bda8dad18d8224958", "92aa1ea67910b9298b209a5bda8dad18d8224958" ]
[ "models/loss_helper.py", "sunrgbd/sunrgbd_detection_dataset.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# \n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport sys\nimport os\nBASE_DIR = os.path.dirname(os.path.abspath(__file__...
[ [ "torch.zeros", "torch.sqrt", "torch.argmax", "torch.min", "torch.gather", "torch.cuda.FloatTensor", "torch.Tensor", "torch.nn.CrossEntropyLoss", "torch.sum" ], [ "numpy.max", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.percentile", "nump...
naiduv/netpyne
[ "20d2dfdecf303c779d6ab97e6ef579835798beb1" ]
[ "netpyne/cell/pointCell.py" ]
[ "\"\"\"\nModule containing a point cell class\n\ncell/pointCell.py \n\nContains pointCell class \n\nContributors: salvadordura@gmail.com, samnemo@gmail.com\n\"\"\"\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import unicode_literals\nfrom __future__ import absolute_import...
[ [ "numpy.append", "numpy.array", "numpy.sort", "numpy.cumsum" ] ]
swreinehr/katana
[ "9b4eef12dfeb79e35aa07a3a335ce35b3e97c08d" ]
[ "python/galois/lonestar/analytics/bfs.py" ]
[ "import numpy as np\nimport pyarrow\nfrom numba import jit\n\nfrom galois.atomic import GAccumulator, GReduceMax\nfrom galois.datastructures import InsertBag\nfrom ._bfs_property_graph import bfs as cython_bfs, verify_bfs as cython_verify_bfs\nfrom galois.loops import do_all, do_all_operator\nfrom galois.property_g...
[ [ "numpy.empty" ] ]
aws-samples/aws-chained-custom-ground-truth-example
[ "71e6b7b53610df5f933a10bd3f6e8f2e0b5f63f0" ]
[ "lambda_functions/post_step1/src/main.py" ]
[ "# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitation the rights t...
[ [ "numpy.float32", "numpy.sqrt" ] ]
clarkedb/motif
[ "9c882a2cd7958ccb9e8a0db26ee25e3f3b5673f4" ]
[ "motif/tonnetz.py" ]
[ "# Import packages\nimport librosa\nimport numpy as np\nfrom librosa.feature import tonnetz\nfrom librosa import display\nfrom matplotlib import pyplot as plt\nfrom matplotlib import style, rcParams\nstyle.use('seaborn')\nrcParams['figure.figsize'] = (16, 8)\n\n\ndef get_ton(data, rate, plot=False):\n \"\"\"\n ...
[ [ "matplotlib.pyplot.colorbar", "matplotlib.style.use", "matplotlib.pyplot.title", "numpy.mean", "matplotlib.pyplot.show", "numpy.var" ] ]
Anubhav1107/sunpy
[ "a675085ae30feb1c33332720fc92c6442ded7c28" ]
[ "sunpy/map/tests/test_maputils.py" ]
[ "import numpy as np\nimport pytest\n\nimport astropy.units as u\nfrom astropy.coordinates import BaseCoordinateFrame, SkyCoord\n\nimport sunpy.map\nfrom sunpy.coordinates import HeliographicStonyhurst\nfrom sunpy.coordinates.frames import HeliographicCarrington\nfrom sunpy.coordinates.utils import GreatArc\nfrom su...
[ [ "numpy.all", "numpy.testing.assert_almost_equal", "numpy.arange" ] ]
avecplezir/dnn-mode-connectivity
[ "9a92ca370571f542b33060f637239172a0d08bba" ]
[ "utils.py" ]
[ "import numpy as np\nimport os\nimport torch\nimport torch.nn.functional as F\n\nimport curves\n\n\ndef l2_regularizer(weight_decay):\n def regularizer(model):\n l2 = 0.0\n for p in model.parameters():\n l2 += torch.sqrt(torch.sum(p ** 2))\n return 0.5 * weight_decay * l2\n ret...
[ [ "numpy.concatenate", "torch.save", "torch.nn.functional.softmax", "numpy.vstack", "torch.sum" ] ]
giusenso/seld-tcn
[ "008da49af6359bc97979ffdfbc1c1396f80f0b9c" ]
[ "seld.py" ]
[ "#\n# A wrapper script that trains the SELDnet and SELD-TCN.\n# The training stops when the SELD error (check paper) stops improving.\n#\n\nimport os\nimport sys\nimport numpy as np\nimport matplotlib.pyplot as plot\nimport cls_data_generator\nimport evaluation_metrics\nimport keras_model\nimport parameter\nimport ...
[ [ "matplotlib.pyplot.switch_backend", "numpy.zeros", "numpy.arcsin", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.diag", "matplotlib.pyplot.subplot" ] ]
trevorcai/dm-haiku
[ "37eb4eed70990c32cbf13c321058b6668d92cf94" ]
[ "haiku/_src/integration/hk_transforms_test.py" ]
[ "# Lint as: python3\n# Copyright 2020 DeepMind Technologies Limited. 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/LI...
[ [ "numpy.prod" ] ]
craigmaclachlan/article_classification
[ "952e51bcf76c9fc929d267b3149a20fce86e8491" ]
[ "articlass/model.py" ]
[ "\"\"\"Module containing functions for working with the Tensorflow.\"\"\"\nimport datetime\nimport os\nimport time\nimport json\nimport numpy\nimport logging\n\nmodlog = logging.getLogger(__name__)\n\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\n\n\nclass ModelConfiguration(object):\n \"\"\"\n St...
[ [ "tensorflow.keras.callbacks.TensorBoard", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.load_model", "numpy.isreal", "matplo...
goncalo-rodrigues/thesis
[ "c6d531b72ddeaf2320a4346912df5519138d11d7" ]
[ "temp.py" ]
[ "import matplotlib.pyplot as plt\nrollouts = {10: [-10, -10, -10, -10, -10, -10, -8, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -6, -10, -10, -10, -10, -1...
[ [ "matplotlib.pyplot.scatter", "matplotlib.pyplot.hist", "matplotlib.pyplot.show" ] ]
geotrellis/geotrellis-python
[ "97bcb17a56ed4b4059e2f0dbab97706562cac692" ]
[ "geopyspark/tests/geotrellis/io_tests/s3_geotiff_rdd_test.py" ]
[ "from os import walk, path\nimport unittest\nimport rasterio\nimport pytest\nimport numpy as np\nfrom geopyspark.geotrellis.constants import LayerType\nfrom geopyspark.geotrellis import LocalLayout, SpatialKey\nfrom geopyspark.tests.python_test_utils import file_path\nfrom geopyspark.geotrellis.geotiff import get\n...
[ [ "numpy.array_equal", "numpy.size", "numpy.argwhere" ] ]
edwardoughton/seismic
[ "e56ab63122c09a7d31b47bb0abfbb7ef41af9664" ]
[ "vis/plot.py" ]
[ "\"\"\"\nPlot results.\n\nWritten by Ed Oughton\n\nDecember 2020\n\n\"\"\"\nimport os\nimport configparser\nimport numpy as np\nimport pandas as pd\nimport geopandas as gpd\nimport contextily as ctx\nimport matplotlib.pyplot as plt\nimport matplotlib.colors\nfrom matplotlib import cm\nimport seaborn as sns\n\nCONFI...
[ [ "pandas.melt", "matplotlib.pyplot.subplots_adjust" ] ]
dbehrlich/sisyphus2
[ "4e99c5f9b5de78d6011d7a6d0a0a76ac729b7fb2" ]
[ "backend/networks.py" ]
[ "from __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nfrom time import time\n\n# Lets make sure to keep things object-oriented,\n# so that all future networks we build will extend\n# the Model class below\n\n# This will mean (in the future) making Model less specific so\n# that futu...
[ [ "tensorflow.verify_tensor_all_finite", "tensorflow.constant_initializer", "tensorflow.ones_like", "numpy.load", "tensorflow.matmul", "tensorflow.gradients", "tensorflow.zeros_like", "tensorflow.clip_by_norm", "tensorflow.stack", "tensorflow.greater", "tensorflow.global_...
LilianBoulard/LevelTwo
[ "23013a53100875d77dfae99494d2ef415d12b0df" ]
[ "leveltwo/maze/base/editable.py" ]
[ "from abc import ABC\n\nimport pygame\nimport numpy as np\n\nfrom tkinter import Tk\nfrom tkinter import messagebox\n\nfrom typing import Tuple, Optional, Dict\n\nfrom .maze import Maze\nfrom .base import Viewport, BoundType\n\nfrom ...enums import Colors\nfrom ...database import Database\nfrom ...sprites.object_to...
[ [ "numpy.array" ] ]
root79-glit/VideoSuperResolution
[ "1d0c54fafaf7a02f0d69408502f90c55f0f76536", "1d0c54fafaf7a02f0d69408502f90c55f0f76536" ]
[ "VSRTorch/Models/Classic.py", "VSRTorch/Models/esrgan/block.py" ]
[ "# Copyright (c): Wenyi Tang 2017-2019.\n# Author: Wenyi Tang\n# Email: wenyi.tang@intel.com\n# Update Date: 2019 - 3 - 21\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .Arch import EasyConv2d, RB\nfrom .Loss import VggFeatureLoss\nfrom .Model import SuperResolution\nfrom ..Uti...
[ [ "torch.optim.Adagrad", "torch.optim.LBFGS", "torch.optim.RMSprop", "torch.nn.Sequential", "torch.nn.Tanh", "torch.optim.Adam", "torch.distributions.normal.Normal", "torch.optim.SGD", "torch.optim.Adadelta", "torch.optim.Rprop", "torch.nn.PixelShuffle", "torch.nn.fun...
lanmengyiyu/detectron2
[ "a9e420a2ef9a0766bb048f181b301e11f320199d" ]
[ "tests/test_scheduler.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport math\nimport numpy as np\nfrom unittest import TestCase\nimport torch\nfrom fvcore.common.param_scheduler import (\n CompositeParamScheduler,\n CosineParamScheduler,\n LinearParamScheduler,\n MultiStepParamScheduler,\n)\nfrom torch import nn\...
[ [ "torch.zeros", "numpy.allclose", "torch.optim.SGD" ] ]
wjsi/aliyun-odps-python-sdk
[ "8b064340e4376def201b8d8fdc0c2fa021aae9be" ]
[ "odps/df/backends/pd/analyzer.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright 1999-2017 Alibaba Group Holding Ltd.\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/...
[ [ "numpy.random.seed", "numpy.random.rand" ] ]
zzqcn/joy
[ "21770513e27ad10cde7c1ab7c1e6f024c8668119" ]
[ "analysis/classifier.py" ]
[ "'''\n *\t\n * Copyright (c) 2016 Cisco Systems, Inc.\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * \n * Redistributions of source code must retain the above copyright\n *...
[ [ "sklearn.linear_model.LogisticRegression", "numpy.array", "numpy.amax", "sklearn.preprocessing.StandardScaler" ] ]
mugoh/ML
[ "05c5b855e51683de91397a6735afb22283063294" ]
[ "mlearning/scripts/fp_growth.py" ]
[ "from ..unsupervised.fp_growth import FPGrowth\n\nfrom terminaltables import AsciiTable\n\nimport numpy as np\n\n\ndef grow_frequent_pattern():\n \"\"\"\n Creates a frequent pattern tree from\n transactions\n \"\"\"\n transactions = np.array(\n [\n ['sawdust', 'porcupines', ...
[ [ "numpy.array" ] ]
cassidylaidlaw/boltzmann-policy-distribution
[ "573476dd3e86934dc8884340c42512caa896e9a7" ]
[ "bpd/agents/gail.py" ]
[ "from typing import Dict, List, Union, Type, cast\nimport torch\nimport random\nfrom torch.nn import functional as F\n\nfrom ray.rllib.agents.trainer import Trainer\nfrom ray.rllib.evaluation.postprocessing import compute_gae_for_sample_batch\nfrom ray.rllib.evaluation.worker_set import WorkerSet\nfrom ray.rllib.ex...
[ [ "torch.nn.functional.softplus" ] ]
leeway00/Assetpricing-via-ML
[ "abb8320a7edb96609a314a2e1d69fbed15bc9fea" ]
[ "MLutils/SklearnUtils.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nimport matplotlib.pyplot as plt\n\nfrom MLutils.BaseUtils import *\n\nimport seaborn as sns\n\nfrom sklearn.preprocessing import StandardScaler, PolynomialFeatures\nfrom sklearn.metrics import r2_score, confusion_matrix, classification_report, \\\n ...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.model_selection.cross_validate", "numpy.mean", "sklearn.model_selection.RandomizedSearchCV", "numpy.geomspace", "pandas.concat", "sklearn.metrics.f1_score", "numpy.concatenate", "matplotlib.pyplot.subplots", "sklearn.metrics.accu...
pkjmesra/nseta
[ "28cd8cede465efe9f506a38c5933602c463e5185" ]
[ "nseta/strategy/macdSignalStrategy.py" ]
[ "# -*- coding: utf-8 -*-\nimport pandas as pd\nimport numpy as np\n\nfrom nseta.common.log import tracelog, default_logger\nfrom nseta.common.commons import Direction\nfrom nseta.strategy.simulatedorder import simulatedorder, OrderType\nfrom nseta.strategy.basesignalstrategy import basesignalstrategy\n\n__all__ = [...
[ [ "pandas.DataFrame" ] ]