code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
""" HMModel """ import numpy as np import dill from ..batchflow.batchflow.models.base import BaseModel def make_hmm_data(batch, model, components): """Prepare hmm input.""" _ = model if isinstance(components, str): components = (components, ) x = np.hstack([np.concatenate([np.concatenate(np.at...
[ "numpy.cumsum", "dill.dump", "numpy.atleast_3d", "dill.load" ]
[((2803, 2818), 'dill.load', 'dill.load', (['file'], {}), '(file)\n', (2812, 2818), False, 'import dill\n'), ((2377, 2408), 'dill.dump', 'dill.dump', (['self.estimator', 'file'], {}), '(self.estimator, file)\n', (2386, 2408), False, 'import dill\n'), ((315, 333), 'numpy.atleast_3d', 'np.atleast_3d', (['arr'], {}), '(ar...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2020-2021 <NAME> <<EMAIL>> # # Distributed under terms of the BSD 3-Clause license. """Create topography and I.C. file for case 5.3 in Xing and Shu (2005). Note, the elevation data is defined at vertices, rather than at cell centers. """ ...
[ "numpy.meshgrid", "torchswe.utils.config.get_config", "numpy.maximum", "numpy.abs", "numpy.power", "numpy.zeros", "pathlib.Path", "numpy.sin", "numpy.linspace" ]
[((758, 780), 'numpy.power', 'numpy.power', (['y[loc]', '(2)'], {}), '(y[loc], 2)\n', (769, 780), False, 'import numpy\n'), ((1190, 1206), 'torchswe.utils.config.get_config', 'get_config', (['case'], {}), '(case)\n', (1200, 1206), False, 'from torchswe.utils.config import get_config\n'), ((1334, 1397), 'numpy.linspace'...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 10 18:07:28 2017 @author: mitchell !!!!!!! !!!!!!! This code exists for legacy purposes. It is likely not functional. Please contact <NAME> (GitHub mfkoerner) for more details. Requires special version of pymatgen/electronic_structure/bandstructur...
[ "pymatgen.MPRester", "time.perf_counter", "importlib.reload", "pickle.load", "numpy.array", "numpy.linalg.norm", "bisect.bisect", "mymatgen.get_cbm_loose", "os.chdir", "mymatgen.get_vbm_loose" ]
[((1357, 1372), 'importlib.reload', 'imp.reload', (['mmg'], {}), '(mmg)\n', (1367, 1372), True, 'import importlib as imp\n'), ((1550, 1567), 'os.chdir', 'os.chdir', (['baseDir'], {}), '(baseDir)\n', (1558, 1567), False, 'import os\n'), ((1575, 1602), 'pymatgen.MPRester', 'MPRester', (['config.matprojapi'], {}), '(confi...
''' June 06, 2019. <NAME>. <EMAIL> This file evaluates a gridworld problem that is solved under a random action policy. The outcome is a state value matrix for each of the possible states. ''' import numpy as np from itertools import product import matplotlib.pyplot as plt import seaborn as sns ACTIONS = [(0, 1), (0...
[ "matplotlib.pyplot.title", "seaborn.heatmap", "numpy.sum", "matplotlib.pyplot.show", "numpy.abs", "numpy.zeros", "numpy.max", "numpy.mean", "matplotlib.pyplot.savefig" ]
[((713, 744), 'numpy.sum', 'np.sum', (['(state, action)'], {'axis': '(0)'}), '((state, action), axis=0)\n', (719, 744), True, 'import numpy as np\n'), ((989, 1019), 'numpy.max', 'np.max', (['state_value_per_action'], {}), '(state_value_per_action)\n', (995, 1019), True, 'import numpy as np\n'), ((1156, 1187), 'numpy.me...
from environment import GymEnvironment from mimic_agent import MimicAgent from fd_model import FDModel from experts.lunar_lander_heuristic import LunarLanderExpert from experts.bipedal_walker_heuristic import BipedalWalkerExpert from experts.half_cheeta import SmallReactivePolicy #from experts.inverted_double_pendulum ...
[ "json.loads", "argparse.ArgumentParser", "experts.half_cheeta.SmallReactivePolicy", "os.path.isdir", "numpy.empty", "numpy.asarray", "numpy.std", "environment.GymEnvironment", "mimic_agent.MimicAgent", "numpy.mean", "fd_model.FDModel", "numpy.random.rand", "os.path.join" ]
[((585, 624), 'os.path.join', 'os.path.join', (['model_path', '"""config.json"""'], {}), "(model_path, 'config.json')\n", (597, 624), False, 'import os\n'), ((675, 696), 'json.loads', 'json.loads', (['json_data'], {}), '(json_data)\n', (685, 696), False, 'import json\n'), ((778, 830), 'os.path.join', 'os.path.join', ([...
import numpy as np from scipy.optimize import fmin_cg def normalize_ratings(ratings): """ Given an array of user ratings, subtract the mean of each product's ratings :param ratings: 2d array of user ratings :return: (normalized ratings array, the calculated means) """ mean_ratings = np.nanmean...
[ "numpy.random.seed", "numpy.nan_to_num", "numpy.random.randn", "numpy.square", "scipy.optimize.fmin_cg", "numpy.isnan", "numpy.dot", "numpy.nanmean" ]
[((310, 337), 'numpy.nanmean', 'np.nanmean', (['ratings'], {'axis': '(0)'}), '(ratings, axis=0)\n', (320, 337), True, 'import numpy as np\n'), ((3005, 3027), 'numpy.nan_to_num', 'np.nan_to_num', (['ratings'], {}), '(ratings)\n', (3018, 3027), True, 'import numpy as np\n'), ((3092, 3109), 'numpy.random.seed', 'np.random...
from copy import deepcopy import numpy as np from gym.spaces import Discrete, Dict, Box # add for grpc import gym import os class halide_rl: """A :class: Halide is a domain-specific language and compiler for image processing pipelines (or graphs) with multiple computation stages. This tas...
[ "copy.deepcopy", "os.makedirs", "gym.spaces.Discrete", "os.path.exists", "numpy.array", "gym.spaces.Box" ]
[((3352, 3385), 'gym.spaces.Discrete', 'Discrete', (['self.env.action_space.n'], {}), '(self.env.action_space.n)\n', (3360, 3385), False, 'from gym.spaces import Discrete, Dict, Box\n'), ((4956, 4974), 'copy.deepcopy', 'deepcopy', (['state[0]'], {}), '(state[0])\n', (4964, 4974), False, 'from copy import deepcopy\n'), ...
#from https://github.com/ajbrock/BigGAN-PyTorch (MIT license) - no modifications ''' Datasets This file contains definitions for our CIFAR, ImageFolder, and HDF5 datasets ''' import os import os.path import sys from PIL import Image import numpy as np use_tqdm=False if use_tqdm: from tqdm import tqdm...
[ "numpy.load", "os.path.join", "os.path.isdir", "accimage.Image", "os.path.exists", "os.walk", "PIL.Image.open", "numpy.savez_compressed", "torchvision.get_image_backend", "os.path.expanduser", "os.listdir", "torch.from_numpy" ]
[((1255, 1278), 'os.path.expanduser', 'os.path.expanduser', (['dir'], {}), '(dir)\n', (1273, 1278), False, 'import os\n'), ((1348, 1373), 'os.path.join', 'os.path.join', (['dir', 'target'], {}), '(dir, target)\n', (1360, 1373), False, 'import os\n'), ((1853, 1866), 'PIL.Image.open', 'Image.open', (['f'], {}), '(f)\n', ...
""" Augments the 3DPW annotation, with the best neutral shape beta that fits the mesh of the gendered shapes. This is a convenience so when evaluating, s.t. there is no need to load ground truth mesh from gendered models. This also pre-computes the 3D joints using the regressor. This is obtained from the ground truth ...
[ "pickle.dump", "tensorflow.reduce_sum", "numpy.abs", "tensorflow.Variable", "pickle.load", "numpy.linalg.norm", "smpl_webuser.serialization.load_model", "os.path.join", "numpy.copy", "os.path.exists", "os.path.basename", "tensorflow.global_variables_initializer", "tensorflow.Session", "ten...
[((784, 862), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""base_dir"""', '"""/scratch1/jason/videos/3DPW"""', '"""Path to 3DPW"""'], {}), "('base_dir', '/scratch1/jason/videos/3DPW', 'Path to 3DPW')\n", (803, 862), False, 'from absl import flags\n'), ((863, 995), 'absl.flags.DEFINE_string', 'flags.DEFINE_st...
"""Script to quickly and reproducibly create test data Note: We may want to delete this at some point. """ from typing import Dict, Iterable, Tuple import geopandas as gpd import numpy as np from geograph.constants import SRC_PATH from geograph.tests.utils import get_array_transform, polygonise_sub_array from geograp...
[ "geograph.tests.utils.polygonise_sub_array", "geograph.tests.utils.get_array_transform", "numpy.random.randint", "numpy.random.seed" ]
[((1719, 1737), 'numpy.random.seed', 'np.random.seed', (['(28)'], {}), '(28)\n', (1733, 1737), True, 'import numpy as np\n'), ((1749, 1810), 'numpy.random.randint', 'np.random.randint', ([], {'low': '(1)', 'high': '(5)', 'size': '(6, 4)', 'dtype': 'np.uint8'}), '(low=1, high=5, size=(6, 4), dtype=np.uint8)\n', (1766, 1...
from selenium import webdriver import pandas as pd from re import sub import numpy as np import statsmodels.stats.api as sms browser=webdriver.Chrome(executable_path=r'C:\Users\Administrator\Documents\chromedriver.exe') browser.get("http://www.randhawa.us/games/retailer/nyu.html") maintain = browser.find_element_by_i...
[ "pandas.read_csv", "numpy.std", "statsmodels.stats.api.DescrStatsW", "numpy.mean", "selenium.webdriver.Chrome" ]
[((134, 228), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': '"""C:\\\\Users\\\\Administrator\\\\Documents\\\\chromedriver.exe"""'}), "(executable_path=\n 'C:\\\\Users\\\\Administrator\\\\Documents\\\\chromedriver.exe')\n", (150, 228), False, 'from selenium import webdriver\n'), ((551, 595...
#!~/anaconda3/bin/python3 # ****************************************************** # Author: <NAME> # Last modified: 2021-09-01 19:20 # Email: <EMAIL> # Filename: 1_feature_extract.py # Description: # extract features # ****************************************************** import os import numpy as np import rand...
[ "sys.path.append", "model.Xie_miccai", "argparse.ArgumentParser", "torch.utils.data.DataLoader", "model.Byol", "model.Simsiam", "numpy.concatenate", "torch.load", "timm.create_model", "model.Chen_mia", "numpy.array", "torch.cuda.is_available", "model.Cs_co", "torch.no_grad", "os.listdir"...
[((691, 712), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (706, 712), False, 'import sys\n'), ((6437, 6506), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""script for feature extraction."""'}), "(description='script for feature extraction.')\n", (6460, 6506), Fa...
import os import sys import numpy as np from numpy.testing import assert_array_equal from pathlib import Path sys.path.append(os.path.join(Path(__file__).parent.parent, 'pyneuromodulation')) sys.path.append(os.path.join(Path(__file__).parent.parent, 'examples')) # https://stackoverflow.com/a/10253916/5060208 # despite...
[ "os.path.abspath", "py_neuromodulation.nm_BidsStream.BidsStream", "numpy.testing.assert_array_equal", "pathlib.Path", "numpy.where", "os.path.join" ]
[((1226, 1259), 'os.path.abspath', 'os.path.abspath', (['"""examples\\\\data"""'], {}), "('examples\\\\data')\n", (1241, 1259), False, 'import os\n'), ((1400, 1506), 'py_neuromodulation.nm_BidsStream.BidsStream', 'nm_BidsStream.BidsStream', ([], {'PATH_RUN': 'PATH_RUN', 'PATH_BIDS': 'PATH_BIDS', 'PATH_OUT': 'PATH_OUT',...
from __future__ import print_function import numpy as np import pandas as pd from functools import partial from genomic_neuralnet.config import JOBLIB_BACKEND from genomic_neuralnet.common import run_predictors from genomic_neuralnet.methods import \ get_brr_prediction, get_en_prediction, \ get_lasso_p...
[ "genomic_neuralnet.common.run_predictors", "functools.partial", "numpy.mean", "numpy.std" ]
[((715, 756), 'functools.partial', 'partial', (['get_lasso_prediction'], {'alpha': '(0.06)'}), '(get_lasso_prediction, alpha=0.06)\n', (722, 756), False, 'from functools import partial\n'), ((770, 807), 'functools.partial', 'partial', (['get_en_prediction'], {'alpha': '(0.1)'}), '(get_en_prediction, alpha=0.1)\n', (777...
import cv2 import numpy as np from PIL import Image import torch from torchvision import transforms mask = Image.open('dataset/mask/112.png') # mask = np.asarray(mask) # print(mask) # print(mask.shape) # cv2.imshow('M', mask) mask = transforms.Resize((512, 512))(mask) # print(mask.shape) # mask = cv2.imread('dataset...
[ "numpy.asarray", "numpy.zeros", "numpy.all", "PIL.Image.open", "numpy.array", "torch.tensor", "torchvision.transforms.Resize" ]
[((108, 142), 'PIL.Image.open', 'Image.open', (['"""dataset/mask/112.png"""'], {}), "('dataset/mask/112.png')\n", (118, 142), False, 'from PIL import Image\n'), ((493, 542), 'numpy.asarray', 'np.asarray', (['[[0, 0, 0], [0, 255, 0], [255, 0, 0]]'], {}), '([[0, 0, 0], [0, 255, 0], [255, 0, 0]])\n', (503, 542), True, 'im...
import numpy as np import string import pickle from collections import defaultdict from argparse import ArgumentParser from nltk.stem.porter import PorterStemmer def load_data(dname): stemmer = PorterStemmer() qids, questions, answers, labels = [], [], [], [] print('Load folder ' + dname) with open(dn...
[ "argparse.ArgumentParser", "numpy.ones", "numpy.hstack", "collections.defaultdict", "numpy.math.log", "numpy.array", "nltk.stem.porter.PorterStemmer", "numpy.vstack" ]
[((200, 215), 'nltk.stem.porter.PorterStemmer', 'PorterStemmer', ([], {}), '()\n', (213, 215), False, 'from nltk.stem.porter import PorterStemmer\n'), ((2153, 2176), 'numpy.array', 'np.array', (['feats_overlap'], {}), '(feats_overlap)\n', (2161, 2176), True, 'import numpy as np\n'), ((3217, 3235), 'collections.defaultd...
import pytest import numpy.testing as npt import numpy as np from tardis.energy_input.gamma_ray_grid import ( calculate_distance_radial, distance_trace, move_packet, ) @pytest.mark.xfail(reason="To be implemented") def test_calculate_distance_radial(): """Test the radial distance calculation""" a...
[ "tardis.energy_input.gamma_ray_grid.move_packet", "numpy.testing.assert_almost_equal", "pytest.mark.xfail" ]
[((184, 229), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""To be implemented"""'}), "(reason='To be implemented')\n", (201, 229), False, 'import pytest\n'), ((335, 380), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""To be implemented"""'}), "(reason='To be implemented')\n", (352, 380), ...
import numpy as np import matplotlib.pyplot as plt from PIL import Image from scipy.ndimage import gaussian_filter def im_processing(n_slice, coef): path = 'figures/Sky_full_of_stars.jpg' image = Image.open(path) data_i = np.asarray(image) slice_size = int(np.shape(data_i)[1] / n_slice) for i in range(n_slice...
[ "matplotlib.pyplot.show", "scipy.ndimage.gaussian_filter", "numpy.asarray", "matplotlib.pyplot.subplots", "PIL.Image.open", "numpy.shape", "matplotlib.pyplot.tight_layout" ]
[((200, 216), 'PIL.Image.open', 'Image.open', (['path'], {}), '(path)\n', (210, 216), False, 'from PIL import Image\n'), ((228, 245), 'numpy.asarray', 'np.asarray', (['image'], {}), '(image)\n', (238, 245), True, 'import numpy as np\n'), ((487, 505), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {}), '...
import numpy as np from functools import reduce def step(item: str, itemState: dict, globalState: dict, preprocessorData: str): if preprocessorData == None: return item words = preprocessorData.splitlines() if len(words) == 0: return item values = set([len(w) for w in words]) gr...
[ "functools.reduce", "numpy.zeros" ]
[((1282, 1308), 'numpy.zeros', 'np.zeros', (['(size_x, size_y)'], {}), '((size_x, size_y))\n', (1290, 1308), True, 'import numpy as np\n'), ((853, 886), 'functools.reduce', 'reduce', (['(lambda x, y: x + y)', 'items'], {}), '(lambda x, y: x + y, items)\n', (859, 886), False, 'from functools import reduce\n')]
import os.path as osp from PIL import Image import numpy as np import scipy.linalg as la from numpy.core.umath_tests import inner1d import pandas as pd from matplotlib import pyplot as plt from more_itertools import unique_everseen import numba from numba import * def affinity(s,non0_coord,var): n = s.shape[0...
[ "numpy.uint8", "numpy.sum", "numpy.argmax", "numpy.zeros", "numpy.transpose", "scipy.linalg.eig", "numpy.argmin", "numpy.nonzero", "numpy.argsort", "numpy.rint", "numpy.array", "numpy.core.umath_tests.inner1d", "numpy.sqrt" ]
[((330, 346), 'numpy.zeros', 'np.zeros', (['(n, n)'], {}), '((n, n))\n', (338, 346), True, 'import numpy as np\n'), ((1140, 1156), 'numpy.zeros', 'np.zeros', (['(n, n)'], {}), '((n, n))\n', (1148, 1156), True, 'import numpy as np\n'), ((1316, 1325), 'scipy.linalg.eig', 'la.eig', (['L'], {}), '(L)\n', (1322, 1325), True...
# -*- coding:UTF-8 -*- # @Author: <NAME> # @Date: 2021-06-08 # @Email: <EMAIL> from PIL import Image from multiprocessing import Manager, Pool, cpu_count import os import re from pdf2image import convert_from_path from tqdm import tqdm from argparse import ArgumentParser import numpy as np import shutil def get_files...
[ "os.mkdir", "pdf2image.convert_from_path", "argparse.ArgumentParser", "multiprocessing.Manager", "os.path.exists", "numpy.array", "re.search", "multiprocessing.Pool", "os.path.join", "os.listdir", "shutil.copy", "multiprocessing.cpu_count" ]
[((343, 367), 'os.path.exists', 'os.path.exists', (['root_dir'], {}), '(root_dir)\n', (357, 367), False, 'import os\n'), ((2390, 2406), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (2404, 2406), False, 'from argparse import ArgumentParser\n'), ((1309, 1332), 'os.path.exists', 'os.path.exists', (['out_...
import numpy as np import matplotlib.pyplot as plt def plot_observable(obs_dict, e0=None, ax=None): '''Plot the observable selected. Args: obs_dict : dictioanry of observable ''' show_plot = False if ax is None: fig = plt.figure() ax = fig.add_subplot(111) show_plo...
[ "numpy.quantile", "matplotlib.pyplot.show", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "numpy.array" ]
[((503, 515), 'numpy.arange', 'np.arange', (['n'], {}), '(n)\n', (512, 515), True, 'import numpy as np\n'), ((675, 691), 'numpy.mean', 'np.mean', (['data', '(1)'], {}), '(data, 1)\n', (682, 691), True, 'import numpy as np\n'), ((257, 269), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (267, 269), True, 'i...
from pyitab.io.loader import DataLoader from pyitab.analysis.linear_model import LinearModel from pyitab.preprocessing.pipelines import PreprocessingPipeline from pyitab.utils.math import seed_correlation from pyitab.preprocessing.normalizers import FeatureZNormalizer, SampleZNormalizer from pyitab.preprocessing.func...
[ "pandas.DataFrame", "pyitab.preprocessing.functions.SampleAttributeTransformer", "numpy.zeros_like", "numpy.sum", "warnings.filterwarnings", "pyitab.utils.math.seed_correlation", "scipy.stats.stats.pearsonr", "numpy.zeros", "numpy.isnan", "seaborn.regplot", "pyitab.preprocessing.pipelines.Prepro...
[((976, 1009), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (999, 1009), False, 'import warnings\n'), ((1131, 1392), 'pyitab.io.loader.DataLoader', 'DataLoader', ([], {'configuration_file': 'conf_file', 'data_path': 'data_path', 'subjects': '"""/media/robbis/DATA/meg/viv...
import xgboost import numpy as np from os.path import expanduser import pandas as pd from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from sklearn.preprocessing import normalize, StandardScaler from sklearn.model_selection import train_test_split from sklearn.metrics impo...
[ "sklearn.preprocessing.StandardScaler", "pandas.read_csv", "sklearn.model_selection.train_test_split", "keras.layers.LSTM", "collections.Counter", "sklearn.metrics.classification_report", "sklearn.metrics.f1_score", "keras.layers.Dense", "sklearn.preprocessing.normalize", "numpy.reshape", "keras...
[((574, 589), 'os.path.expanduser', 'expanduser', (['"""~"""'], {}), "('~')\n", (584, 589), False, 'from os.path import expanduser\n'), ((655, 676), 'pandas.read_csv', 'pd.read_csv', (['dataFile'], {}), '(dataFile)\n', (666, 676), True, 'import pandas as pd\n'), ((1236, 1248), 'sklearn.preprocessing.normalize', 'normal...
import rospy from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint from cubic_polynomial_planner import CubicPolynomialPlanner from lspb_planner import LSPBPlanner from sensor_msgs.msg import JointState from std_msgs.msg import Float64MultiArray import tf2_ros import tf2_geometry_msgs import numpy as np...
[ "numpy.ndindex", "lspb_planner.LSPBPlanner", "rospy.Time.now", "rospy.wait_for_message", "tf2_ros.TransformListener", "rospy.Publisher", "numpy.zeros", "rospy.sleep", "rospy.get_param", "rospy.Time", "tf2_ros.Buffer", "trajectory_msgs.msg.JointTrajectoryPoint", "sensor_msgs.msg.JointState", ...
[((420, 516), 'rospy.Publisher', 'rospy.Publisher', (['"""/joint_group_position_controller/command"""', 'Float64MultiArray'], {'queue_size': '(1)'}), "('/joint_group_position_controller/command',\n Float64MultiArray, queue_size=1)\n", (435, 516), False, 'import rospy\n'), ((546, 636), 'rospy.Publisher', 'rospy.Publi...
import numpy as np from scipy.stats import norm class BlackScholes(): def __init__(self, r, sigma): """ Parameters ---------- r : float Risk-free rate mu : float Drift sigma : float Volatility """ self.r = r ...
[ "scipy.stats.norm.cdf", "numpy.exp", "numpy.log", "numpy.sqrt" ]
[((902, 915), 'numpy.log', 'np.log', (['(S / K)'], {}), '(S / K)\n', (908, 915), True, 'import numpy as np\n'), ((875, 887), 'numpy.sqrt', 'np.sqrt', (['tau'], {}), '(tau)\n', (882, 887), True, 'import numpy as np\n'), ((1122, 1134), 'scipy.stats.norm.cdf', 'norm.cdf', (['d1'], {}), '(d1)\n', (1130, 1134), False, 'from...
""" Test smd0 and eventbuilder for handling step dgrams. See https://docs.google.com/spreadsheets/d/1VlVCwEVGahab3omAFJLaF8DJWFcz-faI9Q9aHa7QTUw/edit?usp=sharing for test setup. """ import os, time, glob, sys from psana.dgram import Dgram from setup_input_files import setup_input_files from psana import DataSource imp...
[ "numpy.asarray", "numpy.zeros", "os.environ.get", "pathlib.Path", "numpy.max", "setup_input_files.setup_input_files", "psana.DataSource", "os.path.join" ]
[((579, 614), 'os.environ.get', 'os.environ.get', (['"""TEST_XTC_DIR"""', '"""."""'], {}), "('TEST_XTC_DIR', '.')\n", (593, 614), False, 'import os, time, glob, sys\n'), ((625, 664), 'os.path.join', 'os.path.join', (['test_xtc_dir', '""".tmp_smd0"""'], {}), "(test_xtc_dir, '.tmp_smd0')\n", (637, 664), False, 'import os...
""" This python script is a dummy example of the inference script that populates output/ folder. For this example, the loading of the model from the directory /model is not taking place and the output/ folder is populated with arrays filled with zeros of the same size as the images in the input/ folder. """ import os ...
[ "nibabel.Nifti1Image", "os.mkdir", "numpy.random.uniform", "SimpleITK.ImageFileWriter", "SimpleITK.ImageFileReader", "numpy.asanyarray", "os.path.exists", "SimpleITK.GetArrayFromImage", "pathlib.Path", "numpy.array", "SimpleITK.GetImageFromArray", "os.path.join", "os.listdir" ]
[((480, 507), 'os.path.exists', 'os.path.exists', (['INPUT_NIFTI'], {}), '(INPUT_NIFTI)\n', (494, 507), False, 'import os\n'), ((513, 534), 'os.mkdir', 'os.mkdir', (['INPUT_NIFTI'], {}), '(INPUT_NIFTI)\n', (521, 534), False, 'import os\n'), ((542, 570), 'os.path.exists', 'os.path.exists', (['OUTPUT_NIFTI'], {}), '(OUTP...
# The MIT License (MIT) # # Copyright (c) 2016-2021 Celiagg Contributors # # 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...
[ "celiagg.Transform", "numpy.empty", "numpy.zeros", "numpy.testing.assert_equal", "numpy.linspace", "celiagg.example_font", "celiagg.CanvasRGB24", "weakref.ref", "celiagg.Path", "celiagg.GraphicsState" ]
[((1402, 1439), 'numpy.zeros', 'np.zeros', (['(10, 10, 3)'], {'dtype': 'np.uint8'}), '((10, 10, 3), dtype=np.uint8)\n', (1410, 1439), True, 'import numpy as np\n'), ((1457, 1480), 'celiagg.CanvasRGB24', 'agg.CanvasRGB24', (['buffer'], {}), '(buffer)\n', (1472, 1480), True, 'import celiagg as agg\n'), ((1501, 1520), 'we...
#!/usr/bin/env python3 """ Script for training model. Use `run_em.py -h` to see an auto-generated description of advanced options. """ import argparse import numpy as np import torch from yamda.sequences import load_fasta_sequences, save_fasta from yamda.mixture import TCM from yamda.utils import save_model def ge...
[ "numpy.random.seed", "torch.manual_seed", "yamda.mixture.TCM", "yamda.sequences.load_fasta_sequences", "torch.cuda.is_available", "yamda.sequences.save_fasta", "yamda.utils.save_model" ]
[((4900, 4925), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (4914, 4925), True, 'import numpy as np\n'), ((4930, 4958), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (4947, 4958), False, 'import torch\n'), ((6284, 6316), 'yamda.sequences.load_fasta_sequ...
from milp_mespp.core import extract_info as ext from milp_sim.risk.classes.hazard import MyHazard import numpy as np def get_param(): g = ext.get_graph_04() deadline = 10 # coefficient parameters default_z_mu = 0.3 default_z_sigma = 0.1 # fire (f) default_f_mu = 0.2 default_f_sigma =...
[ "milp_mespp.core.extract_info.get_graph_04", "numpy.std", "milp_sim.risk.classes.hazard.MyHazard", "milp_mespp.core.extract_info.has_edge", "numpy.mean", "milp_mespp.core.extract_info.get_python_idx" ]
[((145, 163), 'milp_mespp.core.extract_info.get_graph_04', 'ext.get_graph_04', ([], {}), '()\n', (161, 163), True, 'from milp_mespp.core import extract_info as ext\n'), ((727, 748), 'milp_sim.risk.classes.hazard.MyHazard', 'MyHazard', (['g', 'deadline'], {}), '(g, deadline)\n', (735, 748), False, 'from milp_sim.risk.cl...
# import gym import numpy as np import random import tensorflow as tf import tensorflow.contrib.slim as slim import matplotlib.pyplot as plt import scipy.misc import os import time from gridmap import Map env = Map(7) class Qnetwork(): def __init__(self, h_size, lr): #The network recieves a frame from the...
[ "tensorflow.trainable_variables", "random.sample", "tensorflow.reset_default_graph", "tensorflow.reshape", "tensorflow.matmul", "tensorflow.multiply", "numpy.random.randint", "numpy.mean", "tensorflow.split", "tensorflow.contrib.slim.conv2d", "numpy.zeros_like", "tensorflow.one_hot", "os.pat...
[((212, 218), 'gridmap.Map', 'Map', (['(7)'], {}), '(7)\n', (215, 218), False, 'from gridmap import Map\n'), ((4552, 4576), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (4574, 4576), True, 'import tensorflow as tf\n'), ((4647, 4680), 'tensorflow.global_variables_initializer', 'tf.global...
# -*- coding: utf-8 -*- import tensorflow as tf slim = tf.contrib.slim import numpy as np def non_max_suppression(predictions, confidence_threshold=0.5, iou_threshold=0.5): """Applies Non-max suppression to prediction boxes. Most of codes come from https://github.com/mystic123/tensorflow-yolo-v3/blob/maste...
[ "tensorflow.train.Saver", "numpy.argmax", "numpy.asarray", "tensorflow.concat", "numpy.expand_dims", "numpy.nonzero", "tensorflow.split" ]
[((359, 382), 'numpy.asarray', 'np.asarray', (['predictions'], {}), '(predictions)\n', (369, 382), True, 'import numpy as np\n'), ((399, 463), 'numpy.expand_dims', 'np.expand_dims', (['(predictions[:, :, 4] >= confidence_threshold)', '(-1)'], {}), '(predictions[:, :, 4] >= confidence_threshold, -1)\n', (413, 463), True...
import os import numpy as np import pandas as pd import pytest from ladim.release import ParticleReleaser def releaser(conf, grid, text): fname = conf["particle_release_file"] try: with open(fname, "w", encoding="utf-8-sig") as file: file.write(text) pr = ParticleReleaser(conf, gri...
[ "ladim.release.ParticleReleaser", "os.remove", "pandas.Timestamp", "numpy.datetime64", "pytest.fixture", "numpy.cumsum", "pytest.raises", "numpy.timedelta64", "numpy.array", "pandas.to_datetime", "numpy.all" ]
[((378, 394), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (392, 394), False, 'import pytest\n'), ((869, 885), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (883, 885), False, 'import pytest\n'), ((1059, 1075), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1073, 1075), False, 'import pytest\n'...
from copy import deepcopy from functools import reduce from collections import Counter from typing import Union, Optional, Callable, Sequence, List import numpy as np import pandas as pd import altair as alt from sklearn.utils import deprecated from sklearn.preprocessing import normalize from sklearn.metrics import pa...
[ "lib.custom_whatlies.embedding.Embedding", "sklearn.metrics.pairwise.paired_distances", "numpy.mean", "numpy.array", "sklearn.preprocessing.normalize" ]
[((10642, 10653), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (10650, 10653), True, 'import numpy as np\n'), ((20555, 20598), 'numpy.array', 'np.array', (['[w.vector for w in self[overlap]]'], {}), '([w.vector for w in self[overlap]])\n', (20563, 20598), True, 'import numpy as np\n'), ((20614, 20658), 'numpy.array...
""" This script loads the deep guidance data logged from an experiment (specifically, logged by use_deep_guidance_arm.py) renders a few plots, and animates the motion. It should be run from the folder where use_deep_guidance_arm.py was run from for the given experiment. """ import numpy as np import glob import os im...
[ "numpy.load", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.asarray", "pyvirtualdisplay.Display", "matplotlib.pyplot.figure", "numpy.sin", "numpy.array", "numpy.cos", "glob.glob" ]
[((1052, 1092), 'pyvirtualdisplay.Display', 'Display', ([], {'visible': '(False)', 'size': '(1400, 900)'}), '(visible=False, size=(1400, 900))\n', (1059, 1092), False, 'from pyvirtualdisplay import Display\n'), ((1276, 1297), 'numpy.load', 'np.load', (['log_filename'], {}), '(log_filename)\n', (1283, 1297), True, 'impo...
# -*- coding: utf-8 -*- """ Created on Wed Jun 21 15:49:14 2017 @author: Feng """ #import lib_stockselect as l_s from .lib_stockselect import name_dict#, code_dict from . import lib_stockselect as l_s from . import lib_stockplot as l_plt import pandas as pd from datetime import time,datetime import matpl...
[ "matplotlib.pyplot.axes", "pandas.read_csv", "matplotlib.pyplot.figure", "datetime.datetime.strptime", "numpy.array", "datetime.time", "numpy.log10", "datetime.datetime.now", "pandas.concat" ]
[((2318, 2346), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(15, 15)'}), '(figsize=(15, 15))\n', (2328, 2346), True, 'import matplotlib.pyplot as plt\n'), ((2357, 2387), 'matplotlib.pyplot.axes', 'plt.axes', (['[0.1, 0.6, 0.8, 0.3]'], {}), '([0.1, 0.6, 0.8, 0.3])\n', (2365, 2387), True, 'import matplotl...
#The model used here is a sequence or regression model LSTM RNN (Long Short Term Memory Recuurent Neural Network) # this model can be used to predict stock prices import time import numpy as np import pandas as pd import pandas_datareader as pdr from pandas_datareader import data import logging from keras.layers impor...
[ "seaborn.set_style", "keras.layers.core.Dense", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pandas.read_csv", "keras.layers.LSTM", "sklearn.preprocessing.MinMaxScaler", "keras.layers.core.Activation", "time.time", "numpy.insert", "matplotlib.pyplot.figure", "matplotlib.pyplot.rcParams...
[((574, 600), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (587, 600), True, 'import seaborn as sns\n'), ((601, 624), 'seaborn.set_context', 'sns.set_context', (['"""talk"""'], {}), "('talk')\n", (616, 624), True, 'import seaborn as sns\n'), ((862, 889), 'matplotlib.pyplot.rcParam...
from PIL import Image, ImageOps import numpy as np import tensorflow from tensorflow.keras.optimizers import Adam from tensorflow.keras.applications.nasnet import NASNetMobile from tensorflow.keras.preprocessing import image from tensorflow.keras.models import Model from tensorflow.keras.layers import Dense, GlobalAve...
[ "numpy.argmax", "numpy.asarray", "PIL.Image.open", "tensorflow.keras.applications.MobileNet", "PIL.ImageOps.invert", "pickle.load", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.metrics.top_k_categorical_accuracy" ]
[((639, 735), 'tensorflow.keras.applications.MobileNet', 'MobileNet', ([], {'input_shape': '(input_size, input_size, 1)', 'weights': 'None', 'alpha': '(1)', 'classes': 'num_class'}), '(input_shape=(input_size, input_size, 1), weights=None, alpha=1,\n classes=num_class)\n', (648, 735), False, 'from tensorflow.keras.a...
# -*- coding: utf-8 -*- """ Created on Mon Sep 5 18:25:21 2016 @author: Ajoo """ from .autodiff import * from weakref import WeakKeyDictionary import numbers import math __all__ = [ 'DiffFloat', 'dfloat' ] #------------------------------------------------------------------------------ # DiffFloat - ...
[ "numpy.vdot", "math.sin", "numpy.array", "math.cos", "math.log" ]
[((4409, 4428), 'numpy.array', 'np.array', (['[a, b, c]'], {}), '([a, b, c])\n', (4417, 4428), True, 'import numpy as np\n'), ((4436, 4449), 'numpy.vdot', 'np.vdot', (['v', 'v'], {}), '(v, v)\n', (4443, 4449), True, 'import numpy as np\n'), ((4532, 4544), 'math.sin', 'math.sin', (['x1'], {}), '(x1)\n', (4540, 4544), Fa...
from __future__ import print_function import time import random import numpy as np from utils import * from transfer_functions import * class NeuralNetwork(object): def __init__(self, input_layer_size, hidden_layer_size, output_layer_size, iterations = 50, learning_rate = 0.1, tfunction =...
[ "numpy.random.uniform", "numpy.sum", "numpy.argmax", "numpy.ones", "time.time", "numpy.append", "numpy.array", "numpy.arange", "numpy.random.normal", "numpy.sqrt", "numpy.delete", "numpy.random.shuffle", "numpy.atleast_2d" ]
[((1099, 1118), 'numpy.ones', 'np.ones', (['self.input'], {}), '(self.input)\n', (1106, 1118), True, 'import numpy as np\n'), ((1143, 1163), 'numpy.ones', 'np.ones', (['self.hidden'], {}), '(self.hidden)\n', (1150, 1163), True, 'import numpy as np\n'), ((1188, 1208), 'numpy.ones', 'np.ones', (['self.output'], {}), '(se...
import numpy as np from PIL import Image from scipy.io import loadmat, savemat from array import array # load expression basis def LoadExpBasis(): n_vertex = 53215 Expbin = open('BFM/Exp_Pca.bin', 'rb') exp_dim = array('i') exp_dim.fromfile(Expbin, 1) expMU = array('f') expPC = ar...
[ "scipy.io.loadmat", "numpy.transpose", "scipy.io.savemat", "PIL.Image.open", "numpy.mean", "numpy.array", "numpy.loadtxt", "array.array", "numpy.reshape" ]
[((237, 247), 'array.array', 'array', (['"""i"""'], {}), "('i')\n", (242, 247), False, 'from array import array\n'), ((294, 304), 'array.array', 'array', (['"""f"""'], {}), "('f')\n", (299, 304), False, 'from array import array\n'), ((318, 328), 'array.array', 'array', (['"""f"""'], {}), "('f')\n", (323, 328), False, '...
from numpy import loadtxt from xgboost import XGBClassifier from catboost import CatBoostClassifier from matplotlib import pyplot as plt import pandas as pd import numpy as np from sklearn.metrics import roc_auc_score, f1_score from sklearn import metrics import smote_variants as sv from sklearn.linear_model ...
[ "pandas.DataFrame", "sklearn.metrics.roc_curve", "smote_variants.distance_SMOTE", "pandas.read_csv", "sklearn.svm.SVC", "sklearn.metrics.accuracy_score", "sklearn.metrics.recall_score", "numpy.append", "sklearn.linear_model.LogisticRegression", "sklearn.metrics.auc", "numpy.array", "sklearn.me...
[((438, 470), 'pandas.read_csv', 'pd.read_csv', (['"""original_data.csv"""'], {}), "('original_data.csv')\n", (449, 470), True, 'import pandas as pd\n'), ((479, 491), 'numpy.array', 'np.array', (['df'], {}), '(df)\n', (487, 491), True, 'import numpy as np\n'), ((541, 560), 'smote_variants.distance_SMOTE', 'sv.distance_...
import matplotlib.pyplot as plt import numpy as np import pandas as pd import pytask import seaborn as sns from src.config import BLD from src.config import POPULATION_GERMANY @pytask.mark.depends_on( { "initial_states": BLD / "data" / "initial_states.parquet", "work_daily_dist": BLD / "c...
[ "numpy.abs", "pytask.mark.produces", "pandas.read_csv", "matplotlib.pyplot.close", "seaborn.barplot", "pytask.mark.depends_on", "seaborn.despine", "pandas.read_parquet", "pandas.read_pickle", "pandas.testing.assert_series_equal", "matplotlib.pyplot.subplots" ]
[((180, 902), 'pytask.mark.depends_on', 'pytask.mark.depends_on', (["{'initial_states': BLD / 'data' / 'initial_states.parquet',\n 'work_daily_dist': BLD / 'contact_models' / 'empirical_distributions' /\n 'work_recurrent_daily.pkl', 'work_weekly_dist': BLD / 'contact_models' /\n 'empirical_distributions' / 'wo...
# -*- coding: utf-8 -*- """ Created on Mon Nov 14 22:43:13 2016 @author: zhouyu for kaggle challenge - allstate """ import pandas as pd import numpy as np import seaborn as sns dataset = pd.read_csv('/Users/zhouyu/Documents/Zhou_Yu/DS/kaggle_challenge/train.csv') testset = pd.read_csv('/Users/zhouyu/Documents/Zhou_Yu...
[ "seaborn.heatmap", "pandas.read_csv", "matplotlib.pylab.gca", "matplotlib.pylab.subplots", "matplotlib.pylab.show", "numpy.zeros_like", "matplotlib.pylab.scatter", "xgboost.train", "matplotlib.mlab.normpdf", "seaborn.set", "pandas.concat", "matplotlib.pylab.plot", "matplotlib.pylab.ylabel", ...
[((189, 265), 'pandas.read_csv', 'pd.read_csv', (['"""/Users/zhouyu/Documents/Zhou_Yu/DS/kaggle_challenge/train.csv"""'], {}), "('/Users/zhouyu/Documents/Zhou_Yu/DS/kaggle_challenge/train.csv')\n", (200, 265), True, 'import pandas as pd\n'), ((276, 351), 'pandas.read_csv', 'pd.read_csv', (['"""/Users/zhouyu/Documents/Z...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function from scipy.stats import geom from collections import namedtuple import random import math from string import ascii_letters, digits, ascii_lowercase, ascii_uppercase, whitespace, printable import numpy as np PartialMatch = n...
[ "random.choice", "random.random", "collections.namedtuple", "scipy.stats.geom.rvs", "numpy.random.choice", "math.log" ]
[((319, 420), 'collections.namedtuple', 'namedtuple', (['"""PartialMatch"""', "['numCharacters', 'score', 'reported_score', 'continuation', 'state']"], {}), "('PartialMatch', ['numCharacters', 'score', 'reported_score',\n 'continuation', 'state'])\n", (329, 420), False, 'from collections import namedtuple\n'), ((478...
import numpy as np from librosa.output import write_wav from moviepy.editor import VideoFileClip from ImageSequenceClip import ImageSequenceClip from skimage import color import utils import os from collections import defaultdict """ Add audio to video without audio """ __author__ = "<NAME>" def normalize(arr, ...
[ "numpy.amin", "moviepy.editor.VideoFileClip", "utils.ensure_dir", "numpy.amax", "numpy.array" ]
[((1244, 1275), 'utils.ensure_dir', 'utils.ensure_dir', (['save_dir_path'], {}), '(save_dir_path)\n', (1260, 1275), False, 'import utils\n'), ((1292, 1325), 'moviepy.editor.VideoFileClip', 'VideoFileClip', (['video_dir_filename'], {}), '(video_dir_filename)\n', (1305, 1325), False, 'from moviepy.editor import VideoFile...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Disk Embedding into n-Sphire """ from dag_emb_model import DAGEmbeddingModel, DAGEmbeddingBatch, DAGEmbeddingKeyedVectors import numpy as np try: from autograd import grad # Only required for optionally verifying gradients while training from autograd impor...
[ "numpy.zeros_like", "numpy.sum", "numpy.maximum", "numpy.copy", "numpy.where", "numpy.linalg.norm", "numpy.arange" ]
[((1062, 1078), 'numpy.copy', 'np.copy', (['vectors'], {}), '(vectors)\n', (1069, 1078), True, 'import numpy as np\n'), ((4591, 4666), 'numpy.linalg.norm', 'np.linalg.norm', (['(self.vectors_u[:, :1, :] - self.vectors_v[:, 1:, :])'], {'axis': '(1)'}), '(self.vectors_u[:, :1, :] - self.vectors_v[:, 1:, :], axis=1)\n', (...
#!/usr/bin/env python """ pitchanalysis.py -- <NAME> <EMAIL> -- Requires: Python 2.7 Instructions: python pitchanalysis.py [wav-file-name] """ import matplotlib from math import log matplotlib.use("TkAgg") from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure imp...
[ "Tkinter.Tk", "Tkinter.mainloop", "wavelab.thread", "Tkinter.IntVar", "wavelab.readwav", "Tkinter.Label", "wavelab.frequencies", "Tkinter.StringVar", "matplotlib.figure.Figure", "numpy.hanning", "math.log", "Tkinter.Scale", "numpy.hamming", "wavelab.pitch", "matplotlib.use", "matplotli...
[((192, 215), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (206, 215), False, 'import matplotlib\n'), ((2320, 2342), 'wavelab.readwav', 'wavelab.readwav', (['FNAME'], {}), '(FNAME)\n', (2335, 2342), False, 'import wavelab\n'), ((2350, 2376), 'numpy.concatenate', 'np.concatenate', (['(wav, w...
""" philoseismos: engineering seismologist's toolbox. author: <NAME> e-mail: <EMAIL> """ import numpy as np from philoseismos.models.layer import Layer from philoseismos.segy.segy import SegY class HorizontallyLayeredMedium: """ This object represents a horizontally layered medium. Horizontally layered m...
[ "numpy.sqrt", "numpy.empty_like", "numpy.arange", "philoseismos.models.layer.Layer" ]
[((3512, 3547), 'numpy.empty_like', 'np.empty_like', (['zz'], {'dtype': 'np.float32'}), '(zz, dtype=np.float32)\n', (3525, 3547), True, 'import numpy as np\n'), ((3562, 3597), 'numpy.empty_like', 'np.empty_like', (['zz'], {'dtype': 'np.float32'}), '(zz, dtype=np.float32)\n', (3575, 3597), True, 'import numpy as np\n'),...
import openfabmap_python3 as of # configuration for vocabulary SETTINGS = dict() SETTINGS["VocabTrainOptions"] = dict() SETTINGS["VocabTrainOptions"]["ClusterSize"] = 0.45 SETTINGS["FeatureOptions"] = dict() SETTINGS["FeatureOptions"]["FastDetector"] = dict() SETTINGS["FeatureOptions"]["FastDetector"]["Threshold"] =...
[ "numpy.asarray", "openfabmap_python3.VocabularyBuilder", "PIL.Image.open", "cv2.imread", "cv2.ORB_create" ]
[((774, 804), 'openfabmap_python3.VocabularyBuilder', 'of.VocabularyBuilder', (['SETTINGS'], {}), '(SETTINGS)\n', (794, 804), True, 'import openfabmap_python3 as of\n'), ((1031, 1051), 'PIL.Image.open', 'Image.open', (['png_file'], {}), '(png_file)\n', (1041, 1051), False, 'from PIL import Image\n'), ((1150, 1180), 'op...
import cv2 import numpy as np ''' img e kernel devem ter a mesma dimensao ''' def conv2D(img, kernel): output = 0 for i in list(range(img.shape[0])): for j in list(range(img.shape[1])): output += img[i, j]*kernel[i, j] return output if __name__ == '__main__': img = np.array([[1, 0, 1], [0, 0, 1], [1, 0, 1]...
[ "numpy.array" ]
[((279, 322), 'numpy.array', 'np.array', (['[[1, 0, 1], [0, 0, 1], [1, 0, 1]]'], {}), '([[1, 0, 1], [0, 0, 1], [1, 0, 1]])\n', (287, 322), True, 'import numpy as np\n'), ((333, 381), 'numpy.array', 'np.array', (['[[1, 2, 4], [8, 0, 16], [32, 64, 128]]'], {}), '([[1, 2, 4], [8, 0, 16], [32, 64, 128]])\n', (341, 381), Tr...
from data.model import create_model from img_dataloader import TripletPrediction from keras.models import Model from keras.layers import Input from keras.layers.core import Dropout, Dense from keras.layers import Subtract, Concatenate import numpy as np import os WEIGHTS_NN4SMALL2_PATH = './weights/nn4.small2.final.hd...
[ "keras.layers.core.Dense", "numpy.argmax", "numpy.asarray", "data.model.create_model", "keras.models.Model", "keras.layers.Concatenate", "img_dataloader.TripletPrediction", "keras.layers.Subtract", "keras.layers.core.Dropout", "keras.layers.Input", "os.listdir" ]
[((389, 403), 'data.model.create_model', 'create_model', ([], {}), '()\n', (401, 403), False, 'from data.model import create_model\n'), ((412, 436), 'keras.layers.Input', 'Input', ([], {'shape': '(96, 96, 3)'}), '(shape=(96, 96, 3))\n', (417, 436), False, 'from keras.layers import Input\n'), ((444, 468), 'keras.layers....
""" first pass implementation of pzflow estimator First pass will ignore photometric errors and just do things in terms of magnitudes, we will expand in a future update """ import numpy as np from ceci.config import StageParameter as Param from rail.estimation.estimator import Estimator, Informer from rail.core.data ...
[ "pandas.DataFrame", "ceci.config.StageParameter", "pzflow.bijectors.StandardScaler", "pzflow.bijectors.ColorTransform", "numpy.argmax", "rail.estimation.estimator.Estimator.config_options.copy", "rail.estimation.estimator.Estimator.__init__", "pzflow.bijectors.RollingSplineCoupling", "pzflow.bijecto...
[((1283, 1304), 'pandas.DataFrame', 'pd.DataFrame', (['tmpdict'], {}), '(tmpdict)\n', (1295, 1304), True, 'import pandas as pd\n'), ((1319, 1343), 'numpy.array', 'np.array', (['tmpdf[usecols]'], {}), '(tmpdf[usecols])\n', (1327, 1343), True, 'import numpy as np\n'), ((2350, 2380), 'rail.estimation.estimator.Informer.co...
import sys import json import h5py import numpy as np from timeit import default_timer as timer import torch from torch.autograd import Variable import torch.nn.functional as F import options import visdial.metrics as metrics from utils import utilities as utils from dataloader import VisDialDataset from torch.utils....
[ "sys.stdout.write", "torch.cat", "sys.stdout.flush", "torch.no_grad", "sklearn.metrics.pairwise.pairwise_distances", "torch.utils.data.DataLoader", "six.moves.range", "visdial.loss.loss_utils.PairwiseRankingLoss", "visdial.loss.infoGain.prepareBatch", "torch.mean", "visdial.loss.rl_txtuess_loss....
[((637, 679), 'visdial.loss.loss_utils.PairwiseRankingLoss', 'loss_utils.PairwiseRankingLoss', ([], {'margin': '(0.1)'}), '(margin=0.1)\n', (667, 679), True, 'import visdial.loss.loss_utils as loss_utils\n'), ((927, 953), 'torch.cat', 'torch.cat', (['all_txt_feat', '(0)'], {}), '(all_txt_feat, 0)\n', (936, 953), False,...
#!/usr/bin/python3 # Tested with Python 3.8.6 #------------------------------------------------------------------------------ # compile_backend.py #------------------------------------------------------------------------------ # Author: <NAME> # Oregon State University #----------------------------------------------...
[ "corner.corner", "emcee.backends.HDFBackend", "numpy.asarray", "numpy.zeros", "time.strftime", "numpy.shape", "numpy.sort", "numpy.percentile", "glob.glob" ]
[((2386, 2414), 'numpy.asarray', 'np.asarray', (['compiled_samples'], {}), '(compiled_samples)\n', (2396, 2414), True, 'import numpy as np\n'), ((3040, 3412), 'corner.corner', 'corner.corner', (['samples'], {'labels': 'labels', 'label_kwargs': "{'fontsize': 20}", 'quantiles': '[0.16, 0.5, 0.84]', 'histtype': '"""bar"""...
# Copyright (C) 2022 National Center for Atmospheric Research and National Oceanic and Atmospheric Administration # SPDX-License-Identifier: Apache-2.0 # from __future__ import division from builtins import range import numpy as np __author__ = 'barry' def search_listinlist(array1, array2): # find intersection...
[ "pandas.DataFrame", "statsmodels.api.OLS", "pandas.merge", "numpy.where", "numpy.array", "pandas.Series", "numpy.sin", "numpy.cos", "numpy.exp", "statsmodels.api.add_constant", "numpy.int32", "builtins.range", "numpy.concatenate", "numpy.sqrt" ]
[((432, 444), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (440, 444), True, 'import numpy as np\n'), ((458, 470), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (466, 470), True, 'import numpy as np\n'), ((1063, 1081), 'statsmodels.api.add_constant', 'sm.add_constant', (['x'], {}), '(x)\n', (1078, 1081), Tru...
import logging import numpy as np from nptyping import NDArray from scipy.optimize import minimize import scipy.stats as st import Starfish.constants as C from .kernels import global_covariance_matrix def find_residual_peaks( model, num_residuals=100, threshold=4.0, buffer=2, wl_range=(0, np.inf) ): """ ...
[ "numpy.zeros_like", "numpy.abs", "numpy.sum", "numpy.log", "numpy.allclose", "numpy.linalg.eigh", "scipy.stats.uniform.logpdf", "numpy.exp", "logging.getLogger", "numpy.sqrt" ]
[((5444, 5471), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (5461, 5471), False, 'import logging\n'), ((1677, 1714), 'numpy.zeros_like', 'np.zeros_like', (['peak_waves'], {'dtype': 'bool'}), '(peak_waves, dtype=bool)\n', (1690, 1714), True, 'import numpy as np\n'), ((1776, 1810), 'nump...
import pandas as pd import ast import matplotlib.pyplot as plt import numpy as np from matplotlib.ticker import FuncFormatter from matplotlib.lines import Line2D from county_utilities import * import sys, os, csv sys.path.insert(1, '../data_processing') from load_CA_data import * # Load the counties cd = load_countie...
[ "numpy.log", "matplotlib.lines.Line2D", "pandas.read_csv", "numpy.log2", "sys.path.insert", "numpy.around", "matplotlib.pyplot.figure", "matplotlib.ticker.FuncFormatter", "numpy.array", "numpy.exp", "numpy.max", "ast.literal_eval", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig" ]
[((213, 253), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../data_processing"""'], {}), "(1, '../data_processing')\n", (228, 253), False, 'import sys, os, csv\n'), ((4644, 4672), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(40, 10)'}), '(figsize=(40, 10))\n', (4654, 4672), True, 'import matplotli...
#!/usr/bin/python3 -u ''' Research Question 2: Run Recursive Feature Elimination (RFE) for the prediction of 'Target-FeedbackCount' ''' import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.ensemble import RandomForestRegressor from sklearn.linear_model import Ridge from sklearn.neighbors im...
[ "sklearn.model_selection.PredefinedSplit", "sklearn.preprocessing.StandardScaler", "sklearn.feature_selection.RFECV", "dataset.Dataset", "sklearn.ensemble.RandomForestRegressor", "numpy.concatenate" ]
[((2692, 2717), 'dataset.Dataset', 'Dataset', (['DATASET_CSV_PATH'], {}), '(DATASET_CSV_PATH)\n', (2699, 2717), False, 'from dataset import Dataset\n'), ((3109, 3125), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (3123, 3125), False, 'from sklearn.preprocessing import StandardScaler\n'), ...
import numpy as np from solver.interior_point import InteriorPointMethod from solver.path_following import PathFollowing if __name__ == "__main__": A = np.asarray(np.asmatrix('1, 0, 1, 0, 0, 0, 0; \ 2, 2, 0, 1, 0, 0, 0; \ 4, 1, 0, 0, 1, 0, 0; \ ...
[ "solver.path_following.PathFollowing", "numpy.asarray", "numpy.asmatrix", "solver.interior_point.InteriorPointMethod" ]
[((424, 475), 'numpy.asarray', 'np.asarray', (['[2.3, 10, 10, 12, 10]'], {'dtype': 'np.float64'}), '([2.3, 10, 10, 12, 10], dtype=np.float64)\n', (434, 475), True, 'import numpy as np\n'), ((484, 537), 'numpy.asarray', 'np.asarray', (['[-1, -2, 0, 0, 0, 0, 0]'], {'dtype': 'np.float64'}), '([-1, -2, 0, 0, 0, 0, 0], dtyp...
#!/usr/bin/python # # Author: <NAME> # Date: 2018-09-26 # # This script runs Logistic Regression analysis on Baxter Dataset subset of onlt cancer and normal samples to predict diagnosis based on OTU data only. This script only evaluates generalization performance of the model. # ############## IMPORT MODULES #########...
[ "pandas.DataFrame", "sklearn.model_selection.GridSearchCV", "preprocess_data.process_multidata", "matplotlib.pyplot.show", "sklearn.preprocessing.StandardScaler", "sklearn.metrics.roc_curve", "sklearn.model_selection.train_test_split", "seaborn.swarmplot", "sklearn.metrics.auc", "matplotlib.pyplot...
[((352, 373), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (366, 373), False, 'import matplotlib\n'), ((935, 985), 'pandas.read_table', 'pd.read_table', (['"""data/baxter.0.03.subsample.shared"""'], {}), "('data/baxter.0.03.subsample.shared')\n", (948, 985), True, 'import pandas as pd\n'), ((99...
# LICENSE # This software is licensed under an MIT License. # Copyright (c) 2020 <NAME>, <NAME>, <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, inc...
[ "numpy.divide", "numpy.sum", "numpy.power", "numpy.zeros", "numpy.reshape", "scipy.stats.linregress", "numpy.log10" ]
[((3260, 3278), 'numpy.zeros', 'np.zeros', (['[nq, ns]'], {}), '([nq, ns])\n', (3268, 3278), True, 'import numpy as np\n'), ((3287, 3305), 'numpy.zeros', 'np.zeros', (['[nq, ns]'], {}), '([nq, ns])\n', (3295, 3305), True, 'import numpy as np\n'), ((3314, 3332), 'numpy.zeros', 'np.zeros', (['[nq, ns]'], {}), '([nq, ns])...
""" .. module:: System :platform: UNIX """ from collections import OrderedDict import numpy as np from intermol.moleculetype import MoleculeType from intermol.hashmap import HashMap class System(object): _sys = None def __init__(self, name=None): """Initialize a new System object. This ...
[ "collections.OrderedDict", "numpy.zeros", "intermol.hashmap.HashMap", "intermol.moleculetype.MoleculeType" ]
[((772, 785), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (783, 785), False, 'from collections import OrderedDict\n'), ((812, 821), 'intermol.hashmap.HashMap', 'HashMap', ([], {}), '()\n', (819, 821), False, 'from intermol.hashmap import HashMap\n'), ((848, 857), 'intermol.hashmap.HashMap', 'HashMap', (...
""" datatool is the module used to prepare a dataset for input into Chronostar. Here we run a few simple tests on small, contrived datasets. """ import numpy as np import sys sys.path.insert(0, '..') from chronostar import datatool from chronostar import synthdata from chronostar import tabletool PARS = np.array([ ...
[ "numpy.random.seed", "numpy.abs", "numpy.allclose", "sys.path.insert", "chronostar.synthdata.SynthData", "numpy.array", "chronostar.tabletool.convert_table_astro2cart", "chronostar.tabletool.get_colnames", "chronostar.datatool.prepare_data" ]
[((176, 200), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (191, 200), False, 'import sys\n'), ((309, 426), 'numpy.array', 'np.array', (['[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0, 5.0, 1e-05], [100.0, 0.0, 0.0, 0.0, \n 0.0, 0.0, 10.0, 5.0, 1e-05]]'], {}), '([[0.0, 0.0, 0.0, 0.0, 0.0, 0...
#! /usr/bin/env python3 import numpy as np from collections import Counter from scipy.stats import norm, t from scipy.special import logsumexp #################################### ### LSBM with Gaussian processes ### #################################### ## Utility functions to update inverses when row/columns are add...
[ "numpy.sum", "numpy.put", "numpy.random.exponential", "numpy.ones", "numpy.isnan", "numpy.random.normal", "scipy.special.logsumexp", "numpy.copy", "numpy.transpose", "numpy.insert", "numpy.max", "numpy.random.choice", "collections.Counter", "numpy.min", "numpy.delete", "numpy.outer", ...
[((1414, 1461), 'numpy.insert', 'np.insert', ([], {'arr': 'inv', 'obj': 'ind', 'values': 'B21', 'axis': '(0)'}), '(arr=inv, obj=ind, values=B21, axis=0)\n', (1423, 1461), True, 'import numpy as np\n'), ((532, 565), 'numpy.delete', 'np.delete', ([], {'arr': 'M', 'obj': 'ind', 'axis': '(0)'}), '(arr=M, obj=ind, axis=0)\n...
import os from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline # from rllab.envs.mujoco.gather.swimmer_gather_env import SwimmerGatherEnv os.environ["THEANO_FLAGS"] = "device=cpu" from rllab.envs.gym_env import GymEnv from rllab.envs.normalized_env import normalize from rllab.policies.gaussian_mlp...
[ "numpy.random.uniform", "rllab.envs.gym_env.GymEnv", "sandbox.bradly.third_person.launchers.cyberpunk_aws_gail.CyberpunkAWSGAIL", "rllab.policies.gaussian_mlp_policy.GaussianMLPPolicy", "os.path.exists", "rllab.baselines.linear_feature_baseline.LinearFeatureBaseline", "rllab.algos.trpo.TRPO", "numpy.r...
[((867, 891), 'os.path.exists', 'os.path.exists', (['modeldir'], {}), '(modeldir)\n', (881, 891), False, 'import os, shutil\n'), ((897, 920), 'shutil.rmtree', 'shutil.rmtree', (['modeldir'], {}), '(modeldir)\n', (910, 920), False, 'import os, shutil\n'), ((1816, 1856), 'numpy.random.uniform', 'np.random.uniform', ([], ...
import collections import os import zipfile from typing import List, Dict, DefaultDict from zipfile import ZipFile import cv2 import numpy as np import pyclipper import torch def get_results(path_list, merge_path, image_num, regenerate=True): if regenerate or not os.path.exists(merge_path): results_merge...
[ "cv2.contourArea", "zipfile.ZipFile", "pyclipper.Pyclipper", "torch.load", "numpy.asarray", "os.path.exists", "numpy.ones", "collections.defaultdict", "torch.save", "os.chdir" ]
[((624, 646), 'torch.load', 'torch.load', (['merge_path'], {}), '(merge_path)\n', (634, 646), False, 'import torch\n'), ((1680, 1707), 'numpy.ones', 'np.ones', (['length'], {'dtype': 'bool'}), '(length, dtype=bool)\n', (1687, 1707), True, 'import numpy as np\n'), ((2128, 2148), 'os.chdir', 'os.chdir', (['output_dir'], ...
# Environ import scipy as scp #import tensorflow as tf #from scipy.stats import gamma import numpy as np import random import sys #import multiocessing as mp #import psutil import pickle import os # Own #import ddm_data_simulation as ds #import cddm_data_simulation as cds #import kde_training_utilities as kde_util #im...
[ "random.shuffle", "numpy.histogram", "numpy.asmatrix", "numpy.linspace", "os.listdir", "numpy.concatenate" ]
[((1577, 1649), 'os.listdir', 'os.listdir', (['"""/users/afengler/data/kde/angle/base_simulations_ndt_20000/"""'], {}), "('/users/afengler/data/kde/angle/base_simulations_ndt_20000/')\n", (1587, 1649), False, 'import os\n'), ((1650, 1672), 'random.shuffle', 'random.shuffle', (['files_'], {}), '(files_)\n', (1664, 1672)...
import numpy as np import json import os import tempfile import pprint import time import copy import setup_path import airsim import bezier from utils.dataclasses import PosVec3, Quaternion from airsim.types import DrivetrainType, YawMode def calculate_moveable_space(start_point: PosVec3, ...
[ "utils.dataclasses.PosVec3", "numpy.radians", "copy.deepcopy", "json.load", "numpy.asfortranarray", "time.sleep", "airsim.YawMode", "airsim.wait_key", "airsim.MultirotorClient", "numpy.array", "utils.dataclasses.Quaternion", "bezier.Curve" ]
[((12216, 12264), 'utils.dataclasses.PosVec3', 'PosVec3', ([], {'X': '(50.0)', 'Y': '(140.0)', 'Z': '(25.0)', 'frame': '"""global"""'}), "(X=50.0, Y=140.0, Z=25.0, frame='global')\n", (12223, 12264), False, 'from utils.dataclasses import PosVec3, Quaternion\n'), ((12280, 12318), 'utils.dataclasses.PosVec3', 'PosVec3', ...
# -*- coding: utf-8 -*- import sys import time import numpy as np import matplotlib import matplotlib.cm as cm import matplotlib.pyplot as plt import cv2 from numba import jit matplotlib.interactive(False) # cal constant def constF(): A = np.zeros((n, n)) B = np.zeros((n, n)) for i in range(n): ...
[ "matplotlib.pyplot.title", "cv2.VideoWriter_fourcc", "matplotlib.pyplot.figure", "numpy.sin", "matplotlib.pyplot.gca", "matplotlib.pyplot.tick_params", "numpy.full", "numpy.copy", "cv2.cvtColor", "matplotlib.pyplot.close", "matplotlib.pyplot.ylim", "matplotlib.interactive", "matplotlib.cm.je...
[((178, 207), 'matplotlib.interactive', 'matplotlib.interactive', (['(False)'], {}), '(False)\n', (200, 207), False, 'import matplotlib\n'), ((1523, 1534), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (1531, 1534), True, 'import numpy as np\n'), ((1549, 1560), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (1557,...
## Henderson.py ## calculate a Henderson moving average ## adpated from this: ## https://markthegraph.blogspot.com/2014/06/henderson-moving-average.html ## see also ## https://www.abs.gov.au/websitedbs/d3310114.nsf/4a256353001af3ed4b2562bb00121564/5fc845406def2c3dca256ce100188f8e!OpenDocument import numpy as np def h...
[ "numpy.repeat" ]
[((853, 873), 'numpy.repeat', 'np.repeat', (['np.nan', 'n'], {}), '(np.nan, n)\n', (862, 873), True, 'import numpy as np\n'), ((2525, 2545), 'numpy.repeat', 'np.repeat', (['np.nan', 'm'], {}), '(np.nan, m)\n', (2534, 2545), True, 'import numpy as np\n')]
import get_saliency import get_gbp import get_CAM import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms as transforms import numpy as np import matplotlib.pyplot as plt import cv2 from io import BytesIO from PIL import Image import requests def visualize(plots, top_pred, t...
[ "matplotlib.pyplot.title", "get_CAM.generate", "io.BytesIO", "matplotlib.pyplot.show", "get_saliency.generate", "matplotlib.pyplot.imshow", "matplotlib.pyplot.axis", "torch.nn.functional.softmax", "torchvision.transforms.ToTensor", "numpy.min", "numpy.max", "requests.get", "get_gbp.GuidedBac...
[((1535, 1553), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (1551, 1553), True, 'import matplotlib.pyplot as plt\n'), ((1558, 1568), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1566, 1568), True, 'import matplotlib.pyplot as plt\n'), ((3413, 3437), 'torch.nn.functional.softmax',...
############################################################################################# # Given an array of integers, return a new array such that each element at index i of the # # new array is the product of all the number in the original array # ######################################...
[ "numpy.array", "numpy.ones" ]
[((432, 466), 'numpy.ones', 'np.ones', (['arr.shape'], {'dtype': 'np.uint8'}), '(arr.shape, dtype=np.uint8)\n', (439, 466), True, 'import numpy as np\n'), ((698, 727), 'numpy.array', 'np.array', (['arr'], {'dtype': 'np.uint8'}), '(arr, dtype=np.uint8)\n', (706, 727), True, 'import numpy as np\n')]
import pytest from numpy.testing import assert_almost_equal from src.model_code.within_period import get_consumption from src.model_code.within_period import util ######################################################################### # FIXTURES #####################################################################...
[ "src.model_code.within_period.get_consumption", "numpy.testing.assert_almost_equal", "src.model_code.within_period.util" ]
[((1174, 1214), 'src.model_code.within_period.get_consumption', 'get_consumption', ([], {}), '(**setup_get_consumption)\n', (1189, 1214), False, 'from src.model_code.within_period import get_consumption\n'), ((1219, 1268), 'numpy.testing.assert_almost_equal', 'assert_almost_equal', (['actual', 'expected'], {'decimal': ...
# Simulation Manager import os import numpy as np from .standard import * class Simulation: """Class to automate the management of simulations Required Parameters: -------------------- case: moc.Case ngroups: int; number of energy groups to run this simulation in solve_type: str; type of...
[ "numpy.array", "os.path.exists", "os.makedirs", "os.scandir" ]
[((3738, 3758), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (3752, 3758), False, 'import os\n'), ((2839, 2870), 'numpy.array', 'np.array', (['mesh_shape'], {'dtype': 'str'}), '(mesh_shape, dtype=str)\n', (2847, 2870), True, 'import numpy as np\n'), ((3946, 3963), 'os.makedirs', 'os.makedirs', (['pat...
import numpy as np from teilab.utils import dict2str, subplots_create from teilab.plot.plotly import boxplot n_samples, n_features = (4, 1000) data = np.random.RandomState(0).normal(loc=np.expand_dims(np.arange(n_samples), axis=1), size=(n_samples, n_features)) kwargses = [{"vert":True},{"vert":False}] title = ", ".joi...
[ "teilab.utils.dict2str", "numpy.random.RandomState", "numpy.arange", "teilab.plot.plotly.boxplot", "teilab.utils.subplots_create" ]
[((393, 437), 'teilab.utils.subplots_create', 'subplots_create', ([], {'ncols': 'nfigs', 'style': '"""plotly"""'}), "(ncols=nfigs, style='plotly')\n", (408, 437), False, 'from teilab.utils import dict2str, subplots_create\n'), ((494, 572), 'teilab.plot.plotly.boxplot', 'boxplot', (['data'], {'title': 'title', 'fig': 'f...
import torch.utils.data as data import pickle import h5py import numpy as np import torch import random import os from data import load_augment random.seed(334) class data_loader(data.Dataset): def __init__(self, inputPath, ifTrain, transform = False): self.input_path = inputPath self.transform = ...
[ "h5py.File", "torch.from_numpy", "random.seed", "numpy.array", "os.listdir", "numpy.concatenate", "data.load_augment" ]
[((144, 160), 'random.seed', 'random.seed', (['(334)'], {}), '(334)\n', (155, 160), False, 'import random\n'), ((361, 382), 'os.listdir', 'os.listdir', (['inputPath'], {}), '(inputPath)\n', (371, 382), False, 'import os\n'), ((1102, 1200), 'data.load_augment', 'load_augment', (['fname', 'w', 'h'], {'aug_params': 'aug_p...
import numpy as np import cv2 import time # load the input image from disk image = cv2.imread("images/image_02.jpg") # load the class labels from disk rows = open("synset_words.txt").read().strip().split("\n") classes = [r[r.find(" ") + 1:].split(",")[0] for r in rows] blob = cv2.dnn.blobFromImage(image, 1, (224, 2...
[ "cv2.putText", "cv2.waitKey", "cv2.dnn.blobFromImage", "numpy.argsort", "cv2.imread", "cv2.dnn.readNetFromCaffe", "cv2.imshow" ]
[((84, 117), 'cv2.imread', 'cv2.imread', (['"""images/image_02.jpg"""'], {}), "('images/image_02.jpg')\n", (94, 117), False, 'import cv2\n'), ((281, 341), 'cv2.dnn.blobFromImage', 'cv2.dnn.blobFromImage', (['image', '(1)', '(224, 224)', '(104, 117, 123)'], {}), '(image, 1, (224, 224), (104, 117, 123))\n', (302, 341), F...
import numpy as np import datetime class RSWaveformGenerator(): """ Generates .wv files from I/Q for the AFQ 100B I/Q modulation generator and related Rohde & Schwarz instruments RSWaveformGenerator(instrument) Initialises waveform generator ready to upload to qcodes instrument ...
[ "numpy.abs", "numpy.empty", "numpy.floor", "numpy.square", "numpy.shape", "numpy.max", "numpy.min", "numpy.array", "numpy.log10", "datetime.datetime.now" ]
[((2843, 2876), 'numpy.array', 'np.array', (['I_data'], {'dtype': 'np.single'}), '(I_data, dtype=np.single)\n', (2851, 2876), True, 'import numpy as np\n'), ((2893, 2926), 'numpy.array', 'np.array', (['Q_data'], {'dtype': 'np.single'}), '(Q_data, dtype=np.single)\n', (2901, 2926), True, 'import numpy as np\n'), ((3032,...
''' This script is intended to compare results with Yanovich's paper It is ran on the NCSLGR corpus, with FLS, FS and DS ''' from models.data_utils import * from models.model_utils import * from models.train_model import * from models.perf_utils import * import math import numpy as np from matplotlib import pyplot as...
[ "matplotlib.pyplot.switch_backend", "numpy.random.seed", "matplotlib.pyplot.figure", "numpy.arange", "numpy.savez", "matplotlib.pyplot.savefig" ]
[((325, 350), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (343, 350), True, 'from matplotlib import pyplot as plt\n'), ((628, 646), 'numpy.random.seed', 'np.random.seed', (['(17)'], {}), '(17)\n', (642, 646), True, 'import numpy as np\n'), ((6224, 6423), 'numpy.savez', 'n...
from distutils.core import setup, Extension import numpy setup( ext_modules = [ Extension("linear_assignment",["linear_assignment.c"], include_dirs=[numpy.get_include()]), ], )
[ "numpy.get_include" ]
[((166, 185), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (183, 185), False, 'import numpy\n')]
''' A module for representing basic ways of changing triangulations. These moves can also track how laminations and homology classes move through those changes. ''' from abc import ABC, abstractmethod import numpy as np import curver class Move(ABC): ''' A basic move from one triangulation to another. ''' d...
[ "curver.kernel.PartialLinearFunction", "curver.kernel.Edge", "curver.kernel.utilities.half", "numpy.identity", "curver.kernel.Encoding", "curver.kernel.HomologyClass", "numpy.array", "curver.kernel.norm" ]
[((4789, 4854), 'curver.kernel.HomologyClass', 'curver.kernel.HomologyClass', (['self.target_triangulation', 'algebraic'], {}), '(self.target_triangulation, algebraic)\n', (4816, 4854), False, 'import curver\n'), ((5288, 5329), 'numpy.array', 'np.array', (['[[0] * self.zeta]'], {'dtype': 'object'}), '([[0] * self.zeta]...
import numpy as np def get_vectors(all_sentences, word_2_vec): random_vec = np.mean(np.vstack(word_2_vec.values()).astype('float'), axis=0) all_OOV_words = [] all_sentences_vecs = [] for sentence in all_sentences: sentence_vecs = [] for word in sentence: if word not in ...
[ "numpy.vstack", "numpy.zeros", "numpy.ones", "numpy.concatenate" ]
[((833, 875), 'numpy.concatenate', 'np.concatenate', (['all_sentences_vecs'], {'axis': '(0)'}), '(all_sentences_vecs, axis=0)\n', (847, 875), True, 'import numpy as np\n'), ((3234, 3247), 'numpy.zeros', 'np.zeros', (['(300)'], {}), '(300)\n', (3242, 3247), True, 'import numpy as np\n'), ((3350, 3370), 'numpy.vstack', '...
import numpy as np from rllab.misc import special from rllab.misc import tensor_utils from rllab.algos import util from rllab.sampler import parallel_sampler import rllab.misc.logger as logger import rllab.plotter as plotter from rllab.policies.base import Policy from sandbox.rocky.tf.envs.vec_env_executor import VecEn...
[ "rllab.misc.logger.record_tabular", "numpy.sum", "rllab.misc.tensor_utils.concat_tensor_list", "rllab.sampler.stateful_pool.singleton_pool.run_each", "rllab.misc.tensor_utils.pad_tensor_dict", "rllab.sampler.parallel_sampler.truncate_paths", "rllab.sampler.parallel_sampler.terminate_task", "numpy.mean...
[((534, 546), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (544, 546), True, 'import tensorflow as tf\n'), ((615, 648), 'tensorflow.global_variables_initializer', 'tf.global_variables_initializer', ([], {}), '()\n', (646, 648), True, 'import tensorflow as tf\n'), ((6857, 6890), 'rllab.misc.logger.log', 'logger...
import gym from gym import spaces from gym.utils import seeding import numpy as np class PendulumPixelsEnv(gym.Env): metadata = { 'render.modes': ['human', 'rgb_array'], 'video.frames_per_second': 30 } def __init__(self, g=10.0): self.max_speed = 8 self.max_torque = 2. ...
[ "gym.envs.classic_control.rendering.make_circle", "gym.envs.classic_control.rendering.Transform", "gym.envs.classic_control.rendering.make_capsule", "numpy.clip", "numpy.sin", "numpy.array", "gym.spaces.Box", "gym.envs.classic_control.rendering.Viewer", "gym.utils.seeding.np_random" ]
[((400, 433), 'numpy.array', 'np.array', (['[np.pi, self.max_speed]'], {}), '([np.pi, self.max_speed])\n', (408, 433), True, 'import numpy as np\n'), ((462, 551), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(-self.max_torque)', 'high': 'self.max_torque', 'shape': '(1,)', 'dtype': 'np.float32'}), '(low=-self.max_torqu...
import yfinance as yf import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler from typing import Tuple import os import glob import time import json import sys import torch import torch.nn as nn import torch.optim as opt import math from sklearn.metrics im...
[ "matplotlib.pyplot.title", "pandas.read_csv", "sklearn.preprocessing.MinMaxScaler", "numpy.isnan", "matplotlib.pyplot.figure", "os.path.isfile", "os.path.join", "numpy.round", "pandas.DataFrame", "torch.nn.MSELoss", "numpy.empty_like", "numpy.append", "torch.nn.Linear", "torch.nn.LSTM", ...
[((17948, 17962), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (17960, 17962), True, 'import pandas as pd\n'), ((935, 960), 'os.listdir', 'os.listdir', (['"""public/data"""'], {}), "('public/data')\n", (945, 960), False, 'import os\n'), ((1182, 1197), 'yfinance.Ticker', 'yf.Ticker', (['tick'], {}), '(tick)\n',...
"""Split raw channels into seperate files.""" import glob import matplotlib.pyplot as plt import numpy as np import jagular as jag #TODO: don't import externally import nelpy as nel import nelpy.plotting as npl # file_list = ['../sample_data/sample_data_1.rec', # '../sample_data/sample_data_3.rec', # ...
[ "matplotlib.pyplot.plot", "jagular.filtfilt_mmap", "numpy.fromfile", "glob.glob", "nelpy.plotting.plot", "nelpy.AnalogSignalArray", "jagular.io.JagularFileMap", "jagular.utils.extract_channels" ]
[((604, 641), 'glob.glob', 'glob.glob', (['"""sample_data/gap_data.rec"""'], {}), "('sample_data/gap_data.rec')\n", (613, 641), False, 'import glob\n'), ((648, 680), 'jagular.io.JagularFileMap', 'jag.io.JagularFileMap', (['file_list'], {}), '(file_list)\n', (669, 680), True, 'import jagular as jag\n'), ((767, 877), 'ja...
# -*- coding: utf-8 -*- from __future__ import absolute_import import math import logging import numpy as np LOGGER = logging.getLogger(__name__) def gradual_warm_up(scheduler, warm_up_epoch, multiplier): def schedule(e, **kwargs): lr = scheduler(e, **kwargs) lr = lr * ((multiplier - 1.0) * min...
[ "numpy.interp", "math.cos", "logging.getLogger" ]
[((121, 148), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (138, 148), False, 'import logging\n'), ((824, 851), 'numpy.interp', 'np.interp', (['[e]', 'knots', 'vals'], {}), '([e], knots, vals)\n', (833, 851), True, 'import numpy as np\n'), ((1767, 1798), 'math.cos', 'math.cos', (['(math...
import numpy as np import cv2 def overlay_rect_with_opacity(overlaid_image, rect): x, y, w, h = rect sub_img = overlaid_image[y:y+h, x:x+w] white_rect = np.ones(sub_img.shape, dtype=np.uint8) * 255 res = cv2.addWeighted(sub_img, 0.5, white_rect, 0.5, 1.0) # Putting the image back to its position ...
[ "numpy.ones", "cv2.addWeighted" ]
[((222, 273), 'cv2.addWeighted', 'cv2.addWeighted', (['sub_img', '(0.5)', 'white_rect', '(0.5)', '(1.0)'], {}), '(sub_img, 0.5, white_rect, 0.5, 1.0)\n', (237, 273), False, 'import cv2\n'), ((166, 204), 'numpy.ones', 'np.ones', (['sub_img.shape'], {'dtype': 'np.uint8'}), '(sub_img.shape, dtype=np.uint8)\n', (173, 204),...
import math import time import matplotlib.pyplot as plt import numpy as np from PIL import Image import geometry as gm import rtx scene = rtx.Scene((0, 0, 0)) box_width = 6 box_height = 6 # 1 geometry = rtx.PlainGeometry(box_width, box_height) geometry.set_rotation((0, 0, 0)) geometry.set_position((0, 0, -box_widt...
[ "numpy.amin", "rtx.PerspectiveCamera", "numpy.clip", "rtx.Object", "rtx.SolidColorMapping", "matplotlib.pyplot.imshow", "rtx.Renderer", "rtx.CUDAKernelLaunchArguments", "matplotlib.pyplot.pause", "rtx.LambertMaterial", "rtx.RayTracingArguments", "geometry.load", "numpy.uint8", "rtx.Standar...
[((141, 161), 'rtx.Scene', 'rtx.Scene', (['(0, 0, 0)'], {}), '((0, 0, 0))\n', (150, 161), False, 'import rtx\n'), ((208, 248), 'rtx.PlainGeometry', 'rtx.PlainGeometry', (['box_width', 'box_height'], {}), '(box_width, box_height)\n', (225, 248), False, 'import rtx\n'), ((339, 364), 'rtx.LambertMaterial', 'rtx.LambertMat...
import string from typing import Callable, List, Tuple, Union import warnings import keras from keras import backend as kbackend from keras.layers import ( BatchNormalization, Concatenate, Conv1D, Dense, Embedding, Input, TimeDistributed) from keras.models import Model import numpy try: import tensorflow as tf...
[ "numpy.eye", "keras.backend.epsilon", "tensorflow.device", "keras.layers.Conv1D", "keras.models.Model", "keras.layers.Concatenate", "keras.layers.Dense", "keras.layers.Input", "warnings.warn", "keras.backend.clip", "keras.layers.BatchNormalization" ]
[((1902, 1918), 'keras.layers.Input', 'Input', (['(maxlen,)'], {}), '((maxlen,))\n', (1907, 1918), False, 'from keras.layers import BatchNormalization, Concatenate, Conv1D, Dense, Embedding, Input, TimeDistributed\n'), ((4747, 4785), 'keras.models.Model', 'Model', ([], {'inputs': 'char_seq', 'outputs': 'output'}), '(in...
# text2d_demo.py # # An example of usage of the Text2D class, by emulating a terminal which # displays scrolling text data on the screen, OpenGL accelerated via vispy # # Author: <NAME> # http://www.github.com/rmaia3d import numpy as np from vispy import gloo from vispy import app from text2d import Text2D class C...
[ "vispy.gloo.set_viewport", "vispy.app.Timer", "numpy.random.randn", "vispy.gloo.set_state", "vispy.app.run", "vispy.gloo.clear", "text2d.Text2D", "vispy.app.Canvas.__init__" ]
[((3366, 3375), 'vispy.app.run', 'app.run', ([], {}), '()\n', (3373, 3375), False, 'from vispy import app\n'), ((372, 434), 'vispy.app.Canvas.__init__', 'app.Canvas.__init__', (['self'], {'size': '(500, 500)', 'keys': '"""interactive"""'}), "(self, size=(500, 500), keys='interactive')\n", (391, 434), False, 'from vispy...
import numpy as np import os, random, inspect import source.utility as util from tensorflow.contrib.learn.python.learn.datasets import base PACK_PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))+"/.." class DataSet(object): def __init__(self, who_am_i, class_len, data_len, height...
[ "numpy.load", "tensorflow.contrib.learn.python.learn.datasets.base.Datasets", "source.utility.get_filelist", "numpy.asarray", "numpy.asfarray", "numpy.zeros", "source.utility.get_dirlist", "numpy.append", "inspect.currentframe", "numpy.random.rand", "numpy.eye" ]
[((3179, 3234), 'tensorflow.contrib.learn.python.learn.datasets.base.Datasets', 'base.Datasets', ([], {'train': 'train', 'test': 'test', 'validation': 'valid'}), '(train=train, test=test, validation=valid)\n', (3192, 3234), False, 'from tensorflow.contrib.learn.python.learn.datasets import base\n'), ((1095, 1150), 'sou...
import os import time import numpy as np import sys import torch import torch.optim as optim import pandas as pd import matplotlib.pyplot as plt sys.path.append(os.path.join("..")) from torchid.ssfitter import NeuralStateSpaceSimulator from torchid.ssmodels import CartPoleStateSpaceModel # In[Load data] if __name__ ...
[ "torch.mean", "os.makedirs", "torchid.ssmodels.CartPoleStateSpaceModel", "torchid.ssfitter.NeuralStateSpaceSimulator", "os.path.exists", "matplotlib.pyplot.subplots", "time.time", "torch.abs", "torch.optim.Adam", "numpy.array", "numpy.arange", "torch.no_grad", "os.path.join", "torch.tensor...
[((162, 180), 'os.path.join', 'os.path.join', (['""".."""'], {}), "('..')\n", (174, 180), False, 'import os\n'), ((540, 579), 'numpy.array', 'np.array', (['df_X[COL_T]'], {'dtype': 'np.float32'}), '(df_X[COL_T], dtype=np.float32)\n', (548, 579), True, 'import numpy as np\n'), ((588, 627), 'numpy.array', 'np.array', (['...
import os import numpy as np def write_detsk(h5file, ikpt, fwf, ispin, nsh0, kc): """Calculate determinant S(k) at given twist Args: h5file (tables.file.File): hdf5 file handle ikpt (int): twist index fwf (str): wf h5 file e.g. pwscf.pwscf.h5 ispin (int): spin index, use 0 for unpolarized nsh0...
[ "qharv.seed.wf_h5.read", "qharv.seed.wf_h5.get_cmat", "solith.li_nofk.forlib.det.calc_detsk", "h5py.File", "qharv.inspect.axes_pos.raxes", "qharv.seed.wf_h5.normalize_cmat", "chiesa_correction.cubic_pos", "numpy.linalg.norm", "numpy.array", "qharv.reel.config_h5.save_dict", "numpy.dot", "qharv...
[((744, 759), 'qharv.seed.wf_h5.read', 'wf_h5.read', (['fwf'], {}), '(fwf)\n', (754, 759), False, 'from qharv.seed import wf_h5\n'), ((770, 795), 'qharv.seed.wf_h5.get', 'wf_h5.get', (['fp', '"""gvectors"""'], {}), "(fp, 'gvectors')\n", (779, 795), False, 'from qharv.seed import wf_h5\n'), ((805, 836), 'qharv.seed.wf_h...
# authors: <NAME>, <NAME> # date: 2020-06-15 ############################################################################### # IMPORT PACKAGES # ############################################################################### # Basics import pandas as pd impo...
[ "pandas.read_csv", "dash_core_components.Input", "numpy.mean", "dash_html_components.H1", "pandas.DataFrame", "dash_html_components.H3", "shapely.geometry.Point", "dash.Dash", "dash_html_components.Div", "geopandas.GeoDataFrame", "plotly.express.choropleth", "numpy.log10", "re.sub", "geopa...
[((1053, 1143), 'dash.Dash', 'dash.Dash', (['__name__'], {'meta_tags': "[{'name': 'viewport', 'content': 'width=device-width'}]"}), "(__name__, meta_tags=[{'name': 'viewport', 'content':\n 'width=device-width'}])\n", (1062, 1143), False, 'import dash\n'), ((1417, 1461), 'pandas.read_csv', 'pd.read_csv', (['"""data/p...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import argparse import numpy as np from common import read_wave from config import load_config import stft # Logging from logging import getLogger, INFO import log_initializer log_initializer.set_root_level(INFO) log_initializer.set_fmt() logger = ge...
[ "config.load_config", "argparse.ArgumentParser", "numpy.fft.fft", "log_initializer.set_fmt", "stft.to_feature", "numpy.all", "numpy.savez_compressed", "stft.stft", "log_initializer.set_root_level", "logging.getLogger" ]
[((246, 282), 'log_initializer.set_root_level', 'log_initializer.set_root_level', (['INFO'], {}), '(INFO)\n', (276, 282), False, 'import log_initializer\n'), ((283, 308), 'log_initializer.set_fmt', 'log_initializer.set_fmt', ([], {}), '()\n', (306, 308), False, 'import log_initializer\n'), ((318, 337), 'logging.getLogg...
import os import sys import argparse import shutil import time import numpy as np import tensorflow as tf import models import optimizers import utils import additionproblem INPUT_SIZE = 2 TARGET_SIZE = 1 BATCH_SIZE = 100 VAL_BATCH_SIZE = 1000 NUM_OPT_STEPS = 100000 NUM_STEPS_PER_TRAIN_SUMMARY = 10 NUM_STEPS_PER_VA...
[ "argparse.ArgumentParser", "tensorflow.ConfigProto", "numpy.mean", "numpy.arange", "shutil.rmtree", "os.path.join", "numpy.pad", "os.path.exists", "tensorflow.placeholder", "tensorflow.summary.FileWriter", "utils.full_bptt_batch_generator", "tensorflow.summary.merge_all", "tensorflow.summary...
[((557, 643), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description', 'formatter_class': 'formatter_class'}), '(description=description, formatter_class=\n formatter_class)\n', (580, 643), False, 'import argparse\n'), ((2394, 2427), 'os.path.expanduser', 'os.path.expanduser', (['arg...
#!/usr/bin/env python3 import argparse from pathlib import Path # revised from arya's script segment.py parser = argparse.ArgumentParser( description= """ Segment the image into objects and output both 1) contours which we are highly confident have plants and 2) contours which we have less ...
[ "cv2.GaussianBlur", "numpy.load", "numpy.uint8", "numpy.save", "argparse.ArgumentParser", "cv2.cvtColor", "cv2.morphologyEx", "numpy.empty", "numpy.ones", "cv2.adaptiveThreshold", "cv2.imread", "numpy.unique", "cv2.Laplacian" ]
[((115, 524), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""\n Segment the image into objects and output both 1) contours which we are\n highly confident have plants and 2) contours which we have less\n confidence contain plants (where the contours from #1 are conta...