repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
alexcercos/ML-Agents | [
"c096c36b0348e3673b687499e17891cd35168939"
] | [
"ml-agents-envs/mlagents/envs/brain.py"
] | [
"import logging\nimport numpy as np\nimport io\n\nfrom mlagents.envs.communicator_objects.agent_info_pb2 import AgentInfoProto\nfrom mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto\nfrom mlagents.envs.timers import hierarchical_timer, timed\nfrom typing import Dict, List, NamedTu... | [
[
"numpy.dot",
"numpy.isfinite",
"numpy.reshape",
"numpy.isnan",
"numpy.nan_to_num",
"numpy.append",
"numpy.mean",
"numpy.array",
"numpy.zeros"
]
] |
hvkwak/simple-faster-rcnn-pytorch | [
"3ea84a789c91ea8d403637026b4a5add19e5343a"
] | [
"models/faster_rcnn.py"
] | [
"import os\nimport sys\nimport torch\nimport torchvision\nimport numpy as np\nfrom torch import nn\nfrom torch.nn import functional as F\n# from models.utils.nms import non_maximum_suppression\nfrom models.utils.bbox_tools import loc2bbox\nfrom utils.array_tool import tonumpy, totensor\nfrom data.dataset import pre... | [
[
"torch.Tensor",
"matplotlib.patches.Rectangle",
"torch.from_numpy",
"matplotlib.pyplot.subplots",
"numpy.concatenate",
"torch.no_grad",
"matplotlib.pyplot.show"
]
] |
apl-ocean-engineering/visual_odom | [
"6e88c8d5a098585f7b12e4934f47494414824b4d"
] | [
"helper_nodes/display_poses.py"
] | [
"import matplotlib.pyplot as plt\nimport copy\nimport numpy as np\n\nimport argparse\n\n\ndef get_eucld_error(x1, x2, y1, y2, z1, z2):\n error = []\n for i in range(len(x1)):\n p1 = np.array([x1[i], y1[i], z1[i]])\n p2 = np.array([x2[i], y2[i], z2[i]])\n\n error.append(float(np.sum(np.sub... | [
[
"numpy.array",
"matplotlib.pyplot.show",
"numpy.subtract",
"matplotlib.pyplot.subplots"
]
] |
TalkToTheGAN/RelaxTextGAN | [
"6d0846392c8a1267eaa103dd70492cb80024079e"
] | [
"models/plain_lstm.py"
] | [
"import os\nimport random\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\nclass PlainLSTM(nn.Module):\n \"\"\"PlainLSTM \"\"\"\n def __init__(self, vocab_size, emb_dim, hidden_dim, use_cuda=False):\n super(PlainLSTM, se... | [
[
"torch.nn.LogSoftmax",
"torch.cat",
"torch.nn.LSTM",
"torch.zeros",
"torch.nn.Embedding",
"torch.nn.Linear"
]
] |
ebadkamil/EXtra-foam | [
"8e58143040c788dc70ea98ea5adc1fb63b7cfe0d"
] | [
"extra_foam/special_suite/tests/test_gotthard.py"
] | [
"import unittest\nfrom unittest.mock import MagicMock, patch, PropertyMock\nfrom collections import Counter\n\nimport pytest\nimport numpy as np\nfrom xarray import DataArray\n\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtTest import QSignalSpy, QTest\n\nfrom extra_foam.pipeline.tests import _RawDataMixin\n\nfrom ext... | [
[
"numpy.arange",
"numpy.ones",
"numpy.random.randn",
"numpy.random.randint",
"numpy.mean",
"numpy.testing.assert_array_almost_equal"
]
] |
gdalle/PartiallyObservedVectorAutoRegressions | [
"28c9d34d7b6e45679e442721daf4946867fd5fb0"
] | [
"src/read_actual_data.py"
] | [
"import itertools\nimport os\nimport zipfile\nfrom joblib import Parallel, delayed\nimport pandas as pd\nfrom tqdm.notebook import tqdm\n\n# Constants\n\nYEARS = [\"2018\", \"2019\", \"2020\", \"2021\"]\nMONTHS = [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"]\n\nDAT... | [
[
"pandas.concat",
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
jonasvj/TFDE | [
"c5d25947b28524c7a40626f797ca8c157fa70a53"
] | [
"plot_grid.py"
] | [
"#!/usr/bin/env python3\nimport sys\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ndef tt_params(K, M):\n return K + 3*M*K**2\n\ndef tt_dof(K, M):\n return (K-1) + M*K*(K-1) + 2*M*K**2\n\ndef bic(n, k, nllh_per_sample):\n log_lh = -1*nllh_per_sample*n\n return k*np.log(n) -... | [
[
"numpy.log",
"pandas.read_csv",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.close"
]
] |
Developernation/PythonProjects | [
"d682960d060cb1daede3f2f8e814a5aea05c0ec6"
] | [
"sans_tools/NotesAppFe.py"
] | [
"from tkinter.filedialog import askopenfilename\nfrom tkinter.messagebox import showinfo\nfrom NotesApp import SansNotesApp as snp\nfrom datetime import datetime\nfrom tkinter import ttk\nimport tkinter as tk\nimport pandas as pd\nimport os\npd.set_option('display.max_rows', None)\n\n#database connection\nnotes_db ... | [
[
"pandas.set_option",
"pandas.read_excel",
"pandas.read_csv"
]
] |
UBC-MDS/Pystockwatch | [
"4c72dae96d392cf2681b043db6e2fd440c936e49"
] | [
"src/pystockwatch/pystockwatch.py"
] | [
"# authors: Affrin Sultana, Helin Wang, Shi Yan Wang and Pavel Levchenko\n# January,2022\n\n# import plotly.express as px\nimport plotly.graph_objects as go\nimport altair as alt\nimport pandas as pd\nimport numpy as np\nimport yfinance as yf\nimport pandas_datareader as pdr\nimport datetime\nimport warnings\nalt.r... | [
[
"pandas.merge",
"numpy.select",
"pandas.DataFrame"
]
] |
LeeTehi/nnvolterra | [
"d6a084d2f5b4b716423cb4b952cf58a09ea84c23"
] | [
"npxconv.py"
] | [
"import libnpxconv as libx\n\nimport numpy as np\n\n# params for libx (sedt, kernel, srcx, /, padleft, stride)\n\ndef conv_ordern(ker, *src, oshape=None, padleft=0, stride=1):\n if len(src) == 1:\n src = src[0]\n\n if oshape is None:\n if isinstance(src, (list, tuple)):\n assert np.nd... | [
[
"numpy.pad",
"numpy.min",
"numpy.ascontiguousarray",
"numpy.ndim",
"numpy.max",
"numpy.zeros"
]
] |
SMMoseley/Background_Colony_Noise | [
"eb88ccf725939d501f02854b4c82659e8f6d5a3a"
] | [
"waveconverter.py"
] | [
"##Packages##\nimport h5py as h5\nimport numpy as np\nimport pandas as pd\nimport os\nimport ewave\n\n##Functions##\ndef wav_intervals(csv, sample_rate, hour_to_sample_rate):\n for row in csv.itertuples(): #iterates through each row in the csv file\n arf_file = row[0]\n start_time = row[1]*hour_to_... | [
[
"pandas.read_csv",
"numpy.zeros"
]
] |
timgates42/pandashells | [
"4b565435a25ac713eeeacf28c3e5b52fe94530d8"
] | [
"pandashells/bin/p_linspace.py"
] | [
"#! /usr/bin/env python\n\n# standard library imports\nimport sys # NOQA import sys to allow for mocking sys.argv in tests\nimport argparse\nimport textwrap\n\nfrom pandashells.lib import module_checker_lib, arg_lib\n\nmodule_checker_lib.check_for_modules(['pandas'])\n\nfrom pandashells.lib import io_lib\n\nimport... | [
[
"numpy.linspace"
]
] |
jmmelis/FlyTrackApp | [
"7c03eb0aeda7b0bd4e0c6181bc776c92e4fbc582"
] | [
"FlyTrackApp/flight_tracker_vis_class.py"
] | [
"import vtk\nimport sys\nimport os\nimport time\nimport numpy as np\n\n# flight tracker visualization class\n\nclass FlightTrackerVisualization:\n\n\tdef __init__(self):\n\n\t\t# window parameters\n\t\tself.window_name = \"Model\"\n\t\tself.background = (0.1,0.2,0.4)\n\t\tself.window_sz = (600, 600)\n\n\t\t# stl mo... | [
[
"numpy.amax",
"numpy.empty"
]
] |
manny405/mcse | [
"419e4b8c144563ae0bf48982fc7ea26ce941a3eb"
] | [
"mcse/crystals/packing_factor.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom scipy.spatial.distance import cdist\nfrom scipy.spatial import cKDTree \n\nfrom ase.data import vdw_radii,atomic_numbers,covalent_radii\nfrom ase.data.vdw_alvarez import vdw_radii as vdw_radii_alvarez\n\nfrom mcse import Structure\nfrom mcse import BaseDriver_\nf... | [
[
"numpy.dot",
"numpy.meshgrid",
"numpy.min",
"numpy.isnan",
"numpy.linalg.inv",
"numpy.arange",
"numpy.linalg.norm",
"numpy.max",
"numpy.array",
"numpy.where"
]
] |
TDC3Tool/TDC3 | [
"c746d8e89c0eb35cc3d1b73f469a9f89f5e7bbfd"
] | [
"tdc3/models/py/data/FunctionNameConsistencyDataset.py"
] | [
"import random\nimport torch as t\nfrom py.data.XYDataset import XYDataset\nfrom py.util.Config import dtype, device, en_stops\nfrom nltk.tokenize import word_tokenize\nimport numpy as np\n\ndef genericDescriptionClassifier(description, embedding):\n some_generic_descriptions = ['work', 'success', 'test', 'filte... | [
[
"torch.empty",
"torch.load",
"torch.as_tensor",
"torch.rand",
"torch.save"
]
] |
samsungsds-rnd/CADD-CVAE | [
"b4a21f65440aaf7cb5c01f163356fb249a6cba30"
] | [
"cvae.py"
] | [
"\"\"\"\nThe MIT License\n\n \n\nCopyright (c) 2020 Samsung SDS\n\n \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,... | [
[
"tensorflow.clip_by_value",
"tensorflow.get_variable",
"tensorflow.nn.elu",
"tensorflow.concat",
"tensorflow.matmul",
"tensorflow.contrib.layers.variance_scaling_initializer",
"tensorflow.reduce_mean",
"tensorflow.shape",
"tensorflow.nn.tanh",
"tensorflow.constant_initializ... |
epoch8/datapipe | [
"2358e13f6699b44950dc87fda6136f34fa719094"
] | [
"tests/test_meta_info_in_datapipe_events.py"
] | [
"import pandas as pd\nfrom sqlalchemy.sql.expression import select\n\nfrom datapipe.run_config import RunConfig\nfrom datapipe.store.database import TableStoreDB\nfrom datapipe.datatable import DataStore\nfrom datapipe.compute import Catalog, Pipeline,\\\n Table\nfrom datapipe.core_steps import BatchTransform, B... | [
[
"pandas.DataFrame"
]
] |
michellejlin/tprk | [
"04758e40c7dd9060d4d613c52b650e250297cb7a"
] | [
"syph_visualizer.py"
] | [
"import numpy as np\nimport pandas as pd\nimport argparse\nimport sys\nfrom bokeh.palettes import brewer\nfrom bokeh import events\nfrom bokeh.io import export_png, save, export_svgs\nfrom bokeh.resources import CDN\nfrom bokeh.embed import components, file_html, autoload_static\nfrom bokeh.plotting import figure, ... | [
[
"pandas.read_csv"
]
] |
kshama-msft/onnxruntime-training-examples | [
"0192a776e2fc62f1eeda3e3f1200cf40448302c1"
] | [
"huggingface-gpt2/ort_addon/ort_supplement/src/transformers/trainer_ort.py"
] | [
"import json\nimport time\nimport logging\nimport os\nimport random\nimport re\nimport shutil\nfrom contextlib import contextmanager\nfrom pathlib import Path\nfrom typing import Callable, Dict, List, NamedTuple, Optional, Tuple\n\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch.utils.data.datalo... | [
[
"torch.utils.data.distributed.DistributedSampler",
"torch.cuda.set_device",
"torch.tensor",
"torch.nn.DataParallel",
"numpy.mean",
"torch.no_grad",
"torch.distributed.get_rank",
"torch.utils.data.dataloader.DataLoader",
"torch.utils.data.sampler.RandomSampler"
]
] |
kevinleestone/mmstereo | [
"6757847000ed19cce607ce7537f2f38eed305cdd"
] | [
"losses/loss_utils.py"
] | [
"# Copyright 2021 Toyota Research Institute. All rights reserved.\n\nimport torch\nimport torch.nn.functional as F\n\n\ndef null_loss():\n return None, False\n\n\ndef dummy_loss(tensor):\n tensor[torch.isnan(tensor)] = 0.0\n return F.mse_loss(tensor, torch.zeros_like(tensor)) * 0.0, False\n\n\ndef valid_l... | [
[
"torch.zeros_like",
"torch.isnan"
]
] |
speedcell4/pytorch-noreward-rl | [
"b889d78b7b2115feb80198c90e75e35956eae284"
] | [
"test.py"
] | [
"import pickle\nimport time\nfrom collections import deque\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nimport env_wrapper\nfrom model import ActorCritic\n\n\ndef test(rank, args, shared_model):\n torch.manual_seed(args.seed + rank)\n env = env_wrapper.create_doom(a... | [
[
"torch.nn.functional.softmax",
"torch.zeros",
"torch.manual_seed",
"torch.from_numpy",
"torch.autograd.Variable"
]
] |
AbhijeetKrishnan/PettingZoo | [
"d1a68923cef108b92012bfaaf2f083c839213d9f"
] | [
"pettingzoo/classic/tictactoe/tictactoe.py"
] | [
"from pettingzoo import AECEnv\nfrom pettingzoo.utils import agent_selector\nfrom gym import spaces\nimport numpy as np\nimport warnings\n\nfrom pettingzoo.utils import wrappers\n\nfrom .board import Board\n\n\ndef env():\n env = raw_env()\n env = wrappers.CaptureStdoutWrapper(env)\n env = wrappers.Termina... | [
[
"numpy.array",
"numpy.zeros",
"numpy.equal",
"numpy.stack"
]
] |
kunde122/bert | [
"def0a6534b77de915c5d39b2ffd05fd19ac3f2f2"
] | [
"run_classifier.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"tensorflow.contrib.cluster_resolver.TPUClusterResolver",
"tensorflow.metrics.accuracy",
"tensorflow.FixedLenFeature",
"tensorflow.nn.log_softmax",
"tensorflow.reduce_sum",
"tensorflow.gfile.GFile",
"tensorflow.cast",
"tensorflow.train.init_from_checkpoint",
"tensorflow.gfile.M... |
pfschus/fission_bicorrelation | [
"103d1d6e93f722c73e33a9af773dd7ebbf4c6f25"
] | [
"scripts/bicorr_plot.py"
] | [
"\"\"\"\nPlotting functions for Bicorr project\nMoving them here to keep the bicorr.py file cleaner\nPFS, March 2018\n \nChangelog:\n2018_03_15: Move a few functions here\n\"\"\"\n\nimport matplotlib\n#matplotlib.use('agg') # for flux\nimport matplotlib.pyplot as plt\nfrom matplotlib import rcParams\nfrom matplotl... | [
[
"matplotlib.pyplot.legend",
"matplotlib.ticker.MultipleLocator",
"numpy.linspace",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.mean",
"numpy.digitize",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"numpy.arange",
"matplotlib.pyplot.hlines",
"numpy.st... |
tnemelck/kmeans | [
"c1095c6bfc134f4fc9e2c79a781b42d5ee38620f"
] | [
"test.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon May 7 00:42:53 2018\n\n@author: elvex\n\"\"\"\n\nimport numpy as np\nimport numpy.random as npr\nimport random\n \ndef init_board(N, mini = -1, maxi = 1):\n X = npr.uniform(mini, maxi (N, 2))\n return X\n\ndef init_board_gauss(N, k, min... | [
[
"numpy.random.uniform",
"numpy.random.normal",
"numpy.vstack"
]
] |
killianlevacher/defenseInvGAN-src | [
"8fa398536773c5bc00c906562d2d9359572b8157"
] | [
"comparison/eval/metrics.py"
] | [
"import cPickle\nimport tensorflow as tf\nfrom classifiers.cifar_model import Model as CIFARModel\nimport utils\nimport numpy as np\nimport inception\nimport fid\n\n\ndef ComputeClassificationAccuracy(images, recons, labels, args, debug=True):\n model_paths = {'CIFAR': 'classifiers/model/cifar-10', \n ... | [
[
"numpy.reshape",
"numpy.std",
"numpy.mean",
"tensorflow.Session",
"numpy.transpose"
]
] |
neurocaience/deepfreeze | [
"2a8c7da7519df2bacb640917695bd7d226e8d4f4"
] | [
"cnn_code/cuda.py"
] | [
"\"\"\"=============================================================================\nManage CUDA-related utility functions.\n=============================================================================\"\"\"\n\nimport torch\n\n# ------------------------------------------------------------------------------\n\ndef... | [
[
"torch.device",
"torch.cuda.is_available",
"torch.cuda.current_device"
]
] |
JanSellner/pytorch-lightning | [
"0e0da8c3fc2c6d5e7ac54900621a82d213f8ebbf"
] | [
"tests/accelerators/test_accelerator_connector.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.device"
]
] |
emdgroup/brain_waves_for_planning_problems | [
"4b4356f40470d8ecfb6152960d9c4f25a7a11b46"
] | [
"Hybrid_Neuron_Simulation.py"
] | [
"\"\"\"\nAttractor Network for 2DoF Robot Arm\n\nAuthor: Henry Powell and Mathias Winkel\n\"\"\"\nimport sys\nimport numpy as np\n\nfrom graphics import Graphics\nfrom ContinuousAttractorLayer import ContinuousAttractorLayer\nfrom WavePropagationLayer import WavePropagationLayer\nfrom setups import SETUPS\n\nif len... | [
[
"numpy.asarray",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
JonesRobM/SAPPHIRE | [
"fba875af56e48e2c5a4a3cf6788f51f359f63800"
] | [
"main/Sapphire/Post_Process/DistFuncs.py"
] | [
"import numpy as np\nimport os\n\ndef distance(a, b):\n \n dx = abs(a[0] - b[0])\n \n dy = abs(a[1] - b[1])\n \n dz = abs(a[2] - b[2])\n \n return np.sqrt(dx**2 + dy**2 + dz**2)\n\ndef CoMDist(positions, CoM = None, homo = False, specie = None, elements = None):\n \n if homo == False:\n... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.histogram",
"numpy.delete",
"numpy.shape",
"numpy.column_stack",
"numpy.average",
"numpy.zeros"
]
] |
Kalana304/KORSAL | [
"b7a0c7cf5428f632e99d2ca5c5e10a8288f10cc0"
] | [
"CenterNet/src/lib/datasets/sample/ctdet.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch.utils.data as data\nimport numpy as np\nimport torch\nimport json\nimport cv2\nimport os\nfrom utils.image import flip, color_aug\nfrom utils.image import get_affine_transform, affine_tran... | [
[
"numpy.random.random",
"numpy.clip",
"numpy.arange",
"numpy.concatenate",
"numpy.random.randn",
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
pdiercks/pymor | [
"e94f05714d666a929113543c49e88f8f494d64e1"
] | [
"src/pymordemos/parabolic_mor.py"
] | [
"#!/usr/bin/env python\n# This file is part of the pyMOR project (http://www.pymor.org).\n# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.\n# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)\n\n\"\"\"Reduced basis approximation of the heat equation.\n\nUsage:\... | [
[
"matplotlib.pyplot.show"
]
] |
gbmarc1/ExploranceAnonymizer | [
"ff3616ef929269b5c8420266b3c32225cfa4b4a3"
] | [
"src/__main__.py"
] | [
"from argparse import ArgumentParser\nfrom pathlib import Path\n\nimport pandas as pd\nimport spacy\nfrom tqdm import tqdm\n\n\ndef get_parser():\n parser = ArgumentParser()\n parser.add_argument(\"--file\", type=Path)\n return parser\n\n\ndef replace_entities(text, ents):\n new_text = ''\n start = 0... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
Casper-Smet/turing-route-66 | [
"b797485586c3491ddbcd76367aff88b7672d8d9a"
] | [
"route_66/model.py"
] | [
"import numpy as np\nfrom mesa import Model\nfrom mesa.datacollection import DataCollector\nfrom mesa.space import SingleGrid\nfrom mesa.time import StagedActivation\n\nfrom route_66.agent import CarAgent, TrafficLight\n\n\ndef get_average_velocity(model):\n \"\"\"\n Gets the total average velocity over all t... | [
[
"numpy.mean"
]
] |
quadraticmuffin/nd_maze | [
"8f41d923d1839c0d6fb34c02f165b247f181743b"
] | [
"run.py"
] | [
"import numpy as np\n\n\nclass NdMaze():\n '''\n\n '''\n def __init__(self, nd, size, start=None):\n self.board = np.zeros(shape=[size]*nd)\n self.nd = nd\n self.size = size\n self.pos = start\n if start is None:\n self.pos = [0]*nd\n self.dimr = 0\n ... | [
[
"numpy.arange",
"numpy.zeros"
]
] |
basharbme/unet | [
"85117087c1cb73c81a8eea4e127fae7cb47b4fe1"
] | [
"2D/convert_raw_to_hdf5.py"
] | [
"#!/usr/bin/env python\n#\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2019 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses... | [
[
"numpy.expand_dims",
"numpy.random.random",
"numpy.random.seed",
"numpy.arange",
"numpy.std",
"numpy.mean",
"numpy.array"
]
] |
anatfl/IML.HUJI | [
"b4a01e04fff4181837780cc603446fd73defd349"
] | [
"exercises/adaboost_scenario.py"
] | [
"import numpy as np\nfrom typing import Tuple\nfrom IMLearn.metalearners.adaboost import AdaBoost\nfrom IMLearn.learners.classifiers.decision_stump import DecisionStump\nfrom utils import *\nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots\nfrom IMLearn.metrics import accuracy\n\n\ndef g... | [
[
"numpy.random.seed",
"numpy.arange",
"numpy.ones",
"numpy.max",
"numpy.random.rand",
"numpy.array",
"numpy.sum"
]
] |
hrdipto/COVID19-L3-Net | [
"3ae2bba16c2ab0d96650e790dc2e6b896c377183"
] | [
"src/models/semseg.py"
] | [
"import torch\nimport torch.nn.functional as F\nimport torchvision\nfrom torchvision import transforms\nimport os\nimport tqdm\nimport pylab as plt\nimport numpy as np\nimport scipy.sparse as sps\nfrom collections.abc import Sequence\nimport time\nfrom src import utils as ut\nfrom sklearn.metrics import confusion_m... | [
[
"numpy.array",
"torch.no_grad",
"torch.nn.functional.interpolate",
"numpy.unique"
]
] |
EthanChen1234/bert4keras | [
"149b8abe4f5696f7762f49547533873b935f85b9",
"de66f9b66a57152816920a6b068a3f28648dd547"
] | [
"bert4keras/layers.py",
"examples/task_image_caption.py"
] | [
"#! -*- coding: utf-8 -*-\n# 自定义层\n\nimport numpy as np\nimport tensorflow as tf\nfrom bert4keras.backend import keras, K\nfrom bert4keras.backend import sequence_masking\nfrom bert4keras.backend import recompute_grad\nfrom keras import initializers, activations\nfrom keras.layers import *\n\n\ndef integerize_shape... | [
[
"numpy.log",
"tensorflow.reverse_sequence",
"tensorflow.reduce_logsumexp",
"tensorflow.einsum"
],
[
"numpy.array",
"numpy.zeros_like",
"numpy.random.choice"
]
] |
ligongzzz/MCM2020_Code | [
"7e5e6f9a6b09b3eb7e21774535c977ba6e974d79"
] | [
"problem_visual3.py"
] | [
"# Plays of the season.\nimport numpy as np\nimport cv2\nimport csv\nimport matplotlib.pyplot as plt\nimport matlab.engine\nplt.rc('font', family='Times New Roman')\n\n\n# Read the csv file.\ncsv_reader = csv.reader(open('./data/passingevents.csv'))\n\n# The first match.(First match and self passing only.)\npassing... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
PujithaKurakula/BreastCancer-android-python-ml-app | [
"ae1cd5b683a13e72169eda400322b3e17bb48bd9",
"ae1cd5b683a13e72169eda400322b3e17bb48bd9"
] | [
"python-flask/app.py",
"python-flask/model.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom flask import Flask, request, render_template\n\nimport pickle\n\napp = Flask(__name__)\nmodel = pickle.load(open('model.pkl', 'rb'))\n\n@app.route('/')\ndef home():\n \n return render_template('h.html')\n@app.route('/detect')\ndef detect():\n return render_tem... | [
[
"pandas.DataFrame"
],
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.RandomForestClassifier",
"matplotlib.pyplot.figure"
]
] |
jacob-heglund/ece598-xmase | [
"7345b713fbb6d4f84c795cd52778312058cd80f8"
] | [
"PPO.py"
] | [
"from numpy.core.fromnumeric import trace\nimport torch\nimport torch.nn as nn\nfrom torch.distributions import MultivariateNormal\nfrom torch.distributions import Categorical\n\nimport pdb\n\n################################## set device ##################################\n\nprint(\"===============================... | [
[
"torch.nn.Softmax",
"torch.load",
"torch.diag_embed",
"torch.no_grad",
"torch.FloatTensor",
"torch.cuda.is_available",
"torch.device",
"torch.tensor",
"torch.squeeze",
"torch.distributions.MultivariateNormal",
"torch.full",
"torch.nn.ReLU",
"torch.nn.Conv2d",
... |
ICHEC/QNLP | [
"2966c7f71e6979c7ddef62520c3749cf6473fabe"
] | [
"modules/py/pkgs/QNLP/proc/DisCoCat.py"
] | [
"###############################################################################\n\nimport sqlite3\nimport os\nfrom typing import Dict, Tuple\nimport QNLP.proc.process_corpus as pc\nimport numpy as np\nfrom QNLP.io.qnlp_db import qnlp_db as qnlp_db\n\n################################################################... | [
[
"numpy.abs",
"numpy.linalg.norm"
]
] |
wavefancy/BIDMC-PYTHON | [
"97c7d3e1bec19dd7fea34d4ecebbdf2af2b1faed"
] | [
"Utilities/BootstrapMean/BootstrapMean.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\n\n Bootstrap values to estimate confidence interval for mean.\n\n @Author: wavefancy@gmail.com\n\n Usage:\n BootstrapMean.py -n times -c confidence\n BootstrapMean.py -h | --help | -v | --version | -f | --format\n\n Notes:\n 1. Read content from st... | [
[
"numpy.sort",
"numpy.array",
"numpy.mean",
"numpy.empty"
]
] |
danilodsp/quantstats | [
"67a647baeba756c57d87bc7028f55d4dee8702b4"
] | [
"quantstats/_plotting/core.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n#\n# Quantreturns: Portfolio analytics for quants\n# https://github.com/ranaroussi/quantreturns\n#\n# Copyright 2019 Ran Aroussi\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... | [
[
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.ticker.FormatStrFormatter",
... |
csehong/stanford-tensorflow-tutorials | [
"fd93ff0568914724f2b9e97920eb8d6138efc52c"
] | [
"examples/08_tfRecord.py"
] | [
"\"\"\" Examples to demonstrate how to write an image file to a TFRecord,\nand how to read a TFRecord file using TFRecordReader.\nAuthor: Chip Huyen\nPrepared for the class CS 20SI: \"TensorFlow for Deep Learning Research\"\ncs20si.stanford.edu\n\"\"\"\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL']='2'\n\nimport sy... | [
[
"matplotlib.pyplot.imshow",
"tensorflow.FixedLenFeature",
"numpy.asarray",
"tensorflow.train.start_queue_runners",
"tensorflow.decode_raw",
"tensorflow.reshape",
"tensorflow.train.Coordinator",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.train.string_input_producer",
... |
afish880/TensorTest | [
"a41f00ac171cf53539b4e2de47f2e15ccb848c90"
] | [
"research/maskgan/models/rnn_zaremba.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 requi... | [
[
"tensorflow.logging.warning",
"tensorflow.get_variable",
"tensorflow.contrib.layers.linear",
"tensorflow.matmul",
"tensorflow.random_uniform_initializer",
"tensorflow.stack",
"tensorflow.contrib.rnn.BasicLSTMCell",
"tensorflow.cast",
"tensorflow.squeeze",
"tensorflow.contri... |
Numlet/pgw-python | [
"1731fccdd0d3a3a199246fdc6dc04058273237ab"
] | [
"timesmoothing.py"
] | [
"# -*- coding: utf-8 -*-\n\n#from settings import annualcycleraw, variablename_to_smooth, outputpath\nimport xarray as xr\nimport numpy as np\nimport sys\nimport math\nfrom pathlib import Path\n\ndef filterdata(annualcycleraw, variablename_to_smooth, outputpath):\n\n\t\"\"\"\n\tThis function performs a temporal smo... | [
[
"numpy.isnan",
"numpy.arange",
"numpy.cos",
"numpy.sin",
"numpy.full_like",
"numpy.zeros"
]
] |
fabiodepa/ForestQC | [
"aba6d0f2f6925c62229bd01ace7370be314f5886"
] | [
"other/abnormal_sample_detection/scripts/calculate_sampleAB.py"
] | [
"from sample_level_vcf_stat import *\nimport os\nimport sys\nimport pandas as pd\n\n# sample = os.listdir('/u/home/k/k8688933/Jaehoon/data')\n# good_variants_rsid_file = '/u/scratch2/k/k8688933/stat_output/vqsr_qc4/good.all.clfB.rsid'\nvcf_file = sys.argv[1]\noutfile = sys.argv[2]\n# list_ = []\n\n# with open(good_... | [
[
"pandas.DataFrame"
]
] |
jcw780/numpy | [
"1912db21e0f5e61739168864f6b1f37dff3b4006"
] | [
"numpy/lib/tests/test_arraypad.py"
] | [
"\"\"\"Tests for the array padding functions.\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\nimport pytest\n\nimport numpy as np\nfrom numpy.testing import assert_array_equal, assert_allclose, assert_equal\nfrom numpy.lib.arraypad import _as_pairs\n\n\n_numeric_dtypes = (\n np.sct... | [
[
"numpy.lib.pad",
"numpy.testing.assert_equal",
"numpy.pad",
"numpy.reshape",
"numpy.arange",
"numpy.ndarray",
"numpy.full",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.testing.assert_allclose",
"numpy.lib.arraypad._as_pairs",
"numpy.array",
"numpy.z... |
haskie-lambda/DALLE-pytorch | [
"3c59dc9864cc900cefd656f73772e151af4fb97f"
] | [
"dalle_pytorch/vae.py"
] | [
"import io\nimport sys\nimport os, sys\nimport requests\nimport PIL\nimport warnings\nimport os\nimport hashlib\nimport urllib\nimport yaml\nfrom pathlib import Path\nfrom tqdm import tqdm\nfrom math import sqrt\nfrom omegaconf import OmegaConf\nfrom taming.models.vqgan import VQModel\n\nimport torch\nfrom torch im... | [
[
"torch.sigmoid",
"torch.no_grad",
"torch.nn.functional.one_hot",
"torch.device",
"torch.clamp",
"torch.argmax"
]
] |
hsupengbo/201800130086_spring_NNML | [
"c51d074c2d33650cc923ccc4297ecbce31c83df7"
] | [
"Codes/recognition/lib/models/crnn.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass BidirectionalLSTM(nn.Module):\n # Inputs hidden units Out\n def __init__(self, nIn, nHidden, nOut):\n super(BidirectionalLSTM, self).__init__()\n\n self.rnn = nn.LSTM(nIn, nHidden, bidirectional=True)\n self.embedding = nn... | [
[
"torch.nn.Sequential",
"torch.nn.LSTM",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
kadekillary/pandas | [
"f6a5dd4b8c450d73f3bec964b05cca32cef4bb71"
] | [
"pandas/core/arrays/numpy_.py"
] | [
"import numbers\n\nimport numpy as np\nfrom numpy.lib.mixins import NDArrayOperatorsMixin\n\nfrom pandas._libs import lib\nfrom pandas.compat.numpy import function as nv\nfrom pandas.util._decorators import Appender\nfrom pandas.util._validators import validate_fillna_kwargs\n\nfrom pandas.core.dtypes.dtypes import... | [
[
"numpy.asarray",
"pandas._libs.lib.is_scalar",
"numpy.dtype",
"numpy.concatenate",
"pandas.core.nanops.nanprod",
"pandas.core.dtypes.inference.is_list_like",
"pandas.core.nanops.nanmin",
"pandas.core.nanops.nanall",
"pandas.core.nanops.nanstd",
"pandas.core.nanops.nansum",
... |
zyuerugou/tf-faster-rcnn | [
"6d1e3d9691ad3dd570e56a77304fc307969dc0f3"
] | [
"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.maximum",
"numpy.minimum",
"numpy.arange",
"numpy.cumsum",
"numpy.sort",
"numpy.finfo",
"numpy.concatenate",
"numpy.max",
"numpy.argmax",
"numpy.where",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
AJarman/pycaret | [
"e96fefbf95c9e0195ec07ea63ebe25a8ce98baf3"
] | [
"pycaret/tests/test_time_series_tune_base.py"
] | [
"\"\"\"Module to test time_series \"tune_model\" BASE functionality\n\"\"\"\n\nimport pytest\nimport numpy as np\nimport pandas as pd\n\nfrom pycaret.internal.pycaret_experiment import TimeSeriesExperiment\n\nfrom .time_series_test_utils import _ALL_METRICS\n\n\n##########################\n#### Tests Start Here ###... | [
[
"numpy.all",
"numpy.arange"
]
] |
kiddkyd1412/find_av_by_face | [
"e6071b9edbfb6a6ae1c833b13988b6262cc9aa55"
] | [
"my_dlib/tsdlib.py"
] | [
"# -*- coding: utf-8 -*-\nimport base64\nimport json\nimport sys\nimport time\nimport warnings\nfrom concurrent.futures import ThreadPoolExecutor, wait, as_completed\nfrom operator import itemgetter\n\nimport dlib\nimport cv2\nimport os\nimport glob\n\nimport numpy as np\n\nfrom iface import IFace\n\n\nclass FaceDl... | [
[
"numpy.sqrt",
"numpy.save",
"numpy.append",
"numpy.fromstring",
"numpy.load",
"numpy.array"
]
] |
EnzoItaliano/calculoNumericoEmPython | [
"be3161b823955620be71e0f94a3421288fd28ef0"
] | [
"Lista2.py"
] | [
"import math\nimport matplotlib.pyplot as plt\nfrom prettytable import PrettyTable\nfrom sympy import *\nimport numpy as np\nx = symbols('x')\n#Raízes de Equações\n##Método da Bissecção\ndef plot2d(f, inicio, fim):\n z = np.arange(inicio,fim,0.1)\n \n y = []\n for i in range(len(z)):\n y.append(f... | [
[
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
jbathmann/ogs | [
"a79e95d7521a841ffebd441a6100562847e03ab5"
] | [
"Tests/Data/Parabolic/T/3D_3BHEs_array/bcs_tespy.py"
] | [
"###\n# Copyright(c) 2012 - 2019, OpenGeoSys Community(http://www.opengeosys.org)\n# Distributed under a Modified BSD License.\n# See accompanying file LICENSE.txt or\n# http://www.opengeosys.org/project/license\n###\n\nimport sys\nprint(sys.version)\nimport os\nimport numpy as np\nfrom pandas import read_csv\nimpo... | [
[
"numpy.asarray",
"numpy.size",
"pandas.read_csv"
]
] |
897741007/EIAA | [
"94a071687eb387f199f9d8a82848a40ef2a6f5d7"
] | [
"GAT_prediction.py"
] | [
"import torch\nfrom torch import nn\nimport numpy as np\nfrom Smi2Graph import SMI_grapher\nfrom time import time\nimport os\n\nclass GAT_predictor(nn.Module):\n def __init__(self, hidden_dim, layer_num, head_num, dict_size, dropout=0, bond_influence=0, prediction_class=2, device='cuda'):\n # param : bond... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"numpy.sqrt",
"torch.cat",
"torch.randn",
"torch.nn.ModuleList",
"torch.zeros_like",
"torch.nn.Embedding",
"torch.nn.Tanh",
"torch.nn.LayerNorm",
"torch.matmul",
"torch.nn.Linear",
"torch.mul",
"torch.nn.ReLU",
"to... |
Neotriple/differentiable-robot-model | [
"7b3887b5d80ad7d99379962f9f46aabfd4a1c46d"
] | [
"differentiable_robot_model/spatial_vector_algebra.py"
] | [
"from __future__ import annotations\nimport torch\nimport hydra\nimport math\nfrom . import utils\nfrom .utils import cross_product\n\n\ndef x_rot(angle):\n if len(angle.shape) == 0:\n angle = angle.unsqueeze(0)\n angle = utils.convert_into_at_least_2d_pytorch_tensor(angle).squeeze(1)\n batch_size =... | [
[
"torch.ones",
"torch.empty",
"torch.sin",
"torch.zeros",
"torch.einsum",
"torch.cat",
"torch.eye",
"torch.cos"
]
] |
Luger-Lab/Cryo-EM | [
"3eb62434181d6ce438190230758f6ce0e6b20af8"
] | [
"cryolo_relion_wrapper/cryolo_wrapper_library.py"
] | [
"#!/usr/bin/env python\n'''\nOriginal version written by Samuel Bowerman (6/22/2021)\n'''\n\nimport os,sys,glob,datetime,itertools,subprocess,shutil\nimport numpy as np\n\ndef do_denoise(args,logfile):\n starttime = datetime.datetime.now().strftime(\"%Y-%m-%d, %H:%M:%S\")\n logfile.write(\"Beginning 'Denoise'... | [
[
"numpy.array",
"numpy.unique",
"numpy.genfromtxt",
"numpy.random.choice"
]
] |
SooluThomas/qiskit-finance | [
"3e25551b55cdfebfeba1b3889a1cb930b83e57e3"
] | [
"test/circuit/test_european_call_pricing_objective.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2020, 2021.\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.array"
]
] |
olihawkins/penguin-models | [
"fabecdf6336390fc50e67cfd8494ade69fc3ef7f"
] | [
"plots.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"A module for plotting penguins data for modelling with scikit-learn.\"\"\"\n\n# Imports ---------------------------------------------------------------------\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\n# Constants -------... | [
[
"numpy.linspace",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.random.normal",
"matplotlib.pyplot.close",
"matplotlib.ticker.FormatStrFormatter",
"numpy.meshgrid",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.style.reload_library"
]
] |
CurryEleison/lambda-metrics | [
"0954273a1aec0f8c8ea867383e33a9acc9c785cf"
] | [
"lambda/s3trigger.py"
] | [
"import boto3\nimport numpy as np\nimport logging\nimport pandas as pd\nimport datetime\nfrom AwsElbLogUtil import LogDataFrame\nfrom CloudWatchUtil import CustomMetricSender\n\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.INFO)\n\n\n\ndef send_random(event, context):\n data = np.random.randn(5)... | [
[
"numpy.random.randn"
]
] |
skully-coder/COVID-19_TLSTM | [
"7ae6b3e1d8edbcb593b1c5f70001e075b7d29c0f"
] | [
"baselines/DT.py"
] | [
"from math import log\nimport operator\nimport pickle\nimport numpy as np\n\n\ndef load_pkl(path):\n with open(path, 'rb') as f:\n obj = pickle.load(f)\n return obj\n\n\ndef calcShannonEnt(dataSet):\n numEntries = len(dataSet)\n labelCounts = {}\n for featVec in dataSet:\n currentLa... | [
[
"numpy.array"
]
] |
theblackfly/protoflow | [
"02a77e59f6afc8d462a738874d06eca810911166"
] | [
"protoflow/utils/data.py"
] | [
"\"\"\"ProtoFlow data utilities.\"\"\"\n\nimport hashlib\nimport os\nimport shutil\nimport tarfile\nimport zipfile\n\nimport requests\nimport six\nfrom six.moves.urllib.error import HTTPError, URLError\nfrom tensorflow.python.keras.utils.io_utils import path_to_string\nfrom tqdm import tqdm\n\n\ndef _extract_archiv... | [
[
"tensorflow.python.keras.utils.io_utils.path_to_string"
]
] |
johnharveymath/fetchers-python | [
"1f5fc7b64f43142991ad0d901b0840b3e8ef1382"
] | [
"src/plugins/EU_ZH/fetcher.py"
] | [
"# Copyright (C) 2020 University of Oxford\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"pandas.notnull",
"pandas.notna",
"pandas.isna",
"pandas.read_csv"
]
] |
SpatialMetabolomics/pyMS | [
"52c4dce2c4c0eba3c6d447565f3296252f882f9e"
] | [
"pyMSpec/test/test_mass_spectrum.py"
] | [
"\"\"\"\nCreated on 27.08.2015\n\n@author: Dominik Fay\n\"\"\"\nimport unittest\n\nimport numpy\nfrom numpy.ma.testutils import assert_array_equal\n\nfrom .. import mass_spectrum\n\n\nclass MassSpectrumTest(unittest.TestCase):\n def test_init(self):\n \"\"\"Check that spectrum is empty on initialization.\... | [
[
"numpy.array",
"numpy.ma.testutils.assert_array_equal"
]
] |
benmontet/K2-noise | [
"a4b682cdf33f85d2dffc4cef115dcedacfccb4b4"
] | [
"diff_movie.py"
] | [
"#Create a movie of the frames\n\nimport numpy as np\nfrom utils_simple import TIME, FLUX, QUALITY\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.cm import get_cmap\n\n#Limit ourselves 10-40 for more detail\nFLUX = FLUX[:, 15:35, 15:35]\n\ntime = TIME - 1860\ndiffs = np.diff(FLUX, axis=0)\n\nbase = \"frames/{:... | [
[
"numpy.abs",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.colorbar",
"numpy.diff",
"matplotlib.cm.get_cmap"
]
] |
shivamvats/autolab_core | [
"cda081d2e07e3fe6cc9f3e8c86eea92330910d20"
] | [
"autolab_core/dual_quaternion.py"
] | [
"\"\"\"\nClass to handle dual quaternions and their interpolations\nImplementation details inspired by Ben Kenwright's \"A Beginners Guide to\nDual-Quaternions\"\nhttp://cs.gmu.edu/~jmlien/teaching/cs451/uploads/Main/dual-quaternion.pdf\nAuthor: Jacky Liang\n\"\"\"\nfrom numbers import Number\nimport numpy as np\n\... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.roll",
"numpy.allclose"
]
] |
GauravKParmar/Disaster-Response-Pipeline | [
"740aaa9e2062662841add2daa981d5177abda021"
] | [
"data/process_data.py"
] | [
"import sys\nimport pandas as pd\nfrom sqlalchemy import create_engine\n\ndef load_data(messages_filepath, categories_filepath):\n \n \"\"\" \n Loads data from given filepaths and merges them. \n \n Parameters: \n messages_filepath (str): messages filepath\n categories_filepath (str): categories ... | [
[
"pandas.merge",
"pandas.read_csv",
"pandas.to_numeric",
"pandas.concat"
]
] |
CyrilShch/persona-training-scripts | [
"8f026fe29b35b7f217fbb58445181dc0569f3321"
] | [
"Personalization/script_BolCom.py"
] | [
"# imports\nfrom selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nfrom selenium.webdriver.common.keys import Keys\nfrom selenium.common.exceptions import TimeoutException... | [
[
"pandas.DataFrame",
"numpy.random.choice"
]
] |
sam1373/glow-tts | [
"e38e9f0d149c55d3726b059802971145746d99cd"
] | [
"train.py"
] | [
"import os\nimport json\nimport argparse\nimport math\nimport torch\nfrom torch import nn, optim\nfrom torch.nn import functional as F\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\nimport torch.multiprocessing as mp\nimport torch.distributed as dist\nfrom apex.parallel... | [
[
"torch.distributed.init_process_group",
"torch.multiprocessing.spawn",
"torch.cuda.set_device",
"torch.utils.data.distributed.DistributedSampler",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.sum",
"torch.exp",
"torch.no_grad",
"torch.utils.tensorboard.Summary... |
askap-vast/forced_phot | [
"8f4307825781743755d189418a9cb9111aaf0b63"
] | [
"tests/test_forced_phot_inject.py"
] | [
"import time\nimport warnings\nfrom astropy import units as u, constants as c\nfrom astropy.coordinates import SkyCoord\nfrom astropy.io import fits\nfrom astropy.io.fits.verify import VerifyWarning\nfrom astropy.table import Table\nimport astropy.wcs\nfrom astropy.utils.exceptions import AstropyWarning\nfrom matpl... | [
[
"numpy.random.random_sample",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
quincy-125/DigiPath_CLAM_TF | [
"8b7ab50caaca13f666268b0f4e071d123e190978",
"8b7ab50caaca13f666268b0f4e071d123e190978"
] | [
"MODEL/model_bag_classifier.py",
"MODEL/model_attention.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\n\nclass S_Bag(tf.keras.Model):\n def __init__(self, dim_compress_features=512, n_class=2):\n super(S_Bag, self).__init__()\n self.dim_compress_features = dim_compress_features\n self.n_class = n_class\n\n self.s_bag_model = tf.keras.mode... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.transpose",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"tensorflow.math.add_n",
"tensorflow.one_hot",
"tensorflow.math.softmax",
"tensorflow.math.top_k",
"tensorflow.keras.models.Sequential"
],
[
"tensorflow.math.m... |
HaldexBrake/ReducedOrderModeling | [
"d56917f52018dabd317c1a9a583efe0b90cc9e7b"
] | [
"dmd/dmd.py"
] | [
"\"\"\"\n\n\"\"\"\nfrom pyfmi import load_fmu\nimport numpy as np\nfrom scipy.linalg import eig\nfrom numpy.linalg import svd, solve, inv, norm\nimport matplotlib.pyplot as plt\nfrom sympy import symbols, lambdify\n\n\ndef create_input_vec(time_vec, inp_type='sin', amp=10.0, freq=1.0, delta_time=1.0, duration=1):\n... | [
[
"numpy.diag",
"numpy.imag",
"numpy.sqrt",
"numpy.linspace",
"matplotlib.pyplot.plot",
"numpy.zeros_like",
"numpy.exp",
"numpy.linalg.svd",
"numpy.eye",
"numpy.sin",
"numpy.real",
"numpy.argmax",
"matplotlib.pyplot.axis",
"numpy.zeros",
"matplotlib.pyplot... |
thomas-mazumder/project5 | [
"b8f2eda71dcfb550d030a2ee2d9b136005198aca"
] | [
"cluster/silhouette.py"
] | [
"import numpy as np\nfrom scipy.spatial.distance import cdist\n\nclass Silhouette:\n def __init__(self, metric: str = \"euclidean\"):\n \"\"\"\n inputs:\n metric: str\n the name of the distance metric to use\n \"\"\"\n self._metric = metric \n\n def... | [
[
"numpy.min",
"scipy.spatial.distance.cdist",
"numpy.max",
"numpy.zeros",
"numpy.sum"
]
] |
ArpanBose11/Music_Recogniser_Omega | [
"584ca1e77436a54ac2589bb9be839ec392b8b2c2"
] | [
"recognize-from-microphone.py"
] | [
"#!/usr/bin/python\nimport argparse\nimport sys\nfrom argparse import RawTextHelpFormatter\nfrom itertools import zip_longest as izip_longest\n\nimport numpy as np\nfrom termcolor import colored\n\nimport libs.fingerprint as fingerprint\nfrom libs.config import get_config\nfrom libs.db_sqlite import SqliteDatabase\... | [
[
"numpy.frombuffer"
]
] |
hoossainalik/goodreads-reviewer | [
"b4f47856b5c0e88f9bd5bc55b91f2cba8909ef27"
] | [
"BookReviewsSentimentAnalyzer.py"
] | [
"\"\"\"-------------------------------------------\r\nPackage Name: BookReviewsSentimentAnalyzer\r\nAuthor: Hussain Ali Khan\r\nVersion: 1.0.1\r\nLast Modified: 12/02/2018\r\n-------------------------------------------\r\n\"\"\"\r\n\r\nimport sys\r\nfrom PyQt5.QtWidgets import QDialog, QApplication, QMainWindow, QM... | [
[
"pandas.DataFrame"
]
] |
MAC-AutoML/XNAS | [
"2c54ceb09b255cbcabd67f3c39fc777c4b2403f4"
] | [
"search/DrNAS/nb201space_progressive.py"
] | [
"import os\nimport torch\nimport torch.nn as nn\nimport torch.utils\nimport torch.backends.cudnn as cudnn\n\nimport xnas.core.logging as logging\nimport xnas.core.config as config\nimport xnas.core.meters as meters\nimport xnas.search_space.DrNAS.utils as utils\nfrom xnas.core.builders import build_loss_fun, DrNAS_... | [
[
"torch.set_num_threads"
]
] |
GT-RIPL/UNO-IC | [
"6a95f2c6bc52ad80bfb1da53fd046a3d4db310d0"
] | [
"classification/rebalancing.py"
] | [
"import torch\n\ndef prior_recbalancing(logit,beta,s_prior,t_prior=None):\n\t# logit (b,c,h,w): pre-softmax network output\n\t# beta (1,): user controlled hyperparameter \n\t# s_prior (1,c): source (training) data prior\n\t# t_prior (1,c): target (test) data prior (most likely uniform)\n\n prob = torch.nn.Softma... | [
[
"torch.nn.Softmax"
]
] |
alvarochiqui/edem | [
"d28861b04d9053848e26c24056395e5381ed398e"
] | [
"1. FUNDAMENTOS/3. PROGRAMACION ESTADISTICA CON PYTHON/3. my project/Part 1/heart.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Nov 16 18:17:34 2021\n\n@author: alvar\n\"\"\"\n#Importamos todas las librerias necesarias para el proyecto\n\nimport os #sistema operativo\nimport pandas as pd #gestionar datframes\nimport numpy as np #numer... | [
[
"pandas.read_csv",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.text",
"matplotlib.pyplot.show",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.... |
Zhas1ke/Captcha_Generator | [
"72be27f298b8475643f037082b06b453a2dc9b78"
] | [
"captcha.py"
] | [
"import numpy as np\nimport cv2\nimport string\nimport math\nimport os\nimport uuid\nimport random\n\n##############################################\ngrad_img = cv2.imread('grad.png')\ndef sp_noise(image,prob):\n '''\n Add salt and pepper noise to image\n prob: Probability of the noise\n '''\n output... | [
[
"numpy.zeros",
"numpy.random.choice",
"numpy.random.randint"
]
] |
ia-flash/matchvec | [
"e418c55c55a273f6a73fc048b3259967960c7e4f"
] | [
"aws_lambda/lambda_function.py"
] | [
"import io\nimport re\nfrom os import listdir, getenv\nimport json\nimport base64\nimport numpy as np\nimport cv2\nfrom PIL import Image\nfrom matchvec import predict_class, predict_objects, predict_anonym\nfrom urllib.request import urlopen\nfrom requests_toolbelt.multipart import decoder\n\npattern = re.compile('... | [
[
"numpy.array"
]
] |
heytitle/Syllable-based-Neural-Thai-Word-Segmentation | [
"bb8a4f0dbabe31a65f9bfa1fd784000544e3e7f5"
] | [
"scripts/writing/hyperopt-model-tables.py"
] | [
"# This generates model hyperopt tables for Appendix\n\nimport yaml\nimport pandas as pd\nfrom attacut import utils\n\nOUTPUT = \"./writing/tables/hyperopt-model-tables.tex\"\n\ntable = r\"\"\"\n\\begin{table*}\n\n\\centering\n\\begin{tabular}{lc}\n\\toprule\n\\textbf{Average training duration} & %(avg_training).0... | [
[
"pandas.read_csv"
]
] |
vengalraoguttha/EGG | [
"e4f8412f197543ec7f1f00cf89b5a364b038dc57"
] | [
"tests/test_agent_wrappers.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\n\nimport sys\nfrom pathlib import Path\n\nimport torch\nfrom torch.nn import functional as F\n\nimport egg.core as core\n\nsys.path.i... | [
[
"torch.Size",
"torch.randint",
"torch.nn.functional.log_softmax",
"torch.zeros",
"torch.nn.functional.cross_entropy",
"torch.eye",
"torch.tensor",
"torch.nn.Linear"
]
] |
Kyl67899/python-labs | [
"aafc6fc94837ee43c9ef2e1b103d86f80dfc9814"
] | [
"WX272_lab4_thkn.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Feb 14 15:20:21 2020\n\n@author: parsotak\n\"\"\"\n# import datasets\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom netCDF4 import Dataset\nfrom mpl_toolkits.basemap import Basemap\n\n#Define input file\n\ninfile = '/wx/storage/hal... | [
[
"numpy.log",
"numpy.arange",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.colorbar",
"numpy.meshgrid",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
mikhail-tsir/vespa-exloration | [
"9bebc00acb43021fa60c6e144fe4f1fa1d7719fc"
] | [
"text-video-search/src/python/embedding.py"
] | [
"import os\nimport glob\nimport ntpath\nfrom collections import Counter\n\nimport numpy as np\nimport imageio\n\n\nfrom vespa.package import ApplicationPackage, Field, HNSW, RankProfile, QueryTypeField\nfrom vespa.application import Vespa\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvi... | [
[
"torch.no_grad",
"numpy.array",
"torch.utils.data.DataLoader"
]
] |
youngmit/armi | [
"67688e4e67d2a217dfc7b1ccfa64028c20b57a5b"
] | [
"armi/nuclearDataIO/xsCollections.py"
] | [
"# Copyright 2019 TerraPower, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agr... | [
[
"scipy.sparse.issparse",
"numpy.asarray",
"scipy.sparse.csr_matrix",
"numpy.array",
"numpy.zeros"
]
] |
Shuai-Xie/structure_knowledge_distillation | [
"a5a0897f01e16d71dc4e3c77d4ac926fb0cd532d"
] | [
"dataset/datasets.py"
] | [
"import os\r\nimport os.path as osp\r\nimport numpy as np\r\nimport random\r\nimport collections\r\nimport torch\r\nimport torchvision\r\nimport cv2\r\nfrom torch.utils import data\r\n\r\n\r\nclass VOCDataSet(data.Dataset):\r\n def __init__(self, root, list_path, max_iters=None, crop_size=(321, 321), mean=(128, ... | [
[
"numpy.asarray",
"numpy.array",
"numpy.random.choice"
]
] |
donghaW/RCF-pytorch | [
"6380209ef747abefa87637e60d33369ba423814d"
] | [
"data_loader.py"
] | [
"from os.path import join\n\nimport cv2\nimport numpy as np\nfrom PIL import Image\nfrom torch.utils import data\n\n\ndef prepare_image_PIL(im):\n im = im[:,:,::-1] - np.zeros_like(im) # rgb to bgr\n im -= np.array((104.00698793,116.66876762,122.67891434))\n im = np.transpose(im, (2, 0, 1)) # (H x W x C) t... | [
[
"numpy.logical_and",
"numpy.squeeze",
"numpy.zeros_like",
"numpy.transpose",
"numpy.array"
]
] |
kikei/btc-bot-ai | [
"cb118fa1809ebef472a2025be697c9050e948009"
] | [
"apps/predict/src/predict.py"
] | [
"import datetime\n\n# Numpy\nimport numpy as np\n\n# Matplotlib\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\n\nfrom Plotter import Plotter\nfrom dsp import crosszero\nfrom learningUtils import validated, to2d, zscore, loadModel\nfrom utils import readConfig, getLogger, reportTrend, ... | [
[
"numpy.convolve",
"numpy.abs",
"matplotlib.use",
"numpy.argwhere",
"numpy.zeros",
"numpy.sum"
]
] |
AarthiKasirajan/transformer-kgc | [
"d660dce63133f0fd3fa4d909c92b27dad6395153"
] | [
"evaluate.py"
] | [
"import argparse\r\nimport math\r\nfrom tqdm import tqdm\r\nfrom dataset import T5_Dataset\r\nfrom torch.utils.data import DataLoader\r\nfrom utils_accelerate import *\r\nimport numpy as np\r\nfrom typing import Dict\r\nfrom collections import defaultdict\r\n\r\n\r\nclass Evaluator:\r\n def __init__(self, datase... | [
[
"numpy.array",
"torch.utils.data.DataLoader",
"numpy.power"
]
] |
anguyen216/mTSP-work | [
"47d3b59c83569e9e03c92c9b5140a549d4742bce"
] | [
"solvers_examples.py"
] | [
"# includes examples of how to run solvers\n# Author: Anh Nguyen\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom utils import longLatDistKm, plotPath, plotMultiplePaths\nfrom tsp_solvers.dp_solver import DP_TSP\nfrom tsp_solvers.ILP_solver import ILP_TSP\nfrom tsp_solvers.opt2_solver import OPT2_TSP\nfro... | [
[
"numpy.random.choice"
]
] |
TrackerSB/deepjanus | [
"f715072645b1e6f2cc0c51ec0c3a6296cfb14a1d"
] | [
"DeepJanus-BeamNG/udacity_integration/take-free-screenshot.py"
] | [
"import random\n\nimport numpy as np\n\nfrom beamng_brewer import BeamNGBrewer\nfrom beamng_waypoint import BeamNGWaypoint\nfrom road_storage import RoadStorage\nfrom simulation_data_collector import SimulationDataCollector\nfrom beamng_tig_maps import maps\n\nrandom.seed(42)\nnp.random.seed(42)\n\nmaps.install_map... | [
[
"numpy.random.seed"
]
] |
Bhumika0201/autoai | [
"8a1ba4453395798cf694c49ac481ba1d37989fb4"
] | [
"blobcity/utils/ProblemType.py"
] | [
"# Copyright 2021 BlobCity, Inc\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed... | [
[
"numpy.unique"
]
] |
OsmanMutlu/pytorch-pretrained-BERT | [
"837cde8fe82549dc5aeb34aa25b86c07c9448a46"
] | [
"examples/error_analysis.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"Random baseline for the PAN19 hyperpartisan news detection task\"\"\"\n# Version: 2018-09-24\n\n# Parameters:\n# --inputDataset=<directory>\n# Directory that contains the articles XML file with the articles for which a prediction should be made.\n# --outputDir=<directory>\n# Dire... | [
[
"pandas.read_csv",
"torch.load",
"torch.tensor",
"numpy.argmax",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.DataParallel"
]
] |
xiaomingzhid/SSKD | [
"806d6db5c5dea4e018e49ee30d7bfc7b95977ffe"
] | [
"fastreid/evaluation/reid_evaluation.py"
] | [
"# encoding: utf-8\n\"\"\"\n@author: liaoxingyu\n@contact: sherlockliao01@gmail.com\n\"\"\"\nimport copy\nimport logging\nfrom collections import OrderedDict\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom sklearn import metrics\nimport pdb\nfrom fastreid.utils import comm\nfrom fastreid... | [
[
"torch.nn.functional.normalize",
"numpy.abs",
"torch.cat",
"numpy.asarray",
"sklearn.metrics.roc_curve",
"numpy.mean"
]
] |
detrout/woldlab-rna-seq | [
"02099219ff783503e8b6acce94d96b2b374b72da"
] | [
"woldrnaseq/transcript_types.py"
] | [
"#!/usr/bin/python3\n\"\"\"Read annotation bam and count reads per gene_type\n\"\"\"\nfrom argparse import ArgumentParser\nfrom collections import Counter\nimport logging\nfrom pathlib import Path\nimport pandas\nimport pysam\nimport time\n\nfrom .common import (\n add_debug_arguments,\n add_metadata_argument... | [
[
"pandas.HDFStore",
"pandas.DataFrame"
]
] |
gdaguilarc/intelligent-systems | [
"af8c7374a3225ad5944e63956a666ff1ccb6532d"
] | [
"main.py"
] | [
"# Proyecto Final\n# Clustering with kmeans a group of numbers from an image, crop and then predict the label with a NN\n\n# Location:\n# Tecnologico de Monterrey Campus Ciudad de México\n\n# Contributors:\n# Andrea Beatriz Becerra Bolaños - A01337434\n# Guillermo David Aguilar Castilleja - A01337242\n\n# Dependenc... | [
[
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.models.load_model",
"numpy.pad",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.scatter",
"numpy.asarray",
"matplotlib.pyplot.figure",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.datasets.mnist.load_data",
"matplotli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.