code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
from abc import ABC import numpy as np from pydyn.base.expr import Expression, Expr, Manifold from pydyn.operations.transpose import Transpose from pydyn.utils.errors import UndefinedCaseError, ExpressionMismatchError class MatrixExpr(Expr, ABC): def __init__(self): super().__init__() self.type =...
[ "pydyn.operations.transpose.Transpose", "pydyn.base.vectors.TSO3", "numpy.empty", "pydyn.operations.geometry.Delta", "pydyn.base.vectors.Vector", "pydyn.operations.multiplication.MVMul", "pydyn.operations.multiplication.MMMul", "pydyn.operations.multiplication.SMMul", "pydyn.operations.addition.MAdd...
[((494, 511), 'pydyn.operations.addition.MAdd', 'MAdd', (['self', 'other'], {}), '(self, other)\n', (498, 511), False, 'from pydyn.operations.addition import MAdd\n'), ((610, 627), 'pydyn.operations.addition.MAdd', 'MAdd', (['self', 'other'], {}), '(self, other)\n', (614, 627), False, 'from pydyn.operations.addition im...
# processing the SA2 and road shapefiles # inputs: raw SA2 and road shapefiles # Outputs: Adelaide SA2 nodal and link dataframes with transport information # Outputs are pickles: # sa2_node_with_only_transport_attributes.pickle # sa2_edge_with_only_transport_attributes.pickle # Processin...
[ "sys.path.append", "pysal.lib.weights.distance.Kernel.from_dataframe", "pickle.dump", "pandas.DataFrame", "numpy.sum", "utilities.compute_intersection_attributes", "os.getcwd", "utilities.compute_road_attributes", "pandas.MultiIndex.from_product", "shapely.geometry.LineString", "geopandas.GeoDat...
[((841, 870), 'sys.path.append', 'sys.path.append', (['utility_path'], {}), '(utility_path)\n', (856, 870), False, 'import sys\n'), ((1279, 1333), 'geopandas.read_file', 'gpd.read_file', (["(raw_data_path + 'sa2/SA2_2016_AUST.shp')"], {}), "(raw_data_path + 'sa2/SA2_2016_AUST.shp')\n", (1292, 1333), True, 'import geopa...
'''Example streaming ffmpeg numpy processing. Based on examples from https://github.com/kkroening/ffmpeg-python/tree/master/examples Usage instructions: 1. Install opencv, ffmpeg-python and numpy 2. Run python ffmpeg_stream.py input_file 3. In separate terminal run ffplay -f avi http://localhost:8080 (after enabling ...
[ "threading.Thread", "subprocess.Popen", "os.remove", "argparse.ArgumentParser", "logging.basicConfig", "numpy.frombuffer", "os.path.exists", "ffmpeg.output", "ffmpeg.probe", "os.mkfifo", "ffmpeg.input", "logging.getLogger" ]
[((1704, 1789), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Example streaming ffmpeg numpy processing"""'}), "(description='Example streaming ffmpeg numpy processing'\n )\n", (1727, 1789), False, 'import argparse\n'), ((1908, 1935), 'logging.getLogger', 'logging.getLogger', (['__na...
#!/usr/bin/env python import rospy # import sys from std_msgs.msg import ColorRGBA from geometry_msgs.msg import PoseStamped, Twist, Vector3, Point from ford_msgs.msg import Clusters from visualization_msgs.msg import Marker, MarkerArray import numpy as np import math from nav_msgs.msg import Odometry import configpa...
[ "geometry_msgs.msg.Vector3", "crowd_nav.policy.sarl.SARL", "rospy.Subscriber", "numpy.arctan2", "numpy.linalg.norm", "std_msgs.msg.ColorRGBA", "rospy.Duration", "geometry_msgs.msg.PoseStamped", "crowd_sim.envs.utils.robot.Robot", "rospy.Time.now", "configparser.RawConfigParser", "torch.load", ...
[((10476, 10506), 'configparser.RawConfigParser', 'configparser.RawConfigParser', ([], {}), '()\n', (10504, 10506), False, 'import configparser\n'), ((10768, 10798), 'configparser.RawConfigParser', 'configparser.RawConfigParser', ([], {}), '()\n', (10796, 10798), False, 'import configparser\n'), ((10846, 10869), 'gym.m...
# standard imports import logging from sklearn.metrics.cluster import homogeneity_score, completeness_score import numpy import matplotlib.pyplot as plt # our imports import emission.analysis.modelling.tour_model.cluster_pipeline as cp import emission.analysis.modelling.tour_model.similarity as similarity """ Functi...
[ "sklearn.metrics.cluster.completeness_score", "emission.analysis.modelling.tour_model.similarity.similarity", "logging.debug", "emission.analysis.modelling.tour_model.cluster_pipeline.remove_noise", "pygmaps.maps", "emission.analysis.modelling.tour_model.cluster_pipeline.read_data", "numpy.array", "sk...
[((1778, 1811), 'sklearn.metrics.cluster.homogeneity_score', 'homogeneity_score', (['colors', 'labels'], {}), '(colors, labels)\n', (1795, 1811), False, 'from sklearn.metrics.cluster import homogeneity_score, completeness_score\n'), ((1820, 1854), 'sklearn.metrics.cluster.completeness_score', 'completeness_score', (['c...
import numpy as np from pandas import DataFrame import matplotlib.pyplot as py class ca(object): ''' Docstring for function ecopy.ca ==================== Conducts correspondance analysis (CA). User supplies an observation x descriptor matrix. Use ---- ca(x, siteNames=None, spNames...
[ "pandas.DataFrame", "matplotlib.pyplot.show", "numpy.sum", "numpy.amin", "numpy.isnan", "numpy.amax", "numpy.cumsum", "numpy.min", "numpy.array", "numpy.diag", "matplotlib.pyplot.subplots", "numpy.vstack", "numpy.sqrt" ]
[((6821, 6840), 'numpy.sqrt', 'np.sqrt', (['self.evals'], {}), '(self.evals)\n', (6828, 6840), True, 'import numpy as np\n'), ((7352, 7365), 'matplotlib.pyplot.subplots', 'py.subplots', ([], {}), '()\n', (7363, 7365), True, 'import matplotlib.pyplot as py\n'), ((8922, 8931), 'matplotlib.pyplot.show', 'py.show', ([], {}...
'''Class to find shapes in gray image with cv2''' # import the necessary packages import argparse import cv2 as cv2 import os import numpy as np from PIL import Image result = [0] *256 image_path = '../resources/'+os.getenv('IMAGE', 'sample.bin') xbash = np.fromfile(image_path, dtype='uint8') #print(xbash.shape) ima...
[ "cv2.GaussianBlur", "cv2.approxPolyDP", "cv2.erode", "cv2.imshow", "cv2.cvtColor", "cv2.copyMakeBorder", "cv2.drawContours", "cv2.mean", "cv2.resize", "cv2.circle", "cv2.waitKey", "os.getenv", "cv2.putText", "numpy.fromfile", "cv2.threshold", "cv2.moments", "numpy.zeros", "PIL.Imag...
[((258, 296), 'numpy.fromfile', 'np.fromfile', (['image_path'], {'dtype': '"""uint8"""'}), "(image_path, dtype='uint8')\n", (269, 296), True, 'import numpy as np\n'), ((827, 849), 'PIL.Image.fromarray', 'Image.fromarray', (['array'], {}), '(array)\n', (842, 849), False, 'from PIL import Image\n'), ((883, 905), 'cv2.imr...
from PIL import Image import PIL.ImageOps import numpy as np import tensorflow as tf import time ## 시간측정 시작 stime = time.time() ### 학습모델 불러오기 model = tf.keras.models.load_model('my_model.h5') # model.summary() ### 유효영역 자르기 img = PIL.ImageOps.invert(Image.open('sample.bmp')).convert("1") Newimg = np.asarray(img.crop(...
[ "tensorflow.keras.models.load_model", "numpy.amin", "numpy.argmax", "numpy.asarray", "numpy.zeros", "time.time", "numpy.amax", "numpy.argwhere", "PIL.Image.open", "numpy.mean", "numpy.array", "PIL.Image.fromarray" ]
[((117, 128), 'time.time', 'time.time', ([], {}), '()\n', (126, 128), False, 'import time\n'), ((152, 193), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (['"""my_model.h5"""'], {}), "('my_model.h5')\n", (178, 193), True, 'import tensorflow as tf\n'), ((1977, 2023), 'numpy.array', 'np.array', (['[...
''' Useful functions for combined signal strategy ''' import numpy as np def get_split_w_threshold(alpha, normalization='exponential'): """ Get normalize weights and thresholds from alpha vector :param alpha: optimize Vectorize :return: weights and thresholds """ w = [] if normalization ...
[ "numpy.array" ]
[((1541, 1552), 'numpy.array', 'np.array', (['w'], {}), '(w)\n', (1549, 1552), True, 'import numpy as np\n'), ((1553, 1574), 'numpy.array', 'np.array', (['signal_list'], {}), '(signal_list)\n', (1561, 1574), True, 'import numpy as np\n')]
#!/usr/bin/env python2.7 from __future__ import print_function, division import numpy as np import scipy as sp import matplotlib.pyplot as plt import matplotlib.colors as clr import dtk import h5py import time import sys def plot_mag_dust(mag_delta, mag, name,obs= False,ybins=None): plt.figure() if obs: ...
[ "h5py.File", "matplotlib.pyplot.show", "numpy.histogram2d", "time.time", "matplotlib.pyplot.figure", "dtk.Param", "matplotlib.colors.LogNorm", "numpy.linspace", "matplotlib.pyplot.ylabel", "numpy.log10", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid" ]
[((290, 302), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (300, 302), True, 'import matplotlib.pyplot as plt\n'), ((485, 536), 'numpy.histogram2d', 'np.histogram2d', (['mag', 'mag_delta'], {'bins': '(xbins, ybins)'}), '(mag, mag_delta, bins=(xbins, ybins))\n', (499, 536), True, 'import numpy as np\n'), ...
# coding: utf-8 # DO NOT EDIT # Autogenerated from the notebook glm.ipynb. # Edit the notebook and then sync the output with this file. # # flake8: noqa # DO NOT EDIT # # 广义线性模型 import numpy as np import statsmodels.api as sm from scipy import stats from matplotlib import pyplot as plt # ## GLM: 二项式响应数据 # # ### 加载数...
[ "numpy.random.seed", "scipy.stats.zscore", "statsmodels.api.families.Binomial", "scipy.stats.scoreatpercentile", "statsmodels.api.families.Gamma", "numpy.column_stack", "statsmodels.graphics.gofplots.qqplot", "numpy.arange", "numpy.exp", "statsmodels.graphics.api.abline_plot", "statsmodels.api.d...
[((474, 499), 'statsmodels.api.datasets.star98.load', 'sm.datasets.star98.load', ([], {}), '()\n', (497, 499), True, 'import statsmodels.api as sm\n'), ((512, 553), 'statsmodels.api.add_constant', 'sm.add_constant', (['data.exog'], {'prepend': '(False)'}), '(data.exog, prepend=False)\n', (527, 553), True, 'import stats...
import sapien.core as sapien import mplib import numpy as np from sapien.utils.viewer import Viewer class PlanningDemo(): def __init__(self): self.engine = sapien.Engine() self.renderer = sapien.VulkanRenderer() self.engine.set_renderer(self.renderer) scene_config = sapien.SceneCon...
[ "sapien.core.SceneConfig", "trimesh.sample.sample_surface", "numpy.ones", "sapien.core.Pose", "trimesh.creation.box", "sapien.utils.viewer.Viewer", "sapien.core.Engine", "sapien.core.VulkanRenderer" ]
[((169, 184), 'sapien.core.Engine', 'sapien.Engine', ([], {}), '()\n', (182, 184), True, 'import sapien.core as sapien\n'), ((209, 232), 'sapien.core.VulkanRenderer', 'sapien.VulkanRenderer', ([], {}), '()\n', (230, 232), True, 'import sapien.core as sapien\n'), ((305, 325), 'sapien.core.SceneConfig', 'sapien.SceneConf...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """ Generating random graphs""" from cyberbattle.simulation.model import Identifiers, NodeID, CredentialID, PortName, FirewallConfiguration, FirewallRule, RulePermission import numpy as np import networkx as nx from cyberbattle.simulation import ...
[ "cyberbattle.simulation.model.ListeningService", "numpy.random.seed", "random.randint", "numpy.random.beta", "numpy.float32", "random.choice", "cyberbattle.simulation.model.Identifiers", "cyberbattle.simulation.model.FirewallRule", "collections.defaultdict", "networkx.stochastic_block_model", "r...
[((455, 709), 'cyberbattle.simulation.model.Identifiers', 'Identifiers', ([], {'properties': "['breach_node']", 'ports': "['SMB', 'HTTP', 'RDP']", 'local_vulnerabilities': "['ScanWindowsCredentialManagerForRDP', 'ScanWindowsExplorerRecentFiles',\n 'ScanWindowsCredentialManagerForSMB']", 'remote_vulnerabilities': "['...
"""The :func:`deephyper.nas.run.horovod.run` function is used to evaluate a deep neural network by enabling data-parallelism with Horovod to the :func:`deephyper.nas.run.alpha.run` function. This function will automatically apply the linear scaling rule to the learning rate and batch size given the current number of ra...
[ "tensorflow.random.set_seed", "numpy.random.seed", "tensorflow.config.threading.set_intra_op_parallelism_threads", "horovod.tensorflow.keras.callbacks.MetricAverageCallback", "deephyper.nas.run._util.get_search_space", "horovod.tensorflow.keras.callbacks.LearningRateWarmupCallback", "deephyper.nas.run._...
[((851, 878), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (868, 878), False, 'import logging\n'), ((1841, 1851), 'horovod.tensorflow.keras.init', 'hvd.init', ([], {}), '()\n', (1849, 1851), True, 'import horovod.tensorflow.keras as hvd\n'), ((2549, 2568), 'deephyper.nas.run._util.load_...
import numpy as np def distances_to_point(lat_point, lon_point, lats, lons): """Method to calculate distances between a project and an array of lats and lons :Parameters: lat_project: float Project latitude lon_project: float Project longitude lats: np.array ...
[ "numpy.sin", "numpy.sqrt", "numpy.cos", "numpy.deg2rad" ]
[((523, 544), 'numpy.deg2rad', 'np.deg2rad', (['lat_point'], {}), '(lat_point)\n', (533, 544), True, 'import numpy as np\n'), ((562, 583), 'numpy.deg2rad', 'np.deg2rad', (['lon_point'], {}), '(lon_point)\n', (572, 583), True, 'import numpy as np\n'), ((634, 650), 'numpy.deg2rad', 'np.deg2rad', (['lats'], {}), '(lats)\n...
# array module example import sample import array a = array.array('d', [1, -3, 4, 7, 2, 0]) PETSc.Sys.Print(a) sample.clip(a, 1, 4, a) PETSc.Sys.Print(a) # numpy example import numpy b = numpy.random.uniform(-10, 10, size=1000000) PETSc.Sys.Print(b) c = numpy.zeros_like(b) PETSc.Sys.Print(c) sample.c...
[ "numpy.random.uniform", "numpy.zeros_like", "sample.clip2d", "array.array", "timeit.timeit", "sample.clip" ]
[((59, 96), 'array.array', 'array.array', (['"""d"""', '[1, -3, 4, 7, 2, 0]'], {}), "('d', [1, -3, 4, 7, 2, 0])\n", (70, 96), False, 'import array\n'), ((118, 141), 'sample.clip', 'sample.clip', (['a', '(1)', '(4)', 'a'], {}), '(a, 1, 4, a)\n', (129, 141), False, 'import sample\n'), ((202, 245), 'numpy.random.uniform',...
from random import randint, choice from math import sin, cos, radians, exp, sqrt, fabs import pygame from pygame.sprite import Sprite # from pygame.math import vec2d from utils import SIM_COLORS, SCALE, SIGN from utils import euclidean_distance, vec2d, Rotate2D import numpy as np class Agent(Sprite): """ A agent...
[ "utils.SIGN", "math.exp", "pygame.draw.line", "utils.vec2d", "math.radians", "utils.euclidean_distance", "numpy.array", "pygame.sprite.Sprite.__init__" ]
[((2015, 2036), 'pygame.sprite.Sprite.__init__', 'Sprite.__init__', (['self'], {}), '(self)\n', (2030, 2036), False, 'from pygame.sprite import Sprite\n'), ((2487, 2507), 'utils.vec2d', 'vec2d', (['init_position'], {}), '(init_position)\n', (2492, 2507), False, 'from utils import euclidean_distance, vec2d, Rotate2D\n')...
# Copyright 2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
[ "nnabla.functions.max_pooling", "nnabla.functions.concatenate", "nnabla.parametric_functions.deconvolution", "models.networks.initializers.bilinear_depthwise_initializer", "numpy.transpose", "nnabla.functions.relu", "numpy.random.RandomState", "nnabla.logger.logger.debug", "nnabla.functions.reshape"...
[((1166, 1192), 'numpy.random.RandomState', 'np.random.RandomState', (['(214)'], {}), '(214)\n', (1187, 1192), True, 'import numpy as np\n'), ((1483, 1665), 'nnabla.parametric_functions.deconvolution', 'PF.deconvolution', (['x', 'out_map', 'kernel'], {'pad': 'pad', 'stride': 'stride', 'dilation': 'dilation', 'w_init': ...
""" This module implements plotting functions useful to report analysis results. Author: <NAME>, <NAME>, 2017 """ import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches import pandas as pd from nilearn.glm.first_level import check_design_matrix from nilearn.glm.contrasts import expr...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.savefig", "numpy.abs", "matplotlib.pyplot.get_cmap", "numpy.sum", "matplotlib.pyplot.close", "nilearn.glm.first_level.check_design_matrix", "matplotlib.pyplot.subplots", "matplotlib.pyplot.colorbar", "nilearn.glm.contrasts.expression_to_contrast_vect...
[((1283, 1317), 'nilearn.glm.first_level.check_design_matrix', 'check_design_matrix', (['design_matrix'], {}), '(design_matrix)\n', (1302, 1317), False, 'from nilearn.glm.first_level import check_design_matrix\n'), ((2132, 2150), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (2148, 2150), True...
import pandas as pd import numpy as np import pickle import json from sklearn.metrics import mean_squared_error, mean_absolute_error from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from keras.models import Model from keras.optimizers import RMSprop, Adam from keras....
[ "pandas.read_csv", "keras.preprocessing.sequence.pad_sequences", "sklearn.model_selection.train_test_split", "numpy.zeros", "sklearn.preprocessing.LabelEncoder", "keras.preprocessing.text.Tokenizer", "gensim.models.KeyedVectors.load_word2vec_format", "deepmm.models.DeepMultimodalModel", "numpy.sqrt"...
[((687, 710), 'pandas.read_csv', 'pd.read_csv', (['"""data.csv"""'], {}), "('data.csv')\n", (698, 710), True, 'import pandas as pd\n'), ((748, 803), 'gensim.models.KeyedVectors.load_word2vec_format', 'KeyedVectors.load_word2vec_format', (['"""embeddings_w2v.txt"""'], {}), "('embeddings_w2v.txt')\n", (781, 803), False, ...
import matplotlib.pyplot as plt import numpy as np from mode_shape import make_dir from scipy.interpolate import spline num = 300 fre = 2 scale = 1 x = np.arange(0,101) mode1 = np.sin(x*2*np.pi/100) mode2 = np.sin(x*np.pi/100) xnew = np.linspace(x.min(),x.max(),300) #4 0.01 result_path = 'data/1+2_scale_%0.1f_...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.plot", "scipy.interpolate.spline", "mode_shape.make_dir", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "numpy.sin", "numpy.arange", "matplotlib.pyplot.savefig" ]
[((159, 176), 'numpy.arange', 'np.arange', (['(0)', '(101)'], {}), '(0, 101)\n', (168, 176), True, 'import numpy as np\n'), ((184, 211), 'numpy.sin', 'np.sin', (['(x * 2 * np.pi / 100)'], {}), '(x * 2 * np.pi / 100)\n', (190, 211), True, 'import numpy as np\n'), ((214, 237), 'numpy.sin', 'np.sin', (['(x * np.pi / 100)'...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from math import pi class proposal_q(): def __init__(self, config, scope_name='proposal'): self.config = config with tf.variable_scope(scope_name...
[ "tensorflow.reduce_sum", "tensorflow.nn.relu", "tensorflow.sqrt", "tensorflow.summary.scalar", "numpy.log", "tensorflow.stop_gradient", "tensorflow.reshape", "tensorflow.reduce_mean", "tensorflow.variable_scope", "numpy.zeros", "tensorflow.placeholder", "tensorflow.matmul", "tensorflow.exp",...
[((1769, 1794), 'tensorflow.reduce_sum', 'tf.reduce_sum', (['lq'], {'axis': '(1)'}), '(lq, axis=1)\n', (1782, 1794), True, 'import tensorflow as tf\n'), ((2088, 2161), 'tensorflow.placeholder', 'tf.placeholder', ([], {'name': '"""X"""', 'dtype': 'tf.float32', 'shape': '[None, self.config.dim]'}), "(name='X', dtype=tf.f...
""" RB-related functions of gates and models """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government reta...
[ "numpy.linalg.eigvals", "pygsti.tools.optools.diamonddist", "numpy.argmax", "pygsti.tools.rbtools.p_to_r", "pygsti.tools.matrixtools.unvec", "numpy.zeros", "numpy.transpose", "numpy.amax", "numpy.sort", "numpy.mean", "numpy.linalg.inv", "numpy.array", "warnings.warn", "pygsti.tools.optools...
[((4189, 4223), 'pygsti.tools.rbtools.p_to_r', '_rbtls.p_to_r', (['p'], {'d': 'd', 'rtype': 'rtype'}), '(p, d=d, rtype=rtype)\n', (4202, 4223), True, 'from pygsti.tools import rbtools as _rbtls\n'), ((9132, 9150), 'numpy.argmax', '_np.argmax', (['absgam'], {}), '(absgam)\n', (9142, 9150), True, 'import numpy as _np\n')...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 12 08:54:32 2021 OK so far: swoosh h2o: 1994-2019 30S to 30N mean, 82 hpa regressors: QBO_CDAS = +5 months lag correlated with h2o: 0.508 Anom_nino3p4 = no lags corr with h2o: -0.167 LR: no CV does R2 of 0.2857 Cross valid...
[ "seaborn.lineplot", "sklearn.model_selection.GridSearchCV", "numpy.abs", "sklearn.model_selection.cross_validate", "sklearn.model_selection.train_test_split", "aux_functions_strat.anomalize_xr", "sklearn.metrics.r2_score", "joblib.dump", "numpy.logspace", "aux_functions_strat.path_glob", "numpy....
[((1556, 1600), 'seaborn.set_theme', 'sns.set_theme', ([], {'style': '"""ticks"""', 'font_scale': '(1.5)'}), "(style='ticks', font_scale=1.5)\n", (1569, 1600), True, 'import seaborn as sns\n'), ((1680, 1701), 'pandas.DataFrame', 'pd.DataFrame', (['df_shap'], {}), '(df_shap)\n', (1692, 1701), True, 'import pandas as pd\...
#!/usr/bin/env python """ Creates lists of molecules on a grid with a +-0.5 pixel random offset. Hazen 12/16 """ import numpy import random import storm_analysis.sa_library.sa_h5py as saH5Py def emittersOnGrid(h5_name, nx, ny, sigma, spacing, zrange, zoffset, seed = 0): if seed is not None: random.se...
[ "argparse.ArgumentParser", "storm_analysis.sa_library.sa_h5py.saveLocalizations", "numpy.zeros", "numpy.ones", "random.random", "random.seed" ]
[((1206, 1246), 'storm_analysis.sa_library.sa_h5py.saveLocalizations', 'saH5Py.saveLocalizations', (['h5_name', 'peaks'], {}), '(h5_name, peaks)\n', (1230, 1246), True, 'import storm_analysis.sa_library.sa_h5py as saH5Py\n'), ((1312, 1398), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""...
""" desisim.pixsim ============== Tools for DESI pixel level simulations using specter """ from __future__ import absolute_import, division, print_function import sys import os import os.path import random from time import asctime import socket import astropy.units as u import numpy as np import desimodel.io impo...
[ "numpy.empty", "numpy.arange", "numpy.random.normal", "multiprocessing.cpu_count", "desiutil.log.get_logger", "time.asctime", "traceback.print_exc", "astropy.io.fits.getdata", "os.path.exists", "numpy.random.RandomState", "socket.gethostname", "desiutil.iers.freeze_iers", "numpy.random.poiss...
[((457, 469), 'desiutil.log.get_logger', 'get_logger', ([], {}), '()\n', (467, 469), False, 'from desiutil.log import get_logger\n'), ((8037, 8050), 'desiutil.iers.freeze_iers', 'freeze_iers', ([], {}), '()\n', (8048, 8050), False, 'from desiutil.iers import freeze_iers\n'), ((19668, 19699), 'numpy.zeros', 'np.zeros', ...
import re import pandas as pd import numpy as np import ast import pickle import datetime from nltk.corpus import stopwords import pkg_resources # from pkg_resources import resource_string, resource_listdir def memoize(func): memory = {} def memoizer(*args, **kwargs): key = str(args) + str(kwargs) ...
[ "pandas.read_csv", "pkg_resources.resource_filename", "datetime.datetime.now", "numpy.max", "pickle.load", "nltk.corpus.stopwords.words", "ast.literal_eval", "re.sub" ]
[((839, 909), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['"""dbaicd10.resources"""', '"""dba_icd10.csv"""'], {}), "('dbaicd10.resources', 'dba_icd10.csv')\n", (870, 909), False, 'import pkg_resources\n'), ((936, 1007), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', ([...
#-*- coding: utf-8 -*- # --------------------------------------------------------------------# # --------------------------------------------------------------------# # ---------- Made by <NAME> @ircam on 11/2015 # ---------- Copyright (c) 2018 CREAM Lab // CNRS / IRCAM / Sorbonne Université # ---------- # ---------- p...
[ "os.mkdir", "os.remove", "numpy.sum", "transform_audio.extract_sentences_tags", "numpy.max", "datetime.timedelta", "soundfile.write", "subprocess.Popen", "soundfile.read", "os.path.basename", "subprocess.check_output", "os.path.realpath", "numpy.asarray", "datetime.datetime", "subprocess...
[((1006, 1034), 'os.path.basename', 'os.path.basename', (['video_file'], {}), '(video_file)\n', (1022, 1034), False, 'import os\n'), ((1212, 1248), 'subprocess.call', 'subprocess.call', (['command'], {'shell': '(True)'}), '(command, shell=True)\n', (1227, 1248), False, 'import subprocess\n'), ((1637, 1665), 'os.path.ba...
# Import essential libraries import requests import cv2 import numpy as np import imutils import mediapipe as mp import threading import pygame.mixer from pygame import * import time import os import sys import multiprocessing #Global variables definition landmarks= {'thumb': [1,2,3,4], 'index': [5,6,7,8], 'middle': [...
[ "cv2.cvtColor", "cv2.waitKey", "cv2.imdecode", "numpy.zeros", "time.time", "time.sleep", "numpy.array", "numpy.linalg.norm", "multiprocessing.Queue", "cv2.rectangle", "requests.get", "imutils.resize", "multiprocessing.Process", "cv2.imshow", "os.listdir", "sys.exit" ]
[((739, 750), 'numpy.zeros', 'np.zeros', (['(5)'], {}), '(5)\n', (747, 750), True, 'import numpy as np\n'), ((764, 775), 'numpy.zeros', 'np.zeros', (['(5)'], {}), '(5)\n', (772, 775), True, 'import numpy as np\n'), ((852, 868), 'numpy.zeros', 'np.zeros', (['(5, 2)'], {}), '((5, 2))\n', (860, 868), True, 'import numpy a...
''' Shows the grid world using pygame. Globecom Tutorial - December 7, 2021 Tutorial 29: Machine Learning for MIMO Systems with Large Arrays <NAME> (NCSU), <NAME> (UFPA) and <NAME>. (NCSU) ''' import time import matplotlib.pyplot as plt from matplotlib import colors import numpy as np import pygame as pg import pyscree...
[ "imageio.mimsave", "numpy.abs", "pygame.display.set_mode", "pyscreenshot.grab", "matplotlib.pyplot.subplots", "time.sleep", "pygame.transform.scale", "matplotlib.pyplot.figure", "pygame.image.load", "pygame.time.Clock", "matplotlib.colors.ListedColormap", "matplotlib.pyplot.savefig" ]
[((983, 1038), 'matplotlib.colors.ListedColormap', 'colors.ListedColormap', (["['gray', 'red', 'green', 'blue']"], {}), "(['gray', 'red', 'green', 'blue'])\n", (1004, 1038), False, 'from matplotlib import colors\n'), ((1093, 1105), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1103, 1105), True, 'import ...
import calendar import numpy as np import pandas as pd import os import shutil import tables import tempfile import unittest from datetime import datetime from phildb.log_handler import LogHandler class LogHandlerTest(unittest.TestCase): def setUp(self): self.tmp_dir = tempfile.mkdtemp() self.log...
[ "pandas.Timestamp", "numpy.isnan", "datetime.datetime", "tempfile.mkdtemp", "shutil.rmtree", "tables.open_file", "os.path.join", "phildb.log_handler.LogHandler" ]
[((285, 303), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (301, 303), False, 'import tempfile\n'), ((328, 371), 'os.path.join', 'os.path.join', (['self.tmp_dir', '"""log_file.hdf5"""'], {}), "(self.tmp_dir, 'log_file.hdf5')\n", (340, 371), False, 'import os\n'), ((1638, 1681), 'os.path.join', 'os.path.joi...
import numpy as np import pymc as pm challenger_data = np.genfromtxt( "../../Chapter2_MorePyMC/data/challenger_data.csv", skip_header=1, usecols=[1, 2], missing_values="NA", delimiter=",") # drop the NA values challenger_data = challenger_data[~np.isnan(challenger_data[:, 1])] temperature = challenger_data[...
[ "pymc.MAP", "pymc.Model", "numpy.genfromtxt", "pymc.MCMC", "numpy.isnan", "pymc.Bernoulli", "numpy.exp", "pymc.Normal" ]
[((57, 193), 'numpy.genfromtxt', 'np.genfromtxt', (['"""../../Chapter2_MorePyMC/data/challenger_data.csv"""'], {'skip_header': '(1)', 'usecols': '[1, 2]', 'missing_values': '"""NA"""', 'delimiter': '""","""'}), "('../../Chapter2_MorePyMC/data/challenger_data.csv',\n skip_header=1, usecols=[1, 2], missing_values='NA'...
import json import logging import time import numpy as np from sklearn.svm import OneClassSVM from sklearn.metrics import roc_auc_score from sklearn.metrics.pairwise import pairwise_distances from base.base_dataset import BaseADDataset from networks.main import build_network class OCSVM(object): """A class for O...
[ "json.dump", "networks.main.build_network", "sklearn.metrics.pairwise.pairwise_distances", "logging.getLogger", "time.time", "sklearn.metrics.roc_auc_score", "numpy.array", "sklearn.svm.OneClassSVM", "numpy.concatenate" ]
[((552, 585), 'sklearn.svm.OneClassSVM', 'OneClassSVM', ([], {'kernel': 'kernel', 'nu': 'nu'}), '(kernel=kernel, nu=nu)\n', (563, 585), False, 'from sklearn.svm import OneClassSVM\n'), ((1071, 1335), 'networks.main.build_network', 'build_network', (['"""embedding"""', 'dataset'], {'embedding_size': 'embedding_size', 'p...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """Utility methods.""" import numpy as np import pandas as pd import scipy.sparse import sparse as sp import itertools from operator import getitem from collections import defaultdict, Counter from sklearn import clone from ...
[ "statsmodels.iolib.summary.summary_return", "numpy.sum", "numpy.ravel", "numpy.iinfo", "numpy.ones", "collections.defaultdict", "numpy.shape", "numpy.arange", "numpy.tile", "sklearn.model_selection.GroupKFold", "sparse.concatenate", "sklearn.clone", "sklearn.linear_model.MultiTaskLassoCV", ...
[((959, 977), 'numpy.iinfo', 'np.iinfo', (['np.int32'], {}), '(np.int32)\n', (967, 977), True, 'import numpy as np\n'), ((14297, 14357), 'sklearn.utils.check_X_y', 'check_X_y', (['X', 'T'], {'multi_output': 'multi_output_T', 'y_numeric': '(True)'}), '(X, T, multi_output=multi_output_T, y_numeric=True)\n', (14306, 14357...
from typing import Any, Tuple, Union import numpy as np import pandas as pd def named_aggregate_summary(series: pd.Series, key: str): summary = { f"max_{key}": np.max(series), f"mean_{key}": np.mean(series), f"median_{key}": np.median(series), f"min_{key}": np.min(series), } ...
[ "numpy.abs", "numpy.sum", "numpy.count_nonzero", "numpy.median", "numpy.std", "numpy.isfinite", "numpy.isnan", "numpy.max", "numpy.mean", "numpy.min" ]
[((1053, 1080), 'numpy.isfinite', 'np.isfinite', (['present_values'], {}), '(present_values)\n', (1064, 1080), True, 'import numpy as np\n'), ((175, 189), 'numpy.max', 'np.max', (['series'], {}), '(series)\n', (181, 189), True, 'import numpy as np\n'), ((214, 229), 'numpy.mean', 'np.mean', (['series'], {}), '(series)\n...
''' Classes for BMI decoding using the Kalman filter. ''' import numpy as np from scipy.io import loadmat from . import bmi import pickle import re class KalmanFilter(bmi.GaussianStateHMM): """ Low-level KF, agnostic to application Model: x_{t+1} = Ax_t + w_t; w_t ~ N(0, W) y_t = C...
[ "numpy.trace", "numpy.sum", "random.shuffle", "numpy.ones", "numpy.linalg.svd", "numpy.linalg.norm", "numpy.mean", "numpy.diag", "numpy.linalg.pinv", "numpy.linalg.solve", "numpy.mat", "numpy.multiply", "numpy.ndim", "numpy.linalg.det", "numpy.cov", "numpy.hstack", "scipy.optimize.fm...
[((28104, 28115), 'numpy.mat', 'np.mat', (['C_v'], {}), '(C_v)\n', (28110, 28115), True, 'import numpy as np\n'), ((28128, 28141), 'numpy.mat', 'np.mat', (['Q_hat'], {}), '(Q_hat)\n', (28134, 28141), True, 'import numpy as np\n'), ((31330, 31394), 'scipy.optimize.fmin_bfgs', 'fmin_bfgs', (['cost_fn', 'nu_0'], {'fprime'...
import numpy as np from .real_ffts import _RealFFTBasis class LegendreBasis(_RealFFTBasis): r""" Discretize a continuous field into `deg` local states using a Legendre polynomial basis such that, .. math:: \frac{1}{\Delta x} \int_s m(h, x) dx = \sum_0^{L-1} m[l, s] P_l(h) where t...
[ "numpy.array" ]
[((2494, 2517), 'numpy.array', 'np.array', (['self.n_states'], {}), '(self.n_states)\n', (2502, 2517), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- """ Created on Thu Apr 2 10:58:30 2020 @author: <NAME> """ #%%importing libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt #%% read csv dataset = pd.read_csv("svm_dataset.csv") #%% dataset.drop(["id","Unnamed: 32"],axis = 1, inplace = True) # Malignant = 'M' # ...
[ "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.scatter", "matplotlib.pyplot.legend", "sklearn.model_selection.train_test_split", "numpy.min", "numpy.max", "sklearn.svm.SVC", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((204, 234), 'pandas.read_csv', 'pd.read_csv', (['"""svm_dataset.csv"""'], {}), "('svm_dataset.csv')\n", (215, 234), True, 'import pandas as pd\n'), ((433, 522), 'matplotlib.pyplot.scatter', 'plt.scatter', (['M.radius_mean', 'M.texture_mean'], {'color': '"""red"""', 'label': '"""Malignant"""', 'alpha': '(0.3)'}), "(M....
import pytest import numpy as np from numpy.testing import assert_allclose from sunpy.image.util import to_norm, un_norm def test_to_norm(): array_simple = np.array([10., 20., 30., 100.]) assert_allclose(to_norm(array_simple), np.array([0.1, 0.2, 0.3, 1.])) array_simple_neg = np.array([-10., 0., 10., 90...
[ "sunpy.image.util.to_norm", "numpy.array" ]
[((164, 199), 'numpy.array', 'np.array', (['[10.0, 20.0, 30.0, 100.0]'], {}), '([10.0, 20.0, 30.0, 100.0])\n', (172, 199), True, 'import numpy as np\n'), ((293, 327), 'numpy.array', 'np.array', (['[-10.0, 0.0, 10.0, 90.0]'], {}), '([-10.0, 0.0, 10.0, 90.0])\n', (301, 327), True, 'import numpy as np\n'), ((441, 470), 'n...
""" The ``risk_models`` module provides functions for estimating the covariance matrix given historical returns. Because of the complexity of estimating covariance matrices (and the importance of efficient computations), this module mostly provides a convenient wrapper around the underrated `sklearn.covariance` module....
[ "pandas.DataFrame", "numpy.fmin", "numpy.trace", "numpy.sum", "numpy.nan_to_num", "numpy.eye", "numpy.zeros", "numpy.identity", "numpy.shape", "numpy.append", "numpy.linalg.norm", "numpy.tile", "numpy.dot", "warnings.warn", "numpy.diag", "numpy.sqrt" ]
[((2751, 2788), 'numpy.fmin', 'np.fmin', (['(daily_returns - benchmark)', '(0)'], {}), '(daily_returns - benchmark, 0)\n', (2758, 2788), True, 'import numpy as np\n'), ((4556, 4572), 'numpy.zeros', 'np.zeros', (['(N, N)'], {}), '((N, N))\n', (4564, 4572), True, 'import numpy as np\n'), ((4771, 4828), 'pandas.DataFrame'...
#!/bin/python # -*- coding: utf-8 -*- import time import numpy as np import scipy.linalg as sl import pandas as pd from econsieve import KalmanFilter, TEnKF from grgrlib.core import timeprint from grgrlib.multiprocessing import serializer from econsieve.stats import logpdf def create_obs_cov(self, scale_obs=0.1): ...
[ "econsieve.KalmanFilter", "numpy.random.seed", "numpy.diagflat", "numpy.empty", "numpy.isnan", "numpy.random.randint", "sys.exc_info", "numpy.linalg.pinv", "econsieve.TEnKF", "numpy.pad", "pandas.DataFrame", "numpy.ndim", "grgrlib.multiprocessing.serializer", "numpy.var", "numpy.random.s...
[((332, 351), 'numpy.array', 'np.array', (['self.data'], {}), '(self.data)\n', (340, 351), True, 'import numpy as np\n'), ((416, 436), 'numpy.diagflat', 'np.diagflat', (['sig_obs'], {}), '(sig_obs)\n', (427, 436), True, 'import numpy as np\n'), ((565, 642), 'numpy.vstack', 'np.vstack', (['(pmat[1, 0][:, :-self.neps], q...
"""Construction of 2D data tables from ASCII files obtained from models/simulations or other sources. Currently supported are the files generated for the papers: | Nuclear Physics Meets the Sources of the Ultra-High Energy Cosmic Rays | <NAME>, <NAME>, <NAME> | Sci.Rep. 7 (2017) 1, 4882 | e-Print: 160...
[ "numpy.stack", "numpy.full", "numpy.load", "numpy.concatenate", "prince.util.info", "numpy.array", "numpy.loadtxt", "os.path.join", "numpy.all" ]
[((2030, 2074), 'os.path.join', 'join', (['resource_path', '"""photo-nuclear"""', 'f_root'], {}), "(resource_path, 'photo-nuclear', f_root)\n", (2034, 2074), False, 'from os.path import join\n'), ((2082, 2120), 'prince.util.info', 'info', (['(0)', '"""Loading files"""', "(f_root + '*')"], {}), "(0, 'Loading files', f_r...
import os from mushroom_rl.utils.preprocessors import MinMaxPreprocessor from mushroom_rl.utils.callbacks import PlotDataset import numpy as np from mushroom_rl.algorithms.policy_search import REINFORCE from mushroom_rl.approximators.parametric import LinearApproximator from mushroom_rl.approximators.regressor impor...
[ "mushroom_rl.utils.dataset.compute_J", "mushroom_rl.core.Logger", "numpy.random.seed", "mushroom_rl.environments.LQR.generate", "mushroom_rl.algorithms.policy_search.REINFORCE", "os.makedirs", "mushroom_rl.utils.preprocessors.MinMaxPreprocessor.load", "numpy.ones", "mushroom_rl.utils.preprocessors.M...
[((778, 794), 'numpy.random.seed', 'np.random.seed', ([], {}), '()\n', (792, 794), True, 'import numpy as np\n'), ((809, 858), 'mushroom_rl.core.Logger', 'Logger', (['"""plot_and_norm_example"""'], {'results_dir': 'None'}), "('plot_and_norm_example', results_dir=None)\n", (815, 858), False, 'from mushroom_rl.core impor...
""" Authors: <NAME>. Copyright: Copyright (c) 2021 Microsoft Research 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, mo...
[ "tensorflow.reshape", "pytest.mark.parametrize", "tests.utils.Compiler", "tensorflow.split", "pytest.mark.skip", "numpy.random.randn", "os.path.dirname", "tensorflow.pad", "tensorflow.concat", "tests.utils.assert_almost_equal", "tensorflow.compat.v1.Session", "tensorflow.squeeze", "tensorflo...
[((1331, 1505), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""a_shape, out_shape"""', '[([2, 3], [6]), ([6], [2, 3]), ([2, 3], [3, 2]), ([2, 3], [-1]), ([1], []),\n ([3, 2, 3], [2, -1]), ([3, 2, 3], [-1, 9])]'], {}), "('a_shape, out_shape', [([2, 3], [6]), ([6], [2, 3]),\n ([2, 3], [3, 2]), ([2, 3],...
import csv import numpy as np import pandas as pd import matplotlib.pyplot as plt from statsmodels.tsa.base.datetools import dates_from_str import datetime import time from sklearn import svm import json feature_file_cases = '/Users/edwardgent/Downloads/NYT_US_COVID19.csv' feature_file_tests = '/Users/edwardgent/Down...
[ "pandas.DataFrame", "csv.reader", "json.loads", "statsmodels.tsa.base.datetools.dates_from_str", "json.dumps", "pandas.DatetimeIndex", "numpy.array", "sklearn.svm.SVC" ]
[((464, 552), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['New Cases', 'New Deaths', 'New Tests', 'Ventilators', 'ICU']"}), "(columns=['New Cases', 'New Deaths', 'New Tests', 'Ventilators',\n 'ICU'])\n", (476, 552), True, 'import pandas as pd\n'), ((997, 1026), 'statsmodels.tsa.base.datetools.dates_from_s...
# coding: utf-8 import datetime import pytest import numpy as np from ...models.transition.linear import ConstantVelocity from ...predictor.information import InformationKalmanPredictor from ...predictor.kalman import KalmanPredictor from ...types.state import InformationState, GaussianState from ...types.array import...
[ "numpy.allclose", "numpy.linalg.inv", "datetime.datetime.now", "datetime.timedelta" ]
[((903, 926), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (924, 926), False, 'import datetime\n'), ((1358, 1384), 'numpy.linalg.inv', 'np.linalg.inv', (['prior_covar'], {}), '(prior_covar)\n', (1371, 1384), True, 'import numpy as np\n'), ((1901, 1936), 'numpy.linalg.inv', 'np.linalg.inv', (['pre...
'''Set of functions to construct a graph as a combination of smaller subgraphs (of aparticular shape, defined in the shapes.py file) ''' import graphwave import math import networkx as nx import numpy as np from shapes import * from utils.utils import * from shapes.shapes import * def build_structure(width_basis, bas...
[ "networkx.set_node_attributes", "math.floor", "numpy.max", "networkx.Graph", "numpy.array", "numpy.random.choice", "networkx.number_of_nodes" ]
[((1827, 1863), 'networkx.set_node_attributes', 'nx.set_node_attributes', (['basis', 'attrs'], {}), '(basis, attrs)\n', (1849, 1863), True, 'import networkx as nx\n'), ((5620, 5630), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (5628, 5630), True, 'import networkx as nx\n'), ((1888, 1913), 'networkx.number_of_nodes'...
# Copyright (c) Facebook, Inc. and its affiliates. """ MultiDatasetLoader class is used by DatasetLoader class to load multiple datasets and more granular """ import logging import warnings import numpy as np from mmf.common.registry import registry from mmf.utils.build import build_dataloader_and_sampler, build_data...
[ "numpy.random.choice", "mmf.utils.distributed.is_master", "logging.getLogger", "mmf.utils.general.get_batch_size", "mmf.common.registry.registry.get", "mmf.utils.build.build_dataset", "mmf.utils.build.build_dataloader_and_sampler", "warnings.warn", "mmf.utils.distributed.is_dist_initialized" ]
[((462, 489), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (479, 489), False, 'import logging\n'), ((735, 746), 'mmf.utils.distributed.is_master', 'is_master', ([], {}), '()\n', (744, 746), False, 'from mmf.utils.distributed import broadcast_scalar, is_dist_initialized, is_master\n'), (...
import os import pandas as pd from sklearn import ensemble from sklearn import preprocessing from sklearn import metrics import joblib import numpy as np from . import dispatcher def predict(test_data_path, model_type, model_path): df = pd.read_csv(test_data_path) test_idx = df["id"].values predictions =...
[ "pandas.read_csv", "os.path.join", "numpy.column_stack" ]
[((244, 271), 'pandas.read_csv', 'pd.read_csv', (['test_data_path'], {}), '(test_data_path)\n', (255, 271), True, 'import pandas as pd\n'), ((366, 393), 'pandas.read_csv', 'pd.read_csv', (['test_data_path'], {}), '(test_data_path)\n', (377, 393), True, 'import pandas as pd\n'), ((1086, 1126), 'numpy.column_stack', 'np....
import numpy as np import servo2 import math import time savedir="Camera_Data/" map_A = np.load(savedir+'servoA.npy') map_B = np.load(savedir+'servoB.npy') steps = len(map_A) wait = 0.3 def vect_to_deg(x, y): servo_A, servo_B = 0, 0 try: A = list(map(lambda k: k >= y, map_A)).index(True)-1 if map_A[A] == ...
[ "servo2.A", "numpy.load", "math.sqrt", "time.sleep", "servo2.B", "servo2.home" ]
[((90, 121), 'numpy.load', 'np.load', (["(savedir + 'servoA.npy')"], {}), "(savedir + 'servoA.npy')\n", (97, 121), True, 'import numpy as np\n'), ((128, 159), 'numpy.load', 'np.load', (["(savedir + 'servoB.npy')"], {}), "(savedir + 'servoB.npy')\n", (135, 159), True, 'import numpy as np\n'), ((772, 785), 'servo2.home',...
''' Model definition ''' import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim from settings import * from data_prep import calc_iou def SSDHook(feature_map, hook_id): """ Takes input feature map, output the predictions tensor hook_id is for variable_scope unqie string ID """ with tf....
[ "tensorflow.reduce_sum", "tensorflow.contrib.layers.flatten", "tensorflow.reshape", "tensorflow.contrib.slim.l2_regularizer", "tensorflow.nn.softmax", "tensorflow.contrib.slim.conv2d", "tensorflow.abs", "tensorflow.nn.top_k", "tensorflow.concat", "tensorflow.variable_scope", "tensorflow.minimum"...
[((1706, 1775), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32', '[None, num_total_preds]'], {'name': '"""y_true_conf"""'}), "(tf.int32, [None, num_total_preds], name='y_true_conf')\n", (1720, 1775), True, 'import tensorflow as tf\n'), ((1829, 1903), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', ...
""" ==================================================================== ConvSCCS cross validation on simulated longitudinal features example ==================================================================== In this example we simulate longitudinal data with preset relative incidence for each feature. We then perfo...
[ "numpy.sum", "numpy.sin", "matplotlib.pylab.suptitle", "numpy.arange", "numpy.exp", "matplotlib.pylab.title", "matplotlib.pylab.subplots", "matplotlib.pylab.figure", "matplotlib.pylab.show", "tick.survival.SimuSCCS", "numpy.repeat", "numpy.ceil", "numpy.hstack", "scipy.sparse.csr_matrix", ...
[((903, 926), 'tick.survival.simu_sccs.CustomEffects', 'CustomEffects', (['(lags + 1)'], {}), '(lags + 1)\n', (916, 926), False, 'from tick.survival.simu_sccs import CustomEffects\n'), ((1422, 1565), 'tick.survival.SimuSCCS', 'SimuSCCS', (['n_samples', 'n_intervals', 'n_features', 'n_lags'], {'time_drift': 'time_drift'...
import numpy, math from params_geo import * import nanopores.py4gmsh.basic import nanopores.py4gmsh.extra from nanopores.py4gmsh import * from warnings import warn def get_geo(x0 = None, crosssections = True, exit_i = None, **params): """ writes a 3d geo file for an extruded axissymmetric geometry for Howo...
[ "numpy.asarray", "dolfin.plot", "numpy.array", "nanopores.geo2xml.geofile2geo", "warnings.warn" ]
[((678, 2705), 'numpy.array', 'numpy.array', (['[[2.16, 0.0, 0.0], [2.77, 0.0, -0.19], [3.24, 0.0, -0.1], [3.59, 0.0, -0.1],\n [3.83, 0.0, -0.35], [3.84, 0.0, -0.8], [3.67, 0.0, -1.34], [3.73, 0.0, \n -1.96], [3.93, 0.0, -2.31], [4.23, 0.0, -2.67], [4.44, 0.0, -2.81], [\n 4.33, 0.0, -3.25], [4.01, 0.0, -3.5], ...
import numpy as np from multiagent.core import World, Agent, Landmark from multiagent.agents import VIP, Bodyguard, StreetBystander from multiagent.scenario import VIPScenario import copy class Scenario(VIPScenario): def __init__(self, num_bodyguards=4, num_bystanders=10, communication=True, env_range=1.0, comm_di...
[ "numpy.random.uniform", "copy.deepcopy", "numpy.random.choice", "numpy.random.seed", "multiagent.agents.StreetBystander", "numpy.zeros", "multiagent.core.Landmark", "multiagent.agents.VIP", "multiagent.agents.Bodyguard", "numpy.random.randint", "numpy.array", "numpy.arange", "numpy.cos", "...
[((628, 635), 'multiagent.core.World', 'World', ([], {}), '()\n', (633, 635), False, 'from multiagent.core import World, Agent, Landmark\n'), ((1945, 1979), 'copy.deepcopy', 'copy.deepcopy', (['world.landmarks[:2]'], {}), '(world.landmarks[:2])\n', (1958, 1979), False, 'import copy\n'), ((2546, 2571), 'numpy.random.see...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Feb 17 15:42:13 2018 amortization_table.py @author: david # source for most of Mortgage class' basic functions # https://github.com/jbmohler/mortgage/blob/master/mortgage.py """ import argparse import decimal import os import pandas as pd import numpy ...
[ "numpy.divide", "datetime.datetime.today", "argparse.ArgumentParser", "decimal.Decimal", "numpy.array" ]
[((12232, 12285), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Mortgage Tools"""'}), "(description='Mortgage Tools')\n", (12255, 12285), False, 'import argparse\n'), ((1697, 1719), 'decimal.Decimal', 'decimal.Decimal', (['""".01"""'], {}), "('.01')\n", (1712, 1719), False, 'import deci...
""" Descriptors ============ The descriptors module offers all kinds of acoustics related descriptors. .. toctree:: :maxdepth: 2 Descriptors from ISO/TR 25417:2007 ********************************** Descriptors from :mod:`acoustics.standards.iso_tr_25417_2007`. .. autoattribute:: acoustics.descriptors.REFERENC...
[ "numpy.log10", "numpy.array", "numpy.sum" ]
[((3138, 3154), 'numpy.array', 'np.array', (['levels'], {}), '(levels)\n', (3146, 3154), True, 'import numpy as np\n'), ((3545, 3561), 'numpy.array', 'np.array', (['levels'], {}), '(levels)\n', (3553, 3561), True, 'import numpy as np\n'), ((3763, 3779), 'numpy.array', 'np.array', (['levels'], {}), '(levels)\n', (3771, ...
"""playground music_beats """ import numpy as np import matplotlib.pylab as plt # v1: 2 patterns # v2: 16 probs for event t = np.linspace(0, 16-1, 16) print("t", t) p1 = np.zeros((16, 1)) p2 = np.zeros((16, 1)) p1[[0, 4, 8, 12],0] = 1. p2[[0, 6, 8, 14],0] = 1. plt.subplot(211) plt.bar(t, p1) # , "ko") plt.subpl...
[ "matplotlib.pylab.subplot", "numpy.zeros", "matplotlib.pylab.bar", "numpy.linspace", "matplotlib.pylab.show" ]
[((129, 155), 'numpy.linspace', 'np.linspace', (['(0)', '(16 - 1)', '(16)'], {}), '(0, 16 - 1, 16)\n', (140, 155), True, 'import numpy as np\n'), ((175, 192), 'numpy.zeros', 'np.zeros', (['(16, 1)'], {}), '((16, 1))\n', (183, 192), True, 'import numpy as np\n'), ((198, 215), 'numpy.zeros', 'np.zeros', (['(16, 1)'], {})...
from multiprocessing import Pool from functools import partial from pathlib import Path import pandas as pd import numpy as np from numpy import array import matplotlib.pyplot as plt import tqdm from fire import Fire from bifacial_radiance.main import RadianceObj,AnalysisObj, _popen Path.ls = lambda x: sorted(list(x....
[ "functools.partial", "fire.Fire", "pathlib.Path.home", "numpy.deg2rad", "pandas.read_hdf", "bifacial_radiance.main._popen", "pathlib.Path", "numpy.sin", "numpy.array", "numpy.cos", "multiprocessing.Pool", "numpy.arctan", "numpy.sqrt" ]
[((10446, 10477), 'numpy.array', 'array', (['[-15.965, -1.45, height]'], {}), '([-15.965, -1.45, height])\n', (10451, 10477), False, 'from numpy import array\n'), ((10493, 10533), 'numpy.array', 'array', (['[-15.965, -1.45 + length, height]'], {}), '([-15.965, -1.45 + length, height])\n', (10498, 10533), False, 'from n...
"""Handling of skew surge data. Two skew surge datasets are implemented: the dataset for Brest created by Reinert et al. (2021), which can be received from the authors upon request, and the GESLA-2 surge dataset of Marcos & Woodworth (2017). See the file ‘tools_GESLA’ for further information on the latter. Written by...
[ "numpy.load", "calendar.timegm", "tools_GESLA.get_GESLA_surge_filename", "numpy.array", "tools_GESLA.read_GESLA_surge_file" ]
[((3139, 3163), 'numpy.load', 'np.load', (['SKEW_SURGE_FILE'], {}), '(SKEW_SURGE_FILE)\n', (3146, 3163), True, 'import numpy as np\n'), ((3185, 3217), 'numpy.array', 'np.array', (['high_tides'], {'dtype': 'bool'}), '(high_tides, dtype=bool)\n', (3193, 3217), True, 'import numpy as np\n'), ((4331, 4375), 'calendar.timeg...
import os import sys import datetime from pathlib import Path from logging import getLogger, Formatter, StreamHandler, INFO, WARNING from logging import FileHandler import importlib import pandas as pd import numpy as np from easydict import EasyDict as edict def is_devmode(): return True if os.uname().nodename...
[ "logging.FileHandler", "pandas.read_csv", "logging.StreamHandler", "os.uname", "logging.Formatter", "pathlib.Path", "numpy.array", "easydict.EasyDict", "datetime.datetime.now", "logging.getLogger" ]
[((627, 644), 'easydict.EasyDict', 'edict', (['mod.CONFIG'], {}), '(mod.CONFIG)\n', (632, 644), True, 'from easydict import EasyDict as edict\n'), ((1018, 1043), 'logging.FileHandler', 'FileHandler', (['logfile_path'], {}), '(logfile_path)\n', (1029, 1043), False, 'from logging import FileHandler\n'), ((1105, 1120), 'l...
""" Functions and Operations for analysing a cluster's tidal tails """ __author__ = "<NAME>" __all__ = [ "to_tail", "tail_path", "tail_path_match", ] try: from galpy.util import conversion except: import galpy.util.bovy_conversion as conversion from galpy.util import _rotate_to_arbitrary_vector f...
[ "numpy.sum", "numpy.append", "numpy.fabs", "numpy.array", "numpy.mean", "numpy.tan", "numpy.arctan", "numpy.sqrt", "matplotlib.pyplot.savefig", "numpy.atleast_2d" ]
[((1386, 1438), 'numpy.array', 'np.array', (['[cluster.vxgc, cluster.vygc, cluster.vzgc]'], {}), '([cluster.vxgc, cluster.vygc, cluster.vzgc])\n', (1394, 1438), True, 'import numpy as np\n'), ((1455, 1480), 'numpy.array', 'np.array', (['[1.0, 0.0, 0.0]'], {}), '([1.0, 0.0, 0.0])\n', (1463, 1480), True, 'import numpy as...
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import optuna import mlflow import os import numpy as np from numpyencoder import NumpyEncoder from argparse import Namespace from typing import List, Dict, Tuple, Optional from pathlib import Path import tempfile import j...
[ "torch.nn.MSELoss", "recsys.utils.get_data", "recsys.models.initialize_model", "recsys.data.RCDataloader", "torch.optim.lr_scheduler.ReduceLROnPlateau", "optuna.TrialPruned", "pathlib.Path", "recsys.utils.load_dict", "torch.cuda.is_available", "torch.no_grad", "numpy.vstack" ]
[((4369, 4407), 'pathlib.Path', 'Path', (['config.config_dir', '"""params.json"""'], {}), "(config.config_dir, 'params.json')\n", (4373, 4407), False, 'from pathlib import Path\n'), ((4724, 4740), 'recsys.utils.get_data', 'utils.get_data', ([], {}), '()\n', (4738, 4740), False, 'from recsys import utils, config, data, ...
import pandas as pd import numpy as np from matplotlib import pyplot as plt import cv2 from PIL import Image import os def label_to_name(labels, names): """ Utility function to map label to corresponding name """ arr_map = [] for i in range(0, labels.shape[0]): label = labels[i] name = names[names["ClassId"] ...
[ "pandas.DataFrame", "matplotlib.pyplot.show", "pandas.pivot_table", "os.path.join", "cv2.cvtColor", "numpy.std", "matplotlib.pyplot.suptitle", "PIL.Image.open", "numpy.mean", "numpy.random.randint", "numpy.reshape", "numpy.linspace", "numpy.array", "matplotlib.pyplot.subplots", "os.listd...
[((416, 437), 'pandas.DataFrame', 'pd.DataFrame', (['arr_map'], {}), '(arr_map)\n', (428, 437), True, 'import pandas as pd\n'), ((540, 626), 'pandas.pivot_table', 'pd.pivot_table', (['mappings'], {'index': "['label', 'name']", 'values': "['id']", 'aggfunc': '"""count"""'}), "(mappings, index=['label', 'name'], values=[...
import textmining import numpy import sklearn from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction.text import TfidfTransformer m=[] p=0 with open ("ess1.txt", "r") as myfile: doc1=myfile.read() #doc1=myfile.read().replace('\n', '') with open ("ess2.txt", "r"...
[ "textmining.TermDocumentMatrix", "numpy.savetxt", "sklearn.feature_extraction.text.TfidfTransformer", "numpy.vstack" ]
[((460, 491), 'textmining.TermDocumentMatrix', 'textmining.TermDocumentMatrix', ([], {}), '()\n', (489, 491), False, 'import textmining\n'), ((1803, 1821), 'sklearn.feature_extraction.text.TfidfTransformer', 'TfidfTransformer', ([], {}), '()\n', (1819, 1821), False, 'from sklearn.feature_extraction.text import TfidfTra...
import logging import numpy as np from typing import List, Tuple, Union from autoarray import exc from autoarray.mask import abstract_mask, mask_2d from autoarray.structures.grids.one_d import grid_1d from autoarray.structures.grids.one_d import grid_1d_util from autoarray.structures.arrays.one_d import arra...
[ "numpy.full", "numpy.size", "numpy.sum", "logging.basicConfig", "numpy.invert", "autoarray.structures.arrays.one_d.array_1d_util.numpy_array_1d_from_fits", "autoarray.mask.abstract_mask.AbstractMask.__new__", "autoarray.mask.mask_2d.Mask2D.manual", "numpy.asarray", "autoarray.structures.grids.one_...
[((333, 354), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (352, 354), False, 'import logging\n'), ((365, 392), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (382, 392), False, 'import logging\n'), ((1685, 1805), 'autoarray.mask.abstract_mask.AbstractMask.__new__', 'ab...
import numpy as np import random class Tensor (object): def __init__(self, data, autograd=False, creators=None, creation_op=None, id=None): self.data = np.array(data) self.creation_op = creation_op self.creators = creators self.grad = None self.autograd = autograd s...
[ "numpy.array", "random.randint" ]
[((166, 180), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (174, 180), True, 'import numpy as np\n'), ((380, 405), 'random.randint', 'random.randint', (['(0)', '(100000)'], {}), '(0, 100000)\n', (394, 405), False, 'import random\n')]
# THIS IS A PROGRAM FOR CLUSTERING. from clustering import clustering # 自作モジュール (clustering.py) と clusteringクラス の import import pandas as pd import matplotlib.pyplot as plt import tkinter as tk from tkinter import filedialog, image_names, ttk, messagebox import os from matplotlib.backends.backend_tkagg import Figure...
[ "os.path.abspath", "clustering.clustering.balance", "os.path.basename", "tkinter.Button", "pandas.read_csv", "tkinter.Entry", "matplotlib.pyplot.Figure", "clustering.clustering.shortest", "tkinter.filedialog.askopenfilename", "tkinter.Scale", "numpy.array", "clustering.clustering.longest", "...
[((9495, 9502), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (9500, 9502), True, 'import tkinter as tk\n'), ((9768, 9794), 'tkinter.Label', 'tk.Label', ([], {'text': '"""1. ファイル選択"""'}), "(text='1. ファイル選択')\n", (9776, 9794), True, 'import tkinter as tk\n'), ((9962, 9980), 'tkinter.Entry', 'tk.Entry', ([], {'width': '(30)'}...
""" .. module:: foreground :platform: Unix :synopsis: functions describing behaviour of foreground spectra. .. moduleauthor: <NAME> <<EMAIL>> """ import numpy as np def BB_scaling(nu, nu_0, T): """Blackbody scaling factor from frequency nu, to frequency nu_0. Parameters ---------- nu : `float`...
[ "numpy.exp" ]
[((626, 668), 'numpy.exp', 'np.exp', (['(h * nu_0 * 1000000000.0 / (kb * T))'], {}), '(h * nu_0 * 1000000000.0 / (kb * T))\n', (632, 668), True, 'import numpy as np\n'), ((674, 714), 'numpy.exp', 'np.exp', (['(h * nu * 1000000000.0 / (kb * T))'], {}), '(h * nu * 1000000000.0 / (kb * T))\n', (680, 714), True, 'import nu...
################################################################# # Code written by <NAME> (<EMAIL>) # For bug report, please contact author using the email address ################################################################# import sys, random, time, argparse from collections import OrderedDict import pickle imp...
[ "numpy.load", "theano.tensor.tensor3", "numpy.random.seed", "argparse.ArgumentParser", "theano.sandbox.rng_mrg.MRG_RandomStreams", "numpy.mean", "theano.tensor.sqrt", "theano.tensor.log", "theano.tensor.concatenate", "theano.tensor.mean", "theano.tensor.nnet.softmax", "numpy.max", "theano.sh...
[((554, 567), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (565, 567), False, 'from collections import OrderedDict\n'), ((708, 745), 'numpy.asarray', 'np.asarray', (['data'], {'dtype': 'config.floatX'}), '(data, dtype=config.floatX)\n', (718, 745), True, 'import numpy as np\n'), ((920, 947), 'numpy.load'...
# Wrapper class around hnswlib import hnswlib import numpy as np import threading import pickle from .typings import VectorList class Hnswlib(): def __init__(self, space, dim): self.index = hnswlib.Index(space, dim) self.lock = threading.Lock() self.dict_labels = {} self.cur_ind = 0...
[ "pickle.dump", "numpy.asarray", "threading.Lock", "pickle.load", "hnswlib.Index" ]
[((203, 228), 'hnswlib.Index', 'hnswlib.Index', (['space', 'dim'], {}), '(space, dim)\n', (216, 228), False, 'import hnswlib\n'), ((249, 265), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (263, 265), False, 'import threading\n'), ((1604, 1618), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1615, 1618), ...
import argparse import os import yaml import sys import numpy as np import time import json from .eval_np import PanopticEval from .config import global_cfg need_nuscenes_remap = False if global_cfg.DATA_CONFIG.DATASET_NAME == 'SemanticKitti': DATA = yaml.safe_load(open('semantic-kitti.yaml', 'r')) # get numbe...
[ "numpy.zeros" ]
[((729, 767), 'numpy.zeros', 'np.zeros', (['(maxkey + 100)'], {'dtype': 'np.int32'}), '(maxkey + 100, dtype=np.int32)\n', (737, 767), True, 'import numpy as np\n'), ((935, 963), 'numpy.zeros', 'np.zeros', (['(20)'], {'dtype': 'np.int32'}), '(20, dtype=np.int32)\n', (943, 963), True, 'import numpy as np\n')]
import argparse import os import pickle import time # import warnings import numpy as np from power_planner.utils.utils import get_distance_surface from csv import writer import warnings import matplotlib.pyplot as plt # utils imports from power_planner.utils.utils_ksp import KspUtils from power_planner.utils.utils_cos...
[ "numpy.sum", "argparse.ArgumentParser", "csv.writer", "numpy.ceil", "numpy.asarray", "power_planner.utils.utils_costs.CostUtils.compute_angle_costs", "numpy.ones", "power_planner.utils.utils_ksp.KspUtils.path_distance", "time.time", "numpy.max", "pickle.load", "numpy.where", "numpy.dot", "...
[((2127, 2152), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2150, 2152), False, 'import argparse\n'), ((2479, 2508), 'os.path.join', 'os.path.join', (['""".."""', '"""outputs"""'], {}), "('..', 'outputs')\n", (2491, 2508), False, 'import os\n'), ((1095, 1117), 'numpy.asarray', 'np.asarray',...
#!/usr/bin/env python import logging import aiohttp import asyncio from tqdm.asyncio import tqdm_asyncio from tqdm.contrib.logging import logging_redirect_tqdm import pandas as pd import numpy as np import time import datetime as dt from typing import Collection, Dict, List, Optional, Tuple, Union from yahoo_finance i...
[ "pandas.DataFrame", "datetime.datetime.today", "pandas.read_csv", "numpy.unique", "tqdm.contrib.logging.logging_redirect_tqdm", "time.time", "aiohttp.ClientSession", "datetime.datetime.strptime", "pandas.to_datetime", "datetime.timedelta", "yahoo_finance.download_ticker_sector_industry", "yaho...
[((404, 431), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (421, 431), False, 'import logging\n'), ((1442, 1510), 'pandas.DataFrame', 'pd.DataFrame', (['tickers_info'], {'columns': "['SYMBOL', 'SECTOR', 'INDUSTRY']"}), "(tickers_info, columns=['SYMBOL', 'SECTOR', 'INDUSTRY'])\n", (1454,...
from diffgram.brain.inference import Inference import tempfile # TODO import these only if local prediction is needed import cv2 try: import tensorflow as tf except: print("Could not import tensorflow") import numpy as np import requests import scipy.misc import diffgram.utils.visualization_utils as vis_util ...
[ "diffgram.brain.inference.Inference", "tensorflow.Session", "numpy.expand_dims", "tempfile.mkdtemp", "diffgram.utils.visualization_utils.visualize_boxes_and_labels_on_image_array", "tensorflow.gfile.GFile", "tensorflow.Graph", "requests.get", "numpy.squeeze", "tensorflow.import_graph_def", "tens...
[((1340, 1512), 'diffgram.brain.inference.Inference', 'Inference', ([], {'method': '"""object_detection"""', 'id': "dict['id']", 'status': "dict['status']", 'box_list': "dict['box_list']", 'score_list': "dict['score_list']", 'label_list': "dict['label_list']"}), "(method='object_detection', id=dict['id'], status=dict['...
""" Environment with a distribution of mazes (one new maze is drawn at each episode) Author: <NAME> """ import numpy as np from deer.base_classes import Environment #import matplotlib #matplotlib.use('qt5agg') #from mpl_toolkits.axes_grid1 import host_subplot #import mpl_toolkits.axisartist as AA #import matplotlib....
[ "copy.deepcopy", "numpy.zeros", "numpy.random.RandomState", "numpy.argwhere", "a_star_path_finding.AStar", "numpy.repeat" ]
[((7284, 7313), 'numpy.random.RandomState', 'np.random.RandomState', (['(123456)'], {}), '(123456)\n', (7305, 7313), True, 'import numpy as np\n'), ((2589, 2599), 'a_star_path_finding.AStar', 'pf.AStar', ([], {}), '()\n', (2597, 2599), True, 'import a_star_path_finding as pf\n'), ((5148, 5192), 'numpy.zeros', 'np.zeros...
""" functions.py In this work, we present PolymerXtal, a software designed to build and analyze molecular-level polymer crystal structures. PolymerXtal provides a standardized process to generate polymer crystal structure based on monomer, tacticity, helicity, chiriality and unit cell information and analyze the crysta...
[ "os.path.join", "numpy.sqrt" ]
[((3267, 3301), 'os.path.join', 'os.path.join', (['directory', '"""main.py"""'], {}), "(directory, 'main.py')\n", (3279, 3301), False, 'import os, sys, os.path\n'), ((3315, 3357), 'os.path.join', 'os.path.join', (['directory', '"""doAtomTyping.py"""'], {}), "(directory, 'doAtomTyping.py')\n", (3327, 3357), False, 'impo...
import numpy as np import pandas as pd import tools import tiles import interp import computational as cpt import matplotlib.pyplot as plt import gsw from scipy import interpolate from scipy import integrate import os # plt.ion() time_flag = 'annual' # 'DJF' # 'annual' typestat = 'zmean' seasons = ['DJF', 'MAM', 'J...
[ "numpy.sum", "numpy.floor", "numpy.arange", "numpy.exp", "pandas.to_pickle", "scipy.interpolate.interp1d", "gsw.p_from_z", "pandas.DataFrame", "os.path.exists", "numpy.transpose", "tiles.tiles_with_halo", "numpy.linspace", "gsw.rho", "computational.compute_weight", "numpy.ceil", "os.sy...
[((1512, 1567), 'computational.compute_weight', 'cpt.compute_weight', (['lonr[i]', 'latr[j]', 'LONr', 'LATr', 'resor'], {}), '(lonr[i], latr[j], LONr, LATr, resor)\n', (1530, 1567), True, 'import computational as cpt\n'), ((1579, 1627), 'pandas.DataFrame', 'pd.DataFrame', (['(0.0)'], {'columns': 'var_stats', 'index': '...
# Copyright (c) 2019 <NAME> # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import numpy as np from phylanx import Phylanx @Phylanx def in_top_k(predictions, targets, k): top_k = np.argsort(-predictions)[:...
[ "numpy.any", "numpy.argsort" ]
[((384, 411), 'numpy.any', 'np.any', (['(target == top_k)', '(-1)'], {}), '(target == top_k, -1)\n', (390, 411), True, 'import numpy as np\n'), ((294, 318), 'numpy.argsort', 'np.argsort', (['(-predictions)'], {}), '(-predictions)\n', (304, 318), True, 'import numpy as np\n')]
import numpy as np import pylab as pl from gls import sinefitm from multiplot import dofig, doaxes fac1 = 100 fac2 = 1 fac3 = 1 ls = ['-','--',':','-.'] mrk = ['.',',','+','x'] col = ['k','c','m','y'] def plotTS(time, y1, y2, y3 = None, figno = 1, discrete = True, \ savefile = None, period = None, x...
[ "gls.sinefitm", "numpy.copy", "numpy.median", "pylab.ylabel", "numpy.zeros", "multiplot.doaxes", "pylab.plot", "numpy.nanmin", "numpy.shape", "pylab.savefig", "numpy.arange", "pylab.ylim", "pylab.xlabel", "pylab.xlim", "multiplot.dofig", "numpy.nanmax", "numpy.sqrt" ]
[((382, 394), 'numpy.shape', 'np.shape', (['y1'], {}), '(y1)\n', (390, 394), True, 'import numpy as np\n'), ((779, 808), 'multiplot.dofig', 'dofig', (['figno', '(1)', 'ny'], {'aspect': '(1)'}), '(figno, 1, ny, aspect=1)\n', (784, 808), False, 'from multiplot import dofig, doaxes\n'), ((821, 844), 'multiplot.doaxes', 'd...
import numpy as np import imutils import time import cv2 video = cv2.VideoCapture(0) video.set(cv2.CAP_PROP_BUFFERSIZE, 2) while True: ret, frame = video.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) all_chans = [] for chan in frame[:, :]: _, binary = cv2.threshold(chan, 70, 255, cv2....
[ "cv2.dilate", "cv2.cvtColor", "cv2.waitKey", "cv2.threshold", "cv2.imwrite", "numpy.ones", "cv2.VideoCapture", "numpy.array", "cv2.erode", "cv2.imshow" ]
[((66, 85), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (82, 85), False, 'import cv2\n'), ((178, 217), 'cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_BGR2GRAY'], {}), '(frame, cv2.COLOR_BGR2GRAY)\n', (190, 217), False, 'import cv2\n'), ((498, 517), 'numpy.array', 'np.array', (['all_chans'], {...
import os import sys import csv import cv2 import math import time import numbers import numpy as np from multiprocessing import Process # local imported codes import parameters as parm from object_tracking_util import Camera, scalar_to_rgb, setup_system_objects, \ single_cam_detect...
[ "object_tracking_util.setup_system_objects", "object_tracking_util.Camera", "math.sqrt", "csv.writer", "cv2.waitKey", "time.time", "cv2.VideoCapture", "numpy.array", "object_tracking_util.multi_cam_detector", "object_tracking_util.single_cam_detector", "cv2.destroyAllWindows", "cv2.resize" ]
[((995, 1011), 'numpy.array', 'np.array', (['[0, 0]'], {}), '([0, 0])\n', (1003, 1011), True, 'import numpy as np\n'), ((1101, 1129), 'cv2.VideoCapture', 'cv2.VideoCapture', (['self.index'], {}), '(self.index)\n', (1117, 1129), False, 'import cv2\n'), ((1785, 1824), 'object_tracking_util.setup_system_objects', 'setup_s...
import re from functools import reduce from itertools import chain from typing import Union, Dict, List import pandas as pd import numpy as np from .common import * DataFrameType = Union[pd.DataFrame, Dict[str, pd.DataFrame], List[Dict[str, pd.DataFrame]]] # Serialization helper functions # -----------------------...
[ "numpy.dtype", "pandas.to_datetime", "itertools.chain", "re.sub" ]
[((533, 559), 'pandas.to_datetime', 'pd.to_datetime', (["df['time']"], {}), "(df['time'])\n", (547, 559), True, 'import pandas as pd\n'), ((2106, 2119), 'numpy.dtype', 'np.dtype', (['"""O"""'], {}), "('O')\n", (2114, 2119), True, 'import numpy as np\n'), ((2304, 2331), 'itertools.chain', 'chain', (['obj_nans', 'other_n...
import cv2 import numpy as np from plantcv.plantcv import gaussian_blur def test_gaussian_blur(test_data): """Test for PlantCV.""" # Read in test data img = cv2.imread(test_data.small_rgb_img) gaussian_img = gaussian_blur(img=img, ksize=(51, 51), sigma_x=0, sigma_y=None) assert np.average(img) != ...
[ "cv2.imread", "numpy.average", "plantcv.plantcv.gaussian_blur" ]
[((171, 206), 'cv2.imread', 'cv2.imread', (['test_data.small_rgb_img'], {}), '(test_data.small_rgb_img)\n', (181, 206), False, 'import cv2\n'), ((226, 289), 'plantcv.plantcv.gaussian_blur', 'gaussian_blur', ([], {'img': 'img', 'ksize': '(51, 51)', 'sigma_x': '(0)', 'sigma_y': 'None'}), '(img=img, ksize=(51, 51), sigma_...
from __future__ import print_function, division import numpy as np import sys scalarTypes = (complex, float, int, np.number) if sys.version_info < (3,): scalarTypes += (long, ) def isScalar(f): if isinstance(f, scalarTypes): return True elif isinstance(f, np.ndarray) and f.size == 1 and isinstanc...
[ "numpy.array", "numpy.atleast_2d" ]
[((460, 473), 'numpy.array', 'np.array', (['pts'], {}), '(pts)\n', (468, 473), True, 'import numpy as np\n'), ((585, 603), 'numpy.atleast_2d', 'np.atleast_2d', (['pts'], {}), '(pts)\n', (598, 603), True, 'import numpy as np\n')]
import copy import warnings import numpy as np import pandas as pd import colorcet import bokeh.models import bokeh.plotting from . import utils def strip( data=None, q=None, cats=None, q_axis="x", palette=None, order=None, p=None, show_legend=False, color_column=None, parc...
[ "numpy.percentile", "warnings.warn", "copy.copy", "pandas.Series" ]
[((3977, 4001), 'copy.copy', 'copy.copy', (['jitter_kwargs'], {}), '(jitter_kwargs)\n', (3986, 4001), False, 'import copy\n'), ((4022, 4046), 'copy.copy', 'copy.copy', (['marker_kwargs'], {}), '(marker_kwargs)\n', (4031, 4046), False, 'import copy\n'), ((12267, 12288), 'copy.copy', 'copy.copy', (['box_kwargs'], {}), '(...
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # 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 us...
[ "smarts.core.utils.sumo.sumolib.geomhelper.positionAtShapeOffset", "os.path.isfile", "numpy.linalg.norm", "numpy.inner", "trimesh.exchange.gltf.export_glb", "numpy.interp", "os.path.join", "numpy.unique", "shapely.geometry.Point", "trimesh.Scene", "shapely.geometry.Polygon", "logging.warning",...
[((4537, 4557), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(1)'}), '(maxsize=1)\n', (4546, 4557), False, 'from functools import lru_cache\n'), ((26149, 26170), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(16)'}), '(maxsize=16)\n', (26158, 26170), False, 'from functools import lru_cache\n'), ((27621...
import os import pickle import random import numpy as np import pandas as pd from sklearn.neighbors import KDTree BASE_DIR = os.path.dirname(os.path.abspath(__file__)) base_path = cfg.DATASET_FOLDER runs_folder = "oxford/" filename = "pointcloud_locations_20m_10overlap.csv" pointcloud_fols = "/pointcloud_20m_10overl...
[ "pandas.DataFrame", "os.path.abspath", "pickle.dump", "os.path.join", "random.shuffle", "numpy.setdiff1d", "sklearn.neighbors.KDTree" ]
[((2077, 2130), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['file', 'northing', 'easting']"}), "(columns=['file', 'northing', 'easting'])\n", (2089, 2130), True, 'import pandas as pd\n'), ((2139, 2192), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['file', 'northing', 'easting']"}), "(columns=['file...
############################################################################## # Copyright 2016-2017 Rigetti Computing # # 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...
[ "pyquil.api.QVMConnection", "pyquil.paulis.PauliTerm", "grove.pyqaoa.qaoa.QAOA", "numpy.hstack" ]
[((939, 958), 'pyquil.api.QVMConnection', 'api.QVMConnection', ([], {}), '()\n', (956, 958), True, 'import pyquil.api as api\n'), ((2098, 2297), 'grove.pyqaoa.qaoa.QAOA', 'QAOA', (['CXN', 'n_qubits'], {'steps': 'steps', 'cost_ham': 'cost_operators', 'ref_hamiltonian': 'ref_operators', 'store_basis': '(True)', 'minimize...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import glob import os.path import sys import shutil import random import matplotlib.pyplot as plt import xml.etree.ElementTree as ET import scipy.io as scio import tensorflow_datasets as tfds import tensorflow...
[ "matplotlib.pyplot.title", "tensorflow.reduce_sum", "numpy.sum", "tensorflow.clip_by_value", "tensorflow_datasets.features.Image", "scipy.io.loadmat", "matplotlib.pyplot.figure", "numpy.tile", "tensorflow.split", "tensorflow.image.crop_to_bounding_box", "tensorflow.image.random_crop", "matplot...
[((8348, 8373), 'tensorflow.constant', 'tf.constant', (['train_images'], {}), '(train_images)\n', (8359, 8373), True, 'import tensorflow as tf\n'), ((8393, 8418), 'tensorflow.constant', 'tf.constant', (['train_labels'], {}), '(train_labels)\n', (8404, 8418), True, 'import tensorflow as tf\n'), ((8438, 8463), 'tensorflo...
import numpy as np from ..utils import GeneticAlgorithm as GA from ..utils import round_vars from .lcb_merit import lcb_merit def lcb_ga(num_pts, opt_prob, surrogate, X, fX, Xpend=None, kappa=2.0, dtol=1e-3, lcb_target=None): """Minimize the LCB using a genetic algorithm. :param num_pts: Number of points to...
[ "numpy.empty", "numpy.zeros", "numpy.vstack" ]
[((1152, 1173), 'numpy.vstack', 'np.vstack', (['(X, Xpend)'], {}), '((X, Xpend))\n', (1161, 1173), True, 'import numpy as np\n'), ((1192, 1225), 'numpy.zeros', 'np.zeros', (['(num_pts, opt_prob.dim)'], {}), '((num_pts, opt_prob.dim))\n', (1200, 1225), True, 'import numpy as np\n'), ((1115, 1142), 'numpy.empty', 'np.emp...
import os from random import random, sample import numpy as np from PIL import Image, ImageDraw from skimage.segmentation import felzenszwalb from skimage.morphology import skeletonize, remove_small_objects from skimage.util import invert from tqdm import tqdm import cv2 def cv2pil(cv2_img): if len(cv2_img.shape)...
[ "cv2.GaussianBlur", "numpy.abs", "cv2.arcLength", "numpy.argmin", "cv2.bilateralFilter", "numpy.arange", "numpy.unique", "numpy.multiply", "cv2.cvtColor", "skimage.morphology.skeletonize", "cv2.convertScaleAbs", "numpy.linspace", "cv2.drawContours", "numpy.dstack", "cv2.Canny", "numpy....
[((628, 645), 'numpy.array', 'np.array', (['pil_img'], {}), '(pil_img)\n', (636, 645), True, 'import numpy as np\n'), ((661, 701), 'cv2.cvtColor', 'cv2.cvtColor', (['cv2_img', 'cv2.COLOR_RGB2BGR'], {}), '(cv2_img, cv2.COLOR_RGB2BGR)\n', (673, 701), False, 'import cv2\n'), ((808, 825), 'numpy.arange', 'np.arange', (['(0...
import glob import numpy as np def _word_to_bool(word): """convert a string to boolean according the first 2 characters.""" _accepted_bool_prefixes = ("T", ".T") return word.upper().startswith(_accepted_bool_prefixes) class Photons: pass class Wavelengths: pass class Physics: pass class ...
[ "numpy.deg2rad", "numpy.arange", "glob.glob" ]
[((18379, 18411), 'glob.glob', 'glob.glob', (["(directory + '/*.par*')"], {}), "(directory + '/*.par*')\n", (18388, 18411), False, 'import glob\n'), ((17628, 17676), 'numpy.deg2rad', 'np.deg2rad', (['[self.map.RT_imin, self.map.RT_imax]'], {}), '([self.map.RT_imin, self.map.RT_imax])\n', (17638, 17676), True, 'import n...
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
[ "numpy.sum", "InnerEyeDataQuality.evaluation.metrics.compute_accuracy", "numpy.copy", "numpy.argmax", "InnerEyeDataQuality.evaluation.metrics.total_variation", "numpy.setdiff1d", "logging.info", "InnerEyeDataQuality.evaluation.metrics.compute_label_entropy", "numpy.where", "numpy.arange", "numpy...
[((658, 680), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (667, 680), False, 'from dataclasses import dataclass\n'), ((3503, 3539), 'numpy.argmax', 'np.argmax', (['true_label_counts'], {'axis': '(1)'}), '(true_label_counts, axis=1)\n', (3512, 3539), True, 'import numpy as np\n')...
import copy import logging from itertools import chain import numpy as np import torch from torch.nn import functional as F from rltoolkit import config from rltoolkit.algorithms.ddpg import DDPG from rltoolkit.algorithms.sac.models import SAC_Actor, SAC_Critic logger = logging.getLogger(__name__) class SAC(DDPG):...
[ "copy.deepcopy", "torch.tensor", "numpy.log", "torch.nn.functional.mse_loss", "rltoolkit.algorithms.sac.models.SAC_Actor", "rltoolkit.algorithms.sac.models.SAC_Critic", "torch.no_grad", "torch.min", "logging.getLogger" ]
[((274, 301), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (291, 301), False, 'import logging\n'), ((4135, 4198), 'rltoolkit.algorithms.sac.models.SAC_Actor', 'SAC_Actor', (['self.ob_dim', 'self.ac_lim', 'self.ac_dim', 'self.discrete'], {}), '(self.ob_dim, self.ac_lim, self.ac_dim, self...
# -*- coding: utf-8 -*- """ Test Generic Map """ import os import pytest import numpy as np import astropy.units as u from astropy.coordinates import SkyCoord import matplotlib.pyplot as plt import sunpy import sunpy.map import sunpy.coordinates import sunpy.data.test from sunpy.tests.helpers import figure_test tes...
[ "numpy.zeros_like", "os.path.join", "numpy.ma.array", "numpy.arange", "matplotlib.pyplot.gca", "astropy.coordinates.SkyCoord" ]
[((711, 758), 'numpy.zeros_like', 'np.zeros_like', (['aia171_test_map.data'], {'dtype': 'bool'}), '(aia171_test_map.data, dtype=bool)\n', (724, 758), True, 'import numpy as np\n'), ((1876, 1885), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (1883, 1885), True, 'import matplotlib.pyplot as plt\n'), ((2024, 2100...
""" Contains methods for YOLOv3 models for object detection. Trained on COCO dataset. """ import re import numpy as np from collections import defaultdict from kenning.core.model import ModelWrapper from kenning.datasets.open_images_dataset import DectObject, compute_iou, Dataset # noqa: E501 import sys if sys.ver...
[ "kenning.datasets.open_images_dataset.DectObject", "numpy.argmax", "numpy.frombuffer", "numpy.transpose", "numpy.prod", "collections.defaultdict", "numpy.append", "pathlib.Path", "numpy.where", "numpy.array", "importlib.resources.path", "numpy.exp", "kenning.datasets.open_images_dataset.comp...
[((2457, 2474), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2468, 2474), False, 'from collections import defaultdict\n'), ((2498, 2541), 're.compile', 're.compile', (['"""(width|height|classes)=(\\\\d+)"""'], {}), "('(width|height|classes)=(\\\\d+)')\n", (2508, 2541), False, 'import re\n'), (...
import torch import torch.nn as nn import numpy as np import os import time from zhiqiang.utils.data_parallelism import DataParallelism # define a simple model class SimpleModel(nn.Module): def __init__(self): super(SimpleModel, self).__init__() self.random_start = torch.tensor(np.ones([1, 3, ...
[ "os.getpid", "torch.nn.Conv2d", "multiprocessing.set_start_method", "numpy.ones", "zhiqiang.utils.data_parallelism.DataParallelism" ]
[((1281, 1309), 'multiprocessing.set_start_method', 'mp.set_start_method', (['"""spawn"""'], {}), "('spawn')\n", (1300, 1309), True, 'import multiprocessing as mp\n'), ((1474, 1492), 'zhiqiang.utils.data_parallelism.DataParallelism', 'DataParallelism', (['(2)'], {}), '(2)\n', (1489, 1492), False, 'from zhiqiang.utils.d...
# Copyright 2020 The Magenta Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[ "tensorflow.compat.v1.pad", "fractions.gcd", "magenta.music.mfcc_mel.SpectrogramToMelMatrix", "tensorflow.compat.v1.rank", "tensorflow.compat.v1.signal.linear_to_mel_weight_matrix", "tensorflow.compat.v1.log", "tensorflow.compat.v1.signal.frame", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1....
[((3488, 3521), 'tensorflow.compat.v1.pad', 'tf.pad', (['signal_tensor', 'pad_values'], {}), '(signal_tensor, pad_values)\n', (3494, 3521), True, 'import tensorflow.compat.v1 as tf\n'), ((3543, 3584), 'tensorflow.compat.v1.matmul', 'tf.matmul', (['padded_signal', 'real_dft_tensor'], {}), '(padded_signal, real_dft_tenso...
# -*- coding: utf-8 -*- """ Created on 01/26/2022 @author: maxcurie """ import numpy as np import csv from mpi4py import MPI from Dispersion import VectorFinder_auto_Extensive from MPI_tools import task_dis comm=MPI.COMM_WORLD rank=comm.Get_rank() size=comm.Get_size() print('*******rank='+str(rank)+'*************'...
[ "csv.writer", "MPI_tools.task_dis", "numpy.imag", "numpy.arange", "Dispersion.VectorFinder_auto_Extensive", "numpy.real", "numpy.random.shuffle" ]
[((455, 480), 'numpy.arange', 'np.arange', (['(0.1)', '(10.0)', '(0.5)'], {}), '(0.1, 10.0, 0.5)\n', (464, 480), True, 'import numpy as np\n'), ((492, 514), 'numpy.arange', 'np.arange', (['(1)', '(2.5)', '(0.2)'], {}), '(1, 2.5, 0.2)\n', (501, 514), True, 'import numpy as np\n'), ((526, 550), 'numpy.arange', 'np.arange...
import os, sys import numpy as np import time import glob import random import math from typing import Any, Callable, cast, Dict, List, Optional, Tuple from PIL import Image import pickle import torch as tc from torchvision import transforms from torchvision import datasets #from torchvision.datasets.folder import de...
[ "numpy.random.seed", "numpy.sum", "torch.utils.data.DataLoader", "random.shuffle", "accimage.Image", "torchvision.transforms.ToPILImage", "torch.cat", "time.time", "PIL.Image.open", "numpy.cumsum", "data.get_aug_tforms", "random.seed", "torchvision.transforms.Compose", "pickle.load", "to...
[((1242, 1262), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1256, 1262), True, 'import numpy as np\n'), ((1277, 1306), 'numpy.random.permutation', 'np.random.permutation', (['n_data'], {}), '(n_data)\n', (1298, 1306), True, 'import numpy as np\n'), ((1951, 1968), 'random.seed', 'random.seed', ([...