code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np class ADMM: def __init__(self, lamb, n_blocks, block_size, rho, S, rho_update_func=None): self.lamb = lamb self.n_blocks = n_blocks self.block_size = block_size self.rho = float(rho) self.S = S self.rho_update_func = rho_update_func self.s...
[ "numpy.copy", "numpy.sqrt", "numpy.triu_indices", "numpy.ones", "numpy.diag", "numpy.square", "numpy.array", "numpy.zeros", "numpy.linalg.eigh", "numpy.matrix" ]
[((714, 735), 'numpy.zeros', 'np.zeros', (['self.length'], {}), '(self.length)\n', (722, 735), True, 'import numpy as np\n'), ((753, 774), 'numpy.zeros', 'np.zeros', (['self.length'], {}), '(self.length)\n', (761, 774), True, 'import numpy as np\n'), ((792, 813), 'numpy.zeros', 'np.zeros', (['self.length'], {}), '(self...
#!/usr/bin/env python """Topic Extraction using NLTK RakeKeywordExtractor CERN Webfest 2017 This file contains routines for - Summarization - Representative Messages """ import networkx as nx import numpy as np from nltk import sent_tokenize from sklearn.feature_extraction.text import TfidfTransformer, C...
[ "sklearn.feature_extraction.text.TfidfTransformer", "sklearn.metrics.pairwise.cosine_similarity", "sklearn.feature_extraction.text.CountVectorizer", "numpy.asarray", "nltk.sent_tokenize", "utils.load_sample", "networkx.from_numpy_matrix", "networkx.pagerank" ]
[((836, 865), 'sklearn.metrics.pairwise.cosine_similarity', 'cosine_similarity', (['normalized'], {}), '(normalized)\n', (853, 865), False, 'from sklearn.metrics.pairwise import cosine_similarity\n'), ((881, 919), 'networkx.from_numpy_matrix', 'nx.from_numpy_matrix', (['similarity_graph'], {}), '(similarity_graph)\n', ...
import os import sys import numpy as np import multiprocessing # Import flags specifying dataset parameters from flags import getFlags def preprocess_data(start_index, data_count, data_dir, mesh_dir, soln_dir, RESCALE=True): RESCALE = False LORES = True HIRES = False for i in range(start_index, start...
[ "flags.getFlags", "numpy.abs", "sys.stdout.flush", "multiprocessing.Pool" ]
[((1759, 1769), 'flags.getFlags', 'getFlags', ([], {}), '()\n', (1767, 1769), False, 'from flags import getFlags\n'), ((2122, 2166), 'multiprocessing.Pool', 'multiprocessing.Pool', ([], {'processes': 'NumProcesses'}), '(processes=NumProcesses)\n', (2142, 2166), False, 'import multiprocessing\n'), ((2604, 2622), 'sys.st...
# Copyright 2019 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[ "cirq.ops.pauli_gates.Y", "numpy.sqrt", "cirq.protocols.pauli_expansion", "cirq.value.linear_dict._format_terms", "cirq.ops.pauli_gates.Z", "cirq.ops.identity.I", "cirq.value.LinearDict", "cirq.linalg.operator_spaces.pow_pauli_combination", "cirq._doc.document", "cirq.ops.pauli_gates.X", "cirq.p...
[((1317, 1430), 'cirq._doc.document', 'document', (['PauliSumLike', '"""Any value that can be easily translated into a sum of Pauli products.\n """'], {}), '(PauliSumLike,\n """Any value that can be easily translated into a sum of Pauli products.\n """\n )\n', (1325, 1430), False, 'from cirq._doc import doc...
import os import sys import subprocess from joblib import Parallel, delayed import numpy as np import imageio imageio.plugins.freeimage.download() from imageio.plugins import freeimage import h5py from lz4.block import decompress import scipy.misc import cv2 from path import Path path = os.path.join(os.path.dirname(...
[ "os.path.join", "joblib.Parallel", "path.Path", "numpy.array", "os.path.isdir", "os.mkdir", "numpy.savetxt", "os.path.abspath", "joblib.delayed", "imageio.plugins.freeimage.download", "numpy.save" ]
[((111, 147), 'imageio.plugins.freeimage.download', 'imageio.plugins.freeimage.download', ([], {}), '()\n', (145, 147), False, 'import imageio\n'), ((2710, 2739), 'os.path.join', 'os.path.join', (['path', '"""../test"""'], {}), "(path, '../test')\n", (2722, 2739), False, 'import os\n'), ((3028, 3043), 'path.Path', 'Pat...
# coding: utf-8 # # Color grading with optimal transport # # #### *<NAME>, <NAME>* # In this tutorial we will learn how to perform color grading of images with optimal transport. This is somehow a very direct usage of optimal transport. You will learn how to treat an image as an empirical distribution, and apply op...
[ "matplotlib.pylab.axis", "matplotlib.pylab.figure", "ot.unif", "matplotlib.pylab.tight_layout", "sklearn.cluster.MiniBatchKMeans", "matplotlib.pyplot.imread", "ot.bregman.sinkhorn", "ot.dist", "matplotlib.pylab.imshow", "ot.emd", "matplotlib.pylab.show", "numpy.logspace" ]
[((2908, 2926), 'ot.unif', 'ot.unif', (['nbsamples'], {}), '(nbsamples)\n', (2915, 2926), False, 'import ot\n'), ((2934, 2952), 'ot.unif', 'ot.unif', (['nbsamples'], {}), '(nbsamples)\n', (2941, 2952), False, 'import ot\n'), ((2957, 2987), 'ot.dist', 'ot.dist', (['Xs', 'Xt', '"""sqeuclidean"""'], {}), "(Xs, Xt, 'sqeucl...
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import sys import seaborn as sns sns.set(style="whitegrid") sys.path.append(os.path.abspath(".")) import config from src.features import fe from src.utli import utli # read data df_main = fe.mergred_store_and_user() # check missing rate...
[ "matplotlib.pyplot.ylabel", "seaborn.catplot", "src.utli.utli.missing_data", "seaborn.scatterplot", "sys.exit", "seaborn.set", "src.features.fe.mergred_store_and_user", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.close", "matplotlib.pyplot.axhline", "matplotlib.pyplot.savefig", "numpy.triu_...
[((114, 140), 'seaborn.set', 'sns.set', ([], {'style': '"""whitegrid"""'}), "(style='whitegrid')\n", (121, 140), True, 'import seaborn as sns\n'), ((270, 297), 'src.features.fe.mergred_store_and_user', 'fe.mergred_store_and_user', ([], {}), '()\n', (295, 297), False, 'from src.features import fe\n'), ((378, 404), 'src....
import itertools import random from typing import Callable from typing import Dict from typing import List from typing import Optional from typing import Tuple from typing import Union from unittest.mock import patch from unittest.mock import PropertyMock import numpy as np import pytest import optuna from optuna.sam...
[ "optuna.distributions.DiscreteUniformDistribution", "optuna.samplers._tpe.sampler._get_observation_pairs", "numpy.array", "optuna.distributions.CategoricalDistribution", "optuna.distributions.UniformDistribution", "unittest.mock.patch", "numpy.asarray", "numpy.max", "optuna.samplers._tpe.sampler._co...
[((18731, 18915), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""state"""', '[(optuna.trial.TrialState.FAIL,), (optuna.trial.TrialState.PRUNED,), (\n optuna.trial.TrialState.RUNNING,), (optuna.trial.TrialState.WAITING,)]'], {}), "('state', [(optuna.trial.TrialState.FAIL,), (optuna.\n trial.TrialState...
#!/usr/bin/python # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this l...
[ "numpy.array", "builtins.range", "os.listdir", "argparse.ArgumentParser", "numpy.asarray", "time.perf_counter", "tensorrtserver.api.api_pb2.InferRequestHeader.Output", "os.path.isdir", "pandas.DataFrame", "tensorrtserver.api.model_config_pb2.ModelInput.Format.Name", "tensorrtserver.api.model_con...
[((6714, 6735), 'numpy.array', 'np.array', (['resized_img'], {}), '(resized_img)\n', (6722, 6735), True, 'import numpy as np\n'), ((9477, 9502), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (9500, 9502), False, 'import argparse\n'), ((11157, 11189), 'grpc.insecure_channel', 'grpc.insecure_cha...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import matplotlib.pyplot as plt import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.utils import shuffle from sklearn.metrics import confusion_matrix from sklearn.uti...
[ "libs.data.mass.Mass", "numpy.unique", "matplotlib.pyplot.show", "numpy.where", "sklearn.utils.shuffle", "numpy.set_printoptions", "sklearn.ensemble.RandomForestClassifier", "numpy.stack", "libs.data.utils.power_spectrum", "numpy.concatenate", "sklearn.utils.multiclass.unique_labels", "sys.pat...
[((356, 377), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (371, 377), False, 'import sys\n'), ((967, 999), 'sklearn.metrics.confusion_matrix', 'confusion_matrix', (['y_true', 'y_pred'], {}), '(y_true, y_pred)\n', (983, 999), False, 'from sklearn.metrics import confusion_matrix\n'), ((1064, 109...
import os import cv2 import numpy as np def find_image_files(input_dir): """ Recursively searches for .jpg/.png images. """ for root_dir, found_dirs, found_files in os.walk(input_dir): for found_file in found_files: if os.path.splitext(found_file)[-1].lower() in ['.jpg', '.png']: ...
[ "os.path.exists", "numpy.histogram", "os.makedirs", "os.path.splitext", "os.path.join", "os.path.dirname", "os.path.isdir", "os.path.basename", "cv2.cvtColor", "cv2.resize", "cv2.imread", "os.walk" ]
[((184, 202), 'os.walk', 'os.walk', (['input_dir'], {}), '(input_dir)\n', (191, 202), False, 'import os\n'), ((2655, 2683), 'os.path.dirname', 'os.path.dirname', (['output_path'], {}), '(output_path)\n', (2670, 2683), False, 'import os\n'), ((2702, 2731), 'os.path.basename', 'os.path.basename', (['output_path'], {}), '...
""" Program's entry-point :authors: [<NAME>, <NAME>, <NAME>] :url: https://github.com/pBouillon/TELECOM_TAN :license: [MIT](https://github.com/pBouillon/TELECOM_TAN/blob/master/LICENSE) """ import matplotlib.pyplot as plt import pyaudio import numpy as np from utils.constants import * from utils.data...
[ "utils.data_objects.Phoneme", "wave.open", "utils.sound_utils.scalar_product", "matplotlib.pyplot.plot", "os.path.join", "numpy.array", "utils.easy_thread.ThreadPool", "utils.data_objects.Sample", "os.path.basename", "numpy.save", "numpy.std", "utils.sound_utils.wav_to_normalized_h_2", "nump...
[((1201, 1218), 'pyaudio.PyAudio', 'pyaudio.PyAudio', ([], {}), '()\n', (1216, 1218), False, 'import pyaudio\n'), ((1425, 1439), 'numpy.dtype', 'np.dtype', (['"""i2"""'], {}), "('i2')\n", (1433, 1439), True, 'import numpy as np\n'), ((1599, 1613), 'numpy.std', 'np.std', (['sample'], {}), '(sample)\n', (1605, 1613), Tru...
import argparse import numpy as np import gym import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from utils import logz from utils.tools import get_output_folder, OUNoise, hard_update, soft_update from utils.buffer import ReplayBuffer FloatTensor = torch.FloatTensor """ ...
[ "numpy.clip", "torch.from_numpy", "torch.nn.MSELoss", "numpy.array", "gym.make", "utils.logz.dump_tabular", "torch.tanh", "numpy.mean", "utils.buffer.ReplayBuffer", "argparse.ArgumentParser", "torch.nn.LayerNorm", "numpy.max", "utils.tools.hard_update", "utils.tools.OUNoise", "numpy.rand...
[((5011, 5029), 'gym.make', 'gym.make', (['args.env'], {}), '(args.env)\n', (5019, 5029), False, 'import gym\n'), ((5196, 5221), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (5210, 5221), True, 'import numpy as np\n'), ((5226, 5254), 'torch.manual_seed', 'torch.manual_seed', (['args.seed...
import sys import numpy as np import scipy.ndimage import matplotlib.pyplot as plt import soundfile # Test of pitch-shift quality without PVC if __name__ == "__main__": block_size = 4096 n_blocks = 4 FILT_SIZE = 8 if len(sys.argv) < 5: print( "Usage: {} <in_filename> <out_filena...
[ "numpy.hanning", "numpy.abs", "numpy.ceil", "numpy.fft.irfft", "numpy.angle", "soundfile.write", "numpy.fft.rfft", "numpy.zeros", "numpy.exp", "numpy.interp", "sys.exit", "numpy.pad", "soundfile.SoundFile", "numpy.arange" ]
[((845, 877), 'soundfile.SoundFile', 'soundfile.SoundFile', (['in_filename'], {}), '(in_filename)\n', (864, 877), False, 'import soundfile\n'), ((924, 958), 'numpy.ceil', 'np.ceil', (['(in_file.frames / in_shift)'], {}), '(in_file.frames / in_shift)\n', (931, 958), True, 'import numpy as np\n'), ((1086, 1126), 'numpy.z...
import asyncio import datetime from collections import deque import cv2 import numpy as np from .app import MeasurementStep _message_action = { MeasurementStep.NOT_READY: "", MeasurementStep.READY: "Press 's' to start", MeasurementStep.USER_STARTED: "", MeasurementStep.MEASURING: "Press Esc to cance...
[ "cv2.rectangle", "numpy.copy", "collections.deque", "cv2.resize", "asyncio.Queue", "cv2.putText", "cv2.imshow", "datetime.datetime.now", "numpy.array", "asyncio.sleep", "cv2.getTextSize", "cv2.waitKey" ]
[((1094, 1110), 'asyncio.Queue', 'asyncio.Queue', (['(1)'], {}), '(1)\n', (1107, 1110), False, 'import asyncio\n'), ((1464, 1480), 'collections.deque', 'deque', ([], {'maxlen': '(11)'}), '(maxlen=11)\n', (1469, 1480), False, 'from collections import deque\n'), ((5791, 5814), 'datetime.datetime.now', 'datetime.datetime....
import tkinter as tk from tkinter import ttk from PIL import Image, ImageTk from tkinter import filedialog as fd from tkinter import messagebox as mb import matplotlib.pyplot as plt import numpy as np import cv2 class GUI(tk.Frame): def __init__(self, parent = None): tk.Frame.__init__(self, parent) ...
[ "tkinter.IntVar", "cv2.imwrite", "tkinter.Frame.__init__", "PIL.Image.open", "tkinter.filedialog.asksaveasfilename", "tkinter.Toplevel", "tkinter.Button", "tkinter.Scale", "numpy.array", "tkinter.Tk", "tkinter.Label", "tkinter.messagebox.showinfo", "tkinter.Frame", "tkinter.filedialog.asko...
[((3546, 3553), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (3551, 3553), True, 'import tkinter as tk\n'), ((281, 312), 'tkinter.Frame.__init__', 'tk.Frame.__init__', (['self', 'parent'], {}), '(self, parent)\n', (298, 312), True, 'import tkinter as tk\n'), ((421, 442), 'tkinter.Frame', 'tk.Frame', (['self'], {'bd': '(10)...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Contains the :class:`TSSearch` for finding transition states and reaction paths using FSM. """ import glob import logging import os import shutil import time import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import ard.consta...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.ylabel", "os.path.exists", "argparse.ArgumentParser", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "ard.sm.FSM", "ard.node.Node", "matplotlib.pyplot.savefig", "matplotlib.use", "os.path.splitext", "os.path.dirname", "shutil.copyfile", "...
[((229, 250), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (243, 250), False, 'import matplotlib\n'), ((23563, 23575), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (23573, 23575), True, 'import matplotlib.pyplot as plt\n'), ((23587, 23608), 'matplotlib.pyplot.plot', 'plt.plot', (...
from setuptools import setup, find_packages, Extension from codecs import open from os import path """ Release instruction: Check that tests run correctly for 36 and 27 and doc compiles without warning (make clean first). change __version__ in setup.py to new version name. First upload to test pypi: mktmpenv (P...
[ "Cython.Build.cythonize", "setuptools.find_packages", "os.path.join", "os.path.dirname", "numpy.get_include" ]
[((1771, 1793), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (1783, 1793), False, 'from os import path\n'), ((3234, 3255), 'Cython.Build.cythonize', 'cythonize', (['extensions'], {}), '(extensions)\n', (3243, 3255), False, 'from Cython.Build import cythonize\n'), ((1848, 1876), 'os.path.join',...
import numpy import soundfile from espnet.utils.io_utils import SoundHDF5File # TODO(kamo): Please implement, if anyone is interesting class SpeedPerturbation(object): # The marker used by "Transformation" accept_uttid = False def __init__(self, lower=0.8, upper=1.2, utt2scale=None): self.utt2s...
[ "soundfile.read", "espnet.utils.io_utils.SoundHDF5File", "numpy.random.uniform" ]
[((2481, 2525), 'numpy.random.uniform', 'numpy.random.uniform', (['self.lower', 'self.upper'], {}), '(self.lower, self.upper)\n', (2501, 2525), False, 'import numpy\n'), ((3444, 3473), 'espnet.utils.io_utils.SoundHDF5File', 'SoundHDF5File', (['utt2noise', '"""r"""'], {}), "(utt2noise, 'r')\n", (3457, 3473), False, 'fro...
# coding=utf-8 # Copyright 2019 The Google NoisyStudent Team Authors. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
[ "utils.get_uid_list", "utils.get_dst_from_filename", "tensorflow.gfile.MakeDirs", "tensorflow.gfile.Exists", "numpy.random.random", "tensorflow.placeholder", "json.dump", "tensorflow.Session", "utils.save_pic", "utils.decode_raw_image", "utils.iterate_through_dataset", "utils.bytes_feature", ...
[((940, 1034), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""predict_ckpt_path"""', '""""""', '"""The path to the checkpoint for prediction."""'], {}), "('predict_ckpt_path', '',\n 'The path to the checkpoint for prediction.')\n", (959, 1034), False, 'from absl import flags\n'), ((1032, 1111), 'absl.flags...
#!/usr/bin/env python # Copyright 2020 <NAME> # License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """ Adopt from my another project: https://github.com/funcwj/setk See https://github.com/funcwj/setk/tree/master/doc/data_simu for command line usage """ import argparse import numpy as np from aps.loader....
[ "numpy.mean", "aps.loader.audio.read_audio", "numpy.abs", "argparse.ArgumentParser", "numpy.zeros", "numpy.pad", "aps.loader.audio.add_room_response" ]
[((3261, 3304), 'numpy.zeros', 'np.zeros', (['[N, mix_nsamps]'], {'dtype': 'np.float32'}), '([N, mix_nsamps], dtype=np.float32)\n', (3269, 3304), True, 'import numpy as np\n'), ((7558, 7582), 'numpy.mean', 'np.mean', (['(spk_utt[0] ** 2)'], {}), '(spk_utt[0] ** 2)\n', (7565, 7582), True, 'import numpy as np\n'), ((9932...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 31 15:50:31 2020 @author: Dr. <NAME> European Space Agency (ESA) European Space Research and Technology Centre (ESTEC) Keplerlaan 1, 2201 AZ Noordwijk, The Netherlands Email: <EMAIL> GitHub: mnguenther Twitter: m_n_guenther Web: www.mnguenther.com ...
[ "allesfitter.exoworlds_rdx.lightcurves.index_transits.get_tmid_observed_transits", "wotan.flatten", "numpy.polyfit", "seaborn.set_style", "numpy.argsort", "numpy.array", "numpy.nanmin", "seaborn.set", "numpy.where", "numpy.diff", "numpy.max", "matplotlib.pyplot.close", "numpy.nanmax", "num...
[((436, 548), 'seaborn.set', 'sns.set', ([], {'context': '"""paper"""', 'style': '"""ticks"""', 'palette': '"""deep"""', 'font': '"""sans-serif"""', 'font_scale': '(1.5)', 'color_codes': '(True)'}), "(context='paper', style='ticks', palette='deep', font='sans-serif',\n font_scale=1.5, color_codes=True)\n", (443, 548...
from operator import itemgetter import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib from openreview_matcher.evals import base_evaluator from openreview_matcher import utils matplotlib.style.use('ggplot') class Evaluator(base_evaluator.Evaluator): """ An Evaluator instan...
[ "numpy.mean", "openreview_matcher.utils.load_obj", "numpy.asarray", "matplotlib.style.use", "operator.itemgetter", "matplotlib.pyplot.subplots" ]
[((213, 243), 'matplotlib.style.use', 'matplotlib.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (233, 243), False, 'import matplotlib\n'), ((740, 764), 'openreview_matcher.utils.load_obj', 'utils.load_obj', (['datapath'], {}), '(datapath)\n', (754, 764), False, 'from openreview_matcher import utils\n'), ((5292, 5...
import unittest import io from svgelements import * class TestElementShape(unittest.TestCase): def test_rect_dict(self): values = { 'tag': 'rect', 'rx': "4", 'ry': "2", 'x': "50", 'y': "51", 'width': "20", ...
[ "io.StringIO", "numpy.linspace" ]
[((15475, 15909), 'io.StringIO', 'io.StringIO', (['u"""<?xml version="1.0" encoding="utf-8" ?>\n <svg>\n <ellipse style="stroke:#fc0000;stroke-width:1;fill:none" cx="0" cy="0" rx="1" ry="1" transform="scale(100) rotate(-90,0,0)"/>\n <rect style="strok...
import numpy as np import math def snr_plot(model, snrs, lbl, test_idx, X_test, Y_test, classes): # Plot confusion matrix acc = {} for snr in snrs: # extract classes @ SNR test_SNRs = list(map(lambda x: lbl[x][1], test_idx)) test_X_i = X_test[np.where(np.array(test_SNRs) == snr)] ...
[ "numpy.mean", "numpy.abs", "numpy.argmax", "numpy.diag", "math.log", "numpy.sum", "numpy.array" ]
[((1188, 1223), 'numpy.sum', 'np.sum', (['((S - mean_S) * (S - mean_S))'], {}), '((S - mean_S) * (S - mean_S))\n', (1194, 1223), True, 'import numpy as np\n'), ((1227, 1254), 'numpy.sum', 'np.sum', (['((S - SN) * (S - SN))'], {}), '((S - SN) * (S - SN))\n', (1233, 1254), True, 'import numpy as np\n'), ((1084, 1094), 'n...
import os import argparse import pickle as pk import numpy as np import matplotlib.pyplot as plt import torch import torch.nn as nn from stgcn import STGCN from GaussianCopula import CopulaLoss from utils import generate_dataset, load_metr_la_data, get_normalized_adj use_gpu = True num_timesteps_input = 12 num_times...
[ "torch.randperm", "torch.from_numpy", "torch.cuda.is_available", "utils.get_normalized_adj", "utils.generate_dataset", "os.path.exists", "numpy.mean", "argparse.ArgumentParser", "GaussianCopula.CopulaLoss", "matplotlib.pyplot.plot", "utils.load_metr_la_data", "stgcn.STGCN", "matplotlib.pyplo...
[((400, 444), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""STGCN"""'}), "(description='STGCN')\n", (423, 444), False, 'import argparse\n'), ((613, 638), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (636, 638), False, 'import torch\n'), ((658, 678), 'torch.dev...
# Author: <NAME> import numpy as np from collections import defaultdict from agent import * ############################################### mdp = createMDP() # Escolhe próximo estado dado uma ação def performAction(pi, P): def nextState(s): ps = P[(s, pi[s])] probs = list(map(lambda x: x[0],...
[ "numpy.random.choice", "collections.defaultdict", "numpy.append" ]
[((1035, 1065), 'collections.defaultdict', 'defaultdict', (['(lambda : (0.0, 0))'], {}), '(lambda : (0.0, 0))\n', (1046, 1065), False, 'from collections import defaultdict\n'), ((2328, 2377), 'numpy.random.choice', 'np.random.choice', (["['UP', 'DOWN', 'LEFT', 'RIGHT']"], {}), "(['UP', 'DOWN', 'LEFT', 'RIGHT'])\n", (23...
import grpc import time from concurrent import futures import drivers.xarm.wrapper.xarm_api as arm import robot_con.xarm_shuidi.shuidi.shuidi_robot as agv import robot_con.xarm_shuidi.xarm_shuidi_pb2 as aa_msg # aa = arm_agv import robot_con.xarm_shuidi.xarm_shuidi_pb2_grpc as aa_rpc import numpy as np class XArmShui...
[ "robot_con.xarm_shuidi.xarm_shuidi_pb2.Status", "robot_con.xarm_shuidi.xarm_shuidi_pb2_grpc.add_XArmShuidiServicer_to_server", "robot_con.xarm_shuidi.shuidi.shuidi_robot.ShuidiRobot", "robot_con.xarm_shuidi.xarm_shuidi_pb2.GripperStatus", "concurrent.futures.ThreadPoolExecutor", "time.sleep", "numpy.arr...
[((3446, 3504), 'robot_con.xarm_shuidi.xarm_shuidi_pb2_grpc.add_XArmShuidiServicer_to_server', 'aa_rpc.add_XArmShuidiServicer_to_server', (['aa_server', 'server'], {}), '(aa_server, server)\n', (3485, 3504), True, 'import robot_con.xarm_shuidi.xarm_shuidi_pb2_grpc as aa_rpc\n'), ((555, 579), 'drivers.xarm.wrapper.xarm_...
# Copyright 2019 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "mindspore.log.info", "mindspore.dataset.GeneratorDataset", "numpy.array", "numpy.array_equal", "pytest.raises" ]
[((992, 1033), 'mindspore.log.info', 'logger.info', (['"""Test 1D Generator : 0 - 63"""'], {}), "('Test 1D Generator : 0 - 63')\n", (1003, 1033), True, 'from mindspore import log as logger\n'), ((1078, 1121), 'mindspore.dataset.GeneratorDataset', 'ds.GeneratorDataset', (['generator_1d', "['data']"], {}), "(generator_1d...
# -*- coding: utf-8 -*- """ __author__ = '{<NAME>}' __email__ = '{<EMAIL>}' """ from module.model import DaNN from module.datafunc import make_dataloaders import torch from tqdm import tqdm import numpy as np import os from convex_adversarial import robust_loss, robust_loss_parallel torch.manual_seed(7) torch.cu...
[ "torch.cuda.manual_seed_all", "torch.manual_seed", "module.model.DaNN", "torch.ones", "torch.nn.CrossEntropyLoss", "module.datafunc.make_dataloaders", "torch.load", "os.path.join", "convex_adversarial.robust_loss", "numpy.exp", "torch.cuda.is_available", "torch.zeros", "torch.where" ]
[((291, 311), 'torch.manual_seed', 'torch.manual_seed', (['(7)'], {}), '(7)\n', (308, 311), False, 'import torch\n'), ((312, 343), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_all', (['(100)'], {}), '(100)\n', (338, 343), False, 'import torch\n'), ((456, 462), 'module.model.DaNN', 'DaNN', ([], {}), '()\n', (46...
""" Python re-implementation of "Visual Object Tracking using Adaptive Correlation Filters" @inproceedings{Bolme2010Visual, title={Visual object tracking using adaptive correlation filters}, author={Bolme, <NAME>. and Beveridge, <NAME> and Draper, <NAME>. and Lui, <NAME>}, booktitle={Computer Vision & Patter...
[ "numpy.mean", "cv2.warpAffine", "numpy.fft.ifft2", "numpy.conj", "numpy.std", "numpy.log", "cv2.getRectSubPix", "pysot.pycftrackers.lib.utils.gaussian2d_labels", "numpy.fft.fft2", "pysot.pycftrackers.lib.utils.cos_window", "numpy.array", "numpy.argmax", "numpy.sum", "numpy.cos", "cv2.cvt...
[((1111, 1129), 'pysot.pycftrackers.lib.utils.cos_window', 'cos_window', (['(w, h)'], {}), '((w, h))\n', (1121, 1129), False, 'from pysot.pycftrackers.lib.utils import gaussian2d_labels, cos_window\n'), ((1147, 1199), 'cv2.getRectSubPix', 'cv2.getRectSubPix', (['first_frame', '(w, h)', 'self._center'], {}), '(first_fra...
# -*- coding: utf-8 -*- """ Created on Mon Jun 29 12:59:04 2020 @author: hartwgj """ # cth 1mm interferometer code import scipy.constants from scipy import fft,ifft from cthmds import CTHData import numpy as np # input the chord # return the density and time axis # other possible keywords: numfwin, phase,SAVEintfr...
[ "numpy.abs", "numpy.where", "numpy.fft.fft", "numpy.max", "numpy.array", "numpy.linspace" ]
[((3043, 3066), 'numpy.fft.fft', 'np.fft.fft', (['sawsig.data'], {}), '(sawsig.data)\n', (3053, 3066), True, 'import numpy as np\n'), ((3162, 3209), 'numpy.linspace', 'np.linspace', (['(0.0)', '(1.0 / (2.0 * dt))', '(length // 2)'], {}), '(0.0, 1.0 / (2.0 * dt), length // 2)\n', (3173, 3209), True, 'import numpy as np\...
# -*- coding: utf-8 -*- # Contains the "Note" class used in our program, that represent a note # and keeps various attributes assigned to it. It also contains static # methods to get a random note, or convert a whole list. import random import re from time import sleep import numpy as np import simpleaudio as sa #...
[ "numpy.abs", "random.choice", "simpleaudio.play_buffer", "time.sleep", "numpy.sin", "re.findall" ]
[((1218, 1243), 'random.choice', 'random.choice', (['NOTE_NAMES'], {}), '(NOTE_NAMES)\n', (1231, 1243), False, 'import random\n'), ((1264, 1291), 'random.choice', 'random.choice', (['NOTE_FIGURES'], {}), '(NOTE_FIGURES)\n', (1277, 1291), False, 'import random\n'), ((1888, 1939), 're.findall', 're.findall', (['"""([A-Z]...
""" cclib (http://cclib.sf.net) is (c) 2006, the cclib development team and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html). """ __revision__ = "$Revision: 668 $" import re import numpy import logfileparser import utils class ORCA(logfileparser.Logfile): """An ORCA log file."...
[ "numpy.array", "numpy.zeros", "doctest.testmod" ]
[((15197, 15239), 'doctest.testmod', 'doctest.testmod', (['orcaparser'], {'verbose': '(False)'}), '(orcaparser, verbose=False)\n', (15212, 15239), False, 'import doctest, orcaparser\n'), ((2516, 2538), 'numpy.zeros', 'numpy.zeros', (['(5,)', '"""d"""'], {}), "((5,), 'd')\n", (2527, 2538), False, 'import numpy\n'), ((96...
#!/usr/bin/env python3 import argparse import math import os import time import numpy as np import torch import torch.nn.functional as F import torch.optim as optim from Steed.optimizationfns import MultiClassLM from Steed.drllib import models, utils, common TEST_ITERS = 1000 RunName = "Test5" def test_net(net, env...
[ "Steed.drllib.common.unpack_batch_a2c", "numpy.clip", "torch.log", "Steed.drllib.utils.float32_preprocessor", "argparse.ArgumentParser", "Steed.drllib.models.AgentA2C", "os.makedirs", "Steed.drllib.models.ModelA2C", "os.path.join", "torch.sqrt", "Steed.optimizationfns.MultiClassLM.LM", "time.t...
[((1146, 1186), 'os.path.join', 'os.path.join', (['"""saves"""', "('ddpg-' + RunName)"], {}), "('saves', 'ddpg-' + RunName)\n", (1158, 1186), False, 'import os\n'), ((1191, 1228), 'os.makedirs', 'os.makedirs', (['save_path'], {'exist_ok': '(True)'}), '(save_path, exist_ok=True)\n', (1202, 1228), False, 'import os\n'), ...
import numpy as np import pandas as pd import matplotlib.pyplot as plt selected_df = pd.read_csv('./../selected_countries.csv') # LatAm latAm = selected_df.loc[selected_df['region'] == 'Latin America & the Caribbean'] latAm = latAm.groupby(['year']).mean().reset_index() # Iterate over main categories main_categories...
[ "numpy.array", "pandas.read_csv", "matplotlib.pyplot.show" ]
[((86, 128), 'pandas.read_csv', 'pd.read_csv', (['"""./../selected_countries.csv"""'], {}), "('./../selected_countries.csv')\n", (97, 128), True, 'import pandas as pd\n'), ((601, 619), 'numpy.array', 'np.array', (['latAm[i]'], {}), '(latAm[i])\n', (609, 619), True, 'import numpy as np\n'), ((767, 777), 'matplotlib.pypl...
import cv2 import numpy as np import pycocotools.mask as mask_util import torch from utils.data.structures.bounding_box import BoxList from utils.data.structures.boxlist_ops import cat_boxlist, boxlist_nms, \ boxlist_ml_nms, boxlist_soft_nms, boxlist_box_voting from utils.data.structures.parsing import f...
[ "utils.data.structures.bounding_box.BoxList", "torch.from_numpy", "numpy.arange", "torch.arange", "numpy.mean", "numpy.asarray", "numpy.max", "numpy.exp", "numpy.min", "utils.data.structures.boxlist_ops.boxlist_ml_nms", "numpy.maximum", "utils.data.structures.boxlist_ops.boxlist_nms", "numpy...
[((2178, 2197), 'utils.data.structures.boxlist_ops.cat_boxlist', 'cat_boxlist', (['result'], {}), '(result)\n', (2189, 2197), False, 'from utils.data.structures.boxlist_ops import cat_boxlist, boxlist_nms, boxlist_ml_nms, boxlist_soft_nms, boxlist_box_voting\n'), ((12086, 12107), 'numpy.min', 'np.min', (['im_shape[0:2]...
""" This script is used to download the public planck data To run it: python get_planck_data.py global.dict It will download maps, likelihood masks and beams of planck """ import numpy as np from pspy import pspy_utils, so_dict import sys import wget import tarfile import astropy.io.fits as fits d = so_dict.so_dict()...
[ "pspy.so_dict.so_dict", "wget.download", "tarfile.open", "numpy.sqrt", "pspy.pspy_utils.create_directory", "numpy.zeros", "astropy.io.fits.open", "numpy.transpose", "numpy.arange" ]
[((303, 320), 'pspy.so_dict.so_dict', 'so_dict.so_dict', ([], {}), '()\n', (318, 320), False, 'from pspy import pspy_utils, so_dict\n'), ((479, 516), 'pspy.pspy_utils.create_directory', 'pspy_utils.create_directory', (['data_dir'], {}), '(data_dir)\n', (506, 516), False, 'from pspy import pspy_utils, so_dict\n'), ((796...
import os print(os.environ.get('tushare_token')) import numpy as np print(np.__version__) # 1.15.1 import matplotlib print(matplotlib.matplotlib_fname()) # import matplotlib.pyplot as plt # x = np.array([1, 2, 3, 4, 5, 6]) # y = np.array([10, 5, 15, 10, 30, 20]) # plt.plot(x, y, color='blue') # plt.show() # plt.sav...
[ "numpy.histogram", "matplotlib.path.Path", "matplotlib.animation.FuncAnimation", "os.environ.get", "numpy.zeros", "matplotlib.patches.PathPatch", "numpy.random.seed", "numpy.full", "numpy.random.randn", "matplotlib.pyplot.subplots", "matplotlib.matplotlib_fname", "matplotlib.pyplot.show" ]
[((560, 584), 'numpy.random.seed', 'np.random.seed', (['(19680801)'], {}), '(19680801)\n', (574, 584), True, 'import numpy as np\n'), ((625, 646), 'numpy.random.randn', 'np.random.randn', (['(1000)'], {}), '(1000)\n', (640, 646), True, 'import numpy as np\n'), ((657, 680), 'numpy.histogram', 'np.histogram', (['data', '...
import numpy as np from nlplingo.tasks.common.binary.binary_event_entity import BinaryEventEntity from nlplingo.common.data_types import int_type class EventArgumentExample(BinaryEventEntity): def __init__(self, arg0, arg1, event_domain, label_str): # def __init__(self, anchor, argument, sentence, event_dom...
[ "numpy.zeros" ]
[((1154, 1190), 'numpy.zeros', 'np.zeros', (['num_labels'], {'dtype': 'int_type'}), '(num_labels, dtype=int_type)\n', (1162, 1190), True, 'import numpy as np\n')]
# Imports here import pandas as pd import numpy as np import time import matplotlib.pyplot as plt import torch from torch import nn, optim from torchvision import datasets, transforms, models, utils import json import scipy.io from pprint import pprint from collections import OrderedDict from PIL import Image import wa...
[ "torch.nn.ReLU", "torchvision.models.densenet161", "torch.exp", "numpy.array", "torch.cuda.is_available", "torch.nn.functional.softmax", "torchvision.datasets.ImageFolder", "torchvision.transforms.ToTensor", "torch.topk", "torchvision.transforms.RandomHorizontalFlip", "torch.nn.NLLLoss", "torc...
[((327, 360), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (350, 360), False, 'import warnings\n'), ((1201, 1260), 'torchvision.datasets.ImageFolder', 'datasets.ImageFolder', (['train_dir'], {'transform': 'train_transforms'}), '(train_dir, transform=train_transforms)\n',...
import numpy as np from UTILS.Calculus import Calculus from UTILS.Tools import Tools # Theoretical background https://arxiv.org/abs/1401.5176 # Mocak, Meakin, Viallet, Arnett, 2014, Compressible Hydrodynamic Mean-Field # # Equations in Spherical Geometry and their Application to Turbulent Stellar # # Convection Data...
[ "numpy.zeros" ]
[((3812, 3824), 'numpy.zeros', 'np.zeros', (['nx'], {}), '(nx)\n', (3820, 3824), True, 'import numpy as np\n')]
#!/usr/bin/env python3 """ File name: viewnet.py Author: <NAME> email: <EMAIL> Date created: 02/09/2017 (DD/MM/YYYY) Python Version: 3.5 Description: Module used for visualization of the network systems generated using netsim.py """ import argparse, os, time,traceback,sys import numpy as...
[ "numpy.log10", "pandas.read_csv", "mpl_toolkits.axes_grid1.inset_locator.inset_axes", "matplotlib.tri.Triangulation", "matplotlib.collections.LineCollection", "networkx.draw_networkx_nodes", "networkx.draw_networkx_edges", "argparse.ArgumentParser", "networkx.get_edge_attributes", "netsim.RandomCo...
[((683, 700), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (694, 700), True, 'import pandas as pd\n'), ((1384, 1402), 'numpy.log10', 'np.log10', (['df.onoff'], {}), '(df.onoff)\n', (1392, 1402), True, 'import numpy as np\n'), ((11384, 11409), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {...
from dataclasses import dataclass from collections import defaultdict from functools import lru_cache from typing import Dict, List import json import warnings from scipy.spatial import distance as spd from torch.distributions.categorical import Categorical from tqdm import tqdm import joblib import langdetect import ...
[ "warnings.catch_warnings", "yaml.load", "torch.Tensor", "langdetect.detect", "numpy.array", "numpy.sum", "collections.defaultdict", "numpy.isnan", "numpy.expand_dims", "json.load", "functools.lru_cache", "warnings.filterwarnings", "scipy.spatial.distance.jensenshannon" ]
[((3019, 3045), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(1000000)'}), '(maxsize=1000000)\n', (3028, 3045), False, 'from functools import lru_cache\n'), ((1089, 1117), 'scipy.spatial.distance.jensenshannon', 'spd.jensenshannon', (['p', 'q', '(2.0)'], {}), '(p, q, 2.0)\n', (1106, 1117), True, 'from scipy.sp...
import datetime import math import operator import sqlite3 import uuid import numpy as np import pandas as pd import pandas.testing as tm import pytest from packaging.version import parse import ibis import ibis.expr.datatypes as dt from ibis import config from ibis import literal as L sa = pytest.importorskip("sqla...
[ "ibis.sqlite.compile", "math.sqrt", "math.log", "pandas.testing.assert_frame_equal", "math.exp", "math.log10", "ibis.NA.fillna", "pytest.mark.xfail", "numpy.where", "numpy.testing.assert_allclose", "pandas.Categorical", "ibis.param", "ibis.table", "packaging.version.parse", "ibis.expr.da...
[((295, 328), 'pytest.importorskip', 'pytest.importorskip', (['"""sqlalchemy"""'], {}), "('sqlalchemy')\n", (314, 328), False, 'import pytest\n'), ((16637, 16726), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""column"""', "[lambda t: 'float_col', lambda t: t['float_col']]"], {}), "('column', [lambda t: 'f...
# logisitc regression classifier for the donut problem. # # the notes for this class can be found at: # https://deeplearningcourses.com/c/data-science-logistic-regression-in-python # https://www.udemy.com/data-science-logistic-regression-in-python from __future__ import print_function, division from builtins import r...
[ "numpy.ones", "numpy.random.random", "matplotlib.pyplot.plot", "numpy.log", "numpy.exp", "numpy.array", "builtins.range", "numpy.cos", "matplotlib.pyplot.scatter", "numpy.concatenate", "numpy.sin", "matplotlib.pyplot.title", "numpy.random.randn", "numpy.round", "matplotlib.pyplot.show" ]
[((914, 948), 'numpy.concatenate', 'np.concatenate', (['[X_inner, X_outer]'], {}), '([X_inner, X_outer])\n', (928, 948), True, 'import numpy as np\n'), ((955, 996), 'numpy.array', 'np.array', (['([0] * (N // 2) + [1] * (N // 2))'], {}), '([0] * (N // 2) + [1] * (N // 2))\n', (963, 996), True, 'import numpy as np\n'), (...
import numpy as np import pandas as pd def get_converging_models_option1(conc_df_interp: pd.DataFrame, n_models: int) -> list: non_converging_models = [] for model_i in range(n_models): last_conc_values = \ conc_df_interp[(conc_df_interp['model'] == model_i) & (conc_df_interp['time_point'].be...
[ "numpy.append", "numpy.array", "numpy.abs", "numpy.repeat" ]
[((2069, 2081), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (2077, 2081), True, 'import numpy as np\n'), ((2093, 2105), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (2101, 2105), True, 'import numpy as np\n'), ((2115, 2127), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (2123, 2127), True, 'import num...
""" HandTracker or HandTrakingModule ================================ It is a simple module to detect hands and do simple projects with hand recognition and machine learning. Hand Detector ------------- Uses: 1. To find and detect hand. 2. To find 21 landmarks in each hand. 3. To find the distance between any ...
[ "cv2.rectangle", "cv2.line", "cv2.putText", "cv2.imshow", "cv2.circle", "cv2.waitKey", "cv2.VideoCapture", "cv2.cvtColor", "mediapipe.python.solutions.hands.Hands", "numpy.interp", "math.hypot", "time.time" ]
[((16800, 17033), 'cv2.rectangle', 'cv.rectangle', (['image', '(rectdim[CornerPoints.Top_Left_Corner][0], rectdim[CornerPoints.\n Top_Left_Corner][1])', '(rectdim[CornerPoints.Bottom_Right_Corner][0], rectdim[CornerPoints.\n Bottom_Right_Corner][1])', 'BGColor', 'cv.FILLED'], {}), '(image, (rectdim[CornerPoints.T...
import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import pickle import gzip np.set_printoptions(threshold=np.inf) f = open('data/ACML_Movies.csv', 'r') movie_strngs = f.read() movie_strngs = movie_strngs.split('\n') movie_strngs = movie_strngs[1:] movie_strngs = movie_strngs[:-1] ratings =...
[ "numpy.copy", "numpy.mean", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "numpy.power", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.argmax", "numpy.max", "numpy.append", "numpy.array", "matplotlib.pyplot.figure", "numpy.zeros", "numpy.dot", "numpy.exp", "nu...
[((105, 142), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.inf'}), '(threshold=np.inf)\n', (124, 142), True, 'import numpy as np\n'), ((485, 502), 'numpy.array', 'np.array', (['ratings'], {}), '(ratings)\n', (493, 502), True, 'import numpy as np\n'), ((544, 566), 'numpy.copy', 'np.copy', (['r...
""" Tests for exact diffuse initialization Notes ----- These tests are against four sources: - Koopman (1997) - The R package KFAS (v1.3.1): test_exact_diffuse_filtering.R - Stata: test_exact_diffuse_filtering_stata.do - Statsmodels state space models using approximate diffuse filtering Koopman (1997) provides anal...
[ "numpy.testing.assert_equal", "statsmodels.tsa.statespace.varmax.VARMAX", "numpy.log", "numpy.column_stack", "numpy.array", "statsmodels.tsa.statespace.kalman_smoother.KalmanSmoother", "numpy.isscalar", "numpy.testing.assert_allclose", "numpy.diagonal", "numpy.eye", "statsmodels.tsa.statespace.d...
[((2534, 2588), 'pandas.PeriodIndex', 'pd.PeriodIndex', ([], {'start': '"""1959Q1"""', 'end': '"""2009Q3"""', 'freq': '"""Q"""'}), "(start='1959Q1', end='2009Q3', freq='Q')\n", (2548, 2588), True, 'import pandas as pd\n'), ((2439, 2464), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (2454, 2...
import numpy as np import pandas as pd import math import scipy.linalg as la import matplotlib.pyplot as plt import seaborn as sns from scipy.spatial import distance import numba from numba import jit, int32, int64, float32, float64 import pstats @jit(nopython = True) def p_ij(d_matrix, perplexity = 40.0, tol = 1e-6):...
[ "numpy.random.normal", "numpy.fabs", "seaborn.color_palette", "numpy.log", "numpy.asarray", "numpy.fill_diagonal", "numpy.exp", "numpy.sum", "numpy.zeros", "numba.jit", "numpy.empty", "numpy.random.seed", "numpy.expand_dims", "matplotlib.pyplot.figure", "pandas.DataFrame", "numpy.trans...
[((249, 267), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (252, 267), False, 'from numba import jit, int32, int64, float32, float64\n'), ((2063, 2081), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (2066, 2081), False, 'from numba import jit, int32, int64, float32, fl...
from __future__ import print_function, division from horoma.cfg import DEVICE import torch.nn as nn import torch.optim as optim import time import copy import numpy as np import torch from sklearn import warnings from horoma.experiments import HoromaExperiment from horoma.utils.data import HoromaDataset from...
[ "torch.optim.SGD", "torch.nn.CrossEntropyLoss", "torch.load", "torch.max", "numpy.asarray", "sklearn.warnings.catch_warnings", "torch.nn.Conv2d", "sklearn.warnings.simplefilter", "torch.tensor", "torch.sum", "torch.utils.data.DataLoader", "torch.set_grad_enabled", "torchvision.transforms.ToT...
[((2488, 2540), 'torch.optim.SGD', 'optim.SGD', (['params_to_update'], {'lr': '(0.0001)', 'momentum': '(0.9)'}), '(params_to_update, lr=0.0001, momentum=0.9)\n', (2497, 2540), True, 'import torch.optim as optim\n'), ((2632, 2643), 'time.time', 'time.time', ([], {}), '()\n', (2641, 2643), False, 'import time\n'), ((5960...
""" (C) 2017 <NAME> [London Machine Learning Study Group](http://www.meetup.com/London-Machine-Learning-Study-Group/members/) This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/. """ import numpy as n...
[ "numpy.mean", "numpy.unique", "sklearn.model_selection.train_test_split", "numpy.std", "numpy.genfromtxt", "sklearn.metrics.accuracy_score", "sklearn.metrics.confusion_matrix" ]
[((5842, 5913), 'numpy.genfromtxt', 'np.genfromtxt', (['"""gender_height_weight.csv"""'], {'delimiter': '""","""', 'skip_header': '(1)'}), "('gender_height_weight.csv', delimiter=',', skip_header=1)\n", (5855, 5913), True, 'import numpy as np\n'), ((6133, 6200), 'sklearn.model_selection.train_test_split', 'train_test_s...
import numpy as np from q_learning.utils import Scalarize from coinrun import make from coinrun import setup_utils def testing(): setup_utils.setup_and_load() episodes = 10 env = Scalarize(make('standard', num_envs=1)) for i in range(episodes): env.reset() while True: env....
[ "numpy.random.randint", "coinrun.setup_utils.setup_and_load", "coinrun.make" ]
[((137, 165), 'coinrun.setup_utils.setup_and_load', 'setup_utils.setup_and_load', ([], {}), '()\n', (163, 165), False, 'from coinrun import setup_utils\n'), ((204, 232), 'coinrun.make', 'make', (['"""standard"""'], {'num_envs': '(1)'}), "('standard', num_envs=1)\n", (208, 232), False, 'from coinrun import make\n'), ((3...
from tfdlg.data import BlockDataset from tfdlg.dialog.data import DialogDataset from tfdlg.dialog.data import DialogClsDataset from tfdlg.models import PreLNDecoder from tfdlg.losses import PaddingLoss from tfdlg.tokenizers import SentencePieceTokenizer from tfdlg.dialog.tokenizers import encode_dialog from typing impo...
[ "tfdlg.dialog.data.DialogClsDataset.from_generator", "tfdlg.data.BlockDataset.from_generator", "tensorflow.keras.losses.BinaryCrossentropy", "tfdlg.dialog.tokenizers.encode_dialog", "tfdlg.tokenizers.SentencePieceTokenizer.load", "tfdlg.generations.TopKTopPGenerator", "numpy.array", "tfdlg.losses.Padd...
[((627, 640), 'tfdlg.losses.PaddingLoss', 'PaddingLoss', ([], {}), '()\n', (638, 640), False, 'from tfdlg.losses import PaddingLoss\n'), ((712, 760), 'tfdlg.tokenizers.SentencePieceTokenizer.load', 'SentencePieceTokenizer.load', ([], {'model_dir': 'model_dir'}), '(model_dir=model_dir)\n', (739, 760), False, 'from tfdlg...
import plotly.graph_objs as go import numpy as np def make_scatter(products_df, xcol, ycol, hovercol, tickprefix=''): f_scatter = go.FigureWidget([go.Scatter(x = products_df[xcol], y = products_df[ycol], mode = 'markers', ...
[ "numpy.random.rand", "plotly.graph_objs.Scatter" ]
[((152, 356), 'plotly.graph_objs.Scatter', 'go.Scatter', ([], {'x': 'products_df[xcol]', 'y': 'products_df[ycol]', 'mode': '"""markers"""', 'text': '[x[:30] for x in products_df[hovercol]]', 'selected_marker_size': '(5)', 'marker_size': '(3)', 'selected_marker_color': '"""red"""', 'opacity': '(0.8)'}), "(x=products_df[...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2022 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
[ "ltv_mpc.solve_mpc", "pylab.ion", "pylab.plot", "pylab.grid", "numpy.array", "numpy.linspace", "pylab.clf" ]
[((1353, 1419), 'numpy.array', 'np.array', (['[[1.0, T, T ** 2 / 2.0], [0.0, 1.0, T], [0.0, 0.0, 1.0]]'], {}), '([[1.0, T, T ** 2 / 2.0], [0.0, 1.0, T], [0.0, 0.0, 1.0]])\n', (1361, 1419), True, 'import numpy as np\n'), ((1453, 1494), 'numpy.array', 'np.array', (['[T ** 3 / 6.0, T ** 2 / 2.0, T]'], {}), '([T ** 3 / 6.0...
import copy from matplotlib import cm import matplotlib.colors import numpy as np import hexrd.ui.constants from hexrd.ui.brightness_contrast_editor import BrightnessContrastEditor from hexrd.ui.hexrd_config import HexrdConfig from hexrd.ui.ui_loader import UiLoader from hexrd.ui.utils import block_signals class C...
[ "numpy.nanpercentile", "hexrd.ui.utils.block_signals", "hexrd.ui.ui_loader.UiLoader", "copy.copy", "hexrd.ui.brightness_contrast_editor.BrightnessContrastEditor", "hexrd.ui.hexrd_config.HexrdConfig" ]
[((648, 658), 'hexrd.ui.ui_loader.UiLoader', 'UiLoader', ([], {}), '()\n', (656, 658), False, 'from hexrd.ui.ui_loader import UiLoader\n'), ((2350, 2383), 'hexrd.ui.brightness_contrast_editor.BrightnessContrastEditor', 'BrightnessContrastEditor', (['self.ui'], {}), '(self.ui)\n', (2374, 2383), False, 'from hexrd.ui.bri...
import unittest import numpy import chainer from chainer import backend from chainer.backends import cuda from chainer import links from chainer import testing from chainer.testing import attr class TestInceptionBNBase(unittest.TestCase): in_channels = 3 out1, proj3, out3, proj33, out33, proj_pool = 3, 2, ...
[ "chainer.Variable", "chainer.testing.run_module", "chainer.testing.product", "chainer.backend.get_array_module", "chainer.using_config", "numpy.random.uniform", "chainer.links.InceptionBN", "chainer.get_dtype", "chainer.backends.cuda.to_gpu" ]
[((3462, 3500), 'chainer.testing.run_module', 'testing.run_module', (['__name__', '__file__'], {}), '(__name__, __file__)\n', (3480, 3500), False, 'from chainer import testing\n'), ((445, 464), 'chainer.get_dtype', 'chainer.get_dtype', ([], {}), '()\n', (462, 464), False, 'import chainer\n'), ((593, 736), 'chainer.link...
import os import gc import numpy as np import numpy.ma as ma import matplotlib matplotlib.use('TKAgg') import matplotlib.pyplot as plt ############################################################################### ############################################################################### ####################...
[ "matplotlib.pyplot.ylabel", "numpy.arange", "numpy.ma.max", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.max", "matplotlib.pyplot.close", "numpy.linspace", "os.path.isdir", "numpy.min", "matplotlib.pyplot.cla", "numpy.abs", "matplotlib.pyplot.savefig", "matplotlib.use", "...
[((81, 104), 'matplotlib.use', 'matplotlib.use', (['"""TKAgg"""'], {}), "('TKAgg')\n", (95, 104), False, 'import matplotlib\n'), ((4845, 4858), 'numpy.ma.max', 'ma.max', (['sMass'], {}), '(sMass)\n', (4851, 4858), True, 'import numpy.ma as ma\n'), ((4882, 4910), 'numpy.linspace', 'np.linspace', (['(0)', 'sMass_max', '(...
import os.path import os import random import math from scipy.misc import imsave import cv2 import numpy as np from skimage.util import random_noise import math def add_noise(img, mode='gaussian', mean=0, var=0.01, level=None): """ img: 0-1 or 0-255 noisy_img: 0-255 """ if level: var = (lev...
[ "cv2.imwrite", "os.path.exists", "random.shuffle", "scipy.misc.imsave", "os.path.join", "math.sqrt", "random.seed", "numpy.random.seed", "skimage.util.random_noise", "os.mkdir", "cv2.imread" ]
[((2713, 2727), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (2724, 2727), False, 'import random\n'), ((2728, 2745), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (2742, 2745), True, 'import numpy as np\n'), ((349, 408), 'skimage.util.random_noise', 'random_noise', (['img'], {'mode': 'mode', '...
import numpy as np import scanpy as sc from scipy.sparse import csr_matrix, find from scipy.sparse.linalg import eigs class DiffusionMap: """This Diffusion Map implementation is inspired from the implementation of https://github.com/dpeerlab/Palantir/blob/master/src/palantir/utils.py """ def __init_...
[ "numpy.sort", "numpy.floor", "numpy.linalg.norm", "numpy.argsort", "numpy.real", "numpy.zeros", "scanpy.pp.neighbors", "numpy.exp", "scipy.sparse.find", "scanpy.AnnData", "scipy.sparse.linalg.eigs", "numpy.ravel" ]
[((731, 747), 'scanpy.AnnData', 'sc.AnnData', (['data'], {}), '(data)\n', (741, 747), True, 'import scanpy as sc\n'), ((756, 831), 'scanpy.pp.neighbors', 'sc.pp.neighbors', (['temp'], {'n_neighbors': 'self.n_neighbors', 'n_pcs': '(0)'}), '(temp, n_neighbors=self.n_neighbors, n_pcs=0, **self.kwargs)\n', (771, 831), True...
import torch from torch.utils.tensorboard import SummaryWriter from torch.nn.utils.clip_grad import clip_grad_norm_ from torch import distributions from boltzmann import protein from boltzmann.generative import transforms from boltzmann import nn from boltzmann import utils from boltzmann import training from sklearn.n...
[ "boltzmann.generative.transforms.PiecewiseRationalQuadraticCDF", "torch.min", "torch.cuda.is_available", "boltzmann.utils.GradualWarmupScheduler", "simtk.openmm.app.PDBFile", "torch.normal", "simtk.openmm.app.ForceField", "numpy.arange", "os.remove", "torch.utils.tensorboard.SummaryWriter", "os....
[((630, 740), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""train.py"""', 'description': '"""Train generative model of molecular conformation."""'}), "(prog='train.py', description=\n 'Train generative model of molecular conformation.')\n", (653, 740), False, 'import argparse\n'), ((854, 89...
import os, argparse, traceback, glob, librosa, random, itertools, time, torch import numpy as np import soundfile as sf import torch.optim as optim import torch.nn.functional as F from torch.utils.data import Dataset, DataLoader from gan import Generator, MultiScale from hparams import * class MelDataset(Dataset): ...
[ "gan.MultiScale", "os.makedirs", "argparse.ArgumentParser", "gan.Generator", "torch.load", "os.path.join", "torch.from_numpy", "traceback.print_exc", "itertools.count", "torch.nn.functional.relu", "torch.utils.data.DataLoader", "torch.no_grad", "numpy.load", "time.time" ]
[((1191, 1283), 'torch.utils.data.DataLoader', 'DataLoader', (['trainset'], {'batch_size': 'batch_size', 'num_workers': '(0)', 'shuffle': '(True)', 'drop_last': '(True)'}), '(trainset, batch_size=batch_size, num_workers=0, shuffle=True,\n drop_last=True)\n', (1201, 1283), False, 'from torch.utils.data import Dataset...
from orbit.models.ktrlite import KTRLite import pandas as pd import numpy as np import math from scipy.stats import nct from enum import Enum import torch import matplotlib.pyplot as plt from copy import deepcopy from ..constants.constants import ( KTRTimePointPriorKeys, PredictMethod, TrainingMetaKeys, ...
[ "pandas.Index", "numpy.array", "numpy.nanmean", "copy.deepcopy", "numpy.arange", "pandas.to_datetime", "numpy.repeat", "numpy.where", "numpy.max", "matplotlib.pyplot.close", "numpy.concatenate", "pandas.DataFrame", "orbit.models.ktrlite.KTRLite", "numpy.ones", "numpy.in1d", "numpy.sque...
[((16118, 16166), 'numpy.array', 'np.array', (['self._positive_regressor_init_knot_loc'], {}), '(self._positive_regressor_init_knot_loc)\n', (16126, 16166), True, 'import numpy as np\n'), ((16218, 16268), 'numpy.array', 'np.array', (['self._positive_regressor_init_knot_scale'], {}), '(self._positive_regressor_init_knot...
""" Loading and interacting with data in the change filmstrips notebook, inside the Real_world_examples folder. """ # Load modules import os import dask import datacube import warnings import numpy as np import pandas as pd import xarray as xr import matplotlib.pyplot as plt from odc.algo import geomedian_with_mads fr...
[ "ipyleaflet.basemap_to_tiles", "datacube.utils.geometry.assign_crs", "numpy.sqrt", "datacube.Datacube", "odc.ui.select_on_a_map", "numpy.log", "deafrica_tools.datahandling.mostcommon_crs", "pandas.cut", "deafrica_tools.datahandling.load_ard", "deafrica_tools.dask.create_local_dask_cluster", "mat...
[((4518, 4562), 'ipyleaflet.basemap_to_tiles', 'basemap_to_tiles', (['basemaps.Esri.WorldImagery'], {}), '(basemaps.Esri.WorldImagery)\n', (4534, 4562), False, 'from ipyleaflet import basemaps, basemap_to_tiles\n'), ((4580, 4665), 'odc.ui.select_on_a_map', 'select_on_a_map', ([], {'height': '"""600px"""', 'layers': '(b...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 3 15:28:32 2021 @author: <NAME> & <NAME> """ # ============================================================================= # Importing necessary libraries # ============================================================================= import pa...
[ "data_filtering.university_exam_data.rename_axis", "matplotlib.pyplot.savefig", "data_filtering.university_exam_data.insert", "pandas.DataFrame", "numpy.log", "data_filtering.highschool.insert", "stargazer.stargazer.Stargazer", "plotly.express.line", "statsmodels.api.add_constant", "statsmodels.fo...
[((1788, 1848), 'matplotlib.pyplot.savefig', 'plt.savefig', (["(graph_location + 'correlation-coefficients.png')"], {}), "(graph_location + 'correlation-coefficients.png')\n", (1799, 1848), True, 'import matplotlib.pyplot as plt\n'), ((2336, 2507), 'statsmodels.formula.api.ols', 'ols', (['"""factor ~ log_percentile_o...
import hivae import vae import sys import torch import functools import my_util import math import pathlib import argparse import numpy as np filedir = pathlib.Path(__file__).resolve().parent sys.path.append(str(filedir.parent / "privacy")) from tensorflow_privacy.privacy.analysis.rdp_accountant import compute_rdp, get...
[ "math.ceil", "argparse.ArgumentParser", "pathlib.Path", "numpy.array", "tensorflow_privacy.privacy.analysis.rdp_accountant.compute_rdp", "tensorflow_privacy.privacy.analysis.rdp_accountant.get_privacy_spent" ]
[((958, 1002), 'tensorflow_privacy.privacy.analysis.rdp_accountant.compute_rdp', 'compute_rdp', (['q', 'sgd_sigma', 'sgd_steps', 'orders'], {}), '(q, sgd_sigma, sgd_steps, orders)\n', (969, 1002), False, 'from tensorflow_privacy.privacy.analysis.rdp_accountant import compute_rdp, get_privacy_spent\n'), ((1017, 1061), '...
# -*- coding: utf-8 -*- """ Created on Thu Mar 29 19:36:28 2018 @author: fhp7 """ import virtual_battery as virbat import numpy as np from bokeh.plotting import figure from bokeh.io import output_file, show import model_output as out #%% Example of running the model once straight through model_df = v...
[ "bokeh.io.show", "bokeh.plotting.figure", "virtual_battery.acquire_data", "numpy.arange", "virtual_battery.save_results", "virtual_battery.set_params", "model_output.out_loc", "virtual_battery.simulate", "virtual_battery.visualize" ]
[((319, 373), 'virtual_battery.acquire_data', 'virbat.acquire_data', (['"""Cowen_Green_Button_20180403.csv"""'], {}), "('Cowen_Green_Button_20180403.csv')\n", (338, 373), True, 'import virtual_battery as virbat\n'), ((385, 404), 'virtual_battery.set_params', 'virbat.set_params', ([], {}), '()\n', (402, 404), True, 'imp...
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import matplotlib.pyplot as plt class TimeSeries(): """A class that holds time series data Attributes: - series (pd.Series) - a pandas Series with a Datetime index. The index must be in time order. """ def __...
[ "pandas.Series", "numpy.arange", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.figure", "numpy.isnan", "bim_graph.BimGraph", "matplotlib.pyplot.get_cmap" ]
[((10928, 10938), 'bim_graph.BimGraph', 'BimGraph', ([], {}), '()\n', (10936, 10938), False, 'from bim_graph import BimGraph\n'), ((977, 1023), 'pandas.Series', 'pd.Series', ([], {'index': '[dates, times]', 'data': 's.values'}), '(index=[dates, times], data=s.values)\n', (986, 1023), True, 'import pandas as pd\n'), ((3...
# ______________________________________________________________________________ # ****************************************************************************** # # The simplest robot task: Just go and reach a point # # ______________________________________________________________________________ # ******************...
[ "dynamic_graph.plug", "numpy.identity", "dynamic_graph.sot.core.GainAdaptive", "dynamic_graph.sot.dynamics_pinocchio.fromSotToPinocchio", "dynamic_graph.sot.core.Task", "numpy.hstack", "dynamic_graph.sot.core.meta_tasks.setGain", "dynamic_graph.sot.core.FeatureGeneric", "pinocchio.JointModelFreeFlye...
[((3002, 3108), 'dynamic_graph.sot.dynamics_pinocchio.humanoid_robot.HumanoidRobot', 'HumanoidRobot', (['robotName', 'pinocchioRobot.model', 'pinocchioRobot.data', 'halfSitting', 'OperationalPointsMap'], {}), '(robotName, pinocchioRobot.model, pinocchioRobot.data,\n halfSitting, OperationalPointsMap)\n', (3015, 3108...
# generated bbox ground truth from pixel-wise segmentation # it currently only generate one bbox from __future__ import print_function import numpy as np import h5py import os import pdb mask_path = 'data/socket' #f = h5py.File(os.path.join(mask_path, "seg_mask.h5"), 'r') #bbox_path = 'data/socket/seg_bbox' #f = h5py....
[ "os.path.exists", "numpy.where", "os.path.join", "numpy.array", "os.mkdir" ]
[((389, 439), 'os.path.join', 'os.path.join', (['mask_path', '"""train_socket_label_u.h5"""'], {}), "(mask_path, 'train_socket_label_u.h5')\n", (401, 439), False, 'import os\n'), ((464, 513), 'os.path.join', 'os.path.join', (['mask_path', '"""test_socket_label_u.h5"""'], {}), "(mask_path, 'test_socket_label_u.h5')\n", ...
# Copyright (C) 2015-2019 <NAME> # SPDX-License-Identifier: Apache-2.0 import dolfin import numpy from matplotlib import pyplot from ocellaris.utils import gather_lines_on_root, timeit, ocellaris_error from . import Probe, register_probe INCLUDE_BOUNDARY = False WRITE_INTERVAL = 1 SHOW_INTERVAL = 0 @register_probe...
[ "ocellaris.utils.ocellaris_error", "dolfin.Timer", "numpy.array", "numpy.zeros", "matplotlib.pyplot.figure", "dolfin.vertices", "dolfin.cells", "matplotlib.pyplot.ion", "dolfin.Cell", "ocellaris.utils.gather_lines_on_root", "dolfin.facets" ]
[((8623, 8642), 'dolfin.facets', 'dolfin.facets', (['mesh'], {}), '(mesh)\n', (8636, 8642), False, 'import dolfin\n'), ((12020, 12046), 'numpy.zeros', 'numpy.zeros', (['(2, 3)', 'float'], {}), '((2, 3), float)\n', (12031, 12046), False, 'import numpy\n'), ((12067, 12088), 'numpy.zeros', 'numpy.zeros', (['(2)', 'float']...
# -*- coding: utf-8 -*- import glob import jiagu import numpy as np from random import random def normalize(vec): total = sum(vec) assert(abs(total) > 1e-6) for i in range(len(vec)): assert(vec[i] >= 0) vec[i] = float(vec[i]) / total def get_prob(vec, prob): assert (len(vec) == len(...
[ "numpy.argmax", "numpy.array", "numpy.zeros", "numpy.random.randint", "jiagu.seg", "random.random", "glob.glob" ]
[((367, 375), 'random.random', 'random', ([], {}), '()\n', (373, 375), False, 'from random import random\n'), ((1567, 1602), 'glob.glob', 'glob.glob', (["(self.filepath + '/*.txt')"], {}), "(self.filepath + '/*.txt')\n", (1576, 1602), False, 'import glob\n'), ((2618, 2691), 'numpy.zeros', 'np.zeros', (['[self.number_of...
import logging import math from collections import defaultdict from enum import Enum from itertools import chain from random import randint, random from typing import List import numpy as np from scipy import optimize import util.optimizer_utils as utils class Algorithm(Enum): """The currently possible algorithm...
[ "logging.getLogger", "util.optimizer_utils.round_to_nearest_60", "math.isnan", "util.optimizer_utils.differentiate_and_interpolate", "scipy.optimize.basinhopping", "collections.defaultdict", "random.random", "numpy.isinf", "random.randint", "util.optimizer_utils.differentiate" ]
[((568, 602), 'logging.getLogger', 'logging.getLogger', (['"""src.Optimizer"""'], {}), "('src.Optimizer')\n", (585, 602), False, 'import logging\n'), ((996, 1024), 'collections.defaultdict', 'defaultdict', (['(lambda : np.inf)'], {}), '(lambda : np.inf)\n', (1007, 1024), False, 'from collections import defaultdict\n'),...
# 可以自己import我们平台支持的第三方python模块,比如pandas、numpy等。 from rqalpha.api import * import pandas as pd import numpy as np from datetime import timedelta from pybrain.datasets import SequentialDataSet from pybrain.tools.shortcuts import buildNetwork from pybrain.structure.networks import Network from pybrain.structure.modules im...
[ "pybrain.tools.shortcuts.buildNetwork", "pybrain.datasets.SequentialDataSet", "numpy.isnan", "pandas.DataFrame", "pybrain.supervised.RPropMinusTrainer" ]
[((460, 483), 'pybrain.datasets.SequentialDataSet', 'SequentialDataSet', (['(4)', '(1)'], {}), '(4, 1)\n', (477, 483), False, 'from pybrain.datasets import SequentialDataSet\n'), ((574, 652), 'pybrain.tools.shortcuts.buildNetwork', 'buildNetwork', (['(4)', '(1)', '(1)'], {'hiddenclass': 'LSTMLayer', 'outputbias': '(Fal...
#!/usr/bin/env python3 import sys import os import biopac_preproc as bio import numpy as np sub = sys.argv[1] ses = sys.argv[2] ftype = sys.argv[3] wdir = '/data' SET_DPI = 100 cwd = os.getcwd() os.chdir(wdir) filename = f'sub-{sub}/ses-{ses}/func_phys/sub-{sub}_ses-{ses}_task-breathhold_physio' npidx = np.genfro...
[ "os.chdir", "biopac_preproc.parttwo", "numpy.genfromtxt", "os.getcwd" ]
[((187, 198), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (196, 198), False, 'import os\n'), ((200, 214), 'os.chdir', 'os.chdir', (['wdir'], {}), '(wdir)\n', (208, 214), False, 'import os\n'), ((374, 413), 'numpy.genfromtxt', 'np.genfromtxt', (['f"""{filename}_co_orig.1D"""'], {}), "(f'{filename}_co_orig.1D')\n", (387,...
""" Provides analysis of site symmetries. """ import numpy as np from pymatgen.symmetry.analyzer import SpacegroupAnalyzer as sga from pymatgen.core.operations import SymmOp def get_site_symmetries(struc, precision=0.1): """ Get all the point group operations centered on each atomic site in the form [[po...
[ "pymatgen.symmetry.analyzer.SpacegroupAnalyzer", "numpy.allclose", "pymatgen.core.operations.SymmOp.from_rotation_and_translation" ]
[((1060, 1093), 'pymatgen.symmetry.analyzer.SpacegroupAnalyzer', 'sga', (['tempstruc'], {'symprec': 'precision'}), '(tempstruc, symprec=precision)\n', (1063, 1093), True, 'from pymatgen.symmetry.analyzer import SpacegroupAnalyzer as sga\n'), ((2570, 2709), 'pymatgen.core.operations.SymmOp.from_rotation_and_translation'...
""" helpers.py for RiskPaths """ import numpy as np from bisect import bisect_left def partition(start, finish, step=1): """ Helper function to return an inclusive equal-spaced range, i.e. finish will be the last element """ return np.linspace(start, finish, (finish-start)/step + 1) def interp(range, value): "...
[ "numpy.linspace", "bisect.bisect_left" ]
[((238, 293), 'numpy.linspace', 'np.linspace', (['start', 'finish', '((finish - start) / step + 1)'], {}), '(start, finish, (finish - start) / step + 1)\n', (249, 293), True, 'import numpy as np\n'), ((418, 443), 'bisect.bisect_left', 'bisect_left', (['range', 'value'], {}), '(range, value)\n', (429, 443), False, 'from...
# coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. from pyiron_atomistics import Project as ProjectCore from pyiron_feal.factories.structure import StructureFactory from p...
[ "pyiron_feal.factories.structure.StructureFactory", "pyiron_feal.subroutines.ZeroK", "numpy.append", "numpy.array", "pyiron_feal.factories.job.JobFactory", "pyiron_feal.subroutines.MCMDSRO" ]
[((936, 1041), 'numpy.array', 'np.array', (["['2005--Mendelev-M-I--Al-Fe--LAMMPS--ipr1',\n '2020--Farkas-D--Fe-Ni-Cr-Co-Al--LAMMPS--ipr1']"], {}), "(['2005--Mendelev-M-I--Al-Fe--LAMMPS--ipr1',\n '2020--Farkas-D--Fe-Ni-Cr-Co-Al--LAMMPS--ipr1'])\n", (944, 1041), True, 'import numpy as np\n'), ((1104, 1203), 'numpy....
from __future__ import absolute_import, division, print_function import os import re import pickle import warnings import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from rlssm import plotting from .utils import list_individual_variables from .stan_utility import check_all_diag...
[ "numpy.mean", "pickle.dump", "re.compile", "numpy.log", "os.getcwd", "numpy.exp", "numpy.sum", "numpy.array", "pandas.unique", "pandas.melt", "numpy.var", "seaborn.FacetGrid" ]
[((6053, 6075), 'numpy.exp', 'np.exp', (['log_likelihood'], {}), '(log_likelihood)\n', (6059, 6075), True, 'import numpy as np\n'), ((6094, 6121), 'numpy.mean', 'np.mean', (['likelihood'], {'axis': '(0)'}), '(likelihood, axis=0)\n', (6101, 6121), True, 'import numpy as np\n'), ((6165, 6179), 'numpy.log', 'np.log', (['m...
import torch import random import torchvision.transforms as transforms import numpy as np import cv2 from poissonblending import blend from multiprocessing import Process, Queue, Pool import time import sys def gen_input_mask(shape, position, w_h): """ * inputs: - shape (sequence, required): ...
[ "torchvision.transforms.functional.to_tensor", "torchvision.transforms.functional.to_pil_image", "cv2.seamlessClone", "torch.unsqueeze", "numpy.array", "multiprocessing.Pool", "torch.zeros", "multiprocessing.Queue", "numpy.transpose", "random.randint", "torch.cat", "poissonblending.blend" ]
[((1654, 1672), 'torch.zeros', 'torch.zeros', (['shape'], {}), '(shape)\n', (1665, 1672), False, 'import torch\n'), ((3503, 3538), 'random.randint', 'random.randint', (['(0)', '(mask_w - harea_w)'], {}), '(0, mask_w - harea_w)\n', (3517, 3538), False, 'import random\n'), ((3554, 3589), 'random.randint', 'random.randint...
"""Train spoken word classifier and test on Flickr-Audio one-shot speech task. Author: <NAME> Contact: <EMAIL> Date: October 2019 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import datetime import functools import os import time from absl impor...
[ "tensorflow.keras.layers.Dense", "absl.logging.log", "tensorflow.nn.softmax", "moonshot.baselines.model_utils.save_model", "tensorflow.keras.losses.CategoricalCrossentropy", "tensorflow.reduce_mean", "absl.flags.DEFINE_enum", "absl.flags.DEFINE_float", "moonshot.utils.logging.absl_file_logger", "s...
[((1873, 1958), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""episodes"""', '(400)', '"""number of L-way K-shot learning episodes"""'], {}), "('episodes', 400,\n 'number of L-way K-shot learning episodes')\n", (1893, 1958), False, 'from absl import flags\n'), ((1955, 2045), 'absl.flags.DEFINE_integer', ...
import numpy as np import state def estimate_tauW(): # Update tauW shape=state.N * state.n/2+1e-3 rate=np.sum((state.W-state.YHa)*(state.W-state.YHa))/2+1e-3 state.tauW=np.random.gamma(shape,1/rate,1) return()
[ "numpy.sum", "numpy.random.gamma" ]
[((192, 227), 'numpy.random.gamma', 'np.random.gamma', (['shape', '(1 / rate)', '(1)'], {}), '(shape, 1 / rate, 1)\n', (207, 227), True, 'import numpy as np\n'), ((117, 170), 'numpy.sum', 'np.sum', (['((state.W - state.YHa) * (state.W - state.YHa))'], {}), '((state.W - state.YHa) * (state.W - state.YHa))\n', (123, 170)...
# class to help manage loading stored camera poses import numpy as np from director import transformUtils class CameraPoses(object): def __init__(self, posegraphFile=None): self.posegraphFile = posegraphFile if self.posegraphFile is not None: self.loadCameraPoses(posegraphFile) ...
[ "numpy.searchsorted", "numpy.array", "numpy.loadtxt", "director.transformUtils.transformFromPose" ]
[((379, 404), 'numpy.loadtxt', 'np.loadtxt', (['posegraphFile'], {}), '(posegraphFile)\n', (389, 404), True, 'import numpy as np\n'), ((430, 473), 'numpy.array', 'np.array', (['(data[:, 0] * 1000000.0)'], {'dtype': 'int'}), '(data[:, 0] * 1000000.0, dtype=int)\n', (438, 473), True, 'import numpy as np\n'), ((750, 801),...
import time import pytest import numpy as np import pandas as pd import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import filestore import filestore.api import filestore.handlers import hxnfly.fly import hxnfly.log from hxnfly.callbacks import FlyLiveCrossSection from hxnfly.fly2d import Fly2D...
[ "hxnfly.callbacks.FlyLiveCrossSection", "numpy.random.rand", "pandas.DataFrame", "matplotlib.use", "hxnfly.callbacks.FlyLiveImage", "matplotlib.pyplot.clf", "time.sleep", "filestore.api.retrieve", "numpy.array", "numpy.linspace", "pytest.raises", "hxnfly.fly2d.Fly2D", "pytest.fixture", "hx...
[((85, 106), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (99, 106), False, 'import matplotlib\n'), ((2077, 2177), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""', 'params': "['with_mock_detector', 'with_sim_detector', 'relative']"}), "(scope='function', params=['with_mock_d...
from utils.customloader import CustomDataset, DatasetSplit from torchvision import datasets, transforms from torch.utils.data import DataLoader from sklearn.model_selection import train_test_split import numpy as np import torch import random def get_dataloader(data='mnist', test_size=0.5, num_workers=0, batch_size=32...
[ "torch.utils.data.DataLoader", "sklearn.model_selection.train_test_split", "torchvision.datasets.MNIST", "numpy.expand_dims", "torchvision.transforms.Normalize", "utils.customloader.CustomDataset", "torchvision.transforms.ToTensor" ]
[((788, 820), 'numpy.expand_dims', 'np.expand_dims', (['total_data_x', '(-1)'], {}), '(total_data_x, -1)\n', (802, 820), True, 'import numpy as np\n'), ((840, 872), 'numpy.expand_dims', 'np.expand_dims', (['total_data_y', '(-1)'], {}), '(total_data_y, -1)\n', (854, 872), True, 'import numpy as np\n'), ((918, 1029), 'sk...
"""Common functions for polar coding.""" import numba import numpy as np from ..constants import INFINITY from .node_types import NodeTypes @numba.njit def zero( llr: np.array, mask_steps: int = 0, last_chunk_type: int = 0, ) -> np.array: """Compute beta values for ZERO node. https:/...
[ "numpy.fabs", "numpy.prod", "numpy.ones", "numpy.argsort", "numpy.sum", "numpy.zeros", "numpy.sign" ]
[((673, 708), 'numpy.zeros', 'np.zeros', (['llr.size'], {'dtype': 'np.double'}), '(llr.size, dtype=np.double)\n', (681, 708), True, 'import numpy as np\n'), ((906, 917), 'numpy.sum', 'np.sum', (['llr'], {}), '(llr)\n', (912, 917), True, 'import numpy as np\n'), ((1196, 1208), 'numpy.fabs', 'np.fabs', (['llr'], {}), '(l...
# # Copyright 2018 Analytics Zoo Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "zoo.pipeline.api.autograd.square", "zoo.pipeline.api.autograd.mm", "numpy.ones", "zoo.pipeline.api.keras.models.Sequential", "math.sqrt", "zoo.pipeline.api.keras.models.Model", "numpy.zeros", "bigdl.nn.layer.Squeeze", "zoo.pipeline.api.autograd.sqrt", "bigdl.nn.layer.Sum" ]
[((2272, 2296), 'zoo.pipeline.api.keras.models.Model', 'Model', (['input', 'next_input'], {}), '(input, next_input)\n', (2277, 2296), False, 'from zoo.pipeline.api.keras.models import Model\n'), ((4094, 4107), 'zoo.pipeline.api.autograd.mm', 'auto.mm', (['q', 'k'], {}), '(q, k)\n', (4101, 4107), True, 'import zoo.pipel...
import tensorflow as tf import os from PIL import Image import numpy as np import logging import time from dl.step1_cnn import Step1CNN from dl.util import visualize_boxes_and_labels_on_image_array_V1 logger = logging.getLogger("detect") class FreezerDetectorFactory: _detector = {} @staticmethod def get...
[ "logging.getLogger", "PIL.Image.fromarray", "PIL.Image.open", "time.sleep", "numpy.squeeze", "os.path.realpath", "numpy.array", "os.path.dirname", "os.path.split", "tensorflow.ConfigProto", "dl.util.visualize_boxes_and_labels_on_image_array_V1", "time.time" ]
[((211, 238), 'logging.getLogger', 'logging.getLogger', (['"""detect"""'], {}), "('detect')\n", (228, 238), False, 'import logging\n'), ((828, 844), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (842, 844), True, 'import tensorflow as tf\n'), ((1487, 1498), 'time.time', 'time.time', ([], {}), '()\n', (1...
import numpy as np import matplotlib.pyplot as plt x = np.arange(0,100) y = x*2 # Functional Method fig = plt.figure() ax = fig.add_axes([0, 0, 1, 1]) ax.plot(x, y) ax.set_title('title') ax.set_xlabel('X') ax.set_ylabel('Y') plt.show()
[ "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.show" ]
[((63, 80), 'numpy.arange', 'np.arange', (['(0)', '(100)'], {}), '(0, 100)\n', (72, 80), True, 'import numpy as np\n'), ((119, 131), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (129, 131), True, 'import matplotlib.pyplot as plt\n'), ((244, 254), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' gnpy.core.utils =============== This module contains utility functions that are used with gnpy. ''' import json import numpy as np from numpy import pi, cos, sqrt, log10 from scipy import constants def load_json(filename): with open(filename, 'r') as f: ...
[ "numpy.abs", "numpy.log10", "numpy.sqrt", "numpy.arange", "json.load", "numpy.shape", "json.dump" ]
[((1006, 1053), 'numpy.arange', 'np.arange', (['startf', '(stopf + spacing / 2)', 'spacing'], {}), '(startf, stopf + spacing / 2, spacing)\n', (1015, 1053), True, 'import numpy as np\n'), ((3403, 3411), 'numpy.sqrt', 'sqrt', (['hf'], {}), '(hf)\n', (3407, 3411), False, 'from numpy import pi, cos, sqrt, log10\n'), ((331...
from abc import abstractmethod import logging from hampel import hampel import mlflow import numpy as np import pandas as pd from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split from sklearn.metrics import mean_absolute_error from sklearn.svm import SVR from xgboost im...
[ "logging.basicConfig", "logging.getLogger", "mlflow.start_run", "sklearn.model_selection.train_test_split", "numpy.random.choice", "mlflow.log_metric", "mlflow.active_run", "mlflow.xgboost.log_model", "numpy.column_stack", "mlflow.set_experiment", "numpy.array", "numpy.random.seed", "sigeml....
[((746, 791), 'mlflow.set_experiment', 'mlflow.set_experiment', (['config.experiment_name'], {}), '(config.experiment_name)\n', (767, 791), False, 'import mlflow\n'), ((830, 869), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (849, 869), False, 'import logging\...
import os import dash_html_components as html import dash_core_components as dcc from dash.dependencies import Input, Output import dash_bio import pandas as pd import numpy as np import math import plotly.graph_objects as go from layout_helper import run_standalone_app text_style = {"color": "#506784", "font-family"...
[ "numpy.log10", "plotly.graph_objects.layout.Margin", "dash.dependencies.Output", "dash_html_components.Br", "os.path.join", "layout_helper.run_standalone_app", "dash.dependencies.Input", "dash_core_components.Markdown", "os.path.abspath", "dash_bio.Pileup", "dash_html_components.H4" ]
[((12471, 12533), 'layout_helper.run_standalone_app', 'run_standalone_app', (['layout', 'callbacks', 'header_colors', '__file__'], {}), '(layout, callbacks, header_colors, __file__)\n', (12489, 12533), False, 'from layout_helper import run_standalone_app\n'), ((477, 570), 'os.path.join', 'os.path.join', (['"""https://s...
import matplotlib.pyplot as plt import numpy as np from lms_code.analysis.run_bem import get_slip_magnitude import lms_code.lib.rep2 as rep2 import lms_code.plots.plot_all as lms_plot def main(): lms_plot.setup() fig = plt.figure() which_model = 'all_details' bem_soln = rep2.load('bem_' + which_model)...
[ "matplotlib.pyplot.text", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.log", "lms_code.plots.plot_all.setup", "matplotlib.pyplot.fill_between", "numpy.exp", "lms_code.lib.rep2.load", "matplotlib.pyplot.figure", "numpy.lin...
[((201, 217), 'lms_code.plots.plot_all.setup', 'lms_plot.setup', ([], {}), '()\n', (215, 217), True, 'import lms_code.plots.plot_all as lms_plot\n'), ((228, 240), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (238, 240), True, 'import matplotlib.pyplot as plt\n'), ((289, 320), 'lms_code.lib.rep2.load', 'r...
import argparse import os import pickle import random import time from tqdm import tqdm from multiprocessing import Pool import torch import numpy as np import matplotlib.pyplot as plt from util.bioinformatics_algorithms.edit_distance import cross_distance_matrix from util.data_handling.string_generator import Indepen...
[ "os.path.exists", "numpy.random.geometric", "pickle.dump", "argparse.ArgumentParser", "os.makedirs", "util.bioinformatics_algorithms.edit_distance.cross_distance_matrix", "numpy.asarray", "random.seed", "os.path.dirname", "multiprocessing.Pool", "util.data_handling.string_generator.IndependentGe...
[((865, 916), 'util.bioinformatics_algorithms.edit_distance.cross_distance_matrix', 'cross_distance_matrix', (['sequences_str', 'sequences_str'], {}), '(sequences_str, sequences_str)\n', (886, 916), False, 'from util.bioinformatics_algorithms.edit_distance import cross_distance_matrix\n'), ((2796, 2821), 'argparse.Argu...
import time import os os.environ["CUDA_VISIBLE_DEVICES"] = "-1" import tensorflow as tf from tensorflow.python.saved_model import tag_constants from PIL import Image from absl import app, flags, logging import cv2 import numpy as np from absl.flags import FLAGS from tensorflow.compat.v1 import ConfigProto from tensorf...
[ "tensorflow.shape", "cv2.imshow", "core.analysis.create_dashboard", "tensorflow.keras.models.load_model", "absl.flags.DEFINE_float", "tensorflow.saved_model.load", "cv2.moveWindow", "centroid_tracking.tracker.Tracker", "absl.flags.DEFINE_boolean", "cv2.VideoWriter", "absl.app.run", "cv2.VideoW...
[((619, 677), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""framework"""', '"""tf"""', '"""(tf, tflite, trt"""'], {}), "('framework', 'tf', '(tf, tflite, trt')\n", (638, 677), False, 'from absl import app, flags, logging\n'), ((678, 778), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""weights_ball"...
import serial import sys import time import numpy as np import struct import threading import matplotlib.pyplot as plt def readTSI(dev, bdrate, samplesNb, periodMs : int): ser = serial.Serial(dev, bdrate, timeout=10) command = "SSR" + str(periodMs).zfill(4) ser.write(command.encode()) ser.write(b'\r')...
[ "threading.Event", "numpy.array", "serial.Serial", "numpy.savetxt", "threading.Thread", "numpy.loadtxt", "time.time", "matplotlib.pyplot.subplots", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((2122, 2139), 'threading.Event', 'threading.Event', ([], {}), '()\n', (2137, 2139), False, 'import threading\n'), ((184, 222), 'serial.Serial', 'serial.Serial', (['dev', 'bdrate'], {'timeout': '(10)'}), '(dev, bdrate, timeout=10)\n', (197, 222), False, 'import serial\n'), ((1159, 1176), 'numpy.array', 'np.array', (['...
from reliapy._messages import * from scipy.stats import norm import numpy as np from reliapy.math import spectral_decomposition, cholesky_decomposition class Random: """ ``Random`` simple random sampling. **Input:** * **distribution_obj** (`object`) Object of ``JointDistribution``. **Att...
[ "numpy.sqrt", "scipy.stats.norm.rvs", "numpy.array", "reliapy.math.cholesky_decomposition", "scipy.stats.norm.cdf", "reliapy.math.spectral_decomposition" ]
[((1634, 1648), 'numpy.array', 'np.array', (['mean'], {}), '(mean)\n', (1642, 1648), True, 'import numpy as np\n'), ((1668, 1681), 'numpy.array', 'np.array', (['std'], {}), '(std)\n', (1676, 1681), True, 'import numpy as np\n'), ((2229, 2314), 'scipy.stats.norm.rvs', 'norm.rvs', ([], {'loc': '(0)', 'scale': '(1)', 'siz...
import sys import numpy as np from scipy.stats import describe import os import time import matplotlib import pandas as pd from sklearn.base import ClassifierMixin, BaseEstimator import warnings import scipy import sklearn from sklearn.model_selection import train_test_split from sklearn.decomposition import PCA import...
[ "pandas.read_csv", "matplotlib.pyplot.ylabel", "numpy.hstack", "sklearn.ensemble.AdaBoostClassifier", "sklearn.neighbors.KNeighborsClassifier", "multiprocessing.cpu_count", "sklearn.metrics.roc_auc_score", "numpy.count_nonzero", "numpy.array", "numpy.argsort", "scipy.stats.expon", "numpy.arang...
[((361, 382), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (375, 382), False, 'import matplotlib\n'), ((1806, 1822), 'matplotlib.pyplot.title', 'plt.title', (['title'], {}), '(title)\n', (1815, 1822), True, 'import matplotlib.pyplot as plt\n'), ((1827, 1859), 'matplotlib.pyplot.xlabel', 'plt.xl...