repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
icanswim/cosmosis | [
"fe8bbd713d44dc03b47321526c2b16c859fcc3e6"
] | [
"learning.py"
] | [
"from datetime import datetime\nimport logging\nimport random\nimport os\n\nos.environ['NUMEXPR_MAX_THREADS'] = '16'\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom torch import no_grad, save, load, from_numpy, as_tensor, squeeze\nfrom torch.utils.data import Sampler, DataLoader\... | [
[
"numpy.concatenate",
"torch.utils.data.Sampler",
"numpy.reshape",
"numpy.asarray",
"pandas.DataFrame",
"torch.no_grad",
"numpy.exp",
"torch.from_numpy",
"torch.squeeze",
"numpy.apply_along_axis",
"torch.load",
"torch.as_tensor",
"matplotlib.pyplot.show",
"pa... |
gfwilliams/tensorflow | [
"c7f3bb27278a2392b55cde6e3bd6714556511f9d"
] | [
"tensorflow/python/keras/engine/base_layer.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.python.ops.array_ops.identity",
"tensorflow.python.training.tracking.layer_utils.has_weights",
"tensorflow.python.training.tracking.layer_utils.cache_recursive_attribute",
"tensorflow.python.keras.engine.input_spec.assert_input_compatibility",
"tensorflow.python.keras.engine.node.N... |
thu-coai/PPT | [
"0c1de17c8e7bb0dd071f102cb4236b16ab7c0e1a"
] | [
"data_utils/pretrain/IndexDataset.py"
] | [
"from functools import lru_cache\nimport os\nimport mpu\nimport shutil\nimport struct\nfrom itertools import accumulate\n\nimport numpy as np\nimport torch\nfrom utils import print_rank_0\nimport time\n\ndef __best_fitting_dtype(vocab_size=None):\n if vocab_size is not None and vocab_size < 65500:\n retur... | [
[
"numpy.array",
"numpy.copyto",
"numpy.empty",
"numpy.random.RandomState",
"torch.cuda.LongTensor",
"numpy.load",
"numpy.save",
"numpy.split",
"numpy.memmap",
"numpy.frombuffer",
"torch.distributed.get_rank",
"numpy.dtype"
]
] |
sujitmandal/Neural-Network | [
"3111d38c0ddd508d28151a21ee4ba018db198ec4"
] | [
"Neural Network/KNeighborsClassifier/diabetes.py"
] | [
"# Import required libraries\nimport sklearn\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.metrics import classification_report\nfro... | [
[
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.plot_confusion_matrix",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.classification_report",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.show",
"pandas.read_csv"
... |
VaniW/deconfounded-lexicon-induction | [
"419ecf717f51cfd1741732ca3191b36b565bd1a4"
] | [
"causal_attribution/__init__.py"
] | [
"\"\"\"\nThis package has two interfaces:\n\n(1) score_vocab(): Given text (T), vocab (V), outcome(s) Y, and \n confound(s) (C), this method will score each element of the\n vocab according to how well it explains each Y, controlling \n for all of the C's.\n\n(2) evaluate_vocab(): Measure's the strength of... | [
[
"numpy.concatenate",
"sklearn.linear_model.Ridge",
"sklearn.linear_model.LogisticRegression",
"pandas.read_csv",
"sklearn.model_selection.cross_val_score"
]
] |
gribera/rpi-sorting-machine | [
"a073195dcc18e76b902eaa0cd07dc090dc3f1652"
] | [
"tracker.py"
] | [
"import numpy as np\nfrom collections import OrderedDict\nfrom scipy.spatial import distance as dist\nfrom trackable_object import TrackableObject\n\nclass Tracker:\n\tdef __init__(self, maxDisappeared=1, maxDistance=50):\n\t\t\"\"\"\n\t\t\tConstructor.\n\n\t\t\tmaxDisappeared: int, Tiempo de desaparición del objet... | [
[
"numpy.array"
]
] |
thirtyonelee/image-retrieval | [
"ffa955bb43b7e39d80228ff64cc4b3a99f8b570a"
] | [
"service/numpy_retrieval.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os\nimport h5py\nimport numpy as np\n\nTHRESHOLD = float(os.environ.get('THRESHOLD', '0.85')) # 检索阈值\n\n\nclass NumpyRetrieval(object):\n def __init__(self, index_dir, emb_size=512):\n self.emb_size = emb_size\n self.load(index_dir)\n\n def load(self, index_di... | [
[
"numpy.dot",
"numpy.argsort"
]
] |
NeurIPSPaperSubmission7934/code_submission | [
"713fce673e8e3ba30b559d4eebe6d3e4891069ed"
] | [
"experiments/eval_model.py"
] | [
"# Copyright (c) 2018 Copyright holder of the paper Generative Adversarial Model Learning\n# submitted to NeurIPS 2019 for review\n# All rights reserved.\n\nimport joblib\nimport torch\nfrom rllab.torch.metrics.eval_metrics import TrajSampler, calc_avg_displacement_timesteps, calc_leaving_boundaries_rate, calc_succ... | [
[
"numpy.sin",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"numpy.ones",
"matplotlib.pyplot.close",
"numpy.mean",
"numpy.arange",
"numpy.cos",
"pandas.concat",
"torch.load",
"pandas.read_csv"
]
] |
fagaiera/python-machine-learning-book-3rd-edition-examples | [
"16c7eb01fc670a3845847d0e2ac3569c3fd61c35"
] | [
"Chapter 03/06 K-nearest neighbors - a lazy learn algorithm/plotter.py"
] | [
"from matplotlib.colors import ListedColormap\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef plot_decision_regions(X, y, classifier, test_idx=None, resolution=0.02):\n\n # setup marker generator and color map\n markers = ('s', 'x', 'o', '^', 'v')\n colors = ('red', 'blue', 'lightgreen', 'gray'... | [
[
"matplotlib.pyplot.scatter",
"numpy.arange",
"matplotlib.pyplot.contourf",
"numpy.unique"
]
] |
drgmk/dd | [
"3e06f53b23f8d5e6ae485ffdf2929cd33fbb333f"
] | [
"dd/imaging.py"
] | [
"import numpy as np\n\ndef gauss_2d(x_off, y_off, peak, sig_maj, sig_min, pa, size, norm=False):\n '''Return a 2d Gaussian.\n \n Parameters\n ----------\n x_off : float\n X pixel offset from center.\n y_off : float\n Y pixel offset from center.\n peak : float\n Peak value.\... | [
[
"numpy.deg2rad",
"numpy.sum",
"numpy.arange",
"numpy.exp"
]
] |
andyk/homework | [
"6f31240e7b16bb94992a87fc764839591bd034af"
] | [
"hw1/hollygrimm_behavior_cloner.py"
] | [
"# Copying Holly Grimm's solution https://github.com/hollygrimm/cs294-homework/blob/master/hw1/bc.py\n# Copy and pasting and merging it into a copy of my behavior_cloner.py code.\n\nimport argparse\nimport pickle\nimport os\nimport sys\nimport tensorflow.compat.v1 as tf\nimport numpy as np\nfrom sklearn.model_selec... | [
[
"tensorflow.compat.v1.summary.FileWriter",
"tensorflow.compat.v1.global_variables_initializer",
"numpy.random.permutation",
"numpy.mean",
"tensorflow.compat.v1.Session",
"numpy.std",
"tensorflow.compat.v1.reset_default_graph",
"numpy.stack",
"sklearn.model_selection.train_test_... |
Sina-Mehdiz/PyDy | [
"88fd663b65dbf1b2d740c0ee99d4771a5e6c78c7"
] | [
"pydy/tests/test_system.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nfrom numpy import testing\nimport sympy as sm\nfrom sympy.physics.mechanics import dynamicsymbols\nfrom scipy.integrate import odeint\n\nfrom ..system import System\nfrom ..models import multi_mass_spring_damper, n_link_pendulum_on_cart\nfrom ..utils import sympy_equal_... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.ones",
"numpy.linspace",
"numpy.testing.assert_raises"
]
] |
HillaPeter/FinalProject | [
"f42849483a2e898a3198bb539c22bbfdf4308cc9"
] | [
"ClusterFiles/RetrainModels.py"
] | [
"import pandas as pd\nimport numpy as np\nimport os\nimport math\nimport timeit\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom random import seed\nfrom random import randint\nfrom collections import Counter\nfrom imblearn.under_sampling import RandomUnderSampler\nfrom sklearn.model_selection import t... | [
[
"numpy.trace",
"numpy.asarray",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"numpy.sum",
"matplotlib.pyplot.figure",
"scipy.stats.randint",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"pandas.read_csv",
"sklearn.metrics.f1_sc... |
ZombaSY/minimalRL | [
"be08d993c699a11603328db92c569f12f92de17a"
] | [
"ppo-comet.py"
] | [
"import gym\nfrom comet_ml import Experiment\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom utils.log import Log\nfrom torch.distributions import Categorical\nfrom utils.utils import save_model\nimport random\nimport argparse\n\n\nparser = argparse.ArgumentP... | [
[
"torch.nn.Linear",
"torch.device",
"torch.distributions.Categorical",
"torch.min",
"torch.clamp",
"torch.from_numpy",
"torch.tensor",
"torch.nn.functional.softmax",
"torch.log"
]
] |
omerdr/ensemble-regression-python | [
"815b919d66e1192646186143b7358a355638facd"
] | [
"construct_ensemble.py"
] | [
"from __future__ import print_function\n\nimport sys\nimport time\nimport errno\nimport traceback\nfrom os import path\nfrom threading import Lock\n\nimport numpy as np\nimport pandas as pd\nimport scipy.io as sio\nfrom concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor, as_completed\nfrom dummy_pool... | [
[
"numpy.max",
"pandas.DataFrame",
"numpy.mean",
"sklearn.preprocessing.scale",
"numpy.arange",
"pandas.concat",
"sklearn.model_selection.train_test_split",
"numpy.var"
]
] |
winnerineast/Synonyms | [
"6633d861089427a5f0668ebe330aaf1364e8002d"
] | [
"synonyms/synonyms.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#=========================================================================\n#\n# Copyright (c) 2017 <> All Rights Reserved\n#\n#\n# File: /Users/hain/ai/Synonyms/synonyms/__init__.py\n# Author: Hai Liang Wang\n# Date: 2017-09-27\n#\n#=================================... | [
[
"numpy.average",
"numpy.sum"
]
] |
ingwinlu/pandas | [
"89632189cc2f7d1c9bfcbe42342238092e0426c1"
] | [
"pandas/io/formats/csvs.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nModule for formatting output data into CSV files.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport warnings\n\nimport csv as csvlib\nfrom zipfile import ZipFile\n\nimport numpy as np\n\nfrom pandas._libs import writers as libwriters\n\nfrom pandas import compat\nfrom pand... | [
[
"pandas.compat.StringIO",
"pandas.core.dtypes.missing.notna",
"pandas.compat.zip",
"pandas.io.common._get_handle",
"pandas.io.common._infer_compression",
"pandas._libs.writers.write_csv_rows",
"pandas.compat.range",
"pandas.io.common.UnicodeWriter",
"pandas.io.common.get_filepa... |
vensentzhou/QUANTAXIS | [
"51333dedea6b91532dc16a0e1d9f300c8f18f225"
] | [
"QUANTAXIS/QAFetch/QAQuery_Async.py"
] | [
"# coding:utf-8\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016-2021 yutiansut/QUANTAXIS\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including withou... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"numpy.asarray"
]
] |
QData/super_sac | [
"f44f0ab88bc462da0cee354b406822db7084f430"
] | [
"super_sac/popart.py"
] | [
"import math\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\n\n\nclass PopArtLayer(nn.Module):\n def __init__(self, beta=1e-4, min_steps=1000, init_nu=0):\n super().__init__()\n self.mu = torch.zeros(1)\n # high initialization said to increase stability (PopArt pg 13)... | [
[
"torch.zeros",
"torch.sqrt",
"torch.ones"
]
] |
firefly-cpp/simframe | [
"63475e1cf41fcd6baa9c27fb1451c47a87d77ac7"
] | [
"tests/io/test_namespacewriter.py"
] | [
"# Tests for the namespace writer\n\n\nimport numpy as np\nimport pytest\nfrom simframe import Frame\nfrom simframe import Instruction\nfrom simframe import Integrator\nfrom simframe import schemes\nfrom simframe import writers\n\n\ndef test_namespacewriter_attributes():\n writer = writers.namespacewriter()\n ... | [
[
"numpy.all"
]
] |
MaksadAnnamuradov/DataGurus | [
"864fa1c1b36b3c305bf9a4978d8bdc4b8e9b2a2f"
] | [
"experiments/fu_package.py"
] | [
"from pathlib import Path\nimport uuid\n\nimport dash_uploader as du\nimport dash\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output, State\n\nfrom flask import Flask, flash, request\nimport pandas as pd\nfrom werkzeug.utils import secure_filename\n\napp = dash.Dash(__name__)\n\nUPLOA... | [
[
"pandas.read_csv"
]
] |
SkyfengBiuBiu/tiny-faces-pytorch | [
"98fea5246b80c9c57a65ba8dee68cc8296a2c940"
] | [
"models/model.py"
] | [
"import numpy as np\nimport torch\nfrom torch import nn\nfrom torchvision.models import resnet50, resnet101\n\n\nclass DetectionModel(nn.Module):\n \"\"\"\n Hybrid Model from Tiny Faces paper\n \"\"\"\n\n def __init__(self, base_model=resnet50, num_templates=1, num_objects=1):\n super().__init__(... | [
[
"numpy.zeros",
"torch.nn.ConvTranspose2d",
"numpy.ones",
"torch.nn.Conv2d",
"numpy.arange",
"numpy.abs",
"torch.Tensor",
"numpy.floor"
]
] |
mesakh123/carla-client | [
"a4b0e74d6741ad77a46725dc65cc0c3f69497941"
] | [
"clientlib/label_utils.py"
] | [
"import numpy as np\n\nclass _baseLabel(object):\n def __init__(self, x=0, y=0, z=0, h=0, w=0, l=0, ry=0):\n self.x = x\n self.y = y\n self.z = z\n self.h = h\n self.w = w\n self.l = l\n self.ry = ry\n\n def get_location(self):\n return np.array([self.x,... | [
[
"numpy.array"
]
] |
hysts/pytorch_mpiigaze | [
"34d7d2fd9102688bc7a523a6f1d9542f8b934aa8"
] | [
"demo.py"
] | [
"#!/usr/bin/env python\n\nimport datetime\nimport logging\nimport pathlib\nfrom typing import Optional\n\nimport cv2\nimport numpy as np\nimport yacs.config\n\nfrom gaze_estimation import GazeEstimationMethod, GazeEstimator\nfrom gaze_estimation.gaze_estimator.common import (Face, FacePartsName,\n ... | [
[
"numpy.hstack"
]
] |
rheehot/nlp_implementation | [
"4bf7e8fab765b43080491e4c43f477c1ec93a489"
] | [
"Very_Deep_Convolutional_Networks_for_Text_Classification/model/metric.py"
] | [
"import torch\nfrom tqdm import tqdm\n\n\ndef evaluate(model, data_loader, metrics, device):\n if model.training:\n model.eval()\n\n summary = {metric: 0 for metric in metrics}\n\n for step, mb in tqdm(enumerate(data_loader), desc='steps', total=len(data_loader)):\n x_mb, y_mb = map(lambda el... | [
[
"torch.no_grad"
]
] |
AmintorDusko/pennylane-lightning | [
"9554a95842de9d7759ce96bfa75857e0c9ca756b"
] | [
"tests/conftest.py"
] | [
"# Copyright 2020 Xanadu Quantum Technologies 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 applica... | [
[
"numpy.array",
"numpy.sqrt"
]
] |
ahirsharan/napari-mm3 | [
"13b5eb6b33bd13d535c31b67c1d43a033d3e15c0"
] | [
"src/napari_mm3/_function.py"
] | [
"from __future__ import print_function, division\nimport copy\nimport datetime\nimport glob\nimport h5py\nimport json\nimport os\nimport multiprocessing\nfrom multiprocessing import Pool\nimport matplotlib as mpl\nfont = {'family' : 'sans-serif',\n 'weight' : 'normal',\n 'size' : 12}\nmpl.rc('font',... | [
[
"numpy.ones_like",
"numpy.float16",
"numpy.rollaxis",
"tensorflow.keras.losses.categorical_crossentropy",
"numpy.copy",
"numpy.exp",
"tensorflow.reshape",
"numpy.mean",
"numpy.where",
"numpy.nanmean",
"matplotlib.patches.Ellipse",
"matplotlib.pyplot.draw",
"nump... |
namankhetan/e2cnn | [
"2c0567977087299be663db9bc8c0f2a1331dbe7c"
] | [
"examples/VGG_E2CNN.py"
] | [
"from typing import List, Tuple, Any, Union\r\n\r\nimport math\r\nimport numpy as np\r\nimport torch\r\nfrom torch.nn import AdaptiveAvgPool2d\r\nimport torch.nn.functional as F\r\n\r\nfrom e2cnn import gspaces\r\nfrom e2cnn import nn\r\nfrom e2cnn.nn import init\r\nfrom e2cnn.nn import GeometricTensor\r\nfrom e2cn... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.BatchNorm1d",
"torch.nn.AdaptiveAvgPool2d",
"torch.allclose",
"torch.randn",
"torch.nn.ELU"
]
] |
Mu-L/PaddleSpeech | [
"0fa3fdb9ee89ca399b0f63ef2117c6370dc1f33d"
] | [
"tests/unit/audio/features/test_stft.py"
] | [
"# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.testing.assert_array_almost_equal"
]
] |
helenalee1994/skip-thoughts | [
"0635014ae9681c78b440aa896a63c74b61545f49"
] | [
"model.py"
] | [
"\"\"\"\nThis file implements the Skip-Thought architecture.\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom skip_thoughts.config import *\n\n\nclass Encoder(nn.Module):\n thought_size = 1200\n word_size = 620\n\n @staticmethod\n def reverse_variable(var):\n ... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LSTM",
"torch.autograd.Variable",
"torch.LongTensor",
"torch.nn.Embedding"
]
] |
TalhaAsmal/pandas_talib | [
"449f7a05c235af7853d74d6fccc297ce747492a1"
] | [
"pandas_talib/__init__.py"
] | [
"'''\r\nCreated on April 15, 2012\r\nLast update on July 18, 2015\r\n\r\n@author: Bruno Franca\r\n@author: Peter Bakker\r\n@author: Femto Trader\r\n'''\r\nimport pandas as pd\r\n\r\n\r\nclass Columns(object):\r\n OPEN='Open'\r\n HIGH='High'\r\n LOW='Low'\r\n CLOSE='Close'\r\n VOLUME='Volume'\r\n\r\n#... | [
[
"pandas.rolling_mean",
"pandas.rolling_std",
"pandas.DataFrame",
"pandas.rolling_sum",
"pandas.ewma",
"pandas.concat",
"pandas.Series"
]
] |
tomasstolker/SPECIES | [
"f74483a334f36cbeafeaf372446ae1ea9f278d95"
] | [
"tests/test_read/test_calibration.py"
] | [
"import os\nimport shutil\n\nimport pytest\nimport numpy as np\n\nimport species\nfrom species.util import test_util\n\n\nclass TestCalibration:\n def setup_class(self):\n self.limit = 1e-8\n self.test_path = os.path.dirname(__file__) + \"/\"\n self.model_param = {\"scaling\": 1.0}\n\n de... | [
[
"numpy.sum",
"numpy.linspace"
]
] |
pwcz/cascada-notifier | [
"07b6f63f5f20cc9f823097feec51ff32983f3c5c"
] | [
"main.py"
] | [
"__author__ = \"pwcz\"\nimport bs4\nfrom urllib.request import Request, urlopen\nimport re\nimport json\nimport signal\nimport sys\nimport base64\nfrom time import sleep\nimport numpy as np\nimport datetime\nfrom collections import defaultdict\nimport logging as logger\nfrom telegram_sender import TelegramSender\nl... | [
[
"numpy.where",
"numpy.arange"
]
] |
YouYueHuang/test_on_AWS_EC2 | [
"ec3e8a336bb983bc6dd12c1bb8369ded6e62dc5c"
] | [
"P3-Behavioral-Cloning/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\n\nimport utils\n\nsio = socketio.Serv... | [
[
"numpy.array",
"numpy.asarray"
]
] |
inwwin/cddm | [
"a395c19471ba680c991219a6f51f7327b89139bd"
] | [
"examples/paper/two_component/random_video.py"
] | [
"\"\"\"Random triggering single camera video\n\"\"\"\nfrom cddm.core import auto_count\nfrom cddm.sim import simple_brownian_video, create_random_time, adc\nfrom cddm.viewer import VideoViewer \nfrom cddm.video import crop, multiply\nfrom examples.paper.one_component.conf import NFRAMES_RANDOM, SIMSHAPE, BACKGROUND... | [
[
"numpy.all",
"matplotlib.pyplot.imread"
]
] |
RaphaelOlivier/pyaudlib | [
"6c9321550e3e1a74081699a8d0770f986647206c"
] | [
"tests/sig/test_stproc.py"
] | [
"\"\"\"Test suite for short-time processing.\"\"\"\nimport numpy as np\n\nfrom audlib.sig.window import hamming\nfrom audlib.sig.stproc import stana, ola\n\n\ndef test_stproc():\n \"\"\"Test the stana-ola framework.\"\"\"\n sr = 16000\n sig = np.ones(10000)\n hop = .5\n wind = hamming(512, hop=hop, s... | [
[
"numpy.ones"
]
] |
iedmrc/monte-carlo-vrp | [
"e7fa4f8454ba2fc8bde9dfdb5fabf0cf70484f12"
] | [
"vrp.py"
] | [
"from pprint import pprint\nimport time as tm\nimport gmpy2\nimport json\nimport requests\nimport sys\nimport itertools\nimport random\nimport numpy as np\nimport argparse\n\nparser = argparse.ArgumentParser()\n\nparser.add_argument(\"-i\", \"--input\", type=str, default=\"input_thu.json\",\n help=\"Input fi... | [
[
"numpy.random.normal"
]
] |
PabRod/pendulum | [
"957409d44f6d0bbf31adad1b6778c3fcd8c0fdf3"
] | [
"scripts/animation_nipendulum.py"
] | [
"## Import the required modules\nfrom pendulum.models import *\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\n## Set-up your problem\ng = 9.8 # Acceleration of gravity\nl = 1 # Pendulum length\nd = 1 # Damping\n\n# Pivot's position\n## The pivot is moving, so its position is a functio... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
wentaozhu/speechnas | [
"2a3b97860157c16992e863e16af9ca64b898e4d0"
] | [
"dataloader/utils/prefetcher.py"
] | [
"from __future__ import print_function, division\n\nimport torch\n\n\"\"\"\nthis code is modified from\nhttps://github.com/rwightman/pytorch-image-models/blob/master/timm/data/loader.py#L46\n\"\"\"\n\n\nclass DataPrefetcher():\n def __init__(self, loader):\n self.loader = loader\n\n def __iter__(self):... | [
[
"torch.cuda.current_stream",
"torch.cuda.Stream",
"torch.cuda.stream"
]
] |
rongfang323/policy-data-analyzer | [
"73a03089753a26fe5e7031c5c68ba887428246a9",
"73a03089753a26fe5e7031c5c68ba887428246a9"
] | [
"tasks/src/visualization/pr_curve.py",
"tasks/data_loader/src/utils.py"
] | [
"import pandas as pd\nimport plotly.express as px\nfrom sklearn.metrics import precision_recall_curve, auc\n\npredictions_file = \"models/highlighter/sbert2.csv\"\n\nif __name__ == \"__main__\":\n # Load predictions and calculate Precision-Recall curve\n predictions = pd.read_csv(predictions_file)\n precis... | [
[
"sklearn.metrics.auc",
"pandas.read_csv",
"sklearn.metrics.precision_recall_curve"
],
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks"
]
] |
danyan1/GAT | [
"486c242688cc0c330cda9508d91cc1f05f2c87df"
] | [
"execute_cora.py"
] | [
"import time\nimport numpy as np\nimport tensorflow as tf\n\nfrom models import GAT\nfrom utils import process\n\ncheckpt_file = 'pre_trained/cora/mod_cora.ckpt'\n\ndataset = 'cora'\n\n# training params\nbatch_size = 1\nnb_epochs = 100000\npatience = 100\nlr = 0.005 # learning rate\nl2_coef = 0.0005 # weight deca... | [
[
"numpy.max",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.min",
"tensorflow.reshape",
"tensorflow.placeholder",
"tensorflow.name_scope",
"tensorflow.local_variables_initializer",
"tensorflow.global_variables_initializer"
]
] |
aaditis/egem | [
"89b4cbd8c623dc1826d65b55bb92527e68ebbcce"
] | [
"srv/python/EDA/eda.py"
] | [
"\"\"\"\neda.py is a Python script to make fast static plots that quickly visualizes data sets.\n@author: Scott Campit\n\"\"\"\n\nimport pandas as pd\nimport scipy\nimport numpy as np\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n# File paths\ngcpFile = '~/Data/Expression/Proteomics/GCP/MappedGCP_sub... | [
[
"matplotlib.pyplot.show",
"pandas.read_excel"
]
] |
btalamini/optimism | [
"023e1b2a0b137900a7517e4c7ac5056255cf7bbe"
] | [
"examples/hemisphere_cap/plot_force_displacement.py"
] | [
"from matplotlib import pyplot as plt\nimport numpy as np\n\nforceControlData = np.load('force_control_response.npz')\n\nF = forceControlData['force']\nU = forceControlData['displacement']\nplt.plot(U, F, marker='o')\nplt.xlabel('Displacement')\nplt.ylabel('Force')\n\nplotComparison = True\nif plotComparison:\n ... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.load",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
awwong1/topic-traceability | [
"60d6fd8b52855d1e5faeaec3c160f2541e3ec0ca"
] | [
"sample_and_plot_results.py"
] | [
"#!/usr/bin/env python3\nimport os\nimport pickle\nimport json\nimport random\nimport seaborn as sns\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport statistics\n\nDIR_PATH = os.path.dirname(os.path.realpath(__file__))\n\nCOURSE_NAME_STUBS = {\n \"agile-planning-for-software-products\": \"Agile Plan... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
atcemgil/notes | [
"380d310a87767d9b1fe88229588dfe00a61d2353"
] | [
"notes_utilities.py"
] | [
"## Contains utilities\n\nimport numpy as np\n\n\n# Utilities for discrete distributions\n\ndef randgen(pr, N=1): \n L = len(pr)\n return int(np.random.choice(range(L), size=N, replace=True, p=pr))\n\ndef log_sum_exp(l, axis=0):\n l_star = np.max(l, axis=axis, keepdims=True)\n return l_star + np.log(np.... | [
[
"numpy.max",
"numpy.sin",
"numpy.array",
"numpy.dot",
"numpy.sum",
"numpy.exp",
"numpy.eye",
"matplotlib.pylab.Line2D",
"numpy.where",
"numpy.arange",
"numpy.cos",
"numpy.abs"
]
] |
laggui/pytorch-cpp | [
"500c5112722daa7af9e6eddad19fc6ca25337f4c"
] | [
"pytorch/to_torch_script.py"
] | [
"import torch\nimport argparse\n\nfrom torch.jit import trace\n\nfrom vgg import VGGNet\nfrom utils import try_load\n\n# Check device \ndevice = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')\nprint('[Device] {}'.format(device))\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(... | [
[
"torch.rand",
"torch.cuda.is_available",
"torch.jit.trace"
]
] |
hn1201/ga-learner-dsmp-repo | [
"c42656551e930d13df98f6631bb63fe179035ed8"
] | [
"MatPlotLib/code.py"
] | [
"# --------------\n#Importing header files\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\ndata = pd.read_csv(path, sep=',', delimiter=None)\r\n\r\n#Code starts here\r\nloan_status = data['Loan_Status'].value_counts()\r\nloan_status.plot(kind=\"bar\", stacked=True, figsize=(8,... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.ylabel",
"pandas.read_csv",
"matplotlib.pyplot.xticks"
]
] |
sukhsung/tomviz | [
"b5ab44440be94476093206672e527c54098b58c7"
] | [
"tomviz/python/GaussianFilterTiltSeries.py"
] | [
"def transform_scalars(dataset, sigma=2.0):\n \"\"\"Apply a Gaussian filter to tilt images.\"\"\"\n \"\"\"Gaussian Filter blurs the image and reduces the noise and details.\"\"\"\n\n from tomviz import utils\n import scipy.ndimage\n import numpy as np\n\n tiltSeries = utils.get_array(dataset)\n\n ... | [
[
"numpy.empty_like"
]
] |
xiaojiew1/surprise | [
"74d8f15d01b6a6e4e82852a0d35eb04c83bf4e9f"
] | [
"examples/double_robust_algorithms/drrec_coat.py"
] | [
"from config import tmp_dir\nfrom surprise import accuracy\nfrom surprise import Dataset\nfrom surprise import Reader\nfrom surprise import MFIPS\n\nfrom os import path\n\nimport config\n\nimport itertools\nimport io\nimport numpy as np\nimport requests\nimport time\nimport zipfile\n\ndef dense_to_sparse(rawfile, o... | [
[
"numpy.zeros_like",
"numpy.loadtxt",
"numpy.count_nonzero",
"numpy.nonzero"
]
] |
jerichosu/MoViNet-pytorch | [
"2ad697facd370d01b0f3a6093d38211166e594de"
] | [
"movinets/models.py"
] | [
"\"\"\"\nCode inspired by:\nhttps://pytorch.org/vision/stable/_modules/torchvision/models/mobilenetv2.html\nhttps://pytorch.org/vision/stable/_modules/torchvision/models/mobilenetv3.html\n\"\"\"\nfrom collections import OrderedDict\nimport torch\nfrom torch.nn.modules.utils import _triple, _pair\nimport torch.nn.fu... | [
[
"torch.cat",
"torch.nn.modules.utils._pair",
"torch.nn.functional.adaptive_avg_pool3d",
"torch.nn.init.kaiming_normal_",
"torch.nn.AvgPool3d",
"torch.nn.functional.pad",
"torch.nn.modules.utils._triple",
"torch.sigmoid",
"torch.nn.functional.avg_pool3d",
"torch.nn.init.norm... |
BrianZ111/TGC-Designer-Tools | [
"bc0cca96444b33c0ae93e5c5d43e40061cdef6b8"
] | [
"tgc_visualizer.py"
] | [
"import cv2\nimport json\nimport math\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport overpy\nimport sys\n\nfrom GeoPointCloud import GeoPointCloud\nimport tgc_definitions\nimport tgc_tools\n\ndef drawBrushesOnImage(brushes, color, im, pc, image_scale, fill=True):\n for brush in brushes:\n ce... | [
[
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.int32",
"matplotlib.pyplot.imshow"
]
] |
SMattfeldt/probeye | [
"3a1e236f1e389f4e775a1413a4cf173f39ab2f12"
] | [
"tests/integration_tests/tests_with_correlation/test_time_correlation.py"
] | [
"\"\"\"\nEstimation of gravitational constant assuming correlation in time\n----------------------------------------------------------------------------------------\nThe experimental setup in this test is a ball that is vertically thrown upwards into the\nair and which eventually falls down again. The trajectory of... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.zeros",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"numpy.cosh",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.exp",
"numpy.arctan",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.sqrt",... |
RuohanW/autogluon | [
"fa349db5e75a18cd3af7d9d3f1064eb34e92aca1"
] | [
"core/tests/unittests/bayesopt/gpautograd/test_comparison_gpy.py"
] | [
"import os\nfrom typing import List, Optional\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pickle\nimport tempfile\n\nfrom autogluon.core.searcher.bayesopt.tuning_algorithms.default_algorithm import \\\n DEFAULT_METRIC\nfrom autogluon.core.searcher.bayesopt.models.gp_model import \\\n GaussPro... | [
[
"numpy.concatenate",
"matplotlib.pyplot.colorbar",
"numpy.random.seed",
"matplotlib.pyplot.title",
"numpy.ones",
"numpy.min",
"numpy.mean",
"numpy.std",
"numpy.sqrt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
]
] |
homebase3/nycdsa_final_project | [
"07d753fe6863c155adfc4b9d8d4b2fbf96ee6005"
] | [
"script/city_long_lat_parse.py"
] | [
"# %% load in libraries\nfrom bs4 import BeautifulSoup, Comment\nimport pandas as pd\nimport time\nfrom selenium import webdriver\nimport random\nimport numpy as np\nfrom selenium.webdriver.common.action_chains import ActionChains\nimport re\nfrom gazpacho import Soup\n\n# %% set up selenium\n\nfrom selenium import... | [
[
"pandas.DataFrame"
]
] |
corahama/python | [
"234fa60ac6258905b158f1e114868a2629d52773"
] | [
"snn/srm.py"
] | [
"import math\n\nimport numpy as np\n\n\nclass SRM():\n def __init__(self) -> None:\n # self.tc = 0\n self.u = []\n self.spikeTrain = []\n self.V = 10 # mV -> best = {iris: 4, wine: 500, norm: 5}\n # Eta kernel parameters\n self.eta_0 = 5 # mV -> best = {iris: 22, wine: 2... | [
[
"numpy.std",
"numpy.array",
"numpy.arange",
"numpy.heaviside"
]
] |
megies/SHTOOLS | [
"740455a28eafb6bb23a449cdec43724e86d99c4f"
] | [
"examples/python/GravMag/TestGrav.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nThis script tests the gravity and magnetics routines.\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport pyshtools\nfrom pyshtools import gravmag\nfrom pyshtools import shio\nfrom pyshtools import constant\n\npyshtools.utils.figstyle()\n\n\n# ==== MAIN FUNCTION =... | [
[
"numpy.max",
"matplotlib.pyplot.xlim",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.min",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyp... |
khurrumsaleem/sandy | [
"74d4d62d808fd3637f0129a3f25c63db322d724e"
] | [
"tests/record_test.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Jul 12 11:25:35 2018\r\n\r\n@author: Fiorito_L\r\n\"\"\"\r\n\r\nimport pytest\r\n\r\nimport numpy as np\r\nimport rwf\r\n\r\nfrom sandy.data import Pu9\r\nfrom sandy.formats.records import (\r\n read_ilist,\r\n read_dlist,\r\n read_list,\r\n ... | [
[
"numpy.array"
]
] |
BorgwardtLab/ARDISS | [
"9e9f88eaf73e177e4084d771ec0e0cc96f2921a5"
] | [
"ardiss/ard_model.py"
] | [
"# -----------------------------------------------------------------------------\n# These functions compute the ARD values for the chromosome of interest\n# They rely on three external libraries: tensorflow, gpflow and sklearn. The\n# Experiment class calls these methods if the ARD option is enabled.\n#\n# January ... | [
[
"numpy.array",
"numpy.asarray",
"numpy.copy",
"tensorflow.Graph",
"numpy.mean",
"numpy.take",
"sklearn.preprocessing.scale",
"numpy.arange",
"numpy.sqrt",
"numpy.floor"
]
] |
cliffeby/Duckpin2 | [
"9b1b0891e898625373409f7b4b7d4e058184c45e"
] | [
"DPBootV1.py"
] | [
"# import the necessary packages\r\n\r\nimport time\r\nfrom datetime import datetime\r\nimport cv2\r\nimport numpy\r\nimport RPi.GPIO as GPIO\r\nimport Iothub_client_functions as iot\r\nimport picamera\r\nimport io\r\nimport threading\r\nimport cropdata1440\r\nimport myGPIO\r\nfrom picamera.array import PiRGBArray\... | [
[
"numpy.array"
]
] |
monoclecat/SPFlow | [
"3acd8683f05cf1d850fe7d0ebb4e24496050adb4"
] | [
"sb3.py"
] | [
"import stable_baselines3 as sb3\nimport gym\nfrom stable_baselines3.sac.policies import SACPolicy\nfrom stable_baselines3.sac.sac import SAC\nfrom stable_baselines3.common.utils import polyak_update\nfrom stable_baselines3.common.policies import BasePolicy, register_policy, ContinuousCritic, BaseModel\nfrom stable... | [
[
"torch.cat",
"torch.min",
"torch.no_grad",
"torch.add",
"numpy.mean",
"torch.nn.functional.mse_loss",
"torch.is_grad_enabled",
"numpy.log2",
"torch.set_grad_enabled"
]
] |
dimitreOliveira/melanoma-classification | [
"e366a645b872f035a34fd2df5ee96fa8a1615ce1"
] | [
"Scripts/scripts_lr_schedulers.py"
] | [
"import math\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\n\n\n@tf.function\ndef constant_schedule_with_warmup(epoch, warmup_epochs=0, lr_start=1e-4, lr_max=1e-3):\n \"\"\" Create a schedule with a constant learning rate preceded by a warmup\n period during which the learning rate increases linea... | [
[
"tensorflow.math.maximum",
"tensorflow.math.cos"
]
] |
kozistr/NatSR-pytorch | [
"b189e977120740cbc69e82411e4011eec8f5c446"
] | [
"natsr/schedulers.py"
] | [
"from torch.optim.lr_scheduler import ExponentialLR\nfrom torch.optim.optimizer import Optimizer\n\nfrom natsr import LRSchedulerType\n\n\n# TODO : implement staircase exp lr scheduling\ndef build_lr_scheduler(config, model_type: str, optimizer: Optimizer):\n lr_schedule_type: str = config['model'][model_type]['... | [
[
"torch.optim.lr_scheduler.ExponentialLR"
]
] |
bobmayuze/sqlflow | [
"8e51c19eed656d506ffa9240024b8e12010cbd01"
] | [
"python/runtime/feature/derivation.py"
] | [
"# Copyright 2020 The SQLFlow Authors. All rights reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap... | [
[
"numpy.prod"
]
] |
brandon-zhang/OlinEngineSim | [
"1831b52a50ab2af023e202626b645645ab573c97"
] | [
"main.py"
] | [
"from tkinter import *\r\nfrom tkinter import filedialog\r\nfrom Sim import Sim\r\nfrom InputPanel import InputPanel\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\r\nfrom GrainPanel import GrainPanel\r\nfrom ResultsPanel import ResultsPanel\r\nimport os\r\nfro... | [
[
"matplotlib.pyplot.Figure",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg"
]
] |
sergedurand/projet_algo_2i003 | [
"3c4badb445f6f5a3391c60a465af1632ae52ec72"
] | [
"code/MesuresExperimentales.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Dec 9 14:42:15 2018\r\n\r\n@author: Serge Durand et Arthur Limbour\r\n\r\n\r\n\"\"\"\r\n\r\nimport time\r\nimport math\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport random\r\nimport csv\r\n\r\n#création d'arbres et d'instances :\r\ndef Calcu... | [
[
"numpy.median",
"numpy.array",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure"
]
] |
getalp/disambiguate | [
"1867296bf22bdbcf87d0aa368977717b68064ce6"
] | [
"python/getalp/wsd/model.py"
] | [
"from torch.nn import Module, CrossEntropyLoss\nfrom torch.optim import Adam\nimport torch\nfrom getalp.wsd.loss.label_smoothed_cross_entropy import LabelSmoothedCrossEntropyCriterion\nfrom getalp.wsd.modules.embeddings import get_elmo_embeddings, get_bert_embeddings, get_auto_embeddings, EmbeddingsLUT\nfrom getalp... | [
[
"torch.no_grad",
"torch.save",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss"
]
] |
morzh/hyperstyle | [
"ed87f620143d045f374aa42712a43abd751a90e6"
] | [
"models/encoders/restyle_e4e_encoders.py"
] | [
"from enum import Enum\nimport numpy as np\nfrom torch import nn\nfrom torch.nn import Conv2d, BatchNorm2d, PReLU, Sequential, Module\nfrom torchvision.models import resnet34\n\nfrom models.stylegan2.model import EqualLinear\nfrom models.encoders.helpers import get_blocks, bottleneck_IR, bottleneck_IR_SE\n\n\nclass... | [
[
"torch.nn.ModuleList",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.Conv2d",
"torch.nn.PReLU",
"numpy.log2"
]
] |
YuyaOzono0224/oreillydeel-learning | [
"df8b4b5a5ee3ab75a5ad9af01fcab07c069903f6"
] | [
"ch01/forward_net.py"
] | [
"# coding: utf-8\nimport numpy as np\n\n\nclass Sigmoid:\n def __init__(self):\n self.params = []\n\n def forward(self, x):\n return 1 / (1 + np.exp(-x))\n\n\nclass Affine:\n def __init__(self, W, b):\n self.params = [W, b]\n\n def forward(self, x):\n W, b = self.params\n ... | [
[
"numpy.dot",
"numpy.random.randn",
"numpy.exp"
]
] |
laumalo/ConsensusDocking | [
"1f4cc6c6f02b92f692d676a8b5a942a52eaa7d60",
"1f4cc6c6f02b92f692d676a8b5a942a52eaa7d60"
] | [
"consensus_docking/preprocessing/parserFTDock.py",
"tests/test_preprocessing_parser_frodock.py"
] | [
"import os\nimport sys\nimport logging\nimport pandas as pd\nimport numpy as np\n\nlogging.basicConfig(\n format='%(asctime)s [%(module)s] - %(levelname)s: %(message)s',\n datefmt='%d-%b-%y %H:%M:%S',\n level=logging.INFO, stream=sys.stdout)\n\n\nclass ParserFTDock:\n def __init__(self, working_dir='.',... | [
[
"numpy.max",
"numpy.array",
"pandas.read_csv",
"numpy.min"
],
[
"pandas.read_csv"
]
] |
arnelg/qutip | [
"781856e8f41254884844f9c1c9e76f2a1f4e78ed"
] | [
"qutip/states.py"
] | [
"# This file is part of QuTiP: Quantum Toolbox in Python.\n#\n# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are... | [
[
"numpy.exp",
"numpy.log",
"numpy.flipud",
"numpy.arange",
"numpy.sqrt",
"scipy.sparse.csr_matrix",
"numpy.empty_like",
"numpy.array",
"numpy.zeros",
"numpy.roll",
"scipy.arange",
"scipy.conj",
"numpy.cumprod",
"numpy.asarray",
"scipy.sparse.spdiags",
... |
gayashiva/air_model | [
"fb6fb02b866a821ee8a83551be78c25bdb7da7c9"
] | [
"src/data/ravat20.py"
] | [
"\nimport sys\nimport pandas as pd\nimport numpy as np\nfrom datetime import datetime, timedelta\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nfrom matplotlib.backends.backend_pdf import PdfPages\nfrom pandas.plotting import register_matplotlib_converters\nimport math\nimport time\nfrom pathl... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.subplots",
"matplotlib.dates.WeekdayLocator",
"matplotlib.dates.DayLocator"
]
] |
zuoziji/transaction | [
"7a59817a699d9df32e13d43edda630520af7860d"
] | [
"Stage/fh_tools/windy_utils.py"
] | [
"# -*- coding:utf-8 -*-\r\n\"\"\"\r\n 万得缓存接口\r\nwsd_cache 对应 w.wsd 函数\r\nwss_cache 对应 w.wss 函数\r\nwset_cache 对应 w.wset 函数\r\nCACHE_ENABLE 可以取消缓存功能(默认为True)\r\n\"\"\"\r\nimport json\r\nimport os\r\nfrom collections import OrderedDict\r\nimport pandas as pd\r\nfrom fh_tools.fh_utils import clean_datetime_remove_ti... | [
[
"pandas.DataFrame",
"pandas.read_excel"
]
] |
PointKernel/cudf | [
"cc25f3d30ce6f4e4939d5b913ca1a66ab32ac75e"
] | [
"python/cudf/cudf/core/frame.py"
] | [
"# Copyright (c) 2020-2021, NVIDIA CORPORATION.\n\nfrom __future__ import annotations\n\nimport copy\nimport pickle\nimport warnings\nfrom collections import abc\nfrom typing import (\n Any,\n Callable,\n Dict,\n List,\n MutableMapping,\n Optional,\n Tuple,\n TypeVar,\n Union,\n cast,\... | [
[
"numpy.full",
"numpy.random.choice",
"numpy.asarray",
"numpy.iterable",
"numpy.random.seed",
"numpy.isscalar",
"numpy.int64",
"numpy.issubdtype",
"numpy.iinfo",
"numpy.dtype"
]
] |
NERSC/timemory-tutorials | [
"06056bfad1599364d0f881d53f280b2308313e69"
] | [
"tutorial-day-1/python-api-and-tools/extended/02_python_profiling/example.py"
] | [
"#!/usr/bin/env python\n\nimport sys\nimport numpy as np\n\n\n@profile\ndef fib(n):\n return n if n < 2 else (fib(n - 1) + fib(n - 2))\n\n\n@profile\ndef inefficient(n):\n a = 0\n for i in range(n):\n a += i\n for j in range(n):\n a += j\n arr = np.arange(a * n * n * n, dtype=np... | [
[
"numpy.arange"
]
] |
LandonFuhr/aseen | [
"9a7d6b0a66930872cf1da7d3a5493326285f3bd1"
] | [
"src/py/analysis_lib/video_creator/colors.py"
] | [
"from matplotlib import cm\n\n# (B, G, R)\nmouse_colors = [\n (83, 255, 18), # green\n (0, 139, 232), # orange\n (255, 136, 0), # blue\n (0, 196, 255), # yellow\n (0, 25, 255) # red\n]\n\noutline_colormap = cm.get_cmap('plasma', 100)\n"
] | [
[
"matplotlib.cm.get_cmap"
]
] |
nokpil/AgentNet | [
"cb321395aa4b8d34ffc18fa93b1455e8ab868fed"
] | [
"src/DataStructure.py"
] | [
"\n# coding: utf-8\n\n# ## Data Process for ModAdd data\n\n# In[1]:\n\n\nimport torch\nimport torch.nn as nn\nimport torchvision\nimport torchvision.transforms as transforms\nfrom datetime import datetime\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom torch.autograd import Variable\nimport torch.optim a... | [
[
"numpy.concatenate",
"numpy.array",
"torch.FloatTensor",
"numpy.tile",
"numpy.random.shuffle",
"numpy.nonzero",
"numpy.cumsum",
"torch.Tensor"
]
] |
YuliangXiu/ICON | [
"ece5a09aa2d56aec28017430e65a0352622a0f30"
] | [
"lib/pare/pare/models/layers/attention.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is\n# holder of all proprietary rights on this computer program.\n# You can only use this computer program if you have closed\n# a license agreement with MPG or you get the right to use the computer\n# program from som... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Softmax",
"torch.nn.Sequential",
"torch.nn.Tanh",
"torch.nn.ReLU",
"torch.nn.init.uniform_"
]
] |
ShouryaMehra/FastSpeech-Fast-and-High-Quality-End-to-End-Text-to-Speech | [
"64e820671e6c792512ff14c59639d93ce5e989b3"
] | [
"transformer/SubLayers.py"
] | [
"import torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport numpy as np\r\n\r\nfrom .Modules import ScaledDotProductAttention\r\n\r\n\r\nclass MultiHeadAttention(nn.Module):\r\n \"\"\" Multi-Head Attention module \"\"\"\r\n\r\n def __init__(self, n_head, d_model, d_k, d_v, dropout=0.1):\r\n sup... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.nn.Conv1d",
"numpy.power"
]
] |
romainreignier/robot-software | [
"9cd2ffedb5dec99e913d77b8b58b24d451510632"
] | [
"tools/plot_demo.py"
] | [
"import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nTABLE_SIZE = {'x': 3000, 'y': 2000}\nROBOT_SIZE = 245\nARM_LENGTHS = (100, 98)\nARM_OFFSET = {'x': -100, 'y': 0, 'a': np.pi}\n\ndef discrete_circle(center, radius, samples, offset=0):\n return [center[0] + radius * ... | [
[
"matplotlib.use",
"numpy.array",
"numpy.sin",
"matplotlib.pyplot.subplots",
"numpy.cos"
]
] |
Zach-Ziyi-Liu/Answerer-in-Questioner-s-Mind-Information-Theoretic-Approach-to-Goal-Oriented-Visual-Dialog | [
"23f5202593a1308a8c3640d9ed9759aef5fbe6c2"
] | [
"eval_utils/rank_questioner.py"
] | [
"import sqlite3\nimport string\nimport sys\nfrom sys import stdout\nimport json\nimport gc\nimport h5py\nimport numpy as np\nimport random\nfrom timeit import default_timer as timer\n\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\n\nimport options\nimport visdial.metrics as met... | [
[
"numpy.array",
"torch.cat",
"torch.autograd.Variable",
"torch.from_numpy",
"torch.nn.functional.mse_loss",
"torch.utils.data.DataLoader",
"sklearn.metrics.pairwise.pairwise_distances",
"numpy.sqrt",
"torch.mean"
]
] |
stjordanis/gradient-checkpointing | [
"43444e0523495c9f305f2c32d81eeea2328a1b18"
] | [
"memory_saving_gradients.py"
] | [
"from toposort import toposort\nimport contextlib\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib.graph_editor as ge\nimport time\nimport sys\nsys.setrecursionlimit(10000)\n# refers back to current module if we decide to split helpers out\nutil = sys.modules[__name__]\n\n# getting rid of \"W... | [
[
"tensorflow.contrib.graph_editor.reroute_ts",
"tensorflow.contrib.graph_editor.filter_ts_from_regex",
"tensorflow.get_default_graph",
"tensorflow.expand_dims",
"tensorflow.contrib.graph_editor.get_backward_walk_ops",
"tensorflow.contrib.graph_editor.add_control_inputs",
"tensorflow.sca... |
constantinpape/fastpy | [
"b3b4f7114b393d4c4d413b13ed032461fd2e903e"
] | [
"ccxt/setup.py"
] | [
"from setuptools import setup, Extension\nfrom setuptools.command.build_ext import build_ext\nimport sys\nimport os\nimport setuptools\n\n__version__ = '0.0.1'\n\n\nclass get_pybind_include(object):\n \"\"\"Helper class to determine the pybind11 include path\n\n The purpose of this class is to postpone import... | [
[
"numpy.get_include"
]
] |
chenjiehu/MGCN_ODA | [
"311a71444d6e22d4049d7356c1aa31584857006c"
] | [
"utils.py"
] | [
"import os\nimport shutil\nimport time\nimport pprint\n\nimport torch\nimport torch.nn.functional as F\n\n# data_split\nroot = './'\nfilename = 'RA_10wayRSI' # dataset folder name\nfilename_shot = 'shot_AR' # shot folder name\nfilename_query = 'query_AR' # query folder name\nshot = 5\n\n\n# train\n\ndef set_gp... | [
[
"torch.zeros",
"torch.mul",
"torch.norm",
"sklearn.metrics.accuracy_score",
"torch.topk",
"torch.randn",
"torch.nn.functional.softmax",
"torch.zeros_like",
"torch.argmax",
"torch.sum"
]
] |
neohope/MLStudy | [
"bba16587e4f3efe11c926030f6bbcff6db0dde14"
] | [
"NeuralNetwork/CNN/pool_math_test.py"
] | [
"#!/usr/bin/python\n# -*- coding:utf-8 -*-\n\n\"\"\"\nMax Pooling卷积分神经网络Demo\n\"\"\"\n\nimport numpy as np\nfrom NeuralNetwork.CNN import pool_math\n\n\ndef init_pool_test():\n a = np.array(\n [[[1, 1, 2, 4],\n [5, 6, 7, 8],\n [3, 2, 1, 0],\n [1, 2, 3, 4]],\n [[0, 1, 2, ... | [
[
"numpy.array"
]
] |
aam-at/mnist_challenge | [
"eb600c537671387e687e2bb9def73d41fc7512ef"
] | [
"model_robustml.py"
] | [
"import robustml\nimport tensorflow as tf\n\nimport model\n\nclass Model(robustml.model.Model):\n def __init__(self, sess):\n self._model = model.Model()\n\n saver = tf.compat.v1.train.Saver()\n checkpoint = tf.train.latest_checkpoint('models/secret')\n saver.restore(sess, checkpoint)\n\n self._sess... | [
[
"tensorflow.compat.v1.train.Saver",
"tensorflow.train.latest_checkpoint"
]
] |
zhcui/sparse | [
"00aa0c2561d3850b9afdf03d833d20662df8cd5b"
] | [
"sparse/tests/tmp_test/test_bdok1.py"
] | [
"import numpy as np\nimport six\n\nimport sparse\nfrom sparse import BDOK\nfrom sparse.utils import assert_eq\n\ndef test_random_shape_nnz(shape, block_shape, density):\n s = sparse.brandom(shape, block_shape, density, format='bdok')\n\n assert isinstance(s, BDOK)\n\n assert s.shape == shape\n expected_... | [
[
"numpy.ceil",
"numpy.prod",
"numpy.floor"
]
] |
danilovazm/Mnist-Digit-Recognition- | [
"c0b79aac319ca996015ed93a6bb9d0c91f74090e"
] | [
"test.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport seaborn as sns\r\nfrom sklearn.metrics import confusion_matrix\r\n\r\ndef Test(Net, test_set):\r\n j=0\r\n predictions = []\r\n labels = []\r\n with torch.no_grad():\r\n for i, (x, y) in enumerate(test_set):\r\n if torch.cuda.is_availabl... | [
[
"sklearn.metrics.confusion_matrix",
"torch.cuda.is_available",
"torch.argmax",
"torch.no_grad"
]
] |
sgillies/pygeos | [
"02899c8582b35cecbbbda7ad50bc00861046edc6"
] | [
"pygeos/test/common.py"
] | [
"import numpy as np\nimport pygeos\nimport sys\nfrom contextlib import contextmanager\n\npoint_polygon_testdata = (\n pygeos.points(np.arange(6), np.arange(6)),\n pygeos.box(2, 2, 4, 4),\n)\npoint = pygeos.points(2, 3)\nline_string = pygeos.linestrings([(0, 0), (1, 0), (1, 1)])\nlinear_ring = pygeos.linearrin... | [
[
"numpy.arange"
]
] |
itprov/CarND-Behavioral-Cloning-P3 | [
"4b4d305a84407fa1dd0929faab96e589946a2773"
] | [
"model.py"
] | [
"from setup_data import get_data\n\nimport h5py\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\n\nfrom keras import Sequential\nfrom keras.callbacks import ModelCheckpoint\nfrom keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPooling2D\nfrom keras.layers import Cropping2D, Lambda\nfrom kera... | [
[
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"sklearn.utils.shuffle"
]
] |
Aarsh2001/annotated_deep_learning_paper_implementations | [
"d1fc1bc0e09975687419149dbe25cce786f81fcc"
] | [
"labml_nn/experiments/cifar10.py"
] | [
"\"\"\"\n---\ntitle: CIFAR10 Experiment\nsummary: >\n This is a reusable trainer for CIFAR10 dataset\n---\n\n# CIFAR10 Experiment\n\"\"\"\nfrom typing import List\n\nimport torch.nn as nn\n\nfrom labml import lab\nfrom labml.configs import option\nfrom labml_helpers.datasets.cifar10 import CIFAR10Configs as CIFAR1... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
xizaoqu/Panoptic-PolarNet | [
"8ce05f437f54e030eac7de150f43caab2810cfbb"
] | [
"network/instance_post_processing.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn.functional as F\nimport torch_scatter\n\n\ndef find_instance_center(ctr_hmp, threshold=0.1, nms_kernel=5, top_k=None, polar=False):\n \"\"\"\n Find the center points from the center heatmap.\n Arguments:\n ctr_hmp: A Ten... | [
[
"torch.nonzero",
"torch.cat",
"torch.argmax",
"torch.flatten",
"torch.arange",
"torch.max",
"torch.norm",
"torch.argmin",
"torch.add",
"torch.unsqueeze",
"torch.nn.functional.softmax",
"torch.zeros_like",
"torch.nn.functional.pad",
"torch.nn.functional.max_p... |
emsellem/pygme | [
"cce7805d26c2791e8c342d74f3b89f6fdc23af8c",
"cce7805d26c2791e8c342d74f3b89f6fdc23af8c"
] | [
"pygme/photMGE.py",
"pygme/pyhist.py"
] | [
"#!/usr/bin/python\n\"\"\"\nThis module specifically deals with the photometric quantities\nrelated to a Multi Gaussian Expansion models (Monnet et al. 1992, Emsellem et al. 1994). It\nmakes use of the MGE class defined in pygme.py module.\nIt includes the derivation of projected and deprojected photometry.\n\nWAR... | [
[
"scipy.special.erf",
"numpy.zeros_like",
"numpy.exp",
"numpy.sqrt"
],
[
"numpy.concatenate",
"numpy.bincount",
"numpy.zeros_like",
"numpy.array",
"numpy.ones_like",
"numpy.histogram2d",
"numpy.zeros",
"numpy.histogramdd",
"numpy.nonzero",
"numpy.arange",... |
hyoo/keras-molecule | [
"18077fdd011a38f2607ff3c054bf3fee2ee7af06"
] | [
"molecules/vectorizer.py"
] | [
"import numpy as np\nimport itertools\nimport random\n\nclass CharacterTable(object):\n '''\n Given a set of characters:\n + Encode them to a one hot integer representation\n + Decode the one hot integer representation to their character output\n + Decode a vector of probabilities to their character output\n ... | [
[
"numpy.sum",
"numpy.ones",
"numpy.zeros"
]
] |
1170629651/dm_control | [
"fb0199e61db3323a17f56fd089af61f7c949f41e"
] | [
"dm_control/locomotion/tasks/reference_pose/tracking.py"
] | [
"# Copyright 2020 The dm_control Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"numpy.array",
"numpy.dot",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.sum",
"numpy.sort",
"numpy.abs"
]
] |
Hertin/espnet | [
"a0f2175df08b4750a9f0305c20b8c11f6e941867",
"a0f2175df08b4750a9f0305c20b8c11f6e941867"
] | [
"espnet/utils/dataset.py",
"espnet/nets/beam_search.py"
] | [
"#!/usr/bin/env python\n\n# Copyright 2017 Johns Hopkins University (Shinji Watanabe)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\n\"\"\"pytorch dataset and dataloader implementation for chainer training.\"\"\"\n\nimport torch\nimport torch.utils.data\nimport logging\nimport numpy as np\nimport st... | [
[
"torch.utils.data.dataloader.DataLoader"
],
[
"torch.zeros",
"torch.cat",
"torch.arange",
"torch.nn.ModuleDict",
"torch.tensor",
"torch.topk"
]
] |
entrepreneur-interet-general/the-magical-csv-merge-machine | [
"5941c2ed3db64548ece74311c5055ee298e31ab8"
] | [
"merge_machine/preprocess_fields_v3.py"
] | [
"#!/usr/bin/env python3\n# coding=utf-8\n\n# Standard modules\nimport csv, itertools, re, logging, optparse, time, sys, math, os, unidecode\nfrom functools import partial, reduce, lru_cache\nfrom collections import defaultdict, Counter, Iterable\nfrom operator import itemgetter, add\nfrom fuzzywuzzy import fuzz\nim... | [
[
"pandas.DataFrame",
"numpy.split"
]
] |
paul028/PoolNet | [
"a5c17510a7646e585c7325767dee84524fe9f460"
] | [
"metrics.py"
] | [
"from PIL import Image\nimport numpy as np\nfrom sklearn.metrics import average_precision_score\nfrom sklearn.metrics import precision_recall_curve\nimport matplotlib.pyplot as plt\nfrom inspect import signature\nfrom scipy import ndimage\nfrom numpy import random,argsort,sqrt\nfrom sklearn.metrics import jaccard_... | [
[
"numpy.logical_not",
"numpy.logical_xor",
"scipy.ndimage.binary_erosion",
"numpy.zeros",
"sklearn.metrics.precision_recall_curve",
"numpy.sum",
"numpy.where",
"sklearn.metrics.average_precision_score",
"numpy.argsort",
"numpy.absolute",
"numpy.vstack"
]
] |
ggirelli/fish-prode | [
"e904dc1f0f728270b9f7cab9e8b6f13d629d4635"
] | [
"ifpd/scripts/query/probe.py"
] | [
"\"\"\"\n@author: Gabriele Girelli\n@contact: gigi.ga90@gmail.com\n\"\"\"\n\nimport argparse\nfrom ifpd import const, query\nfrom ifpd.scripts import arguments as ap # type: ignore\nfrom ifpd.exception import enable_rich_assert\nimport logging\nimport numpy as np # type: ignore\nimport os\nfrom rich.logging impor... | [
[
"numpy.round",
"numpy.isfinite",
"numpy.logical_and"
]
] |
yueludanfeng/Test | [
"8ea2bd2a8602ed51379c7a89ea1fdf370b8f1ca7"
] | [
"GUI/demo05.py"
] | [
"import matplotlib.pyplot as plt\r\n\r\nX1 = range(0, 50, 100)\r\nY1 = [num ** 2 for num in X1] # y = x^2 X2 = [0, 1] Y2 = [0, 1] # y = x\r\nY1 = [i/2 for i in X1]\r\nplt.figure('five')\r\nFig = plt.figure(figsize=(8,4)) # Create a `figure' instance # Create a `axes' instance in the figure\r\n# Ax = Fig.add_subpl... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure"
]
] |
Tillsten/MplLayouter | [
"92ae901168cff31d57fd9f03f2fdc014833a76da"
] | [
"layout_items.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n\n\"\"\"\nfrom __future__ import division, print_function\nimport kiwisolver as kiwi\nimport matplotlib\nmatplotlib.use('qt4agg')\nfrom matplotlib import pyplot as plt\n\nVariable = kiwi.Variable\n\n\nplt.close('all')\n\n\nclass Box(object):\n \"\"\"\n Basic rectangle represe... | [
[
"matplotlib.use",
"matplotlib.pyplot.Text",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.