code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import torch import numpy as np from class_dataset import MyDataSet from class_model import MyModel from train_model import train_with_LBFGS from test_model import test_error, test, plot from torch import nn import matplotlib.pyplot as plt import scipy.stats import torch.onnx from matplotlib.pyplot import...
[ "torch.nn.MSELoss", "matplotlib.pyplot.show", "train_model.train_with_LBFGS", "matplotlib.pyplot.ylim", "numpy.power", "numpy.log2", "torch.cat", "torch.set_default_dtype", "torch.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "class_model.MyModel" ]
[((331, 369), 'torch.set_default_dtype', 'torch.set_default_dtype', (['torch.float64'], {}), '(torch.float64)\n', (354, 369), False, 'import torch\n'), ((637, 649), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {}), '()\n', (647, 649), False, 'from torch import nn\n'), ((693, 722), 'class_model.MyModel', 'MyModel', (['(1)', '...
''' RegressionTree is tested by comparing its output to that of sklearn.DecisionTreeRegressor. If equally good splits exist, the output of these models is non-deterministic. This is mainly a problem when there is a small amount of data in the nodes, so we test on a larger dataset and limit the depth. author: <NAME> da...
[ "numpy.allclose", "sklearn.tree.DecisionTreeRegressor" ]
[((763, 797), 'sklearn.tree.DecisionTreeRegressor', 'DecisionTreeRegressor', ([], {'max_depth': 'd'}), '(max_depth=d)\n', (784, 797), False, 'from sklearn.tree import DecisionTreeRegressor\n'), ((1037, 1062), 'numpy.allclose', 'np.allclose', (['pred', 'mypred'], {}), '(pred, mypred)\n', (1048, 1062), True, 'import nump...
import numpy as np from ..core.errors import InvalidConfigError from .base import ExperimentDesign from .random_design import RandomDesign from pyDOE import lhs, doe_lhs class LatinMixedDesign(ExperimentDesign): """ Latin experiment design modified to work with non-continuous variables. Neglec...
[ "numpy.isin", "numpy.full_like", "numpy.empty", "numpy.floor", "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.min", "numpy.linspace", "numpy.dot", "pyDOE.doe_lhs._pdist", "numpy.unique" ]
[((719, 775), 'numpy.empty', 'np.empty', (['(init_points_count, self.space.dimensionality)'], {}), '((init_points_count, self.space.dimensionality))\n', (727, 775), True, 'import numpy as np\n'), ((2093, 2135), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'samples'], {'endpoint': '(False)'}), '(0, 1, samples, endpo...
""" sonde.formats.greenspan ~~~~~~~~~~~~~~~~~ This module implements the Greenspan format There are two main greenspan formats also the files may be in ASCII or Excel (xls) format The module attempts to autodetect the correct format """ from __future__ import absolute_import import csv import...
[ "numpy.zeros", "numpy.isnan", "datetime.datetime", "datetime.datetime.strptime", "numpy.array", "warnings.warn" ]
[((7109, 7154), 'warnings.warn', 'warnings.warn', (['"""Expects File Object"""', 'Warning'], {}), "('Expects File Object', Warning)\n", (7122, 7154), False, 'import warnings\n'), ((13059, 13101), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['buf[0:14]', 'fmt'], {}), '(buf[0:14], fmt)\n', (13085, 13101)...
#!/usr/bin/env python3 from mujoco_py import load_model_from_path, MjSim, MjViewer from gym_kuka_mujoco.utils.kinematics import forwardKin, forwardKinJacobian, forwardKinSite, forwardKinJacobianSite import mujoco_py import matplotlib.pyplot as plt import numpy as np def trajectory_gen_joints(qd, tf, n, ti=0, dt=0.002,...
[ "mujoco_py.MjSim", "numpy.absolute", "numpy.trace", "mujoco_py.load_model_from_path", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.zeros", "mujoco_py.functions.mj_fullM", "numpy.array", "numpy.dot", "numpy.eye", "mujoco_py.MjViewer" ]
[((1366, 1375), 'numpy.eye', 'np.eye', (['(7)'], {}), '(7)\n', (1372, 1375), True, 'import numpy as np\n'), ((1441, 1450), 'numpy.eye', 'np.eye', (['(7)'], {}), '(7)\n', (1447, 1450), True, 'import numpy as np\n'), ((1690, 1699), 'numpy.eye', 'np.eye', (['(7)'], {}), '(7)\n', (1696, 1699), True, 'import numpy as np\n')...
from PIL import Image import matplotlib.pyplot as plt import numpy as np import math import scipy.signal from pylab import * import cv2 from scipy.signal import convolve2d import scipy.stats as st image_house = np.array(Image.open("images/house2.jpg"),dtype='int32') image_rectangle = np.array(Image.open("...
[ "matplotlib.pyplot.subplot", "numpy.outer", "matplotlib.pyplot.show", "cv2.circle", "scipy.signal.convolve2d", "matplotlib.pyplot.plot", "cv2.cvtColor", "cv2.destroyAllWindows", "numpy.zeros", "cv2.imshow", "PIL.Image.open", "cv2.VideoCapture", "time.sleep", "scipy.stats.norm.cdf", "nump...
[((233, 264), 'PIL.Image.open', 'Image.open', (['"""images/house2.jpg"""'], {}), "('images/house2.jpg')\n", (243, 264), False, 'from PIL import Image\n'), ((394, 438), 'PIL.Image.open', 'Image.open', (['"""images/carrelage_wikipedia.jpg"""'], {}), "('images/carrelage_wikipedia.jpg')\n", (404, 438), False, 'from PIL imp...
import numpy as np import tensorly as tl import tensorflow as tf from tensorly.decomposition import parafac def cp_decomposition_conv_layer( layers, rank=None ): layer = layers[0] weights = np.asarray(layer.get_weights()[0]) bias = layer.get_weights()[1] if layer.use_bias else None...
[ "tensorflow.keras.layers.Conv2D", "numpy.transpose", "tensorly.set_backend", "tensorly.decomposition.parafac", "tensorly.tensor", "tensorflow.keras.layers.DepthwiseConv2D", "tensorflow.expand_dims" ]
[((338, 356), 'tensorly.tensor', 'tl.tensor', (['weights'], {}), '(weights)\n', (347, 356), True, 'import tensorly as tl\n'), ((380, 405), 'tensorly.set_backend', 'tl.set_backend', (['"""pytorch"""'], {}), "('pytorch')\n", (394, 405), True, 'import tensorly as tl\n'), ((556, 574), 'tensorly.tensor', 'tl.tensor', (['wei...
# MIT License # # Copyright (c) 2018 # # 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, including without limitation the rights # to use, copy, modify, merge, publish, dis...
[ "os.makedirs", "tfmtcnn.datasets.DatasetFactory.DatasetFactory.positive_IoU", "numpy.asarray", "os.path.exists", "random.choice", "numpy.zeros", "numpy.expand_dims", "tfmtcnn.utils.BBox.BBox", "cv2.imread", "numpy.random.randint", "numpy.array", "tfmtcnn.datasets.Landmark.flip", "numpy.where...
[((2055, 2100), 'os.path.join', 'os.path.join', (['target_root_dir', '"""landmark.txt"""'], {}), "(target_root_dir, 'landmark.txt')\n", (2067, 2100), False, 'import os\n'), ((2431, 2479), 'tfmtcnn.datasets.DatasetFactory.DatasetFactory.landmark_dataset', 'DatasetFactory.landmark_dataset', (['"""CelebADataset"""'], {}),...
import numpy as np import pandas from sklearn.metrics import mean_squared_error import math from math import sqrt import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib.pylab as plt from keras.preprocessing.image import ImageDataGenerator import numpy as np import PIL from PIL import ImageFilter i...
[ "pandas.DataFrame", "keras.optimizers.SGD", "pandas.read_csv", "keras.callbacks.ModelCheckpoint", "keras.layers.Dropout", "numpy.zeros", "numpy.isfinite", "numpy.isnan", "keras.callbacks.EarlyStopping", "keras.layers.Dense", "numpy.array", "keras.models.Sequential", "numpy.ndarray", "numpy...
[((896, 934), 'pandas.read_csv', 'pandas.read_csv', (['"""test-nfl-spread.csv"""'], {}), "('test-nfl-spread.csv')\n", (911, 934), False, 'import pandas\n'), ((968, 999), 'numpy.zeros', 'np.zeros', (['[1, getter2.shape[1]]'], {}), '([1, getter2.shape[1]])\n', (976, 999), True, 'import numpy as np\n'), ((2436, 2464), 'nu...
import os import torch import numpy as np from torch.utils.data import DataLoader from pytorch_med_imaging.med_img_dataset import ImageDataSet import tqdm.auto as auto import pandas as pd import SimpleITK as sitk __all__ = ['label_statistics'] def label_statistics(label_dir: str, id_globber: str...
[ "pandas.DataFrame", "SimpleITK.ReadImage", "numpy.asarray", "tqdm.auto.tqdm", "pytorch_med_imaging.med_img_dataset.ImageDataSet", "SimpleITK.LabelShapeStatisticsImageFilter", "numpy.concatenate" ]
[((590, 667), 'pytorch_med_imaging.med_img_dataset.ImageDataSet', 'ImageDataSet', (['label_dir'], {'verbose': 'verbose', 'dtype': '"""uint8"""', 'idGlobber': 'id_globber'}), "(label_dir, verbose=verbose, dtype='uint8', idGlobber=id_globber)\n", (602, 667), False, 'from pytorch_med_imaging.med_img_dataset import ImageDa...
import numpy as np from skimage import io import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.cm as cm from math import floor from scipy.signal import convolve2d from scipy.optimize import linear_sum_assignment from scipy.stats import linregress from scipy.spatial import Delaunay from c...
[ "numpy.trace", "matplotlib.cm.get_cmap", "numpy.ones", "numpy.random.randint", "numpy.linalg.norm", "numpy.fft.ifft2", "scipy.spatial.Delaunay", "numpy.fft.ifftshift", "scipy.signal.convolve2d", "matplotlib.colors.Normalize", "numpy.transpose", "skimage.io.imshow", "numpy.linalg.det", "cop...
[((544, 662), 'numpy.array', 'np.array', (['[[0.0, 1, 0, 1, 0], [1.0, -1, -1, -1, 1], [0.0, -1, 0, -1, 0], [1.0, -1, -1,\n -1, 1], [0.0, 1, 0, 1, 0]]'], {}), '([[0.0, 1, 0, 1, 0], [1.0, -1, -1, -1, 1], [0.0, -1, 0, -1, 0], [\n 1.0, -1, -1, -1, 1], [0.0, 1, 0, 1, 0]])\n', (552, 662), True, 'import numpy as np\n'),...
import matplotlib.pyplot as plt import utils from numpy import array, shape, arange def plot_best_fit(weights, data_matrix, label_matrix): """ Graph this """ data_array = array(data_matrix) n = shape(data_array)[0] x_coord_1 = [] y_coord_1 = [] x_coord_2 = [] y_coord_2 = [] for ...
[ "matplotlib.pyplot.show", "numpy.shape", "matplotlib.pyplot.figure", "numpy.array", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((188, 206), 'numpy.array', 'array', (['data_matrix'], {}), '(data_matrix)\n', (193, 206), False, 'from numpy import array, shape, arange\n'), ((588, 600), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (598, 600), True, 'import matplotlib.pyplot as plt\n'), ((760, 782), 'numpy.arange', 'arange', (['(-3.0...
import unittest import numpy as np from mmag.unit_cell.fields import field_dipole from mmag.unit_cell.cell import Cuboid _acc = 0.0001 # Following tests compare the magnetic field created by a dipole to the field generated by the uniformly # charged sheets. If far enough, the resulting fields must be similar class Te...
[ "unittest.main", "mmag.unit_cell.cell.Cuboid", "mmag.unit_cell.fields.field_dipole", "numpy.array", "numpy.fabs", "numpy.sqrt" ]
[((7094, 7109), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7107, 7109), False, 'import unittest\n'), ((392, 435), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {'dtype': 'np.float64'}), '([0.0, 0.0, 0.0], dtype=np.float64)\n', (400, 435), True, 'import numpy as np\n'), ((452, 495), 'numpy.array', 'np.array...
# Copyright # 2019 Department of Dermatology, School of Medicine, Tohoku University # # 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/LICENS...
[ "functools.partial", "sympy.geometry.Point", "skimage.measure.subdivide_polygon", "numpy.cross", "numpy.array", "numpy.dot", "itertools.chain.from_iterable", "skimage.measure.approximate_polygon", "numpy.vstack" ]
[((3684, 3698), 'numpy.array', 'np.array', (['[-1]'], {}), '([-1])\n', (3692, 3698), True, 'import numpy as np\n'), ((3718, 3731), 'numpy.array', 'np.array', (['[1]'], {}), '([1])\n', (3726, 3731), True, 'import numpy as np\n'), ((3744, 3757), 'numpy.array', 'np.array', (['[0]'], {}), '([0])\n', (3752, 3757), True, 'im...
from functions import * from global_variables import init_global import simpy import matplotlib.pyplot as plt import random as rd import numpy as np import os from scipy.optimize import curve_fit from scipy.special import factorial n_server = 1 mu = 0.80 l = 0.64 end_n_actions = 60000 repetitions = 30 initialisation_...
[ "matplotlib.pyplot.show", "numpy.average", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "global_variables.init_global", "numpy.arange", "simpy.Environment", "matplotlib.pyplot.gca", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.sqrt" ]
[((502, 527), 'numpy.arange', 'np.arange', (['(1)', '(30000)', '(6000)'], {}), '(1, 30000, 6000)\n', (511, 527), True, 'import numpy as np\n'), ((1683, 1695), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1693, 1695), True, 'import matplotlib.pyplot as plt\n'), ((1701, 1710), 'matplotlib.pyplot.gca', 'pl...
import numpy as np temp = np.array([[1, 2], [3, 4]]) print (temp[0][0]) print (temp[0][1]) def iround(x): """iround(number) -> integer Round a number to the nearest integer.""" y = round(x) - .5 return int(y) + (y > 0) import decimal x = decimal.Decimal("2.4999999999999999999999999") whole, remain = d...
[ "numpy.around", "numpy.array", "decimal.Decimal" ]
[((26, 52), 'numpy.array', 'np.array', (['[[1, 2], [3, 4]]'], {}), '([[1, 2], [3, 4]])\n', (34, 52), True, 'import numpy as np\n'), ((256, 302), 'decimal.Decimal', 'decimal.Decimal', (['"""2.4999999999999999999999999"""'], {}), "('2.4999999999999999999999999')\n", (271, 302), False, 'import decimal\n'), ((345, 367), 'd...
# -*- coding:utf-8 -*- """ file name: sif_sent2vec.py Created on 2019/1/14 @author: kyy_b @desc: """ import numpy as np from sklearn.decomposition import PCA from typing import List from collections import Counter import pickle class SIFSent2Vec: def __init__(self, corpus, word_embeddings, embedding_size, a=1.0...
[ "numpy.divide", "numpy.multiply", "numpy.subtract", "numpy.zeros", "numpy.transpose", "numpy.append", "sklearn.decomposition.PCA", "numpy.array", "collections.Counter" ]
[((2011, 2016), 'sklearn.decomposition.PCA', 'PCA', ([], {}), '()\n', (2014, 2016), False, 'from sklearn.decomposition import PCA\n'), ((1323, 1352), 'numpy.zeros', 'np.zeros', (['self.embedding_size'], {}), '(self.embedding_size)\n', (1331, 1352), True, 'import numpy as np\n'), ((1756, 1786), 'numpy.divide', 'np.divid...
from .inmoov_shadow_hand_v2 import InmoovShadowNew from . import utils import pybullet as p import time import gym, gym.utils.seeding, gym.spaces import numpy as np import math import os import inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) class InmoovShadowHandGrasp...
[ "pybullet.resetSimulation", "numpy.arctan2", "pybullet.setCollisionFilterPair", "pybullet.applyExternalForce", "numpy.linalg.norm", "pybullet.connect", "gym.utils.seeding.np_random", "pybullet.getQuaternionFromEuler", "pybullet.getContactPoints", "pybullet.getLinkState", "pybullet.setGravity", ...
[((2875, 2951), 'numpy.array', 'np.array', (['([0.009 / self.control_skip] * 7 + [0.024 / self.control_skip] * 17)'], {}), '([0.009 / self.control_skip] * 7 + [0.024 / self.control_skip] * 17)\n', (2883, 2951), True, 'import numpy as np\n'), ((3035, 3085), 'pybullet.getQuaternionFromEuler', 'p.getQuaternionFromEuler', ...
# Copyright (C) 2016 <NAME> # # This file is part of GM81. # # GM81 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # GM81 is distrib...
[ "numpy.empty", "numpy.tanh", "numpy.sqrt" ]
[((1345, 1443), 'numpy.sqrt', 'np.sqrt', (['((N0 ** 2 * k ** 2 + f ** 2 * (np.pi * j / b) ** 2) / (k ** 2 + (np.pi * j /\n b) ** 2))'], {}), '((N0 ** 2 * k ** 2 + f ** 2 * (np.pi * j / b) ** 2) / (k ** 2 + (np.\n pi * j / b) ** 2))\n', (1352, 1443), True, 'import numpy as np\n'), ((4142, 4158), 'numpy.empty', 'np...
import numpy as np from transforms.gaf import GAF from models.cnn import CNN class CNNTimeSeries(CNN): def __init__(self, image_shape, prediction_shape, batch_size, extremes=[None, None]): super().__init__(image_shape, prediction_shape) self.batch_size = batch_size self.extremes = extreme...
[ "transforms.gaf.GAF", "numpy.array", "numpy.expand_dims", "numpy.concatenate" ]
[((458, 486), 'transforms.gaf.GAF', 'GAF', (['sequence', 'self.extremes'], {}), '(sequence, self.extremes)\n', (461, 486), False, 'from transforms.gaf import GAF\n'), ((1566, 1592), 'numpy.concatenate', 'np.concatenate', (['self.dataX'], {}), '(self.dataX)\n', (1580, 1592), True, 'import numpy as np\n'), ((1609, 1630),...
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.svm import LinearSVC from sklearn.linear_model import SGDClassifier from sklearn.metrics import accuracy_score from sklearn.preprocessing import PolynomialFeatures import matplotlib.pyplot as plt import matplotlib.c...
[ "os.mkdir", "sklearn.linear_model.SGDClassifier", "sklearn.model_selection.train_test_split", "numpy.genfromtxt", "numpy.random.RandomState", "time.time", "random.seed", "os.path.join" ]
[((428, 473), 'numpy.genfromtxt', 'np.genfromtxt', (['"""data/SUSY.csv"""'], {'delimiter': '""","""'}), "('data/SUSY.csv', delimiter=',')\n", (441, 473), True, 'import numpy as np\n'), ((539, 602), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.2)', 'random_state': 'rando...
# https://towardsdatascience.com/6-steps-to-write-any-machine-learning-algorithm-from-scratch-perceptron-case-study-335f638a70f3 # Importing libraries # NAND Gate # Note: x0 is a dummy variable for the bias term # x0 x1 x2 import numpy as np x = [[1., 0., 0.], [1., 0., 1.], [1., 1., 0.], [1., 1., 1...
[ "numpy.dot" ]
[((428, 443), 'numpy.dot', 'np.dot', (['w', 'x[0]'], {}), '(w, x[0])\n', (434, 443), True, 'import numpy as np\n')]
#! /usr/bin/env python import numpy as np simples = [1,0] def sigmd(x): return ( 1 / ( 1 + np.exp(-x) ) ) def dsigmd(x): return (sigmd(x)*( 1- sigmd(x))) # #Cross-entropy loss # def loss(y_lab,f): return (y_lab*np.log(f) + (1-y_lab)*np.log(1 - f))*(-1) def nn(w,b,x): return sigmd(w*x+b) def dw(x...
[ "numpy.log", "numpy.exp" ]
[((98, 108), 'numpy.exp', 'np.exp', (['(-x)'], {}), '(-x)\n', (104, 108), True, 'import numpy as np\n'), ((229, 238), 'numpy.log', 'np.log', (['f'], {}), '(f)\n', (235, 238), True, 'import numpy as np\n'), ((251, 264), 'numpy.log', 'np.log', (['(1 - f)'], {}), '(1 - f)\n', (257, 264), True, 'import numpy as np\n')]
""" Code to sample from the latent space and generate the corresponding audio. The input is the conditional parameter pitch. """ import torch from torchvision import transforms from torchvision.datasets import MNIST from torch.utils.data import DataLoader import numpy as np import matplotlib.pyplot as pyp from vae_kri...
[ "sys.path.append", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "os.makedirs", "matplotlib.pyplot.ylim", "numpy.log2", "torch.load", "torch.FloatTensor", "numpy.zeros", "numpy.insert", "matplotlib.pyplot.figure", "numpy.array", "numpy.linspace", "glob.glob", "sampling_synth.recon_...
[((390, 438), 'sys.path.append', 'sys.path.append', (['"""../extra_dependencies/models/"""'], {}), "('../extra_dependencies/models/')\n", (405, 438), False, 'import sys\n'), ((1060, 1090), 'glob.glob', 'glob.glob', (["(dir_files + '*.pth')"], {}), "(dir_files + '*.pth')\n", (1069, 1090), False, 'import glob\n'), ((7794...
import ipyleaflet as ll import numpy as np import vaex.image from .plot import BackendBase import copy from .utils import debounced class IpyleafletBackend(BackendBase): def __init__(self, map=None, center=[53.3082834, 6.388399], zoom=12): self.map = map self._center = center self._zoom = ...
[ "numpy.array", "copy.deepcopy", "ipyleaflet.Map" ]
[((778, 816), 'ipyleaflet.Map', 'll.Map', ([], {'center': 'center', 'zoom': 'self._zoom'}), '(center=center, zoom=self._zoom)\n', (784, 816), True, 'import ipyleaflet as ll\n'), ((1401, 1427), 'copy.deepcopy', 'copy.deepcopy', (['self.limits'], {}), '(self.limits)\n', (1414, 1427), False, 'import copy\n'), ((530, 546),...
import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import dash from app import app import numpy import plotly.graph_objects as go # or plotly.express as px from elasticsearch import Elasticsearch port = 9200 index_name = "evm_tests" server = "alpine" es...
[ "elasticsearch.Elasticsearch", "plotly.graph_objects.Scatter", "dash_html_components.H6", "dash_html_components.Div", "plotly.graph_objects.Figure", "dash.dependencies.Input", "dash_html_components.H4", "numpy.array", "dash_core_components.Graph", "dash.dependencies.Output" ]
[((323, 409), 'elasticsearch.Elasticsearch', 'Elasticsearch', (["[{'host': server, 'port': port}]"], {'http_auth': "('elastic', 'changeme')"}), "([{'host': server, 'port': port}], http_auth=('elastic',\n 'changeme'))\n", (336, 409), False, 'from elasticsearch import Elasticsearch\n'), ((412, 423), 'plotly.graph_obje...
import numpy as np from ..search_setting._base import get_params, to_func def eval_fitness(scores, sign): """ Fitness is in proportion to difference from worst score. """ scores = sign*scores scores = np.nanmax(scores) - scores scores /= np.nansum(scores) scores[np.isnan(scores)] = 0 r...
[ "numpy.nansum", "numpy.isnan", "numpy.array", "numpy.random.rand", "numpy.nanmax" ]
[((264, 281), 'numpy.nansum', 'np.nansum', (['scores'], {}), '(scores)\n', (273, 281), True, 'import numpy as np\n'), ((223, 240), 'numpy.nanmax', 'np.nanmax', (['scores'], {}), '(scores)\n', (232, 240), True, 'import numpy as np\n'), ((293, 309), 'numpy.isnan', 'np.isnan', (['scores'], {}), '(scores)\n', (301, 309), T...
from __future__ import print_function, absolute_import from six import iteritems, itervalues from six.moves import range from pyNastran.bdf.bdf import BDF import tables import numpy as np from .input import Input from .result import Result from .pynastran_interface import get_bdf_cards from .punch ...
[ "tables.add", "pyNastran.bdf.bdf.BDF", "six.StringIO", "tables.Filters", "numpy.array", "tables.open_file" ]
[((490, 533), 'tables.Filters', 'tables.Filters', ([], {'complib': '"""zlib"""', 'complevel': '(5)'}), "(complib='zlib', complevel=5)\n", (504, 533), False, 'import tables\n'), ((554, 610), 'tables.open_file', 'tables.open_file', (['h5filename'], {'mode': 'mode', 'filters': 'filters'}), '(h5filename, mode=mode, filters...
import matplotlib.pyplot as plt import seaborn as sns sns.set() import numpy as np import sys sys.path.append('../') from src.utils.plotting import latexconfig latexconfig() h = 6.626e-34 # Planck constant [J⋅s] c = 3.0e+8 # speed of light [m/s] k = 1.38e-23 # Boltzmann constant [J⋅K^−1] def B_rj(labda,...
[ "sys.path.append", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "matplotlib.pyplot.vlines", "src.utils.plotting.latexconfig", "matplotlib.pyplot.axvspan", "matplotlib.pyplot.figure", "numpy.arange", "numpy.exp", "matplotlib.pyplot.ylabel", "matplotlib.pyplot....
[((54, 63), 'seaborn.set', 'sns.set', ([], {}), '()\n', (61, 63), True, 'import seaborn as sns\n'), ((95, 117), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (110, 117), False, 'import sys\n'), ((161, 174), 'src.utils.plotting.latexconfig', 'latexconfig', ([], {}), '()\n', (172, 174), False, '...
import numpy as np from agents.common import PlayerAction, BoardPiece, SavedState def test_evaluate_window(): from agents.agent_minimax import evaluate_window window = np.array([0,1.0,1]) player = BoardPiece(2) ret = evaluate_window(window, player) assert isinstance(ret, np.int) def test_alpha_bet...
[ "agents.agent_minimax.generate_move_minimax", "agents.agent_minimax.evaluate_window", "numpy.zeros", "agents.common.BoardPiece", "agents.agent_minimax.score_position", "numpy.array", "agents.agent_minimax.alpha_beta" ]
[((177, 198), 'numpy.array', 'np.array', (['[0, 1.0, 1]'], {}), '([0, 1.0, 1])\n', (185, 198), True, 'import numpy as np\n'), ((210, 223), 'agents.common.BoardPiece', 'BoardPiece', (['(2)'], {}), '(2)\n', (220, 223), False, 'from agents.common import PlayerAction, BoardPiece, SavedState\n'), ((234, 265), 'agents.agent_...
import gettext import unittest import numpy # local libraries from nion.swift import Facade from nion.data import DataAndMetadata from nion.swift.test import TestContext from nion.ui import TestUI from nion.swift import Application from nion.swift.model import DocumentModel from nionswift_plugin.nion_experimental_to...
[ "nionswift_plugin.nion_experimental_tools.AffineTransformImage.AffineTransformMenuItem", "nion.swift.Facade.initialize", "nion.swift.Facade.get_api", "numpy.zeros", "nion.data.DataAndMetadata.new_data_and_metadata", "nion.swift.model.DocumentModel.evaluate_data", "numpy.rot90", "nion.data.DataAndMetad...
[((375, 394), 'nion.swift.Facade.initialize', 'Facade.initialize', ([], {}), '()\n', (392, 394), False, 'from nion.swift import Facade\n'), ((481, 515), 'nion.swift.test.TestContext.MemoryProfileContext', 'TestContext.MemoryProfileContext', ([], {}), '()\n', (513, 515), False, 'from nion.swift.test import TestContext\n...
import numpy as np import matplotlib.pyplot as plt import pandas as pd import math import cmath import seaborn import scipy import functools import time #parameter settings v=1 #intracell hopping in time period 1 w=1 #intercell hopping in time period 2 aalpha=-0.25 #phase index 1 bbeta=0.75 #phase ind...
[ "scipy.linalg.expm", "numpy.matrix", "numpy.abs", "numpy.log", "math.pow", "numpy.angle", "numpy.zeros", "numpy.mod", "scipy.linalg.inv", "numpy.arange", "numpy.exp", "numpy.cos", "cmath.exp", "numpy.conjugate", "numpy.sqrt" ]
[((561, 570), 'numpy.abs', 'np.abs', (['z'], {}), '(z)\n', (567, 570), True, 'import numpy as np\n'), ((587, 598), 'numpy.angle', 'np.angle', (['z'], {}), '(z)\n', (595, 598), True, 'import numpy as np\n'), ((865, 896), 'numpy.zeros', 'np.zeros', (['(2, 2)'], {'dtype': 'complex'}), '((2, 2), dtype=complex)\n', (873, 89...
""" # A tutorial about Label Images in ANTsPy In ANTsPy, we have a special class for dealing with what I call "Label Images" - a brain image where each pixel/voxel is associated with a specific label. For instance, an atlas or parcellation is the prime example of a label image. But `LabelImage` types dont <i>just</...
[ "pandas.DataFrame", "numpy.asarray", "numpy.zeros", "ants.from_numpy", "ants.LabelImage", "os.path.join" ]
[((1316, 1334), 'numpy.zeros', 'np.zeros', (['(20, 20)'], {}), '((20, 20))\n', (1324, 1334), True, 'import numpy as np\n'), ((1719, 1864), 'numpy.asarray', 'np.asarray', (["[['TopRight', 'Right', 'Top'], ['BottomRight', 'Right', 'Bottom'], [\n 'TopLeft', 'Left', 'Top'], ['BottomLeft', 'Left', 'Bottom']]"], {}), "([[...
from skimage.segmentation._watershed import watershed from i3Deep import utils import os from evaluate import evaluate import numpy as np from tqdm import tqdm def compute_predictions(image_path, mask_path, gt_path, save_path, nr_modalities, class_labels): image_filenames = utils.load_filenames(image_path)...
[ "skimage.segmentation._watershed.watershed", "numpy.flip", "os.path.basename", "evaluate.evaluate", "i3Deep.utils.load_nifty", "i3Deep.utils.load_filenames", "numpy.unique" ]
[((360, 391), 'i3Deep.utils.load_filenames', 'utils.load_filenames', (['mask_path'], {}), '(mask_path)\n', (380, 391), False, 'from i3Deep import utils\n'), ((1059, 1101), 'evaluate.evaluate', 'evaluate', (['gt_path', 'save_path', 'class_labels'], {}), '(gt_path, save_path, class_labels)\n', (1067, 1101), False, 'from ...
# The setup here is similar to Table 8.1 in Watanabe textbook. I don't use his prior for A and B however. He also never specifies how he chose A_0 and B_0 from __future__ import print_function from torch.distributions.uniform import Uniform from torch.distributions.normal import Normal from torch.distributions.multiv...
[ "sys.path.append", "numpy.empty", "numpy.append", "numpy.log" ]
[((392, 414), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (407, 414), False, 'import sys\n'), ((1411, 1422), 'numpy.empty', 'np.empty', (['(0)'], {}), '(0)\n', (1419, 1422), True, 'import numpy as np\n'), ((3310, 3328), 'numpy.empty', 'np.empty', (['args.MCs'], {}), '(args.MCs)\n', (3318, 33...
import numpy as np from scipy import stats import seaborn as sns def r2_pearson(x, y): return stats.pearsonr(x, y)[0] ** 2 def r_pearson(x, y): return stats.pearsonr(x, y)[0] def r2_spearman(x, y): return stats.spearmanr(x, y)[0] ** 2 def r_spearman(x, y): return stats.spearmanr(x, y)[0] def p...
[ "scipy.stats.spearmanr", "scipy.stats.pearsonr", "seaborn.regplot", "seaborn.jointplot", "numpy.log10" ]
[((1381, 1459), 'seaborn.regplot', 'sns.regplot', (['x', 'y'], {'data': 'df', 'ax': 'g.ax_joint', 'scatter': '(False)', 'color': 'reg_line_color'}), '(x, y, data=df, ax=g.ax_joint, scatter=False, color=reg_line_color)\n', (1392, 1459), True, 'import seaborn as sns\n'), ((163, 183), 'scipy.stats.pearsonr', 'stats.pearso...
import numpy as np import rospy from std_msgs.msg import Float64MultiArray, MultiArrayDimension def main(): rospy.init_node('phonebot_stand', anonymous=True) cmd_topic = '/phonebot/joints_position_controller/command' pub = rospy.Publisher(cmd_topic, Float64MultiArray, queue_size=16) msg = Float64Multi...
[ "numpy.full", "std_msgs.msg.MultiArrayDimension", "rospy.Time.now", "rospy.Publisher", "rospy.Rate", "numpy.clip", "rospy.is_shutdown", "std_msgs.msg.Float64MultiArray", "rospy.init_node" ]
[((114, 163), 'rospy.init_node', 'rospy.init_node', (['"""phonebot_stand"""'], {'anonymous': '(True)'}), "('phonebot_stand', anonymous=True)\n", (129, 163), False, 'import rospy\n'), ((237, 297), 'rospy.Publisher', 'rospy.Publisher', (['cmd_topic', 'Float64MultiArray'], {'queue_size': '(16)'}), '(cmd_topic, Float64Mult...
from matplotlib import pyplot as plt import numpy as np def graph(sac, avg_reward, disc_r): plt.title("Reward per Epoch") plt.xlabel("Epoch") plt.ylabel("Reward") ls1 = np.linspace(0, len(sac.q1_loss), num=len(avg_reward)).tolist() avg_rp = np.array(avg_reward) plt.plot(ls1, avg_rp/np.max(np.abs(avg_rp))...
[ "matplotlib.pyplot.title", "numpy.abs", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "matplotlib.pyplot.legend", "matplotlib.pyplot.draw", "numpy.array", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.pause" ]
[((97, 126), 'matplotlib.pyplot.title', 'plt.title', (['"""Reward per Epoch"""'], {}), "('Reward per Epoch')\n", (106, 126), True, 'from matplotlib import pyplot as plt\n'), ((128, 147), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Epoch"""'], {}), "('Epoch')\n", (138, 147), True, 'from matplotlib import pyplot as p...
import numpy as np # Linear algebra import re # Regular expressions import pandas as pd # Data wrangling import string import sys # Custom dependencies sys.path.append('/projects/../../PythonNotebooks/model/') from helper import * class Translator(object): def __init__(self, DataFrame, maxlen = 150...
[ "sys.path.append", "json.dump", "pandas.DataFrame", "json.load", "re.split", "numpy.trim_zeros", "numpy.asarray", "numpy.array", "pandas.Series", "numpy.arange", "re.compile" ]
[((153, 210), 'sys.path.append', 'sys.path.append', (['"""/projects/../../PythonNotebooks/model/"""'], {}), "('/projects/../../PythonNotebooks/model/')\n", (168, 210), False, 'import sys\n'), ((4450, 4468), 'pandas.Series', 'pd.Series', (['decoded'], {}), '(decoded)\n', (4459, 4468), True, 'import pandas as pd\n'), ((5...
from typing import Callable, List import tensorflow as tf import gudhi import numpy as np from distances.euclidean import euclidean_distance def generate_distance_matrix(point_cloud: np.array, distance_function: Callable[[np.array, np.array], float] = euclidean_distance): numpy_dist...
[ "numpy.tril_indices", "numpy.argmax", "tensorflow.reshape", "numpy.zeros", "numpy.argsort", "numpy.array", "numpy.reshape", "gudhi.RipsComplex" ]
[((334, 388), 'numpy.zeros', 'np.zeros', (['(point_cloud.shape[0], point_cloud.shape[0])'], {}), '((point_cloud.shape[0], point_cloud.shape[0]))\n', (342, 388), True, 'import numpy as np\n'), ((1282, 1332), 'gudhi.RipsComplex', 'gudhi.RipsComplex', ([], {'distance_matrix': 'distance_matrix'}), '(distance_matrix=distanc...
# Copyright 2020, Battelle Energy Alliance, LLC # ALL RIGHTS RESERVED """ Created on Feb. 7, 2020 @author: wangc, mandd """ #External Modules------------------------------------------------------------------------------------ import numpy as np import numpy.ma as ma #External Modules End------------------------------...
[ "utils.InputData.parameterInputFactory", "numpy.power", "numpy.any", "numpy.ma.array", "numpy.exp" ]
[((4302, 4343), 'numpy.ma.array', 'ma.array', (['(self._tm - self._loc)'], {'mask': 'mask'}), '(self._tm - self._loc, mask=mask)\n', (4310, 4343), True, 'import numpy.ma as ma\n'), ((5006, 5047), 'numpy.ma.array', 'ma.array', (['(self._tm - self._loc)'], {'mask': 'mask'}), '(self._tm - self._loc, mask=mask)\n', (5014, ...
# -*- coding: utf-8 -*- """ Created on Tue Apr 20 09:34:32 2021 @author: jsalm """ # -*- coding: utf-8 -*- """ Created on Tue Mar 23 14:56:52 2021 @author: jsalm """ import tpp_class_ball as tpp import numpy as np import os import matplotlib.pyplot as plt dirname = os.path.dirname(__file__) save_bin = os.path.join(d...
[ "numpy.stack", "tpp_class_ball.Muscle_Mech", "tpp_class_ball.Ball", "matplotlib.pyplot.close", "os.path.dirname", "numpy.arange", "tpp_class_ball.TpPendulum", "os.path.join" ]
[((269, 294), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (284, 294), False, 'import os\n'), ((306, 339), 'os.path.join', 'os.path.join', (['dirname', '"""save_bin"""'], {}), "(dirname, 'save_bin')\n", (318, 339), False, 'import os\n'), ((371, 387), 'matplotlib.pyplot.close', 'plt.close', ...
import numpy as np class LinearReressionGD(object): ''' Requirement : Numpy module ''' def __init__(self,lr,n_iters): self.lr = lr self.n_iters = n_iters def fit(self,X,y) : self.w_ = np.zeros(1+X.shape[1]) self.cost_ = [] for i in range(self.n_iters): y_hat = self.activation(X) error = (y-y_hat...
[ "numpy.dot", "numpy.zeros" ]
[((197, 221), 'numpy.zeros', 'np.zeros', (['(1 + X.shape[1])'], {}), '(1 + X.shape[1])\n', (205, 221), True, 'import numpy as np\n'), ((536, 558), 'numpy.dot', 'np.dot', (['X', 'self.w_[1:]'], {}), '(X, self.w_[1:])\n', (542, 558), True, 'import numpy as np\n')]
#------------------------------------------------------------------------------ # Libraries #------------------------------------------------------------------------------ # Standard import numpy as np import pandas as pd import more_itertools # User from base.base_estimator import BaseCateEstimator from randomized_ex...
[ "randomized_experiments.frequentist_inference.TreatmentEffectEstimator", "numpy.array", "pandas.Series" ]
[((1566, 1634), 'randomized_experiments.frequentist_inference.TreatmentEffectEstimator', 'frequentist_inference.TreatmentEffectEstimator', ([], {'use_regression': '(False)'}), '(use_regression=False)\n', (1612, 1634), False, 'from randomized_experiments import frequentist_inference\n'), ((1870, 1881), 'numpy.array', 'n...
""" Created on July 2020 Demo for traning a 2D FBSEM net @author: <NAME> <EMAIL> """ import numpy as np from matplotlib import pyplot as plt from geometry.BuildGeometry_v4 import BuildGeometry_v4 from models.deeplib import buildBrainPhantomDataset # build PET recontruction object temPath = r'C:\pythonWorkSpace...
[ "numpy.load", "geometry.BuildGeometry_v4.BuildGeometry_v4", "numpy.arange", "matplotlib.pyplot.subplots", "models.deeplib.buildBrainPhantomDataset" ]
[((335, 363), 'geometry.BuildGeometry_v4.BuildGeometry_v4', 'BuildGeometry_v4', (['"""mmr"""', '(0.5)'], {}), "('mmr', 0.5)\n", (351, 363), False, 'from geometry.BuildGeometry_v4 import BuildGeometry_v4\n'), ((1114, 1132), 'numpy.arange', 'np.arange', (['(0)', '(5)', '(1)'], {}), '(0, 5, 1)\n', (1123, 1132), True, 'imp...
import numpy as np from glmsingle.ols.make_poly_matrix import (make_polynomial_matrix, make_projection_matrix) import warnings warnings.simplefilter(action="ignore", category=FutureWarning) def construct_projection_matrix(ntimepoints, extra_...
[ "numpy.arange", "glmsingle.ols.make_poly_matrix.make_projection_matrix", "warnings.simplefilter", "glmsingle.ols.make_poly_matrix.make_polynomial_matrix" ]
[((172, 234), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (193, 234), False, 'import warnings\n'), ((793, 839), 'glmsingle.ols.make_poly_matrix.make_polynomial_matrix', 'make_polynomial_matrix', (['ntimep...
from __future__ import division import numpy as np def projectSimplex(v): # Compute the minimum L2-distance projection of vector v onto the probability simplex nVars = len(v) mu = np.sort(v) mu = mu[::-1] sm = 0 for j in xrange(nVars): sm = sm + mu[j] if mu[j] - (1 / (j + 1)) * (sm...
[ "numpy.sort" ]
[((190, 200), 'numpy.sort', 'np.sort', (['v'], {}), '(v)\n', (197, 200), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- """ TRABAJO 2 Nombre Estudiante: <NAME> """ import numpy as np import matplotlib.pyplot as plt # Fijamos la semilla np.random.seed(1) def simula_unif(N, dim, rango): return np.random.uniform(rango[0],rango[1],(N,dim)) def simula_gaus(N, dim, sigma): media = 0 ...
[ "matplotlib.pyplot.title", "numpy.load", "numpy.random.seed", "matplotlib.pyplot.clf", "numpy.empty", "numpy.ones", "numpy.clip", "numpy.mean", "matplotlib.pyplot.contour", "numpy.arange", "numpy.exp", "numpy.linalg.norm", "numpy.copy", "numpy.std", "numpy.max", "numpy.linspace", "nu...
[((155, 172), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (169, 172), True, 'import numpy as np\n'), ((13433, 13458), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (13441, 13458), True, 'import numpy as np\n'), ((15143, 15166), 'numpy.mean', 'np.mean', (['sucesion_pasos...
# coding=utf-8 # Copyright 2020 The Google Research 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 applicab...
[ "os.remove", "pybullet.createMultiBody", "pybullet.createVisualShape", "numpy.float32", "pybullet.createConstraint", "time.sleep", "pybullet.changeConstraint", "ravens.utils.apply", "pybullet.changeVisualShape", "pybullet.createCollisionShape", "numpy.sqrt" ]
[((1450, 1465), 'os.remove', 'os.remove', (['urdf'], {}), '(urdf)\n', (1459, 1465), False, 'import os\n'), ((1710, 1749), 'ravens.utils.apply', 'utils.apply', (['square_pose', 'zone_position'], {}), '(square_pose, zone_position)\n', (1721, 1749), False, 'from ravens import utils\n'), ((2073, 2093), 'numpy.float32', 'np...
from __future__ import print_function import argparse import numpy as np import numpy.random as npr import time import os import sys import pickle import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms # Format time for printing pu...
[ "sys.stdout.write", "pickle.dump", "numpy.random.seed", "argparse.ArgumentParser", "torch.nn.functional.dropout", "pickle.load", "sys.stdout.flush", "torch.device", "torchvision.transforms.Normalize", "os.path.join", "torchvision.transforms.Compose", "torch.nn.functional.log_softmax", "torch...
[((6525, 6578), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""training MNIST"""'}), "(description='training MNIST')\n", (6548, 6578), False, 'import argparse\n'), ((8868, 8911), 'torch.device', 'torch.device', (["('cuda' if use_cuda else 'cpu')"], {}), "('cuda' if use_cuda else 'cpu')\n...
# %% import numpy as np from bokeh.layouts import gridplot from bokeh.plotting import figure, output_file, show from bokeh.io import output_notebook import pandas as pd class plotresult: def __init__(self, savefile): container = np.load(savefile) self.sim_result = [container[key] for key in contai...
[ "numpy.load", "bokeh.io.output_notebook", "bokeh.plotting.figure", "numpy.where", "bokeh.plotting.show" ]
[((243, 260), 'numpy.load', 'np.load', (['savefile'], {}), '(savefile)\n', (250, 260), True, 'import numpy as np\n'), ((678, 695), 'bokeh.io.output_notebook', 'output_notebook', ([], {}), '()\n', (693, 695), False, 'from bokeh.io import output_notebook\n'), ((709, 769), 'bokeh.plotting.figure', 'figure', ([], {'x_axis_...
# ============================================================================= # Created By: bpatter5 # Updated By: bpatter5 # Created On: 12/3/2018 # Updated On: 12/8/2018 # Purpose: Methods for working with Parquet files and Arrow operations # =========================================================================...
[ "numpy.full", "pyarrow.RecordBatch.from_arrays", "pyarrow.Table.from_batches", "pyarrow.Table.from_arrays", "numpy.arange", "pyarrow.parquet.read_table", "pyarrow.array", "pyarrow.parquet.write_to_dataset", "pyarrow.memory_map" ]
[((1587, 1606), 'pyarrow.memory_map', 'pa.memory_map', (['path'], {}), '(path)\n', (1600, 1606), True, 'import pyarrow as pa\n'), ((2754, 2786), 'numpy.arange', 'np.arange', (['(0)', 'test_stat.shape[1]'], {}), '(0, test_stat.shape[1])\n', (2763, 2786), True, 'import numpy as np\n'), ((2854, 2897), 'pyarrow.RecordBatch...
""" 1. Crop( _crop1 ~ _crop4 ) 2. Random RGB Scaling( _rgb ) 3. weak Gaussian Blur( _blur ) 4. rotation( _rot1 ~ _rot2 ) """ import cv2 import os import numpy as np import matplotlib.pyplot as plt import copy import random def filtering(img, number): if number == 0: return cv2.Gaussian...
[ "cv2.GaussianBlur", "random.randint", "cv2.rotate", "cv2.imwrite", "numpy.zeros", "cv2.imread", "random.random", "cv2.LUT", "numpy.arange", "cv2.flip", "os.listdir" ]
[((1760, 1791), 'numpy.zeros', 'np.zeros', (['image.shape', 'np.uint8'], {}), '(image.shape, np.uint8)\n', (1768, 1791), True, 'import numpy as np\n'), ((2375, 2396), 'cv2.LUT', 'cv2.LUT', (['image', 'table'], {}), '(image, table)\n', (2382, 2396), False, 'import cv2\n'), ((2491, 2513), 'os.listdir', 'os.listdir', (['i...
import mmcv import numpy as np from pycocotools_local.coco import * import os.path as osp from .utils import to_tensor, random_scale from mmcv.parallel import DataContainer as DC from .custom import CustomDataset from .forkedpdb import ForkedPdb from skimage.transform import resize class Coco3D2ScalesDataset(CustomDa...
[ "numpy.load", "numpy.transpose", "numpy.zeros", "numpy.hstack", "numpy.array", "skimage.transform.resize", "mmcv.parallel.DataContainer", "os.path.join", "numpy.repeat" ]
[((6808, 6855), 'os.path.join', 'osp.join', (['self.img_prefix', "img_info['filename']"], {}), "(self.img_prefix, img_info['filename'])\n", (6816, 6855), True, 'import os.path as osp\n'), ((6882, 6933), 'os.path.join', 'osp.join', (['self.img_prefix_2', "img_info_2['filename']"], {}), "(self.img_prefix_2, img_info_2['f...
# -*- coding: utf-8 -*- """ Created on Thu May 21 19:48:17 2020 @author: zhang """ import os import numpy as np import xgboost as xgb from sklearn.metrics import accuracy_score from xgboost import plot_importance #显示特征重要性 from matplotlib import pyplot import random from sklearn.model_selection import trai...
[ "sklearn.model_selection.GridSearchCV", "numpy.load", "sklearn.model_selection.train_test_split", "numpy.array", "xgboost.XGBClassifier" ]
[((399, 424), 'numpy.array', 'np.array', (['[0, 0, 0, 0, 1]'], {}), '([0, 0, 0, 0, 1])\n', (407, 424), True, 'import numpy as np\n'), ((421, 446), 'numpy.array', 'np.array', (['[1, 0, 0, 1, 0]'], {}), '([1, 0, 0, 1, 0])\n', (429, 446), True, 'import numpy as np\n'), ((443, 468), 'numpy.array', 'np.array', (['[1, 0, 1, ...
#/usr/bin/env python # system import import os import pkg_resources import yaml import pprint import numpy as np import pandas as pd import itertools import matplotlib.pyplot as plt # 3rd party import torch from torch_geometric.data import Data from trackml.dataset import load_event # local import from heptrkx.datas...
[ "exatrkx.LayerlessEmbedding", "yaml.load", "numpy.random.seed", "argparse.ArgumentParser", "matplotlib.pyplot.scatter", "torch.cat", "matplotlib.pyplot.figure", "numpy.random.randint", "numpy.array", "heptrkx.dataset.event.Event", "exatrkx.src.utils_torch.build_edges", "itertools.product", "...
[((673, 705), 'heptrkx.dataset.event.Event', 'master.Event', (['utils_dir.inputdir'], {}), '(utils_dir.inputdir)\n', (685, 705), True, 'from heptrkx.dataset import event as master\n'), ((861, 886), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (875, 886), True, 'import numpy as np\n'), ((...
from numpy.random import randn import ref import torch import numpy as np def adjust_learning_rate(optimizer, epoch, LR, LR_param): #lr = LR * (0.1 ** (epoch // dropLR)) LR_policy = LR_param.get('lr_policy', 'step') if LR_policy == 'step': steppoints = LR_param.get('steppoints', [4, 7, 9, 10]) ...
[ "numpy.random.randn" ]
[((1243, 1250), 'numpy.random.randn', 'randn', ([], {}), '()\n', (1248, 1250), False, 'from numpy.random import randn\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys # Hack so you don't have to put the library containing this script in the PYTHONPATH. sys.path = [os.path.abspath(os.path.join(__file__, '..', '..'))] + sys.path import theano import theano.tensor as T import numpy as np import tempfile from numpy....
[ "smartlearner.Trainer", "smartlearner.optimizers.SGD", "numpy.arange", "os.path.join", "numpy.prod", "convnade.batch_schedulers.MiniBatchSchedulerWithAutoregressiveMask", "numpy.set_printoptions", "tempfile.TemporaryDirectory", "theano.tensor.concatenate", "smartlearner.tasks.Print", "numpy.test...
[((1443, 1477), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': '(220)'}), '(linewidth=220)\n', (1462, 1477), True, 'import numpy as np\n'), ((1807, 1850), 'convnade.utils.Timer', 'Timer', (['"""Loading/processing binarized MNIST"""'], {}), "('Loading/processing binarized MNIST')\n", (1812, 1850), F...
from pyrep.objects.vision_sensor import VisionSensor import numpy as np import cv2 class Camera(VisionSensor): def __init__(self): super().__init__('camera') # enable camera sensor #self.set_explicit_handling(1) #self.handle_explicitly() # compute vision sensor intrinsic mat...
[ "numpy.array" ]
[((637, 708), 'numpy.array', 'np.array', (['[[0, 1, 0, 1.1], [1, 0, 0, 0], [0, 0, -1, 1.8], [0, 0, 0, 1]]'], {}), '([[0, 1, 0, 1.1], [1, 0, 0, 0], [0, 0, -1, 1.8], [0, 0, 0, 1]])\n', (645, 708), True, 'import numpy as np\n'), ((889, 918), 'numpy.array', 'np.array', (['img'], {'dtype': 'np.uint8'}), '(img, dtype=np.uint...
""" This file contains classes which have functions to optimize the queries to ask the human. """ from typing import Callable, List, Tuple import itertools import numpy as np from scipy.spatial import ConvexHull import warnings from aprel.basics import Trajectory, TrajectorySet from aprel.learning import Belief, Sampl...
[ "aprel.utils.kMedoids", "aprel.utils.dpp_mode", "numpy.ones_like", "numpy.concatenate", "aprel.basics.TrajectorySet", "numpy.argpartition", "numpy.isclose", "numpy.min", "numpy.array", "numpy.arange", "numpy.exp", "numpy.random.choice", "warnings.warn", "scipy.spatial.ConvexHull", "numpy...
[((19786, 19817), 'aprel.utils.kMedoids', 'kMedoids', (['distances', 'batch_size'], {}), '(distances, batch_size)\n', (19794, 19817), False, 'from aprel.utils import kMedoids, dpp_mode, default_query_distance\n'), ((22988, 23013), 'scipy.spatial.ConvexHull', 'ConvexHull', (['features_diff'], {}), '(features_diff)\n', (...
import os.path import numpy as np from sklearn.impute import KNNImputer from torch.autograd import Variable import torch import torch.optim as optim import pandas as pd from utils import * from neural_network import AutoEncoder import item_response as irt import random def load_data(base_path="../data"): """ Loa...
[ "pandas.read_csv", "numpy.empty", "torch.autograd.Variable", "torch.FloatTensor", "neural_network.AutoEncoder", "item_response.irt", "numpy.isnan", "sklearn.impute.KNNImputer", "numpy.array", "numpy.asmatrix", "item_response.sigmoid", "torch.sum" ]
[((1103, 1140), 'pandas.read_csv', 'pd.read_csv', (['"""../data/train_data.csv"""'], {}), "('../data/train_data.csv')\n", (1114, 1140), True, 'import pandas as pd\n'), ((1321, 1347), 'numpy.empty', 'np.empty', (['(num_std, num_q)'], {}), '((num_std, num_q))\n', (1329, 1347), True, 'import numpy as np\n'), ((2049, 2074)...
import numpy as np import torch from torch.nn import functional as F from collections import Counter from sklearn.metrics import f1_score,precision_score,recall_score import skimage.transform import matplotlib.pyplot as plt import pandas as pd from core.frame_base_measurement import compute_align_MoF_UoI,compute_align_...
[ "numpy.sum", "numpy.argmax", "torch.argmax", "torch.cat", "numpy.mean", "torch.no_grad", "core.frame_base_measurement.compute_align_MoF_UoI_bg", "numpy.unique", "torch.nn.functional.pad", "pandas.DataFrame", "numpy.max", "core.frame_base_measurement.compute_align_MoF_UoI", "torch.unique", ...
[((720, 740), 'os.listdir', 'os.listdir', (['path_dir'], {}), '(path_dir)\n', (730, 740), False, 'import os\n'), ((2358, 2397), 'torch.tensor', 'torch.tensor', (['batch_aggregated_key_list'], {}), '(batch_aggregated_key_list)\n', (2370, 2397), False, 'import torch\n'), ((2892, 2919), 'torch.nn.functional.pad', 'F.pad',...
""" For use in dumping single frame ground truths of Apollo training Dataset Adapted from https://github.com/ClementPinard/SfmLearner-Pytorch/blob/0caec9ed0f83cb65ba20678a805e501439d2bc25/data/kitti_raw_loader.py Authors: <NAME>, <EMAIL>, 2020 <NAME>, <EMAIL>, 2019 Date: 2020/07/15 """ from __future__ im...
[ "yaml.load", "pathlib.Path", "glob.glob", "os.path.join", "multiprocessing.cpu_count", "sys.path.append", "os.path.abspath", "cv2.cvtColor", "logging.warning", "os.path.dirname", "numpy.genfromtxt", "cv2.resize", "dump_tools.utils_kitti.scale_P", "numpy.char.add", "apollo.eval_pose.eval_...
[((671, 696), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR'], {}), '(BASE_DIR)\n', (686, 696), False, 'import os, sys\n'), ((697, 722), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (712, 722), False, 'import os, sys\n'), ((770, 791), 'logging.basicConfig', 'logging.basicConfig', ([], {...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 22 07:09:33 2022 @author: owner """ # Most recent version: 23 May 2022 by <NAME> # University of Colorado Boulder # Advisors: <NAME> and <NAME> # Major working functions for analysis of SDO/EVE 304 Angstrom light curves, # SDO/AIA 1600 Angstrom ima...
[ "astropy.convolution.Gaussian2DKernel", "astropy.convolution.convolve", "numpy.load", "numpy.sum", "numpy.abs", "numpy.amin", "scipy.io.loadmat", "numpy.polyfit", "numpy.empty", "numpy.argmax", "numpy.isnan", "matplotlib.animation.FuncAnimation", "numpy.shape", "matplotlib.pyplot.figure", ...
[((3126, 3139), 'numpy.zeros', 'np.zeros', (['(800)'], {}), '(800)\n', (3134, 3139), True, 'import numpy as np\n'), ((3154, 3167), 'numpy.zeros', 'np.zeros', (['(800)'], {}), '(800)\n', (3162, 3167), True, 'import numpy as np\n'), ((3278, 3307), 'numpy.meshgrid', 'np.meshgrid', (['xarr_Mm', 'yarr_Mm'], {}), '(xarr_Mm, ...
from __future__ import division from pyomo.environ import * import numpy as np import pandas as pd # Create a model model = AbstractModel() # Import sets set_df = pd.read_csv('../data/interim/lp_data/input_data/Set_List.csv') node_list = list(set_df['B'])[:95] charger_list = list(set_df['K'])[:2] time_list = list(set...
[ "pandas.read_csv", "numpy.array" ]
[((165, 227), 'pandas.read_csv', 'pd.read_csv', (['"""../data/interim/lp_data/input_data/Set_List.csv"""'], {}), "('../data/interim/lp_data/input_data/Set_List.csv')\n", (176, 227), True, 'import pandas as pd\n'), ((4099, 4117), 'numpy.array', 'np.array', (['result_x'], {}), '(result_x)\n', (4107, 4117), True, 'import ...
# ------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # ----------------------------------------------------------------------...
[ "abex.emukit.moment_matching_qei.correlation_from_covariance", "abex.emukit.moment_matching_qei.calculate_cumulative_min_moments", "numpy.zeros_like", "numpy.random.seed", "abex.emukit.moment_matching_qei.get_next_cumulative_min_moments", "numpy.random.rand", "numpy.corrcoef", "numpy.zeros", "numpy....
[((2546, 2569), 'pytest.mark.timeout', 'pytest.mark.timeout', (['(30)'], {}), '(30)\n', (2565, 2569), False, 'import pytest\n'), ((2571, 2676), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""mean_spread_scale,means_mean"""', '[(1, 0), (1, -100), (1000.0, 0), (0.001, 0)]'], {}), "('mean_spread_scale,means_m...
#!/usr/bin/env python #helping pages: #https://stackoverflow.com/questions/2827393/angles-between-two-n-dimensional-vectors-in-python/13849249#13849249 import rospy import numpy import tf import tf2_ros import geometry_msgs.msg #flag to start the first iteration starter = True ##FOR NEW SPACE POSITION def message_...
[ "tf2_ros.TransformBroadcaster", "tf.transformations.translation_matrix", "tf.transformations.quaternion_about_axis", "rospy.Time.now", "numpy.cross", "numpy.arccos", "numpy.clip", "rospy.sleep", "rospy.is_shutdown", "numpy.linalg.norm", "tf.transformations.translation_from_matrix", "rospy.init...
[((394, 438), 'tf.transformations.quaternion_from_matrix', 'tf.transformations.quaternion_from_matrix', (['T'], {}), '(T)\n', (435, 438), False, 'import tf\n'), ((461, 506), 'tf.transformations.translation_from_matrix', 'tf.transformations.translation_from_matrix', (['T'], {}), '(T)\n', (503, 506), False, 'import tf\n'...
import numpy as np class Plotter(object): def __init__(self, backend=None): if backend is not None: self.use(backend) # ---------- def points(self, points, **kwargs): points = np.asarray(points, dtype='d') points = np.atleast_2d(points) shape = points.shape[:-...
[ "numpy.asarray", "numpy.zeros", "numpy.linspace", "numpy.rollaxis", "numpy.atleast_2d" ]
[((220, 249), 'numpy.asarray', 'np.asarray', (['points'], {'dtype': '"""d"""'}), "(points, dtype='d')\n", (230, 249), True, 'import numpy as np\n'), ((267, 288), 'numpy.atleast_2d', 'np.atleast_2d', (['points'], {}), '(points)\n', (280, 288), True, 'import numpy as np\n'), ((820, 849), 'numpy.asarray', 'np.asarray', ([...
from collections.abc import Iterable import re import numpy as np import quantum_keymap.config.default as default_conf from quantum_keymap.util import list_concat from quantum_keymap.util import load_config class KeymapModel(object): def __init__(self, config=None) -> None: self.config = load_config(def...
[ "quantum_keymap.util.list_concat", "numpy.triu", "numpy.zeros", "numpy.array", "quantum_keymap.util.load_config", "re.compile" ]
[((305, 330), 'quantum_keymap.util.load_config', 'load_config', (['default_conf'], {}), '(default_conf)\n', (316, 330), False, 'from quantum_keymap.util import load_config\n'), ((806, 850), 'numpy.zeros', 'np.zeros', (['(self.N * self.N, self.N * self.N)'], {}), '((self.N * self.N, self.N * self.N))\n', (814, 850), Tru...
from typing import List import numpy as np import pytest from numpy import float64 from modes.mode_solver_full import mode_solver_full def group_index( wavelength: float = 1.55, wavelength_step: float = 0.01, overwrite: bool = False, n_modes: int = 1, **wg_kwargs, ) -> List[float64]: r""" ...
[ "numpy.array", "modes.mode_solver_full.mode_solver_full", "numpy.real", "pytest.mark.parametrize", "numpy.round" ]
[((2173, 2224), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""overwrite"""', '[True, False]'], {}), "('overwrite', [True, False])\n", (2196, 2224), False, 'import pytest\n'), ((1178, 1273), 'modes.mode_solver_full.mode_solver_full', 'mode_solver_full', ([], {'wavelength': 'wavelength', 'overwrite': 'overw...
"""Utility functions for working with numpy arrays.""" from __future__ import annotations from typing import TYPE_CHECKING import numpy as np if TYPE_CHECKING: from numpy.typing import ArrayLike def message_bit( message: str, delimiter: str, bits: int, ) -> tuple[ArrayLike, int]: """Return a me...
[ "numpy.ceil", "numpy.frombuffer", "numpy.packbits", "numpy.unpackbits", "numpy.concatenate" ]
[((571, 610), 'numpy.frombuffer', 'np.frombuffer', (['byte_msg'], {'dtype': 'np.uint8'}), '(byte_msg, dtype=np.uint8)\n', (584, 610), True, 'import numpy as np\n'), ((628, 650), 'numpy.unpackbits', 'np.unpackbits', (['msg_arr'], {}), '(msg_arr)\n', (641, 650), True, 'import numpy as np\n'), ((1936, 1957), 'numpy.packbi...
from sys import platform import numpy as np import matplotlib.pyplot as plt import random ''' Authors: <NAME> <NAME> <NAME> Date: 5th February 2021 ''' class Agent_holonomic: ''' Omnidirectional robot class ''' def __init__(self, radius_bot): self.radius_bot = radius_bot self.type = "Omnidirectional ro...
[ "numpy.abs", "numpy.deg2rad", "numpy.rad2deg", "numpy.sin", "numpy.array", "numpy.cos", "numpy.sign", "numpy.round", "numpy.sqrt" ]
[((376, 391), 'numpy.deg2rad', 'np.deg2rad', (['(120)'], {}), '(120)\n', (386, 391), True, 'import numpy as np\n'), ((409, 424), 'numpy.deg2rad', 'np.deg2rad', (['(240)'], {}), '(240)\n', (419, 424), True, 'import numpy as np\n'), ((992, 1012), 'numpy.array', 'np.array', (['[v_x, v_y]'], {}), '([v_x, v_y])\n', (1000, 1...
""" Tests for ivp_4_ode.py """ from nma.ivp_4_ode import runge_kutta_o4 from numpy.testing import assert_almost_equal def test_runge_kutta_o4(): """ This test is Example 3 in chapter 5 of the textbook. """ # setup f = lambda t, y: y - t ** 2 + 1 a = 0 b = 2 N = 10 y_initial = 0.5 ...
[ "numpy.testing.assert_almost_equal", "nma.ivp_4_ode.runge_kutta_o4" ]
[((352, 389), 'nma.ivp_4_ode.runge_kutta_o4', 'runge_kutta_o4', (['f', 'a', 'b', 'N', 'y_initial'], {}), '(f, a, b, N, y_initial)\n', (366, 389), False, 'from nma.ivp_4_ode import runge_kutta_o4\n'), ((450, 488), 'numpy.testing.assert_almost_equal', 'assert_almost_equal', (['result', 'actual', '(6)'], {}), '(result, ac...
import emcee import triangle import scipy as sp import numpy as np from from_fits import create_uvdata_from_fits_file from components import CGComponent from model import Model, CCModel from stats import LnPost if __name__ == '__main__': uv_fname = '1633+382.l22.2010_05_21.uvf' map_fname = '1633+382.l22.2010_...
[ "model.CCModel", "emcee.utils.sample_ball", "emcee.EnsembleSampler", "triangle.corner", "model.Model", "components.CGComponent", "numpy.max", "stats.LnPost", "from_fits.create_uvdata_from_fits_file" ]
[((349, 387), 'from_fits.create_uvdata_from_fits_file', 'create_uvdata_from_fits_file', (['uv_fname'], {}), '(uv_fname)\n', (377, 387), False, 'from from_fits import create_uvdata_from_fits_file\n'), ((430, 461), 'components.CGComponent', 'CGComponent', (['(1.0)', '(0.0)', '(0.0)', '(1.0)'], {}), '(1.0, 0.0, 0.0, 1.0)\...
# convex unimodal optimization function from numpy import arange from matplotlib import pyplot # objective function def objective(x): return x[0]**2.0 # define range for input r_min, r_max = -5.0, 5.0 # sample input range uniformly at 0.1 increments inputs = arange(r_min, r_max, 0.1) # compute targets results = [obj...
[ "matplotlib.pyplot.axvline", "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.show" ]
[((262, 287), 'numpy.arange', 'arange', (['r_min', 'r_max', '(0.1)'], {}), '(r_min, r_max, 0.1)\n', (268, 287), False, 'from numpy import arange\n'), ((389, 417), 'matplotlib.pyplot.plot', 'pyplot.plot', (['inputs', 'results'], {}), '(inputs, results)\n', (400, 417), False, 'from matplotlib import pyplot\n'), ((506, 55...
# based on https://github.com/adamtornhill/maat-scripts/blob/master/miner/complexity_calculations.py import re import numpy from tools.encoding import detect_encoding leading_tabs_expr = re.compile(r'^(\t+)') leading_spaces_expr = re.compile(r'^( +)') empty_line_expr = re.compile(r'^\s*$') def n_log_tabs(line): ...
[ "numpy.mean", "re.sub", "tools.encoding.detect_encoding", "re.compile" ]
[((191, 212), 're.compile', 're.compile', (['"""^(\\\\t+)"""'], {}), "('^(\\\\t+)')\n", (201, 212), False, 'import re\n'), ((235, 254), 're.compile', 're.compile', (['"""^( +)"""'], {}), "('^( +)')\n", (245, 254), False, 'import re\n'), ((274, 294), 're.compile', 're.compile', (['"""^\\\\s*$"""'], {}), "('^\\\\s*$')\n"...
import os import numpy as np import pandas as pd import math import time from sklearn.linear_model import LogisticRegression from sklearn.linear_model import LinearRegression, Ridge import statsmodels.api as sm def SplitBasedSelectionForm(data, k, model, list_neigh, split_point1, split_point2, nb_classes, limit) ...
[ "numpy.size", "numpy.asarray", "numpy.square", "numpy.zeros", "time.time", "pandas.cut", "numpy.min", "numpy.max", "numpy.arange", "numpy.array", "sklearn.linear_model.Ridge" ]
[((345, 356), 'time.time', 'time.time', ([], {}), '()\n', (354, 356), False, 'import time\n'), ((365, 381), 'numpy.size', 'np.size', (['data', '(0)'], {}), '(data, 0)\n', (372, 381), True, 'import numpy as np\n'), ((411, 427), 'numpy.size', 'np.size', (['data', '(1)'], {}), '(data, 1)\n', (418, 427), True, 'import nump...
import argparse import glob import json import numpy as np from sklearn.metrics import accuracy_score, f1_score from fever_utils import make_sentence_id def calculate_scores(args): evidences = {} with open(args.dataset_file, 'r', encoding='utf-8') as f: for line in f: line_json = json.loa...
[ "argparse.ArgumentParser", "numpy.argmax", "sklearn.metrics.accuracy_score", "fever_utils.make_sentence_id", "sklearn.metrics.f1_score", "numpy.array", "numpy.exp", "glob.glob" ]
[((4584, 4688), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Calculates various metrics of label prediction output files."""'}), "(description=\n 'Calculates various metrics of label prediction output files.')\n", (4607, 4688), False, 'import argparse\n'), ((1607, 1648), 'glob.glob'...
import time from numpy import random from pandas import DataFrame from openpyxl import Workbook from openpyxl.styles import Font, Border, Side, Alignment from openpyxl.styles.cell_style import StyleArray from openpyxl.styles.named_styles import NamedStyle from openpyxl.utils.dataframe import dataframe_to_rows ft = F...
[ "pandas.DataFrame", "openpyxl.utils.dataframe.dataframe_to_rows", "openpyxl.Workbook", "openpyxl.styles.Font", "openpyxl.cell.WriteOnlyCell", "time.clock", "openpyxl.styles.Alignment", "openpyxl.styles.named_styles.NamedStyle", "itertools.islice", "numpy.random.rand", "openpyxl.styles.Border", ...
[((319, 334), 'openpyxl.styles.Font', 'Font', ([], {'bold': '(True)'}), '(bold=True)\n', (323, 334), False, 'from openpyxl.styles import Font, Border, Side, Alignment\n'), ((340, 370), 'openpyxl.styles.Alignment', 'Alignment', ([], {'horizontal': '"""center"""'}), "(horizontal='center')\n", (349, 370), False, 'from ope...
import os import re import codecs import numpy as np models_path = "./models" eval_path = "./evaluation" eval_temp = os.path.join(eval_path, "temp") eval_script = os.path.join(eval_path, "conlleval") def create_dico(item_list): """ Create a dictionary of items from a list of list of items. """ asse...
[ "numpy.zeros", "os.path.join", "re.sub" ]
[((119, 150), 'os.path.join', 'os.path.join', (['eval_path', '"""temp"""'], {}), "(eval_path, 'temp')\n", (131, 150), False, 'import os\n'), ((165, 201), 'os.path.join', 'os.path.join', (['eval_path', '"""conlleval"""'], {}), "(eval_path, 'conlleval')\n", (177, 201), False, 'import os\n'), ((1032, 1053), 're.sub', 're....
import os import fnmatch import shutil import csv import pandas as pd import numpy as np import glob import datetime print(os.path.realpath(__file__)) def FindResults(TaskList, VisitFolder, PartID): for j in TaskList: TempFile = glob.glob(os.path.join(VisitFolder,(PartID+'_'+j+'*.csv'))) # Ideal...
[ "pandas.DataFrame", "fnmatch.filter", "pandas.DataFrame.from_dict", "pandas.pivot_table", "pandas.read_csv", "os.path.realpath", "datetime.datetime.now", "numpy.isnan", "numpy.nonzero", "numpy.diff", "numpy.array", "os.path.split", "os.path.join", "os.listdir" ]
[((125, 151), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (141, 151), False, 'import os\n'), ((2463, 2486), 'os.listdir', 'os.listdir', (['VisitFolder'], {}), '(VisitFolder)\n', (2473, 2486), False, 'import os\n'), ((2635, 2677), 'fnmatch.filter', 'fnmatch.filter', (['ll', "(SearchString...
#coding:utf-8 ################################################### # File Name: dataloader.py # Author: <NAME> # mail: @ # Created Time: Wed 21 Mar 2018 07:04:35 PM CST #============================================================= import os import sys import time import datetime import gensim import codecs import numpy...
[ "sys.path.append", "numpy.random.uniform", "common.strutil.stringhandler.split_word_and_seg", "nltk.util.ngrams", "codecs.open", "os.makedirs", "os.path.dirname", "tensorflow.reshape", "os.path.exists", "numpy.array", "numpy.arange", "gensim.models.KeyedVectors.load_word2vec_format", "numpy....
[((351, 373), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (366, 373), False, 'import sys\n'), ((6242, 6256), 'numpy.array', 'np.array', (['list'], {}), '(list)\n', (6250, 6256), True, 'import numpy as np\n'), ((6582, 6653), 'gensim.models.KeyedVectors.load_word2vec_format', 'gensim.models.Ke...
from sklearn.preprocessing import LabelEncoder from imutils.face_utils import FaceAligner from sklearn.svm import SVC from imutils import paths import tensorflow as tf from tensorflow import logging import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from tensorflow.python.util import deprecation deprecation....
[ "face_recognition.compare_faces", "numpy.argmax", "numpy.argsort", "tensorflow.ConfigProto", "numpy.linalg.norm", "sklearn.svm.SVC", "cv2.rectangle", "cv2.CascadeClassifier", "dlib.rectangle", "dlib.shape_predictor", "imutils.face_utils.FaceAligner", "imutils.paths.list_images", "random.rand...
[((361, 423), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (395, 423), True, 'import tensorflow as tf\n'), ((2380, 2390), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (2388, 2390), True, 'import tensorflo...
"""Basic functionality""" import numpy as np import pennylane as qml from tqdm.notebook import tqdm def vqe(circuit, H, dev, optimizer, steps, params, sparse=False, bar=True, diff_method="adjoint"): """ Performs the VQE (Variational Quantum Eigensolver) process for a given circuit and Hamiltonian. Optimiz...
[ "pennylane.qchem.excitations", "numpy.allclose", "pennylane.expval", "pennylane.BasisState", "pennylane.DoubleExcitation", "pennylane.qnode", "pennylane.grad", "pennylane.SingleExcitation", "pennylane.state" ]
[((1283, 1322), 'pennylane.qnode', 'qml.qnode', (['dev'], {'diff_method': 'diff_method'}), '(dev, diff_method=diff_method)\n', (1292, 1322), True, 'import pennylane as qml\n'), ((4310, 4389), 'pennylane.qchem.excitations', 'qml.qchem.excitations', ([], {'electrons': 'active_electrons', 'orbitals': '(2 * active_orbitals...
#!/usr/bin/env python import os.path as osp import sys sys.path.append(osp.join(osp.dirname(__file__), 'tools')) import _init_paths from fast_rcnn.config import cfg, cfg_from_file, cfg_from_list from fast_rcnn.test import im_detect from fast_rcnn.nms_wrapper import nms import caffe import cv2 import numpy as np impor...
[ "cv_bridge.CvBridge", "caffe.set_mode_gpu", "rospy.Subscriber", "os.path.basename", "os.path.dirname", "os.path.realpath", "rospy.Publisher", "rospy.Rate", "numpy.hstack", "caffe.set_device", "rospy.is_shutdown", "numpy.where", "rospy.init_node", "cv2.rectangle", "fast_rcnn.nms_wrapper.n...
[((81, 102), 'os.path.dirname', 'osp.dirname', (['__file__'], {}), '(__file__)\n', (92, 102), True, 'import os.path as osp\n'), ((2390, 2410), 'caffe.set_mode_gpu', 'caffe.set_mode_gpu', ([], {}), '()\n', (2408, 2410), False, 'import caffe\n'), ((2413, 2446), 'caffe.set_device', 'caffe.set_device', (['self.cfg.GPU_ID']...
from collections.abc import MutableSequence import warnings import io import copy import numpy as np import pandas as pd from . import endf import openmc.checkvalue as cv from .resonance import Resonances def _add_file2_contributions(file32params, file2params): """Function for aiding in adding resonance paramet...
[ "numpy.pad", "copy.deepcopy", "io.StringIO", "openmc.checkvalue.check_type", "numpy.zeros", "numpy.triu_indices", "copy.copy", "openmc.checkvalue.CheckedList", "numpy.random.multivariate_normal", "pandas.DataFrame.from_records", "warnings.warn", "numpy.diag" ]
[((2011, 2069), 'openmc.checkvalue.check_type', 'cv.check_type', (['"""resonance ranges"""', 'ranges', 'MutableSequence'], {}), "('resonance ranges', ranges, MutableSequence)\n", (2024, 2069), True, 'import openmc.checkvalue as cv\n'), ((2093, 2160), 'openmc.checkvalue.CheckedList', 'cv.CheckedList', (['ResonanceCovari...
""" """ import os import sys #import tensorflow as tf from keras.models import Model, Sequential, load_model from keras.layers import Input, Dense, Cropping2D, Lambda, Conv2D, Flatten, BatchNormalization, Activation, ELU, Dropout, MaxPooling2D, merge from keras.utils.vis_utils import plot_model from keras.layers.mer...
[ "matplotlib.pyplot.title", "keras.regularizers.l2", "keras.layers.Cropping2D", "keras.layers.merge.concatenate", "matplotlib.pyplot.figure", "numpy.random.randint", "keras.layers.Input", "trace.trace_start", "matplotlib.pyplot.close", "keras.utils.vis_utils.plot_model", "keras.layers.Flatten", ...
[((612, 643), 'trace.trace_start', 'trace.trace_start', (['"""trace.html"""'], {}), "('trace.html')\n", (629, 643), False, 'import trace\n'), ((489, 510), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (503, 510), False, 'import matplotlib\n'), ((1051, 1063), 'keras.models.Sequential', 'Sequentia...
""" Project: RadarBook File: rain.py Created by: <NAME> On: 3/18/2018 Created with: PyCharm Copyright (C) 2019 Artech House (<EMAIL>) This file is part of Introduction to Radar Using Python and MATLAB and can not be copied and/or distributed without the express permission of Artech House. """ from numpy import log10, ...
[ "numpy.log10", "numpy.array", "numpy.cos" ]
[((830, 876), 'numpy.array', 'array', (['[-5.3398, -0.35351, -0.23789, -0.94158]'], {}), '([-5.3398, -0.35351, -0.23789, -0.94158])\n', (835, 876), False, 'from numpy import log10, exp, array, cos\n'), ((889, 931), 'numpy.array', 'array', (['[-0.1008, 1.2697, 0.86036, 0.64552]'], {}), '([-0.1008, 1.2697, 0.86036, 0.645...
import torch from torch import nn import numpy as np class SineLayer(nn.Module): def __init__(self, in_dims, out_dims, bias=True, is_first=False, omega_0=30): super().__init__() self.omega_0 = omega_0 self.in_dims = in_dims # If is_first=True, omega_0 is a frequency factor which ...
[ "torch.nn.Sequential", "torch.no_grad", "numpy.sqrt", "torch.nn.Linear" ]
[((763, 802), 'torch.nn.Linear', 'nn.Linear', (['in_dims', 'out_dims'], {'bias': 'bias'}), '(in_dims, out_dims, bias=bias)\n', (772, 802), False, 'from torch import nn\n'), ((2379, 2403), 'torch.nn.Sequential', 'nn.Sequential', (['*self.net'], {}), '(*self.net)\n', (2392, 2403), False, 'from torch import nn\n'), ((873,...
import os, pdb import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from data import v2 from layers import * from layers.modules.feat_pooling import FeatPooling from torch.nn.parameter import Parameter # This function is derived from torchvision VG...
[ "torch.nn.ReLU", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.cat", "numpy.identity", "torch.nn.BatchNorm2d", "torch.nn.Linear", "torch.nn.MaxPool2d" ]
[((967, 1015), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', ([], {'kernel_size': '(3)', 'stride': '(1)', 'padding': '(1)'}), '(kernel_size=3, stride=1, padding=1)\n', (979, 1015), True, 'import torch.nn as nn\n'), ((1028, 1086), 'torch.nn.Conv2d', 'nn.Conv2d', (['(512)', '(1024)'], {'kernel_size': '(3)', 'padding': '(6)', 'di...
# plain.py import numpy __all__ = ["data_length", "convert_data"] def data_length(line): return len(line.strip().split()) def tokenize(data): return data.split() def to_word_id(data, voc, unk="UNK"): newdata = [] unkid = voc[unk] for d in data: idlist = [voc[w] if w in voc else unki...
[ "numpy.zeros" ]
[((519, 557), 'numpy.zeros', 'numpy.zeros', (['(max_len, batch)', '"""int32"""'], {}), "((max_len, batch), 'int32')\n", (530, 557), False, 'import numpy\n'), ((569, 605), 'numpy.zeros', 'numpy.zeros', (['(max_len, batch)', 'dtype'], {}), '((max_len, batch), dtype)\n', (580, 605), False, 'import numpy\n')]
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import bqplot import bqplot.pyplot as bqpyplot import pandas as pd from fastai.data_block import LabelList from ipywidgets import widgets, Layout, IntSlider import numpy as np from utils_cv.common.image import im_...
[ "numpy.abs", "utils_cv.common.data.get_files_in_directory", "os.path.join", "pandas.DataFrame", "ipywidgets.widgets.Checkbox", "utils_cv.common.image.im_width", "os.path.exists", "ipywidgets.Layout", "ipywidgets.widgets.HBox", "os.path.basename", "ipywidgets.widgets.Button", "pandas.Series", ...
[((2046, 2060), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (2058, 2060), True, 'import pandas as pd\n'), ((2288, 2318), 'os.path.exists', 'os.path.exists', (['self.anno_path'], {}), '(self.anno_path)\n', (2302, 2318), False, 'import os\n'), ((2980, 3018), 'os.path.join', 'os.path.join', (['self.im_dir', 'im_...
""" tanh ~~~~ Plots a graph of the tanh function.""" import numpy as np import matplotlib.pyplot as plt z = np.arange(-5, 5, .1) t = np.tanh(z) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(z, t) ax.set_ylim([-1.0, 1.0]) ax.set_xlim([-5,5]) ax.grid(True) ax.set_xlabel('z') ax.set_title('ta...
[ "matplotlib.pyplot.figure", "numpy.arange", "numpy.tanh", "matplotlib.pyplot.show" ]
[((120, 141), 'numpy.arange', 'np.arange', (['(-5)', '(5)', '(0.1)'], {}), '(-5, 5, 0.1)\n', (129, 141), True, 'import numpy as np\n'), ((146, 156), 'numpy.tanh', 'np.tanh', (['z'], {}), '(z)\n', (153, 156), True, 'import numpy as np\n'), ((166, 178), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (176, 17...
#!/usr/bin/env python # coding: utf-8 # In[1]: # Import the TensorFlow and output the verion get_ipython().system('pip install tensorflow==1.14.0') import tensorflow as tf print("\n\nTensorFlow version:", tf.__version__) # In[2]: n_inputs = 28 * 28 n_hidden1 = 300 n_hidden2 = 100 n_outputs = 10 # In[3]: tf....
[ "numpy.random.seed", "tensorflow.clip_by_value", "tensorflow.get_collection", "tensorflow.reset_default_graph", "sklearn.metrics.accuracy_score", "tensorflow.maximum", "sklearn.exceptions.NotFittedError", "tensorflow.assign", "tensorflow.Variable", "tensorflow.get_default_graph", "tensorflow.lay...
[((317, 341), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (339, 341), True, 'import tensorflow as tf\n'), ((346, 406), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(None, n_inputs)', 'name': '"""X"""'}), "(tf.float32, shape=(None, n_inputs), name='X')\n", (36...
from tkinter import * import tkinter import pyautogui import PIL.Image, PIL.ImageTk import cv2 import numpy as np import time import os import keyboard import datetime import os import keyboard from PIL import ImageTk import win32clipboard as clip import win32con from io import BytesIO from PIL import ...
[ "os.listdir", "os.mkdir", "os.remove", "io.BytesIO", "win32clipboard.SetClipboardData", "win32clipboard.CloseClipboard", "cv2.cvtColor", "os.path.exists", "pyautogui.screenshot", "win32clipboard.EmptyClipboard", "time.sleep", "keyboard.is_pressed", "cv2.imread", "win32clipboard.OpenClipboa...
[((340, 369), 'os.path.exists', 'os.path.exists', (['"""screenshots"""'], {}), "('screenshots')\n", (354, 369), False, 'import os\n'), ((427, 452), 'os.listdir', 'os.listdir', (['"""screenshots"""'], {}), "('screenshots')\n", (437, 452), False, 'import os\n'), ((508, 531), 'datetime.datetime.now', 'datetime.datetime.no...
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.cluster import KMeans DATA_DIR = os.path.join('..', 'data') def load_data(path): """Loads the data!""" return pd.read_pickle(path) def split_intervals(data_intervals, h_split): """ Receives a list of int...
[ "matplotlib.pyplot.title", "pandas.date_range", "numpy.sum", "matplotlib.pyplot.hist", "numpy.amin", "sklearn.cluster.KMeans", "numpy.asarray", "numpy.isnan", "numpy.shape", "numpy.amax", "matplotlib.pyplot.figure", "numpy.where", "numpy.mean", "pandas.read_pickle", "os.path.join", "nu...
[((130, 156), 'os.path.join', 'os.path.join', (['""".."""', '"""data"""'], {}), "('..', 'data')\n", (142, 156), False, 'import os\n'), ((217, 237), 'pandas.read_pickle', 'pd.read_pickle', (['path'], {}), '(path)\n', (231, 237), True, 'import pandas as pd\n'), ((4132, 4176), 'pandas.date_range', 'pd.date_range', (['date...
#!/usr/bin/env python3 """ Quadtree Image Segmentation <NAME> Split the image into four quadrants. Find the quadrant with the highest error. Split that quadrant into four quadrants. Repeat N times. """ import heapq import argparse import imageio import imageio_ffmpeg import numpy as np from tqdm import tqdm def bo...
[ "numpy.sum", "argparse.ArgumentParser", "imageio.read", "numpy.empty", "imageio.imread", "heapq.heappop", "numpy.cumsum", "imageio_ffmpeg.write_frames", "numpy.array", "numpy.copyto", "imageio.imsave" ]
[((1226, 1253), 'numpy.cumsum', 'np.cumsum', (['I'], {'axis': '(0)', 'out': 'I'}), '(I, axis=0, out=I)\n', (1235, 1253), True, 'import numpy as np\n'), ((1258, 1285), 'numpy.cumsum', 'np.cumsum', (['I'], {'axis': '(1)', 'out': 'I'}), '(I, axis=1, out=I)\n', (1267, 1285), True, 'import numpy as np\n'), ((3091, 3158), 'a...
import cv2 import numpy as np from utils import * img = cv2.imread('/home/yared/Documents/leaf images/Apple___healthy_markers/0bb2ddc5-d1f4-4fc2-be6b-6b63c60790df___RS_HL 7550.JPG',0) img[img > 0 ] = 255 img_inv = cv2.bitwise_not(img) debug(img_inv, 'img_inv') print('type', img_inv.dtype) nb_components, output, stats,...
[ "cv2.bitwise_not", "numpy.zeros", "cv2.connectedComponentsWithStats", "cv2.imread", "cv2.imshow" ]
[((57, 195), 'cv2.imread', 'cv2.imread', (['"""/home/yared/Documents/leaf images/Apple___healthy_markers/0bb2ddc5-d1f4-4fc2-be6b-6b63c60790df___RS_HL 7550.JPG"""', '(0)'], {}), "(\n '/home/yared/Documents/leaf images/Apple___healthy_markers/0bb2ddc5-d1f4-4fc2-be6b-6b63c60790df___RS_HL 7550.JPG'\n , 0)\n", (67, 19...
from typing import List, Tuple, Union import geopandas as gpd import numpy as np from scipy.stats import norm, poisson, uniform from scipy.stats._distn_infrastructure import rv_frozen from shapely.geometry import Point from .area import Area from .feature import Feature from .utils import clip_points class Layer: ...
[ "shapely.geometry.Point", "scipy.stats.norm", "scipy.stats.poisson", "scipy.stats.uniform.rvs", "scipy.stats.uniform", "numpy.hstack", "numpy.sin", "numpy.array", "geopandas.read_file", "numpy.cos", "numpy.random.random", "numpy.sqrt" ]
[((2730, 2759), 'geopandas.read_file', 'gpd.read_file', (['path'], {}), '(path, **kwargs)\n', (2743, 2759), True, 'import geopandas as gpd\n'), ((11467, 11483), 'numpy.array', 'np.array', (['points'], {}), '(points)\n', (11475, 11483), True, 'import numpy as np\n'), ((15091, 15107), 'numpy.array', 'np.array', (['points...
import numpy as np from datetime import datetime, timedelta import talib from scipy.signal import argrelmin, argrelmax from binance.client import Client from binance_client.configs import get_binance_client from binance_client.constants import SignalDirection from binance_client.kline import get_kline_dataframe from s...
[ "scipy.signal.argrelmin", "signals.divergence.short_divergence", "signals.divergence.long_divergence", "datetime.datetime.utcnow", "scipy.signal.argrelmax", "numpy.array", "talib.RSI", "utils.time.calculate_time_delta" ]
[((608, 624), 'numpy.array', 'np.array', (['prices'], {}), '(prices)\n', (616, 624), True, 'import numpy as np\n'), ((642, 662), 'numpy.array', 'np.array', (['indicators'], {}), '(indicators)\n', (650, 662), True, 'import numpy as np\n'), ((691, 708), 'scipy.signal.argrelmin', 'argrelmin', (['prices'], {}), '(prices)\n...