code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np from calculatearea import AreaEstimator from math import sqrt area_estimator = AreaEstimator(filename='rancho_rd.jpg', # name of the image in the directory color_range=((0, 0, 118), (100, 100, 255)), default_area_color=(255, 20, 160)) ...
[ "calculatearea.AreaEstimator", "numpy.array", "math.sqrt" ]
[((100, 222), 'calculatearea.AreaEstimator', 'AreaEstimator', ([], {'filename': '"""rancho_rd.jpg"""', 'color_range': '((0, 0, 118), (100, 100, 255))', 'default_area_color': '(255, 20, 160)'}), "(filename='rancho_rd.jpg', color_range=((0, 0, 118), (100, 100,\n 255)), default_area_color=(255, 20, 160))\n", (113, 222)...
import cv2 import numpy as np import random import matplotlib.pyplot as plt def similarity_transform(image, center, dim, angle=0.0, scale=1.0, clip=True): #similarity transform includes rotation+translation+scaling #it retains parallel and angles M = cv2.getRotationMatrix2D(center, angle, scale) (w,h,...
[ "cv2.imshow", "cv2.warpPerspective", "cv2.destroyAllWindows", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "cv2.waitKey", "random.randint", "numpy.abs", "cv2.warpAffine", "numpy.ones", "cv2.getPerspectiveTransform", "matplotlib.pyplot.gca", "matplotlib.pyplot.gcf", "cv2.getAffineTr...
[((265, 310), 'cv2.getRotationMatrix2D', 'cv2.getRotationMatrix2D', (['center', 'angle', 'scale'], {}), '(center, angle, scale)\n', (288, 310), False, 'import cv2\n'), ((777, 811), 'cv2.getAffineTransform', 'cv2.getAffineTransform', (['pts1', 'pts2'], {}), '(pts1, pts2)\n', (799, 811), False, 'import cv2\n'), ((849, 88...
from abc import abstractmethod, ABC import torch from dpm.distributions import ( Distribution, Normal, Data, GumbelSoftmax, ConditionalModel, Categorical ) from dpm.distributions import MixtureModel from dpm.train import train from dpm.criterion import cross_entropy, ELBO from torch.nn import Softmax, Modul...
[ "dpm.train.train", "torch.nn.Softmax", "torch.eye", "functools.partial", "dpm.criterion.ELBO", "dpm.distributions.Data", "torch.randn", "numpy.arange" ]
[((1003, 1010), 'dpm.distributions.Data', 'Data', (['x'], {}), '(x)\n', (1007, 1010), False, 'from dpm.distributions import Distribution, Normal, Data, GumbelSoftmax, ConditionalModel, Categorical\n'), ((1027, 1075), 'dpm.train.train', 'train', (['data', 'self.model', 'cross_entropy'], {}), '(data, self.model, cross_en...
""" PyTorch dataset classes for molecular data. """ import itertools from typing import Dict, List, Tuple, Union import numpy as np import torch from rdkit import Chem # noinspection PyUnresolvedReferences from rdkit.Chem import AllChem, rdmolops, rdPartialCharges, rdForceFieldHelpers, rdchem from scipy impor...
[ "torch.from_numpy", "numpy.isfinite", "numpy.arange", "rdkit.Chem.rdForceFieldHelpers.MMFFGetMoleculeProperties", "rdkit.Chem.rdchem.BondStereo.values.values", "rdkit.Chem.rdmolops.AssignStereochemistryFrom3D", "numpy.ones", "rdkit.Chem.GetPeriodicTable", "conformation.graph_data.Data", "conformat...
[((1794, 1832), 'torch.load', 'torch.load', (["self.metadata[idx]['path']"], {}), "(self.metadata[idx]['path'])\n", (1804, 1832), False, 'import torch\n'), ((2418, 2460), 'conformation.distance_matrix.distmat_to_vec', 'distmat_to_vec', (["self.metadata[idx]['path']"], {}), "(self.metadata[idx]['path'])\n", (2432, 2460)...
import sys import os import cv2 import glob import math from time import sleep, time import matplotlib matplotlib.use('agg') import numpy as np from time import time from nnlib import nnlib import matplotlib.pyplot as plt from facelib import S3FDExtractor, LandmarksExtractor class SlimFace(object): def __init__...
[ "nnlib.nnlib.import_all", "facelib.S3FDExtractor", "matplotlib.use", "facelib.LandmarksExtractor", "os.path.join", "math.sqrt", "cv2.imshow", "nnlib.nnlib.keras.models.load_model", "cv2.waitKey", "nnlib.nnlib.DeviceConfig", "math.fabs", "cv2.VideoCapture", "numpy.concatenate", "cv2.resize"...
[((103, 124), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (117, 124), False, 'import matplotlib\n'), ((11258, 11264), 'time.time', 'time', ([], {}), '()\n', (11262, 11264), False, 'from time import time\n'), ((11275, 11313), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""./media/jcdemo.mp4"""']...
import librosa import torch import torch.nn as nn import torch.nn.functional as F from torch import tensor as T import numpy as np from torch.nn.functional import conv1d import torchopenl3.core class CustomSTFT(nn.Module): """ STFT implemented like kapre 0.1.4. Attributes ---------- n_dft: int ...
[ "torch.nn.ZeroPad2d", "torch.nn.functional.conv1d", "torch.sqrt", "numpy.log", "torch.nn.BatchNorm1d", "torch.nn.functional.pad", "numpy.arange", "torch.nn.BatchNorm2d", "numpy.multiply", "torch.nn.BatchNorm3d", "torch.nn.Conv3d", "librosa.filters.mel", "torch.nn.functional.relu", "torch.n...
[((3277, 3332), 'librosa.filters.get_window', 'librosa.filters.get_window', (['"""hann"""', 'n_dft'], {'fftbins': '(True)'}), "('hann', n_dft, fftbins=True)\n", (3303, 3332), False, 'import librosa\n'), ((3509, 3550), 'numpy.multiply', 'np.multiply', (['dft_real_kernels', 'dft_window'], {}), '(dft_real_kernels, dft_win...
from torch import nn as nn from torch.nn import functional as F from torch.nn.utils import spectral_norm import torch from torch import nn as nn from torch.nn import functional as F from torch.nn.utils import spectral_norm from basicsr.utils.registry import ARCH_REGISTRY import torch class add_attn(nn.Module): ...
[ "numpy.uint8", "os.path.exists", "torch.nn.BatchNorm2d", "cv2.imwrite", "argparse.ArgumentParser", "torch.load", "torch.nn.Conv2d", "shutil.rmtree", "torch.nn.AvgPool2d", "numpy.squeeze", "os.mkdir", "torch.nn.functional.interpolate", "torch.nn.functional.relu", "torch.nn.functional.pad", ...
[((5411, 5436), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5434, 5436), False, 'import argparse\n'), ((6116, 6135), 'cv2.imread', 'cv2.imread', (['imgpath'], {}), '(imgpath)\n', (6126, 6135), False, 'import cv2\n'), ((573, 659), 'torch.nn.Conv2d', 'nn.Conv2d', (['x_channels', 'x_channels']...
""" Runs a model on a single node across N-gpus. """ import os from argparse import ArgumentParser import pathlib import numpy as np import torch import pytorch_lightning as pl from lightning_models import LightningModel from pytorch_lightning import Trainer from pytorch_lightning.callbacks import EarlyStopping, Mode...
[ "pytorch_lightning.callbacks.ModelCheckpoint", "pytorch_lightning.callbacks.EarlyStopping", "lightning_models.LightningModel", "argparse.ArgumentParser", "pathlib.Path", "pytorch_lightning.seed_everything", "pytorch_lightning.profiler.AdvancedProfiler", "lightning_models.LightningModel.add_model_speci...
[((650, 672), 'pathlib.Path', 'pathlib.Path', (['exp_path'], {}), '(exp_path)\n', (662, 672), False, 'import pathlib\n'), ((1015, 1038), 'pathlib.Path', 'pathlib.Path', (['ckpt_path'], {}), '(ckpt_path)\n', (1027, 1038), False, 'import pathlib\n'), ((1365, 1388), 'pathlib.Path', 'pathlib.Path', (['prof_path'], {}), '(p...
import json import logging import math import os import pathlib import subprocess import numpy as np import shapely.geometry import shapely.affinity import venn7.bezier ROOT = pathlib.Path(os.path.realpath(__file__)).parent class VennDiagram: """A simple symmetric monotone Venn diagram. The diagram is encoded ...
[ "json.loads", "json.dumps", "numpy.hypot", "os.path.realpath", "numpy.array", "math.cos", "numpy.arctan2", "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlim", "math.sin", "math.comb", "matplotlib.pyplot.subplots", "json.dump", "matplotlib.pyplot.show" ]
[((192, 218), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (208, 218), False, 'import os\n'), ((5641, 5667), 'json.loads', 'json.loads', (['process.stdout'], {}), '(process.stdout)\n', (5651, 5667), False, 'import json\n'), ((6138, 6152), 'matplotlib.pyplot.subplots', 'plt.subplots', ([],...
#!/usr/bin/env python import click as ck import numpy as np import pandas as pd import gzip import os import torch as th from collections import Counter from aminoacids import MAXLEN, to_ngrams import logging import json from sklearn.metrics import roc_curve, auc, matthews_corrcoef from utils import get_goplus_defs,...
[ "logging.basicConfig", "pandas.read_pickle", "numpy.mean", "click.option", "sklearn.metrics.auc", "torch.load", "numpy.sum", "deepgoel.load_normal_forms", "torch_utils.FastTensorDataLoader", "utils.Ontology", "utils.get_goplus_defs", "click.command" ]
[((343, 382), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (362, 382), False, 'import logging\n'), ((493, 505), 'click.command', 'ck.command', ([], {}), '()\n', (503, 505), True, 'import click as ck\n'), ((507, 574), 'click.option', 'ck.option', (['"""--data-r...
import os import torch import create_data from model import shape_net import numpy as np def align_bone_len(opt_, pre_): opt = opt_.copy() pre = pre_.copy() opt_align = opt.copy() for i in range(opt.shape[0]): ratio = pre[i][6] / opt[i][6] opt_align[i] = ratio * opt_align[i] ...
[ "numpy.abs", "model.shape_net.ShapeNet", "torch.Tensor", "os.path.join", "create_data.DataSet", "numpy.load" ]
[((688, 708), 'model.shape_net.ShapeNet', 'shape_net.ShapeNet', ([], {}), '()\n', (706, 708), False, 'from model import shape_net\n'), ((923, 968), 'create_data.DataSet', 'create_data.DataSet', ([], {'_mano_root': '"""mano/models"""'}), "(_mano_root='mano/models')\n", (942, 968), False, 'import create_data\n'), ((747, ...
import numpy as np raw = open("inputs/7.txt","r").readline() input_array= [int(i) for i in np.asarray(raw.split(","))] test_array = [16,1,2,0,4,2,7,1,2,14] def alignCrabsPartOne(input): result_array=[] for i in range(min(input), max(input)+1): result_array.append(sum([abs((horizontalPos-i)) for horizontalPos in i...
[ "numpy.amin" ]
[((439, 460), 'numpy.amin', 'np.amin', (['result_array'], {}), '(result_array)\n', (446, 460), True, 'import numpy as np\n'), ((784, 805), 'numpy.amin', 'np.amin', (['result_array'], {}), '(result_array)\n', (791, 805), True, 'import numpy as np\n'), ((398, 419), 'numpy.amin', 'np.amin', (['result_array'], {}), '(resul...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import glob import os import random import numpy as np import pytest try: import torch import torch.distribute...
[ "torch.manual_seed", "habitat_baselines.config.default.get_config", "random.seed", "torch.set_num_threads", "pytest.mark.parametrize", "habitat_baselines.common.baseline_registry.baseline_registry.get_trainer", "habitat_sim.utils.datasets_download.main", "torch.cuda.is_available", "numpy.random.seed...
[((761, 852), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not baseline_installed)'], {'reason': '"""baseline sub-module not installed"""'}), "(not baseline_installed, reason=\n 'baseline sub-module not installed')\n", (779, 852), False, 'import pytest\n'), ((855, 998), 'pytest.mark.parametrize', 'pytest.mark.par...
import _pickle, numpy as np, itertools as it from time import perf_counter # from cppimport import import_hook # # # import cppimport # # # cppimport.set_quiet(False) # import rpxdock as rp from rpxdock.bvh import bvh_test from rpxdock.bvh import BVH, bvh import rpxdock.homog as hm def test_bvh_isect_cpp(): assert...
[ "rpxdock.bvh.bvh.naive_isect_range", "rpxdock.bvh.bvh.bvh_collect_pairs_range_vec", "numpy.random.rand", "rpxdock.bvh.bvh.naive_isect_fixed", "rpxdock.bvh.bvh.bvh_isect_fixed_range_vec", "rpxdock.bvh.bvh.bvh_count_pairs_vec", "_pickle.dump", "numpy.array", "rpxdock.bvh.BVH", "numpy.linalg.norm", ...
[((321, 351), 'rpxdock.bvh.bvh_test.TEST_bvh_test_isect', 'bvh_test.TEST_bvh_test_isect', ([], {}), '()\n', (349, 351), False, 'from rpxdock.bvh import bvh_test\n'), ((3652, 3680), 'rpxdock.bvh.bvh_test.TEST_bvh_test_min', 'bvh_test.TEST_bvh_test_min', ([], {}), '()\n', (3678, 3680), False, 'from rpxdock.bvh import bvh...
import os import copy import logging import time import numpy as np np.seterr(divide='ignore', invalid='ignore') from prune import prune logging_path = os.path.join(os.getcwd(), "text_log.log") logging.basicConfig(level=logging.INFO, format="%(levelname)s - %(asctime)s - %(msg)s", datefmt="%Y-%m-%d %H:%M:%S...
[ "numpy.multiply", "logging.StreamHandler", "copy.deepcopy", "numpy.where", "time.time", "os.getcwd", "numpy.linspace", "prune.prune_sum_eq_len", "numpy.empty", "numpy.dot", "numpy.isnan", "logging.FileHandler", "numpy.nansum", "numpy.seterr", "numpy.nan_to_num", "prune.prune" ]
[((69, 113), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""'}), "(divide='ignore', invalid='ignore')\n", (78, 113), True, 'import numpy as np\n'), ((168, 179), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (177, 179), False, 'import os\n'), ((871, 905), 'numpy.linspace', 'np.linspac...
# -*- coding: utf-8 -*- """ Created on Tue Mar 30 09:06:40 2021 @author: subhash """ import numpy as np import matplotlib.pyplot as plt import laspy as lp input_path = "C:\\" dataname = "2020_Drone_M" point_cloud=lp.file.File(input_path+dataname+".las", mode="r") print(type(point_cloud)) print(point_cloud) points ...
[ "laspy.file.File", "numpy.asarray", "open3d.visualization.draw_geometries", "numpy.vstack", "open3d.geometry.PointCloud", "open3d.utility.Vector3dVector" ]
[((215, 269), 'laspy.file.File', 'lp.file.File', (["(input_path + dataname + '.las')"], {'mode': '"""r"""'}), "(input_path + dataname + '.las', mode='r')\n", (227, 269), True, 'import laspy as lp\n'), ((695, 720), 'open3d.geometry.PointCloud', 'o3d.geometry.PointCloud', ([], {}), '()\n', (718, 720), True, 'import open3...
import numpy as np from scipy import integrate from floris.utils.tools import valid_ops as vops # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # # MISCELLANEOUS # # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
[ "numpy.abs", "numpy.sqrt", "floris.utils.tools.valid_ops.wake_overlap_ellipse", "numpy.exp", "numpy.array", "floris.utils.tools.valid_ops.find_and_load_model", "numpy.cos", "numpy.sin" ]
[((741, 754), 'numpy.sqrt', 'np.sqrt', (['beta'], {}), '(beta)\n', (748, 754), True, 'import numpy as np\n'), ((1001, 1107), 'numpy.exp', 'np.exp', (['(-((z - z_hub) ** 2 / (2 * (sigma_z_D_r * D_r) ** 2)) - y ** 2 / (2 * (\n sigma_y_D_r * D_r) ** 2))'], {}), '(-((z - z_hub) ** 2 / (2 * (sigma_z_D_r * D_r) ** 2)) - y...
import time import numpy as np import copy import matplotlib.pyplot as plt import scipy.stats import sklearn.metrics import sklearn.utils.validation def accuracy(y, p_pred): """ Computes the accuracy. Parameters ---------- y : array-like Ground truth labels. p_pred : array-like ...
[ "numpy.clip", "numpy.histogram", "numpy.average", "numpy.argmax", "numpy.max", "matplotlib.pyplot.close", "numpy.linspace", "numpy.isnan", "numpy.concatenate", "copy.deepcopy", "numpy.shape", "numpy.isinf", "time.time", "numpy.var" ]
[((2036, 2061), 'numpy.argmax', 'np.argmax', (['p_pred'], {'axis': '(1)'}), '(p_pred, axis=1)\n', (2045, 2061), True, 'import numpy as np\n'), ((2286, 2337), 'numpy.linspace', 'np.linspace', (['bin_range[0]', 'bin_range[1]', '(n_bins + 1)'], {}), '(bin_range[0], bin_range[1], n_bins + 1)\n', (2297, 2337), True, 'import...
""" DATAQ 4108 Device Level code author: <NAME> Date: November 2017- April 2019 fully python3 compatible. The main purpose of this module is to provide useful interface between DI-4108 and a server system level code that does all numbercrynching. This modules only job is to attend DI-4108 and insure that all d...
[ "caproto.server.pvproperty", "textwrap.dedent", "numpy.zeros", "caproto.server.run" ]
[((1536, 1647), 'caproto.server.pvproperty', 'pvproperty', ([], {'value': 'arr_logging', 'dtype': 'int', 'max_length': '(logging_shape[0] * logging_shape[1] * logging_shape[2])'}), '(value=arr_logging, dtype=int, max_length=logging_shape[0] *\n logging_shape[1] * logging_shape[2])\n', (1546, 1647), False, 'from capr...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import time from collections import defaultdict, deque from typing import Any, Dict, List, Optional import ra...
[ "habitat.logger.warn", "habitat.logger.add_filehandler", "habitat.utils.visualizations.maps.colorize_topdown_map", "habitat_baselines.rl.ppo.encoder_dict.get_vision_encoder_inputs", "habitat_baselines.common.environments.get_env_class", "torch.cuda.is_available", "habitat_baselines.common.baseline_regis...
[((3519, 3565), 'habitat_baselines.common.baseline_registry.baseline_registry.register_trainer', 'baseline_registry.register_trainer', ([], {'name': '"""ppo"""'}), "(name='ppo')\n", (3553, 3565), False, 'from habitat_baselines.common.baseline_registry import baseline_registry\n'), ((38227, 38242), 'torch.no_grad', 'tor...
"""A module that carry out the utility's used by the AI algorithms """ import pickle from collections import deque from typing import Deque import numpy as np import tensorflow.keras as tk import tensorflow as tf from sklearn.preprocessing import LabelEncoder import ai.config as config from model.action import Action...
[ "tensorflow.device", "pickle.dump", "collections.deque", "pickle.load", "tensorflow.keras.optimizers.Adam", "numpy.array" ]
[((1885, 1911), 'tensorflow.device', 'tf.device', (['"""/device:GPU:0"""'], {}), "('/device:GPU:0')\n", (1894, 1911), True, 'import tensorflow as tf\n'), ((4474, 4500), 'collections.deque', 'deque', ([], {'maxlen': 'self.max_len'}), '(maxlen=self.max_len)\n', (4479, 4500), False, 'from collections import deque\n'), ((7...
"""Provides high-level DNDarray initialization functions""" import numpy as np import torch import warnings from typing import Callable, Iterable, Optional, Sequence, Tuple, Type, Union, List from .communication import MPI, sanitize_comm, Communication from .devices import Device from .dndarray import DNDarray from ...
[ "numpy.ceil", "torch.full", "numpy.iinfo", "numpy.array", "torch.arange", "torch.meshgrid", "numpy.empty", "torch.linspace" ]
[((4971, 5030), 'torch.arange', 'torch.arange', (['start', 'stop', 'step'], {'device': 'device.torch_device'}), '(start, stop, step, device=device.torch_device)\n', (4983, 5030), False, 'import torch\n'), ((36374, 36440), 'torch.linspace', 'torch.linspace', (['start', 'stop', 'lshape[0]'], {'device': 'device.torch_devi...
# Find angles in degrees of skeleton segments import os import cv2 import numpy as np import pandas as pd from plantcv.plantcv import params from plantcv.plantcv import outputs from plantcv.plantcv import color_palette from plantcv.plantcv._debug import _debug def segment_angle(segmented_img, objects, label="default...
[ "cv2.boxPoints", "cv2.line", "os.path.join", "plantcv.plantcv.outputs.add_observation", "cv2.putText", "cv2.minAreaRect", "pandas.DataFrame", "cv2.fitLine", "numpy.arctan" ]
[((2615, 2834), 'plantcv.plantcv.outputs.add_observation', 'outputs.add_observation', ([], {'sample': 'label', 'variable': '"""segment_angle"""', 'trait': '"""segment angle"""', 'method': '"""plantcv.plantcv.morphology.segment_angle"""', 'scale': '"""degrees"""', 'datatype': 'list', 'value': 'segment_angles', 'label': ...
import numpy as np import time from sklearn.utils import check_random_state from scipy.special import expit def sigmoid(x): return expit(np.clip(x, -30, 30)) class RestrictedBoltzmannMachine: def __init__(self, n_hidden_variables, learning_rate=0.1, batch_size=20, n_epochs=15, mu=0.5, pcd_st...
[ "numpy.clip", "sklearn.utils.check_random_state", "numpy.sqrt", "numpy.random.random", "numpy.asarray", "numpy.array", "numpy.zeros", "time.time" ]
[((143, 162), 'numpy.clip', 'np.clip', (['x', '(-30)', '(30)'], {}), '(x, -30, 30)\n', (150, 162), True, 'import numpy as np\n'), ((700, 737), 'sklearn.utils.check_random_state', 'check_random_state', (['self.random_state'], {}), '(self.random_state)\n', (718, 737), False, 'from sklearn.utils import check_random_state\...
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt import booz_xform as bx wout_filename = 'test_files/wout_li383_1.4m.nc' b = bx.Booz_xform() b.read_wout(wout_filename) b.compute_surfs = [47] b.run() bx.surfplot(b) plt.tight_layout() plt.figure() bx.surfplot(b, fill=False, cmap=plt.cm.jet, le...
[ "booz_xform.surfplot", "booz_xform.Booz_xform", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "numpy.arange", "matplotlib.pyplot.show" ]
[((152, 167), 'booz_xform.Booz_xform', 'bx.Booz_xform', ([], {}), '()\n', (165, 167), True, 'import booz_xform as bx\n'), ((226, 240), 'booz_xform.surfplot', 'bx.surfplot', (['b'], {}), '(b)\n', (237, 240), True, 'import booz_xform as bx\n'), ((241, 259), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), ...
import numpy as np from flask import request from chatbot.common.Debug import flush from chatbot.common.Talk import parse, get_ml_vars, get_ml_model, create_input from chatbot.api.helpers.responses.Talk import TalkResponse from chatbot.models.TalkLog import TalkLogModel from chatbot.api.domain.repositories.TalkLogRepos...
[ "chatbot.common.Talk.get_ml_model", "numpy.argmax", "numpy.argsort", "numpy.array", "chatbot.common.Talk.get_ml_vars", "chatbot.models.TalkLog.TalkLogModel", "chatbot.common.Talk.parse", "chatbot.common.Talk.create_input" ]
[((679, 698), 'chatbot.common.Talk.get_ml_vars', 'get_ml_vars', (['bot_id'], {}), '(bot_id)\n', (690, 698), False, 'from chatbot.common.Talk import parse, get_ml_vars, get_ml_model, create_input\n'), ((715, 735), 'chatbot.common.Talk.get_ml_model', 'get_ml_model', (['bot_id'], {}), '(bot_id)\n', (727, 735), False, 'fro...
from interface import default, Interface import numpy as np import pandas as pd from zipline.utils.sentinel import sentinel DEFAULT_FX_RATE = sentinel('DEFAULT_FX_RATE') class FXRateReader(Interface): def get_rates(self, rate, quote, bases, dts): """ Get rates to convert ``bases`` into ``quote...
[ "pandas.DatetimeIndex", "numpy.array", "zipline.utils.sentinel.sentinel" ]
[((145, 172), 'zipline.utils.sentinel.sentinel', 'sentinel', (['"""DEFAULT_FX_RATE"""'], {}), "('DEFAULT_FX_RATE')\n", (153, 172), False, 'from zipline.utils.sentinel import sentinel\n'), ((2280, 2310), 'numpy.array', 'np.array', (['[base]'], {'dtype': 'object'}), '([base], dtype=object)\n', (2288, 2310), True, 'import...
"""This module specifies classes that model an application traffic pattern. """ from numpy.random import default_rng import random __all__ = [ "Application", "SingleConstantApplication", "SingleRandomApplication", "MultiConstantApplication", "MultiRandomApplication", "MultiPoissonApplication",...
[ "random.sample", "random.choices", "numpy.random.default_rng" ]
[((4863, 4897), 'random.sample', 'random.sample', (['self._node_names', '(2)'], {}), '(self._node_names, 2)\n', (4876, 4897), False, 'import random\n'), ((7074, 7119), 'random.sample', 'random.sample', (['self._pairs', 'self._cardinality'], {}), '(self._pairs, self._cardinality)\n', (7087, 7119), False, 'import random\...
import os import random import numpy as np import logging import argparse import collections import open3d as o3d import sys print(os.path.abspath(__file__)) sys.path.append(".") import torch import torch.nn.parallel import torch.optim import torch.utils.data from util import config from util.common_util import Ave...
[ "logging.getLogger", "logging.StreamHandler", "util.common_util.intersectionAndUnion", "sys.path.append", "util.config.load_cfg_from_cfg_file", "numpy.mean", "argparse.ArgumentParser", "numpy.stack", "numpy.random.seed", "numpy.concatenate", "util.common_util.AverageMeter", "model.pointtransfo...
[((160, 180), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (175, 180), False, 'import sys\n'), ((491, 507), 'random.seed', 'random.seed', (['(123)'], {}), '(123)\n', (502, 507), False, 'import random\n'), ((508, 527), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (522, 527), ...
# -*- coding: utf-8 -*- """ Created on Tue Apr 28 13:20:36 2020 @author: ambar """ ''' Imports ''' import glob from astropy.io import fits import numpy as np import matplotlib.pyplot as plt from astropy.nddata import CCDData import astropy.units as u import ccdproc import os ########################################...
[ "ccdproc.trim_image", "os.path.exists", "numpy.nanmedian", "os.makedirs", "astropy.nddata.CCDData", "astropy.io.fits.open", "ccdproc.subtract_bias", "glob.glob" ]
[((4345, 4370), 'astropy.io.fits.open', 'fits.open', (['sciencelist[0]'], {}), '(sciencelist[0])\n', (4354, 4370), False, 'from astropy.io import fits\n'), ((653, 675), 'astropy.io.fits.open', 'fits.open', (['biaslist[0]'], {}), '(biaslist[0])\n', (662, 675), False, 'from astropy.io import fits\n'), ((1625, 1650), 'num...
from keras.models import Model, load_model from keras.preprocessing.image import ImageDataGenerator from keras.optimizers import SGD import numpy as np import os import pandas as pd import json from keras.applications.densenet import preprocess_input as densenet_preprocess_input # from keras.applications.resnet50 impo...
[ "json.dump", "numpy.save", "keras.models.load_model", "keras.preprocessing.image.ImageDataGenerator" ]
[((513, 572), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'preprocessing_function': 'preprocess_input'}), '(preprocessing_function=preprocess_input)\n', (531, 572), False, 'from keras.preprocessing.image import ImageDataGenerator\n'), ((599, 667), 'keras.preprocessing.image.ImageDataGene...
# Copyright 2020 The TensorFlow 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 i...
[ "numpy.sqrt", "pylib.pc.tests.utils._create_random_point_cloud_segmented", "tensorflow.unique_with_counts", "numpy.array", "numpy.arange", "numpy.repeat", "pylib.pc.PointCloud", "numpy.asarray", "sklearn.neighbors.KernelDensity", "numpy.exp", "numpy.concatenate", "tensorflow_graphics.util.test...
[((3976, 4062), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['(1, 200, 1, 4, 2)', '(1, 200, 1, 4, 3)', '(1, 100, 1, 4, 4)'], {}), '((1, 200, 1, 4, 2), (1, 200, 1, 4, 3), (1, 100, 1, \n 4, 4))\n', (4000, 4062), False, 'from absl.testing import parameterized\n'), ((5707, 5723), 'tensorflow_gr...
from __future__ import division import numpy as np import torch import torch.nn as nn from ..registry import ROIPOOLING @ROIPOOLING.register_module class RoIPooling(nn.Module): def __init__(self, pool_plane, inter_channels, outchannels, crop_s...
[ "torch.nn.ReLU", "torch.nn.Dropout", "torch.nn.init.constant_", "torch.nn.functional.affine_grid", "torch.stack", "torch.nn.init.kaiming_normal_", "torch.from_numpy", "numpy.stack", "numpy.array", "torch.nn.MaxPool2d", "torch.nn.init.normal_", "torch.nn.Linear", "torch.cat" ]
[((489, 513), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', (['pool_plane'], {}), '(pool_plane)\n', (501, 513), True, 'import torch.nn as nn\n'), ((1699, 1719), 'numpy.stack', 'np.stack', (['ab'], {'axis': '(0)'}), '(ab, axis=0)\n', (1707, 1719), True, 'import numpy as np\n'), ((563, 611), 'torch.nn.Linear', 'nn.Linear', (['(n...
""" Fake data generator. """ import datetime import os from typing import Dict import collections import numpy as np import pandas as pd # Generic type definitions. ndist_params = collections.namedtuple('ndist_params', ('mu', 'sigma', 'derives_from', 'decimals')) # # Generator settings # # Base paths. BASE_DIR = ...
[ "datetime.datetime", "numpy.random.normal", "collections.namedtuple", "pandas.to_timedelta", "pandas.read_csv", "numpy.arange", "numpy.where", "pandas.merge", "os.path.join", "os.path.abspath", "pandas.to_datetime" ]
[((184, 271), 'collections.namedtuple', 'collections.namedtuple', (['"""ndist_params"""', "('mu', 'sigma', 'derives_from', 'decimals')"], {}), "('ndist_params', ('mu', 'sigma', 'derives_from',\n 'decimals'))\n", (206, 271), False, 'import collections\n'), ((391, 421), 'os.path.join', 'os.path.join', (['BASE_DIR', '"...
from jina import Executor, Document, DocumentArray, requests import numpy as np from typing import Tuple import os top_k = 10 class DiskIndexer(Executor): """Simple indexer class """ def __init__(self, **kwargs): super().__init__(**kwargs) self._docs = DocumentArray() self.top_k = top...
[ "os.path.exists", "numpy.ones", "os.makedirs", "os.path.join", "jina.requests", "jina.DocumentArray.load", "numpy.linalg.norm", "numpy.take_along_axis", "jina.DocumentArray" ]
[((733, 754), 'jina.requests', 'requests', ([], {'on': '"""/index"""'}), "(on='/index')\n", (741, 754), False, 'from jina import Executor, Document, DocumentArray, requests\n'), ((867, 889), 'jina.requests', 'requests', ([], {'on': '"""/search"""'}), "(on='/search')\n", (875, 889), False, 'from jina import Executor, Do...
#!/usr/bin/env python """experiments.py: experiments python program for different experiment applications""" __author__ = "<NAME>." __copyright__ = "Copyright 2020, SuperDARN@VT" __credits__ = [] __license__ = "MIT" __version__ = "1.0." __maintainer__ = "<NAME>." __email__ = "<EMAIL>" __status__ = "Research" import ...
[ "numpy.log10", "model.Model", "pandas.read_csv", "matplotlib.dates.MinuteLocator", "numpy.array", "scipy.stats.ttest_rel", "datetime.timedelta", "utils.smooth", "sys.path.append", "utils.read_goes", "datetime.datetime", "os.path.exists", "numpy.mean", "argparse.ArgumentParser", "netCDF4....
[((331, 352), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (345, 352), False, 'import matplotlib\n'), ((419, 455), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""config/alt.mplstyle"""'], {}), "('config/alt.mplstyle')\n", (432, 455), True, 'import matplotlib.pyplot as plt\n'), ((468, 494...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Code accompanying the manuscript: "Reinterpreting the relationship between number of species and number of links connects community structure and stability" ------- v1.0.0 (First release) ------- For any question or comment, please contact: <NAME>(1), <EMAIL> (1)...
[ "decomposition.experiment", "robustness.robx", "robustness.R2deltaS", "matplotlib.pyplot.ylabel", "local_stability.realpart", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.axhline", "numpy.array", "numpy.linspace", "decomposition.R2L", "matplotlib.pyplot.scatter", ...
[((821, 955), 'numpy.array', 'np.array', (['[[0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 1, 1], [1, 0, 0, 0, 1,\n 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0]]'], {}), '([[0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 1, 1], [1, 0,\n 0, 0, 1, 1], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0]])\n', (829, 955...
import numpy as np import nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize import re import unicodedata from word2vec_api import get_word_vector # ****** Define functions to create average word vectors of paragraphs def makeFeatureVec(words, index2word_set, num_features=300): # Fu...
[ "nltk.wordnet.WordNetLemmatizer", "numpy.add", "word2vec_api.get_word_vector", "nltk.tokenize.word_tokenize", "numpy.zeros", "numpy.divide" ]
[((454, 496), 'numpy.zeros', 'np.zeros', (['(num_features,)'], {'dtype': '"""float32"""'}), "((num_features,), dtype='float32')\n", (462, 496), True, 'import numpy as np\n'), ((678, 698), 'nltk.tokenize.word_tokenize', 'word_tokenize', (['words'], {}), '(words)\n', (691, 698), False, 'from nltk.tokenize import word_tok...
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[ "paddle.fluid.contrib.reader.distributed_batch_reader", "sys.setdefaultencoding", "utils.init.init_checkpoint", "multiprocessing.cpu_count", "numpy.array", "paddle.fluid.Executor", "scipy.stats.pearsonr", "paddle.fluid.ExecutionStrategy", "os.path.exists", "utils.args.print_arguments", "argparse...
[((1447, 1479), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['__doc__'], {}), '(__doc__)\n', (1470, 1479), False, 'import argparse\n'), ((1490, 1554), 'utils.args.ArgumentGroup', 'ArgumentGroup', (['parser', '"""model"""', '"""model configuration and paths."""'], {}), "(parser, 'model', 'model configuration ...
''' Author: <NAME> and <NAME> Purpose: To predict aesthetic quality of image on a scale of 1 to 5. How to use: There is a folder named test_images in parent directory of scripts Put all your image to test in that folder Run this code ie.. python3 main.py Sample Output: farm1_262_20009074919_cdd...
[ "os.listdir", "keras.models.load_model", "PIL.Image.open", "os.path.join", "numpy.max", "numpy.array", "os.remove" ]
[((1862, 1880), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (1872, 1880), False, 'import os\n'), ((2306, 2336), 'numpy.array', 'np.array', (['ims'], {'dtype': '"""float32"""'}), "(ims, dtype='float32')\n", (2314, 2336), True, 'import numpy as np\n'), ((2348, 2362), 'numpy.max', 'np.max', (['X_test'], {}...
import numpy as np import warnings from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import UniformFloatHyperparameter, CategoricalHyperparameter from ConfigSpace.conditions import EqualsCondition from solnml.components.feature_engineering.transformations.base_transformer i...
[ "solnml.components.utils.text_util.build_embeddings_index", "ConfigSpace.hyperparameters.UniformFloatHyperparameter", "numpy.hstack", "solnml.components.utils.text_util.load_text_embeddings", "ConfigSpace.conditions.EqualsCondition", "ConfigSpace.hyperparameters.CategoricalHyperparameter", "ConfigSpace....
[((1472, 1563), 'ConfigSpace.hyperparameters.CategoricalHyperparameter', 'CategoricalHyperparameter', (['"""method"""', "['average', 'weighted']"], {'default_value': '"""weighted"""'}), "('method', ['average', 'weighted'], default_value=\n 'weighted')\n", (1497, 1563), False, 'from ConfigSpace.hyperparameters import...
import glob,sys import numpy as np sys.path.append('../../flu/src') import test_flu_prediction as test_flu import matplotlib.pyplot as plt import analysis_utils_toy_data as AU file_formats = ['.svg', '.pdf'] plt.rcParams.update(test_flu.mpl_params) line_styles = ['-', '--', '-.'] cols = ['b', 'r', 'g', 'c', 'm', 'k'...
[ "numpy.mean", "matplotlib.pyplot.xscale", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.gca", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.figure", "analysis_utils_toy_data.load_prediction_data", "sys.path.append", "matplotlib.pyplot.xlim", "matplotlib.pyp...
[((35, 67), 'sys.path.append', 'sys.path.append', (['"""../../flu/src"""'], {}), "('../../flu/src')\n", (50, 67), False, 'import glob, sys\n'), ((209, 249), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (['test_flu.mpl_params'], {}), '(test_flu.mpl_params)\n', (228, 249), True, 'import matplotlib.pyplot a...
#!/usr/bin/env python3 # wykys 2019 import numpy as np def awgn(s: np.ndarray, snr_db: float = 20) -> np.ndarray: sig_avg_watts = np.mean(s**2) sig_avg_db = 10 * np.log10(sig_avg_watts) noise_avg_db = sig_avg_db - snr_db noise_avg_watts = 10 ** (noise_avg_db / 10) mean_noise = 0 noise_volts...
[ "numpy.mean", "numpy.log10", "sig_plot.show", "numpy.sqrt", "sig_plot.splitplot", "numpy.sin", "numpy.arange" ]
[((137, 152), 'numpy.mean', 'np.mean', (['(s ** 2)'], {}), '(s ** 2)\n', (144, 152), True, 'import numpy as np\n'), ((527, 554), 'numpy.arange', 'np.arange', (['(0)', '(1 / f)', '(1 / fs)'], {}), '(0, 1 / f, 1 / fs)\n', (536, 554), True, 'import numpy as np\n'), ((560, 585), 'numpy.sin', 'np.sin', (['(2 * np.pi * f * t...
# import scipy.signal as sig import scipy as sp import numpy as np # tc = 30e-9 # caviy_tc = 10e-9 # n=1 # wc = 1/tc fac = sp.math.factorial # def filter_func(tc, order, t): # wc=1/float(tc) # return (wc*t)**(order-1)/fac(order-1)*wc*np.exp(-wc*t) # filt = filter_func(tc, 7, np.arange(tc,20*tc, 0.1*t...
[ "numpy.exp", "scipy.signal.deconvolve", "numpy.arange" ]
[((1305, 1320), 'numpy.exp', 'np.exp', (['(-wc * t)'], {}), '(-wc * t)\n', (1311, 1320), True, 'import numpy as np\n'), ((1868, 1887), 'scipy.signal.deconvolve', 'deconvolve', (['y', 'filt'], {}), '(y, filt)\n', (1878, 1887), False, 'from scipy.signal import deconvolve\n'), ((1719, 1752), 'numpy.arange', 'np.arange', (...
"""Implementation of a subset of the NumPy API using SymPy primitives.""" from collections import Iterable as _Iterable import sympy as _sym import numpy as _np from symnum.array import ( SymbolicArray as _SymbolicArray, is_sympy_array as _is_sympy_array, unary_elementwise_func as _unary_elementwise_func, ...
[ "numpy.prod", "symnum.array.slice_iterator", "symnum.array.is_sympy_array", "numpy.array", "sympy.log", "symnum.array.unary_elementwise_func", "sympy.exp", "sympy.arg", "symnum.array.binary_broadcasting_func", "symnum.array.SymbolicArray" ]
[((3206, 3257), 'symnum.array.unary_elementwise_func', '_unary_elementwise_func', (['sympy_func', 'numpy_name', '""""""'], {}), "(sympy_func, numpy_name, '')\n", (3229, 3257), True, 'from symnum.array import SymbolicArray as _SymbolicArray, is_sympy_array as _is_sympy_array, unary_elementwise_func as _unary_elementwise...
""" this is a simple demo of data-retrieving by ipython all codes including %matplotlib should be coded in ipython interface please first uncomment the code on line 13 and then run the following code in ipython """ import numpy as np import pandas as pd import pandas.io.data as web goog = web.DataReader('GOOG', data_so...
[ "pandas.rolling_std", "numpy.sqrt", "pandas.io.data.DataReader" ]
[((290, 369), 'pandas.io.data.DataReader', 'web.DataReader', (['"""GOOG"""'], {'data_source': '"""yahoo"""', 'start': '"""3/14/2009"""', 'end': '"""4/14/2009"""'}), "('GOOG', data_source='yahoo', start='3/14/2009', end='4/14/2009')\n", (304, 369), True, 'import pandas.io.data as web\n'), ((468, 511), 'pandas.rolling_st...
# -*- coding: utf-8 -*- """ Author ------ <NAME> Email ----- <EMAIL> Created on ---------- - Sun Jun 25 13:00:00 2017 Modifications ------------- - Sun Jun 25 13:00:00 2017 Aims ---- - utils for computing in parallel """ from copy import deepcopy import numpy as np from ipyparallel import Client def launch_ipc...
[ "numpy.random.shuffle", "copy.deepcopy", "numpy.unique", "ipyparallel.Client" ]
[((429, 452), 'ipyparallel.Client', 'Client', ([], {'profile': 'profile'}), '(profile=profile)\n', (435, 452), False, 'from ipyparallel import Client\n'), ((1504, 1551), 'numpy.unique', 'np.unique', (["dv['host_names']"], {'return_counts': '(True)'}), "(dv['host_names'], return_counts=True)\n", (1513, 1551), True, 'imp...
import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pytest from cycler import cycler def test_colorcycle_basic(): fig, ax = plt.subplots() ax.set_prop_cycle(cycler('color', ['r', 'g', 'y'])) for _ in range(4): ax.plot(range(10), range(10)) assert [l.get_color() ...
[ "matplotlib.colors.to_rgba", "numpy.array", "pytest.raises", "cycler.cycler", "matplotlib.pyplot.subplots" ]
[((162, 176), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (174, 176), True, 'import matplotlib.pyplot as plt\n'), ((404, 418), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (416, 418), True, 'import matplotlib.pyplot as plt\n'), ((794, 808), 'matplotlib.pyplot.subplots', 'plt.subpl...
import numpy as np from pingle.core.policy import Policy class RandomPolicy: actions = [] def get_action(self, *, observation, previous_reward, public_speech): """ Parameters ---------- observation: Observation ...
[ "numpy.random.choice" ]
[((681, 711), 'numpy.random.choice', 'np.random.choice', (['self.actions'], {}), '(self.actions)\n', (697, 711), True, 'import numpy as np\n')]
# description: scan for grammar scores import os import h5py import glob import json import logging import numpy as np from tronn.datalayer import H5DataLoader from tronn.interpretation.inference import run_inference from tronn.interpretation.motifs import get_sig_pwm_vector from tronn.nets.preprocess_nets import mu...
[ "logging.getLogger", "tronn.interpretation.motifs.get_sig_pwm_vector", "tronn.interpretation.inference.run_inference", "tronn.util.scripts.parse_multi_target_selection_strings", "tronn.datalayer.H5DataLoader", "json.load", "numpy.sum", "tronn.util.formats.write_to_json", "tronn.util.pwms.MotifSetMan...
[((699, 726), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (716, 726), False, 'import logging\n'), ((1340, 1446), 'tronn.interpretation.motifs.get_sig_pwm_vector', 'get_sig_pwm_vector', (['args.sig_pwms_file', 'args.sig_pwms_key', 'args.foreground_targets'], {'reduce_type': '"""any"""'}...
# Copyright 2020 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
[ "tensorflow.app.run", "os.path.exists", "argparse.ArgumentParser", "tensorflow.placeholder", "tensorflow.Session", "tensorflow.compat.v1.logging.set_verbosity", "os.path.isdir", "network.Pydnet", "numpy.squeeze", "os.path.isfile", "cv2.cvtColor", "tensorflow.expand_dims", "cv2.resize", "cv...
[((880, 942), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (914, 942), True, 'import tensorflow as tf\n'), ((953, 1019), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Single sh...
import numpy as np import matplotlib.pyplot as plt x = np.linspace(0,2*np.pi) y = np.sin(x) plt.plot(x,y) plt.show()
[ "numpy.sin", "numpy.linspace", "matplotlib.pyplot.plot", "matplotlib.pyplot.show" ]
[((55, 80), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)'], {}), '(0, 2 * np.pi)\n', (66, 80), True, 'import numpy as np\n'), ((82, 91), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (88, 91), True, 'import numpy as np\n'), ((92, 106), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {}), '(x, y)\n', (100, 1...
""" <NAME> CEA Saclay - DM2S/STMF/LGLS Mars 2021 - Stage 6 mois We provide here a python package that can be used to graph and plot TRUSt data within jupyterlab. This work is based on the files package (a TRUST package that reads the son files). """ from trustutils import files as tf import matplotlib.pyplot as plt ...
[ "trustutils.jupyter.filelist.FileAccumulator.Append", "matplotlib.pyplot.gca", "os.getcwd", "os.chdir", "trustutils.files.SonSEGFile", "numpy.loadtxt", "re.findall", "numpy.array", "numpy.zeros", "pandas.DataFrame", "trustutils.files.SonPOINTFile", "matplotlib.pyplot.subplots", "matplotlib.p...
[((730, 741), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (739, 741), False, 'import os\n'), ((774, 788), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (782, 788), False, 'import os\n'), ((837, 865), 'trustutils.jupyter.filelist.FileAccumulator.Append', 'FileAccumulator.Append', (['data'], {}), '(data)\n', (859, ...
#In 1 from __future__ import print_function from __future__ import division import pandas as pd import numpy as np # from matplotlib import pyplot as plt # import seaborn as sns # from sklearn.model_selection import train_test_split import statsmodels.api as sm # just for the sake of this blog post! from warnings...
[ "pandas.isnull", "pandas.read_csv", "statsmodels.tools.eval_measures.meanabs", "statsmodels.api.families.NegativeBinomial", "numpy.concatenate", "pandas.concat", "warnings.filterwarnings", "numpy.arange" ]
[((343, 367), 'warnings.filterwarnings', 'filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (357, 367), False, 'from warnings import filterwarnings\n'), ((417, 483), 'pandas.read_csv', 'pd.read_csv', (['"""data/dengue_features_train.csv"""'], {'index_col': '[0, 1, 2]'}), "('data/dengue_features_train.csv', index...
from knmy import knmy import pandas as pd import numpy as np def knmi_get(start, end, stations=[240]): # knmy.get_hourly_data returns a tuple with 4 items. Immediately index to [3] to get the df with weather variables. knmi_data = knmy.get_hourly_data(stations=[240], start=start, end=end, ...
[ "numpy.where", "pandas.to_datetime", "knmy.knmy.get_hourly_data" ]
[((1676, 1747), 'numpy.where', 'np.where', (["(knmi_data['precipitation'] < 0)", '(0)', "knmi_data['precipitation']"], {}), "(knmi_data['precipitation'] < 0, 0, knmi_data['precipitation'])\n", (1684, 1747), True, 'import numpy as np\n'), ((246, 355), 'knmy.knmy.get_hourly_data', 'knmy.get_hourly_data', ([], {'stations'...
import numpy as np def PCA_numpy(data, n_components=2): #1nd step is to find covarience matrix data_vector = [] for i in range(data.shape[1]): data_vector.append(data[:, i]) cov_matrix = np.cov(data_vector) #2rd step is to compute eigen vectors and eigne values eig_values...
[ "numpy.abs", "numpy.cov", "numpy.linalg.eig" ]
[((222, 241), 'numpy.cov', 'np.cov', (['data_vector'], {}), '(data_vector)\n', (228, 241), True, 'import numpy as np\n'), ((336, 361), 'numpy.linalg.eig', 'np.linalg.eig', (['cov_matrix'], {}), '(cov_matrix)\n', (349, 361), True, 'import numpy as np\n'), ((528, 549), 'numpy.abs', 'np.abs', (['eig_values[i]'], {}), '(ei...
import typing import numpy as np import numba as nb @nb.njit def uf_build(n: int) -> np.ndarray: return np.full(n, -1, np.int64) @nb.njit def uf_find(uf: np.ndarray, u: int) -> int: if uf[u] < 0: return u uf[u] = uf_find(uf, uf[u]) return uf[u] @nb.njit def uf_unite( uf: np.ndarray, u: int, ...
[ "numpy.full" ]
[((112, 136), 'numpy.full', 'np.full', (['n', '(-1)', 'np.int64'], {}), '(n, -1, np.int64)\n', (119, 136), True, 'import numpy as np\n')]
#!/usr/bin/env python3 """Graph Viewer demo. Renders a phonebot into an OpenGL-based window, looping through joint angles; i.e., we construct a PhonebotGraph and update the transforms of the legs. """ import time import numpy as np from phonebot.core.common.math.utils import anorm from phonebot.core.common.config im...
[ "phonebot.core.common.config.PhonebotSettings", "phonebot.core.frame_graph.graph_utils.solve_knee_angle", "phonebot.core.frame_graph.graph_utils.get_graph_geometries", "phonebot.core.common.math.utils.anorm", "numpy.linspace", "phonebot.core.frame_graph.phonebot_graph.PhonebotGraph", "phonebot.vis.viewe...
[((705, 723), 'phonebot.core.common.config.PhonebotSettings', 'PhonebotSettings', ([], {}), '()\n', (721, 723), False, 'from phonebot.core.common.config import PhonebotSettings\n'), ((868, 889), 'phonebot.core.frame_graph.phonebot_graph.PhonebotGraph', 'PhonebotGraph', (['config'], {}), '(config)\n', (881, 889), False,...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2020-2021 Alibaba Group Holding Limited. # # 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/LI...
[ "logging.getLogger", "vineyard.ObjectMeta", "vineyard.io.deserialize", "numpy.testing.assert_array_almost_equal", "numpy.ones", "pytest.mark.skip", "os.environ.get", "vineyard.connect", "shutil.rmtree", "pytest.fixture", "vineyard.io.serialize" ]
[((770, 799), 'logging.getLogger', 'logging.getLogger', (['"""vineyard"""'], {}), "('vineyard')\n", (787, 799), False, 'import logging\n'), ((803, 833), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (817, 833), False, 'import pytest\n'), ((2838, 2869), 'pytest.mark.skip', 'p...
# /usr/bin/env python3.6 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification,...
[ "tensorflow.math.squared_difference", "tensorflow.add", "tensorflow.sigmoid", "tensorflow.constant", "numpy.cos" ]
[((3562, 3623), 'tensorflow.math.squared_difference', 'tf.math.squared_difference', (['ada_quantized_output', 'orig_output'], {}), '(ada_quantized_output, orig_output)\n', (3588, 3623), True, 'import tensorflow as tf\n'), ((5067, 5101), 'tensorflow.constant', 'tf.constant', (['(0.0)'], {'dtype': 'tf.float32'}), '(0.0, ...
import os import numpy as np import pickle import time from collections import deque from mpi4py import MPI import tensorflow as tf from stable_baselines import logger from stable_baselines.common import tf_util, SetVerbosity, TensorboardWriter from stable_baselines import DDPG from stable_baselines.common.buffers i...
[ "stable_baselines.common.math_util.scale_action", "numpy.random.rand", "stable_baselines.logger.record_tabular", "stable_baselines.common.buffers.ReplayBuffer", "mpi4py.MPI.COMM_WORLD.Get_size", "numpy.array", "tensorflow.RunMetadata", "os.remove", "os.path.exists", "numpy.mean", "collections.de...
[((3704, 3764), 'numpy.random.uniform', 'np.random.uniform', (['(-1.5)', '(1.5)', 'self.env.action_space.shape[0]'], {}), '(-1.5, 1.5, self.env.action_space.shape[0])\n', (3721, 3764), True, 'import numpy as np\n'), ((3814, 3839), 'mpi4py.MPI.COMM_WORLD.Get_rank', 'MPI.COMM_WORLD.Get_rank', ([], {}), '()\n', (3837, 383...
import random import pandas as pd import numpy as np def intermediate_model(): # Reading entire grid cells. df = pd.read_csv('..\\cells_ny.csv') # storing individual columns cell_ids = df['cell_id'] cell_names = df['cell_names'] max_row = 0 max_col = 0 # getting max row and column ...
[ "numpy.array", "random.choice", "random.shuffle", "pandas.read_csv" ]
[((123, 154), 'pandas.read_csv', 'pd.read_csv', (['"""..\\\\cells_ny.csv"""'], {}), "('..\\\\cells_ny.csv')\n", (134, 154), True, 'import pandas as pd\n'), ((670, 688), 'numpy.array', 'np.array', (['cell_ids'], {}), '(cell_ids)\n', (678, 688), True, 'import numpy as np\n'), ((3080, 3102), 'random.choice', 'random.choic...
#!/usr/bin/python2 import sys import os import nibabel as nib import numpy as np from nilearn.input_data import NiftiMasker from scipy.stats import ttest_rel from fg_constants import * def load_cv_map(regressors, subj, masker): img = os.path.join(MAPS_DIR, regressors, subj, 'corr_cv.nii.gz') return masker.tr...
[ "nibabel.save", "nibabel.load", "os.path.join", "scipy.stats.ttest_rel", "numpy.vstack" ]
[((241, 299), 'os.path.join', 'os.path.join', (['MAPS_DIR', 'regressors', 'subj', '"""corr_cv.nii.gz"""'], {}), "(MAPS_DIR, regressors, subj, 'corr_cv.nii.gz')\n", (253, 299), False, 'import os\n'), ((522, 537), 'numpy.vstack', 'np.vstack', (['maps'], {}), '(maps)\n', (531, 537), True, 'import numpy as np\n'), ((870, 8...
import glob import numpy as np import pandas as pd from collections import OrderedDict #from . import metrics import metrics from .csv_reader import csv_node __all__ = ['tune_threshold', 'assemble_node', 'assemble_dev_threshold', 'metric_reading', 'Ensemble'] def tune_thres...
[ "numpy.mean", "collections.OrderedDict", "numpy.arange", "numpy.round", "numpy.array", "metrics.classification_summary", "numpy.std", "pandas.DataFrame", "glob.glob" ]
[((453, 477), 'numpy.arange', 'np.arange', (['(0.01)', '(1)', '(0.01)'], {}), '(0.01, 1, 0.01)\n', (462, 477), True, 'import numpy as np\n'), ((1194, 1210), 'numpy.array', 'np.array', (['probas'], {}), '(probas)\n', (1202, 1210), True, 'import numpy as np\n'), ((574, 629), 'numpy.array', 'np.array', (['[(1 if p > thres...
# Training a Dueling Double DQN agent to play break-out import random import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import utils import gym import numpy as np from gym.core import ObservationWrapper from gym.spaces import Box import cv2 import os import atari_wrappers # adju...
[ "torch.nn.ReLU", "replay_buffer.ReplayBuffer", "torch.cuda.is_available", "gym.make", "utils.linear_decay", "numpy.mean", "os.path.exists", "numpy.where", "numpy.max", "atari_wrappers.MaxAndSkipEnv", "atari_wrappers.FireResetEnv", "numpy.random.choice", "atari_wrappers.ClipRewardEnv", "ata...
[((496, 514), 'gym.make', 'gym.make', (['ENV_NAME'], {}), '(ENV_NAME)\n', (504, 514), False, 'import gym\n'), ((11607, 11628), 'replay_buffer.ReplayBuffer', 'ReplayBuffer', (['(10 ** 4)'], {}), '(10 ** 4)\n', (11619, 11628), False, 'from replay_buffer import ReplayBuffer\n'), ((2128, 2169), 'atari_wrappers.MaxAndSkipEn...
from flask import Flask, request from flask import render_template import numpy as np import pickle import os import matplotlib.pyplot as plt app = Flask(__name__) ## function to check whether board is its terminal state def check_winner(game): winner = '' checkfor = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6...
[ "flask.render_template", "pickle.dump", "flask.Flask", "pickle.load", "flask.request.form.get", "numpy.zeros", "numpy.random.uniform" ]
[((149, 164), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (154, 164), False, 'from flask import Flask, request\n'), ((7943, 7976), 'flask.render_template', 'render_template', (['"""tictactoe.html"""'], {}), "('tictactoe.html')\n", (7958, 7976), False, 'from flask import render_template\n'), ((8075, 8105...
from simupy.block_diagram import BlockDiagram import simupy_flight import numpy as np from nesc_testcase_helper import plot_nesc_comparisons, int_opts, benchmark from nesc_testcase_helper import ft_per_m, kg_per_slug Ixx = 3.6*kg_per_slug/(ft_per_m**2) #slug-ft2 Iyy = 3.6*kg_per_slug/(ft_per_m**2) #slug-ft2 Izz = 3.6...
[ "simupy_flight.get_constant_aero", "simupy.block_diagram.BlockDiagram", "simupy_flight.get_constant_winds", "nesc_testcase_helper.benchmark", "nesc_testcase_helper.plot_nesc_comparisons", "simupy_flight.Planetodetic", "numpy.arange" ]
[((1585, 1614), 'simupy.block_diagram.BlockDiagram', 'BlockDiagram', (['planet', 'vehicle'], {}), '(planet, vehicle)\n', (1597, 1614), False, 'from simupy.block_diagram import BlockDiagram\n'), ((2179, 2211), 'nesc_testcase_helper.plot_nesc_comparisons', 'plot_nesc_comparisons', (['res', '"""10"""'], {}), "(res, '10')\...
#!/usr/bin/python #------------------------------------------------------------------------------ # Name: plotUpperLimits.py # Author: <NAME>, 20150212 # Last Modified: 20150212 #This is to read upper limits files and plot them so another Python script # createHTML.py, can display them at the end of...
[ "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel", "matplotlib.use", "math.pow", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "os.path.join", "os.getcwd", "os.path.isfile", "numpy.array", "matplotlib.pyplot.figure", "os.path.isdir", "matplotlib.pyplot.yticks", "os.mkdir", "...
[((583, 597), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (590, 597), True, 'import matplotlib as mpl\n'), ((1851, 1890), 'os.path.isfile', 'os.path.isfile', (['"""upper_limit_bands.xml"""'], {}), "('upper_limit_bands.xml')\n", (1865, 1890), False, 'import os\n'), ((2319, 2334), 'numpy.array', 'np.ar...
# Siconos solvers import siconos.numerics as sn # fclib interface import siconos.fclib as fcl # h5py import h5py import numpy as np import scipy.linalg as la # --- Create a friction contact problem --- # Case 1 : from scratch # Number of contacts nc = 3 # W matrix w_shape = (3 * nc, 3 * nc) W = np.zeros(w_shape, dty...
[ "siconos.numerics.FrictionContactProblem", "siconos.numerics.fc3d_driver", "siconos.numerics.SolverOptions", "numpy.zeros", "numpy.finfo", "numpy.zeros_like" ]
[((299, 334), 'numpy.zeros', 'np.zeros', (['w_shape'], {'dtype': 'np.float64'}), '(w_shape, dtype=np.float64)\n', (307, 334), True, 'import numpy as np\n'), ((610, 644), 'numpy.zeros', 'np.zeros', (['(3 * nc)'], {'dtype': 'np.float64'}), '(3 * nc, dtype=np.float64)\n', (618, 644), True, 'import numpy as np\n'), ((732, ...
# Standard library imports from pprint import pprint # Local application imports from gym_snape.game import Game from gym_snape.game.pets import Pet from gym_snape.game.food import Food # Third-party imports import gym from gym import spaces import numpy as np class Snape(gym.Env): metadata = {'render.modes': [...
[ "gym_snape.game.Game", "numpy.iinfo", "gym.spaces.Discrete", "pprint.pprint" ]
[((461, 482), 'gym_snape.game.Game', 'Game', ([], {'display': 'display'}), '(display=display)\n', (465, 482), False, 'from gym_snape.game import Game\n'), ((2785, 2826), 'gym.spaces.Discrete', 'spaces.Discrete', (['(self.end_turn_action + 1)'], {}), '(self.end_turn_action + 1)\n', (2800, 2826), False, 'from gym import ...
from __future__ import print_function import subprocess import tempfile import numpy as np import warnings import astropy.units as u _quantity = u.Quantity from collections import defaultdict import os import sys from . import utils from . import synthspec from .utils import QuantityOff,ImmutableDict,unitless,grouper ...
[ "numpy.array", "os.path.exists", "numpy.where", "numpy.exp", "astropy.units.brightness_temperature", "subprocess.call", "tempfile.NamedTemporaryFile", "warnings.warn", "os.path.expanduser", "astropy.log.warn", "numpy.abs", "numpy.allclose", "numpy.any", "os.getenv", "collections.defaultd...
[((1695, 1772), 'warnings.warn', 'warnings.warn', (['"""pyradex is deprecated: Use pyradex.Radex instead if you can."""'], {}), "('pyradex is deprecated: Use pyradex.Radex instead if you can.')\n", (1708, 1772), False, 'import warnings\n'), ((3675, 3736), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([...
""" Building ======== The building module contains functions related to building acoustics. """ from __future__ import division import numpy as np #from acoustics.utils import w def rw_curve(tl): """ Calculate the curve of :math:`Rw` from a NumPy array `tl` with third octave data between 100 Hz and 3....
[ "numpy.log10", "numpy.any", "numpy.array", "numpy.deg2rad", "numpy.sum", "numpy.cos", "numpy.min" ]
[((395, 465), 'numpy.array', 'np.array', (['[0, 3, 6, 9, 12, 15, 18, 19, 20, 21, 22, 23, 23, 23, 23, 23]'], {}), '([0, 3, 6, 9, 12, 15, 18, 19, 20, 21, 22, 23, 23, 23, 23, 23])\n', (403, 465), True, 'import numpy as np\n'), ((1078, 1167), 'numpy.array', 'np.array', (['[-29, -26, -23, -21, -19, -17, -15, -13, -12, -11, ...
import numpy as np from collections import defaultdict from .loss import compute_rre, compute_rte class Logger: def __init__(self): self.store = defaultdict(list) def reset(self): self.store = defaultdict(list) def add(self, key, value): self.store[key].append(valu...
[ "numpy.mean", "numpy.max", "numpy.sum", "collections.defaultdict", "numpy.min" ]
[((168, 185), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (179, 185), False, 'from collections import defaultdict\n'), ((232, 249), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (243, 249), False, 'from collections import defaultdict\n'), ((370, 394), 'numpy.mean', 'np....
"""MIT License Copyright (c) 2019, <NAME> 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, distri...
[ "stuett.data.MHDSLRFilenames", "numpy.abs", "stuett.DirectoryStore", "pathlib.Path", "stuett.global_config.get_setting", "io.BytesIO", "stuett.ABSStore", "stuett.global_config.setting_exists", "numpy.array", "torch.is_tensor", "numpy.isnan", "stuett.data.CsvSource", "pandas.to_datetime" ]
[((4891, 4956), 'stuett.data.CsvSource', 'stuett.data.CsvSource', (['rock_temperature_file_mh10'], {'store': 'ts_store'}), '(rock_temperature_file_mh10, store=ts_store)\n', (4912, 4956), False, 'import stuett\n'), ((5060, 5113), 'stuett.data.CsvSource', 'stuett.data.CsvSource', (['radiation_file'], {'store': 'ts_store'...
import numpy as np import torch import math def TLift(in_score, gal_cam_id, gal_time, prob_cam_id, prob_time, num_cams, tau=100, sigma=200, K=10, alpha=0.2): """Function for the Temporal Lifting (TLift) method TLift is a model-free temporal cooccurrence based score weighting method proposed in <NAME> and ...
[ "numpy.where", "math.pow", "numpy.sort", "numpy.zeros_like", "torch.pow", "numpy.random.randint", "torch.cuda.is_available", "numpy.transpose", "numpy.random.randn" ]
[((2196, 2221), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2219, 2221), False, 'import torch\n'), ((4259, 4283), 'numpy.random.randn', 'np.random.randn', (['(50)', '(100)'], {}), '(50, 100)\n', (4274, 4283), True, 'import numpy as np\n'), ((4301, 4329), 'numpy.random.randint', 'np.random.r...
# -*- coding: utf-8 -*- # Copyright (c) 2016-2022 by University of Kassel and Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. import pytest import gc import copy import numpy as np import pandas as pd try: import geopandas as gpd import shapely.geo...
[ "pandas.isnull", "pandas.DataFrame", "pandapower.create_empty_network", "pandapower.control.ConstControl", "pandapower.toolbox.get_gc_objects_dict", "pandas.Int64Dtype", "pandapower.auxiliary.get_indices", "pytest.main", "numpy.array_equal", "pytest.raises", "gc.collect", "copy.deepcopy", "p...
[((1568, 1619), 'pandapower.auxiliary.get_indices', 'get_indices', (['[102, 107]', 'lookup'], {'fused_indices': '(True)'}), '([102, 107], lookup, fused_indices=True)\n', (1579, 1619), False, 'from pandapower.auxiliary import get_indices\n'), ((1631, 1661), 'numpy.array_equal', 'np.array_equal', (['result', '[2, 7]'], {...
# template matching import cv2 import numpy as np from scipy import signal from pprint import pprint from matplotlib import pyplot as plt def show_img(title, img): cv2.namedWindow(f"{title}", cv2.WINDOW_NORMAL) cv2.imshow(f"{title}", img) cv2.waitKey(0) # 需要處理成透明背景 應該就可以找到對的物體進行辨識 path1 = "...
[ "cv2.rectangle", "cv2.imwrite", "cv2.namedWindow", "cv2.normalize", "numpy.sqrt", "numpy.where", "cv2.imshow", "cv2.minMaxLoc", "cv2.waitKey", "cv2.matchTemplate", "cv2.imread", "numpy.float32" ]
[((362, 382), 'cv2.imread', 'cv2.imread', (['path1', '(0)'], {}), '(path1, 0)\n', (372, 382), False, 'import cv2\n'), ((397, 417), 'cv2.imread', 'cv2.imread', (['path2', '(0)'], {}), '(path2, 0)\n', (407, 417), False, 'import cv2\n'), ((476, 506), 'numpy.where', 'np.where', (['(template > 0)', '(100)', '(0)'], {}), '(t...
# Copyright (c) 2021, Technische Universität Kaiserslautern (TUK) & National University of Sciences and Technology (NUST). # All rights reserved. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import print_function from __fut...
[ "os.path.exists", "torchnet.meter.ConfusionMeter", "torch.device", "sklearn.metrics.classification_report", "torch.Tensor", "os.path.join", "dataset.get_dataloaders_generated_data", "matplotlib.colors.ListedColormap", "torch.argmax", "numpy.array", "numpy.asarray", "collections.defaultdict", ...
[((800, 825), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (818, 825), True, 'import matplotlib.pyplot as plt\n'), ((6495, 6510), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (6508, 6510), False, 'import torch\n'), ((14746, 14761), 'torch.no_grad', 'torch.no_grad', ...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[ "numpy.where", "es_agent.ESAgent", "numpy.any", "numpy.max", "powernet_model.PowerNetModel", "numpy.isnan", "utils.process", "numpy.load", "es.ES" ]
[((1829, 1844), 'powernet_model.PowerNetModel', 'PowerNetModel', ([], {}), '()\n', (1842, 1844), False, 'from powernet_model import PowerNetModel\n'), ((1865, 1874), 'es.ES', 'ES', (['model'], {}), '(model)\n', (1867, 1874), False, 'from es import ES\n'), ((1899, 1917), 'es_agent.ESAgent', 'ESAgent', (['algorithm'], {}...
from __future__ import division from scipy.stats import norm from pandas import read_excel import numpy as np # Transform to normal distribution # def allnorm(x, y): sample = len(x) # Estimate norm parameters # phat1 = norm.fit(x, loc=0, scale=1) meanx = phat1[0] sigmax = phat1[1] phat2 = n...
[ "scipy.stats.norm.fit", "numpy.sum", "numpy.zeros", "numpy.concatenate", "pandas.read_excel", "scipy.stats.norm.cdf" ]
[((235, 262), 'scipy.stats.norm.fit', 'norm.fit', (['x'], {'loc': '(0)', 'scale': '(1)'}), '(x, loc=0, scale=1)\n', (243, 262), False, 'from scipy.stats import norm\n'), ((319, 346), 'scipy.stats.norm.fit', 'norm.fit', (['y'], {'loc': '(0)', 'scale': '(1)'}), '(y, loc=0, scale=1)\n', (327, 346), False, 'from scipy.stat...
import torch.utils.data as data import torch import numpy as np import os from os import listdir from os.path import join from PIL import Image, ImageOps, ImageEnhance import random import re import json import math import torch.nn.functional as F def is_image_file(filename): return any(filename.endswith(extension...
[ "PIL.Image.open", "os.listdir", "numpy.float32", "random.randrange", "os.path.join", "os.path.split", "json.load", "torch.tensor", "numpy.zeros", "numpy.cos", "PIL.ImageOps.flip", "numpy.sin", "random.randint", "torch.rand" ]
[((6182, 6195), 'numpy.cos', 'np.cos', (['theta'], {}), '(theta)\n', (6188, 6195), True, 'import numpy as np\n'), ((6243, 6256), 'numpy.sin', 'np.sin', (['theta'], {}), '(theta)\n', (6249, 6256), True, 'import numpy as np\n'), ((6273, 6286), 'numpy.cos', 'np.cos', (['theta'], {}), '(theta)\n', (6279, 6286), True, 'impo...
#!/usr/bin/env python """detector.py: module is dedicated to all detector functions.""" __author__ = "<NAME>." __copyright__ = "Copyright 2020, SuperDARN@VT" __credits__ = [] __license__ = "MIT" __version__ = "1.0." __maintainer__ = "<NAME>." __email__ = "<EMAIL>" __status__ = "Research" import os import datetime as...
[ "numpy.log10", "pandas.read_csv", "numpy.array", "datetime.timedelta", "numpy.gradient", "datetime.datetime", "os.path.exists", "json.dumps", "plotlib.plot_fit_data_with_scores", "traceback.print_exc", "numpy.abs", "uuid.uuid1", "pandas.DataFrame.from_records", "numpy.median", "numpy.qua...
[((615, 627), 'json.load', 'json.load', (['f'], {}), '(f)\n', (624, 627), False, 'import json\n'), ((11753, 11774), 'multiprocessing.Pool', 'Pool', ([], {'processes': 'procs'}), '(processes=procs)\n', (11757, 11774), False, 'from multiprocessing import Pool\n'), ((12629, 12650), 'multiprocessing.Pool', 'Pool', ([], {'p...
# -*- coding: utf-8 -*- """Test for updater.kalman module""" import pytest import numpy as np from stonesoup.models.measurement.linear import LinearGaussian from stonesoup.types.detection import Detection from stonesoup.types.hypothesis import SingleHypothesis from stonesoup.types.prediction import ( GaussianState...
[ "stonesoup.types.state.GaussianState", "numpy.allclose", "stonesoup.updater.kalman.SqrtKalmanUpdater", "numpy.array", "numpy.linalg.inv", "numpy.array_equal", "stonesoup.updater.kalman.KalmanUpdater", "numpy.linalg.cholesky", "stonesoup.types.hypothesis.SingleHypothesis" ]
[((3165, 3365), 'stonesoup.types.state.GaussianState', 'GaussianState', (['(prediction.mean + kalman_gain @ (measurement.state_vector -\n eval_measurement_prediction.mean))', '(prediction.covar - kalman_gain @ eval_measurement_prediction.covar @\n kalman_gain.T)'], {}), '(prediction.mean + kalman_gain @ (measurem...
# setupPly.py --- # # Description: # Author: <NAME> # Date: 28 Jun 2019 # https://arxiv.org/abs/1904.01701 # # Instituto Superior Técnico (IST) # Code: import open3d as o3d import argparse import os from glob import glob import pickle from global_registration import preprocess_point_cloud, execute_global_registratio...
[ "numpy.trace", "open3d.PointCloud", "numpy.array", "open3d.Vector2iVector", "numpy.linalg.norm", "copy.deepcopy", "global_registration.execute_global_registration", "numpy.arange", "open3d.TransformationEstimationPointToPoint", "open3d.VisualizerWithEditing", "argparse.ArgumentParser", "numpy....
[((407, 432), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (430, 432), False, 'import argparse\n'), ((939, 964), 'os.path.join', 'os.path.join', (['path', 'depth'], {}), '(path, depth)\n', (951, 964), False, 'import os\n'), ((1006, 1029), 'os.path.join', 'os.path.join', (['path', 'rgb'], {}),...
from aoc2020 import * from aoc2020.utils import math_product from itertools import chain import numpy as np def tborder(tile): _, m = tile return "".join(m[0]) def bborder(tile): _, m = tile return "".join(m[-1]) def lborder(tile): _, m = tile return "".join(m[:,0]) def rborder(tile): ...
[ "numpy.fliplr", "numpy.array", "aoc2020.utils.math_product", "numpy.rot90" ]
[((517, 529), 'numpy.fliplr', 'np.fliplr', (['m'], {}), '(m)\n', (526, 529), True, 'import numpy as np\n'), ((727, 817), 'aoc2020.utils.math_product', 'math_product', (['[image_table[y][x][0] for x, y in [(0, 0), (0, -1), (-1, 0), (-1, -1)]]'], {}), '([image_table[y][x][0] for x, y in [(0, 0), (0, -1), (-1, 0), (\n ...
from IMLearn.learners import UnivariateGaussian, MultivariateGaussian import numpy as np import plotly.graph_objects as go import plotly.io as pio pio.templates.default = "simple_white" def test_univariate_gaussian(): # Question 1 - Draw samples and print fitted model sample = np.random.normal(10, 1, 1000) ...
[ "numpy.random.normal", "plotly.graph_objects.Heatmap", "numpy.random.multivariate_normal", "numpy.sort", "numpy.argmax", "plotly.graph_objects.Figure", "numpy.array", "numpy.linspace", "plotly.graph_objects.Scatter", "numpy.random.seed", "numpy.shape", "IMLearn.learners.UnivariateGaussian", ...
[((288, 317), 'numpy.random.normal', 'np.random.normal', (['(10)', '(1)', '(1000)'], {}), '(10, 1, 1000)\n', (304, 317), True, 'import numpy as np\n'), ((327, 347), 'IMLearn.learners.UnivariateGaussian', 'UnivariateGaussian', ([], {}), '()\n', (345, 347), False, 'from IMLearn.learners import UnivariateGaussian, Multiva...
from math import exp import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split class LR(): def __init__(self,max_iterator=200,learning_rate = 0.01): self.max_iterator = max_iterator self.learning...
[ "math.exp", "numpy.dot", "numpy.transpose", "numpy.hstack" ]
[((597, 627), 'numpy.hstack', 'np.hstack', (['(pad, data_feature)'], {}), '((pad, data_feature))\n', (606, 627), True, 'import numpy as np\n'), ((1507, 1530), 'numpy.dot', 'np.dot', (['x', 'self.weights'], {}), '(x, self.weights)\n', (1513, 1530), True, 'import numpy as np\n'), ((387, 394), 'math.exp', 'exp', (['(-x)']...
import numpy as np from torch.utils.data import Dataset import jsonlines import json import random from tqdm import tqdm import pandas as pd try: from vocab_gen import * except ImportError: from datasets.vocab_gen import * class YelpDataset(Dataset): def __init__(self, jsonl_file:str, tokenizer=None, max_...
[ "random.shuffle", "json.dump", "tqdm.tqdm", "numpy.asarray", "jsonlines.open", "numpy.array", "numpy.savetxt", "pandas.read_json" ]
[((5103, 5130), 'tqdm.tqdm', 'tqdm', (['training_yelp.reviews'], {}), '(training_yelp.reviews)\n', (5107, 5130), False, 'from tqdm import tqdm\n'), ((2582, 2598), 'numpy.array', 'np.array', (['review'], {}), '(review)\n', (2590, 2598), True, 'import numpy as np\n'), ((2914, 2942), 'random.shuffle', 'random.shuffle', ([...
import os, numpy as np class CMIP6_models: total_num = 0 instances = [] file_path = './' def __init__(self, Name, Res, Grids, CaseList, VarLab): self.__class__.instances.append(self) self.Name = Name self.Res = Res self.Grids = Grids self.CaseList = CaseList ...
[ "os.listdir", "numpy.unique" ]
[((840, 861), 'os.listdir', 'os.listdir', (['data_path'], {}), '(data_path)\n', (850, 861), False, 'import os, numpy as np\n'), ((1041, 1061), 'numpy.unique', 'np.unique', (['timestamp'], {}), '(timestamp)\n', (1050, 1061), True, 'import os, numpy as np\n')]
# pip install pycocotools opencv-python opencv-contrib-python # wget https://github.com/opencv/opencv_extra/raw/master/testdata/cv/ximgproc/model.yml.gz import os import copy import time import argparse import contextlib import multiprocessing import numpy as np import cv2 import cv2.ximgproc import matplotlib.patc...
[ "pycocotools.cocoeval.COCOeval", "numpy.array", "copy.deepcopy", "matplotlib.pyplot.imshow", "os.path.exists", "cv2.ximgproc.createStructuredEdgeDetection", "argparse.ArgumentParser", "numpy.asarray", "pycocotools.coco.COCO", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "cv2.ximgproc.s...
[((548, 560), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (558, 560), True, 'import matplotlib.pyplot as plt\n'), ((565, 580), 'matplotlib.pyplot.imshow', 'plt.imshow', (['img'], {}), '(img)\n', (575, 580), True, 'import matplotlib.pyplot as plt\n'), ((585, 600), 'matplotlib.pyplot.axis', 'plt.axis', ([...
import numpy as np import os import csv import sys import tensorflow as tf import matplotlib.pyplot as plt from sklearn.decomposition import PCA from keras.callbacks import EarlyStopping, Callback from keras.models import Model, Sequential, load_model from keras.layers import Input, Dense, Dropout, Fla...
[ "keras.backend.sum", "math.sqrt", "scipy.stats.pearsonr", "keras.layers.Dense", "numpy.mean", "numpy.delete", "keras.utils.plot_model", "keras.backend.square", "numpy.asarray", "os.path.isdir", "os.mkdir", "numpy.concatenate", "keras.models.Model", "sklearn.metrics.mean_absolute_error", ...
[((3941, 3983), 'numpy.load', 'np.load', (['"""outliers.npy"""'], {'allow_pickle': '(True)'}), "('outliers.npy', allow_pickle=True)\n", (3948, 3983), True, 'import numpy as np\n'), ((3991, 4033), 'numpy.load', 'np.load', (['"""X_ab_aux.npy"""'], {'allow_pickle': '(True)'}), "('X_ab_aux.npy', allow_pickle=True)\n", (399...
# coding: utf-8 # In[7]: import numpy as np from sklearn import cluster from scipy.cluster.vq import whiten k = 50 kextra = 10 num_recs = 645 seed = 2 segment_file = open('bird_data/supplemental_data/segment_features.txt', 'r') ##clean line = segment_file.readline() line = segment...
[ "scipy.cluster.vq.whiten", "numpy.zeros", "sklearn.cluster.KMeans", "numpy.vstack" ]
[((915, 934), 'scipy.cluster.vq.whiten', 'whiten', (['segfeatures'], {}), '(segfeatures)\n', (921, 934), False, 'from scipy.cluster.vq import whiten\n'), ((982, 1075), 'sklearn.cluster.KMeans', 'cluster.KMeans', ([], {'n_clusters': 'k', 'init': '"""k-means++"""', 'n_init': 'k', 'max_iter': '(300)', 'random_state': 'see...
import numpy as np import cmath from matplotlib import pyplot as plt def f(x): return 10/(1+(10*x - 5)**2) def reverse_bit(n): return int('{:08b}'.format(n)[::-1], 2) def fft(f_k): N = len(f_k) if N >= 2: first_half = f_k[0:N//2] second_half = f_k[N//2:N] first = fft(first...
[ "numpy.sqrt", "numpy.arange", "matplotlib.pyplot.plot", "numpy.append", "numpy.exp", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((784, 817), 'matplotlib.pyplot.plot', 'plt.plot', (['real'], {'label': '"""Real part"""'}), "(real, label='Real part')\n", (792, 817), True, 'from matplotlib import pyplot as plt\n'), ((818, 856), 'matplotlib.pyplot.plot', 'plt.plot', (['imag'], {'label': '"""Imaginary part"""'}), "(imag, label='Imaginary part')\n", ...
import argparse import pandas as pd import matplotlib import matplotlib.pyplot as plt import numpy as np import os def plot_controller_data(data_file): data = pd.read_csv(data_file, skiprows=[1]) font = {'family': 'Source Sans Pro', 'size': 12, 'weight': 'light'} matplotlib.rc('font', **font) matplot...
[ "matplotlib.pyplot.savefig", "pandas.read_csv", "argparse.ArgumentParser", "matplotlib.pyplot.close", "os.path.normpath", "matplotlib.pyplot.figure", "numpy.linspace", "matplotlib.rc" ]
[((165, 201), 'pandas.read_csv', 'pd.read_csv', (['data_file'], {'skiprows': '[1]'}), '(data_file, skiprows=[1])\n', (176, 201), True, 'import pandas as pd\n'), ((279, 308), 'matplotlib.rc', 'matplotlib.rc', (['"""font"""'], {}), "('font', **font)\n", (292, 308), False, 'import matplotlib\n'), ((631, 658), 'matplotlib....
# coding: utf-8 # In[2]: import keras import scipy as sp import scipy.misc, scipy.ndimage.interpolation from medpy import metric import numpy as np import os from keras import losses import tensorflow as tf from keras.models import Model from keras.layers import Input,merge, concatenate, Conv2D, MaxPoo...
[ "keras.models.load_model", "csv.writer", "numpy.array", "cv2.resize", "glob.glob" ]
[((1034, 1077), 'keras.models.load_model', 'load_model', (['"""basic_dense_net_dsp_round2.h5"""'], {}), "('basic_dense_net_dsp_round2.h5')\n", (1044, 1077), False, 'from keras.models import load_model\n'), ((1318, 1362), 'glob.glob', 'glob.glob', (['"""/home/rdey/dsp_final/test/*.jpg"""'], {}), "('/home/rdey/dsp_final/...
# GR2 test from Liv Rev import numpy from models import sr_mf from bcs import outflow from simulation import simulation from methods import fvs_method from rk import rk3 from grid import grid from matplotlib import pyplot Ngz = 3 Npoints = 800 L = 0.5 interval = grid([-L, L], Npoints, Ngz) rhoL = 1 pL = 1 rhoR = 0.1...
[ "numpy.random.rand", "grid.grid", "numpy.zeros_like", "numpy.array", "numpy.cos", "numpy.linalg.norm", "numpy.sin", "models.sr_mf.initial_riemann", "numpy.random.randn" ]
[((265, 292), 'grid.grid', 'grid', (['[-L, L]', 'Npoints', 'Ngz'], {}), '([-L, L], Npoints, Ngz)\n', (269, 292), False, 'from grid import grid\n'), ((648, 740), 'numpy.array', 'numpy.array', (['[rhoL_e, 0, 0, 0, epsL, rhoL_p, 0, 0, 0, epsL, Bx, ByL, BzL, 0, 0, 0, 0, 0]'], {}), '([rhoL_e, 0, 0, 0, epsL, rhoL_p, 0, 0, 0,...
# Compartments are created here. # NOT USED YET import tkinter as tk from matplotlib import pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure import matplotlib from tkinter import messagebox import test import numpy as np class CreateCompartmentWindow()...
[ "test.get_to_draw", "test.get_grid", "tkinter.Button", "numpy.max", "matplotlib.pyplot.figure", "tkinter.Tk", "numpy.min", "matplotlib.pyplot.suptitle", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg" ]
[((6467, 6474), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (6472, 6474), True, 'import tkinter as tk\n'), ((1844, 1856), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1854, 1856), True, 'from matplotlib import pyplot as plt\n'), ((1908, 1942), 'matplotlib.backends.backend_tkagg.FigureCanvasTkAgg', 'FigureC...
# MIT License # # Copyright (c) 2017-2019 <NAME> # # 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, ...
[ "tindetheus.machine_learning.calc_avg_emb", "tindetheus.image_processing.show_images", "numpy.array", "tindetheus.facenet_clone.facenet.load_model", "os.path.exists", "tensorflow.Graph", "argparse.ArgumentParser", "tensorflow.Session", "tindetheus.image_processing.al_copy_images", "tindetheus.tind...
[((9981, 10086), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'help_text', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=help_text, formatter_class=argparse.\n RawDescriptionHelpFormatter)\n', (10004, 10086), False, 'import argparse\n'), ((2763, 2870), 'tind...
import sys import csv import MeCab import numpy as np class CalcSim_MeCab: def __init__(self): pass def cos_sim(self, x, y): val = np.sqrt(np.sum(x**2)) * np.sqrt(np.sum(y**2)) return np.dot(x, y) / val if val != 0 else 0 def WordFrequencyCount(self, word, wordFre...
[ "MeCab.Tagger", "numpy.sum", "numpy.dot", "csv.reader" ]
[((5678, 5792), 'csv.reader', 'csv.reader', (['f_in'], {'delimiter': '""","""', 'doublequote': '(True)', 'lineterminator': "'\\r\\n'", 'quotechar': '"""\\""""', 'skipinitialspace': '(True)'}), '(f_in, delimiter=\',\', doublequote=True, lineterminator=\'\\r\\n\',\n quotechar=\'"\', skipinitialspace=True)\n', (5688, 5...
import h5py import numpy as np def load_stdata(fname): f = h5py.File(fname, 'r') data = f['data'].value timestamps = f['date'].value f.close() return data, timestamps data,timestamps = load_stdata('NYC14_M16x8_T60_NewEnd.h5') # print(data,timestamps) data = np.ndarray.tolist(data) timestamps = np.n...
[ "numpy.ndarray.tolist", "h5py.File" ]
[((279, 302), 'numpy.ndarray.tolist', 'np.ndarray.tolist', (['data'], {}), '(data)\n', (296, 302), True, 'import numpy as np\n'), ((316, 345), 'numpy.ndarray.tolist', 'np.ndarray.tolist', (['timestamps'], {}), '(timestamps)\n', (333, 345), True, 'import numpy as np\n'), ((63, 84), 'h5py.File', 'h5py.File', (['fname', '...