code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import os.path as osp import os import sys import argparse import numpy as np # add paths parent_dir = osp.dirname(osp.abspath(__file__)) if parent_dir not in sys.path: sys.path.append(parent_dir) from src.autoencoder import Configuration as Conf from src.point_net_ae import PointNetAutoEncoder from src.in_out i...
[ "sys.path.append", "os.mkdir", "src.evaluation_metrics.coverage", "numpy.save", "src.evaluation_metrics.minimum_mathing_distance", "argparse.ArgumentParser", "os.path.abspath", "src.in_out.load_all_point_clouds_from_filenames", "src.in_out.load_all_point_clouds_under_folder", "src.in_out.snc_categ...
[((806, 831), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (829, 831), False, 'import argparse\n'), ((1886, 1954), 'os.path.join', 'osp.join', (['project_dir', '"""data"""', '"""shape_net_core_uniform_samples_2048"""'], {}), "(project_dir, 'data', 'shape_net_core_uniform_samples_2048')\n", (1...
import numpy as np a = np.arange(10,22).reshape((3, 4)) print("Original array:") print(a) print("Each element of the array is:") for x in np.nditer(a): print(x,end=" ")
[ "numpy.nditer", "numpy.arange" ]
[((138, 150), 'numpy.nditer', 'np.nditer', (['a'], {}), '(a)\n', (147, 150), True, 'import numpy as np\n'), ((23, 40), 'numpy.arange', 'np.arange', (['(10)', '(22)'], {}), '(10, 22)\n', (32, 40), True, 'import numpy as np\n')]
"""PCA anomaly detection a la Shyu, Chen, Sarinnaparkorn and Chang. A function and an scikit-learn style anomaly detector based off of Shyu, Chen, Sarinnapakorn and Chang's paper 'A Novel Anomaly Detection Scheme Based on Prinicpal Component Classifier'. The scheme has three steps: 1. Get a robust representation o...
[ "heapq.nsmallest", "sklearn.preprocessing.StandardScaler", "numpy.percentile", "numpy.linalg.eigh", "numpy.sort", "numpy.mean", "numpy.linalg.inv", "numpy.array" ]
[((1911, 1927), 'numpy.linalg.inv', 'np.linalg.inv', (['S'], {}), '(S)\n', (1924, 1927), True, 'import numpy as np\n'), ((2010, 2028), 'numpy.mean', 'np.mean', (['X'], {'axis': '(1)'}), '(X, axis=1)\n', (2017, 2028), True, 'import numpy as np\n'), ((2287, 2327), 'heapq.nsmallest', 'nsmallest', (['self._n_keep', 'X'], {...
from typing import List import dgl.function as fn import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from dgl.nn import SumPooling, AvgPooling from ogb.graphproppred.mol_encoder import AtomEncoder def aggregate_mean(h): """mean aggregation""" return torch.mean(h, dim=1) def ...
[ "torch.mean", "torch.nn.Dropout", "torch.relu", "numpy.log", "torch.nn.ModuleList", "dgl.nn.SumPooling", "dgl.function.copy_u", "torch.nn.BatchNorm1d", "torch.nn.Linear", "dgl.nn.AvgPooling", "torch.max", "torch.nn.functional.relu", "torch.sum", "torch.min", "ogb.graphproppred.mol_encode...
[((294, 314), 'torch.mean', 'torch.mean', (['h'], {'dim': '(1)'}), '(h, dim=1)\n', (304, 314), False, 'import torch\n'), ((541, 560), 'torch.sum', 'torch.sum', (['h'], {'dim': '(1)'}), '(h, dim=1)\n', (550, 560), False, 'import torch\n'), ((636, 660), 'torch.mean', 'torch.mean', (['(h * h)'], {'dim': '(1)'}), '(h * h, ...
import numpy as np import cv2 import pandas as pd import os from time import time from pytesseract import image_to_string from re import search from glob import glob as listdir from collections import Counter from argparse import ArgumentParser from bs4 import BeautifulSoup as bs from requests import get as geturl cl...
[ "argparse.ArgumentParser", "cv2.approxPolyDP", "cv2.arcLength", "numpy.ones", "glob.glob", "cv2.inRange", "cv2.matchTemplate", "pandas.DataFrame", "cv2.cvtColor", "numpy.int32", "requests.get", "collections.Counter", "cv2.boundingRect", "re.search", "cv2.resize", "os.path.basename", ...
[((9743, 9759), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (9757, 9759), False, 'from argparse import ArgumentParser\n'), ((1000, 1022), 'numpy.array', 'np.array', (['[30, 22, 18]'], {}), '([30, 22, 18])\n', (1008, 1022), True, 'import numpy as np\n'), ((1053, 1075), 'numpy.array', 'np.array', (['[8...
# -*- coding: UTF-8 -*- from math import e import os from numpy.lib.type_check import _imag_dispatcher import pandas as pd import shutil import numpy as np import cv2 import random from tqdm import tqdm import pyfastcopy import json,sklearn from sklearn.model_selection import train_test_split pos_data_base='D:/WWF_De...
[ "tqdm.tqdm", "os.makedirs", "json.loads", "pandas.read_csv", "numpy.array", "shutil.copyfile", "os.listdir" ]
[((517, 545), 'os.makedirs', 'os.makedirs', (['Final_data_base'], {}), '(Final_data_base)\n', (528, 545), False, 'import os\n'), ((915, 942), 'pandas.read_csv', 'pd.read_csv', (['annotation_dir'], {}), '(annotation_dir)\n', (926, 942), True, 'import pandas as pd\n'), ((1039, 1056), 'tqdm.tqdm', 'tqdm', (['pic_id_list']...
import numpy as np from keras import backend as K from keras import activations, initializers from keras.initializers import Constant, Initializer from keras.layers import Layer from scipy import signal from scipy import linalg as la import math import tensorflow as tf def transition(measure, N, **measure_args): ...
[ "keras.backend.dot", "scipy.linalg.solve_triangular", "numpy.empty", "numpy.ones", "numpy.arange", "numpy.diag", "numpy.meshgrid", "keras.activations.get", "tensorflow.concat", "tensorflow.cast", "math.log", "keras.initializers.get", "scipy.signal.cont2discrete", "keras.initializers.Consta...
[((3525, 3536), 'keras.initializers.Constant', 'Constant', (['(0)'], {}), '(0)\n', (3533, 3536), False, 'from keras.initializers import Constant, Initializer\n'), ((4475, 4519), 'keras.initializers.get', 'initializers.get', (['input_encoders_initializer'], {}), '(input_encoders_initializer)\n', (4491, 4519), False, 'fr...
""" @author: <NAME> """ import numpy as np name_dict = {0:'<NAME>' , 1:'<NAME>', 2:'<NAME>', 3:'<NAME>', 4:'<NAME>', 5:'RVNK Neeraj', 6:'<NAME>', 7:'<NAME>', 8:'<NAME>', 9:'<NAME>', ...
[ "numpy.save" ]
[((337, 372), 'numpy.save', 'np.save', (['"""name_dict.npy"""', 'name_dict'], {}), "('name_dict.npy', name_dict)\n", (344, 372), True, 'import numpy as np\n')]
import numpy as np from scipy.linalg import eigh, inv def eigen_to_G(evals, evecs, efermi, energy): """ calculate green's function from eigenvalue/eigenvector for energy(e-ef): G(e-ef). :param evals: eigen values :param evecs: eigen vectors :param efermi: fermi energy :param energy: energy :...
[ "scipy.linalg.inv", "numpy.random.random", "scipy.linalg.eigh", "numpy.eye", "numpy.diag" ]
[((559, 568), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (565, 568), True, 'import numpy as np\n'), ((582, 601), 'scipy.linalg.inv', 'inv', (['(S * energy - H)'], {}), '(S * energy - H)\n', (585, 601), False, 'from scipy.linalg import eigh, inv\n'), ((647, 654), 'scipy.linalg.eigh', 'eigh', (['H'], {}), '(H)\n', (6...
import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from sympy import nroots, re, im, symbols, sympify from types import FunctionType from collections import defaultdict from tqdm.auto import tqdm from .varma import Varma class LedoitPecheShrinkage: """ Given sample eigenvalues lambd...
[ "numpy.maximum", "numpy.abs", "sympy.im", "numpy.ones", "numpy.argmin", "numpy.argsort", "numpy.random.default_rng", "collections.defaultdict", "numpy.sin", "numpy.exp", "sympy.re", "sympy.sympify", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "tqdm.a...
[((1355, 1372), 'numpy.array', 'np.array', (['lambdas'], {}), '(lambdas)\n', (1363, 1372), True, 'import numpy as np\n'), ((8155, 8169), 'matplotlib.pyplot.xlim', 'plt.xlim', (['xlim'], {}), '(xlim)\n', (8163, 8169), True, 'import matplotlib.pyplot as plt\n'), ((8178, 8192), 'matplotlib.pyplot.ylim', 'plt.ylim', (['yli...
import numpy as np # Adam optimizer class OptimizerADAM: """ Adaptive Momentum Stochastic Gradient Decent Optimizer. """ def __init__( self, learning_rate=0.001, decay=0., epsilon=1e-7, beta_1=0.9, beta_2=0.999 ): """...
[ "numpy.zeros_like", "numpy.sqrt" ]
[((1664, 1692), 'numpy.zeros_like', 'np.zeros_like', (['layer.weights'], {}), '(layer.weights)\n', (1677, 1692), True, 'import numpy as np\n'), ((1726, 1754), 'numpy.zeros_like', 'np.zeros_like', (['layer.weights'], {}), '(layer.weights)\n', (1739, 1754), True, 'import numpy as np\n'), ((1790, 1817), 'numpy.zeros_like'...
import matplotlib.pyplot as plt import numpy as np x = np.linspace(-5, 5, 100) y1 = 0.5 * x y2 = x * x plt.figure() plt.xlabel('X axis...') plt.ylabel('Y axis...') #设置坐标轴的文字标签 ax = plt.gca() # get current axis 获得坐标轴对象 ax.spines['right'].set_c...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "numpy.linspace", "matplotlib.pyplot.gca", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((56, 79), 'numpy.linspace', 'np.linspace', (['(-5)', '(5)', '(100)'], {}), '(-5, 5, 100)\n', (67, 79), True, 'import numpy as np\n'), ((105, 117), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (115, 117), True, 'import matplotlib.pyplot as plt\n'), ((118, 141), 'matplotlib.pyplot.xlabel', 'plt.xlabel', ...
import numpy as np from os import makedirs, listdir from os.path import join, isfile, isdir, exists, splitext from pak.datasets.MOT import MOT16 from pak import utils from time import time from skimage.transform import resize from cabbage.data.ReId import get_positive_pairs_by_index def get_element(X, bb, shape): ...
[ "numpy.load", "numpy.save", "numpy.concatenate", "os.makedirs", "os.path.isdir", "pak.datasets.MOT.MOT16", "time.time", "os.path.isfile", "numpy.array", "pak.utils.extract_eq", "skimage.transform.resize", "numpy.random.choice", "cabbage.data.ReId.get_positive_pairs_by_index", "os.path.join...
[((449, 500), 'skimage.transform.resize', 'resize', (['X[y:y + h, x:x + w]', 'shape'], {'mode': '"""constant"""'}), "(X[y:y + h, x:x + w], shape, mode='constant')\n", (455, 500), False, 'from skimage.transform import resize\n'), ((649, 687), 'pak.utils.extract_eq', 'utils.extract_eq', (['Y_gt'], {'col': '(7)', 'value':...
import numpy as np import csv from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D class clustering: def __init__(self): self.specimen = np.zeros((125, 3)) # 使用欧氏距离 def calculate_distance(self, x, y): res = 0 for i in range(len(x)): ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "csv.reader", "matplotlib.pyplot.axes", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.random.randint", "matplotlib.pyplot.savefig", "numpy.sqrt" ]
[((4502, 4514), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (4512, 4514), True, 'from matplotlib import pyplot as plt\n'), ((4526, 4551), 'matplotlib.pyplot.axes', 'plt.axes', ([], {'projection': '"""3d"""'}), "(projection='3d')\n", (4534, 4551), True, 'from matplotlib import pyplot as plt\n'), ((5914, ...
import numpy as np import tensorflow as tf def binary_encode(i, j): return np.array([i >> d & 1 for d in range(j)]) def fizz_buzz_encode(i): if i % 15 == 0: return np.array([0, 0, 0, 1]) elif i % 5 == 0: return np.array([0, 0, 1, 0]) elif i % 3 == 0: return np.array([0, 1, 0, 0]) else: return...
[ "numpy.vectorize", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.argmax", "numpy.argmax", "tensorflow.Session", "tensorflow.placeholder", "tensorflow.matmul", "tensorflow.random_normal", "numpy.arange", "numpy.array", "tensorflow.initialize_all_variables", "tensorflow.train.Gr...
[((512, 547), 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""', '[None, 10]'], {}), "('float', [None, 10])\n", (526, 547), True, 'import tensorflow as tf\n'), ((553, 587), 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""', '[None, 4]'], {}), "('float', [None, 4])\n", (567, 587), True, 'import tenso...
import os import sys import unittest import numpy as np from math import isclose # Make sure we can import the /src. sys.path.append(os.path.abspath("../../code")) from src.porosity import Porosity from src.tree_roots import TreeRoots from src.water_content import WaterContent from src.soil_properties import SoilProp...
[ "unittest.main", "os.path.abspath", "numpy.sum", "src.water_content.WaterContent", "numpy.zeros", "src.porosity.Porosity", "numpy.arange", "numpy.linspace", "src.soil_properties.SoilProperties", "numpy.random.rand", "src.tree_roots.TreeRoots" ]
[((134, 163), 'os.path.abspath', 'os.path.abspath', (['"""../../code"""'], {}), "('../../code')\n", (149, 163), False, 'import os\n'), ((4048, 4063), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4061, 4063), False, 'import unittest\n'), ((939, 979), 'numpy.arange', 'np.arange', (['(0.0)', '(z_max + self.dz)', '...
# Neural network for pop assignment # Load packages import tensorflow.keras as tf from kerastuner.tuners import RandomSearch from kerastuner import HyperModel import numpy as np import pandas as pd import allel import zarr import h5py from sklearn.model_selection import RepeatedStratifiedKFold, train_test_split from s...
[ "numpy.sum", "tensorflow.keras.layers.Dense", "pandas.read_csv", "sklearn.model_selection.train_test_split", "tensorflow.keras.callbacks.ModelCheckpoint", "matplotlib.pyplot.figure", "tensorflow.keras.Sequential", "shutil.rmtree", "numpy.round", "tensorflow.keras.callbacks.EarlyStopping", "numpy...
[((17514, 17548), 'pandas.read_csv', 'pd.read_csv', (['sample_data'], {'sep': '"""\t"""'}), "(sample_data, sep='\\t')\n", (17525, 17548), True, 'import pandas as pd\n'), ((18158, 18190), 'numpy.delete', 'np.delete', (['dc', 'uk_remove'], {'axis': '(0)'}), '(dc, uk_remove, axis=0)\n', (18167, 18190), True, 'import numpy...
import logging import re from os import path import os import netCDF4 import numpy as np from netCDF4 import Dataset, date2index, num2date from dateutil.parser import parse from datetime import datetime from dateutil.relativedelta import relativedelta import geopyspark as gps from shapely.geometry import Polygon from...
[ "netCDF4.Dataset", "dateutil.parser.parse", "geopyspark.Extent", "netCDF4.date2index", "os.path.isdir", "netCDF4.date2num", "geopyspark.TemporalProjectedExtent", "numpy.square", "dateutil.relativedelta.relativedelta", "geopyspark.Tile.from_numpy_array", "numpy.array", "geopyspark.LocalLayout",...
[((369, 397), 'logging.getLogger', 'logging.getLogger', (['"""pyspark"""'], {}), "('pyspark')\n", (386, 397), False, 'import logging\n'), ((432, 468), 'netCDF4.Dataset', 'Dataset', (['path', '"""r"""'], {'format': '"""NETCDF4"""'}), "(path, 'r', format='NETCDF4')\n", (439, 468), False, 'from netCDF4 import Dataset, dat...
import sys from pathlib import Path sys_path = str((Path(__file__).resolve().parent / '../').resolve()) # sys.path.append("/home/liang/topic_ws/src/object_detect") sys.path.append(str(sys_path)) import torch import spconv import numpy as np import os import datetime from ros_numpy import point_cloud2 from numpy.lib.rec...
[ "for_ros.utils.common_utils.mask_points_by_range", "rospy.Subscriber", "torch.cat", "pathlib.Path", "torch.cuda.current_device", "os.path.join", "spconv.SparseConvTensor", "rospy.Time.now", "torch.load", "os.path.exists", "for_ros.utils.model.DetNet", "rospy.init_node", "torch.zeros", "dat...
[((4154, 4218), 'numpy.logical_and', 'np.logical_and', (['(pts_img[:, 0] >= 0)', '(pts_img[:, 0] < img_shape[1])'], {}), '(pts_img[:, 0] >= 0, pts_img[:, 0] < img_shape[1])\n', (4168, 4218), True, 'import numpy as np\n'), ((4236, 4300), 'numpy.logical_and', 'np.logical_and', (['(pts_img[:, 1] >= 0)', '(pts_img[:, 1] < ...
import numpy as np import pybullet as pb import matplotlib.pyplot as pt def get_object_poses(env): # take the picture rgba, view, proj = env.get_camera_image() # replace this with NN objs = [ pb.getBasePositionAndOrientation(bid) for bid in range(3, pb.getNumBodies()) # first two bodie...
[ "numpy.stack", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "pybullet.getBasePositionAndOrientation", "numpy.ones", "numpy.array", "pybullet.getNumBodies" ]
[((918, 954), 'numpy.stack', 'np.stack', (['(x[0] / x[3], x[1] / x[3])'], {}), '((x[0] / x[3], x[1] / x[3]))\n', (926, 954), True, 'import numpy as np\n'), ((1479, 1499), 'matplotlib.pyplot.imshow', 'pt.imshow', (['sub_image'], {}), '(sub_image)\n', (1488, 1499), True, 'import matplotlib.pyplot as pt\n'), ((1504, 1513)...
import os import cv2 import csv import numpy as np num_output = 8 input_shape = (512, 512, 3) batch_size = 10 IMAGES_FOLDER = 'resized_frames' ANNOTATION_FILE = 'annotation_formatted.csv' OUTPUT = 'output' ### Initialise empty numpy arrays data = np.empty((0,512,512,3), dtype=np.int8) target = np.empty((0,8), dty...
[ "numpy.divide", "csv.reader", "numpy.empty", "numpy.expand_dims", "cv2.imread", "numpy.arange", "numpy.array", "numpy.vstack", "os.path.join", "numpy.random.shuffle" ]
[((253, 294), 'numpy.empty', 'np.empty', (['(0, 512, 512, 3)'], {'dtype': 'np.int8'}), '((0, 512, 512, 3), dtype=np.int8)\n', (261, 294), True, 'import numpy as np\n'), ((301, 333), 'numpy.empty', 'np.empty', (['(0, 8)'], {'dtype': 'np.float'}), '((0, 8), dtype=np.float)\n', (309, 333), True, 'import numpy as np\n'), (...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Catalog. TODO: add plotting """ from pandas import DataFrame, read_csv, read_table from numpy import full, sqrt, power, arctan2, rad2deg from numpy.random import uniform, normal from .data import GUO_FILE from .seed import set_numpy_random_seed #TODO: allow access to...
[ "pandas.DataFrame", "numpy.random.uniform", "numpy.full", "numpy.arctan2", "numpy.power", "numpy.random.normal" ]
[((2269, 2280), 'pandas.DataFrame', 'DataFrame', ([], {}), '()\n', (2278, 2280), False, 'from pandas import DataFrame, read_csv, read_table\n'), ((2606, 2666), 'numpy.random.uniform', 'uniform', (['self.limits.xi.radian', 'self.limits.xf.radian', 'count'], {}), '(self.limits.xi.radian, self.limits.xf.radian, count)\n',...
""" Various functions / models for calculating airmass """ import numpy as np from astropy.constants import R_earth # import matplotlib.pyplot as plt RHO0 = 1.225 # Density of air at sea level (kg/m^3) HMAX = 84852. # Maximal height for model atmosphere # Re = 6378100 # Earth radius (m) YOUNG_COEF1 = [1.002432, ...
[ "numpy.radians", "numpy.sez", "numpy.degrees", "numpy.polyval", "numpy.empty", "numpy.arcsin", "numpy.sin", "numpy.arange", "numpy.array", "numpy.cos", "numpy.sec", "numpy.exp", "numpy.piecewise", "numpy.sqrt" ]
[((2562, 2602), 'numpy.piecewise', 'np.piecewise', (['H_gp', 'regions', 'expressions'], {}), '(H_gp, regions, expressions)\n', (2574, 2602), True, 'import numpy as np\n'), ((3394, 3403), 'numpy.sec', 'np.sec', (['z'], {}), '(z)\n', (3400, 3403), True, 'import numpy as np\n'), ((4208, 4217), 'numpy.cos', 'np.cos', (['z'...
import torch import torchvision from torchvision.models import vgg16 from torchvision import transforms from torch.utils.data import DataLoader from torch.optim import Adam import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision.transforms import Compose, CenterCrop, Normalize...
[ "core50.Core50", "ilab.Ilab", "torch.optim.lr_scheduler.StepLR", "torch.cat", "numpy.mean", "torchvision.transforms.Normalize", "torch.no_grad", "toybox.Toybox", "cifar100.cifar100", "torch.nn.functional.log_softmax", "exemplar.Exemplar", "copy.deepcopy", "tqdm.tqdm", "torchvision.transfor...
[((1547, 1590), 'torch.nn.DataParallel', 'nn.DataParallel', (['self.model'], {'device_ids': '[0]'}), '(self.model, device_ids=[0])\n', (1562, 1590), True, 'import torch.nn as nn\n'), ((11762, 11783), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (11781, 11783), True, 'import torch.nn as nn\n'), ...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "IPython.display.Audio", "levitt_experiment.LevittExp", "ipywidgets.Output", "numpy.sin", "numpy.arange", "ipywidgets.Button", "IPython.display.display", "ipywidgets.Label", "numpy.hanning", "sleeve_usb.SleeveUSB", "json.dump", "ipywidgets.HBox", "random.random", "numpy.random.standard_nor...
[((1603, 1619), 'ipywidgets.Output', 'widgets.Output', ([], {}), '()\n', (1617, 1619), True, 'import ipywidgets as widgets\n'), ((1810, 1882), 'ipywidgets.Label', 'widgets.Label', (['self.title'], {'disabled': '(False)', 'style': "{'font_weight': 'bold'}"}), "(self.title, disabled=False, style={'font_weight': 'bold'})\...
import pandas as pd import matplotlib.pyplot as plt from PyQt5.QtCore import * from libs.figure.figure_QDialog import fig_Dialog import os import numpy as np class save_DynamicResult_(QThread): def __init__(self, over_tracked, parameter, save_path, parent=None): super(save_DynamicResult_, self).__init__() ...
[ "pandas.DataFrame", "numpy.zeros", "pandas.ExcelWriter", "pandas.concat", "pandas.value_counts" ]
[((3048, 3103), 'pandas.DataFrame', 'pd.DataFrame', (['binding'], {'columns': "['Frame', 'New Binding']"}), "(binding, columns=['Frame', 'New Binding'])\n", (3060, 3103), True, 'import pandas as pd\n'), ((3195, 3254), 'pandas.DataFrame', 'pd.DataFrame', (['debinding'], {'columns': "['Frame', 'New Debinding']"}), "(debi...
import numpy import seaborn import matplotlib.pyplot as plt import pandas import textwrap import os import scipy.stats.distributions import numpy as np def plot_sampling_boundaries_1D(x_values, ranges, **kwargs): plt.axvline(ranges, ls='--', color='k', lw=1) plt.axvline(max(x_values), ls='--', color='k', lw=1...
[ "pandas.DataFrame", "matplotlib.pyplot.axvline", "matplotlib.pyplot.axhline", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "os.path.join", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "numpy.expand_dims", "textwrap.TextWrapper", "matplotlib.pyplot.fi...
[((219, 264), 'matplotlib.pyplot.axvline', 'plt.axvline', (['ranges'], {'ls': '"""--"""', 'color': '"""k"""', 'lw': '(1)'}), "(ranges, ls='--', color='k', lw=1)\n", (230, 264), True, 'import matplotlib.pyplot as plt\n'), ((426, 496), 'pandas.DataFrame', 'pandas.DataFrame', (['params[:-1]'], {'columns': 'likelihood.flat...
import arviz import numpy as np import pandas import seaborn as sns import torch import torch.distributions as dist from matplotlib import pyplot import test_stan import generate_data sns.set() # np.random.seed(1) def user_simulator_typezero(action, W, a, educability=0.6): # action is either a tuple, or -1 for...
[ "pandas.DataFrame", "matplotlib.pyplot.axvline", "torch.distributions.Bernoulli", "seaborn.heatmap", "matplotlib.pyplot.show", "numpy.zeros", "numpy.max", "arviz.plot_trace", "numpy.arange", "test_stan.fit_model_w_education", "numpy.random.choice", "torch.zeros", "generate_data", "seaborn....
[((186, 195), 'seaborn.set', 'sns.set', ([], {}), '()\n', (193, 195), True, 'import seaborn as sns\n'), ((1726, 1782), 'generate_data', 'generate_data', ([], {'n_noncollinear': '(50)', 'n_collinear': '(100)', 'n': '(100)'}), '(n_noncollinear=50, n_collinear=100, n=100)\n', (1739, 1782), False, 'import generate_data\n')...
# Copyright 2020 The Kubric 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
[ "sys.path.append", "kubric.pylab.FlatMaterial", "kubric.pylab.random_rotation", "kubric.pylab.Cube", "kubric.pylab.random_hue_color", "kubric.pylab.OrthographicCamera", "kubric.pylab.position_sampler", "numpy.linspace", "kubric.pylab.Color.from_hsv", "datetime.datetime.now", "kubric.pylab.get_co...
[((630, 650), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (645, 650), False, 'import sys\n'), ((1698, 1820), 'kubric.pylab.Cube', 'kb.Cube', ([], {'scale': '(1, 1, 0.9)', 'position': '(0, 0, -0.9)', 'material': 'floor_material', 'static': '(True)', 'restitution': '(0.0)', 'friction': '(0.0)'}), ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 2 13:15:35 2018 Modified Sat Dec 1 2018 (fix save/import issue) Modified Wed Dec 5 2018 (Fix Issue 2, Handle DC Loads) Modified on 02/22/2019 for version 0.1.0 Modified on 04/11/2021 to address Issues #10, 12, & 13 related to improving ...
[ "pandas.DataFrame", "Parameters.load_fields.index", "DataFrame.DataFrame.__init__", "numpy.array", "Parameters.load_types.keys" ]
[((1235, 1260), 'Parameters.load_fields.index', 'sp.load_fields.index', (['val'], {}), '(val)\n', (1255, 1260), True, 'import Parameters as sp\n'), ((1495, 1556), 'DataFrame.DataFrame.__init__', 'DataFrame.__init__', (['self', 'sp.load_fields', 'sp.load_field_types'], {}), '(self, sp.load_fields, sp.load_field_types)\n...
#!usr/bin/env python3 import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.stats import norm seed_number = 1234 norm_dist = "random_draws_normal.csv" #import data infile = norm_dist random_numbers = pd.read_csv(infile, index_col=0) random_numbers.columns = range(random_numbers.shape[1]) #...
[ "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pandas.read_csv", "matplotlib.pyplot.style.use", "numpy.exp", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((230, 262), 'pandas.read_csv', 'pd.read_csv', (['infile'], {'index_col': '(0)'}), '(infile, index_col=0)\n', (241, 262), True, 'import pandas as pd\n'), ((507, 566), 'pandas.DataFrame', 'pd.DataFrame', (['(random_numbers * monthly_theta + monthly_mean)'], {}), '(random_numbers * monthly_theta + monthly_mean)\n', (519...
# -------------- # Importing header files import numpy as np import warnings warnings.filterwarnings('ignore') #New record new_record=[[50, 9, 4, 1, 0, 0, 40, 0]] #Reading file data = np.genfromtxt(path, delimiter=",", skip_header=1) #Code starts here #concatenating a new record to a existing a...
[ "numpy.sum", "warnings.filterwarnings", "numpy.std", "numpy.genfromtxt", "numpy.max", "numpy.min", "numpy.mean", "numpy.concatenate" ]
[((82, 115), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (105, 115), False, 'import warnings\n'), ((203, 252), 'numpy.genfromtxt', 'np.genfromtxt', (['path'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(path, delimiter=',', skip_header=1)\n", (216, 252), True, 'i...
""" Nearest-neighbor distance distribution analysis Nearest-neighbor distance distributions provide information about deviations from a spatial homogeneous Poisson process (i.e. complete spatial randomness, CSR). Point-event distances are given by the distance between a random point (not being an event) and the neare...
[ "pandas.DataFrame", "sklearn.neighbors.NearestNeighbors", "numpy.exp", "matplotlib.pyplot.gca", "logging.getLogger" ]
[((1530, 1557), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1547, 1557), False, 'import logging\n'), ((2955, 3044), 'pandas.DataFrame', 'pd.DataFrame', (["{'nn_distance': distances[..., k - 1], 'nn_index': indices[..., k - 1]}"], {}), "({'nn_distance': distances[..., k - 1], 'nn_index...
import os import shutil import time import socket import torch import torch.optim as optim import torch.nn as nn import numpy as np import Utils from Utils.checkpoints import build_logger from Utils.checkpoints import plot_image, save_context from Utils import flags import Torture from Torture.Models import resnet_3l...
[ "Utils.flags.DEFINE_argument", "torch.utils.data.DataLoader", "torch.nn.CrossEntropyLoss", "numpy.zeros", "torchvision.datasets.CIFAR100", "torchvision.datasets.CIFAR10", "socket.gethostname", "torch.optim.lr_scheduler.LambdaLR", "Utils.checkpoints.save_context", "MI.pgd.projected_gradient_descent...
[((814, 866), 'Utils.flags.DEFINE_argument', 'flags.DEFINE_argument', (['"""-gpu"""', '"""--gpu"""'], {'default': '"""-1"""'}), "('-gpu', '--gpu', default='-1')\n", (835, 866), False, 'from Utils import flags\n'), ((867, 954), 'Utils.flags.DEFINE_argument', 'flags.DEFINE_argument', (['"""--results-folder"""'], {'defaul...
from plotnine import * import numpy as np import pandas as pd import functions.et_make_df as make_df from functions.et_helper import winmean,winmean_cl_boot import MISC import logging logger = logging.getLogger(__name__) def process_lum(etsamples,etmsgs): all_lum = pd.DataFrame() for subject in etsamples.subje...
[ "pandas.DataFrame", "numpy.sum", "scipy.stats.binned_statistic", "numpy.median", "logging.getLogger", "pandas.to_numeric" ]
[((193, 220), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (210, 220), False, 'import logging\n'), ((271, 285), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (283, 285), True, 'import pandas as pd\n'), ((3430, 3475), 'pandas.to_numeric', 'pd.to_numeric', (["all_lum_diff.loc[:, '...
#!/usr/bin/env python """utilities.py: datafile checking and format conversions """ import csv import gdal import json import numpy as np import os import shapefile from gdalconst import * from osgeo import osr, gdal from random import randint import matplotlib.pyplot as plt import pandas """ Do basic checks on any...
[ "pandas.DataFrame", "csv.reader", "csv.writer", "numpy.amin", "matplotlib.pyplot.show", "random.randint", "matplotlib.pyplot.bar", "json.dumps", "numpy.amax", "numpy.array", "shapefile.Reader", "osgeo.gdal.Open", "osgeo.gdal.GetDriverByName", "osgeo.gdal.GetDataTypeName", "osgeo.osr.Spat...
[((428, 443), 'csv.reader', 'csv.reader', (['fin'], {}), '(fin)\n', (438, 443), False, 'import csv\n'), ((1223, 1237), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (1231, 1237), True, 'import numpy as np\n'), ((1584, 1613), 'osgeo.gdal.GetDriverByName', 'gdal.GetDriverByName', (['"""GTiff"""'], {}), "('GTiff'...
import os, sys selfPath = os.path.dirname(__file__) parentPath = os.path.dirname(selfPath) sys.path += [parentPath] from Imp.Imp import Implementation from ItkHandler.ItkHandler import ItkHandler import numpy as np import unittest TEST_EQUALITYRATIO_DELTA = 1e-1 def CreateTestResult(mode_): ...
[ "unittest.main", "numpy.abs", "os.path.dirname", "ItkHandler.ItkHandler.ItkHandler", "Imp.Imp.Implementation" ]
[((31, 56), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (46, 56), False, 'import os, sys\n'), ((71, 96), 'os.path.dirname', 'os.path.dirname', (['selfPath'], {}), '(selfPath)\n', (86, 96), False, 'import os, sys\n'), ((327, 365), 'Imp.Imp.Implementation', 'Implementation', (['"""TestMethod...
import datetime import glob from google_speech import Speech import numpy as np import pandas as pd from pygame.draw import polygon from pygame.font import SysFont from pygame_utilities import display_centered_text import time from bead import ( digitize, draw_columns, height_to_width, ) import operation a...
[ "numpy.random.choice", "bead.digitize", "operation.generate_mixed_problem", "bead.height_to_width", "pygame.font.SysFont", "bead.draw_columns", "datetime.date.today", "numpy.ones", "time.sleep", "datetime.datetime.now", "numpy.random.random", "numpy.random.randint", "glob.glob", "pygame.dr...
[((436, 459), 'glob.glob', 'glob.glob', (["('*' + suffix)"], {}), "('*' + suffix)\n", (445, 459), False, 'import glob\n'), ((4699, 4747), 'pygame_utilities.display_centered_text', 'display_centered_text', (['screen', 'text', 'color', 'font'], {}), '(screen, text, color, font)\n', (4720, 4747), False, 'from pygame_utili...
import numpy as np import pickle as pkl sample_id_to_subject_id = {} subject_id_time = {} subject_id_u = {} with open("data_diet/metadata.txt", "r") as f: for line in f: line = line.split() if "sampleID" in line[0]: continue sample_id = line[0] subject_id = line[2] ...
[ "numpy.array", "numpy.loadtxt" ]
[((611, 686), 'numpy.loadtxt', 'np.loadtxt', (['"""data_diet/counts.txt"""'], {'delimiter': '"""\t"""', 'dtype': 'str', 'comments': '"""!"""'}), "('data_diet/counts.txt', delimiter='\\t', dtype=str, comments='!')\n", (621, 686), True, 'import numpy as np\n'), ((1347, 1386), 'numpy.array', 'np.array', (['subject_id_coun...
""" Script for splitting a dataset hdf5 file into training and validation trajectories. Args: dataset (str): path to hdf5 dataset filter_key (str): if provided, split the subset of trajectories in the file that correspond to this filter key into a training and validation set of trajectories, i...
[ "h5py.File", "numpy.random.seed", "argparse.ArgumentParser", "numpy.sum", "robomimic.utils.file_utils.create_hdf5_filter_key", "numpy.zeros", "numpy.mean", "numpy.random.shuffle" ]
[((1207, 1232), 'h5py.File', 'h5py.File', (['hdf5_path', '"""r"""'], {}), "(hdf5_path, 'r')\n", (1216, 1232), False, 'import h5py\n'), ((1623, 1642), 'numpy.zeros', 'np.zeros', (['num_demos'], {}), '(num_demos)\n', (1631, 1642), True, 'import numpy as np\n'), ((1671, 1694), 'numpy.random.shuffle', 'np.random.shuffle', ...
""" CyclicFeedbackSystem class and methods. This is a child class of the RampSystem class (see ramp_system.py). Author: <NAME> """ from ramp_systems.ramp_system import RampSystem from ramp_systems.cell import Cell import itertools import sympy from sympy.matrices import zeros as sympy_zeros import numpy as np impo...
[ "sympy.symbols", "sympy.utilities.lambdify", "sympy.fraction", "numpy.logical_and", "numpy.diagflat", "sympy.matrices.zeros", "numpy.zeros", "sympy.Matrix", "ramp_systems.ramp_system.RampSystem.__init__", "ramp_systems.cell.Cell", "numpy.array", "numpy.cos", "numpy.array_equal", "warnings....
[((651, 709), 'ramp_systems.ramp_system.RampSystem.__init__', 'RampSystem.__init__', (['self', 'Network', 'L', 'Delta', 'theta', 'gamma'], {}), '(self, Network, L, Delta, theta, gamma)\n', (670, 709), False, 'from ramp_systems.ramp_system import RampSystem\n'), ((2875, 2899), 'sympy.Matrix', 'sympy.Matrix', (['self.Del...
import numpy as np import logging import configargparse as argparse import glob from skimage.external import tifffile import matplotlib.pyplot as plt import matplotlib from math import ceil import copy def error_visualisation(options): ''' Script for visualising the false negatives signalled by the CTC evaluat...
[ "matplotlib.pyplot.show", "logging.basicConfig", "numpy.median", "matplotlib.pyplot.close", "numpy.where", "numpy.array", "glob.glob", "matplotlib.pyplot.subplots_adjust", "numpy.vstack", "configargparse.ArgumentParser", "matplotlib.pyplot.subplots", "logging.getLogger" ]
[((5508, 5699), 'configargparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Visualise the erros by viewing raw data, groundtruth segmentation and tracking result."""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description=\n 'Visualise the erros by viewing raw data, gr...
import functools import numpy as np import pytest import tensorflow as tf from tests.layers.flows.helper import invertible_flow_standard_check from tfsnippet.layers import CouplingLayer, conv2d from tfsnippet.ops import (flatten_to_ndims, unflatten_from_ndims, tra...
[ "numpy.random.seed", "numpy.abs", "tensorflow.zeros_like", "tensorflow.matmul", "numpy.exp", "numpy.random.normal", "tests.layers.flows.helper.invertible_flow_standard_check", "numpy.zeros_like", "numpy.transpose", "tensorflow.placeholder", "pytest.raises", "tfsnippet.layers.CouplingLayer", ...
[((770, 793), 'numpy.split', 'np.split', (['x', '[n1]', 'axis'], {}), '(x, [n1], axis)\n', (778, 793), True, 'import numpy as np\n'), ((2194, 2229), 'numpy.concatenate', 'np.concatenate', (['[y1, y2]'], {'axis': 'axis'}), '([y1, y2], axis=axis)\n', (2208, 2229), True, 'import numpy as np\n'), ((1158, 1174), 'numpy.zero...
#!/usr/bin/env python from load import ROOT as R import numpy as N from gna.constructors import Points from gna.bindings import DataType segments = N.arange(0.0, 5.1, dtype='d') segments_t = Points(segments) print( 'Edges', segments ) for case in [ ( 0.5, 3.6, 0.4), (-1.5, 3.6, 0.4), ( 3.5,...
[ "load.ROOT.SegmentWise", "numpy.arange", "gna.constructors.Points" ]
[((152, 181), 'numpy.arange', 'N.arange', (['(0.0)', '(5.1)'], {'dtype': '"""d"""'}), "(0.0, 5.1, dtype='d')\n", (160, 181), True, 'import numpy as N\n'), ((195, 211), 'gna.constructors.Points', 'Points', (['segments'], {}), '(segments)\n', (201, 211), False, 'from gna.constructors import Points\n'), ((452, 478), 'nump...
import numpy as np from sklearn.utils import check_array, check_X_y from joblib import Parallel, delayed from .regression_tree import RegressionTree import copy class StochasticThresholdModelTrees(): """ Class of the Stochastic Threshold Model Trees. - Extended ensemble method based on tree-base...
[ "sklearn.utils.check_array", "numpy.std", "numpy.median", "numpy.log2", "sklearn.utils.check_X_y", "numpy.iinfo", "numpy.random.RandomState", "numpy.mean", "joblib.Parallel", "joblib.delayed", "numpy.sqrt" ]
[((1519, 1550), 'sklearn.utils.check_X_y', 'check_X_y', (['X', 'y', "['csr', 'csc']"], {}), "(X, y, ['csr', 'csc'])\n", (1528, 1550), False, 'from sklearn.utils import check_array, check_X_y\n'), ((2172, 2207), 'sklearn.utils.check_array', 'check_array', (['X'], {'accept_sparse': '"""csr"""'}), "(X, accept_sparse='csr'...
import numpy as np import matplotlib.pylab as plt import matplotlib.gridspec as gridspec import os import pandas as pd #plt.rcParams["image.composite_image"] =False ################################################################ import matplotlib matplotlib.rcParams.update({'text.usetex': False, 'font.family': 'stixge...
[ "matplotlib.pylab.savefig", "numpy.abs", "numpy.sum", "matplotlib.pylab.subplot", "matplotlib.pylab.figtext", "matplotlib.rcParams.update", "numpy.histogram", "numpy.where", "numpy.arange", "numpy.loadtxt", "numpy.repeat", "matplotlib.pylab.close", "matplotlib.gridspec.GridSpec", "matplotl...
[((248, 360), 'matplotlib.rcParams.update', 'matplotlib.rcParams.update', (["{'text.usetex': False, 'font.family': 'stixgeneral', 'mathtext.fontset': 'stix'\n }"], {}), "({'text.usetex': False, 'font.family':\n 'stixgeneral', 'mathtext.fontset': 'stix'})\n", (274, 360), False, 'import matplotlib\n'), ((655, 671),...
import os import errno import click import numpy as np from configs.ibsr import IBSRConfig from src.data.preprocessor import Preprocessor from src.models.unet import Unet from src.data.utils import DataUtils # Use IBSRConfig # You can create another config in 'configs' directory and change _config variable _config = I...
[ "numpy.load", "numpy.save", "os.makedirs", "src.data.preprocessor.Preprocessor", "src.models.unet.Unet", "click.echo", "click.command", "click.Path", "src.data.utils.DataUtils", "click.group" ]
[((397, 459), 'src.models.unet.Unet', 'Unet', (['_config.IMG_SIZE', '_config.IMG_SIZE', '_config.WEIGHTS_PATH'], {}), '(_config.IMG_SIZE, _config.IMG_SIZE, _config.WEIGHTS_PATH)\n', (401, 459), False, 'from src.models.unet import Unet\n'), ((463, 476), 'click.group', 'click.group', ([], {}), '()\n', (474, 476), False, ...
from abc import ABC, abstractmethod from typing import Any, List, Optional, Sequence import numpy as np from openfermion import IsingOperator, QubitOperator, SymbolicOperator from zquantum.core.wavefunction import Wavefunction from ..bitstring_distribution import ( BitstringDistribution, create_bitstring_dist...
[ "numpy.array" ]
[((6674, 6702), 'numpy.array', 'np.array', (['flipped_amplitudes'], {}), '(flipped_amplitudes)\n', (6682, 6702), True, 'import numpy as np\n')]
# Copyright (c) 2016, <NAME> # Licensed under the BSD 3-clause license (see LICENSE) # This file was modified from the GPy project. Its file header is replicated # below. Its LICENSE.txt is replicated in the LICENSE file for this directory. # Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt). # Licensed under th...
[ "numpy.zeros" ]
[((4274, 4305), 'numpy.zeros', 'np.zeros', (['self.param_array.size'], {}), '(self.param_array.size)\n', (4282, 4305), True, 'import numpy as np\n')]
# # setup python environment # pip install --upgrade pip, scikit-image, numpy, Pillow, nibabel # # This is the first preprocessing step: downsample and resize all images into the same size # # Usage: # # for i in {1..15}_{1..10}.tif; do echo $i >> filelist.txt; done # n=100; while read file; do if [ -f $file ]; then n=...
[ "skimage.transform.downscale_local_mean", "numpy.eye", "numpy.array", "skimage.io.imread" ]
[((563, 609), 'skimage.io.imread', 'skimage.io.imread', (['inputImg'], {'plugin': '"""tifffile"""'}), "(inputImg, plugin='tifffile')\n", (580, 609), False, 'import skimage\n'), ((619, 678), 'skimage.transform.downscale_local_mean', 'skimage.transform.downscale_local_mean', (['im[:, :, 0]', '(8, 8)'], {}), '(im[:, :, 0]...
import os import time import math import random import dill as pk import numpy as np from collections import defaultdict import torch from torch.nn.utils.rnn import pad_sequence def set_seed(seed): random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) def ...
[ "numpy.full", "torch.randint", "numpy.random.seed", "math.ceil", "numpy.argmax", "torch.manual_seed", "torch.cuda.manual_seed", "numpy.zeros", "numpy.argmin", "collections.defaultdict", "random.seed", "numpy.arange", "time.localtime", "numpy.vstack", "torch.isnan", "numpy.random.shuffl...
[((210, 227), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (221, 227), False, 'import random\n'), ((232, 252), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (246, 252), True, 'import numpy as np\n'), ((257, 280), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (27...
import argparse import datetime import logging import os import sys import tempfile import numpy as np import igibson from igibson.envs.igibson_env import iGibsonEnv from igibson.render.mesh_renderer.mesh_renderer_cpu import MeshRendererSettings from igibson.render.mesh_renderer.mesh_renderer_vr import VrConditionSwi...
[ "igibson.render.mesh_renderer.mesh_renderer_cpu.MeshRendererSettings", "igibson.utils.ig_logging.IGLogWriter", "numpy.random.uniform", "argparse.ArgumentParser", "tempfile.gettempdir", "numpy.zeros", "datetime.datetime.now", "igibson.envs.igibson_env.iGibsonEnv", "logging.info", "igibson.utils.uti...
[((498, 565), 'logging.info', 'logging.info', (["('*' * 80 + '\\nDescription:' + main.__doc__ + '*' * 80)"], {}), "('*' * 80 + '\\nDescription:' + main.__doc__ + '*' * 80)\n", (510, 565), False, 'import logging\n'), ((1299, 1370), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run and co...
############################################################################### # # # sudoku_solver.py # # # ...
[ "numpy.array" ]
[((7723, 7748), 'numpy.array', 'np.array', (['sudoku_to_solve'], {}), '(sudoku_to_solve)\n', (7731, 7748), True, 'import numpy as np\n')]
# -------------- # Importing header files import numpy as np # Path of the file has been stored in variable called 'path' #New record new_record=[[50, 9, 4, 1, 0, 0, 40, 0]] data=np.genfromtxt(path, delimiter=",", skip_header=1) print(data.shape) census=np.concatenate((data,new_record),axis=0) print(c...
[ "numpy.std", "numpy.genfromtxt", "numpy.concatenate" ]
[((194, 243), 'numpy.genfromtxt', 'np.genfromtxt', (['path'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(path, delimiter=',', skip_header=1)\n", (207, 243), True, 'import numpy as np\n'), ((271, 313), 'numpy.concatenate', 'np.concatenate', (['(data, new_record)'], {'axis': '(0)'}), '((data, new_record), axis=0)...
import torch import torch.nn.utils as nn_utils import numpy as np from codes.c_models.base_model import RNNModel from codes.d_agents.on_policy.on_policy_agent import OnPolicyAgent from codes.e_utils import replay_buffer from codes.e_utils.common_utils import float32_preprocessor class AgentA2C(OnPolicyAgent): ""...
[ "numpy.asarray", "codes.e_utils.common_utils.float32_preprocessor", "numpy.array", "codes.e_utils.replay_buffer.ExperienceReplayBuffer" ]
[((718, 819), 'codes.e_utils.replay_buffer.ExperienceReplayBuffer', 'replay_buffer.ExperienceReplayBuffer', ([], {'experience_source': 'None', 'buffer_size': 'self.params.BATCH_SIZE'}), '(experience_source=None, buffer_size=\n self.params.BATCH_SIZE)\n', (754, 819), False, 'from codes.e_utils import replay_buffer\n'...
# %% import os from tqdm import tqdm import numpy as np import pandas as pd import argparse import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras import losses from tensorflow.keras import optimizers from tensorflow.keras.callbacks import ModelCheckpoint, Learnin...
[ "numpy.load", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv1D", "tensorflow.keras.Input", "tensorflow.keras.backend.clear_session", "tensorflow.keras.layers.GlobalMaxPooling1D", "tensorflow.keras.layers.PReLU", "tensorflow.keras.Model", "tensorfl...
[((1023, 1069), 'numpy.load', 'np.load', (['"""tmp/inputs_0.npy"""'], {'allow_pickle': '(True)'}), "('tmp/inputs_0.npy', allow_pickle=True)\n", (1030, 1069), True, 'import numpy as np\n'), ((1091, 1137), 'numpy.load', 'np.load', (['"""tmp/inputs_1.npy"""'], {'allow_pickle': '(True)'}), "('tmp/inputs_1.npy', allow_pickl...
import numpy as np from PIL import Image, ImageOps, ImageEnhance from pysot.utils.bbox import center2corner, Center , Corner ,corner2center import math # ImageNet code should change this value PI=3.1415926 def center_ro(cx,cy,px,py,a): a=-2*PI/360*a x= (px - cx)*math.cos(a) - (py - cy)*math.sin(a) + cx y=...
[ "numpy.random.uniform", "numpy.uint8", "PIL.ImageEnhance.Brightness", "PIL.ImageOps.solarize", "PIL.ImageEnhance.Color", "PIL.ImageEnhance.Contrast", "numpy.ones", "math.sin", "pysot.utils.bbox.Center", "PIL.ImageEnhance.Sharpness", "numpy.random.random", "numpy.array", "PIL.ImageOps.equaliz...
[((1238, 1272), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(0.1)', 'high': 'n'}), '(low=0.1, high=n)\n', (1255, 1272), True, 'import numpy as np\n'), ((1771, 1790), 'pysot.utils.bbox.corner2center', 'corner2center', (['bbox'], {}), '(bbox)\n', (1784, 1790), False, 'from pysot.utils.bbox import center2co...
import tensorflow as tf import numpy as np from sciml_bench.benchmarks.em_denoise.model import autoencoder def test_autoencoder(): model = autoencoder((128, 128, 1)) assert isinstance(model, tf.keras.Model) assert model.input_shape == (None, 128, 128, 1) assert model.output_shape == (None, 128, 128, ...
[ "sciml_bench.benchmarks.em_denoise.model.autoencoder", "numpy.random.random" ]
[((145, 171), 'sciml_bench.benchmarks.em_denoise.model.autoencoder', 'autoencoder', (['(128, 128, 1)'], {}), '((128, 128, 1))\n', (156, 171), False, 'from sciml_bench.benchmarks.em_denoise.model import autoencoder\n'), ((374, 400), 'sciml_bench.benchmarks.em_denoise.model.autoencoder', 'autoencoder', (['(128, 128, 1)']...
""" File: pylinex/expander/PadExpander.py Author: <NAME> Date: 3 Sep 2017 Description: File containing class representing an Expander which expands the data by padding it with zeros (or any other value). """ import numpy as np from ..util import int_types, numerical_types from .Expander import Expander tr...
[ "numpy.zeros", "numpy.ones", "numpy.identity", "numpy.arange", "numpy.concatenate" ]
[((2091, 2135), 'numpy.zeros', 'np.zeros', (['(pads_before, original_space_size)'], {}), '((pads_before, original_space_size))\n', (2099, 2135), True, 'import numpy as np\n'), ((2157, 2200), 'numpy.zeros', 'np.zeros', (['(pads_after, original_space_size)'], {}), '((pads_after, original_space_size))\n', (2165, 2200), Tr...
import numpy as np from scipy import signal import math import skimage.measure import copy from PIL import Image import os def loadimage(nom): im = Image.open(nom).convert('L') return (np.array(im).flatten() / 255) PERSISTANCE = 0.05 pathCroix = 'DATAIN\\CROIX\\' pathRond = 'DATAIN\\ROND\\' ...
[ "numpy.maximum", "os.walk", "numpy.zeros", "numpy.expand_dims", "PIL.Image.open", "numpy.rot90", "numpy.array", "numpy.exp", "numpy.reshape", "numpy.random.rand", "numpy.dot", "numpy.sqrt", "scipy.signal.convolve", "numpy.ndarray.flatten" ]
[((367, 385), 'os.walk', 'os.walk', (['pathCroix'], {}), '(pathCroix)\n', (374, 385), False, 'import os\n'), ((503, 520), 'os.walk', 'os.walk', (['pathRond'], {}), '(pathRond)\n', (510, 520), False, 'import os\n'), ((795, 814), 'numpy.maximum', 'np.maximum', (['x', '(0)', 'x'], {}), '(x, 0, x)\n', (805, 814), True, 'im...
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of exma (https://github.com/fernandezfran/exma/). # Copyright (c) 2021, <NAME> # License: MIT # Full Text: https://github.com/fernandezfran/exma/blob/master/LICENSE # ============================================================================ # IMPO...
[ "numpy.full", "numpy.testing.assert_array_equal", "pytest.raises", "numpy.array", "numpy.testing.assert_array_almost_equal" ]
[((729, 744), 'numpy.full', 'np.full', (['(3)', '(1.0)'], {}), '(3, 1.0)\n', (736, 744), True, 'import numpy as np\n'), ((756, 806), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5]'], {}), '([0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5])\n', (764, 806), True, 'import numpy as np\n'), ((818, 868), 'num...
from baconian.common.spaces.base import Space import numpy as np from typeguard import typechecked from baconian.core.parameters import Parameters from baconian.common.schedules import Scheduler class ExplorationStrategy(object): def __init__(self): self.parameters = None def predict(self, **kwargs):...
[ "numpy.random.random" ]
[((958, 976), 'numpy.random.random', 'np.random.random', ([], {}), '()\n', (974, 976), True, 'import numpy as np\n')]
""" ==================================== Comparing Linear Bayesian Regressors ==================================== This example compares two different bayesian regressors: - a :ref:`automatic_relevance_determination` - a :ref:`bayesian_ridge_regression` In the first part, we use an :ref:`ordinary_least_squares` (O...
[ "matplotlib.pyplot.title", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.figure", "numpy.sin", "matplotlib.pyplot.tight_layout", "matplotlib.colors.SymLogNorm", "pandas.DataFrame", "sklearn.datasets.make_regression", "numpy.random.RandomState", "numpy.linspace", "sklearn.linear_mode...
[((1487, 1592), 'sklearn.datasets.make_regression', 'make_regression', ([], {'n_samples': '(100)', 'n_features': '(100)', 'n_informative': '(10)', 'noise': '(8)', 'coef': '(True)', 'random_state': '(42)'}), '(n_samples=100, n_features=100, n_informative=10, noise=8,\n coef=True, random_state=42)\n', (1502, 1592), Fa...
import math import numpy as np import torch from collections import defaultdict from hover.utils.torch_helper import cross_entropy_with_probs def loss_coteaching_directed(y_student, y_teacher, target, forget_rate): """ Subroutine for loss_coteaching_graph. """ num_remember = math.ceil((1 - forget_rate...
[ "torch.cat", "numpy.not_equal", "collections.defaultdict", "numpy.argsort", "numpy.mean", "hover.utils.torch_helper.cross_entropy_with_probs" ]
[((475, 536), 'hover.utils.torch_helper.cross_entropy_with_probs', 'cross_entropy_with_probs', (['y_teacher', 'target'], {'reduction': '"""none"""'}), "(y_teacher, target, reduction='none')\n", (499, 536), False, 'from hover.utils.torch_helper import cross_entropy_with_probs\n'), ((906, 923), 'collections.defaultdict',...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Run some experiments and visualize the results. """ from mdso import SpectralOrdering, SimilarityMatrix, evaluate_ordering import numpy as np import matplotlib.pyplot as plt # Set parameters for data generation n = 500 # size of matrix type_noise = 'gaussian' # dis...
[ "matplotlib.pyplot.savefig", "mdso.SimilarityMatrix", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "numpy.argsort", "mdso.evaluate_ordering", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotl...
[((1086, 1104), 'mdso.SimilarityMatrix', 'SimilarityMatrix', ([], {}), '()\n', (1102, 1104), False, 'from mdso import SpectralOrdering, SimilarityMatrix, evaluate_ordering\n'), ((1287, 1423), 'mdso.SpectralOrdering', 'SpectralOrdering', ([], {'n_components': 'n_components', 'k_nbrs': 'k_nbrs', 'circular': 'circular', '...
from distutils.core import setup,Extension from Cython.Build import cythonize import numpy setup( ext_modules = [Extension('_adjustments',['_adjustments.c'], include_dirs = [numpy.get_include()] )], ) setup( ext_modules=cythonize('_adjustments.pyx'), include_dirs = [numpy.get_include()]...
[ "Cython.Build.cythonize", "numpy.get_include" ]
[((251, 280), 'Cython.Build.cythonize', 'cythonize', (['"""_adjustments.pyx"""'], {}), "('_adjustments.pyx')\n", (260, 280), False, 'from Cython.Build import cythonize\n'), ((300, 319), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (317, 319), False, 'import numpy\n'), ((191, 210), 'numpy.get_include', 'n...
#!/usr/bin/env python3 import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np import os import pandas as pd import sqlalchemy import yaml from gzip import zlib from pickle import loads ref_time = 3.0 benchmarks = {'bnn': 'BNN', 'spam-filter': 'Spam filter', '3d-rendering': '3D renderin...
[ "numpy.mean", "yaml.safe_load", "matplotlib.pyplot.gca", "pandas.set_option", "pandas.DataFrame", "matplotlib.pyplot.setp", "matplotlib.ticker.FixedLocator", "matplotlib.pyplot.rcParams.update", "pandas.read_sql_query", "pickle.loads", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "o...
[((463, 502), 'pandas.set_option', 'pd.set_option', (['"""display.max_rows"""', 'None'], {}), "('display.max_rows', None)\n", (476, 502), True, 'import pandas as pd\n'), ((783, 803), 'yaml.safe_load', 'yaml.safe_load', (['data'], {}), '(data)\n', (797, 803), False, 'import yaml\n'), ((881, 915), 'sqlalchemy.create_engi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 23 09:50:28 2017 @author: smullally """ import sys import os import time import re import json import mastAPITools as api try: # Python 3.x from urllib.parse import quote as urlencode from urllib.request import urlretrieve except ImportErr...
[ "pandas.DataFrame.from_dict", "json.loads", "astropy.time.Time", "pprint.PrettyPrinter", "numpy.int", "mastAPITools.mastQuery", "numpy.array", "mastAPITools.retrieveMastData", "mastAPITools.targetNameConeSearch" ]
[((604, 634), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'indent': '(4)'}), '(indent=4)\n', (624, 634), False, 'import pprint\n'), ((1294, 1324), 'mastAPITools.mastQuery', 'api.mastQuery', (['resolverRequest'], {}), '(resolverRequest)\n', (1307, 1324), True, 'import mastAPITools as api\n'), ((1343, 1375), 'j...
""" Harvard CS286 Final Project, Fall 2020. Data structures for simulation of autonomous vehicle controllers presented by <NAME> al. (2019): 'Feedback Control Algorithms for the Dissipation of Traffic Waves with Autonomous Vehicles' https://doi.org/10.1007/978-3-030-25446-9_12 """ import warnings import random import...
[ "pandas.DataFrame", "controllers.LearningController", "numpy.ceil", "controllers.Controller", "numpy.random.RandomState", "matplotlib.pyplot.Rectangle", "warnings.warn", "numpy.isclose", "matplotlib.pyplot.figure", "random.seed", "controllers.BandoFTL", "random.gauss", "controllers.PID", "...
[((1866, 1901), 'numpy.isclose', 'np.isclose', (['s', 'o'], {'atol': 'Position.TOL'}), '(s, o, atol=Position.TOL)\n', (1876, 1901), True, 'import numpy as np\n'), ((6667, 6694), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (6688, 6694), True, 'import numpy as np\n'), ((6723, 6740), '...
# -*- coding: utf-8 -*- '''Implementation of TransD.''' import numpy as np import torch import torch.autograd import torch.nn as nn from keen.constants import * ''' TODO: Check, whether it makes sense to integrate identity matrices. ''' class TransD(nn.Module): def __init__(self, config): super(Trans...
[ "torch.norm", "torch.nn.Embedding", "torch.mul", "torch.einsum", "torch.nn.MarginRankingLoss", "torch.cuda.is_available", "torch.tensor", "numpy.repeat" ]
[((895, 965), 'torch.nn.Embedding', 'nn.Embedding', (['self.num_entities', 'self.entity_embedding_dim'], {'max_norm': '(1)'}), '(self.num_entities, self.entity_embedding_dim, max_norm=1)\n', (907, 965), True, 'import torch.nn as nn\n'), ((1001, 1074), 'torch.nn.Embedding', 'nn.Embedding', (['self.num_relations', 'self....
import matplotlib.pyplot as plt import matplotlib import numpy as np mat_dim = [10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000] cuda_10 = np.array([ 0.200874667, 0.355701333, 0.825088, 1.690432, 3.307168, 8.166197333, 17.14825567, 32.63356933, 111.283745, 484.6938273, 2846.308431]) cuda_10 /= 1000 mkl_10 ...
[ "matplotlib.pyplot.xscale", "matplotlib.pyplot.xlim", "matplotlib.pyplot.yscale", "matplotlib.rc", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.array", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig" ]
[((151, 304), 'numpy.array', 'np.array', (['[0.200874667, 0.355701333, 0.825088, 1.690432, 3.307168, 8.166197333, \n 17.14825567, 32.63356933, 111.283745, 484.6938273, 2846.308431]'], {}), '([0.200874667, 0.355701333, 0.825088, 1.690432, 3.307168, \n 8.166197333, 17.14825567, 32.63356933, 111.283745, 484.6938273,...
import numpy as np import imageio from pathlib import Path import multiprocessing as mp from starfish import data, FieldOfView from starfish.types import Axes, Features from starfish.image import Filter from starfish.core.imagestack.imagestack import ImageStack from starfish.spots import DecodeSpots, FindSpots from st...
[ "numpy.stack", "starfish.Codebook.synthetic_one_hot_codebook", "numpy.copy", "numpy.log", "starfish.spots.FindSpots.LocalMaxPeakFinder", "imageio.imsave", "numpy.zeros", "starfish.image.Filter.GaussianHighPass", "numpy.percentile", "starfish.spots.DecodeSpots.PerRoundMaxChannel", "pathlib.Path",...
[((520, 557), 'pathlib.Path', 'Path', (['workspace_directory', '"""stitched"""'], {}), "(workspace_directory, 'stitched')\n", (524, 557), False, 'from pathlib import Path\n'), ((581, 620), 'pathlib.Path', 'Path', (['workspace_directory', '"""spots_only"""'], {}), "(workspace_directory, 'spots_only')\n", (585, 620), Fal...
import numpy as np from skorch import NeuralNet, NeuralNetRegressor from skorch.callbacks import EpochScoring, ProgressBar from skorch.helper import predefined_split from skorch.utils import to_numpy from sklearn.base import TransformerMixin from braindecode import EEGClassifier, EEGRegressor class EEGTransformer(...
[ "skorch.utils.to_numpy", "numpy.concatenate" ]
[((877, 899), 'numpy.concatenate', 'np.concatenate', (['out', '(0)'], {}), '(out, 0)\n', (891, 899), True, 'import numpy as np\n'), ((840, 854), 'skorch.utils.to_numpy', 'to_numpy', (['outs'], {}), '(outs)\n', (848, 854), False, 'from skorch.utils import to_numpy\n')]
import logging import numpy as np import cv2 import easyocr from skimage.segmentation import clear_border import onnxruntime import logging as log class Inference_engine: def __init__(self, input_image, detector_model, nlp_model, detector_conf=0.1, nlp_conf=0.4, iou_thresh=0.5): self.input_img = input_ima...
[ "numpy.minimum", "numpy.maximum", "numpy.argmax", "cv2.cvtColor", "cv2.getStructuringElement", "cv2.morphologyEx", "numpy.transpose", "numpy.expand_dims", "onnxruntime.InferenceSession", "cv2.imread", "skimage.segmentation.clear_border", "numpy.max", "numpy.array", "logging.info", "numpy...
[((7465, 7505), 'onnxruntime.InferenceSession', 'onnxruntime.InferenceSession', (['Model_path'], {}), '(Model_path)\n', (7493, 7505), False, 'import onnxruntime\n'), ((7542, 7564), 'easyocr.Reader', 'easyocr.Reader', (["['en']"], {}), "(['en'])\n", (7556, 7564), False, 'import easyocr\n'), ((7580, 7602), 'easyocr.Reade...
__author__ = 'edill' from pprint import pprint from atom.api import Atom, Str, observe, Typed import numpy as np class XRF(Atom): folder_name = Str() file_name = Str() data = Typed(object) @observe('folder_name', 'file_name') def update(self, changed): pprint(changed) if changed['...
[ "atom.api.Str", "atom.api.observe", "atom.api.Typed", "numpy.loadtxt", "pprint.pprint" ]
[((150, 155), 'atom.api.Str', 'Str', ([], {}), '()\n', (153, 155), False, 'from atom.api import Atom, Str, observe, Typed\n'), ((172, 177), 'atom.api.Str', 'Str', ([], {}), '()\n', (175, 177), False, 'from atom.api import Atom, Str, observe, Typed\n'), ((189, 202), 'atom.api.Typed', 'Typed', (['object'], {}), '(object)...
import pyscipopt from pyscipopt import Model import ecole import numpy import matplotlib.pyplot as plt import pathlib from localbranching import addLBConstraint from geco.mips.loading.miplib import Loader from event import PrimalBoundChangeEventHandler modes = ['improve-supportbinvars', 'improve-binvars'] mode = mode...
[ "event.PrimalBoundChangeEventHandler", "geco.mips.loading.miplib.Loader", "numpy.load", "pathlib.Path" ]
[((486, 543), 'numpy.load', 'numpy.load', (['"""./result/miplib2017/miplib2017_binary39.npz"""'], {}), "('./result/miplib2017/miplib2017_binary39.npz')\n", (496, 543), False, 'import numpy\n'), ((801, 832), 'event.PrimalBoundChangeEventHandler', 'PrimalBoundChangeEventHandler', ([], {}), '()\n', (830, 832), False, 'fro...
import os import argparse import numpy as np import baseline as bl parser = argparse.ArgumentParser(description='Embed text and save to a .npy') parser.add_argument('--model', help='An embedding model', required=True, type=str) parser.add_argument('--text', help='raw value', type=str) parser.add_argument('--backend', ...
[ "numpy.save", "argparse.ArgumentParser", "os.path.exists", "os.path.isfile", "os.path.splitext", "baseline.EmbeddingsService.load" ]
[((77, 145), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Embed text and save to a .npy"""'}), "(description='Embed text and save to a .npy')\n", (100, 145), False, 'import argparse\n'), ((1029, 1171), 'baseline.EmbeddingsService.load', 'bl.EmbeddingsService.load', (['args.model'], {'b...
import os, gzip, csv, torch, cv2, torchvision, random import torch.nn as nn import numpy as np import scipy.ndimage as ndi import scipy.misc import imageio import matplotlib.pyplot as plt from torchvision import datasets, transforms from collections import defaultdict IMG_HEIGHT, IMG_WIDTH = 400, 400 patch_size = 128 ...
[ "cv2.GaussianBlur", "numpy.load", "numpy.random.seed", "cv2.medianBlur", "random.shuffle", "cv2.adaptiveThreshold", "numpy.sin", "torchvision.models.resnet34", "matplotlib.pyplot.tight_layout", "os.path.join", "imageio.mimsave", "torch.flatten", "numpy.zeros_like", "cv2.cvtColor", "matpl...
[((327, 358), 'numpy.array', 'np.array', (['[0.485, 0.456, 0.406]'], {}), '([0.485, 0.456, 0.406])\n', (335, 358), True, 'import numpy as np\n'), ((365, 396), 'numpy.array', 'np.array', (['[0.229, 0.224, 0.225]'], {}), '([0.229, 0.224, 0.225])\n', (373, 396), True, 'import numpy as np\n'), ((481, 525), 'torchvision.mod...
# -*- coding: utf-8 -*- """ Created on Mon Oct 14 13:05:23 2019 @author: Yuki-F """ import scipy.signal as signal import warnings import scipy as sp import numpy as np from typing import List, Tuple import sys def impz(system:tuple, n:int=None, fs:int=1)->Tuple: """ Impulse response of a digi...
[ "matplotlib.pyplot.title", "numpy.roots", "numpy.abs", "matplotlib.pyplot.figure", "numpy.arange", "numpy.round", "scipy.angle", "scipy.signal.lfilter", "scipy.signal.dlti", "matplotlib.pyplot.yticks", "numpy.max", "matplotlib.pyplot.xticks", "scipy.signal.butter", "scipy.signal.dimpulse",...
[((3869, 3921), 'scipy.signal.freqz', 'signal.freqz', (['system[0]', 'system[1]'], {'worN': 'worN', 'fs': 'fs'}), '(system[0], system[1], worN=worN, fs=fs)\n', (3881, 3921), True, 'import scipy.signal as signal\n'), ((5854, 5895), 'scipy.signal.group_delay', 'signal.group_delay', (['system'], {'w': 'worN', 'fs': 'fs'})...
import os import sys import cv2 import numpy as np x_ps = [] y_ps = [] run_time = 120 # initialization ONLINE = True CALIBRATE = False HD = 1280, 640 BGR_COLOR = {'red': (0, 0, 255), 'green': (127, 255, 0), 'blue': (255, 127, 0), 'yellow': (0, 127, 255), 'black': (0...
[ "cv2.GaussianBlur", "cv2.approxPolyDP", "cv2.arcLength", "cv2.fillPoly", "cv2.imshow", "cv2.warpPerspective", "numpy.zeros_like", "cv2.subtract", "cv2.contourArea", "cv2.cvtColor", "os.path.exists", "cv2.namedWindow", "cv2.setMouseCallback", "numpy.reshape", "cv2.drawContours", "cv2.de...
[((421, 432), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (429, 432), True, 'import numpy as np\n'), ((993, 1011), 'numpy.array', 'np.array', (['[[0, 0]]'], {}), '([[0, 0]])\n', (1001, 1011), True, 'import numpy as np\n'), ((1182, 1209), 'cv2.VideoCapture', 'cv2.VideoCapture', (['file_name'], {}), '(file_name)\n...
#!/usr/bin/env python """ Created on Wed Apr 19 15:29:27 2017 @author: bernier2 """ import h5py from matplotlib import pyplot as plt import numpy as np from hexrd.instrument import centers_of_edge_vec """ # UNCOMMENT IF YOU HAVE A SANE LATEX ENV AND WANT NICE FIG LABELS # # Options params = {'text.usetex': True, ...
[ "hexrd.instrument.centers_of_edge_vec", "h5py.File", "matplotlib.pyplot.show", "argparse.ArgumentParser", "numpy.degrees", "numpy.zeros", "numpy.transpose", "numpy.ones", "numpy.shape", "numpy.min", "numpy.array", "numpy.tile", "matplotlib.pyplot.subplots", "numpy.sqrt" ]
[((738, 749), 'numpy.shape', 'np.shape', (['X'], {}), '(X)\n', (746, 749), True, 'import numpy as np\n'), ((962, 988), 'numpy.zeros', 'np.zeros', (['(mm * m, nn * n)'], {}), '((mm * m, nn * n))\n', (970, 988), True, 'import numpy as np\n'), ((3747, 3766), 'numpy.degrees', 'np.degrees', (['tth_crd'], {}), '(tth_crd)\n',...
import numpy as np import json class Pfpr: """ False Positive Rate UCID """ def __init__(self): pass def run(self, blocksize=64, t_list=[0.9888]): with open('modules/figure4/ucid/ucid_cc_dict_%d.json' % blocksize, 'r') as f: ucid_cc_dict = json.loads(f.read()) ...
[ "numpy.append", "numpy.array" ]
[((339, 372), 'numpy.array', 'np.array', (["ucid_cc_dict['cc_list']"], {}), "(ucid_cc_dict['cc_list'])\n", (347, 372), True, 'import numpy as np\n'), ((1168, 1204), 'numpy.append', 'np.append', (['copydays_cc_list', 'cc_list'], {}), '(copydays_cc_list, cc_list)\n', (1177, 1204), True, 'import numpy as np\n')]
import numpy as np def cofiCostFunc(params, Y, R, num_users, num_movies, num_features, lambda_): """returns the cost and gradient for the collaborative filtering problem. """ # Unfold the U and W matrices from params X = np.reshape( params[:num_movies * num_features], (num_movies, num_feature...
[ "numpy.dot", "numpy.sum", "numpy.transpose", "numpy.reshape" ]
[((240, 329), 'numpy.reshape', 'np.reshape', (['params[:num_movies * num_features]', '(num_movies, num_features)'], {'order': '"""F"""'}), "(params[:num_movies * num_features], (num_movies, num_features),\n order='F')\n", (250, 329), True, 'import numpy as np\n'), ((355, 443), 'numpy.reshape', 'np.reshape', (['param...
""" Library for representing 3D volumetric CT scan data and manipulating them by resampling, etc. """ from __future__ import print_function import sys, os import numpy as np import scipy.ndimage.interpolation as interpolation import transforms3d.affines as affine3d import copy def map_coords_to_scaled_float(coords, o...
[ "copy.deepcopy", "h5py.File", "transforms3d.affines.decompose44", "os.makedirs", "os.path.basename", "os.path.isdir", "os.path.dirname", "numpy.transpose", "scipy.ndimage.interpolation.zoom", "numpy.array", "os.path.splitext", "load_dicom_dir.load_dicom_dir_dicom_orientation", "numpy.eye", ...
[((15937, 15948), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (15945, 15948), False, 'import sys, os\n'), ((5501, 5547), 'load_dicom_dir.load_dicom_dir_dicom_orientation', 'ldd.load_dicom_dir_dicom_orientation', (['dicomdir'], {}), '(dicomdir)\n', (5537, 5547), True, 'import load_dicom_dir as ldd\n'), ((7257, 7289)...
"""Distance metrics related to common features of receptor-ligand processes in molecular systems. The ReceptorDistance class is an abstract class that provides some common functionality for normalizing reference states, providing correct indices of receptor and ligand atoms, and a common image function. Subclasses of...
[ "geomm.grouping.group_pair", "geomm.superimpose.superimpose", "geomm.rmsd.calc_rmsd", "numpy.arange", "wepy.util.util.box_vectors_to_lengths_angles", "numpy.concatenate", "geomm.centering.center_around" ]
[((2756, 2803), 'numpy.concatenate', 'np.concatenate', (['(self._lig_idxs, self._bs_idxs)'], {}), '((self._lig_idxs, self._bs_idxs))\n', (2770, 2803), True, 'import numpy as np\n'), ((2905, 2933), 'numpy.arange', 'np.arange', (['self._n_lig_atoms'], {}), '(self._n_lig_atoms)\n', (2914, 2933), True, 'import numpy as np\...
import logging from copy import copy import numpy as np import matplotlib.pyplot as plt from scipy import interpolate logger = logging.getLogger(__name__) class BraggPeak(object): def __init__(self, bp_domain, bp_vals): """ BraggPeak object is a function created from bp_domain and bp_vals ...
[ "matplotlib.pyplot.show", "scipy.interpolate.InterpolatedUnivariateSpline", "matplotlib.pyplot.plot", "numpy.abs", "copy.copy", "numpy.arange", "numpy.array", "beprof.profile.Profile", "numpy.vstack", "os.path.join", "logging.getLogger" ]
[((129, 156), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (146, 156), False, 'import logging\n'), ((4546, 4565), 'beprof.profile.Profile', 'profile.Profile', (['yy'], {}), '(yy)\n', (4561, 4565), False, 'from beprof import profile\n'), ((4903, 4932), 'matplotlib.pyplot.plot', 'plt.plot...
#!/usr/bin/env python3 import cv2 import csv import sys import numpy as np import net.preprocessing.preprocess as p import concurrent.futures LANDMARKS_MODEL_PATH = 'landmarks\\shape_predictor_68_face_landmarks.dat' def get_landmarks_metadata(landmark_file): landmarks = [] with open(landmark_file) as csv_f...
[ "net.preprocessing.preprocess.get_faces", "net.preprocessing.preprocess.preprocess", "csv.reader", "cv2.imwrite", "cv2.imread", "numpy.max", "numpy.mean", "numpy.array", "numpy.linalg.norm", "numpy.min" ]
[((459, 478), 'numpy.array', 'np.array', (['landmarks'], {}), '(landmarks)\n', (467, 478), True, 'import numpy as np\n'), ((574, 613), 'cv2.imread', 'cv2.imread', (["(input_folder + '/' + img_id)"], {}), "(input_folder + '/' + img_id)\n", (584, 613), False, 'import cv2\n'), ((626, 642), 'net.preprocessing.preprocess.ge...
################################################## # Train a RAW-to-RGB model using training images # ################################################## import tensorflow as tf from tensorflow.keras.utils import Progbar import imageio import numpy as np import sys from datetime import datetime from load_dataset impor...
[ "numpy.random.seed", "vgg.preprocess", "load_dataset.load_val_data_exp", "tensorflow.image.psnr", "tensorflow.image.ssim", "numpy.random.randint", "load_dataset.load_train_patch_exp", "numpy.rot90", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.placeholder", "tensorf...
[((807, 843), 'utils.process_command_args', 'utils.process_command_args', (['sys.argv'], {}), '(sys.argv)\n', (833, 843), False, 'import utils\n'), ((1257, 1274), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1271, 1274), True, 'import numpy as np\n'), ((1340, 1362), 'tensorflow.compat.v1.Session', 't...
import numpy as np import matplotlib.pyplot as plt import random # 由题目要求知道,这里的图用邻接矩阵来表示,而不是前向星 # 这个函数是返回ER图, 我们知道邻接矩阵中,每个位置都表示一个连接状态 def CreateER(N, p): mat = np.random.rand(N, N) mat = np.where(mat>p, 0, 1) for i in range(N): mat[i, i] = 0 mat[i, :] = mat[:, i] return mat # 创建BA网络 de...
[ "matplotlib.pyplot.show", "random.randint", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.zeros", "numpy.ones", "random.random", "numpy.histogram", "numpy.where", "numpy.array", "numpy.random.choice", "numpy.random.rand", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel...
[((165, 185), 'numpy.random.rand', 'np.random.rand', (['N', 'N'], {}), '(N, N)\n', (179, 185), True, 'import numpy as np\n'), ((196, 219), 'numpy.where', 'np.where', (['(mat > p)', '(0)', '(1)'], {}), '(mat > p, 0, 1)\n', (204, 219), True, 'import numpy as np\n'), ((352, 368), 'numpy.zeros', 'np.zeros', (['(N, N)'], {}...
import numpy as np import itertools def cindex_td(death_ages, survival_funcs, survival_ages, observed, weights = []): num = len(death_ages) pairs = itertools.permutations(range(0,num),2) if len(weights) == 0: weights = np.ones(num) N = 0.0 C = 0.0 for (i,j) in pairs: ...
[ "numpy.searchsorted", "numpy.ones" ]
[((245, 257), 'numpy.ones', 'np.ones', (['num'], {}), '(num)\n', (252, 257), True, 'import numpy as np\n'), ((455, 503), 'numpy.searchsorted', 'np.searchsorted', (['survival_ages[i]', 'death_ages[i]'], {}), '(survival_ages[i], death_ages[i])\n', (470, 503), True, 'import numpy as np\n'), ((526, 574), 'numpy.searchsorte...
import cv2 import numpy as np import json import asyncio import random import os from adapter import Adapter from flask import Flask, request, jsonify from nn_image_checker import NNModelChecker from PIL import Image from contract.config import config from contract.download_images import download_images as contract...
[ "os.mkdir", "nn_image_checker.NNModelChecker", "json.loads", "image_manager.ImageManager", "adapter.Adapter", "asyncio.set_event_loop", "flask.Flask", "cv2.imdecode", "os.path.exists", "contract.listen_images.listen_images", "flask.jsonify", "flask.request.get_data", "contract.get_contract.g...
[((873, 888), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (878, 888), False, 'from flask import Flask, request, jsonify\n'), ((905, 921), 'nn_image_checker.NNModelChecker', 'NNModelChecker', ([], {}), '()\n', (919, 921), False, 'from nn_image_checker import NNModelChecker\n'), ((938, 965), 'image_manage...
""" input: rescaled_ct scan with shape [512, 512, 512] output: removed airway, blood vessel and set the parenchyma value to 0, """ import Tool_Functions.Functions as Functions import visualization.visualize_3d.visualize_stl as visualize import os import numpy as np import post_processing.remove_airway_blood_vessel as e...
[ "numpy.sum", "numpy.clip", "prediction.predict_rescaled.predict_covid_19_infection_rescaled_array", "numpy.shape", "prediction.predict_rescaled.get_prediction_airway", "os.path.join", "numpy.set_printoptions", "prediction.predict_rescaled.predict_lung_masks_rescaled_array", "numpy.reshape", "predi...
[((400, 437), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.inf'}), '(threshold=np.inf)\n', (419, 437), True, 'import numpy as np\n'), ((1741, 1778), 'Tool_Functions.Functions.get_bounding_box', 'Functions.get_bounding_box', (['lung_mask'], {}), '(lung_mask)\n', (1767, 1778), True, 'import Too...
from diatom.Hamiltonian import vector_dot import numpy from scipy.linalg import block_diag ''' This module contains code that is incorrect beyond the diagonal elements of the Hamiltonian in N,MN and is left purely for legacy purposes. In almost all cicumstances the code in Hamiltonian is better. ''' def tensor_nucle...
[ "scipy.linalg.block_diag", "numpy.zeros", "diatom.Hamiltonian.vector_dot", "numpy.amax", "numpy.finfo", "numpy.argsort", "numpy.sort", "numpy.array" ]
[((1862, 1881), 'numpy.zeros', 'numpy.zeros', (['(1, 1)'], {}), '((1, 1))\n', (1873, 1881), False, 'import numpy\n'), ((3704, 3719), 'numpy.array', 'numpy.array', (['[]'], {}), '([])\n', (3715, 3719), False, 'import numpy\n'), ((3731, 3750), 'numpy.zeros', 'numpy.zeros', (['(1, 1)'], {}), '((1, 1))\n', (3742, 3750), Fa...
# this script uses Ewald summition to evaluate the substitution structure from pymatgen.core import Structure, Lattice from pymatgen.io.vasp.inputs import Incar from pymatgen.transformations.advanced_transformations import OrderDisorderedStructureTransformation import numpy as np # Phase Diagram will cover N...
[ "pymatgen.transformations.advanced_transformations.OrderDisorderedStructureTransformation", "pymatgen.io.vasp.inputs.Incar.from_file", "pymatgen.core.Structure", "pymatgen.analysis.structure_matcher.StructureMatcher", "pymatgen.core.Structure.from_file", "json.dumps", "numpy.array" ]
[((585, 622), 'pymatgen.core.Structure.from_file', 'Structure.from_file', (['poscar_file_path'], {}), '(poscar_file_path)\n', (604, 622), False, 'from pymatgen.core import Structure, Lattice\n'), ((1415, 1439), 'pymatgen.io.vasp.inputs.Incar.from_file', 'Incar.from_file', (['"""INCAR"""'], {}), "('INCAR')\n", (1430, 14...
from argparse import ArgumentParser from typing import List, Optional, Tuple import numpy as np from numpy.random import RandomState from rlai.actions import Action from rlai.agents import Agent from rlai.environments import Environment from rlai.meta import rl_text from rlai.runners.monitor import Monitor from rlai....
[ "rlai.utils.parse_arguments", "numpy.array", "rlai.actions.Action", "rlai.meta.rl_text" ]
[((412, 439), 'rlai.meta.rl_text', 'rl_text', ([], {'chapter': '(2)', 'page': '(25)'}), '(chapter=2, page=25)\n', (419, 439), False, 'from rlai.meta import rl_text\n'), ((1803, 1830), 'rlai.meta.rl_text', 'rl_text', ([], {'chapter': '(2)', 'page': '(28)'}), '(chapter=2, page=28)\n', (1810, 1830), False, 'from rlai.meta...
import numpy as np from numpy.linalg import multi_dot # discrete xkp1=fk(xk,uk,w,L) def fk(x,u,w,L): fk_out=np.array([x[2], x[3], (2*x[2]*x[3]*np.sin(x[1]) - w*np.sin(x[0]) + (u[1]*np.cos(x[0]))/L)/np.cos(x[1]), - np.cos(x[1])*np.sin(x[1])*np.square(x[...
[ "numpy.arctan2", "numpy.square", "numpy.sin", "numpy.array", "numpy.cos", "numpy.dot", "numpy.diag", "numpy.linalg.multi_dot" ]
[((2381, 2445), 'numpy.array', 'np.array', (['[[0.00377597, -0.00210312], [-0.00210312, 0.00125147]]'], {}), '([[0.00377597, -0.00210312], [-0.00210312, 0.00125147]])\n', (2389, 2445), True, 'import numpy as np\n'), ((2514, 2569), 'numpy.diag', 'np.diag', (['[3e-05, 3e-05, 0.0005, 0.0005, 0.0001, 0.0001]'], {}), '([3e-...
# Series 有索引, 可以用字典的方式, DataFrame: 每一列看作一个Series,培养按列构建数据的思维 import pandas as pd pd.__version__ import numpy as np from pandas import Series, DataFrame a = np.random.randn(5) print(a) s = Series(a,index=['a','b','c','d','e']) print(s) d = {'a':1,'b':2} s = Series(d) print(s) d = {'one':Series([1.0,2.0,3.0],inde...
[ "pandas.DataFrame", "pandas.Series", "numpy.random.randn" ]
[((159, 177), 'numpy.random.randn', 'np.random.randn', (['(5)'], {}), '(5)\n', (174, 177), True, 'import numpy as np\n'), ((192, 234), 'pandas.Series', 'Series', (['a'], {'index': "['a', 'b', 'c', 'd', 'e']"}), "(a, index=['a', 'b', 'c', 'd', 'e'])\n", (198, 234), False, 'from pandas import Series, DataFrame\n'), ((263...
import numpy as np import pickle import pandas as pd from sklearn.linear_model import LogisticRegression # Load true allusions pickle_off = open("../output/nietzsche/orderedTuples.pickle","rb") scoreTuples = pickle.load(pickle_off) trueAllusions=list() for tup in scoreTuples: trueAllusions.append(list(tup)) # ...
[ "pandas.DataFrame", "numpy.random.shuffle", "numpy.nan_to_num", "numpy.amin", "numpy.median", "numpy.zeros", "numpy.ones", "numpy.amax", "sklearn.linear_model.LogisticRegression", "pickle.load", "numpy.array", "numpy.mean", "numpy.delete", "numpy.concatenate" ]
[((210, 233), 'pickle.load', 'pickle.load', (['pickle_off'], {}), '(pickle_off)\n', (221, 233), False, 'import pickle\n'), ((422, 445), 'pickle.load', 'pickle.load', (['pickle_off'], {}), '(pickle_off)\n', (433, 445), False, 'import pickle\n'), ((529, 552), 'pickle.load', 'pickle.load', (['pickle_off'], {}), '(pickle_o...
# -*- coding: utf-8 -*- """ Created on Thu Oct 1 11:22:35 2015 @author: jmmauricio """ import numpy as np import xlrd import pandas as pd def losses(i_rms, m, fp, T_a, params): a_i = params['a_i'] b_i = params['b_i'] c_i = params['c_i'] d_i = params['d_i'] e_i = params['e_i'] a_d = params[...
[ "numpy.linalg.lstsq", "xlrd.open_workbook", "numpy.zeros", "numpy.hstack", "pandas.read_excel", "numpy.array", "numpy.linalg.solve", "numpy.sqrt" ]
[((4294, 4601), 'numpy.array', 'np.array', (['[[1, i_1, -i_1 * alpha_1, i_1 ** 2, -i_1 ** 2 * alpha_1], [1, i_2, -i_2 *\n alpha_2, i_2 ** 2, -i_2 ** 2 * alpha_2], [1, i_3, -i_3 * alpha_3, i_3 **\n 2, -i_3 ** 2 * alpha_3], [1, i_4, -i_4 * alpha_4, i_4 ** 2, -i_4 ** 2 *\n alpha_4], [1, i_5, -i_5 * alpha_5, i_5 *...
import numpy as np from ground.base import get_context context = get_context() Point, Segment = context.point_cls, context.segment_cls from bentley_ottmann.planar import segments_intersect from tqdm import tqdm import matplotlib.pylab as plt from matplotlib import collections as mc class LineSegmentSampling2D: ...
[ "numpy.random.uniform", "tqdm.tqdm", "ground.base.get_context", "bentley_ottmann.planar.segments_intersect", "numpy.sin", "numpy.cos", "numpy.random.rand" ]
[((65, 78), 'ground.base.get_context', 'get_context', ([], {}), '()\n', (76, 78), False, 'from ground.base import get_context\n'), ((629, 658), 'numpy.random.uniform', 'np.random.uniform', (['(0)', 'self.lx'], {}), '(0, self.lx)\n', (646, 658), True, 'import numpy as np\n'), ((672, 701), 'numpy.random.uniform', 'np.ran...