code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# -*- coding: utf-8 -*- """ Created on Thu Mar 1 08:44:45 2018 @author: merit """ import pandas as pd import cx_Oracle import numpy as np import pickle from sklearn.cluster import KMeans import json import time class DataModel: def getDataMap(self, config): dataMap = {} for i in range(len(conf...
[ "sklearn.cluster.KMeans", "numpy.mean", "cx_Oracle.connect", "numpy.max", "numpy.array", "numpy.zeros", "pandas.DataFrame", "pandas.read_sql", "time.time" ]
[((1637, 1667), 'numpy.zeros', 'np.zeros', (['[len2 + 1, len1 + 1]'], {}), '([len2 + 1, len1 + 1])\n', (1645, 1667), True, 'import numpy as np\n'), ((4102, 4119), 'numpy.max', 'np.max', (['otherSims'], {}), '(otherSims)\n', (4108, 4119), True, 'import numpy as np\n'), ((5179, 5423), 'pandas.DataFrame', 'pd.DataFrame', ...
from pendulum.models import * from pendulum.models import _format_accelerations import numpy as np import pytest @pytest.mark.parametrize("input, exp_output", [ ((0, 0), (0, 0)), # Stable equilibrium ((np.pi, 0), (0, 0)) # Unstable equilibrium ]) def test_dpendulum(input, exp_output): ''' Test the equilib...
[ "pytest.approx", "pytest.mark.parametrize", "numpy.linspace" ]
[((115, 205), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""input, exp_output"""', '[((0, 0), (0, 0)), ((np.pi, 0), (0, 0))]'], {}), "('input, exp_output', [((0, 0), (0, 0)), ((np.pi, 0),\n (0, 0))])\n", (138, 205), False, 'import pytest\n'), ((3269, 3460), 'pytest.mark.parametrize', 'pytest.mark.param...
import numpy as np from scipy.integrate import ode from .name2idx import C, V from .set_model import diffeq, param_values, initial_values def solveode(diffeq, y0, tspan, args): sol = ode(diffeq) sol.set_integrator( 'vode', method='bdf', with_jacobian=True, min_step=1e-8 ) sol.set_initial_valu...
[ "numpy.array", "scipy.integrate.ode" ]
[((190, 201), 'scipy.integrate.ode', 'ode', (['diffeq'], {}), '(diffeq)\n', (193, 201), False, 'from scipy.integrate import ode\n'), ((647, 658), 'scipy.integrate.ode', 'ode', (['diffeq'], {}), '(diffeq)\n', (650, 658), False, 'from scipy.integrate import ode\n'), ((539, 550), 'numpy.array', 'np.array', (['T'], {}), '(...
#! /usr/bin/env python # ******************************************************************* # Author: <NAME> # Oct. 2019 # Copyright 2019, <NAME>, All rights reserved. # ******************************************************************* import numpy as np import sys import trajectory import copy import matplotlib.p...
[ "moveit_commander.PlanningSceneInterface", "numpy.array", "numpy.sin", "geometry_msgs.msg.Pose", "copy.copy", "numpy.arange", "moveit_msgs.msg.RobotState", "matplotlib.pyplot.plot", "numpy.ndenumerate", "rospy.sleep", "moveit_commander.RobotCommander", "sensor_msgs.msg.JointState", "rospy.Ti...
[((12185, 12227), 'numpy.array', 'np.array', (['[[0.0, 0.0, 0.5, 0.0, 0.0, 0.0]]'], {}), '([[0.0, 0.0, 0.5, 0.0, 0.0, 0.0]])\n', (12193, 12227), True, 'import numpy as np\n'), ((12244, 12286), 'numpy.array', 'np.array', (['[[0.2, 0.2, 0.2, 0.2, 0.2, 0.2]]'], {}), '([[0.2, 0.2, 0.2, 0.2, 0.2, 0.2]])\n', (12252, 12286), ...
"""Central module of the nodal package. Provides, among others, the classes meant for external usage: * Netlist: reads .csv files * Circuit: provides solve() method to compute electrical variables * Solution: printable object storing the computation results Example use case: from nodal import Circuit,...
[ "logging.basicConfig", "scipy.sparse.linalg.spsolve", "nodal.models.write_E", "numpy.linalg.solve", "nodal.models.write_VCVS", "logging.debug", "nodal.models.write_A", "nodal.models.write_CCVS", "nodal.models.write_CCCS", "nodal.models.write_R", "numpy.zeros", "scipy.sparse.dok_matrix", "csv...
[((682, 722), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.ERROR'}), '(level=logging.ERROR)\n', (701, 722), False, 'import logging\n'), ((1061, 1101), 'logging.debug', 'logging.debug', (['f"""ground node-> {ground}"""'], {}), "(f'ground node-> {ground}')\n", (1074, 1101), False, 'import logging...
import gym import random import keras import numpy as np from collections import deque from keras.models import Sequential from keras.layers import Dense def create_model(state_size,action_size): model=Sequential() model.add(Dense(24,input_dim=state_size,activation='relu')) model.add(Dense(24,activation='...
[ "keras.optimizers.Adam", "random.sample", "collections.deque", "numpy.random.rand", "random.randrange", "numpy.argmax", "keras.models.Sequential", "keras.layers.Dense", "gym.make" ]
[((208, 220), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (218, 220), False, 'from keras.models import Sequential\n'), ((506, 529), 'gym.make', 'gym.make', (['"""CartPole-v1"""'], {}), "('CartPole-v1')\n", (514, 529), False, 'import gym\n'), ((650, 668), 'collections.deque', 'deque', ([], {'maxlen': '(20...
import numpy as np import torch as t import torch.nn as nn from typing import Tuple class NBeatsBlock(nn.Module): """ N-BEATS block which takes a basis function as an argument. """ def __init__(self, n_inputs: int, theta_dim: int, basis: nn.Module, # n_static:int n_layers: int, n_hidde...
[ "torch.nn.ReLU", "torch.nn.Dropout", "numpy.arange", "torch.nn.Sequential", "torch.nn.BatchNorm1d", "numpy.zeros", "torch.nn.Parameter", "torch.einsum", "numpy.cos", "torch.nn.Linear", "numpy.sin", "torch.cat" ]
[((1190, 1212), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (1203, 1212), True, 'import torch.nn as nn\n'), ((4538, 4602), 'torch.einsum', 't.einsum', (['"""bp,pt->bt"""', 'theta[:, cut_point:]', 'self.backcast_basis'], {}), "('bp,pt->bt', theta[:, cut_point:], self.backcast_basis)\n", (45...
import io import csv import logging import requests import glob, os import numpy as np import pandas as pd from pathlib import Path from astropy.table import Table from astropy import units as u from astropy.time import Time from astropy.coordinates import SkyCoord import matplotlib.pyplot as plt # ["g", "r", "i", "z"...
[ "numpy.arange", "ipdb.set_trace", "numpy.digitize", "numpy.diff", "numpy.array", "numpy.sum", "numpy.isnan", "glob.glob", "astropy.table.Table.read" ]
[((3585, 3627), 'glob.glob', 'glob.glob', (['f"""{inpath}/*.forced.difflc.txt"""'], {}), "(f'{inpath}/*.forced.difflc.txt')\n", (3594, 3627), False, 'import glob, os\n'), ((1876, 1918), 'numpy.arange', 'np.arange', (['min_mjd', '(max_mjd + 1)', 'smooth_by'], {}), '(min_mjd, max_mjd + 1, smooth_by)\n', (1885, 1918), Tru...
""" TODO: some figure numberings (CHOICE, VERSION) were changed: make sure the current numberings are consistent with original runs TODO: replaces previous versions 161110, 171029 TODO: how to get the grid small log lines also for x-axis? TODO: mention that Python 3.5.2 or later is required (ideally 3.8) Plots times f...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.ylabel", "inference.linBP_symmetric_parameterized", "utils.to_centering_beliefs", "utils.replace_fraction_of_rows", "numpy.array", "estimation.estimateH", "estimation.estimateH_baseline_serial", "sys.path.append", "numpy.arange", "pandas.pivot_table",...
[((1241, 1267), 'sys.path.append', 'sys.path.append', (['"""../sslh"""'], {}), "('../sslh')\n", (1256, 1267), False, 'import sys\n'), ((2096, 2110), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (2103, 2110), True, 'import matplotlib as mpl\n'), ((2189, 2231), 'pandas.set_option', 'pd.set_option', (['"...
""" Functions and methods for performing solar radiation tests taken from the BSRN Global Network recommended QC tests, V2.0 https://bsrn.awi.de """ import warnings import numpy as np import dask.array as da from scipy.constants import Stefan_Boltzmann from act.utils.geo_utils import get_solar_azimuth_elevation fro...
[ "numpy.radians", "numpy.less", "numpy.greater", "act.utils.data_utils.convert_units", "warnings.catch_warnings", "numpy.nanmean", "dask.array.array", "act.utils.geo_utils.get_solar_azimuth_elevation", "dask.array.where", "warnings.filterwarnings" ]
[((1182, 1279), 'act.utils.geo_utils.get_solar_azimuth_elevation', 'get_solar_azimuth_elevation', ([], {'latitude': 'latitude', 'longitude': 'longitude', 'time': "obj['time'].values"}), "(latitude=latitude, longitude=longitude, time=\n obj['time'].values)\n", (1209, 1279), False, 'from act.utils.geo_utils import get...
import numpy as np import pandas as pd def ks_table(y, quantiles): """Function to produce a K-S table""" if len(set(y)) > 2: raise ValueError('Function only defined for binary classification') df = pd.concat([pd.Series(y), pd.Series(quantiles)], axis=1) df.columns = ['y', 'quantiles'] # ...
[ "pandas.Series", "numpy.abs", "pandas.concat" ]
[((709, 742), 'numpy.abs', 'np.abs', (['(pos_pct_cum - neg_pct_cum)'], {}), '(pos_pct_cum - neg_pct_cum)\n', (715, 742), True, 'import numpy as np\n'), ((776, 868), 'pandas.concat', 'pd.concat', (['[count_total, count_pos, count_neg, pos_pct_cum, neg_pct_cum, ks_idx]'], {'axis': '(1)'}), '([count_total, count_pos, coun...
#!/usr/bin/env python from fipy import * import math import numpy as np # nx = 100 L = 5.e-3 # Gap between needle and water surface (m) e = 1.6e-19 # Coulombic charge of an electron (C) eps = 8.85e-12 # Permittivity of free space (F/m) # dx = L/nx # mesh = Grid1D(nx=nx, dx=dx) # phi = CellVariable(name="Potential (V)"...
[ "numpy.exp", "numpy.fabs" ]
[((386, 401), 'numpy.fabs', 'np.fabs', (['Efield'], {}), '(Efield)\n', (393, 401), True, 'import numpy as np\n'), ((634, 661), 'numpy.exp', 'np.exp', (['(-1650.0 / EfieldMag)'], {}), '(-1650.0 / EfieldMag)\n', (640, 661), True, 'import numpy as np\n')]
import time import numpy as np import torch from torch.autograd import Variable from torch.nn import Parameter from torch.utils.data.sampler import SubsetRandomSampler from data_loader import libsvm_dataset from thrift_ps.ps_service import ParameterServer from thrift_ps.client import ps_client from thrift.transport...
[ "torch.nn.CrossEntropyLoss", "torch.max", "thrift_ps.client.ps_client.pull_model", "thrift_ps.client.ps_client.push_grad", "thrift_ps.client.ps_client.exist_model", "thrift.transport.TSocket.TSocket", "thrift.transport.TTransport.TBufferedTransport", "thrift_ps.client.ps_client.can_pull", "storage.s...
[((618, 629), 'time.time', 'time.time', ([], {}), '()\n', (627, 629), False, 'import time\n'), ((1824, 1851), 'thrift.transport.TSocket.TSocket', 'TSocket.TSocket', (['host', 'port'], {}), '(host, port)\n', (1839, 1851), False, 'from thrift.transport import TSocket\n'), ((1923, 1963), 'thrift.transport.TTransport.TBuff...
if __name__ == '__main__': from crossSection import sigma_real import numpy as np import pandas as pd import matplotlib.pyplot as plt import sys import random import warnings warnings.filterwarnings("ignore") plt.style.use('ja') from numpy.random import normal, sample Enu_TeV...
[ "numpy.sqrt", "numpy.power", "matplotlib.pyplot.style.use", "crossSection.sigma_real", "numpy.array", "warnings.filterwarnings" ]
[((207, 240), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (230, 240), False, 'import warnings\n'), ((245, 264), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ja"""'], {}), "('ja')\n", (258, 264), True, 'import matplotlib.pyplot as plt\n'), ((323, 340), 'numpy.ar...
import numpy as np from typing import Union def cleanup_delete(coords_list_in: np.ndarray, eps_grid: float = 1e-4, cyclic_points: bool = True, check_inline: bool = True, ) -> np.ndarray: """ From the passed coordinate list, returns a...
[ "numpy.abs", "numpy.roll", "numpy.full_like", "numpy.logical_and", "numpy.flipud", "numpy.logical_not", "numpy.logical_or", "numpy.column_stack", "numpy.sum", "numpy.linalg.norm", "numpy.gradient" ]
[((1374, 1409), 'numpy.roll', 'np.roll', (['coords_list_in', '(-1)'], {'axis': '(0)'}), '(coords_list_in, -1, axis=0)\n', (1381, 1409), True, 'import numpy as np\n'), ((1431, 1465), 'numpy.roll', 'np.roll', (['coords_list_in', '(1)'], {'axis': '(0)'}), '(coords_list_in, 1, axis=0)\n', (1438, 1465), True, 'import numpy ...
""" Name : c8_36_Fama_MecBeth_regression.py Book : Python for Finance (2nd ed.) Publisher: Packt Publishing Ltd. Author : <NAME> Date : 6/6/2017 email : <EMAIL> <EMAIL> """ import numpy as np import pandas as pd import statsmodels.api as sm from datetime import datetime # ...
[ "datetime.datetime", "pandas.fama_macbeth", "numpy.random.seed", "numpy.random.randn", "pandas.date_range" ]
[((329, 350), 'numpy.random.seed', 'np.random.seed', (['(12345)'], {}), '(12345)\n', (343, 350), True, 'import numpy as np\n'), ((360, 380), 'datetime.datetime', 'datetime', (['(2013)', '(1)', '(2)'], {}), '(2013, 1, 2)\n', (368, 380), False, 'from datetime import datetime\n'), ((394, 427), 'pandas.date_range', 'pd.dat...
import cv2 import numpy as np import pyautogui from matplotlib import pyplot as plt import time cap = cv2.VideoCapture(0) ct=0 ct1=0 time.sleep(5) while(1): # Take each frame _, frame = cap.read() # Convert BGR to HSV hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) # define range ...
[ "time.sleep", "cv2.imshow", "cv2.convexityDefects", "numpy.array", "cv2.destroyAllWindows", "cv2.threshold", "cv2.arcLength", "cv2.line", "cv2.contourArea", "cv2.waitKey", "cv2.minEnclosingCircle", "cv2.circle", "cv2.cvtColor", "cv2.moments", "cv2.GaussianBlur", "cv2.convexHull", "py...
[((109, 128), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (125, 128), False, 'import cv2\n'), ((143, 156), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (153, 156), False, 'import time\n'), ((2772, 2795), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (2793, 2795), False, ...
# -*- coding: utf-8 -*- """ Created on Thu Dec 31 12:46:30 2020 @author: mhayt """ import os from PIL import Image import random import string import tensorflow as tf import tensorflow_hub as hub import numpy as np def get_random_string(length): ''' creates random string of characters of defined length. ...
[ "os.listdir", "PIL.Image.open", "tensorflow.image.convert_image_dtype", "numpy.reshape", "tensorflow.image.resize", "random.choice", "os.rename", "tensorflow.io.read_file", "numpy.asarray", "os.path.splitext", "os.remove", "numpy.zeros", "tensorflow.config.list_physical_devices", "tensorfl...
[((1012, 1034), 'os.listdir', 'os.listdir', (['input_full'], {}), '(input_full)\n', (1022, 1034), False, 'import os\n'), ((1956, 1978), 'os.listdir', 'os.listdir', (['input_full'], {}), '(input_full)\n', (1966, 1978), False, 'import os\n'), ((2788, 2810), 'os.listdir', 'os.listdir', (['input_full'], {}), '(input_full)\...
# import sys from keras.layers.normalization import BatchNormalization from keras.layers.pooling import MaxPooling1D, AveragePooling1D from sklearn.ensemble.forest import RandomForestClassifier from pandas.core.frame import DataFrame from seaborn.matrix import heatmap # sys.path.insert(0, "/home/cirl/Amir/Human-Activit...
[ "keras.layers.pooling.MaxPooling1D", "keras.utils.vis_utils.plot_model", "tensorflow.set_random_seed", "DeepEEG.evaluation.compute_accuracy", "keras.layers.convolutional.Conv1D", "numpy.random.seed", "keras.callbacks.EarlyStopping", "tensorflow.ConfigProto", "tensorflow.get_default_graph", "keras....
[((970, 988), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (984, 988), True, 'import numpy as np\n'), ((1174, 1188), 'random.seed', 'rn.seed', (['(12345)'], {}), '(12345)\n', (1181, 1188), True, 'import random as rn\n'), ((1329, 1346), 'numpy.random.seed', 'np.random.seed', (['(3)'], {}), '(3)\n', (...
""" Implementation of DDPG - Deep Deterministic Policy Gradient Algorithm and hyperparameter details can be found here: http://arxiv.org/pdf/1509.02971v2.pdf The algorithm is tested on the Pendulum-v0 OpenAI gym task and developed with tflearn + Tensorflow Author: <NAME> """ import tensorflow as tf import num...
[ "replay_buffer.ReplayBuffer", "actor.predict", "tensorflow.set_random_seed", "tensorflow.app.run", "critic.action_gradients", "numpy.reshape", "actor.predict_target", "tensorflow.Session", "actor.train", "numpy.random.seed", "tensorflow.summary.scalar", "tensorflow.summary.merge_all", "criti...
[((1472, 1488), 'tensorflow.Variable', 'tf.Variable', (['(0.0)'], {}), '(0.0)\n', (1483, 1488), True, 'import tensorflow as tf\n'), ((1492, 1535), 'tensorflow.summary.scalar', 'tf.summary.scalar', (['"""Reward"""', 'episode_reward'], {}), "('Reward', episode_reward)\n", (1509, 1535), True, 'import tensorflow as tf\n'),...
import pandas as pd import numpy as np import pyrolite.geochem from ..util.log import Handle logger = Handle(__name__) def phasename(phaseID): """ Take a phase ID and return the name of the phase. Parameters ------------ phaseID : :class:`str` ID for the particular phase (e.g. 'olivine_0...
[ "pandas.DataFrame", "numpy.nancumsum", "pandas.isnull" ]
[((3906, 3996), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "(['pressure', 'temperature', 'step'] + phaseIDs)", 'index': 'idx.index'}), "(columns=['pressure', 'temperature', 'step'] + phaseIDs, index=\n idx.index)\n", (3918, 3996), True, 'import pandas as pd\n'), ((1881, 1932), 'pandas.DataFrame', 'pd.DataF...
from __future__ import print_function import torch from scipy.ndimage.filters import gaussian_filter import numpy as np from PIL import Image import math import cv2 import matplotlib.pyplot as plt import torch.nn.functional as functional import os from torch.autograd import Variable def load_heatmap(hm_path): hm_...
[ "scipy.ndimage.filters.gaussian_filter", "math.sqrt", "torch.from_numpy", "numpy.array", "numpy.logical_and.reduce", "os.walk", "os.path.exists", "numpy.mean", "os.listdir", "matplotlib.pyplot.plot", "numpy.max", "cv2.addWeighted", "os.path.isdir", "numpy.concatenate", "numpy.min", "to...
[((328, 344), 'numpy.load', 'np.load', (['hm_path'], {}), '(hm_path)\n', (335, 344), True, 'import numpy as np\n'), ((2324, 2358), 'numpy.transpose', 'np.transpose', (['hmp_numpy', '(1, 2, 0)'], {}), '(hmp_numpy, (1, 2, 0))\n', (2336, 2358), True, 'import numpy as np\n'), ((4444, 4473), 'numpy.zeros', 'np.zeros', ([], ...
#!/usr/bin/env python3 # coding=utf-8 from math import ceil, floor import librosa from librosa import display import numpy as np import pandas as pd import soundfile as sf from collections import namedtuple import re def load_csv(filename: str, sep=',') -> pd.DataFrame: # print('- loading %s' % filename) cs...
[ "soundfile.info", "librosa.amplitude_to_db", "collections.namedtuple", "math.ceil", "pandas.read_csv", "math.floor", "librosa.lpc", "numpy.fft.rfft", "librosa.display.specshow", "librosa.stft", "soundfile.read", "numpy.transpose", "re.search" ]
[((411, 506), 'collections.namedtuple', 'namedtuple', (['"""Signal"""', "['filename', 'info', 'sample_rate', 'tot_samples', 'tot_duration_ms']"], {}), "('Signal', ['filename', 'info', 'sample_rate', 'tot_samples',\n 'tot_duration_ms'])\n", (421, 506), False, 'from collections import namedtuple\n'), ((4190, 4321), 'c...
import sys import numpy as np X_TRAIN_PATH = sys.argv[1] Y_TRAIN_PATH = sys.argv[2] print("Running the File", sys.argv[0]) print("Directory 1: ", X_TRAIN_PATH) print("Directory 2: ", Y_TRAIN_PATH) ''' For Testing ''' ''' X_TRAIN_PATH = 'X_train' Y_TRAIN_PATH = 'Y_train' ''' X_train = np.genfromtxt(X_TRAIN_PATH, d...
[ "numpy.mean", "numpy.multiply", "numpy.sqrt", "numpy.log", "numpy.subtract", "numpy.exp", "numpy.sum", "numpy.zeros", "numpy.matmul", "numpy.std", "numpy.genfromtxt", "numpy.arange", "numpy.random.shuffle" ]
[((291, 348), 'numpy.genfromtxt', 'np.genfromtxt', (['X_TRAIN_PATH'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(X_TRAIN_PATH, delimiter=',', skip_header=1)\n", (304, 348), True, 'import numpy as np\n'), ((359, 416), 'numpy.genfromtxt', 'np.genfromtxt', (['Y_TRAIN_PATH'], {'delimiter': '""","""', 'skip_header':...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import ( print_function, division, absolute_import) from six.moves import xrange # ============================================================================= # Imports # =======================================================================...
[ "kamrecsys.datasets.load_movielens_mini", "numpy.testing.assert_equal", "numpy.arange", "os.path.join", "kamrecsys.data.EventData", "numpy.array", "numpy.empty_like", "numpy.testing.run_module_suite", "numpy.dtype", "numpy.genfromtxt", "numpy.testing.assert_array_equal" ]
[((1162, 1200), 'os.path.join', 'os.path.join', (['SAMPLE_PATH', '"""pci.event"""'], {}), "(SAMPLE_PATH, 'pci.event')\n", (1174, 1200), False, 'import os\n'), ((1213, 1262), 'numpy.dtype', 'np.dtype', (["[('event', 'U18', 2), ('score', float)]"], {}), "([('event', 'U18', 2), ('score', float)])\n", (1221, 1262), True, '...
import unittest import numpy as np from eig import Context, Bayes from eig.battleship import BattleshipHypothesisSpace class TestContext(unittest.TestCase): def test_observe(self): hs = BattleshipHypothesisSpace(grid_size=3, ship_labels=[1, 2], ship_sizes=[2, 3], orientations=['V', 'H'])...
[ "eig.Context", "numpy.zeros", "eig.Bayes", "eig.battleship.BattleshipHypothesisSpace" ]
[((201, 308), 'eig.battleship.BattleshipHypothesisSpace', 'BattleshipHypothesisSpace', ([], {'grid_size': '(3)', 'ship_labels': '[1, 2]', 'ship_sizes': '[2, 3]', 'orientations': "['V', 'H']"}), "(grid_size=3, ship_labels=[1, 2], ship_sizes=[2, 3\n ], orientations=['V', 'H'])\n", (226, 308), False, 'from eig.battlesh...
import mybayes as bayes import numpy as np from mybayes.influence import ProbTable, Normal from mybayes.settings import NumberOfSample from copy import deepcopy class TempCache(object): data = {} id_top = 0 def add(self, item): self.id_top+=1 self.data[self.id_top] = item return s...
[ "mybayes.remove_all_network", "mybayes.nfact.Constant", "mybayes.influence.generate_tnormal", "numpy.random.triangular", "mybayes.new_network", "mybayes.remove_network", "mybayes.nfact.MaxAddValue", "mybayes.nfact.TempNode", "mybayes.update", "mybayes.influence.ProbTable", "mybayes.influence.cal...
[((587, 613), 'mybayes.remove_all_network', 'bayes.remove_all_network', ([], {}), '()\n', (611, 613), True, 'import mybayes as bayes\n'), ((3326, 3340), 'mybayes.update', 'bayes.update', ([], {}), '()\n', (3338, 3340), True, 'import mybayes as bayes\n'), ((3410, 3438), 'mybayes.remove_network', 'bayes.remove_network', ...
import numpy as np from numba import jit import tensorflow as tf cB = np.array((0, 0, 0), dtype=np.float32) # --------- BOUNDARY c0 = np.array((255, 255, 255), dtype=np.float32) # --- STREET c1 = np.array((0, 0, 255), dtype=np.float32) # ------- HOUSE c2 = np.array((0, 255, 255), dtype=np.float32) # ----- LOW VEGE...
[ "numpy.trace", "tensorflow.get_variable", "tensorflow.pad", "tensorflow.contrib.layers.variance_scaling_initializer", "tensorflow.truncated_normal_initializer", "numpy.array", "numpy.nanmean", "tensorflow.reduce_mean", "tensorflow.image.resize_nearest_neighbor", "tensorflow.layers.conv2d", "tens...
[((71, 108), 'numpy.array', 'np.array', (['(0, 0, 0)'], {'dtype': 'np.float32'}), '((0, 0, 0), dtype=np.float32)\n', (79, 108), True, 'import numpy as np\n'), ((136, 179), 'numpy.array', 'np.array', (['(255, 255, 255)'], {'dtype': 'np.float32'}), '((255, 255, 255), dtype=np.float32)\n', (144, 179), True, 'import numpy ...
''' (c) University of Liverpool 2020 All rights reserved. @author: neilswainston ''' # pylint: disable=invalid-name # pylint: disable=no-member from ast import literal_eval as make_tuple import collections from functools import partial import json import sys from rdkit import Chem import matplotlib.pyplot as plt im...
[ "pandas.read_csv", "numpy.where", "numpy.empty", "pandas.DataFrame", "numpy.fromstring", "json.loads", "matplotlib.pyplot.savefig", "rdkit.Chem.GetPeriodicTable", "numpy.ones", "numpy.argmax", "numpy.any", "ast.literal_eval", "numpy.isnan", "pandas.Series", "numpy.subtract.outer", "num...
[((417, 438), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (428, 438), True, 'import pandas as pd\n'), ((1355, 1383), 'collections.defaultdict', 'collections.defaultdict', (['int'], {}), '(int)\n', (1378, 1383), False, 'import collections\n'), ((1409, 1453), 'functools.partial', 'partial', (['_...
import numpy as np from CNN.py import ConvolutionNN def TestForwardPass(): np.random.seed(0) data_size = np.random.randint(10, 50) for i in range(2,6): f_h, f_w = i, i # Filter height and width (m2, n2) padding, stride = i, i print('For filter with size : ({}, {})'.format(f_h...
[ "numpy.random.randint", "numpy.random.randn", "numpy.random.seed" ]
[((81, 98), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (95, 98), True, 'import numpy as np\n'), ((115, 140), 'numpy.random.randint', 'np.random.randint', (['(10)', '(50)'], {}), '(10, 50)\n', (132, 140), True, 'import numpy as np\n'), ((460, 483), 'numpy.random.randint', 'np.random.randint', (['(4)'...
# encoding: utf-8 # Author: <NAME> # License: MIT from numba import njit import numpy as np from .dataset import get_dataset from polylearn.kernels import anova_kernel, homogeneous_kernel @njit def _all_subsets_fast(output, X, P): n_samples_x = X.get_n_samples() output[:, :] = 1.0 for i1 in range(n_sampl...
[ "polylearn.kernels.anova_kernel", "numpy.dot", "polylearn.kernels.homogeneous_kernel", "numpy.ones" ]
[((678, 711), 'numpy.ones', 'np.ones', (['(X.shape[0], P.shape[0])'], {}), '((X.shape[0], P.shape[0]))\n', (685, 711), True, 'import numpy as np\n'), ((1286, 1301), 'numpy.dot', 'np.dot', (['K', 'lams'], {}), '(K, lams)\n', (1292, 1301), True, 'import numpy as np\n'), ((953, 979), 'polylearn.kernels.anova_kernel', 'ano...
#!/usr/bin/env python import math,operator,random,sys import numpy as np ####### #Probability Tools for DNA sequence analysis ####### def snr(observed,expected): return observed/expected def zscore(observed,expected): return (observed-expected)/math.sqrt(expected) def which_bin(bins, x, safe=0): """ ...
[ "random.uniform", "numpy.log", "math.sqrt", "math.log", "numpy.array", "numpy.cumsum", "math.exp" ]
[((2661, 2672), 'math.log', 'math.log', (['(2)'], {}), '(2)\n', (2669, 2672), False, 'import math, operator, random, sys\n'), ((3102, 3113), 'numpy.array', 'np.array', (['s'], {}), '(s)\n', (3110, 3113), True, 'import numpy as np\n'), ((3122, 3134), 'numpy.cumsum', 'np.cumsum', (['s'], {}), '(s)\n', (3131, 3134), True,...
""" Created on Friday 25 August 2017 Last update: Tuesday 26 December 2017 @author: <NAME> <EMAIL> Some functions to illustrate the convergence of the optimization algorithms for quadratic systems """ import sys sys.path.append('helpers/') from colors import colors_list import matplotlib.pyplot as plt import numpy a...
[ "numpy.reshape", "numpy.ones", "numpy.zeros_like", "matplotlib.pyplot.close", "sys.path.append", "matplotlib.pyplot.subplots", "numpy.arange" ]
[((215, 242), 'sys.path.append', 'sys.path.append', (['"""helpers/"""'], {}), "('helpers/')\n", (230, 242), False, 'import sys\n'), ((460, 475), 'numpy.ones', 'np.ones', (['(5, 1)'], {}), '((5, 1))\n', (467, 475), True, 'import numpy as np\n'), ((762, 794), 'numpy.reshape', 'np.reshape', (['eigenvalues', '(-1, 1)'], {}...
from typing import Tuple import numpy as np import torch import torch.nn as nn from rlcycle.common.abstract.action_selector import ActionSelector from rlcycle.common.utils.common_utils import np2tensor class SACActionSelector(ActionSelector): """Action selector for (vanilla) DDPG policy Attributes: ...
[ "rlcycle.common.abstract.action_selector.ActionSelector.__init__", "numpy.array", "torch.tanh", "rlcycle.common.utils.common_utils.np2tensor" ]
[((601, 640), 'rlcycle.common.abstract.action_selector.ActionSelector.__init__', 'ActionSelector.__init__', (['self', 'use_cuda'], {}), '(self, use_cuda)\n', (624, 640), False, 'from rlcycle.common.abstract.action_selector import ActionSelector\n'), ((704, 729), 'numpy.array', 'np.array', (['action_range[0]'], {}), '(a...
from matplotlib import style from matplotlib import ticker as mticker from matplotlib.finance import candlestick_ohlc from mpl_toolkits.mplot3d import Axes3D from sklearn.decomposition import PCA import datetime as dt import matplotlib.dates as dates import matplotlib.pyplot as plt import numpy as np import ...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.pcolormesh", "matplotlib.style.use", "numpy.arctan2", "matplotlib.ticker.MaxNLocator", "numpy.sin", "matplotlib.pyplot.subplot2grid", "numpy.arange", "sklearn.decomposition.PCA", "matplotlib.pypl...
[((372, 385), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (382, 385), True, 'import matplotlib.pyplot as plt\n'), ((424, 458), 'matplotlib.pyplot.hist2d', 'plt.hist2d', (['x', 'y', 'bin'], {'normed': 'norm'}), '(x, y, bin, normed=norm)\n', (434, 458), True, 'import matplotlib.pyplot as plt\n'), ((...
import h5py import numpy as np from torch.utils.data import Dataset from torchvision import transforms from data.vision_transform import ToTensor, Normalize, RandomCrop, CenterCrop, RandomHorizontalFlip from .datautils import prepare_input class LRW(Dataset): """ A custom dataset class for the LRW main (incl...
[ "numpy.random.choice", "data.vision_transform.RandomCrop", "data.vision_transform.ToTensor", "data.vision_transform.RandomHorizontalFlip", "h5py.File", "data.vision_transform.CenterCrop", "data.vision_transform.Normalize" ]
[((1259, 1286), 'h5py.File', 'h5py.File', (['self.h5file', '"""r"""'], {}), "(self.h5file, 'r')\n", (1268, 1286), False, 'import h5py\n'), ((1730, 1751), 'numpy.random.choice', 'np.random.choice', (['ixs'], {}), '(ixs)\n', (1746, 1751), True, 'import numpy as np\n'), ((839, 849), 'data.vision_transform.ToTensor', 'ToTe...
#_*_coding:utf-8_*_ import pandas as pd import numpy as np from docxtpl import DocxTemplate,InlineImage from docx import shared import os # have_content = False file = pd.ExcelFile("data\小于400三调精度.xlsx") df = file.parse("小于400三调精度") x_data = np.array(df) x_list = x_data.tolist() index = 0 while inde...
[ "os.path.exists", "docx.shared.Cm", "numpy.array", "pandas.ExcelFile", "docxtpl.DocxTemplate" ]
[((179, 215), 'pandas.ExcelFile', 'pd.ExcelFile', (['"""data\\\\小于400三调精度.xlsx"""'], {}), "('data\\\\小于400三调精度.xlsx')\n", (191, 215), True, 'import pandas as pd\n'), ((257, 269), 'numpy.array', 'np.array', (['df'], {}), '(df)\n', (265, 269), True, 'import numpy as np\n'), ((346, 371), 'docxtpl.DocxTemplate', 'DocxTempl...
# -*- coding: utf-8 -*- u""" Created on 2017-1-25 @author: cheng.li """ import unittest import copy import pickle import tempfile import os import numpy as np import pandas as pd from PyFin.Analysis.SeriesValues import SeriesValues class TestSecurityValues(unittest.TestCase): def testSecurityValuesInit(self): ...
[ "pandas.Series", "numpy.abs", "numpy.testing.assert_array_almost_equal", "pickle.dump", "pickle.load", "numpy.array", "numpy.random.randint", "tempfile.NamedTemporaryFile", "numpy.isnan", "os.unlink", "PyFin.Analysis.SeriesValues.SeriesValues", "copy.deepcopy", "numpy.dot", "numpy.random.r...
[((335, 354), 'numpy.array', 'np.array', (['[1, 2, 3]'], {}), '([1, 2, 3])\n', (343, 354), True, 'import numpy as np\n'), ((648, 686), 'numpy.array', 'np.array', (['[3, 2, np.nan, np.nan, 4, 5]'], {}), '([3, 2, np.nan, np.nan, 4, 5])\n', (656, 686), True, 'import numpy as np\n'), ((738, 763), 'PyFin.Analysis.SeriesValu...
import argparse import random import sys import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np def visualize_voxel(res: np.ndarray, color: str = "blue") -> None: """Visualize voxel data in the specified color. This function visualize voxel data. We can specify the voxel c...
[ "argparse.ArgumentParser", "matplotlib.pyplot.figure", "numpy.zeros", "sys.exit", "numpy.full", "numpy.load", "random.randint", "matplotlib.pyplot.show" ]
[((551, 621), 'numpy.full', 'np.full', (['(res.shape[0], res.shape[1], res.shape[2])', '"""blue"""'], {'dtype': 'str'}), "((res.shape[0], res.shape[1], res.shape[2]), 'blue', dtype=str)\n", (558, 621), True, 'import numpy as np\n'), ((655, 667), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (665, 667), Tr...
import pandas as pd pd.options.display.max_rows = 999 import numpy as np import poly_brute_force as poly def constraint_hamiltonian(qubo, num_problem_qubits, num_qubo_qubits): # construct constraint equations # auxiliary qubit a_ij = b_i b_j is enforced by # b_i b_j - 2 b_i a_ij - 2 b_j a_ij + 3 a_ij ...
[ "poly_brute_force.import_QUBO", "poly_brute_force.int_to_bin", "numpy.array", "numpy.zeros", "numpy.einsum", "sys.exit", "pandas.DataFrame" ]
[((2490, 2541), 'numpy.zeros', 'np.zeros', (['(num_qubo_qubits, num_qubo_qubits)', 'float'], {}), '((num_qubo_qubits, num_qubo_qubits), float)\n', (2498, 2541), True, 'import numpy as np\n'), ((2901, 2912), 'numpy.array', 'np.array', (['(0)'], {}), '(0)\n', (2909, 2912), True, 'import numpy as np\n'), ((5252, 5313), 'p...
#!/usr/bin/python import os, sys import json import numpy as np import re # GITHUB location: https://github.com/minogud2/ARC/blob/master/src/manual_solve.py ### YOUR CODE HERE: write at least three functions which solve ### specific tasks by transforming the input x and returning the ### result. Name them according ...
[ "numpy.unique", "numpy.where", "re.match", "os.path.join", "numpy.count_nonzero", "numpy.array", "numpy.nonzero", "numpy.all" ]
[((1340, 1352), 'numpy.unique', 'np.unique', (['x'], {}), '(x)\n', (1349, 1352), True, 'import numpy as np\n'), ((1361, 1428), 'numpy.where', 'np.where', (['(x == unique_values[0])', 'unique_values[1]', 'unique_values[0]'], {}), '(x == unique_values[0], unique_values[1], unique_values[0])\n', (1369, 1428), True, 'impor...
import pandas as pd import numpy as np import logging logger = logging.getLogger(__name__) FORMAT = "[%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s" logging.basicConfig(format=FORMAT) logger.setLevel(logging.ERROR) ################################ # wrangling methods used in: # - income_distribution.ipyn...
[ "logging.getLogger", "numpy.insert", "logging.basicConfig", "numpy.sum", "numpy.array", "numpy.cumsum", "numpy.add.reduceat" ]
[((64, 91), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (81, 91), False, 'import logging\n'), ((161, 195), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': 'FORMAT'}), '(format=FORMAT)\n', (180, 195), False, 'import logging\n'), ((1010, 1040), 'numpy.insert', 'np.insert', ...
from __future__ import print_function, division import os,unittest,numpy as np from pyscf.nao.m_fermi_dirac import fermi_dirac_occupations from pyscf.nao.m_fermi_energy import fermi_energy as get_fermi_energy class KnowValues(unittest.TestCase): def test_fermi_energy_spin_saturated(self): """ This is to test ...
[ "numpy.linspace", "unittest.main", "pyscf.nao.m_fermi_dirac.fermi_dirac_occupations", "pyscf.nao.m_fermi_energy.fermi_energy", "numpy.arange" ]
[((3964, 3979), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3977, 3979), False, 'import os, unittest, numpy as np\n'), ((365, 394), 'numpy.arange', 'np.arange', (['(-10.13)', '(100.0)', '(0.1)'], {}), '(-10.13, 100.0, 0.1)\n', (374, 394), True, 'import os, unittest, numpy as np\n'), ((475, 509), 'pyscf.nao.m_f...
#!/usr/bin/env python # vim: set fileencoding=utf-8 ts=4 sts=4 sw=4 et tw=80 : # # Second cut at astrometry fitting for UCD project. # # <NAME> # Created: 2021-08-30 # Last modified: 2021-08-30 #-------------------------------------------------------------------------- #*******************************************...
[ "logging.basicConfig", "numpy.copy", "logging.getLogger", "numpy.median", "numpy.radians", "numpy.abs", "scipy.optimize.fmin", "numpy.ones_like", "numpy.__version__.split", "theil_sen.linefit", "numpy.hypot", "numpy.array", "numpy.sum", "sys.stderr.write", "numpy.cos", "numpy.sin", "...
[((504, 543), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (523, 543), False, 'import logging\n'), ((553, 580), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (570, 580), False, 'import logging\n'), ((1632, 1655), 'numpy.median',...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import numpy as np import tensorflow as tf import cv2 from utils.misc import get_center Rectangle = collections.namedtuple('Rectangle', ['x', 'y', 'width', 'height']) def get_gauss_filter...
[ "tensorflow.tile", "numpy.sqrt", "tensorflow.shape", "tensorflow.layers.flatten", "tensorflow.transpose", "tensorflow.ifft2d", "numpy.array", "tensorflow.nn.softmax", "tensorflow.cast", "tensorflow.reduce_min", "numpy.mean", "numpy.exp", "tensorflow.concat", "numpy.stack", "tensorflow.mo...
[((232, 298), 'collections.namedtuple', 'collections.namedtuple', (['"""Rectangle"""', "['x', 'y', 'width', 'height']"], {}), "('Rectangle', ['x', 'y', 'width', 'height'])\n", (254, 298), False, 'import collections\n'), ((374, 401), 'numpy.indices', 'np.indices', (['(height, width)'], {}), '((height, width))\n', (384, ...
from __future__ import absolute_import, division, print_function import cv2 import numpy as np import six def figure(fnum=None, pnum=(1, 1, 1), title=None, figtitle=None, doclf=False, docla=False, projection=None, **kwargs): """ http://matplotlib.org/users/gridspec.html Args: fnum (int...
[ "matplotlib.pyplot.gca", "matplotlib.pyplot.gcf", "matplotlib.pyplot.colorbar", "io.BytesIO", "matplotlib.collections.LineCollection", "numpy.diag", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.figure", "matplotlib.transforms.Bbox.union", "cv2.cvtColor", "cv2.imdecode", "numpy.meshgrid",...
[((4081, 4090), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (4088, 4090), True, 'from matplotlib import pyplot as plt\n'), ((4815, 4841), 'matplotlib.pyplot.colorbar', 'plt.colorbar', (['aximg'], {'ax': 'ax'}), '(aximg, ax=ax)\n', (4827, 4841), True, 'from matplotlib import pyplot as plt\n'), ((7228, 7262), '...
import os import numpy from amuse.units import units this_dir, this_filename = os.path.split(__file__) if this_dir == "": this_dir = "." instrument = "WFPC_II_WFC3" data_dir = this_dir + "/data/" + instrument + "/" f = open(data_dir + "ciexyz31.csv","r") lines = f.readlines() cielam = [] | units.nano...
[ "numpy.array", "amuse.units.units.nano", "os.path.split" ]
[((82, 105), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (95, 105), False, 'import os\n'), ((570, 584), 'numpy.array', 'numpy.array', (['x'], {}), '(x)\n', (581, 584), False, 'import numpy\n'), ((591, 605), 'numpy.array', 'numpy.array', (['y'], {}), '(y)\n', (602, 605), False, 'import numpy\n'...
import numpy import sys def main(): if len(sys.argv) != 3: print(sys.argv) print('There are two arguments: input output') return with open(sys.argv[1], 'rb') as fp: b = fp.read() b = b[0x280:] b = b[:512] b = list(map(lambda x: numpy.uint8(x), b)) counter ...
[ "numpy.uint8" ]
[((462, 476), 'numpy.uint8', 'numpy.uint8', (['(5)'], {}), '(5)\n', (473, 476), False, 'import numpy\n'), ((288, 302), 'numpy.uint8', 'numpy.uint8', (['x'], {}), '(x)\n', (299, 302), False, 'import numpy\n'), ((592, 606), 'numpy.uint8', 'numpy.uint8', (['(1)'], {}), '(1)\n', (603, 606), False, 'import numpy\n')]
# -*- coding: utf-8 -*- import json import numpy as np import pandas as pd import sklearn from sklearn.preprocessing import LabelEncoder, OneHotEncoder from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn.preprocessing import PolynomialFeatures from sklear...
[ "sklearn.preprocessing.LabelEncoder", "sklearn.ensemble.RandomForestRegressor", "sklearn.metrics.r2_score", "sklearn.tree.DecisionTreeRegressor", "pandas.read_csv", "sklearn.linear_model.LassoCV", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.OneHotEncoder", "numpy.asarray", "...
[((648, 680), 'pandas.HDFStore', 'pd.HDFStore', (['"""processed_data.h5"""'], {}), "('processed_data.h5')\n", (659, 680), True, 'import pandas as pd\n'), ((1170, 1188), 'numpy.random.seed', 'np.random.seed', (['(60)'], {}), '(60)\n', (1184, 1188), True, 'import numpy as np\n'), ((1254, 1291), 'pandas.read_csv', 'pd.rea...
# Copyright (c) 2016, <NAME> # Licensed under the BSD 3-clause license (see LICENSE) # This file was modified from the GPy project. Its file header is replicated # below. Its LICENSE.txt is replicated in the LICENSE file for this directory. # Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt). # Licensed under th...
[ "numpy.ma.masked_invalid" ]
[((601, 636), 'numpy.ma.masked_invalid', 'np.ma.masked_invalid', (['Y'], {'copy': '(False)'}), '(Y, copy=False)\n', (621, 636), True, 'import numpy as np\n')]
"""Analysis classification result data.""" import os import pandas as pd import numpy as np import matplotlib.pyplot as plt def get_csv_files(path): path = os.path.abspath(path) results = [os.path.join(path, file) for file in os.listdir(path) if file.endswith('.csv')] print(results) return results ...
[ "os.listdir", "pandas.DataFrame", "pandas.read_csv", "matplotlib.pyplot.plot", "os.path.join", "numpy.argmax", "os.path.basename", "os.path.abspath", "matplotlib.pyplot.show" ]
[((163, 184), 'os.path.abspath', 'os.path.abspath', (['path'], {}), '(path)\n', (178, 184), False, 'import os\n'), ((359, 394), 'pandas.read_csv', 'pd.read_csv', (['file_name'], {'index_col': '(0)'}), '(file_name, index_col=0)\n', (370, 394), True, 'import pandas as pd\n'), ((2100, 2110), 'matplotlib.pyplot.show', 'plt...
# cd/d C:\Python27 & for /l %x in (1176291, 1, 1180590) do ( # python "C:\Users\Public\Documents\ShalabyGroup\Aimsun Controller\RunSeveralReplications.py" -aconsolePath "C:\Program Files\Aimsun\Aimsun Next 8.3\aconsole.exe" -modelPath "C:\Users\Public\Documents\ShalabyGroup\TSP-Louis\finchTSPs_3 intx_west_Subnetwor...
[ "subprocess.Popen", "numpy.load", "random.randint", "socket.socket" ]
[((943, 992), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (956, 992), False, 'import socket\n'), ((1183, 1325), 'subprocess.Popen', 'Popen', (['[\'"aconsole.exe"\', \'-v\', \'-log\', \'-project\', AIMSUNU_MODEL_PATH, \'-cmd\',\n \'execut...
from ray.rllib.offline.estimators.off_policy_estimator import OffPolicyEstimate from ray.rllib.offline.estimators.direct_method import DirectMethod, k_fold_cv from ray.rllib.utils.annotations import DeveloperAPI, override from ray.rllib.utils.typing import SampleBatchType from ray.rllib.policy.sample_batch import Sampl...
[ "ray.rllib.offline.estimators.direct_method.k_fold_cv", "numpy.arange", "ray.rllib.utils.annotations.override", "numpy.zeros", "ray.rllib.utils.numpy.convert_to_numpy", "ray.rllib.policy.sample_batch.SampleBatch.concat_samples" ]
[((565, 587), 'ray.rllib.utils.annotations.override', 'override', (['DirectMethod'], {}), '(DirectMethod)\n', (573, 587), False, 'from ray.rllib.utils.annotations import DeveloperAPI, override\n'), ((880, 918), 'ray.rllib.offline.estimators.direct_method.k_fold_cv', 'k_fold_cv', (['batch', 'self.k', 'should_train'], {}...
import math import numpy as np import pandas as pd import scipy.ndimage as ndi import tensorflow as tf import tqdm from scipy.ndimage.morphology import binary_erosion from data_kits import nf_kits from data_kits import np_ops, tf_ops _data_cache = None def loads(opt, logger, set_key): data_list = nf_kits.load_...
[ "numpy.clip", "data_kits.tf_ops.gen_guide_3d", "data_kits.nf_kits.load_split", "tensorflow.shape", "tensorflow.split", "numpy.array", "data_kits.nf_kits.load_extra_data_paths", "tensorflow.cast", "scipy.ndimage.zoom", "numpy.arange", "numpy.random.RandomState", "numpy.where", "tensorflow.py_...
[((307, 344), 'data_kits.nf_kits.load_split', 'nf_kits.load_split', (['set_key', 'opt.fold'], {}), '(set_key, opt.fold)\n', (325, 344), False, 'from data_kits import nf_kits\n'), ((3065, 3099), 'numpy.zeros', 'np.zeros', (['(3, 3, 3)'], {'dtype': 'np.bool'}), '((3, 3, 3), dtype=np.bool)\n', (3073, 3099), True, 'import ...
### Libraries # Standard libraries import numpy as np # Third-party libraries import skfuzzy as fuzz import matplotlib.pyplot as plt def visualize_mf(b, inputs): fig, (ax0, ax1, ax2) = plt.subplots(nrows=3, figsize=(8, 5)) ax0.plot(inputs[0], b[0][0], 'g', linewidth=1.5, label= '-ve Medium') ax0.plot(inp...
[ "skfuzzy.interp_membership", "matplotlib.pyplot.tight_layout", "numpy.zeros_like", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((192, 229), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': '(3)', 'figsize': '(8, 5)'}), '(nrows=3, figsize=(8, 5))\n', (204, 229), True, 'import matplotlib.pyplot as plt\n'), ((1689, 1707), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (1705, 1707), True, 'import matplotlib.py...
import keras import numpy as np import os from glob import glob # Utility Functions def get_list_IDs(any_path, val_split = 0.8): ''' param any_path: directory to either the align files or the .mpg files; i.e. s1_path or s1_align ''' id_list =[os.path.splitext(file)[0] for file in os.list...
[ "os.listdir", "os.path.splitext", "numpy.array", "glob.glob", "numpy.random.shuffle" ]
[((1061, 1105), 'glob.glob', 'glob', (["(align_path + '*.align')"], {'recursive': '(True)'}), "(align_path + '*.align', recursive=True)\n", (1065, 1105), False, 'from glob import glob\n'), ((275, 297), 'os.path.splitext', 'os.path.splitext', (['file'], {}), '(file)\n', (291, 297), False, 'import os\n'), ((313, 333), 'o...
# -*- coding: utf-8 -*- """Testing the covariance matrix class. """ import shutil import pytest import numpy as np import scipy as sp import os from tempfile import mkstemp from typhon.arts.covariancematrix import Block, CovarianceMatrix from typhon.arts.xml import load, save class TestCovarianceMatrix: def setu...
[ "typhon.arts.xml.load", "numpy.random.normal", "typhon.arts.covariancematrix.CovarianceMatrix", "numpy.allclose", "os.close", "typhon.arts.xml.save", "scipy.sparse.identity", "tempfile.mkstemp", "os.remove" ]
[((382, 391), 'tempfile.mkstemp', 'mkstemp', ([], {}), '()\n', (389, 391), False, 'from tempfile import mkstemp\n'), ((400, 412), 'os.close', 'os.close', (['fd'], {}), '(fd)\n', (408, 412), False, 'import os\n'), ((620, 646), 'typhon.arts.covariancematrix.CovarianceMatrix', 'CovarianceMatrix', (['[b1, b2]'], {}), '([b1...
#!/usr/bin/python # -*- coding: utf-8 -*- # Author: <NAME> <<EMAIL>> # License: BSD 3 clause __all__ = [ 'pipeline'] import pandas as pd import numpy as np from collections import OrderedDict from tools import sizeof_file from sklearn import preprocessing class Define(): """Define module. Parameters ...
[ "sklearn.preprocessing.LabelEncoder", "pandas.read_csv", "numpy.ravel", "tools.sizeof_file", "pandas.DataFrame", "pandas.concat" ]
[((2257, 2284), 'tools.sizeof_file', 'sizeof_file', (['self.data_path'], {}), '(self.data_path)\n', (2268, 2284), False, 'from tools import sizeof_file\n'), ((2412, 2497), 'pandas.DataFrame', 'pd.DataFrame', (['[self.describe]'], {'columns': "['name', 'n_features', 'samples', 'size']"}), "([self.describe], columns=['na...
import numpy as np import pandas as pd import os import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from matplotlib.ticker import LinearLocator import seaborn as sns from operator import itemgetter import matplotlib.ticker as ticker import math import matplotlib.patches as patches #run correla...
[ "matplotlib.ticker.NullFormatter", "matplotlib.use", "matplotlib.pyplot.gcf", "matplotlib.pyplot.gca", "seaborn.set_context", "os.path.join", "math.log", "matplotlib.pyplot.close", "numpy.tril", "matplotlib.patches.Patch", "pandas.DataFrame", "operator.itemgetter", "matplotlib.pyplot.legend"...
[((67, 90), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (81, 90), False, 'import matplotlib\n'), ((1049, 1074), 'numpy.tril', 'np.tril', (['cor.values'], {'k': '(-1)'}), '(cor.values, k=-1)\n', (1056, 1074), True, 'import numpy as np\n'), ((1216, 1246), 'pandas.DataFrame', 'pd.DataFrame', ...
# Copyright 2018 <NAME> # # Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or # http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or # http://opensource.org/licenses/MIT>, at your option. This file may not be # copied, modified, or distributed except according to those terms. '''...
[ "ctypes.c_uint32", "numpy.empty", "ctypes.c_double", "numpy.ctypeslib.load_library", "numpy.ctypeslib.as_ctypes" ]
[((1815, 1855), 'numpy.empty', 'np.empty', (['((n_max + 1) * (n_max + 2) // 2)'], {}), '((n_max + 1) * (n_max + 2) // 2)\n', (1823, 1855), True, 'import numpy as np\n'), ((1692, 1725), 'numpy.ctypeslib.load_library', 'ctl.load_library', (['libname', 'libdir'], {}), '(libname, libdir)\n', (1708, 1725), True, 'import num...
import tvm from tvm import target import tvm.relay as relay import tvm.relay.op.nn as nn import tvm.relay.analysis.call_graph as cg import tvm.relay.analysis.analysis as an import tvm._ffi.registry as registry import tensorflow as tf import tensorflow.keras as keras import numpy as np import os from tvm import relay, a...
[ "tvm.target.target.micro", "numpy.ones", "tvm.auto_scheduler.extract_tasks", "tvm.relay.build", "tvm.transform.PassContext", "tvm.auto_scheduler.RecordToFile", "tvm.auto_scheduler.ApplyHistoryBest", "tvm.auto_scheduler.LocalRunner", "tvm.relay.frontend.from_keras", "numpy.zeros", "tensorflow.ker...
[((436, 446), 'tvm.cpu', 'tvm.cpu', (['(0)'], {}), '(0)\n', (443, 446), False, 'import tvm\n'), ((566, 605), 'tvm.target.Target', 'tvm.target.Target', (['"""llvm -mcpu=skylake"""'], {}), "('llvm -mcpu=skylake')\n", (583, 605), False, 'import tvm\n'), ((636, 679), 'tensorflow.keras.models.load_model', 'keras.models.load...
from collections import defaultdict, Counter import numpy as np import tensorflow as tf from capreolus import ConfigOption, Dependency, constants, get_logger from capreolus.utils.common import padlist from capreolus.utils.exceptions import MissingDocError from . import Extractor from .common import load_pretrained_e...
[ "capreolus.utils.common.padlist", "capreolus.Dependency", "capreolus.get_logger", "tensorflow.train.Int64List", "capreolus.ConfigOption", "capreolus.utils.exceptions.MissingDocError", "numpy.array", "numpy.zeros", "tensorflow.io.FixedLenFeature", "collections.defaultdict", "tensorflow.train.Floa...
[((340, 360), 'capreolus.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (350, 360), False, 'from capreolus import ConfigOption, Dependency, constants, get_logger\n'), ((502, 560), 'capreolus.Dependency', 'Dependency', ([], {'key': '"""benchmark"""', 'module': '"""benchmark"""', 'name': 'None'}), "(key='...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 1 22:13:08 2021 @author: tavastm1 """ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Aug 20 21:35:25 2021 @author: tavastm1 """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from co...
[ "pandas.Series", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "pandas.read_csv", "numpy.arange", "matplotlib.pyplot.xticks", "numpy.std", "matplotlib.pyplot.figlegend", "matplotlib.pyplot.style.use", "collections.Counter", "matplotlib.pyplot.figure", "matplotlib.pyplot.bar", "matpl...
[((388, 428), 'pandas.read_csv', 'pd.read_csv', (['"""HumanData/PANAS_SESOI.csv"""'], {}), "('HumanData/PANAS_SESOI.csv')\n", (399, 428), True, 'import pandas as pd\n'), ((885, 896), 'pandas.Series', 'pd.Series', ([], {}), '()\n', (894, 896), True, 'import pandas as pd\n'), ((3551, 3563), 'matplotlib.pyplot.figure', 'p...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Downloads the losses from tensorboard and saves into --dst-folder. Then it smooths the losses and saves the best ones into a CSV file. ''' from __future__ import ( division, absolute_import, print_function, unicode_literals ) import argparse import csv import o...
[ "os.listdir", "pickle.dump", "csv.DictReader", "os.makedirs", "argparse.ArgumentParser", "numpy.ones", "numpy.convolve", "os.path.join" ]
[((414, 465), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train model."""'}), "(description='Train model.')\n", (437, 465), False, 'import argparse\n'), ((1528, 1571), 'os.makedirs', 'os.makedirs', (['args.dst_folder'], {'exist_ok': '(True)'}), '(args.dst_folder, exist_ok=True)\n', (1...
import numpy as np import cv2 from matplotlib import pyplot as plt imgInPath='D:/vaa3d_tools/hackathon/wpkenan/DN_data20181019/1.png'; imgOutPath=imgInPath.split('.')[0]+"_waterShed"+"."+imgInPath.split('.')[1]; img = cv2.imread(imgInPath) gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(gra...
[ "numpy.uint8", "cv2.imwrite", "numpy.ones", "cv2.threshold", "cv2.imshow", "cv2.morphologyEx", "cv2.waitKey", "cv2.distanceTransform", "cv2.connectedComponents", "cv2.cvtColor", "cv2.destroyAllWindows", "cv2.dilate", "cv2.subtract", "cv2.imread", "cv2.watershed" ]
[((219, 240), 'cv2.imread', 'cv2.imread', (['imgInPath'], {}), '(imgInPath)\n', (229, 240), False, 'import cv2\n'), ((248, 285), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2GRAY'], {}), '(img, cv2.COLOR_BGR2GRAY)\n', (260, 285), False, 'import cv2\n'), ((303, 371), 'cv2.threshold', 'cv2.threshold', (['gray'...
""" =========== Multicursor =========== Showing a cursor on multiple plots simultaneously. This example generates two subplots and on hovering the cursor over data in one subplot, the values of that datapoint are shown in both respectively. """ import numpy as np import matplotlib.pyplot as plt from matplotlib.widget...
[ "matplotlib.widgets.MultiCursor", "numpy.sin", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.show" ]
[((346, 371), 'numpy.arange', 'np.arange', (['(0.0)', '(2.0)', '(0.01)'], {}), '(0.0, 2.0, 0.01)\n', (355, 371), True, 'import numpy as np\n'), ((377, 398), 'numpy.sin', 'np.sin', (['(2 * np.pi * t)'], {}), '(2 * np.pi * t)\n', (383, 398), True, 'import numpy as np\n'), ((400, 421), 'numpy.sin', 'np.sin', (['(4 * np.pi...
from pathlib import Path import numpy as np import torch def get_app_name(filename: str) -> str: idx1 = filename.find(":") + 4 idx2 = filename.find("_fetched_") return filename[idx1:idx2] def is_random(filename: str) -> bool: return "_rand" in filename def get_parameter(filename: str, param: str) -> ...
[ "pathlib.Path", "torch.load", "numpy.array", "numpy.sum", "torch.save" ]
[((2624, 2648), 'numpy.array', 'np.array', (['attribute_list'], {}), '(attribute_list)\n', (2632, 2648), True, 'import numpy as np\n'), ((2760, 2782), 'numpy.sum', 'np.sum', (['(init_times > 0)'], {}), '(init_times > 0)\n', (2766, 2782), True, 'import numpy as np\n'), ((660, 679), 'pathlib.Path', 'Path', (['high_load_d...
import os import cv2 import json import pandas as pd import numpy as np from glob import glob from tqdm import tqdm from IPython import embed import base64 from labelme import utils image_path = "./images/" csv_file = "./train_labels.csv" annotations = pd.read_csv(csv_file,header=None).values total_csv_annotations = {...
[ "pandas.read_csv", "base64.b64encode", "numpy.array", "numpy.concatenate", "cv2.imread" ]
[((254, 288), 'pandas.read_csv', 'pd.read_csv', (['csv_file'], {'header': 'None'}), '(csv_file, header=None)\n', (265, 288), True, 'import pandas as pd\n'), ((407, 433), 'numpy.array', 'np.array', (['[annotation[1:]]'], {}), '([annotation[1:]])\n', (415, 433), True, 'import numpy as np\n'), ((515, 574), 'numpy.concaten...
import os import sys import hlt import numpy as np WIDTH = 50 HEIGHT = 50 myID, gameMap = getInit() # Make sure not to produce stderr when loading the model backup = sys.stderr with open('err.log', 'w') as sys.stderr: from keras.models import load_model model = load_model('model.h5') model.predict(np.ran...
[ "numpy.random.normal", "keras.models.load_model", "numpy.array", "numpy.pad", "numpy.transpose", "numpy.arange" ]
[((273, 295), 'keras.models.load_model', 'load_model', (['"""model.h5"""'], {}), "('model.h5')\n", (283, 295), False, 'from keras.models import load_model\n'), ((464, 556), 'numpy.array', 'np.array', (['[[(x.owner, x.production, x.strength) for x in row] for row in frame.contents]'], {}), '([[(x.owner, x.production, x....
import unittest import os import datetime as dt import netCDF4 import numpy as np from forest import (eida50, satellite, navigate) from forest.exceptions import FileNotFound, IndexNotFound class TestLocator(unittest.TestCase): def setUp(self): self.paths = [] self.pattern = "test-eida50*.nc" ...
[ "datetime.datetime", "forest.satellite.Locator", "os.path.exists", "forest.navigate.FileSystem.file_type", "netCDF4.Dataset", "forest.eida50.Coordinates", "datetime.datetime.now", "datetime.timedelta", "netCDF4.date2num", "numpy.testing.assert_array_equal", "os.remove" ]
[((338, 369), 'forest.satellite.Locator', 'satellite.Locator', (['self.pattern'], {}), '(self.pattern)\n', (355, 369), False, 'from forest import eida50, satellite, navigate\n'), ((632, 655), 'datetime.datetime', 'dt.datetime', (['(2019)', '(1)', '(1)'], {}), '(2019, 1, 1)\n', (643, 655), True, 'import datetime as dt\n...
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import preprocessing class Architechture(): def __init__(self, pattern, output, eta, mi, alpha, iterations, epslon): self.pattern = pattern self.output = output self.eta = eta self.mi = mi ...
[ "numpy.sum", "numpy.zeros", "numpy.tril", "numpy.random.uniform", "numpy.transpose", "numpy.amax", "sklearn.preprocessing.scale", "numpy.random.shuffle" ]
[((423, 444), 'numpy.zeros', 'np.zeros', (['self.output'], {}), '(self.output)\n', (431, 444), True, 'import numpy as np\n'), ((468, 523), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(0.01)', '[self.pattern, self.output]'], {}), '(0, 0.01, [self.pattern, self.output])\n', (485, 523), True, 'import numpy as n...
from __future__ import division from skimage import img_as_float, io from skimage.filters import threshold_otsu import numpy as np def quantize(image, L=1, N=4): """Quantize an image. Parameters ---------- image : array_like Input image. L : float Maximum input value. N : int ...
[ "numpy.random.normal", "skimage.filters.threshold_otsu", "numpy.digitize", "numpy.sum", "skimage.io.imread", "numpy.linspace", "numpy.zeros_like", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((2782, 2841), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)', '(3)'], {'subplot_kw': "{'xticks': [], 'yticks': []}"}), "(2, 3, subplot_kw={'xticks': [], 'yticks': []})\n", (2794, 2841), True, 'import matplotlib.pyplot as plt\n'), ((3548, 3558), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3556, 355...
import numpy as np import dolfin as df import matplotlib.pyplot as plt def column_chart(results, solvers, preconditioners, offset=None, ymax=10): slowest = results.max(0) fastest = results.min(0) default = results[0] no_prec = results[1] fig = plt.figure(figsize=(8, 4)) ax = fig.add_subplot(11...
[ "matplotlib.pyplot.setp", "matplotlib.pyplot.savefig", "numpy.ma.load", "dolfin.krylov_solver_methods", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "dolfin.krylov_solver_preconditioners" ]
[((266, 292), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 4)'}), '(figsize=(8, 4))\n', (276, 292), True, 'import matplotlib.pyplot as plt\n'), ((1351, 1384), 'matplotlib.pyplot.setp', 'plt.setp', (['ax'], {'xticklabels': 'solvers'}), '(ax, xticklabels=solvers)\n', (1359, 1384), True, 'import matplot...
from nose.tools import assert_equal from nose.tools import assert_false from nose.tools import assert_in from nose.tools import assert_raises from nose.tools import assert_true import networkx as nx import numpy as np import dagology as dag class TestCausalSet(object): """ Unit tests for the causal set model""" ...
[ "nose.tools.assert_equal", "numpy.random.random", "nose.tools.assert_true", "numpy.array", "dagology.minkowski_interval", "dagology.causal_set_graph", "dagology.de_sitter_interval" ]
[((397, 421), 'numpy.random.random', 'np.random.random', (['(N, D)'], {}), '((N, D))\n', (413, 421), True, 'import numpy as np\n'), ((675, 699), 'numpy.random.random', 'np.random.random', (['(N, D)'], {}), '((N, D))\n', (691, 699), True, 'import numpy as np\n'), ((712, 740), 'dagology.causal_set_graph', 'dag.causal_set...
import numpy as np import time import matplotlib.pyplot as plt import visdom # find the minimum of y # y = x^2 + x + 1 # y' = 2x + 1 # y'' = 2 x0 = 91.91 g = 2*x0 + 1 # f'(x0) gg = 2 # f''(x0) while abs(g) > 0.001: # update x0 x0 = -g/gg + x0 # update one order partial g = 2*x0 + 1 # update ...
[ "numpy.array", "numpy.linalg.inv", "time.sleep", "numpy.linalg.norm" ]
[((722, 740), 'numpy.linalg.norm', 'np.linalg.norm', (['g0'], {}), '(g0)\n', (736, 740), True, 'import numpy as np\n'), ((747, 785), 'numpy.array', 'np.array', (['[[p_xx, p_xy], [p_yx, p_yy]]'], {}), '([[p_xx, p_xy], [p_yx, p_yy]])\n', (755, 785), True, 'import numpy as np\n'), ((1150, 1168), 'numpy.linalg.norm', 'np.l...
import sys import unittest from itertools import product import numpy as np import torch from metal.label_model.class_balance import ClassBalanceModel sys.path.append("../synthetic") class ClassBalanceModelTest(unittest.TestCase): def _set_seed(self, seed): torch.manual_seed(seed) np.random.see...
[ "torch.manual_seed", "numpy.abs", "metal.label_model.class_balance.ClassBalanceModel", "numpy.eye", "numpy.random.random", "torch.from_numpy", "numpy.array", "numpy.zeros", "numpy.einsum", "numpy.random.seed", "unittest.main", "sys.path.append" ]
[((154, 185), 'sys.path.append', 'sys.path.append', (['"""../synthetic"""'], {}), "('../synthetic')\n", (169, 185), False, 'import sys\n'), ((4640, 4655), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4653, 4655), False, 'import unittest\n'), ((275, 298), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}),...
import torch import numpy as np import pandas as pd import os import re import seaborn as sns import json import itertools import pandas as pd import torch import pandas_market_calendars as mcal import datetime from torch.utils.data import Dataset, DataLoader from tqdm import tqdm class StockDataset(Dataset): """...
[ "torch.is_tensor", "numpy.zeros", "torch.zeros", "torch.ones" ]
[((1113, 1144), 'numpy.zeros', 'np.zeros', (['(n_stocks, n_days, 3)'], {}), '((n_stocks, n_days, 3))\n', (1121, 1144), True, 'import numpy as np\n'), ((1996, 2040), 'torch.ones', 'torch.ones', (['(self.n_days - 7, self.n_stocks)'], {}), '((self.n_days - 7, self.n_stocks))\n', (2006, 2040), False, 'import torch\n'), ((2...
import os import numpy as np import matplotlib.pyplot as plt def func(external_proc_num, internal_proc_num, Matrix): for e in range(0, external_proc_num): for i in range(0, internal_proc_num): cmd = './heatmap.out ' + str(e) + ' ' + str(i) # print(cmd, sep = '\n') so = os.popen(cmd).read() # print(so) ...
[ "matplotlib.pyplot.imshow", "numpy.zeros", "os.popen", "matplotlib.pyplot.show" ]
[((360, 415), 'matplotlib.pyplot.imshow', 'plt.imshow', (['Matrix'], {'cmap': '"""hot"""', 'interpolation': '"""nearest"""'}), "(Matrix, cmap='hot', interpolation='nearest')\n", (370, 415), True, 'import matplotlib.pyplot as plt\n'), ((417, 427), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (425, 427), True,...
""" Copyright 2013 <NAME> This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is distributed in the ho...
[ "numpy.linalg.svd", "numpy.diag", "numpy.linalg.norm" ]
[((1055, 1076), 'numpy.linalg.norm', 'LA.norm', (['values[0]', '(2)'], {}), '(values[0], 2)\n', (1062, 1076), True, 'from numpy import linalg as LA\n'), ((1471, 1488), 'numpy.linalg.svd', 'LA.svd', (['values[0]'], {}), '(values[0])\n', (1477, 1488), True, 'from numpy import linalg as LA\n'), ((1555, 1566), 'numpy.diag'...
import numpy as np from mlxtend.feature_selection import SequentialFeatureSelector as SFS from sklearn.model_selection import KFold from sklearn.feature_selection import SelectPercentile, mutual_info_classif import sys from pathlib import Path sys.path[0] = str(Path(sys.path[0]).parent) from metrics import metrics, m...
[ "numpy.mean", "numpy.ones", "metrics.meanMetrics", "pathlib.Path", "metrics.stdMetrics", "mlxtend.feature_selection.SequentialFeatureSelector", "numpy.zeros", "metrics.printMetrics", "sklearn.feature_selection.SelectPercentile", "numpy.std", "metrics.metrics", "sklearn.model_selection.KFold", ...
[((438, 558), 'mlxtend.feature_selection.SequentialFeatureSelector', 'SFS', (['classifier'], {'k_features': 'n_features', 'forward': 'fwd', 'floating': 'fltg', 'verbose': '(1)', 'scoring': '"""accuracy"""', 'cv': '(10)', 'n_jobs': '(-1)'}), "(classifier, k_features=n_features, forward=fwd, floating=fltg, verbose=\n ...
import numpy as np # Unit prefixes for val and lst unitPrefixes = "kMGTPEZYyzafpnμm" # Table chars singleFrameChars = ['│', '─', '┼', '┌', '┐', '└', '┘', '├', '┬', '┤' ,'┴'] doubleFrameChars = ['║', '═', '╬', '╔', '╗', '╚', '╝', '╠', '╦', '╣', '╩'] tableChars = singleFrameChars def sigval(val, err, fix_mul3=True, fi...
[ "numpy.log10", "numpy.sqrt", "numpy.unique", "numpy.argmax", "numpy.array", "numpy.zeros" ]
[((9813, 9843), 'numpy.sqrt', 'np.sqrt', (['(err1 ** 2 + err2 ** 2)'], {}), '(err1 ** 2 + err2 ** 2)\n', (9820, 9843), True, 'import numpy as np\n'), ((5622, 5633), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (5630, 5633), True, 'import numpy as np\n'), ((5736, 5771), 'numpy.unique', 'np.unique', (['exps'], {'retu...
# Copyright 2018 Google, Inc., # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
[ "numpy.reshape", "tensorflow.data.Dataset.from_tensor_slices", "numpy.where", "numpy.diff", "tensorflow.to_int64", "pretty_midi.Note", "pretty_midi.PrettyMIDI", "pretty_midi.Instrument", "numpy.resize", "numpy.zeros", "tensorflow.py_func", "numpy.full", "numpy.pad", "tensorflow.compat.as_t...
[((2152, 2175), 'tensorflow.to_int64', 'tf.to_int64', (['batch_size'], {}), '(batch_size)\n', (2163, 2175), True, 'import tensorflow as tf\n'), ((2645, 2669), 'pretty_midi.PrettyMIDI', 'pretty_midi.PrettyMIDI', ([], {}), '()\n', (2667, 2669), False, 'import pretty_midi\n'), ((2687, 2712), 'pretty_midi.Instrument', 'pre...
import cv2 import mediapipe as mp import numpy as np import pandas as pd mp_drawing = mp.solutions.drawing_utils mp_pose = mp.solutions.pose def calculate_angle(a,b,c): a = np.array(a) # First b = np.array(b) # Mid c = np.array(c) # End radians = np.arctan2(c[1]-b[1], c[0]-b[0]) - np.arctan2(a[1]-...
[ "numpy.abs", "numpy.multiply", "numpy.array", "numpy.arctan2", "cv2.VideoCapture", "cv2.destroyAllWindows", "cv2.cvtColor", "pandas.DataFrame", "pandas.ExcelWriter", "cv2.waitKey" ]
[((178, 189), 'numpy.array', 'np.array', (['a'], {}), '(a)\n', (186, 189), True, 'import numpy as np\n'), ((206, 217), 'numpy.array', 'np.array', (['b'], {}), '(b)\n', (214, 217), True, 'import numpy as np\n'), ((232, 243), 'numpy.array', 'np.array', (['c'], {}), '(c)\n', (240, 243), True, 'import numpy as np\n'), ((34...
import numpy as np from paddle import fluid class MaskedMultiHeadAttention(object): def __init__(self, model_dim, num_heads, dropout=0.0): assert model_dim % num_heads == 0 self.model_dim = model_dim self.num_heads = num_heads self.per_head_dim = model_dim // num_heads self...
[ "numpy.array", "paddle.fluid.layers.elementwise_mul", "paddle.fluid.layers.transpose", "paddle.fluid.layers.matmul", "paddle.fluid.layers.reshape", "paddle.fluid.default_main_program", "numpy.concatenate", "numpy.ones", "paddle.fluid.layers.softmax", "paddle.fluid.unique_name.generate", "paddle....
[((465, 534), 'paddle.fluid.layers.reshape', 'fluid.layers.reshape', (['x', '[-1, seq_len, 3, qkv_dim // 3]'], {'inplace': '(True)'}), '(x, [-1, seq_len, 3, qkv_dim // 3], inplace=True)\n', (485, 534), False, 'from paddle import fluid\n'), ((563, 594), 'paddle.fluid.layers.unstack', 'fluid.layers.unstack', (['x'], {'ax...
import argparse from time import time import torch.optim as optim from caser import Caser from train_caser import Recommender from evaluation import evaluate_ranking from interactions import Interactions from losses import weighted_sigmoid_log_loss from utils import * import numpy as np import torch import os clas...
[ "torch.from_numpy", "torch.sum", "numpy.save", "numpy.arange", "torch.tanh", "numpy.mean", "torch.arange", "argparse.ArgumentParser", "numpy.sort", "torch.floor", "numpy.exp", "numpy.concatenate", "os.path.isfile", "caser.Caser", "interactions.Interactions", "evaluation.evaluate_rankin...
[((18042, 18067), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (18065, 18067), False, 'import argparse\n'), ((20145, 20170), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (20168, 20170), False, 'import argparse\n'), ((20896, 20927), 'interactions.Interactions', 'Inte...
"""Neighborhood SPIN Module.""" import numpy as np from .utils import check_distance_matrix, spin_energy class NeighborhoodSPIN(): """Neighborhood SPIN clustering method. Parameters ---------- initial_sigma : float, optional (default=2e10) Initial sigma value. This parameter controls the weig...
[ "numpy.identity", "numpy.indices", "numpy.argsort", "numpy.exp", "numpy.sign", "numpy.argmin", "numpy.arange" ]
[((3705, 3736), 'numpy.identity', 'np.identity', (['distances.shape[0]'], {}), '(distances.shape[0])\n', (3716, 3736), True, 'import numpy as np\n'), ((4716, 4743), 'numpy.argmin', 'np.argmin', (['mismatch'], {'axis': '(1)'}), '(mismatch, axis=1)\n', (4725, 4743), True, 'import numpy as np\n'), ((4988, 5010), 'numpy.ar...
import xml.etree.ElementTree as elemTree from openslide import OpenSlide import matplotlib.pyplot as plt import numpy as np import os os.environ['OPENCV_IO_MAX_IMAGE_PIXELS'] = str(2**64) import cv2 from skimage import io import sys from tqdm import tqdm from PIL import Image import gc import time import datetime de...
[ "os.path.exists", "xml.etree.ElementTree.parse", "os.makedirs", "numpy.sort", "tqdm.tqdm", "numpy.array", "cv2.cvtColor", "openslide.OpenSlide", "datetime.timedelta", "time.time" ]
[((933, 950), 'tqdm.tqdm', 'tqdm', (['destination'], {}), '(destination)\n', (937, 950), False, 'from tqdm import tqdm\n'), ((2150, 2165), 'openslide.OpenSlide', 'OpenSlide', (['path'], {}), '(path)\n', (2159, 2165), False, 'from openslide import OpenSlide\n'), ((2444, 2457), 'numpy.array', 'np.array', (['img'], {}), '...
import nibabel as nib import numpy as np from ATT.algorithm import surf_tools _, faces = nib.freesurfer.read_geometry('/nfs/t1/nsppara/corticalsurface/fsaverage/surf/lh.sphere') # data = nib.load('../fsfast_surf_mt_lh.mgz').get_data() # data = data[...,0] data = nib.load('/nfs/j3/userhome/huangtaicheng/hworkingshop/p...
[ "numpy.all", "nibabel.load", "numpy.where", "numpy.argsort", "ATT.algorithm.surf_tools.get_n_ring_neighbor", "nibabel.freesurfer.read_geometry" ]
[((90, 183), 'nibabel.freesurfer.read_geometry', 'nib.freesurfer.read_geometry', (['"""/nfs/t1/nsppara/corticalsurface/fsaverage/surf/lh.sphere"""'], {}), "(\n '/nfs/t1/nsppara/corticalsurface/fsaverage/surf/lh.sphere')\n", (118, 183), True, 'import nibabel as nib\n'), ((460, 485), 'numpy.where', 'np.where', (['(dat...
import gzip import numpy as np import keras as kr import sklearn.preprocessing as pre import matplotlib.pyplot as plt from keras.models import load_model from keras.datasets import mnist from keras.layers import Dense, Dropout, Flatten (x_train, y_train), (x_test, y_test) = mnist.load_data() inputs = ~np.array(x_trai...
[ "sklearn.preprocessing.LabelBinarizer", "keras.datasets.mnist.load_data", "keras.models.Sequential", "numpy.array", "keras.layers.Dense" ]
[((276, 293), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (291, 293), False, 'from keras.datasets import mnist\n'), ((393, 415), 'keras.models.Sequential', 'kr.models.Sequential', ([], {}), '()\n', (413, 415), True, 'import keras as kr\n'), ((964, 984), 'sklearn.preprocessing.LabelBinarizer',...
import sys from NiaPy.algorithms.basic import BatAlgorithm as BA from NiaPy.task import StoppingTask from sklearn.linear_model import LogisticRegression from niaaml.preprocessing.feature_selection.feature_selection_algorithm import FeatureSelectionAlgorithm from niaaml.utilities import ParameterDefinition, MinMax from ...
[ "numpy.ones", "niaaml.preprocessing.feature_selection._feature_selection_threshold_benchmark._FeatureSelectionThresholdBenchmark", "niaaml.preprocessing.feature_selection.feature_selection_algorithm.FeatureSelectionAlgorithm.to_string", "NiaPy.task.StoppingTask", "niaaml.utilities.MinMax", "NiaPy.algorith...
[((1729, 1738), 'NiaPy.algorithms.basic.BatAlgorithm', 'BA', ([], {'NP': '(10)'}), '(NP=10)\n', (1731, 1738), True, 'from NiaPy.algorithms.basic import BatAlgorithm as BA\n'), ((2226, 2266), 'numpy.ones', 'numpy.ones', (['(sol.shape[0] - 1)'], {'dtype': 'bool'}), '(sol.shape[0] - 1, dtype=bool)\n', (2236, 2266), False,...
import numpy as np import matplotlib.pyplot as plt import pandas as pd from qpsolvers import solve_qp from sklearn.metrics import confusion_matrix from mpl_toolkits import mplot3d import random #Importing Dataset dataset = pd.read_csv('Mall_Customers.csv') X = dataset.iloc[:, 2:].values k = [1, 2, 3, 4, 5, 6, 7, 8]...
[ "pandas.read_csv", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.linalg.norm", "numpy.zeros", "numpy.min", "numpy.argmin", "matplotlib.pyplot.title", "matplotlib.pyplot.show" ]
[((226, 259), 'pandas.read_csv', 'pd.read_csv', (['"""Mall_Customers.csv"""'], {}), "('Mall_Customers.csv')\n", (237, 259), True, 'import pandas as pd\n'), ((1290, 1314), 'matplotlib.pyplot.plot', 'plt.plot', (['k', 'Cost_points'], {}), '(k, Cost_points)\n', (1298, 1314), True, 'import matplotlib.pyplot as plt\n'), ((1...
import math, torch import numpy as np from numpy.random import normal as normrnd from scipy.stats import multivariate_normal, norm from scipy.linalg import sqrtm, expm from pdb import set_trace as bp from include.DNN import DNN import matplotlib.pyplot as plt import matplotlib.animation as animation from include.dataSt...
[ "numpy.random.rand", "math.sqrt", "numpy.array", "math.exp", "include.DNN.DNN", "numpy.sort", "matplotlib.pyplot.plot", "numpy.matmul", "include.dataStructures.particle.Particle", "matplotlib.pyplot.ylim", "numpy.random.normal", "numpy.identity", "matplotlib.pyplot.gca", "scipy.stats.norm....
[((2629, 2634), 'include.DNN.DNN', 'DNN', ([], {}), '()\n', (2632, 2634), False, 'from include.DNN import DNN\n'), ((2686, 2702), 'torch.load', 'torch.load', (['path'], {}), '(path)\n', (2696, 2702), False, 'import math, torch\n'), ((2905, 2930), 'torch.tensor', 'torch.tensor', (['[rssi, euc]'], {}), '([rssi, euc])\n',...
# run in python 3 import numpy as np import os, sys, json import math def main(theta, alpha): #constants that change with use MASS = 1 N = 4 ALPHA = 0.5 RADIUS = 1 angles = [math.pi / 3, math.pi * 2 / 3, math.pi * 4 / 3, math.pi * 5/3] C = [] C.append([-math.sin(i) for i in angle...
[ "numpy.linalg.pinv", "math.cos", "numpy.array", "numpy.dot", "numpy.matrix", "math.sin" ]
[((419, 430), 'numpy.array', 'np.array', (['C'], {}), '(C)\n', (427, 430), True, 'import numpy as np\n'), ((453, 470), 'numpy.linalg.pinv', 'np.linalg.pinv', (['C'], {}), '(C)\n', (467, 470), True, 'import numpy as np\n'), ((604, 618), 'numpy.dot', 'np.dot', (['_C', '_A'], {}), '(_C, _A)\n', (610, 618), True, 'import n...
from collections import defaultdict from distutils.version import LooseVersion from functools import partial import numba from numba.core import compiler, cgutils, types from numba.core.errors import TypingError from numba.core.extending import intrinsic from numba.experimental import structref from numba.core.typed_p...
[ "africanus.experimental.rime.fused.terms.core.StateStructRef", "numba.core.cgutils.get_null_value", "numpy.conj", "numba.core.types.Tuple", "numpy.searchsorted", "africanus.averaging.support._unique_internal", "numba.core.errors.TypingError", "numba.experimental.structref.new", "collections.defaultd...
[((1685, 1699), 'numpy.conj', 'np.conj', (['jones'], {}), '(jones)\n', (1692, 1699), True, 'import numpy as np\n'), ((614, 645), 'distutils.version.LooseVersion', 'LooseVersion', (['numba.__version__'], {}), '(numba.__version__)\n', (626, 645), False, 'from distutils.version import LooseVersion\n'), ((1741, 1758), 'num...
import numpy as np class Main: def __init__(self): self.n, self.m = map(int, input().split()) def output(self): print(np.eye(self.n, self.m, k=0)) if __name__ == '__main__': obj = Main() obj.output()
[ "numpy.eye" ]
[((152, 179), 'numpy.eye', 'np.eye', (['self.n', 'self.m'], {'k': '(0)'}), '(self.n, self.m, k=0)\n', (158, 179), True, 'import numpy as np\n')]
import cv2 import numpy as np import scipy.ndimage from operator import itemgetter import math from tkinter import * from tkinter import messagebox from tkinter import filedialog from tkinter import ttk from MyFunctions import * Q_90=[ [3,2,2,3,5,8,10,12], [2,2,3,4,5,12,12,11], [3,3,3,5,8,11,14,11], [3,3,4,6,1...
[ "cv2.dct", "tkinter.filedialog.asksaveasfilename", "math.sqrt", "numpy.zeros", "tkinter.ttk.Combobox", "operator.itemgetter", "tkinter.messagebox.showinfo", "tkinter.filedialog.askopenfilename" ]
[((8647, 8682), 'tkinter.ttk.Combobox', 'ttk.Combobox', (['middleframe'], {'width': '(15)'}), '(middleframe, width=15)\n', (8659, 8682), False, 'from tkinter import ttk\n'), ((1317, 1510), 'tkinter.filedialog.askopenfilename', 'filedialog.askopenfilename', ([], {'initialdir': '"""../Forged Images/"""', 'title': '"""Ope...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/detector.ipynb (unless otherwise specified). __all__ = ['FormatDetector'] # Cell import numpy as np import pandas as pd from typing import Any, Dict, Callable from tqdm import tqdm from .judge import FormatJudge from .utils import PatternGenerator # Cell class Format...
[ "numpy.exp" ]
[((2079, 2098), 'numpy.exp', 'np.exp', (['tuple_score'], {}), '(tuple_score)\n', (2085, 2098), True, 'import numpy as np\n')]
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation the rights to use, c...
[ "tensorflow.shape", "tensorflow.pad", "tensorflow.boolean_mask", "tensorflow.Variable", "tensorflow.ones", "numpy.sin", "tensorflow.reduce_sum", "tensorflow.reduce_max", "tensorflow.range", "numpy.cos", "tensorflow.compat.v1.enable_eager_execution", "tensorflow.reshape", "tensorflow.print", ...
[((1161, 1198), 'tensorflow.compat.v1.enable_eager_execution', 'tf.compat.v1.enable_eager_execution', ([], {}), '()\n', (1196, 1198), True, 'import tensorflow as tf\n'), ((4446, 5026), 'tensorflow.Variable', 'tf.Variable', (['[[0, 3, 2, 3, 1, 4, 1, 2, 3, 3, 2, 2, 3, 1, 2, 2, 2, 3, 6, 6, 3, 5, 1, 2, 1,\n 2, 1, 2, 2, ...
""" msg_map - messages type for map of the world part of mavsim_python - Beard & McLain, PUP, 2012 - Last update: 4/10/2019 - RWB """ import numpy as np import parameters.planner_parameters as PLAN class msgMap: def __init__(self): # flag to indicate if the map has changed ...
[ "numpy.copy", "numpy.zeros", "numpy.random.rand" ]
[((1099, 1129), 'numpy.zeros', 'np.zeros', (['(1, PLAN.num_blocks)'], {}), '((1, PLAN.num_blocks))\n', (1107, 1129), True, 'import numpy as np\n'), ((1344, 1372), 'numpy.copy', 'np.copy', (['self.building_north'], {}), '(self.building_north)\n', (1351, 1372), True, 'import numpy as np\n'), ((828, 876), 'numpy.random.ra...
# Copyright (c) 2020-2021 impersonator.org authors (<NAME> and <NAME>). All rights reserved. import unittest import numpy as np import torch from tqdm import tqdm from iPERCore.tools.human_digitalizer import deformers from iPERCore.tools.human_digitalizer import renders from iPERCore.tools.human_digitalizer.bodynets...
[ "iPERCore.tools.human_digitalizer.bodynets.SMPLH", "iPERCore.tools.human_digitalizer.deformers.ClothSmplLinkDeformer", "iPERCore.tools.human_digitalizer.bodynets.SMPL", "torch.tensor", "numpy.concatenate", "unittest.main", "iPERCore.tools.utils.filesio.persistence.load_pickle_file", "iPERCore.tools.ut...
[((506, 582), 'iPERCore.tools.utils.visualizers.visdom_visualizer.VisdomVisualizer', 'VisdomVisualizer', ([], {'env': '"""test_deformers"""', 'ip': '"""http://10.10.10.100"""', 'port': '(31102)'}), "(env='test_deformers', ip='http://10.10.10.100', port=31102)\n", (522, 582), False, 'from iPERCore.tools.utils.visualizer...