code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
""" Move object from one visual marker to another """ import sys import cv2 import numpy as np import obj_loader from utils import (calculate_dist_corners, get_camera_params, get_matrix, load_ref_images, render, get_homographies_contour) if __name__ == "__main__": OBJ_PATH = sys.argv[1] ...
[ "utils.get_camera_params", "utils.get_matrix", "cv2.waitKey", "obj_loader.OBJ", "utils.calculate_dist_corners", "cv2.imshow", "utils.load_ref_images", "cv2.VideoCapture", "utils.render", "numpy.array", "numpy.dot", "utils.get_homographies_contour", "cv2.destroyAllWindows", "sys.exit" ]
[((326, 363), 'obj_loader.OBJ', 'obj_loader.OBJ', (['OBJ_PATH'], {'swapyz': '(True)'}), '(OBJ_PATH, swapyz=True)\n', (340, 363), False, 'import obj_loader\n'), ((390, 407), 'utils.load_ref_images', 'load_ref_images', ([], {}), '()\n', (405, 407), False, 'from utils import calculate_dist_corners, get_camera_params, get_...
# Copyright (c) 2018 <NAME>, <NAME> # All rights reserved. # # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. import mSCM import sys import numpy as np from numpy.random import choice from numpy.random import seed import random nbr = int(sys.argv[1]) random.seed(nbr...
[ "numpy.random.seed", "random.seed" ]
[((305, 321), 'random.seed', 'random.seed', (['nbr'], {}), '(nbr)\n', (316, 321), False, 'import random\n'), ((322, 341), 'numpy.random.seed', 'np.random.seed', (['nbr'], {}), '(nbr)\n', (336, 341), True, 'import numpy as np\n')]
# 引入 sqlite 套件 import sqlite3 import numpy as np import matplotlib.pyplot as plt # %matplotlib inline #定義資料庫位置 conn = sqlite3.connect('database.db') db_connection = conn.cursor() List_Ecg_Signal = [] ## 空列表 #t查詢數據 rows = db_connection.execute("SELECT serialno,time,length,date,ecg,qrs,beat,feature,measuremen...
[ "numpy.frombuffer", "sqlite3.connect" ]
[((119, 149), 'sqlite3.connect', 'sqlite3.connect', (['"""database.db"""'], {}), "('database.db')\n", (134, 149), False, 'import sqlite3\n'), ((1028, 1062), 'numpy.frombuffer', 'np.frombuffer', (['row[4]'], {'dtype': '"""<f4"""'}), "(row[4], dtype='<f4')\n", (1041, 1062), True, 'import numpy as np\n')]
import copy import cv2 import glob import json import numpy as np import os from .box_utils import compute_box_3d, boxes_to_corners_3d, get_size from .rotation import convert_angle_axis_to_matrix3 from .taxonomy import class_names, ARKitDatasetConfig def TrajStringToMatrix(traj_str): """ convert traj_str into tr...
[ "copy.deepcopy", "numpy.ones_like", "os.path.basename", "numpy.asarray", "numpy.zeros", "numpy.identity", "os.path.exists", "numpy.float", "numpy.ones", "cv2.imread", "numpy.mean", "numpy.linalg.inv", "numpy.loadtxt", "numpy.array", "numpy.dot", "numpy.eye", "os.path.join", "numpy....
[((1363, 1375), 'numpy.eye', 'np.eye', (['(4)', '(4)'], {}), '(4, 4)\n', (1369, 1375), True, 'import numpy as np\n'), ((1453, 1478), 'numpy.linalg.inv', 'np.linalg.inv', (['extrinsics'], {}), '(extrinsics)\n', (1466, 1478), True, 'import numpy as np\n'), ((1565, 1585), 'numpy.loadtxt', 'np.loadtxt', (['filename'], {}),...
# # Copyright (c) 2021 Intel Corporation # # 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...
[ "tensorflow_serving.apis.get_model_metadata_pb2.GetModelMetadataRequest", "tensorflow_serving.apis.predict_pb2.PredictRequest", "tensorflow.core.framework.tensor_shape_pb2.TensorShapeProto.Dim", "tensorflow.core.framework.tensor_pb2.TensorProto", "ovmsclient.tfs_compat.grpc.requests.GrpcModelStatusRequest",...
[((8055, 8083), 'numpy.array', 'array', (['[1, 2, 3]'], {'dtype': 'int8'}), '([1, 2, 3], dtype=int8)\n', (8060, 8083), False, 'from numpy import array, float64, int32, int8, float128, float32\n'), ((11394, 11417), 'tensorflow_serving.apis.get_model_status_pb2.GetModelStatusRequest', 'GetModelStatusRequest', ([], {}), '...
""" Module containing all general purpose functions shared by other modules. This module is not intended for the direct use by a User. Therefore, I will only docstring functions if I see fit to do so. LOG --- 11/07/18 Changed the way vector path is analysed. Now, the initial analysis is done with the geometri...
[ "numpy.linalg.eigvals", "numpy.triu", "numpy.sum", "numpy.arctan2", "numpy.allclose", "numpy.einsum", "numpy.argmin", "numpy.around", "numpy.mean", "numpy.linalg.norm", "numpy.sin", "numpy.arange", "numpy.round", "sklearn.cluster.DBSCAN", "scipy.optimize.minimize", "numpy.zeros_like", ...
[((11504, 11515), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (11512, 11515), True, 'import numpy as np\n'), ((11997, 12048), 'numpy.array', 'np.array', (['([com - com_adjust] * coordinates.shape[0])'], {}), '([com - com_adjust] * coordinates.shape[0])\n', (12005, 12048), True, 'import numpy as np\n'), ((12618, ...
#!/usr/bin/env python3 from typing import List import numpy as np import copy import pprint as pp from scipy.misc import logsumexp from scipy.stats import beta from neuralmonkey.vocabulary import Vocabulary from n_gram_model import NGramModel from hypothesis import Hypothesis, ExpandFunction from beam_search import...
[ "beam_search.empty_hypothesis", "numpy.empty", "beam_search.compute_feature", "beam_search.score_hypothesis", "numpy.argsort", "numpy.argpartition", "beam_search.expand_null", "beam_search.log_softmax", "numpy.in1d" ]
[((1875, 1922), 'numpy.empty', 'np.empty', ([], {'shape': '(rows, time_steps)', 'dtype': 'tuple'}), '(shape=(rows, time_steps), dtype=tuple)\n', (1883, 1922), True, 'import numpy as np\n'), ((3544, 3569), 'beam_search.log_softmax', 'log_softmax', (['logits_table'], {}), '(logits_table)\n', (3555, 3569), False, 'from be...
# --- # jupyter: # jupytext: # formats: ipynb,py # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.9.1+dev # kernelspec: # display_name: Python [conda env:generic_expression] * # language: python # name: conda-env-g...
[ "pandas.read_csv", "os.getcwd", "sklearn.preprocessing.MinMaxScaler", "scipy.stats.spearmanr", "ponyo.utils.read_config", "pandas.isnull", "matplotlib.pyplot.colorbar", "numpy.array", "seaborn.jointplot", "os.path.join", "pandas.concat" ]
[((987, 1021), 'ponyo.utils.read_config', 'utils.read_config', (['config_filename'], {}), '(config_filename)\n', (1004, 1021), False, 'from ponyo import utils\n'), ((1174, 1222), 'os.path.join', 'os.path.join', (['base_dir', '"""human_general_analysis"""'], {}), "(base_dir, 'human_general_analysis')\n", (1186, 1222), F...
import matplotlib import matplotlib.pyplot as plt import numpy as np import os import warnings from matplotlib import colors matplotlib.rc("font",family='AR PL SungtiL GB') warnings.filterwarnings('ignore') def vis_national(national, native, null, x): fig = plt.figure() ax = fig.add_subplot(111) plt.gri...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.axhline", "matplotlib.rc", "matplotlib.pyplot.plot", "warnings.filterwarnings", "matplotlib.pyplot.bar", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.array", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pypl...
[((126, 174), 'matplotlib.rc', 'matplotlib.rc', (['"""font"""'], {'family': '"""AR PL SungtiL GB"""'}), "('font', family='AR PL SungtiL GB')\n", (139, 174), False, 'import matplotlib\n'), ((175, 208), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (198, 208), False, 'impor...
# Copyright 2019 Graphcore Ltd. import tensorflow as tf import os import time import argparse import numpy as np import random from tensorflow.python.ipu.scopes import ipu_scope from tensorflow.python.ipu import ipu_compiler from seq2seq_edits import AttentionWrapperNoAssert, dynamic_decode, TrainingHelperNoCond, Gre...
[ "tensorflow.contrib.seq2seq.BahdanauAttention", "util.get_config", "tensorflow.reduce_sum", "tensorflow.contrib.seq2seq.LuongAttention", "argparse.ArgumentParser", "tensorflow.trainable_variables", "seq2seq_edits.GreedyEmbeddingHelperNoCond", "random.sample", "time.strftime", "tensorflow.logging.s...
[((566, 608), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)\n', (590, 608), True, 'import tensorflow as tf\n'), ((14999, 15084), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""NMT model in TensorFlow to run on the IPU"""'}...
import cv2 import numpy as np from random import randint from functools import reduce from os import walk from scipy.spatial import ConvexHull DIMENSIONS = (512, 512) def fragment_overlay(background_img, masked_fragment): mask = masked_fragment.astype(int).sum(-1) == np.zeros(DIMENSIONS) backgrou...
[ "cv2.GaussianBlur", "numpy.abs", "os.walk", "cv2.warpAffine", "numpy.random.randint", "cv2.getRotationMatrix2D", "random.randint", "cv2.cvtColor", "cv2.split", "numpy.random.choice", "cv2.addWeighted", "cv2.createCLAHE", "numpy.dot", "cv2.merge", "scipy.spatial.ConvexHull", "cv2.add", ...
[((329, 387), 'numpy.where', 'np.where', (['mask[..., None]', 'background_img', 'masked_fragment'], {}), '(mask[..., None], background_img, masked_fragment)\n', (337, 387), True, 'import numpy as np\n'), ((1016, 1054), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2LAB'], {}), '(image, cv2.COLOR_BGR2LAB)\n',...
# View more python tutorials on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial # 12 - contours """ Please note, this script is for python3+. If you are using python2+, please modify it accordi...
[ "matplotlib.pyplot.clabel", "numpy.meshgrid", "matplotlib.pyplot.show", "matplotlib.pyplot.yticks", "numpy.exp", "numpy.linspace", "matplotlib.pyplot.xticks" ]
[((576, 597), 'numpy.linspace', 'np.linspace', (['(-3)', '(3)', 'n'], {}), '(-3, 3, n)\n', (587, 597), True, 'import numpy as np\n'), ((602, 623), 'numpy.linspace', 'np.linspace', (['(-3)', '(3)', 'n'], {}), '(-3, 3, n)\n', (613, 623), True, 'import numpy as np\n'), ((630, 647), 'numpy.meshgrid', 'np.meshgrid', (['x', ...
import kfp import kfp.dsl as dsl from kfp.components import create_component_from_func import kfp.components as comp IMAGE = 'salazar99/python-kubeflow:latest' DATA_URL = 'https://gs-kubeflow-pipelines.nyc3.digitaloceanspaces.com/clean-spam-data.csv' # Download data # def download_data(source_path: str, output_csv: c...
[ "numpy.save", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.feature_extraction.text.TfidfVectorizer", "kfp.components.create_component_from_func", "kfp.compiler.Compiler", "kfp.components.InputPath", "kfp.components.load_component_from_url", "sklearn.feature_selection.Selec...
[((621, 771), 'kfp.components.load_component_from_url', 'kfp.components.load_component_from_url', (['"""https://raw.githubusercontent.com/kubeflow/pipelines/master/components/web/Download/component.yaml"""'], {}), "(\n 'https://raw.githubusercontent.com/kubeflow/pipelines/master/components/web/Download/component.yam...
# ============================================================================== # Copyright 2019 - <NAME> # # NOTICE: Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, ...
[ "diplomacy_research.models.state_space.get_current_season", "diplomacy_research.models.datasets.base_builder.VarProtoField", "diplomacy_research.models.state_space.get_orderable_locs_for_powers", "diplomacy_research.models.state_space.get_order_based_mask", "numpy.zeros", "diplomacy_research.models.state_...
[((1513, 1540), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1530, 1540), False, 'import logging\n'), ((4610, 4630), 'diplomacy.Map', 'Map', (['state_proto.map'], {}), '(state_proto.map)\n', (4613, 4630), False, 'from diplomacy import Map\n'), ((4653, 4698), 'diplomacy_research.models....
import csv import numpy as np import torch import time class Timer(object): """ docstring for Timer """ def __init__(self): super(Timer, self).__init__() self.total_time = 0.0 self.calls = 0 self.start_time = 0.0 self.diff = 0.0 self.average_time = 0.0 def tic(self): self.start_time = time.time() ...
[ "numpy.random.beta", "torch.randperm", "csv.writer", "time.time" ]
[((307, 318), 'time.time', 'time.time', ([], {}), '()\n', (316, 318), False, 'import time\n'), ((1435, 1476), 'csv.writer', 'csv.writer', (['self.log_file'], {'delimiter': '"""\t"""'}), "(self.log_file, delimiter='\\t')\n", (1445, 1476), False, 'import csv\n'), ((367, 378), 'time.time', 'time.time', ([], {}), '()\n', (...
# check utils zdecomp def izmat_zdecomp(): import numpy as np from limetr.special_mat import izmat ok = True tol = 1e-10 # setup problem # ------------------------------------------------------------------------- k = 3 n = [5, 2, 4] z_list = [] tr_u_list = [] tr_s_list = ...
[ "numpy.random.randn", "limetr.special_mat.izmat.zdecomp", "numpy.zeros", "numpy.hstack", "numpy.linalg.svd", "numpy.vstack" ]
[((530, 547), 'numpy.vstack', 'np.vstack', (['z_list'], {}), '(z_list)\n', (539, 547), True, 'import numpy as np\n'), ((631, 651), 'numpy.hstack', 'np.hstack', (['tr_s_list'], {}), '(tr_s_list)\n', (640, 651), True, 'import numpy as np\n'), ((664, 683), 'numpy.zeros', 'np.zeros', (['tr_u.size'], {}), '(tr_u.size)\n', (...
''' Created on 13 Aug 2020 @author: <NAME> ''' from .ts_util import * import numpy as np from typing import List, Tuple class ts_data(object): def __init__(self, ts: np.array, prop_train: float =0.75, has_time:bool = True, delta_t:float = 1.0): ''' Utility object for time series data. ...
[ "numpy.linalg.inv" ]
[((2492, 2521), 'numpy.linalg.inv', 'np.linalg.inv', (['self.train_std'], {}), '(self.train_std)\n', (2505, 2521), True, 'import numpy as np\n')]
# %% [markdown] """ # Target Tracking This example demonstrates the kernel-based stochastic optimal control algorithm and the dynamic programming algorithm. By default, it uses a nonholonomic vehicle system (unicycle dynamics), and seeks to track a v-shaped trajectory. To run the example, use the following command: ...
[ "functools.partial", "gym_socks.sampling.random_sampler", "matplotlib.pyplot.show", "numpy.abs", "matplotlib.pyplot.plot", "matplotlib.pyplot.axes", "numpy.power", "matplotlib.pyplot.legend", "numpy.rad2deg", "matplotlib.pyplot.figure", "numpy.array", "gym.envs.registration.make", "numpy.lin...
[((1343, 1358), 'gym.envs.registration.make', 'make', (['system_id'], {}), '(system_id)\n', (1347, 1358), False, 'from gym.envs.registration import make\n'), ((1833, 1874), 'gym_socks.sampling.random_sampler', 'random_sampler', ([], {'sample_space': 'sample_space'}), '(sample_space=sample_space)\n', (1847, 1874), False...
""" ckwg +31 Copyright 2016-2020 by Kitware, Inc. 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 list of conditions and...
[ "kwiver.vital.types.rotation.interpolate_rotation", "numpy.asarray", "numpy.array", "kwiver.vital.types.RotationD", "kwiver.vital.types.RotationF", "numpy.testing.assert_equal", "numpy.linalg.norm", "numpy.eye", "numpy.testing.assert_array_almost_equal", "kwiver.vital.types.rotation.interpolated_r...
[((1827, 1850), 'numpy.asarray', 'numpy.asarray', (['a', 'dtype'], {}), '(a, dtype)\n', (1840, 1850), False, 'import numpy\n'), ((2028, 2039), 'kwiver.vital.types.RotationD', 'RotationD', ([], {}), '()\n', (2037, 2039), False, 'from kwiver.vital.types import rotation, RotationD, RotationF\n'), ((2111, 2122), 'kwiver.vi...
# This file is part of the Astrometry.net suite. # Licensed under a 3-clause BSD style license - see LICENSE from __future__ import print_function from __future__ import absolute_import import os from astrometry.util.fits import fits_table import numpy as np import logging import tempfile import sys py3 = (sys.version...
[ "os.remove", "os.close", "os.path.join", "numpy.round", "numpy.unique", "numpy.meshgrid", "numpy.zeros_like", "os.path.dirname", "os.path.exists", "numpy.log10", "numpy.minimum", "os.path.basename", "os.rename", "astropy.io.fits.open", "astrometry.util.fits.fits_table", "astrometry.uti...
[((4601, 4654), 'numpy.array', 'np.array', (['[1.4e-10, 9e-11, 1.2e-10, 1.8e-10, 7.4e-10]'], {}), '([1.4e-10, 9e-11, 1.2e-10, 1.8e-10, 7.4e-10])\n', (4609, 4654), True, 'import numpy as np\n'), ((4721, 4742), 'numpy.log', 'np.log', (['_lup_to_mag_b'], {}), '(_lup_to_mag_b)\n', (4727, 4742), True, 'import numpy as np\n'...
import base64 import json import sys import wave from flask import Flask, jsonify, request from flask_cors import CORS import parselmouth import pandas as pd from scipy.signal import find_peaks import numpy as np import matplotlib.pyplot as plt app = Flask(__name__) app_config = {"host": "0.0.0.0", "port": sys.argv[1...
[ "matplotlib.pyplot.xlim", "wave.open", "parselmouth.Sound", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "flask_cors.CORS", "matplotlib.pyplot.twinx", "numpy.frombuffer", "flask.Flask", "numpy.empty", "flask.request.environ.get", "matplotlib.pyplot.figure", "flask.jsonify", "matplot...
[((253, 268), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (258, 268), False, 'from flask import Flask, jsonify, request\n'), ((537, 581), 'flask_cors.CORS', 'CORS', (['app'], {'resource': "{'/*': {'origins': '*'}}"}), "(app, resource={'/*': {'origins': '*'}})\n", (541, 581), False, 'from flask_cors impo...
# Lint as: python2, python3 # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # 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 # ...
[ "lingvo.tasks.car.kitti_metadata.KITTIMetadata", "lingvo.compat.gfile.Open", "numpy.load", "lingvo.compat.gfile.MkDir", "lingvo.tasks.car.tools.kitti_data.VeloToCameraTransformation", "lingvo.compat.app.run", "lingvo.compat.gfile.Exists", "absl.flags.DEFINE_string", "lingvo.compat.logging.info", "...
[((1752, 1964), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""decoder_path"""', 'None', '"""Paths to decoder file containing output of decoder for everything. Either supply this argument or individual decoder paths for cars, pedestrians and cyclists."""'], {}), "('decoder_path', None,\n 'Paths to decoder ...
# !/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import datetime import json import math import os import random import time import numpy as np import torch import torch.optim as optim import torch.utils.data import compression from compression.utils import load_i...
[ "numpy.random.seed", "argparse.ArgumentParser", "torch.optim.lr_scheduler.StepLR", "os.path.isfile", "numpy.mean", "optimization.training.train", "os.path.join", "optimization.training.evaluate", "random.randint", "torch.utils.data.DataLoader", "numpy.std", "torch.load", "random.seed", "co...
[((384, 401), 'random.seed', 'random.seed', (['(7610)'], {}), '(7610)\n', (395, 401), False, 'import random\n'), ((412, 485), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Discrete Normalizing flows"""'}), "(description='PyTorch Discrete Normalizing flows')\n", (435, 485), False...
#!/usr/bin/env python3 from pymoos import pymoos import time import matplotlib.pyplot as plt import numpy as np import threading fig, ax = plt.subplots(subplot_kw=dict(polar=True)) ax.set_theta_direction(-1) ax.set_theta_zero_location('N') nav_line, des_line, = ax.plot([], [], 'r', [], [], 'b') nav_line.set_label('NAV...
[ "matplotlib.pyplot.show", "numpy.deg2rad", "threading.Lock", "matplotlib.pyplot.draw", "numpy.arange" ]
[((3430, 3440), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3438, 3440), True, 'import matplotlib.pyplot as plt\n'), ((906, 922), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (920, 922), False, 'import threading\n'), ((2401, 2432), 'numpy.arange', 'np.arange', (['(0)', 'self.n_speed', '(0.1)'], {}...
import numpy as np from random import random import math class Path: def __init__(self, r): self.radius = r self.path = [] def circleDiscretization(self, qtd_poits = 40): self.path = [] angle_diff = 2 * math.pi / qtd_poits for i in range(qtd_poits): point...
[ "math.sin", "numpy.array", "math.cos", "math.sqrt" ]
[((614, 656), 'math.sqrt', 'math.sqrt', (['((x1 - x2) ** 2 + (y1 - y2) ** 2)'], {}), '((x1 - x2) ** 2 + (y1 - y2) ** 2)\n', (623, 656), False, 'import math\n'), ((1655, 1669), 'numpy.array', 'np.array', (['path'], {}), '(path)\n', (1663, 1669), True, 'import numpy as np\n'), ((1132, 1152), 'numpy.array', 'np.array', ([...
#! /usr/bin/env python import random import numpy as np class Environment: def __init__(self, size=[3,4], start=(0,0), end=(2,3), block=[(1,1)], false_end=(1,3)): self.size = size self.state = np.zeros(self.size) self.action_space = self.generate_action_space() self.state_space = s...
[ "numpy.zeros" ]
[((215, 234), 'numpy.zeros', 'np.zeros', (['self.size'], {}), '(self.size)\n', (223, 234), True, 'import numpy as np\n')]
import numpy as np import matplotlib.pyplot as plt from lib5c.util.plotting import plotter @plotter def plot_pvalue_histogram(data, xlabel='pvalue', **kwargs): """ Plots a p-value or q-value distribution. Parameters ---------- data : np.ndarray The p-values or q-values to plot. kwarg...
[ "matplotlib.pyplot.ylabel", "numpy.linspace" ]
[((492, 522), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""number of pixels"""'], {}), "('number of pixels')\n", (502, 522), True, 'import matplotlib.pyplot as plt\n'), ((465, 486), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(21)'], {}), '(0, 1, 21)\n', (476, 486), True, 'import numpy as np\n')]
#PHDF_PATH = '/home/brryan/rpm/phoebus/external/parthenon/scripts/python/' #PHDF_PATH = '/home/brryan/github/phoebus/external/parthenon/scripts/python/' #DUMP_NAMES = '/home/brryan/builds/phoebus/torus.out1.*.phdf' DUMP_NAMES = 'torus.out1.*.phdf' import argparse import numpy as np import sys import matplotlib.pyplot ...
[ "mpl_toolkits.axes_grid1.make_axes_locatable", "matplotlib.pyplot.show", "argparse.ArgumentParser", "numpy.zeros", "numpy.sin", "numpy.exp", "numpy.cos", "glob.glob", "matplotlib.pyplot.Circle", "sys.exit", "parthenon_tools.phdf.phdf", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig...
[((644, 693), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Plot torus"""'}), "(description='Plot torus')\n", (667, 693), False, 'import argparse\n'), ((1092, 1112), 'parthenon_tools.phdf.phdf', 'phdf.phdf', (['dfnams[0]'], {}), '(dfnams[0])\n', (1101, 1112), False, 'from parthenon_tool...
import numpy as np # Python3 program to find element # closet to given target. # Returns element closest to target in arr[] def findClosest(arr, n, target): # Corner cases if (target <= arr[0][0]): return 0 if (target >= arr[n - 1][0]): return n - 1 # Doing binary search i = 0 ...
[ "numpy.zeros" ]
[((1791, 1803), 'numpy.zeros', 'np.zeros', (['(60)'], {}), '(60)\n', (1799, 1803), True, 'import numpy as np\n')]
import numpy as np import tensorflow as tf import tfops_short as Z class model: def __init__(self, sess, hps, train_iterator, data_init): # === Define session self.sess = sess self.hps = hps # === Input tensors with tf.name_scope('input'): s_shape = [None, hps....
[ "tensorflow.zeros_like", "tfops_short.f", "tfops_short.squeeze", "tfops_short.invertible_1x1_conv", "tfops_short.unsplit", "tfops_short.gaussian_diag", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.variable_scope", "tensorflow.compat.v1.placeholder", "tensorflow.name_s...
[((3096, 3117), 'tfops_short.squeeze', 'Z.squeeze', (['(x - 0.5)', '(4)'], {}), '(x - 0.5, 4)\n', (3105, 3117), True, 'import tfops_short as Z\n'), ((5841, 5874), 'tensorflow.zeros_like', 'tf.zeros_like', (['z'], {'dtype': '"""float32"""'}), "(z, dtype='float32')\n", (5854, 5874), True, 'import tensorflow as tf\n'), ((...
""" Test Object Tracking This script receives a .tsv file as input which has already been labelled and runs the four selected objects tracking algorithm on all videos. The target object that is being gazed at by the person is presented in blue. Parameters ---------- tsv_path : str, optional Path to tsv file conta...
[ "numpy.random.seed", "pandas.read_csv", "os.path.isfile", "adam_visual_perception.ObjectTracker", "sacred.Experiment", "sys.exit" ]
[((967, 979), 'sacred.Experiment', 'Experiment', ([], {}), '()\n', (977, 979), False, 'from sacred import Experiment\n'), ((1248, 1273), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (1262, 1273), True, 'import numpy as np\n'), ((1435, 1471), 'pandas.read_csv', 'pd.read_csv', (['args.tsv_...
#! /usr/bin/env python """ Copyright 2015-2018 <NAME> <<EMAIL>> 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...
[ "numpy.stack", "os.path.exists", "numpy.array" ]
[((1231, 1251), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (1245, 1251), False, 'import os\n'), ((3132, 3148), 'numpy.stack', 'np.stack', (['frames'], {}), '(frames)\n', (3140, 3148), True, 'import numpy as np\n'), ((3174, 3194), 'numpy.array', 'np.array', (['frames_idx'], {}), '(frames_idx)\n', (3...
from package import redact_ex from package import solve_explicit_ode import numpy as np EXERCISE_01 = """\ Make a program that is able to graphically solve the equation \u2202T/\u2202t = \u03B1 \u2202\u00B2T/\u2202x\u00B2 = 0 using the Forward in Time, Centered in Space (FTCS) scheme with Dirichlet boundary conditi...
[ "package.solve_explicit_ode", "package.redact_ex", "numpy.zeros", "numpy.cos" ]
[((487, 512), 'package.redact_ex', 'redact_ex', (['EXERCISE_01', '(1)'], {}), '(EXERCISE_01, 1)\n', (496, 512), False, 'from package import redact_ex\n'), ((772, 792), 'numpy.zeros', 'np.zeros', (['(slices + 1)'], {}), '(slices + 1)\n', (780, 792), True, 'import numpy as np\n'), ((801, 821), 'numpy.zeros', 'np.zeros', ...
import itertools import regex as re import numpy as np # seed is fixed for reproducibility np.random.seed(7) from tensorflow import set_random_seed set_random_seed(7) from unidecode import unidecode from delft.utilities.Tokenizer import tokenizeAndFilterSimple from delft.utilities.bert.run_classifier_delft import Data...
[ "unidecode.unidecode", "numpy.random.seed", "regex.compile", "numpy.zeros", "tensorflow.set_random_seed", "regex.sub", "numpy.where", "delft.utilities.bert.tokenization.convert_to_unicode", "delft.utilities.bert.run_classifier_delft.InputExample" ]
[((91, 108), 'numpy.random.seed', 'np.random.seed', (['(7)'], {}), '(7)\n', (105, 108), True, 'import numpy as np\n'), ((148, 166), 'tensorflow.set_random_seed', 'set_random_seed', (['(7)'], {}), '(7)\n', (163, 166), False, 'from tensorflow import set_random_seed\n'), ((483, 546), 'regex.compile', 're.compile', (['"""[...
# Princeton University licenses this file to You 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 in writin...
[ "numpy.atleast_2d", "copy.deepcopy", "ctypes.c_int", "numpy.ctypeslib.as_ctypes", "ctypes.byref", "ctypes.sizeof", "numpy.asfarray", "collections.defaultdict", "numpy.int32", "ctypes.POINTER" ]
[((2832, 2851), 'ctypes.sizeof', 'ctypes.sizeof', (['data'], {}), '(data)\n', (2845, 2851), False, 'import copy, ctypes\n'), ((3008, 3025), 'ctypes.sizeof', 'ctypes.sizeof', (['ty'], {}), '(ty)\n', (3021, 3025), False, 'import copy, ctypes\n'), ((3899, 3920), 'numpy.asfarray', 'np.asfarray', (['variable'], {}), '(varia...
import dash import os import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State import json import requests from bs4 import BeautifulSoup import pandas as pd import numpy as np from selenium import webdriver chrome...
[ "pandas.DataFrame", "json.loads", "dash_html_components.H2", "dash_bootstrap_components.Row", "dash_html_components.Div", "dash_html_components.Button", "dash.dependencies.Input", "dash_bootstrap_components.Col", "dash_html_components.P", "pickle.load", "selenium.webdriver.ChromeOptions", "num...
[((377, 402), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (400, 402), False, 'from selenium import webdriver\n'), ((523, 594), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': 'chrome_exec_shim', 'chrome_options': 'opts'}), '(executable_path=chrome_exec_shim...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 17 21:24:37 2019 @author: anilosmantur """ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 17 20:43:41 2019 @author: anilosmantur """ import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import RandomFore...
[ "sklearn.ensemble.RandomForestClassifier", "sklearn.model_selection.GridSearchCV", "numpy.concatenate", "sklearn.metrics.accuracy_score", "sklearn.preprocessing.MinMaxScaler", "numpy.ones", "numpy.arange", "numpy.array", "numpy.random.shuffle" ]
[((1575, 1595), 'numpy.arange', 'np.arange', (['n_samples'], {}), '(n_samples)\n', (1584, 1595), True, 'import numpy as np\n'), ((1608, 1660), 'numpy.concatenate', 'np.concatenate', (['[nums[:5], nums[10:15], nums[20:25]]'], {}), '([nums[:5], nums[10:15], nums[20:25]])\n', (1622, 1660), True, 'import numpy as np\n'), (...
from __future__ import absolute_import, print_function from numpy.testing import TestCase, dec, assert_, run_module_suite from scipy.weave import inline_tools class TestInline(TestCase): """These are long running tests... Would be useful to benchmark these things somehow. """ @dec.slow def test...
[ "scipy.weave.inline_tools.inline", "numpy.testing.assert_", "numpy.testing.run_module_suite" ]
[((1475, 1493), 'numpy.testing.run_module_suite', 'run_module_suite', ([], {}), '()\n', (1491, 1493), False, 'from numpy.testing import TestCase, dec, assert_, run_module_suite\n'), ((632, 664), 'scipy.weave.inline_tools.inline', 'inline_tools.inline', (['code', "['a']"], {}), "(code, ['a'])\n", (651, 664), False, 'fro...
from skfda.representation.basis import ( FDataBasis, Monomial, BSpline, Fourier, Constant, VectorValued, Tensor) import unittest import numpy as np class TestBasisEvaluationFourier(unittest.TestCase): def test_evaluation_simple_fourier(self): """Test the evaluation of FDataBasis""" fourier ...
[ "unittest.main", "skfda.representation.basis.BSpline", "numpy.testing.assert_raises", "skfda.representation.basis.Fourier", "skfda.representation.basis.Constant", "skfda.representation.basis.VectorValued", "numpy.array", "skfda.representation.basis.Monomial", "numpy.linspace", "numpy.testing.asser...
[((18780, 18795), 'unittest.main', 'unittest.main', ([], {}), '()\n', (18793, 18795), False, 'import unittest\n'), ((322, 361), 'skfda.representation.basis.Fourier', 'Fourier', ([], {'domain_range': '(0, 2)', 'n_basis': '(5)'}), '(domain_range=(0, 2), n_basis=5)\n', (329, 361), False, 'from skfda.representation.basis i...
# Fichier permettant de moduler les differentes methodes de clustering try: # Import generaux import numpy as np import pylab import sys import platform import matplotlib.pyplot as plt import re # Import locaux import kmeans import rkde except: exit(1) ...
[ "matplotlib.pyplot.xlim", "pylab.show", "re.split", "matplotlib.pyplot.ioff", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.array", "pylab.figure", "pylab.ylim", "platform.system", "pylab.xlim", "matplotlib.pyplot.savefig" ]
[((2035, 2049), 'pylab.figure', 'pylab.figure', ([], {}), '()\n', (2047, 2049), False, 'import pylab\n'), ((2159, 2183), 'pylab.xlim', 'pylab.xlim', (['[mini, maxi]'], {}), '([mini, maxi])\n', (2169, 2183), False, 'import pylab\n'), ((2189, 2213), 'pylab.ylim', 'pylab.ylim', (['[mini, maxi]'], {}), '([mini, maxi])\n', ...
# -*- coding: utf-8 -*- """ Flatten mesh using conformal mapping ============================================= Map 3D mesh to a 2D (complex) plane with angle-preserving (conformal) mapping Based on these course notes https://www.cs.cmu.edu/~kmcrane/Projects/DDG/ section 7.4. """ import numpy as np fro...
[ "bfieldtools.mesh_calculus.gradient", "numpy.meshgrid", "numpy.sum", "mayavi.mlab.quiver3d", "bfieldtools.flatten_mesh.flatten_mesh", "bfieldtools.viz.plot_data_on_faces", "mayavi.mlab.points3d", "bfieldtools.utils.load_example_mesh", "bfieldtools.viz.plot_data_on_vertices", "numpy.linspace", "b...
[((712, 758), 'bfieldtools.utils.load_example_mesh', 'load_example_mesh', (['"""meg_helmet"""'], {'process': '(False)'}), "('meg_helmet', process=False)\n", (729, 758), False, 'from bfieldtools.utils import load_example_mesh\n'), ((775, 806), 'bfieldtools.flatten_mesh.flatten_mesh', 'flatten_mesh', (['mesh'], {'_lambda...
import numpy as np from tqdm import tqdm from typing import Dict, Union import torch import gtimer as gt import matplotlib from matplotlib import pyplot as plt import self_supervised.utils.typed_dicts as td from self_supervised.base.data_collector.data_collector import \ PathCollectorSelfSupervised from self_sup_c...
[ "rlkit.torch.pytorch_util.get_numpy", "rlkit.core.rl_algorithm._get_epoch_timings", "rlkit.torch.pytorch_util.from_numpy", "matplotlib.use", "numpy.array", "numpy.random.randint", "torch.Size", "gtimer.stamp", "rlkit.core.logger.record_tabular", "rlkit.core.logger.dump_tabular" ]
[((1535, 1556), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (1549, 1556), False, 'import matplotlib\n'), ((3585, 3623), 'numpy.random.randint', 'np.random.randint', (['(self.num_skills - 1)'], {}), '(self.num_skills - 1)\n', (3602, 3623), True, 'import numpy as np\n'), ((4117, 4326), 'numpy.ar...
import cadquery as cq import numpy as np from OCP.Standard import Standard_ConstructionError def linear_milling_vol(cut, start_point, end_point, mill_diameter): """creates the volume that gets milled from linear move Keyword arguments: start_point -- [x,y,z] toolcentrepoint mm end_point -- [x,y,z] to...
[ "numpy.sin", "numpy.arctan2", "cadquery.Workplane", "numpy.cos" ]
[((478, 550), 'numpy.arctan2', 'np.arctan2', (['(end_point[1] - start_point[1])', '(end_point[0] - start_point[0])'], {}), '(end_point[1] - start_point[1], end_point[0] - start_point[0])\n', (488, 550), True, 'import numpy as np\n'), ((2469, 2490), 'cadquery.Workplane', 'cq.Workplane', (['"""front"""'], {}), "('front')...
# -*- coding: utf-8 -*- """Support Vector Machine (SVM) classification for machine learning. SVM is a binary classifier. The objective of the SVM is to find the best separating hyperplane in vector space which is also referred to as the decision boundary. And it decides what separating hyperplane is the 'best' because...
[ "pandas.read_csv", "sklearn.model_selection.train_test_split", "numpy.array", "sklearn.svm.SVC" ]
[((778, 821), 'pandas.read_csv', 'pd.read_csv', (['"""breast-cancer-wisconsin.data"""'], {}), "('breast-cancer-wisconsin.data')\n", (789, 821), True, 'import pandas as pd\n'), ((1013, 1034), 'numpy.array', 'np.array', (["df['class']"], {}), "(df['class'])\n", (1021, 1034), True, 'import numpy as np\n'), ((1081, 1118), ...
import numpy as np import nudged from scipy.linalg import eig, sqrtm, norm from .utils import adjust def find_linear_projections(X, d, objective, iters=20): n = X.shape[1] objective.X = X XBXT = adjust(objective.XBXT) sqrtXBXT = np.real(sqrtm(XBXT)) projections = [] selected = [] C = np...
[ "numpy.zeros", "scipy.linalg.eig", "numpy.argsort", "scipy.linalg.sqrtm", "scipy.linalg.norm", "numpy.real" ]
[((318, 352), 'numpy.zeros', 'np.zeros', (['(X.shape[0], X.shape[0])'], {}), '((X.shape[0], X.shape[0]))\n', (326, 352), True, 'import numpy as np\n'), ((257, 268), 'scipy.linalg.sqrtm', 'sqrtm', (['XBXT'], {}), '(XBXT)\n', (262, 268), False, 'from scipy.linalg import eig, sqrtm, norm\n'), ((594, 609), 'scipy.linalg.ei...
import sys #print(sys.path) sys.path.append('/home/pi/.local/lib/python3.7/site-packages') import nltk from nltk.stem import WordNetLemmatizer lemmatizer = WordNetLemmatizer() import pickle import numpy as np from keras.models import load_model model = load_model('chatbot_model4.h5') import json import rando...
[ "sys.path.append", "keras.models.load_model", "nltk.stem.WordNetLemmatizer", "random.choice", "numpy.array", "nlip2.name", "nltk.word_tokenize" ]
[((30, 92), 'sys.path.append', 'sys.path.append', (['"""/home/pi/.local/lib/python3.7/site-packages"""'], {}), "('/home/pi/.local/lib/python3.7/site-packages')\n", (45, 92), False, 'import sys\n'), ((161, 180), 'nltk.stem.WordNetLemmatizer', 'WordNetLemmatizer', ([], {}), '()\n', (178, 180), False, 'from nltk.stem impo...
import dill import numpy as np import tensorflow as tf from collections import defaultdict from sklearn.model_selection import train_test_split with open('motion_capture_20181011-1931.dill', 'rb') as f: x = dill.load(f) vec = [l[4] for l in x] # print(len(vec)) x = map(str, vec) x = list(x) #X_train, X_test = ...
[ "tensorflow.train.import_meta_graph", "tensorflow.get_collection", "tensorflow.Session", "dill.load", "collections.defaultdict", "tensorflow.train.latest_checkpoint", "numpy.linalg.norm", "numpy.dot" ]
[((420, 432), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (430, 432), True, 'import tensorflow as tf\n'), ((445, 490), 'tensorflow.train.import_meta_graph', 'tf.train.import_meta_graph', (['"""model.ckpt.meta"""'], {}), "('model.ckpt.meta')\n", (471, 490), True, 'import tensorflow as tf\n'), ((560, 585), 'ten...
""" Script to analyze distribution of squared Euclidean distance between gradients. """ from math import sqrt import numpy as np from scipy import stats # Set constants. k_vals = [35, 30, 36] n_vals = [1, 18, 1] total_n = sum(n_vals) sigma = 0.01 start_t = 200 t = 250 num_trials = 100 alpha = 0.05 load = "vecs.np" ...
[ "scipy.stats.kstest", "numpy.load", "math.sqrt", "numpy.zeros", "numpy.mean", "numpy.linalg.norm", "numpy.random.normal", "numpy.concatenate" ]
[((421, 453), 'numpy.zeros', 'np.zeros', (['(t, total_n, max_k, 2)'], {}), '((t, total_n, max_k, 2))\n', (429, 453), True, 'import numpy as np\n'), ((1557, 1574), 'numpy.concatenate', 'np.concatenate', (['z'], {}), '(z)\n', (1571, 1574), True, 'import numpy as np\n'), ((2089, 2112), 'scipy.stats.kstest', 'stats.kstest'...
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import json import pickle import numpy as np import pandas as pd import azureml.train.automl from sklearn.externals import joblib from azure...
[ "pandas.DataFrame", "azureml.core.model.Model.get_model_path", "inference_schema.parameter_types.numpy_parameter_type.NumpyParameterType", "json.dumps", "inference_schema.parameter_types.pandas_parameter_type.PandasParameterType", "numpy.array", "sklearn.externals.joblib.load" ]
[((633, 729), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': "[{'winddirabs': 0.34244, 'winddirrel': 0.324235, 'windspeedrel': 1.3213}]"}), "(data=[{'winddirabs': 0.34244, 'winddirrel': 0.324235,\n 'windspeedrel': 1.3213}])\n", (645, 729), True, 'import pandas as pd\n'), ((740, 753), 'numpy.array', 'np.array', ([...
import re import numpy as np #numerical operation import matplotlib.pyplot as plt #matploit provides functions that draws graphs or etc. from sklearn.cluster import MiniBatchKMeans from sklearn.cluster import KMeans import array import numpy as np def findminmax(dirname, filename): print('findminmax') mf = op...
[ "sklearn.cluster.MiniBatchKMeans", "numpy.random.seed", "numpy.empty", "sklearn.cluster.KMeans", "numpy.array", "numpy.reshape" ]
[((4919, 4979), 'numpy.empty', 'np.empty', (['(numberofinsatnces * numoffeattype)'], {'dtype': '"""float64"""'}), "(numberofinsatnces * numoffeattype, dtype='float64')\n", (4927, 4979), True, 'import numpy as np\n'), ((5266, 5328), 'numpy.reshape', 'np.reshape', (['TotalInstances', '(numberofinsatnces, numoffeattype)']...
# Author: <NAME> import math import matplotlib.pyplot as plt import numpy as np from scipy.special import logsumexp ''' z = Wx + µ + E the equation above represents the latent variable model which relates a d-dimensional data vector z to a corresponding q-dimensional latent variables x with q < d, for isot...
[ "numpy.random.seed", "numpy.argmin", "matplotlib.pyplot.figure", "numpy.random.randint", "numpy.sin", "numpy.exp", "numpy.arange", "scipy.special.logsumexp", "numpy.unique", "numpy.random.randn", "numpy.power", "numpy.transpose", "numpy.var", "matplotlib.pyplot.show", "numpy.hstack", "...
[((1916, 1959), 'numpy.random.randint', 'np.random.randint', (['(0)', 'n_datapts', 'n_clusters'], {}), '(0, n_datapts, n_clusters)\n', (1933, 1959), True, 'import numpy as np\n'), ((2205, 2238), 'numpy.zeros', 'np.zeros', (['(n_datapts, n_clusters)'], {}), '((n_datapts, n_clusters))\n', (2213, 2238), True, 'import nump...
"""[summary] """ import os import numpy as np import tensorflow as tf from src.utils import evaluation from src.draw import draw class GCLSemi: """[summary] """ def __init__(self, train_relevance_labels, train_features, test_relevance_labels, test_features, test_query_ids, train_features...
[ "numpy.random.seed", "numpy.concatenate", "numpy.random.randn", "tensorflow.global_variables_initializer", "numpy.zeros", "tensorflow.Session", "tensorflow.constant", "tensorflow.placeholder", "tensorflow.matmul", "numpy.mean", "numpy.array", "tensorflow.square", "tensorflow.train.AdamOptimi...
[((855, 895), 'numpy.zeros', 'np.zeros', (['[self.x_unlabeled.shape[0], 1]'], {}), '([self.x_unlabeled.shape[0], 1])\n', (863, 895), True, 'import numpy as np\n'), ((1165, 1195), 'numpy.concatenate', 'np.concatenate', (['(x, y)'], {'axis': '(1)'}), '((x, y), axis=1)\n', (1179, 1195), True, 'import numpy as np\n'), ((12...
# -*- coding: utf-8 -*- import numpy as np import logging, sys, operator from matplotlib.colors import Normalize from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.ticker import MaxNLocator from mpl_toolkits.axes_grid1 import make_axes_loca...
[ "numpy.abs", "numpy.sum", "matplotlib.pyplot.FixedFormatter", "matplotlib.pyplot.figure", "numpy.arange", "numpy.tile", "numpy.interp", "matplotlib.colors.Normalize", "matplotlib.backends.backend_agg.FigureCanvasAgg", "matplotlib.ticker.MaxNLocator", "matplotlib.figure.Figure", "matplotlib.pyp...
[((2042, 2065), 'mpl_toolkits.axes_grid1.make_axes_locatable', 'make_axes_locatable', (['ax'], {}), '(ax)\n', (2061, 2065), False, 'from mpl_toolkits.axes_grid1 import make_axes_locatable\n'), ((5790, 5815), 'numpy.tile', 'np.tile', (['rankings', '(2, 1)'], {}), '(rankings, (2, 1))\n', (5797, 5815), True, 'import numpy...
#This is a direct port of x_keckhelio.pro from XIDL from __future__ import division, print_function from math import pi from numpy import cos, sin import numpy as np def x_keckhelio(ra, dec, epoch=2000.0, jd=None, tai=None, longitude=None, latitude=None, altitude=None, obs='keck'): """ `ra` an...
[ "numpy.sum", "numpy.abs", "numpy.empty", "numpy.sin", "numpy.array", "numpy.cos", "numpy.dot" ]
[((7216, 7246), 'numpy.array', 'np.array', (['((theta + lng) / 15.0)'], {}), '((theta + lng) / 15.0)\n', (7224, 7246), True, 'import numpy as np\n'), ((16178, 16206), 'numpy.array', 'np.array', (['[1.0, dt, dt * dt]'], {}), '([1.0, dt, dt * dt])\n', (16186, 16206), True, 'import numpy as np\n'), ((16735, 16743), 'numpy...
import argparse import importlib.util import os import sys import chainer import numpy as np import six from PIL import Image from ..params import ProcessParams from ..simple import BaseProcessor PROJECT_DIR = os.path.dirname(__file__) waifu2x_path = os.path.join(PROJECT_DIR, "waifu2x-chainer") def import_waifu2x_...
[ "argparse.ArgumentParser", "chainer.serializers.load_npz", "numpy.ceil", "os.path.isdir", "numpy.log2", "os.path.dirname", "chainer.backends.cuda.get_device", "os.path.exists", "chainer.backends.cuda.check_cuda_available", "numpy.round", "os.path.join", "six.print_" ]
[((213, 238), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (228, 238), False, 'import os\n'), ((254, 298), 'os.path.join', 'os.path.join', (['PROJECT_DIR', '"""waifu2x-chainer"""'], {}), "(PROJECT_DIR, 'waifu2x-chainer')\n", (266, 298), False, 'import os\n'), ((4536, 4554), 'numpy.log2', 'n...
from __future__ import print_function, division import os import torch import numpy as np import pandas as pd import math import re import pdb import pickle from scipy import stats from torch.utils.data import Dataset import h5py from libs.utils.utils import generate_split, nth def save_splits(split_datasets, colu...
[ "pandas.DataFrame", "torch.from_numpy", "h5py.File", "numpy.random.seed", "numpy.random.shuffle", "libs.utils.utils.generate_split", "pandas.read_csv", "scipy.stats.mode", "torch.load", "numpy.where", "numpy.array", "numpy.intersect1d", "pandas.concat", "numpy.unique", "libs.utils.utils....
[((480, 524), 'pandas.concat', 'pd.concat', (['splits'], {'ignore_index': '(True)', 'axis': '(1)'}), '(splits, ignore_index=True, axis=1)\n', (489, 524), True, 'import pandas as pd\n'), ((566, 610), 'pandas.concat', 'pd.concat', (['splits'], {'ignore_index': '(True)', 'axis': '(0)'}), '(splits, ignore_index=True, axis=...
import numpy as np import matplotlib.pyplot as plt import cv2 import os from PIL import Image from mtcnn.mtcnn import MTCNN train_dir = 'data/train' valid_dir = 'data/val' face_detector = MTCNN() # for i in os.listdir(train_dir): # print(i) # my_img = 'data/train/madonna/httpiamediaimdbcomimagesMMVBMTANDQNTAxN...
[ "os.path.isdir", "numpy.asarray", "mtcnn.mtcnn.MTCNN", "PIL.Image.open", "PIL.Image.fromarray", "os.path.join", "os.listdir" ]
[((194, 201), 'mtcnn.mtcnn.MTCNN', 'MTCNN', ([], {}), '()\n', (199, 201), False, 'from mtcnn.mtcnn import MTCNN\n'), ((447, 467), 'PIL.Image.open', 'Image.open', (['img_path'], {}), '(img_path)\n', (457, 467), False, 'from PIL import Image\n'), ((504, 519), 'numpy.asarray', 'np.asarray', (['img'], {}), '(img)\n', (514,...
import time import os import glob import gc import numpy as np import torch import torch.optim as optim import torch.nn as nn import pytorch_lightning as pl import pytorch_lightning.loggers as pl_loggers import pytorch_lightning.callbacks as pl_callbacks from torch.utils.data import DataLoader from config_modified im...
[ "pytorch_lightning.Trainer", "numpy.random.seed", "utils.decoders.ctc_search_decode", "time.strftime", "gc.collect", "torch.utils.data.DataLoader", "data.lrs2_dataset.LRS2Pretrain", "utils.metrics.compute_wer", "torch.optim.lr_scheduler.ReduceLROnPlateau", "pytorch_lightning.loggers.NeptuneLogger"...
[((9879, 10025), 'pytorch_lightning.loggers.NeptuneLogger', 'pl_loggers.NeptuneLogger', ([], {'project_name': '"""benso/deep-avsr"""', 'experiment_name': 'f"""video_only_curriculum"""', 'params': 'args', 'tags': "{'start_date': timestr}"}), "(project_name='benso/deep-avsr', experiment_name=\n f'video_only_curriculum...
from __future__ import print_function, division import os import torch import pandas as pd from skimage import io, transform import numpy as np import matplotlib.pyplot as plt from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils from src.data.baseline_transformers import Transforms...
[ "numpy.load", "torch.stack", "numpy.random.randn", "pandas.read_csv", "torchvision.transforms.ToPILImage", "torchvision.transforms.ToTensor", "torchvision.transforms.Normalize", "torch.from_numpy" ]
[((851, 871), 'pandas.read_csv', 'pd.read_csv', (['test_df'], {}), '(test_df)\n', (862, 871), True, 'import pandas as pd\n'), ((910, 945), 'pandas.read_csv', 'pd.read_csv', (['test_df_track_order_df'], {}), '(test_df_track_order_df)\n', (921, 945), True, 'import pandas as pd\n'), ((982, 1010), 'numpy.load', 'np.load', ...
""" Name: <NAME> Class: K63K2 MSSV: 18020116 You should understand the code you write. """ import numpy as np import cv2 import argparse from matplotlib import pyplot as plt def q_0(input_file, output_file, ): img = cv2.imread(input_file, cv2.IMREAD_COLOR) cv2.imshow('Test img', img) cv2.waitKey(5000) ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "numpy.zeros_like", "matplotlib.pyplot.show", "argparse.ArgumentParser", "matplotlib.pyplot.plot", "cv2.waitKey", "cv2.imwrite", "cv2.calcHist", "matplotlib.pyplot.imshow", "matplotlib.pyplot.axis", "cv2.imread", "matplotlib.pyplot.figure"...
[((224, 264), 'cv2.imread', 'cv2.imread', (['input_file', 'cv2.IMREAD_COLOR'], {}), '(input_file, cv2.IMREAD_COLOR)\n', (234, 264), False, 'import cv2\n'), ((269, 296), 'cv2.imshow', 'cv2.imshow', (['"""Test img"""', 'img'], {}), "('Test img', img)\n", (279, 296), False, 'import cv2\n'), ((301, 318), 'cv2.waitKey', 'cv...
""" echopype data model inherited from based class Process for EK80 data. """ import os import datetime as dt import numpy as np import xarray as xr from scipy import signal from ..utils import uwa from .processbase import ProcessBase class ProcessEK80(ProcessBase): """Class for manipulating EK80 echo data alrea...
[ "numpy.abs", "numpy.sum", "numpy.floor", "numpy.ones", "numpy.mean", "numpy.arange", "numpy.linalg.norm", "numpy.convolve", "numpy.round", "numpy.pad", "os.path.exists", "numpy.max", "numpy.hanning", "numpy.log10", "datetime.datetime.now", "numpy.conj", "xarray.concat", "numpy.cos"...
[((11802, 11834), 'os.path.splitext', 'os.path.splitext', (['self.file_path'], {}), '(self.file_path)\n', (11818, 11834), False, 'import os\n'), ((11963, 11986), 'os.path.exists', 'os.path.exists', (['cw_path'], {}), '(cw_path)\n', (11977, 11986), False, 'import os\n'), ((5434, 5482), 'numpy.cos', 'np.cos', (['(2 * np....
""" Run this script with -h for the help. It produces for each method for a given dataset all the data needed to compare the methods on the specified dataset. The strategies being compared are defined after line 88. """ from concurrent.futures import wait, ALL_COMPLETED from concurrent.futures.process import ProcessPo...
[ "pandas.DataFrame", "tqdm.tqdm", "argparse.ArgumentParser", "pseas.discrimination.wilcoxon.Wilcoxon", "pseas.instance_selection.udd.UDD", "pandas.read_csv", "numpy.floor", "pseas.standard_strategy.StandardStrategy", "os.path.exists", "pseas.test_env.TestEnv", "concurrent.futures.process.ProcessP...
[((1356, 1412), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Produce run data."""'}), "(description='Produce run data.')\n", (1379, 1412), False, 'import argparse\n'), ((5860, 5905), 'os.path.exists', 'os.path.exists', (['f"""./runs_{output_suffix}.csv"""'], {}), "(f'./runs_{output_suf...
import sys from copy import copy import numpy as np from moviepy.audio.io.ffmpeg_audiowriter import ffmpeg_audiowrite from moviepy.decorators import requires_duration from moviepy.Clip import Clip # optimize range in function of Python's version if sys.version_info < (3,): range = xrange class AudioClip(Clip)...
[ "numpy.minimum", "moviepy.Clip.Clip.__init__", "numpy.zeros", "numpy.arange", "numpy.array", "moviepy.audio.io.ffmpeg_audiowriter.ffmpeg_audiowrite" ]
[((1488, 1507), 'moviepy.Clip.Clip.__init__', 'Clip.__init__', (['self'], {}), '(self)\n', (1501, 1507), False, 'from moviepy.Clip import Clip\n'), ((3164, 3251), 'moviepy.audio.io.ffmpeg_audiowriter.ffmpeg_audiowrite', 'ffmpeg_audiowrite', (['self', 'filename', 'fps', 'nbytes', 'buffersize', 'codec', 'bitrate', 'verbo...
import joblib import numpy as np import pandas as pd np.random.seed(0) df_tracks = pd.read_hdf('df_data/df_tracks.hdf') df_playlists = pd.read_hdf('df_data/df_playlists.hdf') df_playlists_info = pd.read_hdf('df_data/df_playlists_info.hdf') df_playlists_test = pd.read_hdf('df_data/df_playlists_test.hdf') df_playlists_...
[ "numpy.random.seed", "pandas.read_hdf", "joblib.dump", "numpy.hstack", "numpy.random.choice", "pandas.concat" ]
[((54, 71), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (68, 71), True, 'import numpy as np\n'), ((85, 121), 'pandas.read_hdf', 'pd.read_hdf', (['"""df_data/df_tracks.hdf"""'], {}), "('df_data/df_tracks.hdf')\n", (96, 121), True, 'import pandas as pd\n'), ((137, 176), 'pandas.read_hdf', 'pd.read_hdf'...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 8 17:03:07 2018 @author: jeremiasknoblauch Description: Plots pics from Air Pollution Data London """ import csv import numpy as np from Evaluation_tool import EvaluationTool from matplotlib import pyplot as plt import matplotlib.dates as mdates ...
[ "Evaluation_tool.EvaluationTool", "csv.reader", "numpy.zeros", "datetime.date", "matplotlib.pyplot.subplots", "numpy.var", "numpy.mean", "numpy.array", "datetime.timedelta", "numpy.linspace", "numpy.where", "matplotlib.pyplot.subplots_adjust", "numpy.union1d" ]
[((4958, 4985), 'numpy.zeros', 'np.zeros', (['(T, num_stations)'], {}), '((T, num_stations))\n', (4966, 4985), True, 'import numpy as np\n'), ((5080, 5101), 'numpy.mean', 'np.mean', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (5087, 5101), True, 'import numpy as np\n'), ((8052, 8068), 'Evaluation_tool.EvaluationTo...
r"""Summary objects at the end of training procedures.""" import numpy as np import pickle import torch class TrainingSummary: def __init__(self, model_best, model_final, epochs, epoch_best, losses_train, losses_test=None, identifier=None): self.i...
[ "torch.save", "torch.load", "numpy.log" ]
[((927, 952), 'torch.save', 'torch.save', (['summary', 'path'], {}), '(summary, path)\n', (937, 952), False, 'import torch\n'), ((998, 1014), 'torch.load', 'torch.load', (['path'], {}), '(path)\n', (1008, 1014), False, 'import torch\n'), ((1855, 1879), 'numpy.log', 'np.log', (['self.losses_test'], {}), '(self.losses_te...
from functools import reduce import scipy.ndimage as nd import numpy as np def convert_to_img_frame(img, node_position, mesh, borders, settings): local_node_pos = np.zeros((2, mesh.element_def.n_nodes), dtype=settings.precision) # Partition image image_frame = extract_subframe(img, borders, settings.pad)...
[ "numpy.meshgrid", "numpy.ones_like", "numpy.ceil", "numpy.floor", "numpy.zeros", "numpy.einsum", "numpy.min", "numpy.max", "numpy.where", "numpy.arange", "numpy.linspace", "functools.reduce", "scipy.ndimage.map_coordinates" ]
[((169, 234), 'numpy.zeros', 'np.zeros', (['(2, mesh.element_def.n_nodes)'], {'dtype': 'settings.precision'}), '((2, mesh.element_def.n_nodes), dtype=settings.precision)\n', (177, 234), True, 'import numpy as np\n'), ((624, 651), 'numpy.linspace', 'np.linspace', (['(0.0)', '(1.0)', 'seed'], {}), '(0.0, 1.0, seed)\n', (...
# -*- coding: utf-8 -*- import os import random from torch.utils.data import Dataset from PIL import Image import numpy as np from datasets.data_io import get_transform, read_all_lines from datasets.data_io import * import torchvision.transforms as transforms import torch import torch.nn as nn class LapaPngPng(Da...
[ "torchvision.transforms.ColorJitter", "torch.ones", "torch.stack", "random.randint", "datasets.data_io.read_all_lines", "torchvision.transforms.ToTensor", "PIL.Image.open", "torch.squeeze", "torch.clamp", "numpy.array", "torch.rand", "torchvision.transforms.Resize", "os.path.join", "torch....
[((1218, 1247), 'datasets.data_io.read_all_lines', 'read_all_lines', (['list_filename'], {}), '(list_filename)\n', (1232, 1247), False, 'from datasets.data_io import get_transform, read_all_lines\n'), ((2742, 2775), 'torch.clamp', 'torch.clamp', (['left_image_aug', '(0)', '(1)'], {}), '(left_image_aug, 0, 1)\n', (2753,...
# Confidential, Copyright 2020, Sony Corporation of America, All rights reserved. from typing import List, Optional, Sequence, Union import numpy as np from tqdm import trange from .setup_sim_env import make_gym_env from ..data.interfaces import ExperimentDataSaver, StageSchedule from ..environment import PandemicSi...
[ "numpy.random.RandomState", "tqdm.trange" ]
[((1163, 1197), 'numpy.random.RandomState', 'np.random.RandomState', (['random_seed'], {}), '(random_seed)\n', (1184, 1197), True, 'import numpy as np\n'), ((1810, 1859), 'tqdm.trange', 'trange', (['max_episode_length'], {'desc': '"""Simulating day"""'}), "(max_episode_length, desc='Simulating day')\n", (1816, 1859), F...
import numpy as np from math import * from interpolation import InterpVec class Target(object): @classmethod def get_simple_target(cls, pos, vel): velocity_vectors = [[0, np.array(vel)]] vel_interp = InterpVec(velocity_vectors) target = cls(vel_interp=vel_interp) paramet...
[ "interpolation.InterpVec", "numpy.array", "numpy.degrees", "numpy.sqrt" ]
[((233, 260), 'interpolation.InterpVec', 'InterpVec', (['velocity_vectors'], {}), '(velocity_vectors)\n', (242, 260), False, 'from interpolation import InterpVec\n'), ((336, 365), 'numpy.array', 'np.array', (['[pos[0], pos[1], 0]'], {}), '([pos[0], pos[1], 0])\n', (344, 365), True, 'import numpy as np\n'), ((831, 861),...
import os import numpy as np import matplotlib.pyplot as plt from PIL import Image import time from collections import namedtuple import caffe from lib import run_net from lib import score_util from datasets.pascal_voc import Pascal PV = Pascal('C:\\ALISURE\\Data\\voc\\VOCdevkit\\VOC2012') val_set = PV.get_data_se...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "numpy.zeros", "matplotlib.pyplot.axis", "datasets.pascal_voc.Pascal", "matplotlib.pyplot.figure", "lib.score_util.score_out_gt", "collections.namedtuple", "lib.score_util.score_out_gt_bdry", "PIL.Image.fromarray", "caffe.Net", "lib.score_u...
[((243, 295), 'datasets.pascal_voc.Pascal', 'Pascal', (['"""C:\\\\ALISURE\\\\Data\\\\voc\\\\VOCdevkit\\\\VOC2012"""'], {}), "('C:\\\\ALISURE\\\\Data\\\\voc\\\\VOCdevkit\\\\VOC2012')\n", (249, 295), False, 'from datasets.pascal_voc import Pascal\n'), ((1270, 1338), 'collections.namedtuple', 'namedtuple', (['"""Method"""...
"""camera_fusion CameraCorrected class tests.""" import cv2 import os import sys import filecmp import pytest import numpy as np import shutil import time import unittest.mock as mock sys.path.insert( 0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import camera_fusion # noqa class Vc(object...
[ "numpy.load", "numpy.save", "shutil.copytree", "shutil.rmtree", "os.path.isdir", "numpy.testing.assert_array_equal", "os.path.dirname", "time.sleep", "unittest.mock.patch", "camera_fusion.CameraCorrected", "numpy.array", "numpy.testing.assert_allclose" ]
[((1520, 1556), 'camera_fusion.CameraCorrected', 'camera_fusion.CameraCorrected', (['(0)', '(11)'], {}), '(0, 11)\n', (1549, 1556), False, 'import camera_fusion\n'), ((1690, 1715), 'numpy.array', 'np.array', (['[[1], [0], [0]]'], {}), '([[1], [0], [0]])\n', (1698, 1715), True, 'import numpy as np\n'), ((1727, 1752), 'n...
""" Functions to plot data using the `cartopy` library. These require the `shapely` and `cartopy` libraries to be installed. CartoPy is sometimes difficult to install. """ import numpy as N from cartopy import crs, feature from shapely.geometry import Polygon from ..error.axes import hyperbolic_axes from ..stereonet i...
[ "cartopy.crs.PlateCarree", "numpy.diag", "shapely.geometry.Polygon" ]
[((504, 513), 'numpy.diag', 'N.diag', (['d'], {}), '(d)\n', (510, 513), True, 'import numpy as N\n'), ((625, 674), 'shapely.geometry.Polygon', 'Polygon', (["sheets['upper']", "[sheets['lower'][::-1]]"], {}), "(sheets['upper'], [sheets['lower'][::-1]])\n", (632, 674), False, 'from shapely.geometry import Polygon\n'), ((...
import matplotlib.pyplot as plot import numpy as np #Function to get x and y coordinates from the first 10 clicks, then close the image. def onclick(event): x.append(event.xdata) y.append(event.ydata) print(len(x)) xval = int(event.xdata) yval = int(event.ydata) print(str([xval,yval])) if ...
[ "matplotlib.pyplot.show", "numpy.linalg.lstsq", "matplotlib.pyplot.imshow", "matplotlib.pyplot.close", "numpy.shape", "numpy.array", "matplotlib.pyplot.gca", "matplotlib.pyplot.gcf" ]
[((723, 739), 'matplotlib.pyplot.imshow', 'plot.imshow', (['dem'], {}), '(dem)\n', (734, 739), True, 'import matplotlib.pyplot as plot\n'), ((749, 759), 'matplotlib.pyplot.gca', 'plot.gca', ([], {}), '()\n', (757, 759), True, 'import matplotlib.pyplot as plot\n'), ((770, 780), 'matplotlib.pyplot.gcf', 'plot.gcf', ([], ...
import open3d as o3d import copy import numpy as np # Helper visualization function def draw_registration_result(source, target, transformation): source_temp = copy.deepcopy(source) target_temp = copy.deepcopy(target) source_temp.paint_uniform_color([1, 0.706, 0]) target_temp.paint_uniform_color([0, 0....
[ "copy.deepcopy", "numpy.asarray", "open3d.io.read_point_cloud", "open3d.visualization.draw_geometries", "open3d.pipelines.registration.evaluate_registration", "open3d.pipelines.registration.ICPConvergenceCriteria", "open3d.pipelines.registration.TransformationEstimationPointToPoint", "open3d.pipelines...
[((459, 518), 'open3d.io.read_point_cloud', 'o3d.io.read_point_cloud', (['"""../test_data/icp/cloud_bin_0.pcd"""'], {}), "('../test_data/icp/cloud_bin_0.pcd')\n", (482, 518), True, 'import open3d as o3d\n'), ((528, 587), 'open3d.io.read_point_cloud', 'o3d.io.read_point_cloud', (['"""../test_data/icp/cloud_bin_1.pcd"""'...
""" pyjs9.py: connects Python and JS9 via the JS9 (back-end) helper """ from __future__ import print_function import time import json import base64 import logging from traceback import format_exc from threading import Condition from io import BytesIO import requests __all__ = ['JS9', 'js9Globals'] """ pyjs9.py conn...
[ "pyfits.HDUList", "io.BytesIO", "logging.error", "logging.debug", "json.loads", "socketio.Client", "logging.warning", "numpy.frombuffer", "threading.Condition", "time.sleep", "logging.info", "pyfits.PrimaryHDU", "numpy.array", "requests.post", "numpy.ascontiguousarray", "numpy.issubdty...
[((1775, 1813), 'logging.info', 'logging.info', (['"""set socketio transport"""'], {}), "('set socketio transport')\n", (1787, 1813), False, 'import logging\n'), ((1907, 1961), 'logging.info', 'logging.info', (['"""no python-socketio, use html transport"""'], {}), "('no python-socketio, use html transport')\n", (1919, ...
import os import h5py import pandas as pd import logging import numpy as np from progress.bar import Bar from multiprocessing import Pool, cpu_count from omegaconf import OmegaConf from tools.utils import io # from ANCSH_lib.utils import NetworkType # from tools.visualization import Viewer, ANCSHVisualizer import uti...
[ "numpy.isin", "pandas.read_csv", "numpy.empty", "numpy.ones", "tools.utils.io.write_json", "numpy.linalg.norm", "numpy.arange", "os.path.join", "multiprocessing.cpu_count", "tools.utils.io.file_exist", "numpy.empty_like", "numpy.reshape", "pandas.concat", "numpy.stack", "h5py.File", "n...
[((358, 390), 'logging.getLogger', 'logging.getLogger', (['"""proc_stage2"""'], {}), "('proc_stage2')\n", (375, 390), False, 'import logging\n'), ((1020, 1052), 'numpy.zeros', 'np.zeros', (['(vertices.shape[0], 3)'], {}), '((vertices.shape[0], 3))\n', (1028, 1052), True, 'import numpy as np\n'), ((2148, 2187), 'numpy.w...
import scxx.preprocessing as pp import scxx.plotting as pl import scanorama import os import numpy as np import scanpy as sc from anndata import AnnData np.random.seed(0) NAMESPACE = 'mouse_brain' BATCH_SIZE = 1000 result_dir="./results/1M_mouse_brain/scanorama/" data_names = [ 'data/mouse_brain/nuclei', 'da...
[ "scanorama.correct_scanpy", "numpy.random.seed", "pandas.read_csv", "numpy.concatenate" ]
[((154, 171), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (168, 171), True, 'import numpy as np\n'), ((1165, 1230), 'scanorama.correct_scanpy', 'scanorama.correct_scanpy', (['datasets'], {'return_dimred': '(True)', 'dimred': '(16)'}), '(datasets, return_dimred=True, dimred=16)\n', (1189, 1230), False...
import numpy as np from aura import aura_loader import os import time import random def break_aura(path, pieces): """ Breaks an aura file into smaller chunks. Saves chunks to local folders. :param path: A string type of the path to the aura file that is being chunked. :param pieces: An integer type ...
[ "os.mkdir", "random.shuffle", "numpy.zeros", "time.time", "aura.aura_loader.read_file" ]
[((373, 400), 'aura.aura_loader.read_file', 'aura_loader.read_file', (['path'], {}), '(path)\n', (394, 400), False, 'from aura import aura_loader\n'), ((497, 515), 'os.mkdir', 'os.mkdir', (['filepath'], {}), '(filepath)\n', (505, 515), False, 'import os\n'), ((673, 718), 'numpy.zeros', 'np.zeros', (['(l, w, chunkSize)'...
import pytest import numpy as np from numpy.testing import assert_allclose from keras.models import Sequential from keras.layers.core import Dense, Activation, Flatten from keras.layers.embeddings import Embedding from keras.constraints import unitnorm from keras import backend as K X1 = np.array([[1], [2]], dtype='i...
[ "keras.layers.core.Dense", "numpy.ones_like", "keras.layers.core.Activation", "pytest.main", "keras.backend.get_value", "keras.constraints.unitnorm", "numpy.array", "keras.layers.core.Flatten", "keras.models.Sequential" ]
[((291, 326), 'numpy.array', 'np.array', (['[[1], [2]]'], {'dtype': '"""int32"""'}), "([[1], [2]], dtype='int32')\n", (299, 326), True, 'import numpy as np\n'), ((332, 395), 'numpy.array', 'np.array', (['[[0.1, 0.2], [0.3, 0.4], [0.5, 0.6]]'], {'dtype': '"""float32"""'}), "([[0.1, 0.2], [0.3, 0.4], [0.5, 0.6]], dtype='...
# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved. # # 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 b...
[ "numpy.abs", "os.path.basename", "numpy.std", "numpy.frombuffer", "numpy.allclose", "numpy.max", "numpy.mean", "numpy.min", "numpy.prod" ]
[((809, 835), 'os.path.basename', 'os.path.basename', (['__file__'], {}), '(__file__)\n', (825, 835), False, 'import os\n'), ((2036, 2057), 'numpy.prod', 'numpy.prod', (['arr_shape'], {}), '(arr_shape)\n', (2046, 2057), False, 'import numpy\n'), ((3524, 3553), 'numpy.abs', 'numpy.abs', (['(output - gt_output)'], {}), '...
from datetime import date import numpy as np from matplotlib.lines import Line2D from _ids import * import _icons as ico from utilities import pydate2wxdate, wxdate2pydate, GetAttributes from properties import SummaryProperty class VariableManager: def __init__(self, unit_system): # simulat...
[ "utilities.wxdate2pydate", "utilities.pydate2wxdate", "numpy.array", "properties.SummaryProperty", "utilities.GetAttributes" ]
[((6204, 6294), 'utilities.GetAttributes', 'GetAttributes', (['self'], {'exclude': "('_correlation_labels', '_correlation_matrix')", 'sort': '(True)'}), "(self, exclude=('_correlation_labels', '_correlation_matrix'),\n sort=True)\n", (6217, 6294), False, 'from utilities import pydate2wxdate, wxdate2pydate, GetAttrib...
import numpy as np import cmath from functools import reduce from math import pi, ceil from numpy import sin, cos from scipy.interpolate import interp1d """ References: [Majkrzak2003] <NAME>, <NAME>: Physica B 336 (2003) 27-38 Phase sensitive reflectometry and the unambiguous determination o...
[ "cmath.sqrt", "math.ceil", "refl1d.profile.Microslabs", "refl1d.profile.build_profile", "refl1d.probe.NeutronProbe", "numpy.cumsum", "numpy.diff", "numpy.array", "numpy.sin", "numpy.cos", "functools.reduce", "scipy.interpolate.interp1d", "pylab.plot", "numpy.linalg.multi_dot" ]
[((399, 448), 'scipy.interpolate.interp1d', 'interp1d', (['x', 'fx'], {'bounds_error': '(False)', 'fill_value': '(0)'}), '(x, fx, bounds_error=False, fill_value=0)\n', (407, 448), False, 'from scipy.interpolate import interp1d\n'), ((918, 956), 'cmath.sqrt', 'cmath.sqrt', (['(1 - 16 * pi * sld / q ** 2)'], {}), '(1 - 1...
import os import mitsuba import numpy as np import argparse import utils mitsuba.set_variant('scalar_spectral') from mitsuba.core import xml, Thread, ScalarTransform4f, Transform4f, Bitmap, Struct from mitsuba.python.xml import WriteXML from enoki.scalar import * import open3d as o3d from plyfile import PlyData, PlyE...
[ "plyfile.PlyElement.describe", "mitsuba.core.xml.load_dict", "mitsuba.core.Transform4f.translate", "argparse.ArgumentParser", "utils.file_exist", "numpy.asarray", "mitsuba.set_variant", "mitsuba.core.ScalarTransform4f.look_at", "os.path.dirname", "os.path.realpath", "utils.print_e", "numpy.arr...
[((74, 112), 'mitsuba.set_variant', 'mitsuba.set_variant', (['"""scalar_spectral"""'], {}), "('scalar_spectral')\n", (93, 112), False, 'import mitsuba\n'), ((426, 448), 'plyfile.PlyData.read', 'PlyData.read', (['filename'], {}), '(filename)\n', (438, 448), False, 'from plyfile import PlyData, PlyElement\n'), ((458, 492...
import numpy as np from source_ddc.simulation_tools import simulate from source_ddc.algorithms import NFXP, NPL, CCP from source_ddc.probability_tools import StateManager, random_ccp from test.utils.functional_tools import average_out n_repetitions = 10 def test_nfxp(simple_transition_matrix): def utility_fn(th...
[ "numpy.meshgrid", "numpy.abs", "numpy.log", "source_ddc.probability_tools.StateManager", "test.utils.functional_tools.average_out", "source_ddc.algorithms.NPL", "source_ddc.probability_tools.random_ccp", "numpy.array", "source_ddc.simulation_tools.simulate", "source_ddc.algorithms.CCP", "source_...
[((616, 644), 'source_ddc.probability_tools.StateManager', 'StateManager', ([], {'miles': 'n_states'}), '(miles=n_states)\n', (628, 644), False, 'from source_ddc.probability_tools import StateManager, random_ccp\n'), ((651, 677), 'test.utils.functional_tools.average_out', 'average_out', (['n_repetitions'], {}), '(n_rep...
from typing import Union, List import numpy as np from gym import spaces, ActionWrapper from gym.spaces import flatten_space, flatdim, unflatten, flatten from sorting_gym import DiscreteParametric def merge_discrete_spaces(input_spaces: List[Union[spaces.Discrete, spaces.Tuple, spaces.MultiBinary]]) -> spaces.Multi...
[ "gym.spaces.flatten", "numpy.argmax", "numpy.zeros", "sorting_gym.DiscreteParametric", "gym.spaces.flatdim", "numpy.array", "gym.spaces.unflatten" ]
[((3029, 3117), 'sorting_gym.DiscreteParametric', 'DiscreteParametric', (['env.action_space.parameter_space.n', 'self.disjoint_action_spaces'], {}), '(env.action_space.parameter_space.n, self.\n disjoint_action_spaces)\n', (3047, 3117), False, 'from sorting_gym import DiscreteParametric\n'), ((4889, 4909), 'numpy.ar...
"""Tests for the fixes of ACCESS-ESM1-5.""" import unittest.mock import iris import numpy as np import pytest from esmvalcore.cmor._fixes.cmip6.access_esm1_5 import Cl, Cli, Clw, Hus, Zg from esmvalcore.cmor._fixes.common import ClFixHybridHeightCoord from esmvalcore.cmor.fix import Fix from esmvalcore.cmor.table imp...
[ "esmvalcore.cmor._fixes.cmip6.access_esm1_5.Zg", "numpy.zeros_like", "numpy.ones_like", "esmvalcore.cmor._fixes.cmip6.access_esm1_5.Clw", "iris.cube.CubeList", "esmvalcore.cmor._fixes.cmip6.access_esm1_5.Cli", "esmvalcore.cmor.fix.Fix.get_fixes", "esmvalcore.cmor._fixes.cmip6.access_esm1_5.Hus", "ir...
[((2777, 2803), 'iris.cube.CubeList', 'iris.cube.CubeList', (['[cube]'], {}), '([cube])\n', (2795, 2803), False, 'import iris\n'), ((2870, 2923), 'esmvalcore.cmor.fix.Fix.get_fixes', 'Fix.get_fixes', (['"""CMIP6"""', '"""ACCESS-ESM1-5"""', '"""Amon"""', '"""cl"""'], {}), "('CMIP6', 'ACCESS-ESM1-5', 'Amon', 'cl')\n", (2...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library from builtins import * # NOQA standard_library.install_aliases() # NOQA import unittest from chainer import testing import numpy as ...
[ "chainerrl.agents.dqn.DQN", "chainerrl.explorers.Boltzmann", "chainer.testing.product", "chainerrl.agents.dqn.compute_value_loss", "numpy.random.uniform", "future.standard_library.install_aliases", "numpy.asarray", "chainerrl.agents.dqn.compute_weighted_value_loss", "numpy.ones" ]
[((216, 250), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (248, 250), False, 'from future import standard_library\n'), ((756, 872), 'chainerrl.agents.dqn.DQN', 'DQN', (['q_func', 'opt', 'rbuf'], {'gpu': 'gpu', 'gamma': '(0.9)', 'explorer': 'explorer', 'replay_start_s...
import streamlit as st from streamlit_drawable_canvas import st_canvas from PIL import Image import numpy as np import torch import torch.nn.functional as F import torchvision.transforms as transforms import json # Specify canvas parameters in application stroke_width = st.sidebar.slider( label='Stroke width:',...
[ "streamlit.sidebar.slider", "streamlit_drawable_canvas.st_canvas", "json.load", "torch.topk", "numpy.uint8", "streamlit.sidebar.checkbox", "streamlit.write", "torch.nn.functional.softmax", "torchvision.transforms.ToTensor", "streamlit.sidebar.selectbox", "numpy.array", "torch.device", "torch...
[((275, 351), 'streamlit.sidebar.slider', 'st.sidebar.slider', ([], {'label': '"""Stroke width:"""', 'min_value': '(1)', 'max_value': '(25)', 'value': '(3)'}), "(label='Stroke width:', min_value=1, max_value=25, value=3)\n", (292, 351), True, 'import streamlit as st\n'), ((387, 495), 'streamlit.sidebar.selectbox', 'st....
import numpy as np def float_ndarray_to_dict(arr): return np_arr_to_dict(arr) def dict_to_float_ndarray(string): return dict_to_np_arr(string) def identity(e): return e def float_to_string(num): return str(num) def string_to_float(string): return float(string) def np_arr_to_dict(arr): retu...
[ "numpy.array" ]
[((519, 545), 'numpy.array', 'np.array', (['arr'], {'dtype': 'dtype'}), '(arr, dtype=dtype)\n', (527, 545), True, 'import numpy as np\n')]
import math, random, copy import numpy as np import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' import torch import torch.nn as nn import torch.optim as optim import torch.autograd as autograd import torch.nn.functional as F from DGN import DGN from buffer import ReplayBuffer from surviving import Surviving from co...
[ "surviving.Surviving", "numpy.ones", "DGN.DGN", "numpy.random.randint", "torch.cuda.is_available", "numpy.array", "torch.Tensor", "numpy.random.rand", "buffer.ReplayBuffer" ]
[((346, 371), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (369, 371), False, 'import torch\n'), ((379, 401), 'surviving.Surviving', 'Surviving', ([], {'n_agent': '(100)'}), '(n_agent=100)\n', (388, 401), False, 'from surviving import Surviving\n'), ((489, 511), 'buffer.ReplayBuffer', 'Replay...
import gym from typing import List, Tuple, Dict import numpy as np from gym import spaces from core.simulation import Simulation from service import global_constants class JsbsimGymEnvironmentWrapper(gym.Env): """Custom Environment that follows gym interface""" metadata = {'render.modes': ['human']} def __...
[ "numpy.zeros", "numpy.array", "gym.spaces.Box", "core.simulation.Simulation" ]
[((482, 531), 'core.simulation.Simulation', 'Simulation', ([], {'configuration_path': 'configuration_path'}), '(configuration_path=configuration_path)\n', (492, 531), False, 'from core.simulation import Simulation\n'), ((589, 660), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(-0)', 'high': '(1)', 'shape': '(self._dim...
from typing import Any, Optional, Union import numpy as np import pandas as pd from crowdkit.aggregation.base_aggregator import BaseAggregator from crowdkit.aggregation import MajorityVote def _check_answers(answers: pd.DataFrame) -> None: if not isinstance(answers, pd.DataFrame): raise TypeError('Workin...
[ "crowdkit.aggregation.MajorityVote", "numpy.sum", "pandas.unique" ]
[((1127, 1141), 'crowdkit.aggregation.MajorityVote', 'MajorityVote', ([], {}), '()\n', (1139, 1141), False, 'from crowdkit.aggregation import MajorityVote\n'), ((2446, 2470), 'pandas.unique', 'pd.unique', (['answers.label'], {}), '(answers.label)\n', (2455, 2470), True, 'import pandas as pd\n'), ((4086, 4110), 'pandas....
# Copyright 2021 Intel Corporation # # 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 in w...
[ "pickle.dump", "numpy.array", "daal4py.oneapi.sycl_context", "sklearnex.patch_sklearn", "sklearn.cluster.DBSCAN" ]
[((620, 635), 'sklearnex.patch_sklearn', 'patch_sklearn', ([], {}), '()\n', (633, 635), False, 'from sklearnex import patch_sklearn\n'), ((736, 842), 'numpy.array', 'np.array', (['[[1.0, 2.0], [2.0, 2.0], [2.0, 3.0], [8.0, 7.0], [8.0, 8.0], [25.0, 80.0]]'], {'dtype': 'np.float32'}), '([[1.0, 2.0], [2.0, 2.0], [2.0, 3.0...
import numpy as np import atexit import sys aims = sys.modules['soma.aims'] ''' IO formats readers / writers written in python for aims. Currently: Numpy format for matrices ''' class NpyFormat(aims.FileFormat_SparseOrDenseMatrix): def read(self, filename, obj, context, options=None): mat = np.load(fil...
[ "atexit.register", "numpy.load", "numpy.save", "numpy.asarray" ]
[((2154, 2192), 'atexit.register', 'atexit.register', (['remove_python_formats'], {}), '(remove_python_formats)\n', (2169, 2192), False, 'import atexit\n'), ((309, 326), 'numpy.load', 'np.load', (['filename'], {}), '(filename)\n', (316, 326), True, 'import numpy as np\n'), ((1280, 1302), 'numpy.save', 'np.save', (['fil...
import sys, time, itertools, resource, logging from multiprocessing import Pool, Process from util import psutil_process, print_datetime, array2string, PyTorchDType as dtype import torch import numpy as np import gurobipy as grb from scipy.special import loggamma from sampleForIntegral import integrateOfExponentialOv...
[ "util.array2string", "sampleForIntegral.integrateOfExponentialOverSimplexInduction2", "torch.optim.lr_scheduler.StepLR", "numpy.abs", "torch.empty", "sys.stdout.flush", "numpy.diag", "numpy.full", "scipy.special.loggamma", "numpy.copy", "torch.zeros", "torch.zeros_like", "util.print_datetime...
[((705, 719), 'gurobipy.Model', 'grb.Model', (['"""M"""'], {}), "('M')\n", (714, 719), True, 'import gurobipy as grb\n'), ((3943, 4000), 'torch.zeros', 'torch.zeros', (['[self.K, self.K]'], {'dtype': 'dtype', 'device': 'device'}), '([self.K, self.K], dtype=dtype, device=device)\n', (3954, 4000), False, 'import torch\n'...
# coding: utf-8 # In[1]: import numpy as np import cv2 import matplotlib import matplotlib.pyplot as plt import matplotlib as mpimg import numpy as np from IPython.display import HTML import os, sys import glob import moviepy from moviepy.editor import VideoFileClip from moviepy.editor import * from IPython import ...
[ "numpy.absolute", "numpy.sum", "cv2.bitwise_and", "numpy.argmax", "cv2.getPerspectiveTransform", "numpy.polyfit", "cv2.fillPoly", "numpy.mean", "glob.glob", "cv2.rectangle", "cv2.inRange", "cv2.undistort", "cv2.warpPerspective", "numpy.zeros_like", "numpy.int_", "cv2.cvtColor", "nump...
[((487, 522), 'numpy.zeros', 'np.zeros', (['img.shape'], {'dtype': 'np.uint8'}), '(img.shape, dtype=np.uint8)\n', (495, 522), True, 'import numpy as np\n'), ((553, 630), 'numpy.array', 'np.array', (['[[(200, 675), (1200, 675), (700, 430), (500, 430)]]'], {'dtype': 'np.int32'}), '([[(200, 675), (1200, 675), (700, 430), ...
import pandas as pd import numpy as np import matplotlib.pyplot as plt from .instant_function import data_vars def create_categorical_onehot(df,category_columns): category_dataframe = [] for category_column in category_columns: category_dataframe.append(pd.get_dummies(df[category_column],prefix='col_'...
[ "pandas.get_dummies", "numpy.sum", "pandas.concat" ]
[((377, 414), 'pandas.concat', 'pd.concat', (['category_dataframe'], {'axis': '(1)'}), '(category_dataframe, axis=1)\n', (386, 414), True, 'import pandas as pd\n'), ((1204, 1275), 'pandas.concat', 'pd.concat', (['[norm_continuos_columns, category_dataframe_feature]'], {'axis': '(1)'}), '([norm_continuos_columns, catego...
# -*- coding:utf-8 -*- # @Time : 2019-12-27 16:11 # @Author : liuqiuxi # @Email : <EMAIL> # @File : stockfeedswinddatabase.py # @Project : datafeeds # @Software: PyCharm # @Remark : This is class of stock market import datetime import copy import pandas as pd import numpy as np from datafeeds.ut...
[ "pandas.DataFrame", "copy.deepcopy", "datafeeds.utils.BarFeedConfig.get_wind_database_items", "datafeeds.utils.BarFeedConfig.get_wind", "pandas.merge", "datafeeds.logger.get_logger", "pandas.isnull", "datetime.datetime.strptime", "numpy.where", "pandas.concat" ]
[((1741, 1797), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': "{'dateTime': data.loc[:, 'dateTime']}"}), "(data={'dateTime': data.loc[:, 'dateTime']})\n", (1753, 1797), True, 'import pandas as pd\n'), ((5383, 5423), 'datafeeds.logger.get_logger', 'logger.get_logger', ([], {'name': 'self.LOGGER_NAME'}), '(name=self....
import cv2 import tensorflow as tf import numpy as np from keras.models import Model from keras.models import load_model from numpy import asarray from PIL import Image, ImageOps import azure_get_unet as azure_predict # Since we are using the Azure API, there is not need to save the model to the local filesystem # mod...
[ "cv2.VideoWriter_fourcc", "tensorflow.argmax", "cv2.cvtColor", "numpy.asarray", "numpy.expand_dims", "PIL.ImageOps.grayscale", "cv2.addWeighted", "PIL.Image.fromarray", "cv2.VideoCapture", "numpy.array", "numpy.squeeze" ]
[((474, 498), 'numpy.expand_dims', 'np.expand_dims', (['image', '(0)'], {}), '(image, 0)\n', (488, 498), True, 'import numpy as np\n'), ((556, 577), 'numpy.squeeze', 'np.squeeze', (['result', '(0)'], {}), '(result, 0)\n', (566, 577), True, 'import numpy as np\n'), ((589, 610), 'tensorflow.argmax', 'tf.argmax', (['resul...