repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
AetherPrior/malaya | [
"45d37b171dff9e92c5d30bd7260b282cd0912a7d"
] | [
"session/spelling-correction/t5/t5-super-tiny.py"
] | [
"import tensorflow as tf\nimport tensorflow_datasets as tfds\nimport t5\nimport functools\n\nvocab = 'gs://mesolitica-tpu-general/t5-data-v2/sp10m.cased.ms-en.model'\ntpu = tf.distribute.cluster_resolver.TPUClusterResolver(\n 'node-11', zone='us-central1-f', project='mesolitica-tpu'\n)\nTPU_ADDRESS = tpu.get_mas... | [
[
"tensorflow.strings.join",
"tensorflow.logging.set_verbosity",
"tensorflow.distribute.cluster_resolver.TPUClusterResolver",
"tensorflow.data.TextLineDataset",
"tensorflow.app.run"
]
] |
maitbayev/ml-algorithms | [
"540b546a15cac96bd87b77796cbe1563d36a8466"
] | [
"mla/linear_regression.py"
] | [
"import numpy as np\n\nclass LinearRegression:\n def fit(self, X, y):\n X = np.c_[np.ones((X.shape[0], 1)), X]\n self.beta = np.linalg.inv(X.T @ X) @ X.T @ y\n\n return self.beta\n \n def predict(self, x):\n return np.dot(self.beta, np.r_[1, x])\n"
] | [
[
"numpy.dot",
"numpy.linalg.inv",
"numpy.ones"
]
] |
amydach/web-scraping-challenge | [
"a35d42e5d34a417611a214444752b8f50a1fce1b"
] | [
"Missions_to_Mars/scrape_mars.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport pandas as pd\nfrom splinter import Browser\nfrom splinter.exceptions import ElementDoesNotExist\nfrom bs4 import BeautifulSoup\n\n\n# In[2]:\n\n\nexecutable_path = {'executable_path': 'chromedriver.exe'}\nbrowser = Browser('chrome', **executable_path, ... | [
[
"pandas.read_html"
]
] |
UdonDa/PytorchTutorials | [
"4d9d7d51fe6fb3d09bf9eda60c7bab092d85691c"
] | [
"src/bidirectional_recurrent_neural_network/main.py"
] | [
"import torch\nimport torch.nn as nn\nimport torchvision\nimport torchvision.transforms as transforms\nimport sys\nsys.path.append(\"../\")\nfrom utils.utils import *\n\n\n# Hyper parameters\nsequence_length = 28\ninput_size = 28\nhidden_size = 128\nnum_layers = 2\nnum_classes = 10\nbatch_size = 100\nnum_epochs = 5... | [
[
"torch.nn.Linear",
"torch.nn.LSTM",
"torch.max",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss"
]
] |
SuccessionEcologicalServices/eemeter-1 | [
"dc06f42dc64679a5d56771d6900169eef4eaf515"
] | [
"eemeter/weather/clients.py"
] | [
"import ftplib\nimport gzip\nfrom io import BytesIO\nimport json\nimport logging\nfrom pkg_resources import resource_stream\nimport warnings\nfrom datetime import datetime, timedelta\n\nimport pytz\nimport pandas as pd\nimport requests\n\nlogger = logging.getLogger(__name__)\n\n\nclass NOAAClient(object):\n\n de... | [
[
"pandas.date_range",
"pandas.Series"
]
] |
juanma9613/CarND-Behavioral-Cloning-P3 | [
"def45c2b305167d59ed801cfa6b94235eb297a17"
] | [
"drive.py"
] | [
"import argparse\nimport base64\nfrom datetime import datetime\nimport os\nimport shutil\n\nimport numpy as np\nimport socketio\nimport eventlet\nimport eventlet.wsgi\nfrom PIL import Image\nfrom flask import Flask\nfrom io import BytesIO\n\nfrom keras.models import load_model\nimport h5py\nfrom keras import __vers... | [
[
"numpy.asarray"
]
] |
terratenney/aws-tools | [
"b5d6b160ef0780032f231362158dd9dd892f4e8e"
] | [
"SageMaker/from_athena.py"
] | [
"#import sys\n#!{sys.executable} -m pip install pyathena\n\nfrom pyathena import connect\nimport pandas as pd\n\nconn = connect(s3_staging_dir='s3://aws-athena-query-results-459817416023-us-east-1/', region_name='us-east-1')\ndf = pd.read_sql('SELECT * FROM \"ticketdata\".\"nfl_stadium_data\" order by stadium limit... | [
[
"pandas.read_sql"
]
] |
koriavinash1/nfm | [
"b1be9f7bbb835a9f077161287b4f33f4644d16a6"
] | [
"nfm/CoupledNFM.py"
] | [
"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\nfrom scipy import signal\nfrom matplotlib.ticker import LinearLocator, FormatStrFormatter\nfrom GaussianStatistics import *\nfrom SOM import SOM\n\nGstat = GaussianStatistics()\n\n# NFM 2D i... | [
[
"numpy.max",
"numpy.random.randn",
"numpy.min",
"numpy.mean",
"numpy.tanh",
"numpy.var",
"numpy.abs",
"scipy.signal.convolve2d"
]
] |
TAriasVergara/Acoustic_features | [
"b4277c95e3389aab3b770fb8ce13a836a97a66ae"
] | [
"Spectral/bark_extractor.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Apr 5 17:27:48 2020\r\n\r\n@author: TOMAS\r\n\"\"\"\r\nimport numpy as np\r\nimport math \r\n\r\ndef barke(y,Fs,nB=17,nfft=512):\r\n \"\"\"\r\n y: log-STFT of the signal [framesXbins]\r\n Fs: sampling frequency\r\n nfft: number of points for the Four... | [
[
"numpy.asarray",
"numpy.nonzero",
"numpy.abs",
"numpy.linspace",
"numpy.vstack"
]
] |
smivv/kaggle-bengali | [
"ab6a2153b657b4f4210551f7f4a674920d66a272"
] | [
"src/callbacks/visualizer.py"
] | [
"# flake8: noqa\n# isort: skip_file\nimport cv2\n\nimport numpy as np\n\nimport torch\nimport torchvision.utils\n\nfrom catalyst.dl import Callback, CallbackOrder, State\nfrom catalyst.contrib.tools.tensorboard import SummaryWriter\n\n\nclass VisualizationCallback2(Callback):\n TENSORBOARD_LOGGER_KEY = \"_tensor... | [
[
"torch.is_tensor",
"numpy.asarray",
"numpy.concatenate"
]
] |
1suancaiyu/EfficientGCNv1 | [
"6c0a13e32f30df7bf8f641a1e10cb568d5810e1a"
] | [
"src/model/layers.py"
] | [
"import torch\r\nfrom torch import nn\r\n\r\n\r\nclass Basic_Layer(nn.Module):\r\n def __init__(self, in_channel, out_channel, residual, bias, act, **kwargs):\r\n super(Basic_Layer, self).__init__()\r\n\r\n self.conv = nn.Conv2d(in_channel, out_channel, 1, bias=bias)\r\n self.bn = nn.BatchNo... | [
[
"torch.nn.Identity",
"torch.einsum",
"torch.nn.BatchNorm2d",
"torch.nn.Parameter",
"torch.nn.Conv2d",
"torch.ones_like"
]
] |
nikola3794/composite-tasking | [
"c759a87be783912aae02e0cb9a8d18c52b3c8930"
] | [
"src/data_sets/pascal_mt/tmp_test.py"
] | [
"import sys\nimport os\nif __name__ == \"__main__\":\n sys.path.append(os.getcwd())\n\nimport matplotlib.pyplot as plt\n\nfrom data_sets.pascal_mt.data_set import * \n\nfrom torch.utils.data import DataLoader\n\n\n# The purpose of this script is to test whether the data set\n# class is implemented correctly.\n# ... | [
[
"matplotlib.pyplot.show",
"torch.utils.data.DataLoader"
]
] |
ryu577/graph | [
"d12b1f2d27a3e16b9f7446e4920889978a753d79"
] | [
"graphing/use_cases/open_cube.py"
] | [
"# This file started out in graphing, but migrated to pyray.\n\nimport numpy as np\nimport queue\nfrom collections import defaultdict\nfrom itertools import combinations\nfrom PIL import Image, ImageDraw, ImageFont, ImageMath\n\n\ndef tst():\n survive = {3, 10, 11, 8, 5}\n gr = Graph_cube(survive)\n gr.dfs... | [
[
"numpy.arange"
]
] |
wangxianliang/facenet | [
"28a7f0b97926f83ac5bad7d3da6388c1964d61c0"
] | [
"tmp/mnist_noise_labels.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.nn.conv2d",
"tensorflow.matmul",
"tensorflow.reshape",
"numpy.frombuffer",
"tensorflow.nn.softmax",
"tensorflow.one_hot",
"tensorflow.global_variables_initializer",
"tensorflow.gfile.MakeDirs",
"numpy.arange",
"numpy.random.randint",
"numpy.argmax",
"ten... |
pgluss/Eva | [
"5d12dc6593f9e9147b027526d22738615c80422f"
] | [
"test/filters/test_minimum_filter.py"
] | [
"from src.filters.minimum_filter import FilterMinimum\r\nfrom src.filters.models.ml_pca import MLPCA\r\nfrom src.filters.models.ml_dnn import MLMLP\r\nimport numpy as np\r\nimport unittest\r\n\r\n\r\nclass FilterMinimum_Test(unittest.TestCase):\r\n\r\n def test_FilterMinimum(self):\r\n # Construct the fil... | [
[
"numpy.random.random"
]
] |
dfm/celeritelib | [
"c6874e23367d47743c27ae2ea432bee1dbe864f1"
] | [
"python/celerite2/numpy.py"
] | [
"# -*- coding: utf-8 -*-\n\n__all__ = [\"ConditionalDistribution\", \"GaussianProcess\"]\nimport warnings\n\nimport numpy as np\n\nfrom . import driver\nfrom .core import BaseConditionalDistribution, BaseGaussianProcess\nfrom .driver import LinAlgError\n\n\nclass ConditionalDistribution(BaseConditionalDistribution)... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.empty",
"numpy.diag_indices_from",
"numpy.log",
"numpy.ascontiguousarray",
"numpy.sum",
"numpy.copy",
"numpy.random.randn",
"numpy.diff",
"numpy.random.multivariate_normal",
"numpy.einsum",
"numpy.sqrt"
]
] |
aditen/atmt | [
"7bd17fecc095e019c9e79ec02788e1e979d7a8e8"
] | [
"translate_beam.py"
] | [
"import os\nimport logging\nimport argparse\nimport numpy as np\nfrom tqdm import tqdm\n\nimport torch\nfrom torch.serialization import default_restore_location\n\nfrom seq2seq import models, utils\nfrom seq2seq.data.dictionary import Dictionary\nfrom seq2seq.data.dataset import Seq2SeqDataset, BatchSampler\nfrom s... | [
[
"torch.cat",
"torch.stack",
"torch.no_grad",
"torch.softmax",
"torch.ones",
"torch.manual_seed",
"numpy.where",
"torch.where",
"torch.serialization.default_restore_location"
]
] |
LBJ-Wade/gadget4-tools | [
"94cdb14eb6f7f873eb627115f52caf6c708f175c"
] | [
"write_radial_profile.py"
] | [
"import numpy as np\r\nfrom numba import njit\r\nfrom snapshot_functions import gadget_to_particles\r\n\r\n@njit\r\ndef center_box(c,pos,BoxSize):\r\n pos -= c.reshape((3,1))\r\n for p in range(pos.shape[1]):\r\n for d in range(3):\r\n if pos[d,p] > 0.5*BoxSize: pos[d,p] -= BoxSize\r\n if pos[d,p] < ... | [
[
"numpy.log",
"numpy.zeros",
"numpy.sum",
"numpy.arange",
"numpy.cumsum"
]
] |
zankner/DNC | [
"2596fa3a1ee9bf0a9f160f3f953639e70bb25fe7"
] | [
"models/dynamic_memory/memory_retention_vector.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\ndef mem_retention(free_gates, read_weightings):\n return tf.linalg.matvec(free_gates, read_weightings, transpose_a=True)\n"
] | [
[
"tensorflow.linalg.matvec"
]
] |
AlphaAtlas/Misc_Python_Stuff | [
"b2ebb524928afa90cb3cf18d5393a70d82e0a3d1"
] | [
"extract_subimgs_singleHR256.py"
] | [
"import os\nimport os.path\nimport sys\nfrom multiprocessing import Pool\nimport numpy as np\nimport cv2\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nfrom utils.progress_bar import ProgressBar\n\n\ndef main():\n \"\"\"A multi-thread tool to crop sub imags.\"\"\"\n input_folde... | [
[
"numpy.ascontiguousarray",
"numpy.arange",
"numpy.append"
]
] |
okbalefthanded/ovPyScripts | [
"8828e9b9579734710cba9e61646c0fb517874611",
"8828e9b9579734710cba9e61646c0fb517874611"
] | [
"pyLpov/scripts/scenarios/hybrid_py_online_adaptive.py",
"pyLpov/scripts/scenarios/hybrid_py_online.py"
] | [
"from __future__ import print_function, division\nfrom sklearn.metrics import confusion_matrix\nfrom scipy.linalg import eig\nfrom scipy import sqrt\nimport scipy.signal as sig\nimport numpy as np\nimport socket\nimport logging\nimport pickle\nimport os\nimport gc\n\nOVTK_StimulationLabel_Base = 0x00008100\ncommand... | [
[
"numpy.array",
"numpy.sin",
"numpy.cov",
"numpy.sum",
"numpy.linalg.pinv",
"numpy.ones",
"numpy.real",
"numpy.hstack",
"numpy.eye",
"numpy.flipud",
"scipy.signal.filtfilt",
"numpy.where",
"numpy.argmax",
"numpy.arange",
"numpy.cos",
"numpy.around",
... |
mizeljko/interpret-community | [
"a746bbeca761f6b6bbc85eea3532ee2fb81249d3"
] | [
"python/interpret_community/explanation/explanation.py"
] | [
"# ---------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# ---------------------------------------------------------\n\n\"\"\"Defines the explanations that are returned from explaining models.\"\"\"\n\nimport numpy as np\nimport uuid\nimport json\nim... | [
[
"scipy.sparse.issparse",
"numpy.array",
"numpy.empty",
"numpy.sum",
"pandas.DataFrame",
"numpy.mean",
"numpy.ndarray",
"numpy.abs",
"numpy.absolute"
]
] |
muupan/pytorch-optimizer | [
"efeea8fe4d06c5f4612f1f5bc34acf0c7d7682e1"
] | [
"torch_optimizer/sgdp.py"
] | [
"import math\n\nimport torch\nfrom torch.optim.optimizer import Optimizer\n\nfrom .types import OptFloat, OptLossClosure, Params\n\n__all__ = ('SGDP',)\n\n\nclass SGDP(Optimizer):\n r\"\"\"Implements SGDP algorithm.\n\n It has been proposed in `Slowing Down the Weight Norm Increase in\n Momentum-based Opti... | [
[
"torch.zeros_like"
]
] |
tjulitianyi1997/Towards-Realtime-MOT-1 | [
"cda44e18022fd90411cb7f8911cb7ed9fd9b140d"
] | [
"utils/utils_origin.py"
] | [
"import glob\r\nimport random\r\nimport time\r\nimport os\r\nimport os.path as osp\r\n\r\nimport cv2\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport torch\r\nimport torch.nn.functional as F\r\nfrom torchvision.ops import nms\r\n\r\n\r\ndef mkdir_if_missing(dir):\r\n os.makedirs(dir, exist_ok=T... | [
[
"torch.cat",
"torch.cuda.manual_seed",
"torch.stack",
"numpy.where",
"torch.LongTensor",
"torch.load",
"numpy.cumsum",
"torch.exp",
"torch.sum",
"numpy.concatenate",
"numpy.zeros_like",
"torch.nn.init.constant_",
"torch.ByteTensor",
"torch.manual_seed",
... |
byronwasti/Wireless_Energy_Transfer_Resonant_Inductance | [
"686b575919f49b9e3cc4c826b1f04815ec47629f"
] | [
"resonant_case/calculations.py"
] | [
"#!/usr/bin/python3\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.constants import mu_0\n\nif __name__ == \"__main__\":\n L1 = .5 # Henries\n L2 = .5\n\n # L_m is not super straightforward\n\n V0 = 10 # Volts\n R0 = 1 # ohm\n w = 1000 # in Hertz\n w = 10000 # in Hertz\n #w... | [
[
"matplotlib.pyplot.show",
"numpy.sin",
"numpy.cos"
]
] |
snosrap/spaCy | [
"3f68bbcfec44ef55d101e6db742d353b72652129"
] | [
"spacy/tests/pipeline/test_textcat.py"
] | [
"import random\n\nimport numpy.random\nimport pytest\nfrom numpy.testing import assert_almost_equal\nfrom thinc.api import Config, compounding, fix_random_seed, get_current_ops\nfrom wasabi import msg\n\nimport spacy\nfrom spacy import util\nfrom spacy.cli.evaluate import print_prf_per_type, print_textcats_auc_per_... | [
[
"numpy.testing.assert_almost_equal"
]
] |
exajobs/machine-learning-collection | [
"84444f0bfe351efea6e3b2813e47723bd8d769cc"
] | [
"machine-learning-scripts/examples/tf2-dvc-cnn-evaluate.py"
] | [
"\n# coding: utf-8\n\n# # Dogs-vs-cats classification with CNNs\n# \n# In this notebook, we'll train a convolutional neural network (CNN,\n# ConvNet) to classify images of dogs from images of cats using\n# TensorFlow 2.0 / Keras. This notebook is largely based on the blog\n# post [Building powerful image classifica... | [
[
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.io.read_file",
"tensorflow.image.random_crop",
"tensorflow.keras.models.load_model",
"tensorflow.image.flip_left_right",
"tensorflow.image.resize",
"tensorflow.keras.backend.backend",
"tensorflow.image.decode_jpeg"
]
] |
bluetyson/omf | [
"ec40877da5761b1102163346f7c507050e36c1b4"
] | [
"tests/test_doc_example.py"
] | [
"\"\"\"Test the example in the docs\"\"\"\nimport os\n\nimport numpy as np\nimport png\n\nimport omf\n\n\ndef test_doc_ex():\n \"\"\"Acceptance test of the example from the documentation\"\"\"\n dirname, _ = os.path.split(os.path.abspath(__file__))\n pngfile = os.path.sep.join([dirname, 'out.png'])\n im... | [
[
"numpy.ones",
"numpy.random.rand"
]
] |
Fraunhofer-IIS/georinex | [
"b915238c26c1774d3cde29d3960a63fafa26400c"
] | [
"georinex/nav2.py"
] | [
"#!/usr/bin/env python\nfrom pathlib import Path\nfrom datetime import datetime\nfrom typing import Dict, Any, Sequence, Optional\nfrom typing.io import TextIO\nimport xarray\nimport numpy as np\nimport logging\nfrom .io import opener, rinexinfo\nfrom .common import rinex_string_to_float\n#\nSTARTCOL2 = 3 # column... | [
[
"numpy.nonzero",
"numpy.hstack",
"numpy.asarray",
"numpy.unique"
]
] |
Xacrolyte/MLHJepoch | [
"962bd15ce88881d5ae29bfaf7f536af28ee394fa"
] | [
"app.py"
] | [
"from covid_india import states\nimport streamlit as st\nimport plotly.graph_objects as go\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom matplotlib import rcParams\nimport plotly_express as px\nimport requests\nfrom bs4 import BeautifulSoup\nimport seaborn as sns\nfrom lang import *\nfrom datetime imp... | [
[
"pandas.to_datetime",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"pandas.io.json.json_normalize",
"matplotlib.rcParams.update",
"pandas.melt",
"pandas.read_csv"
]
] |
charlesxjyang/Alexandria | [
"6a4f5cd99fafda425ace642b5376a87606fefdd1"
] | [
"Python/crossref.py"
] | [
"from helper import *\n###---Crossref---###\ndef title_query_crossref(queries,cite_flag=False,relev_flag=False):\n import numpy as np\n from time import sleep\n import json\n from urllib.parse import quote_plus\n cite_flag,relev_flag=weight_database_checker('CrossRef',cite_flag,relev_flag)\n query... | [
[
"numpy.vstack"
]
] |
JacobPaulette/PyLife | [
"ef87fd04a6d3eade58d154427123499705706f36"
] | [
"triple.py"
] | [
"import numpy as np\nfrom scipy import ndimage\nimport re\n\nclass Life:\n \"\"\"The controller class for PyLife.\n \n Parameters:\n\n rule_string : Determines rules for game, e.g. \"B3/S23\" \"B36/S23\", see \n http://www.conwaylife.com/wiki/Rules#Rules for more info.\n matrix : Numpy 2d arra... | [
[
"scipy.ndimage.convolve",
"numpy.array"
]
] |
nicholas-moreles/blaspy | [
"c4af6258e17dd996c4b6d90bbaae15b31b8702b4",
"c4af6258e17dd996c4b6d90bbaae15b31b8702b4"
] | [
"bp_acceptance_tests/level_2/acceptance_test_trmv.py",
"blaspy/helpers.py"
] | [
"\"\"\"\n\n Copyright (c) 2014-2015-2015, The University of Texas at Austin.\n All rights reserved.\n\n This file is part of BLASpy and is available under the 3-Clause\n BSD License, which can be found in the LICENSE file at the top-level\n directory or at http://opensource.org/licenses/BSD-3-Clause\... | [
[
"numpy.allclose",
"numpy.copy",
"numpy.dot"
],
[
"numpy.asmatrix",
"numpy.zeros"
]
] |
vincehass/Arctic-Deep-Reinforcement-Learning-Benchmark | [
"cecb937b861964c25a89e180fdfa07640b12baeb"
] | [
"environements/Action_normalizer.py"
] | [
"import gym\nimport numpy as np\n\nclass ActionNormalizer(gym.ActionWrapper):\n \"\"\"Rescale and relocate the actions.\"\"\"\n\n def action(self, action: np.ndarray) -> np.ndarray:\n \"\"\"Change the range (-1, 1) to (low, high).\"\"\"\n low = self.action_space.low\n high = self.action_s... | [
[
"numpy.clip"
]
] |
tonysyu/scikit-image | [
"d5776656a8217e58cb28d5760439a54e96d15316"
] | [
"skimage/measure/_regionprops.py"
] | [
"# coding: utf-8\nimport warnings\nfrom math import sqrt, atan2, pi as PI\nimport numpy as np\nfrom scipy import ndimage\n\nfrom collections import MutableMapping\n\nfrom skimage.morphology import convex_hull_image, label\nfrom skimage.measure import _moments\n\n\n__all__ = ['regionprops', 'perimeter']\n\n\nSTREL_4... | [
[
"numpy.max",
"numpy.array",
"numpy.dot",
"scipy.ndimage.binary_erosion",
"numpy.zeros",
"numpy.sum",
"scipy.ndimage.find_objects",
"numpy.ones",
"numpy.min",
"numpy.nonzero",
"numpy.mean",
"scipy.ndimage.binary_fill_holes",
"numpy.squeeze",
"numpy.vstack"
... |
pkosiniak/project-object-counter | [
"85a5aadb143a5f9610de3b07c19cf4f160834d7a"
] | [
"server/src/ImageProcessor.py"
] | [
"import io\nfrom typing import List\nfrom src.ImageProcessorBase import ImageProcessorBase\nimport numpy as np\nfrom scipy.ndimage import label, measurements\nimport matplotlib.patches as patches\nimport matplotlib.pyplot as plt\nimport matplotlib\nmatplotlib.use('Agg')\n\n\nclass ImageProcessor(ImageProcessorBase)... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.text",
"numpy.zeros",
"scipy.ndimage.label",
"matplotlib.pyplot.savefig",
"numpy.sum",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.where",
"matplotlib.patches.Rectang... |
NeolithEra/thinc | [
"f7707bb9a2f3f884d3906962d4ebda783476e56d"
] | [
"thinc/tests/layers/test_linear.py"
] | [
"import pytest\nfrom mock import MagicMock\nfrom hypothesis import given, settings\nimport numpy\nfrom numpy.testing import assert_allclose\nfrom thinc.api import Linear, chain, Dropout, SGD\n\nfrom ..strategies import arrays_OI_O_BI\nfrom ..util import get_model, get_shape\n\n\n@pytest.fixture\ndef model():\n m... | [
[
"numpy.testing.assert_allclose",
"numpy.ones",
"numpy.asarray"
]
] |
fangpang20/ofa | [
"a8df50dd371120a5a2c9bad3fc601ed7dac6482d",
"a8df50dd371120a5a2c9bad3fc601ed7dac6482d"
] | [
"data/nlg_data/summary_dataset.py",
"data/nlu_data/mnli_dataset.py"
] | [
"# Copyright 2022 The OFA-Sys Team.\n# All rights reserved.\n# This source code is licensed under the Apache 2.0 license\n# found in the LICENSE file in the root directory.\n\nimport logging\nimport warnings\nimport torch\nimport numpy as np\n\nfrom data import data_utils\nfrom data.ofa_dataset import OFADataset\n\... | [
[
"numpy.array",
"torch.cat"
],
[
"numpy.array",
"torch.cat"
]
] |
ibotdotout/ignite | [
"d2da93d2ff0aab139218e578dee1d0dc8c6481db"
] | [
"ignite/contrib/handlers/tensorboard_logger.py"
] | [
"import numbers\nimport warnings\nfrom typing import Any, Callable, List, Optional, Union\n\nimport torch\nimport torch.nn as nn\nfrom torch.optim import Optimizer\n\nfrom ignite.contrib.handlers.base_logger import (\n BaseLogger,\n BaseOptimizerParamsHandler,\n BaseOutputHandler,\n BaseWeightsHistHandl... | [
[
"torch.utils.tensorboard.SummaryWriter"
]
] |
lucyleeow/scikit-learn-mooc | [
"adce6e0a9393be7d6e22fc393cdbdaf5698dda68"
] | [
"python_scripts/04_basic_parameters_tuning_exercise_02.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.2'\n# jupytext_version: 1.2.4\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---\n\n# %% [markdown]\n# # Exercise 02\n... | [
[
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
hamzajaved05/text2map | [
"c1d824896cf3b9e658687d77762766471b176bc8"
] | [
"textvladpreprocess.py"
] | [
"\"\"\"\nAuthor: Hamza\nDated: 20.04.2019\nProject: texttomap\n\n\"\"\"\nimport torch\nimport pickle\nimport numpy as np\nfrom util.utilities import readcsv2jpgdict, wordskip\n\ndevice = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')\nwith open('training_data_pytorch05.pickle', \"rb\") as a:\n [k... | [
[
"numpy.array",
"torch.cuda.is_available",
"numpy.asarray"
]
] |
Joaopeuko/binanceSpotEasyT | [
"88feb3dfb55a8431aabfed3a4fb760153e88829e"
] | [
"binanceSpotEasyT/trade.py"
] | [
"import hmac\nimport math\nimport time\nimport hashlib\n\nimport numpy as np\nimport requests\nfrom abstractEasyT import trade\nfrom urllib.parse import urlencode\nfrom supportLibEasyT import log_manager\nfrom binanceSpotEasyT.util import get_price_last\nfrom binanceSpotEasyT.util import setup_environment\nfrom bin... | [
[
"numpy.round_"
]
] |
GS-Shashank/DSP-basic-codes | [
"a6ac9b3d0108a5cd3584a9985cb00083253375db"
] | [
"Response of differential equations/TESTFIR_LP.py"
] | [
"\r\n\"\"\"\r\n#####################################\r\n Low Pass Filter Design\r\n \r\n Code by: GSS\r\n \r\n#####################################\r\n// Design a lowpass FIR filter for the following specifications:\r\n// Pass band edge frequency = 1850 Hz\r\n// Stop band edge frequency = 2150 Hz\r\n// ... | [
[
"numpy.concatenate",
"scipy.signal.firwin",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"numpy.unwrap",
"numpy.fft.fft",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"numpy.abs",
"matplotlib.pyplot.show"
... |
rhshah/iAnnotateSV | [
"a2f86543925169219c91fe4e3de5412a69f735a4"
] | [
"iAnnotateSV/helper.py"
] | [
"\"\"\"\nCreated on 25/11/2014.\n\n@author: Ronak H Shah\n\n\"\"\"\nfrom __future__ import division\nimport pandas as pd\n\n'''\nRead the Human Annotation using pandas\n'''\n\n\ndef ReadFile(infile):\n dataDF = pd.read_csv(infile, sep='\\t', header=0, keep_default_na='True')\n return(dataDF)\n\n'''\nRead the ... | [
[
"pandas.read_csv"
]
] |
DanREvans/modern-data-warehouse-dataops | [
"3fb9034698519f0ebc940c715c4e621305ad0f8d"
] | [
"e2e_samples/dataset_versioning/sql/data_generator/main.py"
] | [
"import argparse\nimport pandas as pd\nimport sys\n\nfrom keyvault_wrapper import KeyvaultWrapper\nfrom sql_wrapper import SqlWrapper\nfrom process import Process\n\n\ndef read_csv(path: str) -> pd.DataFrame:\n \"\"\"\n Read csv and modify datatype\n\n :param path: path to csv\n :type path: str\n :re... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
PandoraLS/DeepLearningTemplate | [
"7f7be59311b1d37f640c87d139eac79977c39b75"
] | [
"summary_utils/summary_model.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2021/4/21 下午9:07\n\n\"\"\"\nsummary的一些用法,以rnn为例\n\"\"\"\n\n\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass EncoderGRU(nn.Module):\n def __init__(self, input_size, hidden_size):\n super(EncoderGRU, self).__init__()\n self.hidden_s... | [
[
"torch.zeros",
"torch.nn.Linear",
"torch.nn.LogSoftmax",
"torch.nn.GRU",
"torch.ones",
"torch.cuda.is_available",
"torch.nn.functional.relu",
"torch.nn.Embedding"
]
] |
aryaman4152/model-implementations-PyTorch | [
"a748bb3661fb26f9230d7420182f170f812298d7"
] | [
"f-AnoGAN/encoder_model.py"
] | [
"\"\"\"\nStandard AE encoder\n\"\"\"\n\nimport torch\nimport torch.nn as nn\n\n\nclass Residual_block(nn.Module):\n \"\"\"\n Create new Residual block\n Params:\n in_channels: Input channels\n hidden_inter: hidden channels for intermediate convolution\n hidden_final: Number of channels... | [
[
"torch.nn.ReLU",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Conv2d"
]
] |
AbigailMcGovern/msbrainpy | [
"1489aa1d6190cf70397577dbaa0ae597d9b2bd6d"
] | [
"msbrainpy/brainseries/_preprocessing.py"
] | [
"import numpy as np\nfrom skimage.color import rgb2gray\nfrom skimage import util\nfrom skimage.transform import rescale\nfrom sklearn.decomposition import PCA\n\n\n# File contains functions related to processing in situ hybridisation images\n# such that they can be used to resolve biologically meaningful informati... | [
[
"numpy.max",
"sklearn.decomposition.PCA",
"numpy.argmax"
]
] |
iPhoring/SelfDrivingCar | [
"431679d18bc5b91b5f8a7855031c14a27ed44b33"
] | [
"ros/src/styx/bridge.py"
] | [
"import rospy\n\nimport tf\nfrom geometry_msgs.msg import PoseStamped, Quaternion, TwistStamped\nfrom dbw_mkz_msgs.msg import SteeringReport, ThrottleCmd, BrakeCmd, SteeringCmd\nfrom std_msgs.msg import Float32 as Float\nfrom std_msgs.msg import Bool\nfrom sensor_msgs.msg import PointCloud2\nfrom sensor_msgs.msg im... | [
[
"numpy.asarray"
]
] |
max-imlian/xarray | [
"e4f5b733761bbe9df0748afe15a22a13f4ad908f",
"e4f5b733761bbe9df0748afe15a22a13f4ad908f"
] | [
"xarray/core/variable.py",
"xarray/core/dataarray.py"
] | [
"from __future__ import annotations\n\nimport copy\nimport itertools\nimport numbers\nimport warnings\nfrom datetime import timedelta\nfrom typing import TYPE_CHECKING, Any, Hashable, Literal, Mapping, Sequence\n\nimport numpy as np\nimport pandas as pd\nfrom packaging.version import Version\n\nimport xarray as xr ... | [
[
"numpy.logical_not",
"numpy.concatenate",
"numpy.isnan",
"numpy.asarray",
"numpy.errstate",
"numpy.ma.getmaskarray",
"numpy.nonzero",
"numpy.prod",
"numpy.atleast_1d",
"numpy.timedelta64",
"numpy.asanyarray",
"numpy.datetime64",
"numpy.full_like"
],
[
"p... |
diogo149/doo | [
"d83a1715fb9d4e5eac9f5d3d384a45cfc26fec2f"
] | [
"du/numpy_utils.py"
] | [
"import tempfile\nimport contextlib\nimport numpy as np\n\nfrom . import utils\n\n\ndef constant_value_array(value, shape, dtype=float):\n \"\"\"\n returns a constant valued array with a given shape and dtype\n \"\"\"\n # doing it this way to make sure the resulting array has the proper dtype\n res =... | [
[
"numpy.array",
"numpy.isnan",
"numpy.zeros",
"numpy.set_printoptions",
"numpy.percentile",
"numpy.mean",
"numpy.get_printoptions",
"numpy.std",
"numpy.memmap"
]
] |
Walker088/plurk-salary | [
"947a67a4705bca1026241f1c80d7217a8be6349c"
] | [
"scripts/crawler.py"
] | [
"#!/usr/bin/env python3\nfrom bs4 import BeautifulSoup as bs\nfrom pprint import pprint\nimport numpy as np\nimport logging, logging.config\nimport requests, re, csv\n\nlogging.config.fileConfig(\"crawlerlog.conf\")\nlog = logging.getLogger(\"root\")\n\nurl = \"https://www.plurk.com/p/mtxvw5\"\n\ndef writeCsv(heade... | [
[
"numpy.asarray",
"numpy.median",
"numpy.percentile",
"numpy.mean",
"numpy.std",
"numpy.amax",
"numpy.amin"
]
] |
goodvibrations32/diss.tn.filtering-wind.py | [
"7e5f2456554c6c73f619d5e09d3d355388662d1a"
] | [
"src/paper/decimation_comparison.py"
] | [
"#%% [markdown]\n# the aim of this file is to investigate the effect of sampling frequency\n# more specifically if the usb card when lowering the frequency behaves in a different manner observable in the PS\n#\n# The comparison will revolve aroudn wind speed 0 measurements and more spe:\n# - ca_1_0 \n# - de50.1\n#... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.subplots"
]
] |
avyayv/seqdataloader | [
"f0da8c84377fbd3568d0f1366b3d41358a013026"
] | [
"seqdataloader/batchproducers/coordbased/coordstovals/tiledb.py"
] | [
"import tiledb\nimport numpy as np\nimport dnafrag\nfrom .core import CoordsToVals\n\nclass BasicTiledbProfileCoordsToVals(CoordsToVals):\n def __init__(self, tiledb_paths, pos_label_source_attribute, neg_label_source_attribute=None, center_size_to_use=None, **kwargs):\n '''\n tiledb_paths can be a... | [
[
"numpy.transpose",
"numpy.zeros"
]
] |
YieldLabs/pfhedge | [
"a5ba9d054a8418cb8b27bb67d81a8fc8fb83ef57"
] | [
"pfhedge/_utils/testing.py"
] | [
"from typing import Any\nfrom typing import Callable\n\nimport torch\nfrom torch import Tensor\nfrom torch.testing import assert_close\n\n\ndef assert_monotone(\n fn: Callable[[Tensor], Tensor],\n x1: Tensor,\n x2: Tensor,\n increasing: bool = False,\n allow_equal: bool = False,\n) -> None:\n \"\"... | [
[
"torch.full_like"
]
] |
ctoec/oec-data-tools | [
"775d565bcffd8c090651cf200c401bb6b73460d7"
] | [
"tests/test_sql_extractions.py"
] | [
"import unittest\nimport pandas as pd\nfrom resource_access.connections import get_mysql_connection\nfrom resource_access.constants import ECE_DB_SECTION\nFT = 'FT'\nPT = 'PT'\nINFANT = 'Infant/Toddler'\nPRESCHOOL = 'Preschool'\nSCHOOL_AGE = 'School-age'\n\n\nclass TestSQLExtractionFromDummy(unittest.TestCase):\n\n... | [
[
"pandas.read_sql"
]
] |
Laban92/determined_stallman | [
"938c80f9628823070ee54eefeb83e172820bcf83"
] | [
"utils.py"
] | [
"#!/usr/bin/env python\nimport pandas as pd\nimport numpy as np\n\ndef Heart_rate(d):\n idx = d[d[\"Predicted_Breath\"]==1].index\n count=0\n for i in idx:\n if d.loc[(i-1):(i+1)][\"Predicted_Breath\"].sum()>= 2:\n count+=1\n return count/(d.tail(1)[\"Time [s]\"]/60)\n \ndef calorie... | [
[
"numpy.array"
]
] |
mage1k99/json-excel | [
"28d7d75a1b313cebd76dc5946fcf9fa8e5c2ebf0"
] | [
"conversion_modules/json_to_csv.py"
] | [
"import json\nfrom pandas.io.json import json_normalize\nimport pandas\n\nif __name__ == \"__main__\":\n inputjson = str(input(\"The JSON file path :\"))\n outputCsv = str(input(\"Output CSV file :\"))\n json_toCsv(inputjson,outputCsv)\n\ndef json_toCsv(input_Json_path,output_csv_path):\n #normalize the... | [
[
"pandas.io.json.json_normalize"
]
] |
JiungChoi/2021SleepModelWorkspace | [
"b54d9513db04b5091293cf96e06f95ff774b2a46"
] | [
"test.py"
] | [
"import facetracker_custom as fc\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras.models import load_model\n\njiung = \"jiung\"\nframeCnt = 0\nlandmarks = []\ntoMotionNum = 400\nfromMotionNum = 1\n\n\nmodel = load_model(\"output_02.h5\")\nmodel.summary() # model Info\n\nframeCnt = 0\nfor points i... | [
[
"tensorflow.keras.models.load_model"
]
] |
LBJ-Wade/C-Eagle-analysis | [
"d13ffb219834e11baeb5b9d863c6a6eb965ba6ad",
"d13ffb219834e11baeb5b9d863c6a6eb965ba6ad"
] | [
"obsolete/map_momentum_angular.py",
"Unittest/test_rotvel_alignment.py"
] | [
"import clusters_retriever as extract\nfrom visualisation import map_plot_parameters as plotpar\nimport cluster_profiler as profile\nfrom obsolete import map_synthetizer as mapgen\nimport kernel_convolver as kernconv\n# import cosmolopy !!! USELESS 50 YEARS OLD PACKAGE\n\nimport numpy as np\nimport astropy\nfrom as... | [
[
"numpy.array",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.subplots",
"numpy.where",
"matplotlib.patches.Circle",
"numpy.sqrt",
"numpy.power",
"matplotlib.pyplot.show",
"numpy.linspace"
],
[
"numpy.dot",
"numpy.linalg.norm",
... |
bbradt/catalyst | [
"38a503c8af040906e377b7485d7fe15a7bc1de19"
] | [
"catalyst/contrib/models/cv/segmentation/models/resnetunet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision import models\n\n\ndef get_channels(architecture):\n if architecture in [\"resnet18\", \"resnet34\"]:\n return [512, 256, 128, 64]\n elif architecture in [\"resnet50\", \"resnet101\", \"resnet152\"]:\n return... | [
[
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.functional.max_pool2d",
"torch.nn.functional.interpolate"
]
] |
locross93/dm_alchemy | [
"35449de51d56c427959ae6a3be13d6c6ab738be5",
"35449de51d56c427959ae6a3be13d6c6ab738be5"
] | [
"dm_alchemy/ideal_observer/ideal_observer.py",
"dm_alchemy/ideal_observer/precomputed_maps.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/LICE... | [
[
"numpy.where",
"numpy.zeros"
],
[
"numpy.frompyfunc",
"numpy.array",
"numpy.empty",
"numpy.zeros"
]
] |
zokin/ultrapose | [
"7c6f418956f3b5908f0d739800a3511d44433864",
"7c6f418956f3b5908f0d739800a3511d44433864"
] | [
"dataset/__init__.py",
"eval/detectron/core/config.py"
] | [
"import importlib\nimport torch.utils.data\nfrom dataset.base_dataset import BaseDataset\nfrom torch.utils.data.distributed import DistributedSampler\nimport utils.misc as misc\n\ndef find_dataset_using_name(dataset_name):\n dataset_filename = \"dataset.\" + dataset_name + \"_dataset\"\n datasetlib = importli... | [
[
"torch.utils.data.distributed.DistributedSampler"
],
[
"numpy.array",
"numpy.log"
]
] |
EmuKit/Emukit | [
"2df951e42c82400192220eb18af428f3eb764f6c",
"2df951e42c82400192220eb18af428f3eb764f6c"
] | [
"emukit/test_functions/forrester.py",
"tests/emukit/quadrature/test_measures.py"
] | [
"# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: Apache-2.0\n\n\nimport numpy as np\n\nfrom emukit.core import ContinuousParameter, InformationSourceParameter, ParameterSpace\nfrom emukit.core.loop.user_function import MultiSourceFunctionWrapper\n\n\ndef multi_f... | [
[
"numpy.random.normal",
"numpy.sin",
"numpy.random.randn",
"numpy.zeros"
],
[
"numpy.random.seed",
"numpy.ones",
"numpy.random.randn",
"numpy.arange",
"numpy.sqrt"
]
] |
alsrb0607/KoreanSTT | [
"5fad1e46c878750b3349aacc5bd16550a8031ff0"
] | [
"bin/kospeech/data/audio/core.py"
] | [
"# Copyright (c) 2020, Soohwan Kim. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"numpy.concatenate",
"numpy.lib.stride_tricks.as_strided",
"numpy.asarray",
"numpy.minimum",
"numpy.sum",
"numpy.asfortranarray",
"numpy.mean",
"numpy.prod",
"numpy.memmap",
"numpy.sqrt",
"numpy.abs",
"numpy.isfinite",
"numpy.issubdtype",
"numpy.asanyarray",... |
glimix/ndarray-listener | [
"370cdecc2191336cca5fd231babd5525134c6217"
] | [
"ndarray_listener/_ndl.py"
] | [
"import weakref\n\nimport numpy as np\n\n\nclass float64(np.float64):\n r\"\"\"\n\n Examples\n --------\n\n .. doctest::\n\n >>> from ndarray_listener import ndl, float64\n >>>\n >>> print(float64(1.5))\n 1.5\n >>> print(ndl(1.5))\n 1.5\n \"\"\"\n\n def __... | [
[
"numpy.isscalar",
"numpy.asarray",
"numpy.float64.__new__"
]
] |
brandon-b-miller/cudf | [
"5d2465d6738d00628673fffdc1fac51fad7ef9a7"
] | [
"python/cudf/cudf/tests/test_stats.py"
] | [
"# Copyright (c) 2018, NVIDIA CORPORATION.\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom cudf.core import Series\nfrom cudf.datasets import randomdata\n\nparams_dtypes = [np.int32, np.float32, np.float64]\nmethods = [\"min\", \"max\", \"sum\", \"mean\", \"var\", \"std\"]\n\ninterpolation_methods... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.random.seed",
"numpy.testing.assert_approx_equal",
"numpy.testing.assert_array_almost_equal",
"numpy.random.randint",
"numpy.arange",
"numpy.repeat",
"numpy.random.random",
"numpy.issubdtyp... |
vvkorz/marksim | [
"743aed6b3d956a4244f61b784f400281af550143"
] | [
"src/marksim/utils/utils.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"\nUtils\n-----\n\"\"\"\nimport numpy as np\n\n\nclass Utils:\n \"\"\"\n Utils is a collection of helper functions used in this package.\n \"\"\"\n\n @staticmethod\n def split_nan_array(array):\n \"\"\"\n Split numpy array in chunks usin... | [
[
"numpy.ma.masked_invalid",
"numpy.diff"
]
] |
sutkarsh/ttools | [
"a2e5fbf308566c0c54ab9d6ad1d9f8bc63f8fe99"
] | [
"ttools/modules/networks.py"
] | [
"\"\"\"Common used neural networks operations.\"\"\"\n\n# TODO(mgharbi): maybe add a norm layer at the output if we specify an\n# activation fn ?\n\nfrom collections import OrderedDict\n\nimport numpy as np\nimport torch as th\nfrom torch import nn\n\nfrom ..utils import get_logger\nfrom .image_operators import cro... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.init.constant_",
"torch.nn.Sigmoid",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.Sequential",
"torch.nn.init.xavier_uniform_",
"torch.nn.BatchNorm2d",
"torch.nn.functional.interpolate"... |
HhotateA/quiche_pantie_patch | [
"f50c4fd69bd43cccaeb38f026d486e3ccc3850d8",
"f50c4fd69bd43cccaeb38f026d486e3ccc3850d8"
] | [
"src/models/sakurana.py",
"src/models/lopolykon.py"
] | [
"from PIL import Image\nfrom src.models.cc0 import patcher\nimport numpy as np\nimport skimage.io as io\nfrom src.utils.imgproc import *\nfrom skimage.color import rgb2hsv, hsv2rgb\n\n\nclass patcher(patcher):\n def __init__(self, body='./body/body_sakurana.png', **options):\n try:\n options = ... | [
[
"numpy.array",
"numpy.copy",
"numpy.mean",
"numpy.float32",
"numpy.clip",
"numpy.dstack"
],
[
"numpy.array",
"numpy.linspace",
"numpy.zeros"
]
] |
bpiwowar/OpenNIR-xpm | [
"e937730f709da11707df04517c25945f18bb64cd"
] | [
"onir/random.py"
] | [
"from experimaestro import config, param\nfrom cached_property import cached_property\nimport numpy as np\n\n@param(\"seed\", default=0)\n@config()\nclass Random:\n @cached_property\n def state(self):\n return np.random.RandomState(self.seed)\n"
] | [
[
"numpy.random.RandomState"
]
] |
kevin-teddy/ProjectQ | [
"22828daca975cebed92f946ba2625f295cfa70e9"
] | [
"examples/ionq_half_adder.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2021 ProjectQ-Framework (www.projectq.ch)\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... | [
[
"matplotlib.pyplot.show"
]
] |
godlovesdavid/Impulcifer | [
"c217a505a492174612e39245a742bb01058cc0af"
] | [
"research/headphone-feedback-compensation/compare_headphone_compensation_methods.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom autoeq.frequency_response import FrequencyResponse\nsys.path.insert(1, os.path.realpath(os.path.join(sys.path[0], os.pardir)))\nfrom impulse_response_estimator import ImpulseResponseEstimator\nfrom hrir impo... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.zeros",
"numpy.min",
"numpy.logical_and",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
]
] |
cliveseldon/ngraph-onnx | [
"a2d20afdc7acd5064e4717612ad372d864d03d3d"
] | [
"tests_core/test_ops_convpool.py"
] | [
"# ******************************************************************************\n# Copyright 2018 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:... | [
[
"numpy.array",
"numpy.pad",
"numpy.array_equal",
"numpy.ones",
"numpy.random.randn",
"numpy.broadcast_to"
]
] |
Manas-Embold/gpt-neox | [
"51892e4142405bdc840c1683dc2e33a0a9f7d509"
] | [
"tasks/finetune_utils.py"
] | [
"# coding=utf-8\n# Copyright (c) 2021, EleutherAI contributors\n# This file is based on code by the authors denoted below and has been modified from its original version.\n#\n# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# yo... | [
[
"torch.nn.CrossEntropyLoss",
"torch.utils.data.distributed.DistributedSampler",
"torch.utils.data.DataLoader"
]
] |
Alexandr0s93/deep-reinforcement-learning | [
"02a508d25d2ba3c76c76a8410b3ae27f0d14e13f"
] | [
"p3_collab-compet/noise.py"
] | [
"import copy\nimport random\nimport numpy as np\n\nclass OUNoise:\n \"\"\"Ornstein-Uhlenbeck process.\"\"\"\n\n def __init__(self, size, seed, mu=0., theta=0.15, sigma=0.2):\n \"\"\"Initialize parameters and noise process.\"\"\"\n self.mu = mu * np.ones(size)\n self.theta = theta\n ... | [
[
"numpy.ones",
"numpy.random.randn"
]
] |
xcnkx/kaggle_titanic | [
"09f774b708ae5f7563d14e74ba121748833ff6cc"
] | [
"src/data/make_dataset.py"
] | [
"# -*- coding: utf-8 -*-\nimport subprocess\nimport feather\nimport pandas as pd\nimport os\nimport pathlib\n\nclass Dataset():\n\n def __init__(self, comp_name=None, d_path='./data/'):\n self._comp_name = comp_name\n self._d_path = pathlib.Path(d_path)\n\n def download_data(self):\n #Download datase... | [
[
"pandas.read_csv"
]
] |
MAGIC-nexus/nis-backend | [
"dd425925321134f66884f60b202a59b38b7786a0",
"fd86cf30f79f53cdccddd2a5479507d32f914d4e"
] | [
"nexinfosys/command_generators/parser_spreadsheet_utils.py",
"magic_box/source_eurostat_bulk.py"
] | [
"import numpy as np\nfrom copy import copy\nimport openpyxl\nfrom openpyxl.comments import Comment\nfrom openpyxl.styles import PatternFill\n\nfrom openpyxl.worksheet.worksheet import Worksheet\n#from openpyxl.worksheet import Worksheet\n\nfrom openpyxl.worksheet.copier import WorksheetCopy\n\nglobal_fill = Pattern... | [
[
"numpy.concatenate",
"numpy.zeros",
"numpy.sum",
"numpy.diff",
"numpy.where"
],
[
"pandas.read_csv",
"pandas.read_msgpack"
]
] |
Locust2520/path_explain | [
"45d1cd6690060c8c9a7b57f72bff3b7c66dbd815"
] | [
"examples/time_series/heartbeats/interpret.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\nfrom model import cnn_model\nfrom preprocess import mitbih_dataset\nfrom path_explain.path_explainer_tf import PathExplainerTF\nfrom path_explain.utils import set_up_environment\n\nfrom absl import app\nfrom absl import flags\n\nFLAGS = flags.FLAGS\nflags.DEFINE_integ... | [
[
"numpy.where",
"tensorflow.keras.models.load_model",
"numpy.argmax",
"numpy.logical_and"
]
] |
dorian1000/pm4py-mdl | [
"71e0c2425abb183da293a58d31e25e50137c774f"
] | [
"vbfa_mdl.py"
] | [
"import pandas as pd\nimport os\nimport networkx\nimport datetime\nfrom frozendict import frozendict\nfrom copy import deepcopy\nimport uuid\n\n\nclass Shared:\n vbeln = {}\n timestamp_column = \"event_timestamp\"\n activity_column = \"event_activity\"\n dir = r\"../sap_extraction\"\n tcodes = {}\n ... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.read_csv"
]
] |
diahnuri/TMSS | [
"3eaf3c94befc8b46d671b34f88b0e295d19d9f72"
] | [
"dlnn/listFunction2.py"
] | [
"##THIS IS THE CODE OF THE CREATE TAB\n\n#import library2 yg dibutuhkan\nimport os\nimport pickle\nimport numpy as np\nimport tensorflow as tf\nfrom nltk.tokenize import TweetTokenizer, word_tokenize\nfrom Sastrawi.Stemmer.StemmerFactory import StemmerFactory\nfrom sklearn.feature_extraction.text import CountVector... | [
[
"numpy.random.seed",
"tensorflow.Session",
"sklearn.feature_extraction.text.TfidfTransformer",
"sklearn.model_selection.train_test_split"
]
] |
lishuai1993/FairMOT | [
"b224d61a24038cc7dc38d186e48e25e89c5daa6c"
] | [
"src/lib/models/utils.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\n\ndef _sigmoid(x):\n y = torch.clamp(x.sigmoid_(), min=1e-4, max=1-1e-4)\n return y\n\ndef _gather_feat(feat, ind, mask=None):\n dim = feat.size(2) ... | [
[
"torch.flip"
]
] |
jinoobaek-qz/mesh | [
"d26470554e086ea02e64154194097fbf517232bd",
"d26470554e086ea02e64154194097fbf517232bd"
] | [
"examples/mnist.py",
"mesh_tensorflow/auto_mtf/graph_interface_test.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Mesh TensorFlow Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.compat.v1.logging.info",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.global_variables",
"tensorflow.compat.v1.train.get_global_step",
"tensorflow.compat.v1.identity",
"tensorflow.compat.v1.argmax",
"tensorflow.compat.v1.estimator.export.PredictOutput",... |
BFavier/pygmalion | [
"76391431e55fa1c28dc7a1822f2917bf8487b94b"
] | [
"samples/Traductor.py"
] | [
"import pygmalion as ml\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport pathlib\nimport IPython\n\npath = pathlib.Path(__file__).parent\ndata_path = path / \"data\"\n\n# Download the data\nml.datasets.sentence_pairs(data_path)\n\ndf = pd.read_csv(data_path / \"sentence_pairs.txt\", header=None,\n ... | [
[
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
zmy920423/bandit_portfolio_version | [
"ce92c8f491dfc9cd94caa0783c7c5d263c3358a3"
] | [
"bandit/modules/tcgp.py"
] | [
"import torch\nimport numpy as np\nfrom bandit.modules.module import Module\nfrom bandit.parameter import Parameter\nfrom bandit.containers.container import Container\nfrom collections import OrderedDict\nfrom copy import deepcopy\nimport cvxpy\n\nMAX_ITER = 100000\n\n\nclass TCGP(Module):\n \"\"\"\n OLU clas... | [
[
"torch.zeros",
"torch.norm",
"torch.ones",
"torch.tensor",
"numpy.sort",
"numpy.arange",
"numpy.cumsum",
"torch.dot"
]
] |
pauloalves86/tensortrade | [
"34463f922e4d160704cc197355f93fbcfea51886"
] | [
"tensortrade/environments/trading_environment.py"
] | [
"# Copyright 2019 The TensorTrade Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"numpy.concatenate",
"numpy.nan_to_num",
"pandas.DataFrame",
"numpy.tile",
"numpy.isfinite",
"pandas.concat"
]
] |
corl2019metaworld/metaworld | [
"46d54644915a7d80d3f4206e2e5abe1ccbdb5393"
] | [
"multiworld/envs/mujoco/sawyer_xyz/sawyer_door_6dof.py"
] | [
"from collections import OrderedDict\nimport numpy as np\nfrom gym.spaces import Dict , Box\n\n\nfrom multiworld.envs.env_util import get_stat_in_paths, \\\n create_stats_ordered_dict, get_asset_full_path\nfrom multiworld.core.multitask_env import MultitaskEnv\nfrom multiworld.envs.mujoco.sawyer_xyz.base import... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.exp",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.hstack"
]
] |
RitwickGhosh/retinaface-tf2 | [
"01ac9b4fe41dc11678034b4c5ffb14c51d52d809"
] | [
"modules/losses.py"
] | [
"import tensorflow as tf\n\n\ndef _smooth_l1_loss(y_true, y_pred):\n t = tf.abs(y_pred - y_true)\n return tf.where(t < 1, 0.5 * t ** 2, t - 0.5)\n\n\ndef MultiBoxLoss(num_class=2, neg_pos_ratio=3):\n \"\"\"multi-box loss\"\"\"\n def multi_box_loss(y_true, y_pred):\n num_batch = tf.shape(y_true)[0... | [
[
"tensorflow.abs",
"tensorflow.shape",
"tensorflow.where",
"tensorflow.argsort",
"tensorflow.equal",
"tensorflow.reshape",
"tensorflow.keras.losses.sparse_categorical_crossentropy",
"tensorflow.logical_or",
"tensorflow.maximum",
"tensorflow.reduce_mean",
"tensorflow.bool... |
materials-DFT/sitator | [
"6755a71ccd975425b0f9e9df27585b618be3433a"
] | [
"sitator/dynamics/MergeSitesByDynamics.py"
] | [
"import numpy as np\n\nfrom sitator.dynamics import JumpAnalysis\nfrom sitator.util import PBCCalculator\nfrom sitator.network.merging import MergeSites\nfrom sitator.util.mcl import markov_clustering\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass MergeSitesByDynamics(MergeSites):\n \"\"\"Mer... | [
[
"numpy.square",
"numpy.fill_diagonal",
"numpy.exp",
"numpy.where",
"numpy.nanmean",
"numpy.any",
"numpy.nanstd"
]
] |
krishpop/google-research | [
"3b5ac2325cb61920624859f7ac2faf2198e9c38d"
] | [
"safemrl/utils/misc.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Google Research 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 requ... | [
[
"numpy.concatenate",
"tensorflow.compat.v1.train.remove_checkpoint",
"numpy.pad",
"tensorflow.keras.layers.Lambda",
"scipy.signal.butter",
"tensorflow.train.get_checkpoint_state",
"matplotlib.pyplot.subplots",
"tensorflow.io.gfile.makedirs",
"tensorflow.io.gfile.exists",
"t... |
ayshrv/visitron | [
"2f30e6c002ed021d2be209a94a5e77c2d7e2117f"
] | [
"tasks/viewpoint_select/train_classifier.py"
] | [
"# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: MIT-0\n\nimport logging\nimport os\nimport sys\nimport time\nfrom collections import defaultdict\n\nimport numpy as np\nimport pandas as pd\nimport torch\nimport torch.distributed as dist\nfrom tensorboardX import Summ... | [
[
"torch.device",
"numpy.array",
"torch.utils.data.RandomSampler",
"torch.distributed.init_process_group",
"pandas.DataFrame",
"torch.utils.data.SequentialSampler",
"torch.nn.parallel.DistributedDataParallel",
"torch.cuda.device_count",
"torch.cuda.set_device",
"torch.cuda.is... |
corgiTrax/stable-baselines3 | [
"95dc5e30ab6a21225da4b718953e83870e4f146b"
] | [
"stable_baselines3/active_tamer/probe_tamer_optim.py"
] | [
"import sys\nimport time\nfrom typing import Any, Dict, List, Optional, Tuple, Type, Union\n\nimport gym\nimport numpy as np\nimport torch as th\nfrom torch.nn import functional as F\n\nfrom stable_baselines3.active_tamer.policies import SACPolicy\nfrom stable_baselines3.common.buffers import ReplayBuffer\nfrom sta... | [
[
"torch.cat",
"torch.min",
"torch.no_grad",
"numpy.mean",
"torch.ones",
"torch.nn.functional.mse_loss",
"torch.from_numpy",
"numpy.prod"
]
] |
salilsdesai/text | [
"25e8d002522e6ee781ac6a79f99a5583e775ae0b"
] | [
"test/data/test_builtin_datasets.py"
] | [
"#!/user/bin/env python3\n# Note that all the tests in this module require dataset (either network access or cached)\nimport torch\nimport torchtext\nimport json\nimport hashlib\nfrom parameterized import parameterized\nfrom ..common.torchtext_test_case import TorchtextTestCase\nfrom ..common.parameterized_utils im... | [
[
"torch.tensor"
]
] |
TJU-DRL-LAB/ai-optimizer | [
"f558cc524c66460913989519779873b371bf78bc"
] | [
"multiagent-rl/easy-marl/envs/continuous_mpe/multiagent/scenarios/simple_world_comm.py"
] | [
"import numpy as np\nfrom envs.continuous_mpe.multiagent import World, Agent, Landmark\nfrom envs.continuous_mpe.multiagent import BaseScenario\n\n\nclass Scenario(BaseScenario):\n def make_world(self):\n world = World()\n # set any world properties first\n world.dim_c = 4\n #world.da... | [
[
"numpy.concatenate",
"numpy.square",
"numpy.array",
"numpy.zeros",
"numpy.exp",
"numpy.random.uniform"
]
] |
moojink/metaworld | [
"60c7d9c3876b68f719949a25e600aae3dcf66ede"
] | [
"metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_faucet_close_v2.py"
] | [
"import numpy as np\nfrom gym.spaces import Box\n\nfrom metaworld.envs import reward_utils\nfrom metaworld.envs.asset_path_utils import full_v2_path_for\nfrom metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set\n\n\nclass SawyerFaucetCloseEnvV2(SawyerXYZEnv):\n def __init__(s... | [
[
"numpy.random.seed",
"numpy.array",
"numpy.linalg.norm"
]
] |
msaidzengin/KontroleDegerMi | [
"a14799e1076e018872d09e449c991ce3548a56cd"
] | [
"py-work/Dirichlet/iterative_detection.py"
] | [
"#coding=utf-8\n\nfrom nltk.corpus import stopwords\nfrom nltk.tokenize import word_tokenize\nimport nltk\nimport re\n\nimport sys\nimport time\nfrom gensim.models.ldamulticore import LdaMulticore\n\nfrom gensim.models.coherencemodel import CoherenceModel\nfrom gensim.corpora.dictionary import Dictionary\nfrom gens... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel"
]
] |
trungnt13/dnntoolkit | [
"55864432ec3cc4afcf3822a8aee3bebe149ab4ae"
] | [
"stclearn.py"
] | [
"\"\"\"\nImplementation of accelerated stochastic learning (weight updates after every training example).\nThis version still very slow compare to batch learning, however, it is 2 times faster than the\nnormal way of feeding data one-by-one in batch\n\nExamples\n--------\n>>> import lasagne\n>>> import theano.tenso... | [
[
"numpy.ones",
"numpy.arange",
"numpy.zeros"
]
] |
wwang107/master-thesis | [
"a386613a3351f1c7aeeb8877c8d8586c5bc3e314"
] | [
"src/models/epipolar/EpipolarTransformer.py"
] | [
"import torch\nimport cv2\nfrom torch import nn\nimport torch.nn.functional as F\nimport matplotlib.pyplot as plt\nfrom torch.serialization import save\n\nfrom core import cfg\nfrom utils.multiview import normalize, findFundamentalMat, de_normalize, coord2pix \nfrom utils.vis.vis import save_batch_maps\n\nvisualize... | [
[
"torch.stack",
"torch.arange",
"torch.no_grad",
"torch.nn.Threshold",
"torch.sign",
"matplotlib.pyplot.figure",
"torch.unsqueeze",
"torch.range",
"torch.abs",
"torch.nn.functional.grid_sample",
"torch.tensor",
"matplotlib.pyplot.show",
"torch.ones_like",
"to... |
AIS-Bonn/lattice_net | [
"4b0a0915cd7e5f382b5fbf8e9d4e813ecf3d3c23"
] | [
"latticenet_py/lattice/lattice_modules.py"
] | [
"import torch\nfrom torch.autograd import Function\nfrom torch import Tensor\nfrom torch.nn import functional as F\n\nimport sys\nfrom latticenet import HashTable\nfrom latticenet import Lattice\nimport numpy as np\nimport time\nimport math\nimport torch_scatter\n# from latticenet_py.lattice.lattice_py import Lat... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.LeakyReLU",
"torch.nn.init.kaiming_normal_",
"torch.ones",
"torch.cuda.FloatTensor",
"torch.exp",
"torch.nn.functional.gelu",
"torch.index_fill",
"torch.tensor",
"torch.nn.init.calculate_gain",
"to... |
k-ship/bilby | [
"916d5c4ee4cdb102f1408bd20bc25fa250ab92f0"
] | [
"test/proposal_test.py"
] | [
"import unittest\nimport mock\nimport random\n\nimport numpy as np\n\nimport bilby.gw.sampler.proposal\nfrom bilby.core import prior\nfrom bilby.core.sampler import proposal\n\n\nclass TestSample(unittest.TestCase):\n\n def setUp(self):\n self.sample = proposal.Sample(dict(a=1, c=2))\n\n def tearDown(s... | [
[
"numpy.log",
"numpy.array",
"numpy.sqrt"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.