code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
# coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import sys
import re
import os
from models.beta_irt import Beta_IRT
import visualization.plots as vs
import pandas as pd
import argparse
from hsv... | [
"os.mkdir",
"numpy.random.seed",
"argparse.ArgumentParser",
"numpy.sum",
"pandas.read_csv",
"tensorflow.ConfigProto",
"visualization.plots.plot_noisy_points",
"os.path.join",
"pandas.DataFrame",
"os.path.exists",
"tensorflow.set_random_seed",
"tensorflow.ones",
"re.split",
"hsvi.tensorflow... | [((474, 499), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (497, 499), False, 'import argparse\n'), ((1639, 1668), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['args.seed'], {}), '(args.seed)\n', (1657, 1668), True, 'import tensorflow as tf\n'), ((1669, 1694), 'numpy.random.seed', 'n... |
#!python
##################################################
# ACCESS QC Module
# Innovation Laboratory
# Center For Molecular Oncology
# Memorial Sloan Kettering Cancer Research Center
# maintainer: <NAME> (<EMAIL>)
#
#
# This module functions as an aggregation step to combine QC metrics
# across Waltz runs on differe... | [
"pandas.DataFrame",
"argparse.ArgumentParser",
"pandas.read_csv",
"numpy.mod",
"logging.info",
"numpy.min",
"numpy.max",
"numpy.arange",
"pandas.cut",
"python_tools.util.to_csv",
"pandas.melt",
"pandas.concat"
] | [((821, 860), 'pandas.read_csv', 'pd.read_csv', (['read_counts_path'], {'sep': '"""\t"""'}), "(read_counts_path, sep='\\t')\n", (832, 860), True, 'import pandas as pd\n'), ((967, 1036), 'pandas.melt', 'pd.melt', (['read_counts'], {'id_vars': '[SAMPLE_ID_COLUMN]', 'var_name': '"""Category"""'}), "(read_counts, id_vars=[... |
### Figure 3 E and F - Obenhaus et al.
import sys, os
import os.path
import numpy as np
import datajoint as dj
import pickle
import cmasher as cmr
from general import get_star, print_mannwhitneyu, print_wilcoxon
# Make plots pretty
from matplotlib import pyplot as plt
import seaborn as sns
sns.set(style='white')
... | [
"pickle.dump",
"numpy.nanstd",
"os.path.dirname",
"seaborn.despine",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.nanmean",
"matplotlib.pyplot.Circle",
"numpy.array",
"pickle.load",
"numpy.random.rand",
"seaborn.set",
"general.print_wilcoxon",
"matplotlib.pyplot.savefig",
"general.pr... | [((296, 318), 'seaborn.set', 'sns.set', ([], {'style': '"""white"""'}), "(style='white')\n", (303, 318), True, 'import seaborn as sns\n'), ((1314, 1352), 'seaborn.set', 'sns.set', ([], {'style': '"""white"""', 'font_scale': '(1.5)'}), "(style='white', font_scale=1.5)\n", (1321, 1352), True, 'import seaborn as sns\n'), ... |
#!/usr/bin/env python
import pylab as plt
import scipy
import scipy.interpolate
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.colors as mcol
import sys
import argparse
import scipy.ndimage
import scipy.interpolate
import pyfits
import os
import myutils
import gzip
class xypix_converter:... | [
"numpy.sum",
"argparse.ArgumentParser",
"numpy.ones",
"numpy.shape",
"pylab.axes",
"numpy.mean",
"pylab.figure",
"numpy.ma.masked_array",
"numpy.arange",
"matplotlib.colors.ListedColormap",
"scipy.ndimage.median_filter",
"numpy.meshgrid",
"numpy.zeros_like",
"numpy.std",
"numpy.ndim",
... | [((1152, 1241), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Detect peaks in mGC3/nGC3/GC3 pole count maps"""'}), "(description=\n 'Detect peaks in mGC3/nGC3/GC3 pole count maps')\n", (1175, 1241), False, 'import argparse\n'), ((7006, 7049), 'scipy.genfromtxt', 'scipy.genfromtxt', (... |
import os
from itertools import cycle
from hashlib import md5
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import requests
from django.conf import settings
from cbmonitor.plotter import constants
from cbmonitor.plotter.reports import Report
matplotli... | [
"matplotlib.pyplot.xlim",
"hashlib.md5",
"matplotlib.pyplot.close",
"matplotlib.rcParams.update",
"requests.Session",
"cbmonitor.plotter.constants.LABELS.get",
"os.path.exists",
"numpy.percentile",
"matplotlib.pyplot.axvspan",
"matplotlib.pyplot.figure",
"matplotlib.use",
"pandas.Series",
"i... | [((81, 102), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (95, 102), False, 'import matplotlib\n'), ((311, 879), 'matplotlib.rcParams.update', 'matplotlib.rcParams.update', (["{'axes.formatter.limits': (-6, 6), 'axes.grid': True, 'axes.linewidth': 0.4,\n 'axes.xmargin': 0, 'font.size': 5, 'g... |
import numpy as np
from sklearn.metrics.pairwise import euclidean_distances
from sklearn.base import BaseEstimator, ClusterMixin
class KMeans(BaseEstimator, ClusterMixin):
def __init__(self, n_clusters = 8, max_iter=300, tol=0.001):
self.clusters_centers_ = None
self.labels_ = None
self.ine... | [
"numpy.array",
"sklearn.metrics.pairwise.euclidean_distances",
"numpy.argmin"
] | [((843, 892), 'sklearn.metrics.pairwise.euclidean_distances', 'euclidean_distances', (['data', 'self.clusters_centers_'], {}), '(data, self.clusters_centers_)\n', (862, 892), False, 'from sklearn.metrics.pairwise import euclidean_distances\n'), ((2932, 2954), 'numpy.array', 'np.array', (['self.labels_'], {}), '(self.la... |
# The MIT License (MIT)
# Copyright (c) 2018 Massachusetts Institute of Technology
#
# Authors: <NAME>
# This software is part of the NSF DIBBS Project "An Infrastructure for
# Computer Aided Discovery in Geoscience" (PI: V. Pankratius) and
# NASA AIST Project "Computer-Aided Discovery of Earth Surface
# Deformation Ph... | [
"matplotlib.pyplot.show",
"pyinsar.processing.utilities.generic.generateMatplotlibRectangle",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.unique"
] | [((2624, 2641), 'numpy.unique', 'np.unique', (['labels'], {}), '(labels)\n', (2633, 2641), True, 'import numpy as np\n'), ((2784, 2796), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (2794, 2796), True, 'import matplotlib.pyplot as plt\n'), ((2814, 2824), 'matplotlib.pyplot.axes', 'plt.axes', ([], {}), '(... |
from gridworld_env import *
from random_agent import *
import numpy as np
from vpg_agent import *
def estStateVal(lr = 0.05, max_iter = 20000):
env = env_fn()
s_table = np.random.randn(5, 5)
n_steps = 20
reward = 0
agent = RandomAgent(env.action_space)
# agent = VpgAgent()
t = 0
res = 1... | [
"numpy.abs",
"numpy.round",
"numpy.random.randn"
] | [((179, 200), 'numpy.random.randn', 'np.random.randn', (['(5)', '(5)'], {}), '(5, 5)\n', (194, 200), True, 'import numpy as np\n'), ((1051, 1071), 'numpy.round', 'np.round', (['s_table', '(1)'], {}), '(s_table, 1)\n', (1059, 1071), True, 'import numpy as np\n'), ((854, 884), 'numpy.abs', 'np.abs', (['(s_table - s_table... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from tensorflow.contrib.layers.python.layers import initializers
from tensorflow.contrib import rnn
import logging
import re
import os
import io
import functoo... | [
"tensorflow.gfile.Exists",
"tensorflow.reduce_sum",
"pickle.dump",
"tensorflow.train.Int64List",
"tensorflow.clip_by_value",
"tensorflow.feature_column.make_parse_example_spec",
"tensorflow.reshape",
"numpy.ones",
"tensorflow.logging.set_verbosity",
"tensorflow.ConfigProto",
"tensorflow.train.wr... | [((1089, 1116), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1106, 1116), False, 'import logging\n'), ((7308, 7687), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'device_count': "{'CPU': component_config['config_proto']['device_count']}", 'inter_op_parallelism_threads': "component... |
"""
Sensitivity Plots
"""
from create_geometry import BladeGeometry
from create_geometry_varwake import BladeGeometry2
from lifting_line_solver import LiftingLineSolver
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from read_BEMdata_into_Python import read_matlab_data
import numpy as np
plot_... | [
"matplotlib.pyplot.title",
"read_BEMdata_into_Python.read_matlab_data",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.resize",
"matplotlib.pyplot.legend",
"lifting_line_solver.LiftingLineSolver",
"create_geometry_varwake.BladeGeometry2",
"numpy.split",
"matplotlib.pyplot.figure",
"n... | [((564, 582), 'read_BEMdata_into_Python.read_matlab_data', 'read_matlab_data', ([], {}), '()\n', (580, 582), False, 'from read_BEMdata_into_Python import read_matlab_data\n'), ((18633, 18643), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (18641, 18643), True, 'import matplotlib.pyplot as plt\n'), ((1016, 105... |
import os
import sys
import argparse
import subprocess
import numpy as np
from pycondor import Job, Dagman
from deepclean_prod import io
# Parse command line argument
def parse_cmd():
parser = argparse.ArgumentParser(
prog=os.path.basename(__file__), usage='%(prog)s [options]')
parser.add_argument(... | [
"deepclean_prod.io.parse_config",
"deepclean_prod.io.dict2args",
"os.makedirs",
"os.path.basename",
"os.path.dirname",
"numpy.genfromtxt",
"numpy.arange",
"os.path.join",
"deepclean_prod.io.get_keys"
] | [((551, 591), 'deepclean_prod.io.parse_config', 'io.parse_config', (['params.config', '"""config"""'], {}), "(params.config, 'config')\n", (566, 591), False, 'from deepclean_prod import io\n'), ((937, 972), 'os.makedirs', 'os.makedirs', (['out_dir'], {'exist_ok': '(True)'}), '(out_dir, exist_ok=True)\n', (948, 972), Fa... |
"""
Started out as a copy-paste from the E-LPIPS Tensorflow repo.
"""
import itertools
import random
from typing import Any, Optional
import imageio
import numpy as np
import torch
import torch.nn
import torch.random
from models import PerceptualLoss
class Config:
def __init__(self):
self.enable_offset ... | [
"torch.mean",
"torch.randint",
"matplotlib.pyplot.show",
"torch.stack",
"random.uniform",
"imageio.imread",
"torch.cat",
"numpy.cumsum",
"torch.randperm",
"torch.arange",
"torch.rand",
"matplotlib.pyplot.subplots",
"torch.tensor",
"torch.nn.functional.pad"
] | [((1875, 1930), 'torch.randint', 'torch.randint', (['(0)', 'config.offset_max', '(n, 2)'], {'device': 'dev'}), '(0, config.offset_max, (n, 2), device=dev)\n', (1888, 1930), False, 'import torch\n'), ((1979, 2016), 'numpy.cumsum', 'np.cumsum', (['config.scale_probabilities'], {}), '(config.scale_probabilities)\n', (1988... |
"""
Test various functions regarding chapter 18: Microstructural Features.
"""
import os
import unittest
import numpy as np
import pandas as pd
from mlfinlab.data_structures import get_volume_bars
from mlfinlab.microstructural_features import (get_vpin, get_bar_based_amihud_lambda, get_bar_based_kyle_lambda,
... | [
"mlfinlab.microstructural_features.sigma_mapping",
"os.remove",
"pandas.read_csv",
"mlfinlab.microstructural_features.get_corwin_schultz_estimator",
"mlfinlab.microstructural_features.MicrostructuralFeaturesGenerator",
"mlfinlab.microstructural_features.get_vpin",
"numpy.arange",
"pandas.DataFrame",
... | [((1216, 1241), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1231, 1241), False, 'import os\n'), ((1401, 1463), 'pandas.read_csv', 'pd.read_csv', (['self.path'], {'index_col': '"""date_time"""', 'parse_dates': '[0]'}), "(self.path, index_col='date_time', parse_dates=[0])\n", (1412, 1463), ... |
import cos_module_np
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 2 * np.pi, 0.1)
y = cos_module_np.cos_func_np(x)
plt.plot(x, y)
plt.show()
| [
"cos_module_np.cos_func_np",
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
] | [((77, 105), 'numpy.arange', 'np.arange', (['(0)', '(2 * np.pi)', '(0.1)'], {}), '(0, 2 * np.pi, 0.1)\n', (86, 105), True, 'import numpy as np\n'), ((110, 138), 'cos_module_np.cos_func_np', 'cos_module_np.cos_func_np', (['x'], {}), '(x)\n', (135, 138), False, 'import cos_module_np\n'), ((139, 153), 'matplotlib.pyplot.p... |
import numpy as np
m0 = 9.10938356e-31 #kg
e0 = 1.60217662e-19 #As
hbar = 6.626070040e-34/(2*np.pi) #Js
def Schroedinger(V, dx=1.0, meff=1, normalize=False):
dx = dx * 1.0e-9
N=len(V)
#check if meff is scalar or vector
if not hasattr(meff, "__len__"):
meff = np.ones(N)*meff
#effective electron mass
_m=m0*... | [
"matplotlib.pyplot.show",
"numpy.ones_like",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"numpy.abs",
"matplotlib.pyplot.ylabel",
"numpy.ones",
"numpy.linalg.eigh",
"numpy.min",
"numpy.mean",
"numpy.linspace",
"numpy.diag",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
... | [((332, 341), 'numpy.min', 'np.min', (['V'], {}), '(V)\n', (338, 341), True, 'import numpy as np\n'), ((525, 535), 'numpy.diag', 'np.diag', (['V'], {}), '(V)\n', (532, 535), True, 'import numpy as np\n'), ((607, 624), 'numpy.linalg.eigh', 'np.linalg.eigh', (['H'], {}), '(H)\n', (621, 624), True, 'import numpy as np\n')... |
"""
Copyright (c) 2019-2022, <NAME>/Carnegie Mellon University
All rights reserved.
********************************************************************
Project: training_CVAE_GAN.py
MODULE: CVAE_GAN
Author: <NAME>, Carnegie Mellon University
Brief:
-------------
Training EBSD_CVAE_GAN models.
Both CVAE and discrim... | [
"utils.data_generator.DataGenerator",
"numpy.random.seed",
"numpy.nan_to_num",
"csv.writer",
"tensorflow.reduce_sum",
"tensorflow.math.sigmoid",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.concat",
"time.time",
"tensorflow.case",
"tensorflow.cast",
"utils.eu2qu.eu2qu",
"m... | [((566, 587), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (580, 587), False, 'import matplotlib\n'), ((1290, 1341), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (1334, 1341), True, 'import tensorflow a... |
"""
Author: <NAME>
A model written to graph the Hodgkin - Huxley Equations to understand the gating kinetics for ionic channels (primarily potassium and sodium) within the cardiac cells.
This analysis is done on a space clamped axon.
"""
import numpy as np
class HodgkinHuxley():
C_m = 1
"""membrane capacita... | [
"numpy.power",
"numpy.arange",
"numpy.exp"
] | [((749, 775), 'numpy.arange', 'np.arange', (['(0.0)', '(30.0)', '(0.01)'], {}), '(0.0, 30.0, 0.01)\n', (758, 775), True, 'import numpy as np\n'), ((1078, 1097), 'numpy.exp', 'np.exp', (['(-(V / 18.0))'], {}), '(-(V / 18.0))\n', (1084, 1097), True, 'import numpy as np\n'), ((1214, 1233), 'numpy.exp', 'np.exp', (['(-(V /... |
import anndata
import argparse
import random
import scipy
import numpy as np
def main():
parser = argparse.ArgumentParser("A command to generate test h5ad files")
parser.add_argument("output", help="Name of the output file")
parser.add_argument("nobs", type=int, help="Number of observations (rows)")
p... | [
"numpy.random.seed",
"scipy.sparse.random",
"argparse.ArgumentParser",
"random.seed",
"numpy.random.rand",
"anndata.AnnData"
] | [((104, 168), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""A command to generate test h5ad files"""'], {}), "('A command to generate test h5ad files')\n", (127, 168), False, 'import argparse\n'), ((937, 954), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (948, 954), False, 'import random\n'),... |
#!/usr/bin/env python
# coding: utf-8
# <img style="float: left;" src="earth-lab-logo-rgb.png" width="150" height="150" />
#
# # Earth Analytics Education - EA Python Course Spring 2021
# ## Important - Assignment Guidelines
#
# 1. Before you submit your assignment to GitHub, make sure to run the entire notebook ... | [
"pandas.DataFrame",
"pyproj.set_use_global_context",
"earthpy.data.get_data",
"rioxarray.open_rasterio",
"os.path.join",
"os.getcwd",
"numpy.allclose",
"matplotcheck.notebook.convert_axes",
"pandas.plotting.register_matplotlib_converters",
"matplotlib.pyplot.subplots",
"xarray.concat",
"matplo... | [((6884, 6916), 'pandas.plotting.register_matplotlib_converters', 'register_matplotlib_converters', ([], {}), '()\n', (6914, 6916), False, 'from pandas.plotting import register_matplotlib_converters\n'), ((6960, 6995), 'earthpy.data.get_data', 'et.data.get_data', (['"""ndvi-automation"""'], {}), "('ndvi-automation')\n"... |
import os
import time
import json
import cv2
import openslide
import skimage.io
import numpy as np
import pandas as pd
from glob import glob
from tqdm import tqdm
import tensorflow as tf
import matplotlib.pyplot as plt
from IPython.display import Image, display
from sklearn.model_selection import StratifiedKFold
AUTO =... | [
"tensorflow.random.set_seed",
"os.mkdir",
"numpy.random.seed",
"numpy.sum",
"tensorflow.train.Int64List",
"tensorflow.train.FloatList",
"os.path.join",
"numpy.pad",
"cv2.cvtColor",
"os.path.exists",
"cv2.boundingRect",
"pandas.concat",
"cv2.resize",
"tqdm.tqdm",
"tensorflow.image.encode_... | [((408, 432), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(2020)'], {}), '(2020)\n', (426, 432), True, 'import tensorflow as tf\n'), ((433, 453), 'numpy.random.seed', 'np.random.seed', (['(2020)'], {}), '(2020)\n', (447, 453), True, 'import numpy as np\n'), ((4412, 4450), 'os.path.join', 'os.path.join', (['M... |
# language-learning/src/grammar_learner/utl.py # 190408
import os, sys, time, datetime, itertools, operator, numpy as np
from collections import Counter, OrderedDict
from .read_files import check_mst_files
def UTC():
return str(datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S UTC'))... | [
"datetime.datetime.utcnow",
"numpy.asarray",
"itertools.chain.from_iterable",
"time.time"
] | [((764, 775), 'time.time', 'time.time', ([], {}), '()\n', (773, 775), False, 'import os, sys, time, datetime, itertools, operator, numpy as np\n'), ((3818, 3859), 'numpy.asarray', 'np.asarray', (["([''] + [x[0] for x in tuples])"], {}), "([''] + [x[0] for x in tuples])\n", (3828, 3859), True, 'import os, sys, time, dat... |
import pandas as p
import math
import numpy as np
import itertools as it
from haversine import *
from haversine_script import *
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsRegressor
from sklearn.ensemble import ExtraTreesRegressor
from sklearn.ensemble import RandomFore... | [
"math.exp",
"sklearn.neighbors.KNeighborsRegressor",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"numpy.exp",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
] | [((3196, 3233), 'matplotlib.pyplot.plot', 'plt.plot', (['a_list', 'mean_val_error_list'], {}), '(a_list, mean_val_error_list)\n', (3204, 3233), True, 'import matplotlib.pyplot as plt\n'), ((3233, 3299), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Parameter value α of exponential data representation"""'], {}), "('Pa... |
import numpy as np
import os
import textwrap
from unittest import TestCase, main
from chaosmagpy import coordinate_utils as c
from chaosmagpy import data_utils as d
from math import pi
from timeit import default_timer as timer
try:
from tests.helpers import load_matfile
except ImportError:
from helpers import ... | [
"chaosmagpy.coordinate_utils.sun_position",
"numpy.load",
"chaosmagpy.coordinate_utils._dipole_to_unit",
"numpy.random.random_sample",
"chaosmagpy.coordinate_utils.q_response_1D",
"numpy.ravel",
"os.path.isfile",
"numpy.sin",
"chaosmagpy.coordinate_utils.igrf_dipole",
"numpy.arange",
"chaosmagpy... | [((399, 440), 'os.path.join', 'os.path.join', (['ROOT', '"""data/CHAOS_test.mat"""'], {}), "(ROOT, 'data/CHAOS_test.mat')\n", (411, 440), False, 'import os\n'), ((357, 382), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (372, 382), False, 'import os\n'), ((491, 519), 'os.path.isfile', 'os.pa... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from utils.utils import ReplayBuffer, make_one_mini_batch, convert_to_tensor
class Agent(nn.Module):
def __init__(self,algorithm, writer, device, state_dim, action_dim, args, demonstrations_location_... | [
"numpy.load",
"utils.utils.convert_to_tensor",
"utils.utils.ReplayBuffer",
"numpy.clip",
"torch.distributions.Normal",
"utils.utils.make_one_mini_batch"
] | [((514, 630), 'utils.utils.ReplayBuffer', 'ReplayBuffer', ([], {'action_prob_exist': '(True)', 'max_size': 'self.args.traj_length', 'state_dim': 'state_dim', 'num_action': 'action_dim'}), '(action_prob_exist=True, max_size=self.args.traj_length,\n state_dim=state_dim, num_action=action_dim)\n', (526, 630), False, 'f... |
# -*- coding: utf-8 -*-
"""
Simple example. Has random generating Node, a filter node and a plotting node.
"""
from __future__ import print_function
from qtdataflow.model import Node, Schema
from qtdataflow.view import PixmapNodeView
import numpy as np
import matplotlib
matplotlib.use('Qt4Agg')
import matplotlib.pylab ... | [
"numpy.abs",
"qtdataflow.gui.ChartWindow",
"qtdataflow.view.PixmapNodeView",
"numpy.random.random",
"matplotlib.use",
"matplotlib.pylab.figure"
] | [((271, 295), 'matplotlib.use', 'matplotlib.use', (['"""Qt4Agg"""'], {}), "('Qt4Agg')\n", (285, 295), False, 'import matplotlib\n'), ((2536, 2549), 'qtdataflow.gui.ChartWindow', 'ChartWindow', ([], {}), '()\n', (2547, 2549), False, 'from qtdataflow.gui import ChartWindow\n'), ((753, 773), 'qtdataflow.view.PixmapNodeVie... |
import numpy as np
from vedge_detector import vedge_detector
# load model
model = vedge_detector()
# test random data
rgb_planet = np.random.randint(255, size=(900, 800, 4), dtype=np.uint8)
pred = model.predict(rgb_planet, 'Planet')
| [
"vedge_detector.vedge_detector",
"numpy.random.randint"
] | [((83, 99), 'vedge_detector.vedge_detector', 'vedge_detector', ([], {}), '()\n', (97, 99), False, 'from vedge_detector import vedge_detector\n'), ((133, 191), 'numpy.random.randint', 'np.random.randint', (['(255)'], {'size': '(900, 800, 4)', 'dtype': 'np.uint8'}), '(255, size=(900, 800, 4), dtype=np.uint8)\n', (150, 19... |
import os
import shutil
import time
import random
from itertools import chain
from typing import List, Tuple, Dict
import numpy as np
import torch
import torch.nn as nn
from torch.optim import Adam, SGD
from torch.nn.utils.clip_grad import clip_grad_norm_
from firelab import BaseTrainer
from torchvision.datasets impor... | [
"matplotlib.pyplot.title",
"random.sample",
"src.models.MaskModel",
"torchvision.datasets.CIFAR10",
"matplotlib.pyplot.figure",
"torchvision.transforms.Pad",
"matplotlib.pyplot.contourf",
"numpy.arange",
"skimage.transform.resize",
"shutil.rmtree",
"torchvision.transforms.Normalize",
"os.path.... | [((17432, 17468), 'numpy.zeros', 'np.zeros', (['(square_size, square_size)'], {}), '((square_size, square_size))\n', (17440, 17468), True, 'import numpy as np\n'), ((18283, 18296), 'numpy.copy', 'np.copy', (['mask'], {}), '(mask)\n', (18290, 18296), True, 'import numpy as np\n'), ((19126, 19139), 'numpy.copy', 'np.copy... |
import unittest
import numpy as np
import matplotlib.pyplot as pl
import math
import os
# Using parts of Python for Data Analysis - <NAME>
arr1 = np.array([[1, 2], [3, 4], [5, 6]])
arr2 = np.array([[1, 2], [3, 2]])
arr3 = np.zeros((1, 2, 3))
arr4 = np.eye(10) # same as identity
arr5 = np.arange(4)
arr6 = np.random.ra... | [
"matplotlib.pyplot.title",
"numpy.arange",
"numpy.meshgrid",
"numpy.random.randn",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.close",
"matplotlib.pyplot.colorbar",
"numpy.add",
"numpy.ceil",
"math.sqrt",
"numpy.testing.assert_array_equal",
"numpy.isinf",
"numpy.dot",
"os.makedirs",
"... | [((148, 182), 'numpy.array', 'np.array', (['[[1, 2], [3, 4], [5, 6]]'], {}), '([[1, 2], [3, 4], [5, 6]])\n', (156, 182), True, 'import numpy as np\n'), ((190, 216), 'numpy.array', 'np.array', (['[[1, 2], [3, 2]]'], {}), '([[1, 2], [3, 2]])\n', (198, 216), True, 'import numpy as np\n'), ((224, 243), 'numpy.zeros', 'np.z... |
#--- Legacy python 2.7
from __future__ import division
from __future__ import print_function
# --- General
import matplotlib.pyplot as plt
import unittest
import numpy as np
# --- Local
from wiz.Solver import *
def main(test=False):
try:
import weio
except:
print('Skipping test')
retur... | [
"matplotlib.pyplot.title",
"numpy.multiply",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"weio.read",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((538, 569), 'numpy.linspace', 'np.linspace', (['(0.005)', '(0.995)', 'nCyl'], {}), '(0.005, 0.995, nCyl)\n', (549, 569), True, 'import numpy as np\n'), ((1600, 1612), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1610, 1612), True, 'import matplotlib.pyplot as plt\n'), ((1617, 1655), 'matplotlib.pyplot... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data = pd.read_csv("netflix_revenue_2020.csv")
a = data['area']
y = data['years']
r = data['revenue']
#revenue in 2018
i = 0
total_2018 = 0
while i < 16:
total_2018 += r[i]
i += 1
total_2018
#revenue in 2019
i = 16
total_2019 = 0
while ... | [
"pandas.read_csv",
"matplotlib.pyplot.bar",
"numpy.array",
"matplotlib.pyplot.show"
] | [((79, 118), 'pandas.read_csv', 'pd.read_csv', (['"""netflix_revenue_2020.csv"""'], {}), "('netflix_revenue_2020.csv')\n", (90, 118), True, 'import pandas as pd\n'), ((687, 725), 'numpy.array', 'np.array', (['[percent_2019, percent_2020]'], {}), '([percent_2019, percent_2020])\n', (695, 725), True, 'import numpy as np\... |
import unittest
import numpy as np
from photonai_graph.GraphUtilities import individual_fishertransform
class IndividualFishertransformTest(unittest.TestCase):
def setUp(self):
self.m3d = np.random.rand(10, 20, 20)
self.m4d = np.ones((10, 20, 20, 2))
self.m4dnan = np.empty((10, 20, 20, 2)... | [
"numpy.empty",
"photonai_graph.GraphUtilities.individual_fishertransform",
"numpy.ones",
"numpy.shape",
"numpy.random.rand"
] | [((203, 229), 'numpy.random.rand', 'np.random.rand', (['(10)', '(20)', '(20)'], {}), '(10, 20, 20)\n', (217, 229), True, 'import numpy as np\n'), ((249, 273), 'numpy.ones', 'np.ones', (['(10, 20, 20, 2)'], {}), '((10, 20, 20, 2))\n', (256, 273), True, 'import numpy as np\n'), ((519, 555), 'photonai_graph.GraphUtilities... |
import os
import math
import shutil
from evoplotter import utils
from evoplotter.dims import *
from evoplotter import printer
import numpy as np
CHECK_CORRECTNESS_OF_FILES = 1
STATUS_FILE_NAME = "results/status.txt"
OPT_SOLUTIONS_FILE_NAME = "opt_solutions.txt"
class TableGenerator:
"""Generates table from dat... | [
"os.remove",
"numpy.sum",
"math.sqrt",
"evoplotter.printer.latex_table",
"numpy.mean",
"evoplotter.utils.load_properties_dirs",
"evoplotter.printer.table_color_map",
"evoplotter.utils.ensure_dir"
] | [((4309, 4386), 'evoplotter.utils.load_properties_dirs', 'utils.load_properties_dirs', (['folders'], {'exts': "['.cdgp.error']", 'add_file_path': '(True)'}), "(folders, exts=['.cdgp.error'], add_file_path=True)\n", (4335, 4386), False, 'from evoplotter import utils\n'), ((4421, 4487), 'evoplotter.utils.load_properties_... |
# Location: /dfs2/tw/limvt/08_permeate/github/analysis/02_density-profile/plot_wdensc.py
import numpy as np
import matplotlib.pyplot as plt
import re
from matplotlib.collections import PatchCollection
from matplotlib.patches import Rectangle
def draw_window_boxes(ax, xdata, ydata, widths, colors, alpha=0.5):
# ... | [
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"re.split",
"matplotlib.patches.Rectangle",
"numpy.array",
"numpy.loadtxt",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.subplots"
] | [((860, 874), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (872, 874), True, 'import matplotlib.pyplot as plt\n'), ((1799, 1856), 'numpy.array', 'np.array', (['[-40, -34, -26, -20, -12, -6, 2, 8, 16, 22, 30]'], {}), '([-40, -34, -26, -20, -12, -6, 2, 8, 16, 22, 30])\n', (1807, 1856), True, 'import nu... |
#!/usr/bin/env python3
import pandas as pd
import numpy as np
import datetime
import sys
from sklearn.externals import joblib
from sklearn import cross_validation
from sklearn.metrics import roc_auc_score
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_score
from sklearn.metrics import... | [
"sklearn.preprocessing.StandardScaler",
"numpy.abs",
"pandas.read_csv",
"numpy.empty",
"numpy.zeros",
"sklearn.metrics.recall_score",
"sklearn.metrics.f1_score",
"sklearn.metrics.precision_score",
"sklearn.metrics.confusion_matrix"
] | [((769, 810), 'pandas.read_csv', 'pd.read_csv', (['"""traindata.csv"""'], {'index_col': '(0)'}), "('traindata.csv', index_col=0)\n", (780, 810), True, 'import pandas as pd\n'), ((1211, 1227), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (1225, 1227), False, 'from sklearn.preprocessing imp... |
import pytest
from pathlib import Path
from numpy.testing import assert_allclose
import ccp
Q_ = ccp.Q_
test_dir = Path(__file__).parent
data_dir = test_dir / "data"
@pytest.fixture
def impeller_lp_sec1_from_csv():
suc = ccp.State.define(
p=Q_(4.08, "bar"),
T=Q_(33.6, "degC"),
fluid={
... | [
"numpy.testing.assert_allclose",
"pathlib.Path"
] | [((117, 131), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (121, 131), False, 'from pathlib import Path\n'), ((1275, 1320), 'numpy.testing.assert_allclose', 'assert_allclose', (['p0.eff', '(0.789412)'], {'rtol': '(1e-05)'}), '(p0.eff, 0.789412, rtol=1e-05)\n', (1290, 1320), False, 'from numpy.testing imp... |
import os
import pickle, logging
import numpy as np
import joblib, tqdm
import pandas as pd
from Fuzzy_clustering.ver_tf2.Sklearn_models_deap import sklearn_model
from Fuzzy_clustering.ver_tf2.Cluster_predict_regressors import cluster_predict
from Fuzzy_clustering.ver_tf2.Global_predict_regressor import global_predict
... | [
"numpy.random.chisquare",
"numpy.sum",
"Fuzzy_clustering.ver_tf2.Sklearn_models_deap.sklearn_model",
"sklearn.model_selection.train_test_split",
"joblib.dump",
"numpy.ones",
"numpy.isnan",
"logging.Formatter",
"numpy.mean",
"sklearn.linear_model.RidgeCV",
"joblib.load",
"os.path.join",
"skle... | [((867, 896), 'os.path.basename', 'os.path.basename', (['cluster_dir'], {}), '(cluster_dir)\n', (883, 896), False, 'import os\n'), ((961, 1002), 'os.path.join', 'os.path.join', (['self.cluster_dir', '"""Combine"""'], {}), "(self.cluster_dir, 'Combine')\n", (973, 1002), False, 'import os\n'), ((3875, 3913), 'os.path.joi... |
import torch
import torch.nn.functional as F
import numpy as np
import os, argparse
import cv2
from scripts.SCRN.lib.ResNet_models import SCRN
from utils.data_SCRN import get_loader, test_dataset
parser = argparse.ArgumentParser()
parser.add_argument('--testsize', type=int, default=352, help='testing size')
parser.add... | [
"argparse.ArgumentParser",
"os.makedirs",
"cv2.imwrite",
"torch.load",
"numpy.asarray",
"os.path.exists",
"utils.data_SCRN.test_dataset",
"torch.nn.functional.upsample",
"scripts.SCRN.lib.ResNet_models.SCRN"
] | [((206, 231), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (229, 231), False, 'import os, argparse\n'), ((739, 763), 'torch.load', 'torch.load', (['opt.snapshot'], {}), '(opt.snapshot)\n', (749, 763), False, 'import torch\n'), ((1157, 1213), 'utils.data_SCRN.test_dataset', 'test_dataset', (['... |
"""
test_tflintrans.py: Test suite for the linear estimator :class:`TFLinTrans`
"""
from __future__ import print_function, division
import unittest
import numpy as np
# Add the path to the vampyre package and import it
import env
env.add_vp_path()
import vampyre as vp
def vamp_gauss_test(nz=100,ny=200,... | [
"numpy.trace",
"numpy.abs",
"vampyre.common.TestException",
"numpy.linalg.svd",
"numpy.linalg.norm",
"numpy.mean",
"numpy.prod",
"vampyre.estim.MsgHdlSimp",
"unittest.main",
"vampyre.estim.DiscreteEst",
"vampyre.estim.LinEst",
"numpy.random.randn",
"numpy.power",
"numpy.reshape",
"numpy.... | [((233, 250), 'env.add_vp_path', 'env.add_vp_path', ([], {}), '()\n', (248, 250), False, 'import env\n'), ((2040, 2111), 'vampyre.estim.GaussEst', 'vp.estim.GaussEst', (['zmean0', 'zvar0', 'zshape'], {'map_est': 'map_est', 'name': '"""Prior"""'}), "(zmean0, zvar0, zshape, map_est=map_est, name='Prior')\n", (2057, 2111)... |
import os
import argparse
import time
import pathlib
import multiprocessing
import math
from psycopg2.extensions import TransactionRollbackError
from utils import (update_task, get_max_of_db_column,
get_task, ExploitationNeeded,
LossIsNaN, get_task_ids_and_scores, PopulationFinishe... | [
"argparse.ArgumentParser",
"tensorflow.ConfigProto",
"model.get_optimizer",
"numpy.random.randint",
"os.path.isfile",
"pathlib.Path",
"utils.print_with_time",
"utils.get_max_of_db_column",
"utils.create_new_population",
"numpy.random.choice",
"utils.get_task",
"utils.get_task_ids_and_scores",
... | [((860, 876), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (874, 876), True, 'import tensorflow as tf\n'), ((931, 956), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (941, 956), True, 'import tensorflow as tf\n'), ((961, 982), 'tensorflow.keras.backend.set_session... |
import csv
import math
import os
from heapq import heapify, heappop
from typing import Dict, Iterable, List, Tuple
import numpy as np
from joblib import Parallel, delayed
from rb.cna.cna_graph import CnaGraph
from rb.complexity.complexity_index import ComplexityIndex, compute_indices
from rb.core.document import Docum... | [
"os.listdir",
"rb.processings.pipeline.dataset.Dataset",
"math.isnan",
"csv.reader",
"rb.similarity.vector_model_factory.get_default_model",
"heapq.heapify",
"rb.cna.cna_graph.CnaGraph",
"scipy.stats.pearsonr",
"heapq.heappop",
"rb.processings.pipeline.bert_classifier.BertClassifier",
"joblib.de... | [((1193, 1212), 'rb.utils.rblogger.Logger.get_logger', 'Logger.get_logger', ([], {}), '()\n', (1210, 1212), False, 'from rb.utils.rblogger import Logger\n'), ((1415, 1443), 'rb.core.meta_document.MetaDocument', 'MetaDocument', (['lang', 'sections'], {}), '(lang, sections)\n', (1427, 1443), False, 'from rb.core.meta_doc... |
# Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"logging.root.setLevel",
"textwrap.dedent",
"math.isnan",
"math.isinf",
"numpy.abs",
"numpy.logical_and",
"numpy.array2string",
"logging.StreamHandler",
"logging.getLogger",
"numpy.isnan",
"logging.Formatter",
"numpy.max",
"numpy.diff",
"numpy.array",
"collections.namedtuple",
"numpy.r... | [((4292, 4391), 'collections.namedtuple', 'collections.namedtuple', (['"""HtmlScoreTableValue"""', "['name', 'severity', 'limits', 'value', 'score']"], {}), "('HtmlScoreTableValue', ['name', 'severity', 'limits',\n 'value', 'score'])\n", (4314, 4391), False, 'import collections\n'), ((1773, 1812), 'numpy.reshape', '... |
import xml.etree.ElementTree as ET
import numpy as np
import os
import time
import_directory = 'C:\\Users\<NAME>\Documents\ISCX\labeled_flows_xml\\'
files = os.listdir(import_directory)
errors = []
start_time = time.time()
i = -1
data_array = np.empty((0, 2))
counter = 0
actual = (50**2) * 3
for fil... | [
"xml.etree.ElementTree.parse",
"numpy.empty",
"time.time",
"numpy.fromstring",
"numpy.array",
"os.listdir"
] | [((166, 194), 'os.listdir', 'os.listdir', (['import_directory'], {}), '(import_directory)\n', (176, 194), False, 'import os\n'), ((226, 237), 'time.time', 'time.time', ([], {}), '()\n', (235, 237), False, 'import time\n'), ((260, 276), 'numpy.empty', 'np.empty', (['(0, 2)'], {}), '((0, 2))\n', (268, 276), True, 'import... |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import sys
import re
import json
import math
import numpy as np
from pathlib import Path
from collections import defaultdict
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
from matplotlib import pyplot as plt, colors
... | [
"json.load",
"matplotlib.pyplot.clf",
"sklearn.linear_model.LinearRegression",
"sklearn.preprocessing.PolynomialFeatures",
"collections.defaultdict",
"math.log10",
"numpy.array",
"pathlib.Path",
"matplotlib.colors.hsv_to_rgb",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots",
... | [((646, 685), 're.compile', 're.compile', (['"""([\\\\w_]+)<(\\\\d+), (\\\\d+)>"""'], {}), "('([\\\\w_]+)<(\\\\d+), (\\\\d+)>')\n", (656, 685), False, 'import re\n'), ((1391, 1467), 're.compile', 're.compile', (['"""([\\\\w_]+)<(\\\\d+), ?(\\\\d+)> v=(\\\\d+) n=(\\\\d+): max (\\\\d+) bytes"""'], {}), "('([\\\\w_]+)<(\\... |
import numpy as np
class Window():
def __init__(self):
self.x_low = None
self.x_high = None
self.y_low = None
self.y_high = None
self.allx = None
self.ally = None
# Define a class to receive the characteristics of each line detection
class Line():
def __init_... | [
"numpy.absolute",
"numpy.polyfit",
"numpy.max",
"numpy.array",
"numpy.concatenate"
] | [((1177, 1211), 'numpy.array', 'np.array', (['[0, 0, 0]'], {'dtype': '"""float"""'}), "([0, 0, 0], dtype='float')\n", (1185, 1211), True, 'import numpy as np\n'), ((3796, 3859), 'numpy.polyfit', 'np.polyfit', (['(ploty * self.ym_per_pix)', '(plotx * self.xm_per_pix)', '(2)'], {}), '(ploty * self.ym_per_pix, plotx * sel... |
from PIL import Image
import numpy as np
import os
import argparse
import sys
from sklearn import metrics
def mae(folder,path):
if folder:
orginal_image = os.path.join(folder,path)
else:
orginal_image = path
sal=Image.open(orginal_image)
GT=Image.open(os.path.join("Ground_Truth",pat... | [
"argparse.ArgumentParser",
"numpy.asarray",
"sklearn.metrics.mean_absolute_error",
"PIL.Image.open",
"os.path.join",
"os.listdir"
] | [((245, 270), 'PIL.Image.open', 'Image.open', (['orginal_image'], {}), '(orginal_image)\n', (255, 270), False, 'from PIL import Image\n'), ((384, 398), 'numpy.asarray', 'np.asarray', (['GT'], {}), '(GT)\n', (394, 398), True, 'import numpy as np\n'), ((415, 430), 'numpy.asarray', 'np.asarray', (['sal'], {}), '(sal)\n', ... |
from PIL import Image
import numpy
from numpy.fft import fftn
from numpy.fft import ifftn
import math
import matplotlib.pyplot as plt
import os
from scipy.optimize import curve_fit
import multiprocessing
"""
class WinAnalysis:
def __init__(self):
# The windowed analysis is exclusively performed on the
... | [
"numpy.sum",
"numpy.nanstd",
"numpy.zeros",
"numpy.shape",
"multiprocessing.cpu_count",
"numpy.array",
"multiprocessing.Pool",
"multiprocessing.freeze_support",
"numpy.nanmean"
] | [((1590, 1608), 'numpy.shape', 'numpy.shape', (['array'], {}), '(array)\n', (1601, 1608), False, 'import numpy\n'), ((2402, 2428), 'numpy.nanmean', 'numpy.nanmean', (['activitymap'], {}), '(activitymap)\n', (2415, 2428), False, 'import numpy\n'), ((2517, 2542), 'numpy.nanstd', 'numpy.nanstd', (['activitymap'], {}), '(a... |
# Copyright 2019-2020 MobiledgeX, Inc. All rights and licenses reserved.
# MobiledgeX, Inc. 156 2nd Street #408, San Francisco, CA 94105
#
# 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
#
# ... | [
"os.remove",
"time.strftime",
"glob.glob",
"tracker.models.CentralizedTraining.objects.get_or_create",
"cv2.cvtColor",
"cv2.destroyAllWindows",
"threading.current_thread",
"cv2.resize",
"threading.Thread",
"io.BytesIO",
"cv2.waitKey",
"os.path.getsize",
"os.path.realpath",
"time.sleep",
... | [((1013, 1040), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1030, 1040), False, 'import logging\n'), ((21542, 21556), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (21553, 21556), False, 'import cv2\n'), ((21561, 21584), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {... |
import random
from collections import Counter
import jsonlines
import numpy as np
import torch
from imblearn.over_sampling import RandomOverSampler
from torch.utils.data import Dataset
from tqdm import tqdm
from dependencyparser import DependencyParser
from fxlogger import get_logger
# get logger
logger = get_logger... | [
"random.shuffle",
"numpy.asarray",
"fxlogger.get_logger",
"imblearn.over_sampling.RandomOverSampler",
"collections.Counter",
"jsonlines.open"
] | [((310, 322), 'fxlogger.get_logger', 'get_logger', ([], {}), '()\n', (320, 322), False, 'from fxlogger import get_logger\n'), ((695, 738), 'imblearn.over_sampling.RandomOverSampler', 'RandomOverSampler', ([], {'random_state': 'random_seed'}), '(random_state=random_seed)\n', (712, 738), False, 'from imblearn.over_sampli... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from astropy.units import Quantity
from gammapy.data import ObservationStats
__all__ = [
'LogEnergyAxis',
'calculate_predicted_counts',
'calc... | [
"astropy.units.Quantity",
"numpy.abs",
"gammapy.data.ObservationStats.stack",
"numpy.log",
"numpy.isscalar",
"numpy.logspace",
"numpy.add.reduce",
"numpy.asanyarray",
"numpy.empty_like",
"numpy.errstate",
"numpy.isnan",
"numpy.append",
"uncertainties.unumpy.log10",
"numpy.where",
"numpy.... | [((7711, 7728), 'astropy.units.Quantity', 'Quantity', (['binning'], {}), '(binning)\n', (7719, 7728), False, 'from astropy.units import Quantity\n'), ((8874, 8891), 'numpy.isscalar', 'np.isscalar', (['xmin'], {}), '(xmin)\n', (8885, 8891), True, 'import numpy as np\n'), ((10510, 10526), 'numpy.asanyarray', 'np.asanyarr... |
from gc import collect
import pandas as pd
from tqdm import tqdm
import time
import numpy as np
from sklearn.metrics import classification_report
from sklearn.model_selection import KFold
from sklearn.metrics import roc_auc_score, roc_curve
from sklearn.svm import OneClassSVM as OCSVM
from sklearn.feature_extraction.te... | [
"sklearn.feature_extraction.text.CountVectorizer",
"tqdm.tqdm",
"nltk.stem.WordNetLemmatizer",
"warnings.filterwarnings",
"numpy.std",
"os.path.exists",
"os.system",
"sklearn.model_selection.KFold",
"sklearn.metrics.classification_report",
"time.time",
"gc.collect",
"numpy.mean",
"pandas.rea... | [((1132, 1187), 'sklearn.metrics.classification_report', 'classification_report', (['y_true', 'y_pred'], {'output_dict': '(True)'}), '(y_true, y_pred, output_dict=True)\n', (1153, 1187), False, 'from sklearn.metrics import classification_report\n'), ((1229, 1281), 'sklearn.model_selection.KFold', 'KFold', ([], {'n_spli... |
import numpy as np
import matplotlib.pyplot as plt
from load_data import responses_strong, stimulus_strong
sampling_rate = 20000.0 # Hz
N_data = stimulus_strong.size
N_trials = responses_strong.shape[1]
bin_size = 200.0 # ms
N_bins = int(N_data / bin_size)
window_to_plot = range(0, N_data / 10)
t, trial = np.non... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.bar",
"numpy.nonzero",
"numpy.histogram",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((314, 361), 'numpy.nonzero', 'np.nonzero', (['responses_strong[window_to_plot, :]'], {}), '(responses_strong[window_to_plot, :])\n', (324, 361), True, 'import numpy as np\n'), ((426, 457), 'numpy.arange', 'np.arange', (['stimulus_strong.size'], {}), '(stimulus_strong.size)\n', (435, 457), True, 'import numpy as np\n'... |
__all__ = [
"imread",
"collate_fn",
"torch_masks_to_labels",
"relabel_predicted_masks",
"torch_ready",
]
from pathlib import Path
from typing import Union
import numpy as np
from fast_overlap import overlap
from PIL.Image import open
from scipy.optimize import linear_sum_assignment
def imread(img... | [
"numpy.zeros_like",
"numpy.sum",
"numpy.zeros",
"PIL.Image.open",
"numpy.max",
"numpy.mean",
"numpy.arange",
"fast_overlap.overlap",
"numpy.unique",
"scipy.optimize.linear_sum_assignment"
] | [((815, 847), 'fast_overlap.overlap', 'overlap', (['predicted', 'ground_truth'], {}), '(predicted, ground_truth)\n', (822, 847), False, 'from fast_overlap import overlap\n'), ((871, 917), 'scipy.optimize.linear_sum_assignment', 'linear_sum_assignment', (['overlaps'], {'maximize': '(True)'}), '(overlaps, maximize=True)\... |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import random as rnd
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import normalize
import cv2
import pickle
import hypar
import backbone_0 as nn
import netw... | [
"matplotlib.pyplot.title",
"numpy.load",
"matplotlib.pyplot.figure",
"numpy.mean",
"network_16.Resnet_preprocess",
"pandas.DataFrame",
"numpy.multiply",
"cv2.cvtColor",
"matplotlib.pyplot.imshow",
"numpy.transpose",
"numpy.reshape",
"pandas.concat",
"numpy.save",
"matplotlib.pyplot.show",
... | [((7391, 7441), 'numpy.load', 'np.load', (['"""datasets/x_train.npy"""'], {'allow_pickle': '(True)'}), "('datasets/x_train.npy', allow_pickle=True)\n", (7398, 7441), True, 'import numpy as np\n'), ((7446, 7496), 'numpy.load', 'np.load', (['"""datasets/y_train.npy"""'], {'allow_pickle': '(True)'}), "('datasets/y_train.n... |
'''
Tensor implementation for lsh
'''
import json as json
import numpy as np
import tensorflow as tf
from typing import ByteString, Dict, TypedDict, List, Union
class HashTable(TypedDict):
'''
hash table records for lsh.
'''
hash: Dict[str, str]
hash_bucket: Dict[str, str]
Input_Vector = Union[L... | [
"json.load",
"numpy.random.randn",
"numpy.shape",
"tensorflow.strings.reduce_join",
"tensorflow.matmul",
"numpy.array",
"numpy.arange"
] | [((496, 535), 'tensorflow.strings.reduce_join', 'tf.strings.reduce_join', (['hashes'], {'axis': '(-1)'}), '(hashes, axis=-1)\n', (518, 535), True, 'import tensorflow as tf\n'), ((4869, 4888), 'numpy.shape', 'np.shape', (['input_val'], {}), '(input_val)\n', (4877, 4888), True, 'import numpy as np\n'), ((5499, 5518), 'nu... |
"""An English grammar for chartparse.
This grammar was originally written by <NAME> at the
University of Sussex. The vocabulary is designed to amuse
undergraduate Experimental Psychology students, hence the
references to pigeons and cages.
The grammar is almost entirely Steve's original. The only changes
are a few wo... | [
"collections.namedtuple",
"numpy.random.RandomState"
] | [((1717, 1751), 'collections.namedtuple', 'namedtuple', (['"""Rule"""', "('lhs', 'rhs')"], {}), "('Rule', ('lhs', 'rhs'))\n", (1727, 1751), False, 'from collections import namedtuple\n'), ((2781, 2800), 'numpy.random.RandomState', 'npr.RandomState', (['(42)'], {}), '(42)\n', (2796, 2800), True, 'import numpy.random as ... |
import datetime as dt
from unittest import SkipTest
import numpy as np
from holoviews.core.util import pd
from holoviews.element import Curve
from .testplot import TestMPLPlot, mpl_renderer
class TestCurvePlot(TestMPLPlot):
def test_curve_datetime64(self):
dates = [np.datetime64(dt.datetime(2016,1,i))... | [
"numpy.random.rand",
"datetime.datetime",
"holoviews.core.util.pd.date_range",
"unittest.SkipTest"
] | [((650, 701), 'holoviews.core.util.pd.date_range', 'pd.date_range', (['"""2016-01-01"""', '"""2016-01-10"""'], {'freq': '"""D"""'}), "('2016-01-01', '2016-01-10', freq='D')\n", (663, 701), False, 'from holoviews.core.util import pd\n'), ((1769, 1820), 'holoviews.core.util.pd.date_range', 'pd.date_range', (['"""2016-01-... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import random
carpetID = 171
# Sub generators
def border(matrix, color, h, x_min, x_max, z_min, z_max):
for i in range(x_min, x_max):
matrix[h][i][z_min] = (carpetID, color)
matrix[h][i][z_max-1] = (carpetID, color)
for i in range(z_mi... | [
"numpy.sort",
"numpy.random.choice"
] | [((978, 1016), 'numpy.random.choice', 'np.random.choice', (['(16)', '(2)'], {'replace': '(False)'}), '(16, 2, replace=False)\n', (994, 1016), True, 'import numpy as np\n'), ((1027, 1037), 'numpy.sort', 'np.sort', (['c'], {}), '(c)\n', (1034, 1037), True, 'import numpy as np\n'), ((1229, 1267), 'numpy.random.choice', 'n... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 10 18:27:48 2019
@author: sandipan
"""
import cv2
import numpy as np
from matplotlib import pyplot as plt
import os
import glob
k = 0
new = input("ENTER YOUR INPUT IMAGE DIRECTORY: ")
inpath = os.getcwd() + new
entries = os.listdir(inpath)
for ent... | [
"os.getcwd",
"cv2.imwrite",
"numpy.ones",
"cv2.split",
"numpy.mean",
"cv2.mean",
"os.path.join",
"os.listdir"
] | [((294, 312), 'os.listdir', 'os.listdir', (['inpath'], {}), '(inpath)\n', (304, 312), False, 'import os\n'), ((266, 277), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (275, 277), False, 'import os\n'), ((887, 908), 'cv2.split', 'cv2.split', (['test_image'], {}), '(test_image)\n', (896, 908), False, 'import cv2\n'), ((26... |
from logging import warning
import numpy as np
import pandas as pd
from aif360.datasets import BinaryLabelDataset
class StandardDataset(BinaryLabelDataset):
"""Base class for every :obj:`BinaryLabelDataset` provided out of the box by
aif360.
It is not strictly necessary to inherit this class when addin... | [
"pandas.get_dummies",
"numpy.array",
"numpy.issubdtype"
] | [((5965, 6029), 'pandas.get_dummies', 'pd.get_dummies', (['df'], {'columns': 'categorical_features', 'prefix_sep': '"""="""'}), "(df, columns=categorical_features, prefix_sep='=')\n", (5979, 6029), True, 'import pandas as pd\n'), ((6786, 6826), 'numpy.issubdtype', 'np.issubdtype', (['df[attr].dtype', 'np.number'], {}),... |
"""
Class for working with angle-averaged profiles.
<NAME>
"""
import numpy as np
import matplotlib.pyplot as plt
class AngleAveragedProfile(object):
def __init__(self, filename=None):
self.init_vars()
if filename:
self.read_from_file(filename)
def init_vars(self):
... | [
"numpy.absolute",
"matplotlib.pyplot.show",
"numpy.ceil",
"matplotlib.pyplot.close",
"numpy.floor",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.array",
"numpy.log10",
"matplotlib.pyplot.savefig"
] | [((3655, 3667), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3665, 3667), True, 'import matplotlib.pyplot as plt\n'), ((3900, 3938), 'numpy.where', 'np.where', (['(self.data[var][:idxup] < 0.0)'], {}), '(self.data[var][:idxup] < 0.0)\n', (3908, 3938), True, 'import numpy as np\n'), ((3957, 3995), 'numpy... |
import time
import numpy as np
import cv2
import imutils
import os
import threading
from datetime import date, datetime
from imutils.video import VideoStream
from tensorflow import keras
from tensorflow.python.keras.applications.mobilenet_v2 import preprocess_input
from source.utils import preprocess_face_frame, deco... | [
"imutils.video.VideoStream",
"os.mkdir",
"source.utils.write_bb",
"tensorflow.keras.models.load_model",
"cv2.cvtColor",
"source.utils.check_count_image",
"cv2.waitKey",
"cv2.imshow",
"datetime.date.today",
"time.sleep",
"source.utils.decode_prediction",
"numpy.array",
"source.utils.load_casc... | [((446, 497), 'tensorflow.keras.models.load_model', 'keras.models.load_model', (['"""models/mask_mobilenet.h5"""'], {}), "('models/mask_mobilenet.h5')\n", (469, 497), False, 'from tensorflow import keras\n'), ((628, 651), 'source.utils.load_cascade_detector', 'load_cascade_detector', ([], {}), '()\n', (649, 651), False... |
from __future__ import print_function
from numba import jit, float64
import numpy as np
import inspect
class Component(object):
def __init__(self, comp_name):
""" SED must be in uK_RJ units.
"""
self.comp_name = comp_name
self.sed = globals()[comp_name]
return
def __cal... | [
"numpy.log",
"inspect.signature",
"numpy.exp"
] | [((1555, 1564), 'numpy.exp', 'np.exp', (['x'], {}), '(x)\n', (1561, 1564), True, 'import numpy as np\n'), ((1144, 1171), 'inspect.signature', 'inspect.signature', (['self.sed'], {}), '(self.sed)\n', (1161, 1171), False, 'import inspect\n'), ((3487, 3499), 'numpy.exp', 'np.exp', (['x_to'], {}), '(x_to)\n', (3493, 3499),... |
# OBSS SAHI Tool
# Code written by <NAME>, 2020.
import copy
from typing import Dict, List, Optional, Union
import numpy as np
from PIL import Image
from osgeo import gdal, ogr
import matplotlib.pyplot as plt
from sklearn.linear_model import HuberRegressor
from sklearn.linear_model import TheilSenRegressor
import os
... | [
"numpy.abs",
"numpy.ones",
"numpy.shape",
"numpy.mean",
"cv2.rectangle",
"numpy.sqrt",
"numpy.fft.ifft2",
"os.path.join",
"numpy.zeros_like",
"cv2.dilate",
"cv2.cvtColor",
"skimage.morphology.skeletonize",
"numpy.max",
"sahi.utils.cv.read_image_as_pil",
"numpy.stack",
"copy.deepcopy",
... | [((887, 898), 'numpy.min', 'np.min', (['aux'], {}), '(aux)\n', (893, 898), True, 'import numpy as np\n'), ((5933, 6027), 'fiftyone.Detection', 'fo.Detection', ([], {'label': 'self.category.name', 'bounding_box': 'rel_box', 'confidence': 'self.score.value'}), '(label=self.category.name, bounding_box=rel_box, confidence=... |
import numpy as np
import pandas as pd
from collections import deque
# generate some data
# define features and target values
data = {
'wind_direction': ['N', 'S', 'E', 'W'],
'tide': ['Low', 'High'],
'swell_forecasting': ['small', 'medium', 'large'],
'good_waves': ['Yes', 'No']
}
# create an empty dat... | [
"numpy.random.seed",
"ID3.DecisionTreeClassifier",
"numpy.random.choice"
] | [((372, 390), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (386, 390), True, 'import numpy as np\n'), ((1127, 1193), 'ID3.DecisionTreeClassifier', 'DecisionTreeClassifier', ([], {'X': 'X', 'feature_names': 'feature_names', 'labels': 'y'}), '(X=X, feature_names=feature_names, labels=y)\n', (1149, 119... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import matplotlib.pyplot as plt
import numpy as np
import pickle
import os
# In[2]:
import os
GPU = ""
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ[... | [
"matplotlib.pyplot.title",
"numpy.maximum",
"pickle.load",
"numpy.array",
"matplotlib.colors.LogNorm",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.xlabel"
] | [((518, 541), 'numpy.array', 'np.array', (["d['mat_date']"], {}), "(d['mat_date'])\n", (526, 541), True, 'import numpy as np\n'), ((554, 580), 'numpy.array', 'np.array', (["d['mat_date_eq']"], {}), "(d['mat_date_eq'])\n", (562, 580), True, 'import numpy as np\n'), ((409, 423), 'pickle.load', 'pickle.load', (['f'], {}),... |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | [
"numpy.minimum",
"numpy.ascontiguousarray",
"numpy.maximum",
"numpy.where"
] | [((437, 469), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['dets[:, 0]'], {}), '(dets[:, 0])\n', (457, 469), True, 'import numpy as np\n'), ((479, 511), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['dets[:, 1]'], {}), '(dets[:, 1])\n', (499, 511), True, 'import numpy as np\n'), ((521, 553), 'numpy.ascon... |
import os
import sys
import argparse
import pandas as pd
import numpy as np
import ast
import logging.config
# .. other safe imports
try:
# z test
from statsmodels.stats.proportion import proportions_ztest
# bayesian bootstrap and vis
import matplotlib.pyplot as plt
import seaborn as sns
import... | [
"scipy.stats.norm.ppf",
"numpy.random.dirichlet",
"os.getenv",
"argparse.ArgumentParser",
"pandas.read_csv",
"tqdm.tqdm.pandas",
"bayesian_bootstrap.bootstrap.highest_density_interval",
"numpy.array",
"pandas.Series",
"astropy.utils.NumpyRNGContext",
"statsmodels.stats.proportion.proportions_zte... | [((691, 704), 'tqdm.tqdm.pandas', 'tqdm.pandas', ([], {}), '()\n', (702, 704), False, 'from tqdm import tqdm\n'), ((6209, 6229), 'numpy.array', 'np.array', (['[x_a, x_b]'], {}), '([x_a, x_b])\n', (6217, 6229), True, 'import numpy as np\n'), ((6264, 6284), 'numpy.array', 'np.array', (['[n_a, n_b]'], {}), '([n_a, n_b])\n... |
# -*- coding: utf-8 -*-
"""
.. Authors
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
Define the :class:`InteractCrystal` class.
"""
import numpy as np
from xicsrt.tools.xicsrt_doc import dochelper
from xicsrt.tools import xicsrt_bragg
from xicsrt.tools import xicsrt_math as xm
from xicsrt.optics._In... | [
"xicsrt.tools.xicsrt_bragg.read",
"numpy.log",
"numpy.power",
"numpy.einsum",
"numpy.zeros",
"numpy.arcsin",
"xicsrt.tools.xicsrt_math.magnitude",
"numpy.interp"
] | [((3367, 3402), 'numpy.zeros', 'np.zeros', (['m.shape'], {'dtype': 'np.float64'}), '(m.shape, dtype=np.float64)\n', (3375, 3402), True, 'import numpy as np\n'), ((3417, 3452), 'numpy.zeros', 'np.zeros', (['m.shape'], {'dtype': 'np.float64'}), '(m.shape, dtype=np.float64)\n', (3425, 3452), True, 'import numpy as np\n'),... |
import copy
import logging
from collections import Counter
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
import numpy as np
import pyro
from lightwood.config.config import CONFIG
from lightwood.mixers.helpers.default_net import DefaultNet
from lightwood.mixers.helpers.transformer im... | [
"torch.nn.MSELoss",
"torch.utils.data.DataLoader",
"pyro.distributions.Normal",
"torch.Tensor",
"collections.Counter",
"pyro.distributions.Categorical",
"copy.deepcopy",
"torch.randn_like",
"torch.zeros_like",
"pyro.infer.Trace_ELBO",
"torch.nn.Softplus",
"pyro.optim.Adam",
"lightwood.mixers... | [((996, 1015), 'torch.nn.Softplus', 'torch.nn.Softplus', ([], {}), '()\n', (1013, 1015), False, 'import torch\n'), ((2125, 2171), 'pyro.random_module', 'pyro.random_module', (['"""module"""', 'self.net', 'priors'], {}), "('module', self.net, priors)\n", (2143, 2171), False, 'import pyro\n'), ((2526, 2590), 'torch.randn... |
import numpy as np
import tensorflow.compat.v2 as tf
from tensorflow_probability import distributions as tfpd
def mg2k(m, g):
return 2*m + 1 - g
def make_transfer(M, dtype=tf.float32):
"""Transfer matrices, from r, u, s and c to HMM trans. and emit. matrix."""
K = 2*(M+1)
# r and u indices: m in ... | [
"tensorflow.compat.v2.einsum",
"tensorflow.compat.v2.reduce_logsumexp",
"numpy.log",
"tensorflow.compat.v2.convert_to_tensor",
"tensorflow_probability.distributions.Categorical",
"tensorflow_probability.distributions.OneHotCategorical",
"numpy.zeros",
"tensorflow.compat.v2.concat",
"tensorflow.compa... | [((382, 408), 'numpy.zeros', 'np.zeros', (['(M + 1, 3, 2, K)'], {}), '((M + 1, 3, 2, K))\n', (390, 408), True, 'import numpy as np\n'), ((424, 450), 'numpy.zeros', 'np.zeros', (['(M + 1, 3, 2, K)'], {}), '((M + 1, 3, 2, K))\n', (432, 450), True, 'import numpy as np\n'), ((469, 483), 'numpy.zeros', 'np.zeros', (['(K,)']... |
import numpy as np
from .closedcurve import ClosedCurve
from . import cmt
class Region(object):
"""A region in the complex plane
A region is defined by one or more closed curves. The interior of a
region is defined to be to the left of the tangent vector of the closed
curve. The exterior is the compl... | [
"numpy.max",
"numpy.vstack"
] | [((3187, 3200), 'numpy.vstack', 'np.vstack', (['zi'], {}), '(zi)\n', (3196, 3200), True, 'import numpy as np\n'), ((3214, 3232), 'numpy.max', 'np.max', (['zi'], {'axis': '(0)'}), '(zi, axis=0)\n', (3220, 3232), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
"""
**CMRSET**
`Restrictions`
The data and this python file may not be distributed to others without
permission of the WA+ team.
`Description`
This module downloads CMRSET data from
``ftp.wateraccounting.unesco-ihe.org``.
Use the CMRSET.monthly function to download
and create weekly ALEXI i... | [
"os.remove",
"pandas.Timestamp",
"pandas.date_range",
"os.makedirs",
"os.path.exists",
"numpy.max",
"numpy.min",
"watools.Functions.Start.WaitbarConsole.printWaitBar",
"ftplib.FTP",
"os.path.join"
] | [((2425, 2469), 'pandas.date_range', 'pd.date_range', (['Startdate', 'Enddate'], {'freq': '"""MS"""'}), "(Startdate, Enddate, freq='MS')\n", (2438, 2469), True, 'import pandas as pd\n'), ((2854, 2907), 'os.path.join', 'os.path.join', (['Dir', '"""Evaporation"""', '"""CMRSET"""', '"""Monthly"""'], {}), "(Dir, 'Evaporati... |
import os
import numpy as np
import pandas as pd
import datetime
import random
import pytest
from skmultiflow.data.temporal_data_stream import TemporalDataStream
def test_temporal_data_stream(test_path):
test_file = os.path.join(test_path, 'sea_stream_file.csv')
raw_data = pd.read_csv(test_file)
stream =... | [
"numpy.load",
"pandas.read_csv",
"pytest.warns",
"datetime.datetime",
"random.random",
"pytest.raises",
"numpy.diff",
"random.seed",
"numpy.array",
"numpy.alltrue",
"skmultiflow.data.temporal_data_stream.TemporalDataStream",
"os.path.join"
] | [((223, 269), 'os.path.join', 'os.path.join', (['test_path', '"""sea_stream_file.csv"""'], {}), "(test_path, 'sea_stream_file.csv')\n", (235, 269), False, 'import os\n'), ((285, 307), 'pandas.read_csv', 'pd.read_csv', (['test_file'], {}), '(test_file)\n', (296, 307), True, 'import pandas as pd\n'), ((321, 362), 'skmult... |
import numpy as np
import pandas as pd
import sklearn as scikit
import tensorflow as tf
from preprocessing import Preprocessing
from evaluation import EvaluationClient
from sklearn.model_selection import train_test_split
# ###############################################################################################... | [
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"numpy.asarray",
"sklearn.preprocessing.LabelEncoder",
"sklearn.preprocessing.normalize",
"tensorflow.keras.models.Sequential"
] | [((1575, 1597), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x', 'y'], {}), '(x, y)\n', (1591, 1597), False, 'from sklearn.model_selection import train_test_split\n'), ((1840, 1884), 'tensorflow.keras.models.Sequential', 'tf.keras.models.Sequential', ([], {'name': '"""Iris_Real"""'}), "(name='Iris... |
import os
import random
import argparse
import pickle
import numpy as np
import pandas as pd
import lightgbm as lgb
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import StratifiedKFold
_train_file = 'dataset/df_train.pkl'
_test_file = 'dataset/df_test.pkl'
_verbose_eval = 100
_lgb_seed = 0
_s... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"lightgbm.Dataset",
"os.rename",
"numpy.zeros",
"lightgbm.cv",
"os.path.exists",
"sklearn.metrics.roc_auc_score",
"sklearn.model_selection.StratifiedKFold",
"random.seed"
] | [((1932, 1952), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1946, 1952), True, 'import numpy as np\n'), ((2040, 2065), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2063, 2065), False, 'import argparse\n'), ((3328, 3358), 'numpy.zeros', 'np.zeros', (['X_train_val.shape... |
"""
___ _
/ _/______ ____ ____(_)__ _______
/ _/ __/ _ `/ _ \/ __/ (_-</ __/ _ \
/_//_/ \_,_/_//_/\__/_/___/\__/\___/
___ _____(_)__ ___ ____ / /_(_)
/ _ `/ __/ (_-</ _ `/ _ \/ __/ /
\_, /_/ /_/___/\_,_/_//_/\__/_/
/___/
Samee Lab @ Ba... | [
"tensorflow.random.set_seed",
"numpy.random.seed",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.optimizers.SGD",
"sklearn.decomposition.PCA",
"numpy.arange",
"tensorflow.keras.Sequential",
"numpy.delete"
] | [((807, 827), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (821, 827), True, 'import numpy as np\n'), ((828, 852), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['seed'], {}), '(seed)\n', (846, 852), True, 'import tensorflow as tf\n'), ((1177, 1195), 'tensorflow.keras.Sequential', 'keras.Se... |
"""Handles data for nn models."""
from typing import Any, Sequence
import itertools
import json
from pathlib import Path
import fasttext
import numpy as np
import pandas as pd
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.utils import to_categorical
from invoice_net.label_enc... | [
"json.load",
"tensorflow.keras.utils.to_categorical",
"itertools.zip_longest",
"numpy.isnan",
"invoice_net.label_encoder.LabelEncoder",
"itertools.chain.from_iterable",
"pandas.concat"
] | [((5741, 5809), 'pandas.concat', 'pd.concat', (['[self.data, left_df, top_df, right_df, bottom_df]'], {'axis': '(1)'}), '([self.data, left_df, top_df, right_df, bottom_df], axis=1)\n', (5750, 5809), True, 'import pandas as pd\n'), ((7810, 7824), 'invoice_net.label_encoder.LabelEncoder', 'LabelEncoder', ([], {}), '()\n'... |
import numpy as np
def _determine_overlap_3prime(
fragment1_start, fragment1_stop, fragment2_start, fragment2_stop
):
"""
Observe whether the start-site of fragment2 overlaps the 3' end of fragment1.
Parameters:
-----------
fragment1_start
fragment1_stop
fragment2_start
fragme... | [
"numpy.unique"
] | [((3605, 3636), 'numpy.unique', 'np.unique', (['overlapped_fragments'], {}), '(overlapped_fragments)\n', (3614, 3636), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
"""CIS 693 - Project 5.
Author: <NAME>
Date: June 26, 2020
Description:
The objective of this project is to perform 3D indoor scene reconstruction.
1. Write a program to create a 3D point cloud model based on the pinhole
camera model. Use one RGB-D image (image1 rgb with image... | [
"matplotlib.pyplot.title",
"open3d.geometry.PointCloud",
"numpy.iinfo",
"open3d.visualization.draw_geometries",
"matplotlib.pyplot.figure",
"open3d.geometry.PointCloud.create_from_rgbd_image",
"open3d.registration.PoseGraphNode",
"open3d.registration.PoseGraphEdge",
"cv2.cvtColor",
"matplotlib.pyp... | [((2707, 2727), 'numpy.array', 'np.array', (['cloud_list'], {}), '(cloud_list)\n', (2715, 2727), True, 'import numpy as np\n'), ((2775, 2787), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (2785, 2787), True, 'from matplotlib import pyplot as plt\n'), ((3182, 3192), 'matplotlib.pyplot.show', 'plt.show', (... |
caffe_home = "/home1/06128/dtao/caffe"
import numpy as np
import os
import sys
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import caffe
plt.rcParams['figure.figsize'] = (15, 15)
o_accuracy = 0.5741 #original accuracy
e_accuracy = 0.005 #acceptable accuracy loss
max_test = 9
num_layers =... | [
"numpy.fromfile",
"numpy.zeros",
"os.system",
"caffe.set_mode_cpu",
"matplotlib.use",
"numpy.reshape",
"caffe.Net"
] | [((105, 119), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (112, 119), True, 'import matplotlib as mpl\n'), ((331, 384), 'numpy.zeros', 'np.zeros', (['(num_layers + 1, max_test)'], {'dtype': '"""float32"""'}), "((num_layers + 1, max_test), dtype='float32')\n", (339, 384), True, 'import numpy as np\n')... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import numpy as np
import cv2
import scipy.io
import argparse
from tqdm import tqdm
from utils import get_meta
from shutil import copy2
from pathlib import Path
def get_args():
parser = argparse.ArgumentParser(description="This script cleans-up noisy labels "
... | [
"argparse.ArgumentParser",
"shutil.copy2",
"numpy.isnan",
"pathlib.Path",
"numpy.arange",
"numpy.array",
"utils.get_meta",
"numpy.random.shuffle"
] | [((234, 407), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""This script cleans-up noisy labels and creates database for training."""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description=\n 'This script cleans-up noisy labels and creates database for training... |
# (ytz): check test and run benchmark with pytest:
# pytest -xsv tests/test_nonbonded.py::TestNonbonded::test_dhfr && nvprof pytest -xsv tests/test_nonbonded.py::TestNonbonded::test_benchmark
import copy
import functools
import unittest
import scipy.linalg
from jax.config import config; config.update("jax_enable_x64"... | [
"numpy.random.seed",
"numpy.amin",
"numpy.ones",
"numpy.argsort",
"numpy.random.randint",
"numpy.arange",
"numpy.linalg.norm",
"unittest.main",
"numpy.set_printoptions",
"common.prepare_reference_nonbonded",
"numpy.random.choice",
"simtk.openmm.app.PDBFile",
"jax.config.config.update",
"md... | [((290, 327), 'jax.config.config.update', 'config.update', (['"""jax_enable_x64"""', '(True)'], {}), "('jax_enable_x64', True)\n", (303, 327), False, 'from jax.config import config\n'), ((805, 839), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': '(500)'}), '(linewidth=500)\n', (824, 839), True, 'im... |
"""
Load up the learned word embeddings in sys.argv[1] in memory; for a given search term q, find the 10 closest terms to q in each of the 51 states.
"""
import sys,math,operator
import numpy as np
from numpy import linalg as LA
def find(word, data, name):
print (f"Finding: {word} in {name}")
scores={}
if word n... | [
"numpy.zeros",
"numpy.linalg.norm",
"numpy.array",
"numpy.inner",
"sys.stdin.readline"
] | [((2533, 2553), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (2551, 2553), False, 'import sys, math, operator\n'), ((1955, 1982), 'numpy.array', 'np.array', (['vals'], {'dtype': 'float'}), '(vals, dtype=float)\n', (1963, 1982), True, 'import numpy as np\n'), ((2708, 2728), 'sys.stdin.readline', 'sys.st... |
import tensorflow as tf
import numpy as np
def relu(inputs):
def _relu(x):
return np.maximum(x, 0.)
def _relu_grad(x):
return np.float32(x > 0)
def _relu_grad_op(op, grad):
x = op.inputs[0]
grad_x = grad*tf.py_func(_relu_grad, [x], tf.float32)
return grad_x | [
"numpy.float32",
"numpy.maximum",
"tensorflow.py_func"
] | [((96, 114), 'numpy.maximum', 'np.maximum', (['x', '(0.0)'], {}), '(x, 0.0)\n', (106, 114), True, 'import numpy as np\n'), ((153, 170), 'numpy.float32', 'np.float32', (['(x > 0)'], {}), '(x > 0)\n', (163, 170), True, 'import numpy as np\n'), ((252, 291), 'tensorflow.py_func', 'tf.py_func', (['_relu_grad', '[x]', 'tf.fl... |
from threading import Thread
import time, math
glm_counter = 0
numpy_counter = 0
glm_time = 0
numpy_time = 0
test_duration = 1
display_update_delay = 1 / 10
results = []
def measure_function_glm(func, *args, **kw):
global glm_counter
glm_counter = 0
start = time.time()
last_print = 0
while Tr... | [
"numpy.zeros",
"glm.mat4",
"numpy.identity",
"time.time",
"glm.vec4",
"glm.vec3",
"math.log10",
"numpy.array"
] | [((277, 288), 'time.time', 'time.time', ([], {}), '()\n', (286, 288), False, 'import time, math\n'), ((764, 775), 'time.time', 'time.time', ([], {}), '()\n', (773, 775), False, 'import time, math\n'), ((389, 400), 'time.time', 'time.time', ([], {}), '()\n', (398, 400), False, 'import time, math\n'), ((878, 889), 'time.... |
import numpy as np
from dash import dcc, html
from dash.exceptions import PreventUpdate
import dash_bootstrap_components as dbc
import plotly.graph_objs as go
from deepcave.plugins.dynamic_plugin import DynamicPlugin
from deepcave.utils.logs import get_logger
from deepcave.utils.styled_plotty import get_color
from deep... | [
"dash_bootstrap_components.Label",
"deepcave.utils.styled_plotty.get_color",
"deepcave.utils.layout.get_slider_marks",
"numpy.std",
"deepcave.utils.logs.get_logger",
"numpy.mean",
"numpy.array",
"plotly.graph_objs.Figure",
"deepcave.utils.layout.get_radio_options",
"deepcave.utils.layout.get_selec... | [((435, 455), 'deepcave.utils.logs.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (445, 455), False, 'from deepcave.utils.logs import get_logger\n'), ((5530, 5545), 'numpy.array', 'np.array', (['all_x'], {}), '(all_x)\n', (5538, 5545), True, 'import numpy as np\n'), ((5566, 5581), 'numpy.array', 'np.arr... |
from selenium import webdriver
from sys import argv
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import pandas as pd
import numpy as np
#-----... | [
"pandas.DataFrame",
"selenium.webdriver.support.expected_conditions.presence_of_element_located",
"numpy.array",
"selenium.webdriver.ChromeOptions",
"selenium.webdriver.Chrome",
"selenium.webdriver.support.ui.WebDriverWait"
] | [((526, 551), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (549, 551), False, 'from selenium import webdriver\n'), ((700, 733), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'options': 'options'}), '(options=options)\n', (716, 733), False, 'from selenium import webdriver\n')... |
#import modules
import numpy as np
import keras
import csv
import cv2
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from keras.models import *
from keras.layers import *
from keras.optimizers import Adam
import matplotlib.pyplot as plt
#define the file direcory
features_directo... | [
"csv.reader",
"cv2.cvtColor",
"sklearn.model_selection.train_test_split",
"keras.optimizers.Adam",
"numpy.append",
"numpy.array",
"sklearn.utils.shuffle",
"matplotlib.pyplot.imread"
] | [((2008, 2057), 'numpy.append', 'np.append', (['features', 'features[:, :, ::-1]'], {'axis': '(0)'}), '(features, features[:, :, ::-1], axis=0)\n', (2017, 2057), True, 'import numpy as np\n'), ((2063, 2097), 'numpy.append', 'np.append', (['labels', '(-labels)'], {'axis': '(0)'}), '(labels, -labels, axis=0)\n', (2072, 2... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from numpy.testing import assert_allclose
from astropy.tests.helper import pytest
from ...utils.testing import requires_dependency
from ...utils.random im... | [
"numpy.sum",
"sherpa.stats.WStat",
"sherpa.stats.CStat",
"numpy.testing.assert_allclose",
"sherpa.stats.Cash",
"numpy.sqrt"
] | [((740, 753), 'numpy.sqrt', 'np.sqrt', (['data'], {}), '(data)\n', (747, 753), True, 'import numpy as np\n'), ((1265, 1275), 'sherpa.stats.CStat', 'ss.CStat', ([], {}), '()\n', (1273, 1275), True, 'import sherpa.stats as ss\n'), ((1479, 1495), 'numpy.sum', 'np.sum', (['statsvec'], {}), '(statsvec)\n', (1485, 1495), Tru... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import cv2
import ubelt as ub
from os.path import join, expanduser, basename, splitext, abspath, exists # NOQA
from PIL import Image
from clab import inputs
from .util import fnameutil # NOQA
from .util import imutil
from .util i... | [
"clab.getLogger",
"ubelt.ProgIter",
"ubelt.augpath",
"clab.inputs.Inputs",
"os.path.basename",
"numpy.floor",
"os.path.exists",
"PIL.Image.open",
"ubelt.delete",
"ubelt.ensuredir",
"os.path.join",
"ubelt.repr2",
"cv2.resize"
] | [((391, 410), 'clab.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (400, 410), False, 'from clab import getLogger\n'), ((1240, 1271), 'os.path.join', 'join', (['*((prep.datadir,) + args)'], {}), '(*((prep.datadir,) + args))\n', (1244, 1271), False, 'from os.path import join, expanduser, basename, splitext... |
#!/usr/bin/env python
import re
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from keras import backend as K
from keras.layers import Activation
from keras.layers import Input, Lambda, Dense, Dropout
from keras.layers import Convolution2D, MaxPooling2D, Flatten
from ker... | [
"numpy.abs",
"sklearn.model_selection.train_test_split",
"keras.models.Model",
"numpy.random.randint",
"keras.layers.Input",
"keras.layers.Flatten",
"re.search",
"keras.layers.MaxPooling2D",
"keras.layers.Convolution2D",
"keras.layers.Dropout",
"keras.backend.maximum",
"keras.optimizers.RMSpro... | [((5395, 5433), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'Y'], {'test_size': '(0.25)'}), '(X, Y, test_size=0.25)\n', (5411, 5433), False, 'from sklearn.model_selection import train_test_split\n'), ((5472, 5494), 'keras.layers.Input', 'Input', ([], {'shape': 'input_dim'}), '(shape=input_dim... |
import torch
from agents.utils.baseAgent import BaseAgent
from .utils.dqn import DQNOracle
from random import choice, randint, random
import numpy as np
class DQNAgent(BaseAgent):
def __init__(self, memory_len, in_features, layer_dims, out_features,
train_every, eps, device):
self.dqn_oracle = DQNOracle(me... | [
"numpy.zeros_like",
"numpy.argmax",
"torch.load",
"numpy.zeros",
"random.choice",
"random.random",
"numpy.array",
"numpy.arange"
] | [((642, 658), 'numpy.zeros', 'np.zeros', (['(54 * 5)'], {}), '(54 * 5)\n', (650, 658), True, 'import numpy as np\n'), ((1225, 1267), 'numpy.array', 'np.array', (['possible_actions'], {'dtype': 'np.uint8'}), '(possible_actions, dtype=np.uint8)\n', (1233, 1267), True, 'import numpy as np\n'), ((1293, 1333), 'numpy.zeros_... |
import numpy as np
# log(cosh(x) + ysinh(x))
def log_cosh_sinh(x,y):
return np.log(0.5) + x + np.log(1 + np.exp(-2*x) + y*(1 - np.exp(-2*x)))
# (y + tanh(x))/(1 + ytanh(x))
def tanh_frac(x,y):
return (y*(1 + np.exp(-2*x)) + 1 - np.exp(-2*x))/(1 + np.exp(-2*x) + y*(1 - np.exp(-2*x)))
def truncate_curve(time_p... | [
"numpy.log",
"numpy.sort",
"numpy.append",
"numpy.exp",
"numpy.prod",
"numpy.ediff1d"
] | [((524, 548), 'numpy.sort', 'np.sort', (['time_points_out'], {}), '(time_points_out)\n', (531, 548), True, 'import numpy as np\n'), ((773, 800), 'numpy.ediff1d', 'np.ediff1d', (['truncated_times'], {}), '(truncated_times)\n', (783, 800), True, 'import numpy as np\n'), ((389, 428), 'numpy.prod', 'np.prod', (['(time_hori... |
import heapq
import math
import numpy as np
from pyspark.broadcast import Broadcast
from brainex.classes.Sequence import Sequence
from brainex.misc import merge_dict, fd_workaround
from brainex.utils.ts_utils import lb_kim_sequence, lb_keogh_sequence, paa_compress, sax_compress
from brainex.utils.utils import get_trg... | [
"brainex.utils.ts_utils.lb_keogh_sequence",
"brainex.utils.utils.get_sequences_represented",
"heapq.heapify",
"brainex.utils.ts_utils.sax_compress",
"brainex.utils.utils.get_trgt_len_within_r",
"brainex.utils.ts_utils.lb_kim_sequence",
"brainex.utils.ts_utils.paa_compress",
"heapq.heappush",
"braine... | [((9031, 9058), 'heapq.heapify', 'heapq.heapify', (['target_reprs'], {}), '(target_reprs)\n', (9044, 9058), False, 'import heapq\n'), ((9788, 9814), 'heapq.heapify', 'heapq.heapify', (['c_dist_list'], {}), '(c_dist_list)\n', (9801, 9814), False, 'import heapq\n'), ((13848, 13911), 'brainex.utils.utils.get_sequences_rep... |
import cv2
import numpy as np
import time
# Creating an VideoCapture object
# This will be used for image acquisition later in the code.
cap = cv2.VideoCapture('video/detect.mp4')
if cap.isOpened:
print("your video is opened")
# We give some time for the camera to setup
time.sleep(3)
count = 0
background=0
# Ca... | [
"numpy.flip",
"cv2.bitwise_not",
"cv2.bitwise_and",
"cv2.cvtColor",
"cv2.waitKey",
"numpy.ones",
"time.sleep",
"cv2.VideoCapture",
"cv2.addWeighted",
"numpy.array",
"cv2.imshow",
"cv2.inRange"
] | [((145, 181), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""video/detect.mp4"""'], {}), "('video/detect.mp4')\n", (161, 181), False, 'import cv2\n'), ((278, 291), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (288, 291), False, 'import time\n'), ((431, 458), 'numpy.flip', 'np.flip', (['background'], {'axis': '(1)... |
import sys
import numpy
import scipy.linalg
import scipy.sparse
import pauxy.utils
import math
import time
import itertools
# from pauxy.utils.io import dump_qmcpack_cholesky
from pauxy.trial_wavefunction.free_electron import FreeElectron
try:
from pauxy.estimators.ueg_kernels import vq
from pauxy.estimators... | [
"numpy.sum",
"numpy.eye",
"numpy.dot",
"numpy.asarray",
"pauxy.trial_wavefunction.free_electron.FreeElectron",
"numpy.zeros",
"pauxy.trial_wavefunction.hartree_fock.HartreeFock",
"pauxy.estimators.ueg_kernels.vq",
"numpy.array",
"pauxy.systems.ueg.UEG",
"numpy.linspace",
"itertools.product",
... | [((460, 478), 'numpy.zeros', 'numpy.zeros', (['nmesh'], {}), '(nmesh)\n', (471, 478), False, 'import numpy\n'), ((504, 555), 'numpy.linspace', 'numpy.linspace', (['(-n)', 'n'], {'num': 'nmesh', 'dtype': 'numpy.int32'}), '(-n, n, num=nmesh, dtype=numpy.int32)\n', (518, 555), False, 'import numpy\n'), ((14089, 14130), 'p... |
from matplotlib.pyplot import figure, show
import numpy
fig = figure()
ax1 = fig.add_subplot(221)
ax2 = fig.add_subplot(222)
x = numpy.random.randn(20, 20)
#x[5] = 0.
#x[:, 12] = 0.
ax1.spy(x, markersize=5)
ax2.spy(x, precision=0.1, markersize=5)
show()
| [
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.random.randn"
] | [((63, 71), 'matplotlib.pyplot.figure', 'figure', ([], {}), '()\n', (69, 71), False, 'from matplotlib.pyplot import figure, show\n'), ((132, 158), 'numpy.random.randn', 'numpy.random.randn', (['(20)', '(20)'], {}), '(20, 20)\n', (150, 158), False, 'import numpy\n'), ((253, 259), 'matplotlib.pyplot.show', 'show', ([], {... |
from sgld_test.mcmc_convergance.cosnt import CHAIN_SIZE, SGLD_CHAIN_SIZE
__author__ = 'kcx'
import numpy as np
samples = np.load('./samples.npy')
last = samples[:,SGLD_CHAIN_SIZE-1]
print(last)
import seaborn as sns
sns.set(color_codes=True)
with sns.axes_style("white"):
pr = sns.jointplot(x=last[:,0], y=las... | [
"numpy.load",
"seaborn.axes_style",
"seaborn.plt.show",
"seaborn.jointplot",
"seaborn.set"
] | [((124, 148), 'numpy.load', 'np.load', (['"""./samples.npy"""'], {}), "('./samples.npy')\n", (131, 148), True, 'import numpy as np\n'), ((223, 248), 'seaborn.set', 'sns.set', ([], {'color_codes': '(True)'}), '(color_codes=True)\n', (230, 248), True, 'import seaborn as sns\n'), ((354, 368), 'seaborn.plt.show', 'sns.plt.... |
import numpy as np
import xarray as xr
from . import requires_dask
ntime = 500
nx = 50
ny = 50
class Reindex:
def setup(self):
data = np.random.RandomState(0).randn(ntime, nx, ny)
self.ds = xr.Dataset(
{"temperature": (("time", "x", "y"), data)},
coords={"time": np.arang... | [
"numpy.arange",
"numpy.random.RandomState"
] | [((151, 175), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)'], {}), '(0)\n', (172, 175), True, 'import numpy as np\n'), ((312, 328), 'numpy.arange', 'np.arange', (['ntime'], {}), '(ntime)\n', (321, 328), True, 'import numpy as np\n'), ((335, 348), 'numpy.arange', 'np.arange', (['nx'], {}), '(nx)\n', (344,... |
#!/usr/bin/env python
import numpy
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
def run(b, mo0=None, dm0=None):
mol = gto.Mole()
mol.build(
verbose = 5,
output = 'o2rhf-%3.2f.out' % b,
atom = [
['O', (0, 0, b/2)],
['O', (0, 0, -b/2)],],
... | [
"matplotlib.pyplot.show",
"pyscf.gto.Mole",
"matplotlib.pyplot.plot",
"pyscf.mcscf.project_init_guess",
"pyscf.mcscf.sort_mo",
"matplotlib.pyplot.legend",
"pyscf.mcscf.CASSCF",
"pyscf.scf.RHF",
"pyscf.scf.UHF",
"numpy.arange"
] | [((2285, 2325), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'erhf'], {'label': '"""ROHF,0.9->4.0"""'}), "(x, erhf, label='ROHF,0.9->4.0')\n", (2293, 2325), True, 'import matplotlib.pyplot as plt\n'), ((2326, 2366), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'euhf'], {'label': '"""UHF, 4.0->0.9"""'}), "(x, euhf, labe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.