code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import numpy as np
from cv2 import cv2
import os.path
VIDEO_NUMBER = 107
BOUNDING_BOX_PATH = "\\Users\\George\\Documents\\Python\\ADS CapStone\\aff_wild_annotations_bboxes_landmarks_new\\landmarks\\train"
ANNOTATIONS_PATH = "\\Users\\George\\Documents\\Python\\ADS CapStone\\aff_wild_annotations_bboxes_landm... | [
"cv2.cv2.putText",
"cv2.cv2.destroyAllWindows",
"cv2.cv2.waitKey",
"numpy.append",
"cv2.cv2.polylines",
"cv2.cv2.cvtColor",
"cv2.cv2.imshow"
] | [((1879, 1902), 'cv2.cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1900, 1902), False, 'from cv2 import cv2\n'), ((1084, 1123), 'cv2.cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_BGR2GRAY'], {}), '(frame, cv2.COLOR_BGR2GRAY)\n', (1096, 1123), False, 'from cv2 import cv2\n'), ((1400, 1447), ... |
import math
import random
import os.path
import numpy as np
from collections.abc import Iterable
import tenncor as tc
import extenncor.trainer_cache as ecache
import extenncor.dqn_trainer_pb2 as dqn_pb
_get_random = tc.unif_gen(0, 1)
def get_dqnupdate(update_fn, update_rate):
def dqnupdate(err, vars):
... | [
"tenncor.api.square",
"tenncor.EVariable",
"random.sample",
"tenncor.optimize",
"tenncor.TenncorAPI",
"tenncor.unif_gen",
"tenncor.api.assign_sub",
"tenncor.api.reduce_sum_1d",
"tenncor.api.reduce_max_1d",
"numpy.array",
"extenncor.dqn_trainer_pb2.DqnEnv"
] | [((220, 237), 'tenncor.unif_gen', 'tc.unif_gen', (['(0)', '(1)'], {}), '(0, 1)\n', (231, 237), True, 'import tenncor as tc\n'), ((1216, 1266), 'tenncor.api.reduce_sum_1d', 'tc.api.reduce_sum_1d', (['(src_act * env.src_outmask)', '(0)'], {}), '(src_act * env.src_outmask, 0)\n', (1236, 1266), True, 'import tenncor as tc\... |
from functools import reduce
import re
import numpy as np
import os
import utils.load_data
from sklearn.preprocessing import StandardScaler,MinMaxScaler
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
import utils.feature
from sklearn.metrics import log_loss,classification_report
from tqdm import... | [
"sklearn.preprocessing.StandardScaler",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.metrics.log_loss",
"sklearn.discriminant_analysis.LinearDiscriminantAnalysis",
"numpy.eye",
"numpy.delete",
"numpy.concatenate"
] | [((3582, 3612), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {'feature_range': '()'}), '(feature_range=())\n', (3594, 3612), False, 'from sklearn.preprocessing import StandardScaler, MinMaxScaler\n'), ((1304, 1345), 'numpy.concatenate', 'np.concatenate', (['feature_data_list'], {'axis': '(1)'}), '(feature... |
import numpy as np
from .gate import C, Gate
from .pauli import X, Y, Z
H_MATRIX = 1/np.sqrt(2) * np.array([[1, 1],
[1, -1]])
S_MATRIX = np.array([[1, 0],
[0, 1j]])
H = Gate('H', H_MATRIX, H_MATRIX, 1)
S = Gate('S', S_MATRIX, S_MATRIX.conj().T, 1)
CX = C(X)... | [
"numpy.array",
"numpy.sqrt"
] | [((176, 205), 'numpy.array', 'np.array', (['[[1, 0], [0, 1.0j]]'], {}), '([[1, 0], [0, 1.0j]])\n', (184, 205), True, 'import numpy as np\n'), ((100, 127), 'numpy.array', 'np.array', (['[[1, 1], [1, -1]]'], {}), '([[1, 1], [1, -1]])\n', (108, 127), True, 'import numpy as np\n'), ((87, 97), 'numpy.sqrt', 'np.sqrt', (['(2... |
#!/usr/bin/env python3
import numpy as np
import sys
sys.path.append('../..')
from srlife import receiver
if __name__ == "__main__":
# Setup the base receiver
period = 24.0 # Loading cycle period, hours
days = 1 # Number of cycles represented in the problem
panel_stiffness = "disconnect" # Panels are disco... | [
"sys.path.append",
"srlife.receiver.Panel",
"srlife.receiver.Tube",
"numpy.sin",
"numpy.linspace",
"numpy.cos",
"srlife.receiver.Receiver"
] | [((55, 79), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (70, 79), False, 'import sys\n'), ((356, 404), 'srlife.receiver.Receiver', 'receiver.Receiver', (['period', 'days', 'panel_stiffness'], {}), '(period, days, panel_stiffness)\n', (373, 404), False, 'from srlife import receiver\n'), (... |
import pandas as pd
import numpy as np
import os
import re
import keras
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
from numpy import array
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Flatten
from keras.layers import Activation
f... | [
"keras.models.load_model",
"numpy.exp",
"numpy.zeros",
"numpy.arange"
] | [((572, 651), 'keras.models.load_model', 'keras.models.load_model', (['"""../../model-918-tloss-1.474e-07-vloss-1.866e-07.hdf5"""'], {}), "('../../model-918-tloss-1.474e-07-vloss-1.866e-07.hdf5')\n", (595, 651), False, 'import keras\n'), ((3577, 3618), 'numpy.zeros', 'np.zeros', (['(m, 5 + red_times)'], {'dtype': 'floa... |
#!/usr/bin/env python
# Load Libraries:{{{
import numpy as np ############################# Linear Algebra Library
from scipy.optimize import fsolve
import scipy ############################# Linest
from scipy import stats ################## Statistic Functions
import matplotlib ######################## Plotting
# Imp... | [
"numpy.poly1d",
"numpy.average",
"numpy.polyfit",
"scipy.stats.ttest_ind",
"matplotlib.pyplot.figure",
"scipy.stats.chi2",
"scipy.stats.linregress",
"matplotlib.pyplot.gca"
] | [((682, 710), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'fig_size'}), '(figsize=fig_size)\n', (692, 710), True, 'from matplotlib import pyplot as plt\n'), ((2314, 2342), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'fig_size'}), '(figsize=fig_size)\n', (2324, 2342), True, 'from matplotlib... |
import numpy as np
from matplotlib import pyplot as plt
def forward_euler(f, y0, T, N):
# f(t_n, y_n) -> y'_n
# y0 = Initial value
# T = Final value of t, t varies from 0 to T inclusive
# N = number of steps
y = np.array(y0, dtype=float)
h = float(T)/N
ts = np.linspace(0, T, N+1)
out =... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.empty",
"matplotlib.pyplot.legend",
"numpy.apply_along_axis",
"matplotlib.pyplot.figure",
"numpy.max",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplo... | [((233, 258), 'numpy.array', 'np.array', (['y0'], {'dtype': 'float'}), '(y0, dtype=float)\n', (241, 258), True, 'import numpy as np\n'), ((287, 311), 'numpy.linspace', 'np.linspace', (['(0)', 'T', '(N + 1)'], {}), '(0, T, N + 1)\n', (298, 311), True, 'import numpy as np\n'), ((321, 369), 'numpy.empty', 'np.empty', ([],... |
"""
Modified from KPConv: https://github.com/HuguesTHOMAS/KPConv
Author: <NAME>
Date: May 2021
"""
# Basic libs
import numpy as np
# ----------------------------------------------------------------------------------------------------------------------
#
# Utilities
# \***************/
#
def metric... | [
"numpy.sum",
"numpy.diagonal"
] | [((1205, 1248), 'numpy.diagonal', 'np.diagonal', (['confusions'], {'axis1': '(-2)', 'axis2': '(-1)'}), '(confusions, axis1=-2, axis2=-1)\n', (1216, 1248), True, 'import numpy as np\n'), ((1266, 1293), 'numpy.sum', 'np.sum', (['confusions'], {'axis': '(-1)'}), '(confusions, axis=-1)\n', (1272, 1293), True, 'import numpy... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Testing the closures."""
import numpy as np
import pytest
def get_test_tensors():
"""Generate a random board and key position."""
a_iso = 1.0 / 3.0 * np.eye(3)
a_uni1 = np.zeros((3, 3))
a_uni2 = np.zeros((3, 3))
a_uni3 = np.zeros((3, 3))
a_uni1... | [
"numpy.trace",
"numpy.eye",
"fiberoripy.closures.compute_closure",
"numpy.allclose",
"numpy.zeros",
"numpy.einsum",
"numpy.random.rand",
"pytest.mark.parametrize",
"pytest.approx"
] | [((671, 759), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""type"""', "['IBOF', 'LINEAR', 'HYBRID', 'QUADRATIC', 'RANDOM']"], {}), "('type', ['IBOF', 'LINEAR', 'HYBRID', 'QUADRATIC',\n 'RANDOM'])\n", (694, 759), False, 'import pytest\n'), ((1055, 1143), 'pytest.mark.parametrize', 'pytest.mark.parametri... |
class EvolutionSimulator:
def __init__( self,
genome,
heuristic,
n_generations = 200,
seqs_per_gen = 200,
breed_rate = .1,
max_mutation_rate = 0.01):
""" An EvolutionSimulator is a simulation that ru... | [
"matplotlib.pyplot.title",
"app.generation.Generation",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((1735, 1809), 'app.generation.Generation', 'Generation', (['genome', 'heuristic', 'seqs_per_gen', 'breed_rate', 'max_mutation_rate'], {}), '(genome, heuristic, seqs_per_gen, breed_rate, max_mutation_rate)\n', (1745, 1809), False, 'from app.generation import Generation\n'), ((4682, 4710), 'matplotlib.pyplot.title', 'p... |
import streamlit as st
import numpy as np
import pandas as pd
#st.title('hi') <---Could Also Use This To Give Title
"""
Hi
Look I Created A DataFrame
"""
df=pd.DataFrame(np.array([[5,6,7],[1,2,3],[4,5,6]]),columns=['a','b','c'])
selectbox=st.sidebar.selectbox('Choose The Number You Want!',df['a'])
'You Sele... | [
"streamlit.map",
"numpy.random.randn",
"streamlit.checkbox",
"streamlit.line_chart",
"streamlit.write",
"streamlit.sidebar.selectbox",
"numpy.random.randint",
"numpy.array"
] | [((250, 310), 'streamlit.sidebar.selectbox', 'st.sidebar.selectbox', (['"""Choose The Number You Want!"""', "df['a']"], {}), "('Choose The Number You Want!', df['a'])\n", (270, 310), True, 'import streamlit as st\n'), ((338, 350), 'streamlit.write', 'st.write', (['df'], {}), '(df)\n', (346, 350), True, 'import streamli... |
#!/usr/bin/env/ python
# ECBM E4040 Fall 2021 Assignment 2
# This script contains forward/backward functions of regularization techniques
import numpy as np
def dropout_forward(x, dropout_config, mode):
"""
Dropout feedforward
:param x: input tensor with shape (N, D)
:param dropout_config: (dict)
... | [
"numpy.sum",
"numpy.power",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"numpy.tile",
"numpy.random.choice",
"numpy.var"
] | [((6634, 6662), 'numpy.sum', 'np.sum', (['(dout * x_hat)'], {'axis': '(0)'}), '(dout * x_hat, axis=0)\n', (6640, 6662), True, 'import numpy as np\n'), ((6675, 6695), 'numpy.sum', 'np.sum', (['dout'], {'axis': '(0)'}), '(dout, axis=0)\n', (6681, 6695), True, 'import numpy as np\n'), ((1100, 1168), 'numpy.random.choice',... |
import numpy as np
from astropy.io import ascii
from astropy.coordinates import SkyCoord
from astropy.table import hstack
import astropy.units as u
def make_uvista(catfile = "UVISTA_final_v4.1.cat",
sfr_stellarmass_file = "UVISTA_final_colors_sfrs_v4.1.dat"):
"""
convienance function combine and write out... | [
"astropy.io.ascii.read",
"numpy.empty_like",
"astropy.io.ascii.write",
"astropy.table.hstack",
"astropy.coordinates.SkyCoord",
"numpy.unique"
] | [((366, 414), 'astropy.io.ascii.read', 'ascii.read', (['catfile'], {'include_names': "['ra', 'dec']"}), "(catfile, include_names=['ra', 'dec'])\n", (376, 414), False, 'from astropy.io import ascii\n'), ((427, 459), 'astropy.io.ascii.read', 'ascii.read', (['sfr_stellarmass_file'], {}), '(sfr_stellarmass_file)\n', (437, ... |
import logging
from typing import List
import cv2
import numpy as np
import pydicom as dcm
from ballir_dicom_manager.preprocess.dicom_tag_parser import DicomTagParser
from ballir_dicom_manager.preprocess.slice_manager import SliceManager
log = logging.getLogger(__name__)
class DicomVolumeValidator(DicomTagParser):... | [
"cv2.resize",
"numpy.dstack",
"numpy.amax",
"numpy.product",
"ballir_dicom_manager.preprocess.slice_manager.SliceManager",
"logging.getLogger"
] | [((247, 274), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (264, 274), False, 'import logging\n'), ((342, 356), 'ballir_dicom_manager.preprocess.slice_manager.SliceManager', 'SliceManager', ([], {}), '()\n', (354, 356), False, 'from ballir_dicom_manager.preprocess.slice_manager import S... |
"""Implementations of the IPFP algorithm to solve for equilibrium
and do comparative statics
in several variants of the
`Choo and Siow 2006 <https://www.jstor.org/stable/10.1086/498585?seq=1>`_ model:
* homoskedastic with singles (as in Choo and Siow 2006)
* homoskedastic without singles
* gender-heteroskedastic: w... | [
"numpy.full",
"scipy.linalg.solve",
"numpy.outer",
"numpy.sum",
"numpy.eye",
"numpy.argmax",
"numpy.power",
"numpy.zeros",
"numpy.ones",
"numpy.min",
"numpy.diag",
"numpy.add.outer",
"numpy.sqrt"
] | [((2775, 2794), 'numpy.sum', 'np.sum', (['men_margins'], {}), '(men_margins)\n', (2781, 2794), True, 'import numpy as np\n'), ((3474, 3490), 'numpy.full', 'np.full', (['X', 'bigc'], {}), '(X, bigc)\n', (3481, 3490), True, 'import numpy as np\n'), ((3501, 3517), 'numpy.full', 'np.full', (['Y', 'bigc'], {}), '(Y, bigc)\n... |
from pathlib import Path
from math import floor
import functools
import numpy as np
import tensorflow as tf
from tensorflow import keras
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from settings import *
from phonemes import Phoneme
def format_percentage2(n):
return floor(n * 10000)... | [
"tensorflow.keras.preprocessing.image_dataset_from_directory",
"pandas.DataFrame",
"phonemes.Phoneme.folded_group_phoneme_count",
"seaborn.heatmap",
"matplotlib.pyplot.show",
"tensorflow.keras.models.load_model",
"numpy.argmax",
"math.floor",
"phonemes.Phoneme.symbol_to_folded_group_index",
"matpl... | [((368, 396), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(15, 10)'}), '(figsize=(15, 10))\n', (378, 396), True, 'import matplotlib.pyplot as plt\n'), ((549, 600), 'seaborn.heatmap', 'sns.heatmap', (['df_cm'], {'annot': '(True)', 'cbar': '(False)', 'fmt': '"""d"""'}), "(df_cm, annot=True, cbar=False, fm... |
import os
import numpy as np
import pandas as pd
from tqdm.notebook import trange
from tqdm import tqdm
from tti_explorer import config, utils
from tti_explorer.case import simulate_case, CaseFactors
from tti_explorer.contacts import EmpiricalContactsSimulator
from tti_explorer.strategies import TTIFlowModel, RETURN_... | [
"tti_explorer.config.get_case_config",
"numpy.random.RandomState"
] | [((378, 402), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)'], {}), '(0)\n', (399, 402), True, 'import numpy as np\n'), ((417, 448), 'tti_explorer.config.get_case_config', 'config.get_case_config', (['"""delve"""'], {}), "('delve')\n", (439, 448), False, 'from tti_explorer import config, utils\n')] |
from pyquil.quil import Program
from pyquil.paulis import *
from pyquil.gates import *
import numpy as np
from pyquil.api import get_qc, WavefunctionSimulator
from random import *
from param_init import HadamardToAll
from auxiliary_functions import IntegerToString
def EncodingFunc(N_qubits, sample):
'''Th... | [
"numpy.count_nonzero",
"numpy.zeros",
"pyquil.api.WavefunctionSimulator",
"auxiliary_functions.IntegerToString",
"param_init.HadamardToAll",
"pyquil.quil.Program"
] | [((2225, 2234), 'pyquil.quil.Program', 'Program', ([], {}), '()\n', (2232, 2234), False, 'from pyquil.quil import Program\n'), ((2801, 2828), 'param_init.HadamardToAll', 'HadamardToAll', (['prog', 'qubits'], {}), '(prog, qubits)\n', (2814, 2828), False, 'from param_init import HadamardToAll\n'), ((3180, 3207), 'param_i... |
# -*- coding: utf-8 -*-
"""TextCNN.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1mgqbugWGmNKWNwV8bJfdOYnW5fMIc3Zw
"""
from google.colab import drive
drive.mount('/content/drive' )
import numpy as np
import pandas as pd
import tensorflow as t... | [
"tensorflow.distribute.get_strategy",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.GlobalMaxPooling1D",
"tools_evaluate_model.evaluate",
"gc.collect",
"tensorflow.distribute.experimental.TPUStrategy",
"tools_evaluate_model.p... | [((226, 255), 'google.colab.drive.mount', 'drive.mount', (['"""/content/drive"""'], {}), "('/content/drive')\n", (237, 255), False, 'from google.colab import drive\n'), ((528, 636), 'sys.path.append', 'sys.path.append', (['"""/content/drive/My Drive/Jigsaw Unintended Bias in Toxicity Classification/tools"""'], {}), "(\... |
# Copyright 2014 <NAME>, <EMAIL>
#
# This file is part of the gammatone toolkit, and is licensed under the 3-clause
# BSD license: https://github.com/detly/gammatone/blob/master/COPYING
"""
Plotting utilities related to gammatone analysis, primarily for use with
``matplotlib``.
"""
from __future__ import division
impor... | [
"argparse.ArgumentParser",
"numpy.max",
"numpy.min",
"png.from_array",
"glob.glob",
"numpy.log10"
] | [((4740, 4786), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'HELP_TEXT'}), '(description=HELP_TEXT)\n', (4763, 4786), False, 'import argparse\n'), ((5668, 5802), 'glob.glob', 'glob.glob', (['"""/home/robotlab/speaker_ws/src/speaker_classification_ros/src/speaker_classification/data/respea... |
import sys
import argparse
import numpy
import gzip
import math
''' Read all the word vectors and normalize them '''
def read_word_vectors(filename):
wordVectors = {}
if filename.endswith('.gz'): fileObject = gzip.open(filename, 'r')
else: fileObject = open(filename, 'r')
for lineNum, line in enumerate(fileOb... | [
"numpy.zeros",
"sys.stderr.write",
"gzip.open",
"argparse.ArgumentParser"
] | [((688, 746), 'sys.stderr.write', 'sys.stderr.write', (["('Vectors read from: ' + filename + ' \\n')"], {}), "('Vectors read from: ' + filename + ' \\n')\n", (704, 746), False, 'import sys\n'), ((1903, 1928), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1926, 1928), False, 'import argparse\n... |
#PBL Lidar Functions
import numpy as np
import math as m
from signal_analysis import mode
import sys
sys.path.append('/home/mach/Documents/AnE/Programming/Python/Signal_Processing')
import wavelets as wv
import pycuda_wavelets as py_wv
from scipy import signal
import matplotlib.pyplot as plt
from mpl_toolki... | [
"sys.path.append",
"wavelets.kwwt",
"math.erf",
"numpy.std",
"numpy.zeros",
"numpy.isnan",
"wavelets.clip_wavelet_kw",
"scipy.signal.find_peaks",
"numpy.arange",
"numpy.array",
"numpy.where",
"pycuda_wavelets.kwwt",
"signal_analysis.moving_mean"
] | [((108, 193), 'sys.path.append', 'sys.path.append', (['"""/home/mach/Documents/AnE/Programming/Python/Signal_Processing"""'], {}), "('/home/mach/Documents/AnE/Programming/Python/Signal_Processing'\n )\n", (123, 193), False, 'import sys\n'), ((507, 535), 'numpy.arange', 'np.arange', (['(0)', '(end + res)', 'res'], {}... |
import math
import random
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
# from itertools import count
from collections import namedtuple
## Import function approximator for Q from other file
from Q_network import QNetwork
from whittle_network import WhittleNetwork
import torch
import torch.nn a... | [
"torch.mean",
"whittle_network.WhittleNetwork",
"numpy.random.seed",
"torch.nn.functional.mse_loss",
"torch.mul",
"matplotlib.pyplot.ion",
"torch.set_default_dtype",
"torch.cuda.is_available",
"torch.autograd.set_detect_anomaly",
"collections.namedtuple",
"torch.device",
"torch.max",
"Q_netw... | [((387, 426), 'torch.autograd.set_detect_anomaly', 'torch.autograd.set_detect_anomaly', (['(True)'], {}), '(True)\n', (420, 426), False, 'import torch\n'), ((546, 555), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (553, 555), True, 'import matplotlib.pyplot as plt\n'), ((629, 667), 'torch.set_default_dtype', '... |
__author__ = 'Mariusz'
from pyltes import devices
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import math
from matplotlib.patches import Wedge
from shapely.geometry import Point
class Printer:
"""Class that prints network deployment"""
def __init__(self,parent):
self.parent ... | [
"mpl_toolkits.axes_grid1.make_axes_locatable",
"matplotlib.pyplot.xlim",
"shapely.geometry.Point",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.imshow",
"matplotlib.patches.Wedge",
"numpy.zeros",
"pyltes.devices.UE",
"matplotlib.pyplot.Rectangle",
"matplotlib.pyplot.colo... | [((514, 532), 'matplotlib.pyplot.hist', 'plt.hist', (['thr_MBit'], {}), '(thr_MBit)\n', (522, 532), True, 'import matplotlib.pyplot as plt\n'), ((596, 649), 'matplotlib.pyplot.savefig', 'plt.savefig', (["(filename + '.png')"], {'format': '"""png"""', 'dpi': '(300)'}), "(filename + '.png', format='png', dpi=300)\n", (60... |
import face_utils
import numpy as np
import argparse
import imutils
import dlib
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-p", "--shape-predictor", required=True,
help="path to facial landmark predictor")
ap.add_argument("-i", "--image", required=True,
help="path to input image")
args = vars(ap.pars... | [
"cv2.circle",
"cv2.putText",
"argparse.ArgumentParser",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.destroyAllWindows",
"face_utils.visualize_facial_landmarks",
"cv2.imshow",
"face_utils.shape_to_np",
"cv2.imread",
"face_utils.FACIAL_LANDMARKS_IDXS.items",
"numpy.array",
"dlib.get_frontal_face_detec... | [((97, 122), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (120, 122), False, 'import argparse\n'), ((427, 459), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (457, 459), False, 'import dlib\n'), ((472, 517), 'dlib.shape_predictor', 'dlib.shape_predictor... |
from os.path import join
import numpy as np
from tqdm import tqdm
from rdkit import Chem
from rdkit.Chem import rdMolDescriptors
from rdkit.Chem import MACCSkeys
from mordred import Calculator, descriptors
from pymudra.mudra import MUDRAEstimator
from sklearn.preprocessing import StandardScaler
from sklearn.model_sel... | [
"tqdm.tqdm",
"rdkit.Chem.rdMolDescriptors.GetMorganFingerprintAsBitVect",
"numpy.sum",
"rdkit.Chem.MACCSkeys.GenMACCSKeys",
"numpy.argmax",
"numpy.corrcoef",
"numpy.isfinite",
"numpy.any",
"numpy.array",
"sklearn.model_selection.StratifiedKFold",
"numpy.linspace",
"numpy.triu_indices_from",
... | [((1113, 1154), 'os.path.join', 'join', (['"""datasets"""', '"""D4_mols_confident.sdf"""'], {}), "('datasets', 'D4_mols_confident.sdf')\n", (1117, 1154), False, 'from os.path import join\n'), ((1655, 1696), 'numpy.digitize', 'np.digitize', (['y', 'quantiles[1:]'], {'right': '(True)'}), '(y, quantiles[1:], right=True)\n... |
import numpy as np
from enum import IntEnum
def _guesstype(a, num, t):
b = np.array(list(iter(array(t, num))))
c = np.sort(a) == np.sort(b)
if type(c) == np.ndarray and c.all():
return t
return -1
def guesstype(arr, num):
i = _guesstype(arr, num, atype.WENNER)
if i > 0:
retu... | [
"numpy.sort",
"numpy.zeros"
] | [((126, 136), 'numpy.sort', 'np.sort', (['a'], {}), '(a)\n', (133, 136), True, 'import numpy as np\n'), ((140, 150), 'numpy.sort', 'np.sort', (['b'], {}), '(b)\n', (147, 150), True, 'import numpy as np\n'), ((971, 982), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (979, 982), True, 'import numpy as np\n')] |
import os
import json
import pickle
import numpy as np
from pathlib import Path
from keras.models import Model
from sklearn.model_selection import GridSearchCV
from sklearn.ensemble import RandomForestClassifier
from dog_classifier.net.train import get_train_and_val_dataloader
from dog_classifier.evaluate.evaluate_tra... | [
"sklearn.ensemble.RandomForestClassifier",
"sklearn.model_selection.GridSearchCV",
"pickle.dump",
"json.dump",
"json.load",
"numpy.concatenate",
"os.path.abspath",
"dog_classifier.evaluate.evaluate_training.model_loader",
"dog_classifier.evaluate.evaluate_randomforest.eval_rf_training",
"os.path.i... | [((852, 915), 'dog_classifier.evaluate.evaluate_training.model_loader', 'model_loader', (['path_to_autoencoder', 'main_model', 'checkpoint_model'], {}), '(path_to_autoencoder, main_model, checkpoint_model)\n', (864, 915), False, 'from dog_classifier.evaluate.evaluate_training import model_loader\n'), ((3194, 3264), 'do... |
import sys
sys.path.append("/home/luisals/DeepHalos")
from dlhalos_code import CNN
from dlhalos_code import custom_regularizers as reg
import dlhalos_code.data_processing as tn
from utilss import kl_divergence as kl
from pickle import dump, load
import numpy as np
import os
if __name__ == "__main__":
###########... | [
"sys.path.append",
"numpy.save",
"dlhalos_code.custom_regularizers.active_neurons",
"dlhalos_code.custom_regularizers.l2_norm",
"dlhalos_code.custom_regularizers.sparsity_weights",
"numpy.array",
"numpy.loadtxt",
"numpy.arange",
"dlhalos_code.data_processing.DataGenerator",
"dlhalos_code.data_proc... | [((11, 53), 'sys.path.append', 'sys.path.append', (['"""/home/luisals/DeepHalos"""'], {}), "('/home/luisals/DeepHalos')\n", (26, 53), False, 'import sys\n'), ((827, 861), 'dlhalos_code.data_processing.SimulationPreparation', 'tn.SimulationPreparation', (['all_sims'], {}), '(all_sims)\n', (851, 861), True, 'import dlhal... |
import streamlit as st
from dbox_aux import read_dbx_file
import pandas as pd
import numpy as np
from itertools import cycle
import base64
import plotly.figure_factory as ff
import plotly.express as px
import altair as alt
def run_streamlit_ui():
st.set_page_config(layout="wide")
def download_lin... | [
"streamlit.sidebar.write",
"altair.Chart",
"streamlit.sidebar.selectbox",
"streamlit.sidebar.radio",
"itertools.cycle",
"streamlit.set_page_config",
"streamlit.button",
"numpy.max",
"dbox_aux.read_dbx_file",
"streamlit.beta_columns",
"plotly.express.choropleth",
"streamlit.error",
"streamlit... | [((265, 298), 'streamlit.set_page_config', 'st.set_page_config', ([], {'layout': '"""wide"""'}), "(layout='wide')\n", (283, 298), True, 'import streamlit as st\n'), ((715, 841), 'streamlit.sidebar.selectbox', 'st.sidebar.selectbox', (['"""Select Option?"""', "('Market', 'Deals', 'Technicals', 'Fundamental', 'Valuation'... |
"""
This module extracts the coordinates to be used in the cylinder fitting.
"""
import sys
import numpy as np
import mdtraj as md
import parmed as pmd
from mdtraj import geometry
from simtk import unit
class DataPoints(object):
def __init__(self, structure, topology):
self.structure = structure
... | [
"numpy.asarray",
"numpy.zeros",
"mdtraj.Trajectory",
"mdtraj.geometry.compute_dssp"
] | [((589, 628), 'numpy.zeros', 'np.zeros', ([], {'shape': '(1, coords.shape[0], 3)'}), '(shape=(1, coords.shape[0], 3))\n', (597, 628), True, 'import numpy as np\n'), ((715, 759), 'mdtraj.Trajectory', 'md.Trajectory', (['xyz'], {'topology': 'self.sliced_top'}), '(xyz, topology=self.sliced_top)\n', (728, 759), True, 'impo... |
import pytest
import luigi
from numpy import array
import ccdproc
from astroluigi import votable_database as vodb
@pytest.fixture
def create_FITS(tmpdir):
"""
Function to create FITS images for testing
"""
test_array = array([[10,20], [30,40]])
image1 = ccdproc.CCDData(test_array, unit="adu")
... | [
"ccdproc.fits_ccddata_writer",
"numpy.array",
"ccdproc.CCDData",
"astroluigi.votable_database.ImCalib",
"luigi.build"
] | [((239, 266), 'numpy.array', 'array', (['[[10, 20], [30, 40]]'], {}), '([[10, 20], [30, 40]])\n', (244, 266), False, 'from numpy import array\n'), ((278, 317), 'ccdproc.CCDData', 'ccdproc.CCDData', (['test_array'], {'unit': '"""adu"""'}), "(test_array, unit='adu')\n", (293, 317), False, 'import ccdproc\n'), ((331, 371)... |
import numpy as np
import sys
import steps.rng as srng
import steps.solver as ssolver
import ip3r_model_mesh_gcamp
# Set simulation parameters
T_END = 100.0
DT = 0.001
POINTS = int(T_END / DT)
tpnts = np.arange(0.0, T_END, DT)
ntpnts = tpnts.shape[0]
# Import model
mdl = ip3r_model_mesh_gcamp.getModel()
# Import geo... | [
"ip3r_model_mesh_gcamp.gen_geom",
"steps.solver.Tetexact",
"steps.rng.create",
"numpy.arange",
"ip3r_model_mesh_gcamp.getModel"
] | [((202, 227), 'numpy.arange', 'np.arange', (['(0.0)', 'T_END', 'DT'], {}), '(0.0, T_END, DT)\n', (211, 227), True, 'import numpy as np\n'), ((274, 306), 'ip3r_model_mesh_gcamp.getModel', 'ip3r_model_mesh_gcamp.getModel', ([], {}), '()\n', (304, 306), False, 'import ip3r_model_mesh_gcamp\n'), ((352, 384), 'ip3r_model_me... |
import io
import numpy as np
import progress
def load(filePath, loadEmbeddings=True):
with open(filePath, 'rb') as w2vFile:
firstLine = w2vFile.readline()
embeddingsCount, embeddingSize = tuple(firstLine.split(' '))
embeddingsCount, embeddingSize = int(embeddingsCount), int(embeddingSize)
... | [
"numpy.fromfile",
"numpy.zeros",
"progress.start"
] | [((367, 409), 'numpy.zeros', 'np.zeros', (['(embeddingsCount, embeddingSize)'], {}), '((embeddingsCount, embeddingSize))\n', (375, 409), True, 'import numpy as np\n'), ((424, 555), 'progress.start', 'progress.start', (['"""Loading W2V embeddings: %(percentage)i%%. %(value)i embeddings %(size)i features each."""', 'embe... |
import dnest4.classic as dn4
dn4.postprocess(cut=0.0)
# Plots from the blog post
import matplotlib.pyplot as plt
import numpy as np
posterior_sample = dn4.my_loadtxt("posterior_sample.txt")
plt.plot(posterior_sample[:,41], posterior_sample[:,42],
"k.", markersize=1, alpha=0.2)
plt.xlabel("$x_{41}$")
plt.ylab... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"dnest4.classic.my_loadtxt",
"numpy.corrcoef",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"dnest4.classic.postprocess"
] | [((29, 53), 'dnest4.classic.postprocess', 'dn4.postprocess', ([], {'cut': '(0.0)'}), '(cut=0.0)\n', (44, 53), True, 'import dnest4.classic as dn4\n'), ((153, 191), 'dnest4.classic.my_loadtxt', 'dn4.my_loadtxt', (['"""posterior_sample.txt"""'], {}), "('posterior_sample.txt')\n", (167, 191), True, 'import dnest4.classic ... |
import cv2
from matplotlib import pyplot as plt
import numpy as np
import os
import glob
from scipy.ndimage.filters import gaussian_filter1d
import argparse
## SET UP CONFIGURATION
parser = argparse.ArgumentParser("color_detection.py")
parser.add_argument("--src", help="path to the bottom up images, Exp: dataset/botto... | [
"os.mkdir",
"scipy.ndimage.filters.gaussian_filter1d",
"argparse.ArgumentParser",
"cv2.bitwise_and",
"numpy.ones",
"matplotlib.pyplot.figure",
"os.path.join",
"cv2.inRange",
"cv2.cvtColor",
"matplotlib.pyplot.subplots",
"cv2.resize",
"matplotlib.pyplot.show",
"os.path.basename",
"cv2.morph... | [((191, 236), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""color_detection.py"""'], {}), "('color_detection.py')\n", (214, 236), False, 'import argparse\n'), ((956, 977), 'numpy.zeros', 'np.zeros', (['img_size[1]'], {}), '(img_size[1])\n', (964, 977), True, 'import numpy as np\n'), ((990, 1011), 'numpy.z... |
# -*- coding: utf-8 -*-
"""
单变量分析中常用工具,主要包含以下几类工具:
1、自动分箱(降基)模块:包括卡方分箱、Best-ks分箱
2、基本分析模块,单变量分析工具,以及woe编码工具,以及所有变量的分析报告
3、单变量分析绘图工具,如AUC,KS,分布相关的图
"""
# Author: <NAME>
import numpy as np
import pandas as pd
from abc import abstractmethod
from abc import ABCMeta
from sklearn.utils.multiclass import type_of_target
fro... | [
"numpy.abs",
"openpyxl.Workbook",
"openpyxl.utils.dataframe.dataframe_to_rows",
"pandas.set_option",
"pandas.DataFrame",
"sklearn.utils.multiclass.type_of_target",
"pandas.qcut",
"pandas.isna",
"pandas.concat",
"pandas.IntervalIndex.from_breaks",
"pandas.read_excel",
"pandas.cut",
"pandas.Se... | [((28781, 28823), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', 'None'], {}), "('display.max_columns', None)\n", (28794, 28823), True, 'import pandas as pd\n'), ((28887, 28923), 'pandas.read_excel', 'pd.read_excel', (['"""data/newCRSpd30.xls"""'], {}), "('data/newCRSpd30.xls')\n", (28900, 28923),... |
import numpy as np
from scipy.spatial.distance import euclidean
import matplotlib.pyplot as plt
class Median:
def __init__(self, image, label):
self.label = label
self.img = image
self.h, self.w = self.img.shape
self.coordinates = []
self.median = [0, 0]
def find_coord... | [
"matplotlib.pyplot.show",
"scipy.spatial.distance.euclidean",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.scatter",
"numpy.zeros",
"numpy.mean",
"numpy.array"
] | [((1888, 1905), 'numpy.array', 'np.array', (['image_2'], {}), '(image_2)\n', (1896, 1905), True, 'import numpy as np\n'), ((628, 654), 'numpy.array', 'np.array', (['self.coordinates'], {}), '(self.coordinates)\n', (636, 654), True, 'import numpy as np\n'), ((1474, 1491), 'matplotlib.pyplot.imshow', 'plt.imshow', (['ima... |
from __future__ import print_function, division
import os
import sys
sys.path.append(os.path.dirname(sys.path[0]))
import numpy as np
from matplotlib import pyplot as plt
from cryoio import mrc
from cryoio import ctf
import geometry
import cryoops as coops
from correlation_benchmark import vis_real_space_comparison... | [
"numpy.abs",
"numpy.sum",
"numpy.sin",
"numpy.arange",
"cryoops.compute_inplanerot_matrix",
"correlation_benchmark.calc_difference",
"sincint.genfulltotrunc",
"numpy.zeros_like",
"numpy.random.randn",
"os.path.dirname",
"numpy.get_include",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.sh... | [((86, 114), 'os.path.dirname', 'os.path.dirname', (['sys.path[0]'], {}), '(sys.path[0])\n', (101, 114), False, 'import os\n'), ((571, 600), 'geometry.gencoords', 'geometry.gencoords', (['N', '(2)', 'rad'], {}), '(N, 2, rad)\n', (589, 600), False, 'import geometry\n'), ((714, 751), 'cryoio.ctf.envelope_function', 'ctf.... |
import re
import nltk
nltk.download('stopwords')
from nltk.corpus import stopwords
import numpy as np
import pandas as pd
from polyglot.detect import Detector
from langdetect import detect
from polyglot.detect.base import logger as polyglot_logger
from tqdm import tqdm
tqdm.pandas()
polyglot_logger.setLevel("ERROR")
n... | [
"polyglot.detect.Detector",
"numpy.savetxt",
"tqdm.tqdm.pandas",
"re.escape",
"nltk.corpus.stopwords.words",
"polyglot.detect.base.logger.setLevel",
"nltk.download",
"re.sub"
] | [((22, 48), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (35, 48), False, 'import nltk\n'), ((270, 283), 'tqdm.tqdm.pandas', 'tqdm.pandas', ([], {}), '()\n', (281, 283), False, 'from tqdm import tqdm\n'), ((284, 317), 'polyglot.detect.base.logger.setLevel', 'polyglot_logger.setLevel',... |
from random import choice
from numpy import load
from numpy import expand_dims
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import Normalizer
from sklearn.svm import SVC
from matplotlib import pyplot
# load extracted faces
data = load('5-celebrity-faces-dataset.npz')
testX_faces = data['ar... | [
"matplotlib.pyplot.title",
"numpy.load",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"numpy.expand_dims",
"sklearn.preprocessing.LabelEncoder",
"sklearn.svm.SVC",
"sklearn.preprocessing.Normalizer"
] | [((260, 297), 'numpy.load', 'load', (['"""5-celebrity-faces-dataset.npz"""'], {}), "('5-celebrity-faces-dataset.npz')\n", (264, 297), False, 'from numpy import load\n'), ((356, 384), 'numpy.load', 'load', (['"""faces-embeddings.npz"""'], {}), "('faces-embeddings.npz')\n", (360, 384), False, 'from numpy import load\n'),... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/10/23 16:42
# @Author : ganliang
# @File : tf_logistic_regression.py
# @Desc : 逻辑回归
import os
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import mnist, input_data
import numpy as np
from matplotlib import pyplot as plt
from sr... | [
"tensorflow.matmul",
"os.path.join",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"src.config.logger.info",
"tensorflow.placeholder",
"tensorflow.cast",
"tensorflow.summary.histogram",
"tensorflow.summary.FileWriter",
"numpy.reshape",
"tensorflow.name_scope",
"tensorflow.summary.merge_all"... | [((488, 535), 'os.path.join', 'os.path.join', (['root_path', '"""data"""', '"""fashionMNIST"""'], {}), "(root_path, 'data', 'fashionMNIST')\n", (500, 535), False, 'import os\n'), ((553, 604), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['mnist_path'], {'one_hot': '(Tru... |
"""Testing athenet.algorithm.derest.activation functions.
"""
import numpy as np
import theano
import theano.tensor as T
import unittest
from math import e
from nose.tools import assert_almost_equal, assert_greater
from numpy.testing import assert_array_almost_equal
from athenet.algorithm.derest.layers.fully_connecte... | [
"theano.tensor.tensor3s",
"athenet.algorithm.derest.layers.convolutional.a_conv",
"numpy.ones",
"athenet.algorithm.numlike.TheanoInterval",
"athenet.algorithm.derest.layers.pool.a_pool",
"numpy.arange",
"numpy.testing.assert_array_almost_equal",
"numpy.ndarray",
"numpy.prod",
"unittest.main",
"a... | [((1034, 1073), 'numpy.array', 'np.array', (['x'], {'dtype': 'theano.config.floatX'}), '(x, dtype=theano.config.floatX)\n', (1042, 1073), True, 'import numpy as np\n'), ((25701, 25744), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)', 'catchbreak': '(True)'}), '(verbosity=2, catchbreak=True)\n', (25714, 2574... |
import numpy as np
import matplotlib.pyplot as plt
from starry_process import StarryProcess
import theano
import theano.tensor as tt
from tqdm import tqdm
import os
import time
# Compile the function to compute the likelihood
def get_loglike_function(ydeg, marginalize_over_inclination=False):
t = tt.dvector()
... | [
"os.path.abspath",
"theano.tensor.ones_like",
"numpy.logspace",
"time.time",
"theano.tensor.dvector",
"numpy.array",
"numpy.linspace",
"starry_process.StarryProcess",
"matplotlib.pyplot.subplots"
] | [((1063, 1078), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)'], {}), '(1)\n', (1075, 1078), True, 'import matplotlib.pyplot as plt\n'), ((1190, 1216), 'numpy.array', 'np.array', (['[200.0, 10000.0]'], {}), '([200.0, 10000.0])\n', (1198, 1216), True, 'import numpy as np\n'), ((304, 316), 'theano.tensor.dvector',... |
import numpy as np
from math import cos, sin, pi, radians, pow
from pyquaternion import Quaternion
def rot_matrix_z(theta):
return np.array([[cos(theta), -sin(theta), 0],
[sin(theta), cos(theta), 0],
[0, 0, 1]])
def rot_matrix_y(beta):
return np.array([[cos(beta), 0... | [
"math.pow",
"math.radians",
"numpy.identity",
"math.sin",
"pyquaternion.Quaternion",
"numpy.array",
"math.cos"
] | [((883, 891), 'math.cos', 'cos', (['yaw'], {}), '(yaw)\n', (886, 891), False, 'from math import cos, sin, pi, radians, pow\n'), ((901, 911), 'math.cos', 'cos', (['pitch'], {}), '(pitch)\n', (904, 911), False, 'from math import cos, sin, pi, radians, pow\n'), ((921, 929), 'math.sin', 'sin', (['yaw'], {}), '(yaw)\n', (92... |
# /**
# * @author <NAME>
# * @create date 2021-07-07 19:00:00
# * @modify date 2021-07-07 19:00:00
# * @desc Thermal Comfort Model using Arduino Microcontroller and Tensorflow Lite, Web Interface connects to the device via BLE.
# */
import numpy as np
import tensorflow as tf
model_dir="models/comfort_summer"
de... | [
"numpy.array",
"numpy.max",
"numpy.set_printoptions",
"tensorflow.keras.models.load_model"
] | [((347, 384), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (['model_dir'], {}), '(model_dir)\n', (373, 384), True, 'import tensorflow as tf\n'), ((452, 486), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (471, 486), True, 'import numpy as np\n... |
#Standard modules
import time
import matplotlib.pyplot as plt
import os
import numpy as np
import multiprocessing
import sys
import queue
import ctypes
#RASH modules
import masterboard
import config
import trajectory as trj
import parser
import kinematics
import plotter
class InputTask:
def __init__(self, trajec... | [
"matplotlib.pyplot.suptitle",
"multiprocessing.Queue",
"os.sched_param",
"numpy.full",
"numpy.set_printoptions",
"numpy.degrees",
"os.sched_get_priority_min",
"matplotlib.pyplot.show",
"multiprocessing.Array",
"time.perf_counter",
"time.sleep",
"sys.stdin.close",
"kinematics.simple_walk_cont... | [((12981, 13022), 'multiprocessing.Array', 'multiprocessing.Array', (['ctypes.c_double', '(8)'], {}), '(ctypes.c_double, 8)\n', (13002, 13022), False, 'import multiprocessing\n'), ((13041, 13059), 'sys.stdin.fileno', 'sys.stdin.fileno', ([], {}), '()\n', (13057, 13059), False, 'import sys\n'), ((13080, 13103), 'multipr... |
import numpy as np
from glob import glob
import os
import copy
import torch
import matplotlib.pyplot as plt
import cv2
import matplotlib.patches as mpatches
class npy_skull_show():
def __init__(self,path,classes=2):
self.data_path = path + '/' + 'pred_npy'
self.save_path = path
s... | [
"matplotlib.pyplot.subplot",
"numpy.load",
"copy.deepcopy",
"os.makedirs",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"numpy.expand_dims",
"os.path.exists",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.array",
"matplotlib.pyplot.gca",
"numpy.squeeze",
"os.path.join",
"numpy... | [((544, 588), 'numpy.random.randint', 'np.random.randint', (['(0)', '(255)', '(self.classes, 3)'], {}), '(0, 255, (self.classes, 3))\n', (561, 588), True, 'import numpy as np\n'), ((1458, 1479), 'numpy.load', 'np.load', (['self.gt_path'], {}), '(self.gt_path)\n', (1465, 1479), True, 'import numpy as np\n'), ((1510, 153... |
import numpy as np
import cv2
img = cv2.imread('images/low_contrast_1.jpg', cv2.IMREAD_GRAYSCALE)
height = img.shape[0]
width = img.shape[1]
brightness = 50
for i in np.arange(height):
for j in np.arange(width):
a = img.item(i,j)
b = a + brightness
if b > 255:
... | [
"cv2.waitKey",
"cv2.imwrite",
"cv2.destroyAllWindows",
"cv2.imread",
"numpy.arange",
"cv2.imshow"
] | [((40, 101), 'cv2.imread', 'cv2.imread', (['"""images/low_contrast_1.jpg"""', 'cv2.IMREAD_GRAYSCALE'], {}), "('images/low_contrast_1.jpg', cv2.IMREAD_GRAYSCALE)\n", (50, 101), False, 'import cv2\n'), ((180, 197), 'numpy.arange', 'np.arange', (['height'], {}), '(height)\n', (189, 197), True, 'import numpy as np\n'), ((3... |
import numpy as np
def initiate_list(l):
nbr_ones = []
for n in range(l):
nbr_ones.append(0)
return nbr_ones
def create_binaries(nbr_ones, lim):
nbr1 = []
nbr2 = []
for n in nbr_ones:
if n > lim:
nbr1.append('1')
nbr2.append('0')
else:
... | [
"numpy.logical_not",
"numpy.genfromtxt"
] | [((1487, 1525), 'numpy.genfromtxt', 'np.genfromtxt', (['"""data.txt"""'], {'dtype': '"""str"""'}), "('data.txt', dtype='str')\n", (1500, 1525), True, 'import numpy as np\n'), ((1270, 1290), 'numpy.logical_not', 'np.logical_not', (['ones'], {}), '(ones)\n', (1284, 1290), True, 'import numpy as np\n'), ((1419, 1439), 'nu... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""Module containing functions for intensity normalisation.
"""
from __future__ import annotations
from typing import Union
import numpy as np
import torch
import torch.nn as nn
from multipledispatch import dispatch
from torch import Tensor
from torchvision.transforms ... | [
"torch.stack",
"multipledispatch.dispatch",
"numpy.clip",
"numpy.amax",
"torch.clamp",
"numpy.array",
"torch.max",
"torch.as_tensor",
"torch.get_default_dtype",
"torch.tensor",
"onevision.factory.TRANSFORMS.register"
] | [((3377, 3407), 'multipledispatch.dispatch', 'dispatch', (['(Tensor, np.ndarray)'], {}), '((Tensor, np.ndarray))\n', (3385, 3407), False, 'from multipledispatch import dispatch\n'), ((3745, 3759), 'multipledispatch.dispatch', 'dispatch', (['list'], {}), '(list)\n', (3753, 3759), False, 'from multipledispatch import dis... |
import torch
import numpy as np
import scipy.sparse as sp
import torch_quiver as qv
import time
from ogb.nodeproppred import Evaluator, PygNodePropPredDataset
from scipy.sparse import csr_matrix
import os
import os.path as osp
import quiver
import torch.multiprocessing as mp
from multiprocessing.reduction import Forki... | [
"multiprocessing.reduction.ForkingPickler.register",
"torch.from_numpy",
"torch.multiprocessing.spawn",
"sampler.GraphSageSampler",
"random.shuffle",
"ogb.nodeproppred.PygNodePropPredDataset",
"time.time",
"quiver.CSRTopo",
"sampler.MixedGraphSageSampler",
"torch.multiprocessing.set_start_method",... | [((1289, 1334), 'ogb.nodeproppred.PygNodePropPredDataset', 'PygNodePropPredDataset', (['"""ogbn-products"""', 'root'], {}), "('ogbn-products', root)\n", (1311, 1334), False, 'from ogb.nodeproppred import Evaluator, PygNodePropPredDataset\n'), ((1339, 1363), 'torch.cuda.set_device', 'torch.cuda.set_device', (['(0)'], {}... |
import numpy as np
import keras
import cv2
class DataGenerator(keras.utils.Sequence):
'Generates data for Keras'
def __init__(self, list_item_paths,dir_path, batch_size=1, dim=(80,80,80), n_channels=1,
n_classes=10, shuffle=True):
'Initialization'
self.dim = dim
self.ba... | [
"cv2.resize",
"numpy.load",
"numpy.empty",
"numpy.expand_dims",
"os.listdir",
"numpy.random.shuffle"
] | [((2244, 2305), 'os.listdir', 'os.listdir', (['"""/home/david/Documents/chall_owkin/train/images/"""'], {}), "('/home/david/Documents/chall_owkin/train/images/')\n", (2254, 2305), False, 'import os\n'), ((1494, 1549), 'numpy.empty', 'np.empty', (['(self.batch_size, self.n_channels, *self.dim)'], {}), '((self.batch_size... |
# coding: utf-8
##-------------------------------------------------------------------------------------------
##
## Combined MRCNN-FCN Pipeline (import model_mrcnn) on COCO dataset
## Train MRCNN heads only
## MRCNN modeo (include model_mrcnn) does not include any mask related heads or losses
##
##--------------------... | [
"sys.path.append",
"json.dump",
"io.StringIO",
"numpy.set_printoptions",
"pickle.dump",
"datetime.datetime.now",
"numpy.percentile",
"pprint.PrettyPrinter",
"gc.collect",
"numpy.mean",
"mrcnn.utils.command_line_parser",
"mrcnn.datagen.load_image_gt",
"mrcnn.coco.prep_coco_dataset",
"platfo... | [((542, 564), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (557, 564), False, 'import os, sys, math, io, time, gc, platform, pprint, json, pickle\n'), ((1091, 1132), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'indent': '(2)', 'width': '(100)'}), '(indent=2, width=100)\n', (1111, 11... |
import numpy as np
from ...fem_data import FEMData
from ...fem_elemental_attribute import FEMElementalAttribute
from ...util import string_parser as st
class UCDData(FEMData):
"""FEMEntity of AVS UCD version."""
@classmethod
def read_files(cls, file_names, read_mesh_only=False, time_series=False):
... | [
"numpy.unique",
"numpy.all"
] | [((3776, 3801), 'numpy.all', 'np.all', (['(types == types[0])'], {}), '(types == types[0])\n', (3782, 3801), True, 'import numpy as np\n'), ((4096, 4112), 'numpy.unique', 'np.unique', (['types'], {}), '(types)\n', (4105, 4112), True, 'import numpy as np\n')] |
name_notebook = 'revelle_ch7_example_short' # this is to save
# %load_ext autoreload
# %autoreload 2
import pandas as pd
import numpy as np
import sys
sys.path.append("../")
from reliabilipy import reliability_analysis
# Dataset as examample in Table 7.5 https://personality-project.org/r/book/Chapter7.pdf
V = pd.Da... | [
"sys.path.append",
"reliabilipy.reliability_analysis",
"os.system",
"numpy.matrix"
] | [((152, 174), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (167, 174), False, 'import sys\n'), ((1161, 1204), 'reliabilipy.reliability_analysis', 'reliability_analysis', ([], {'correlations_matrix': 'V'}), '(correlations_matrix=V)\n', (1181, 1204), False, 'from reliabilipy import reliability_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import numpy as np
import pyopencl as cl
from Data import read_text_from_disk
a_np = np.random.rand(50000).astype(np.float64)
b_np = np.random.rand(50000).astype(np.float64)
ctx = cl.create_some_context()
queue = cl... | [
"pyopencl.enqueue_copy",
"pyopencl.create_some_context",
"numpy.empty_like",
"pyopencl.CommandQueue",
"pyopencl.Buffer",
"Data.read_text_from_disk",
"pyopencl.Program",
"numpy.linalg.norm",
"numpy.random.rand"
] | [((285, 309), 'pyopencl.create_some_context', 'cl.create_some_context', ([], {}), '()\n', (307, 309), True, 'import pyopencl as cl\n'), ((318, 338), 'pyopencl.CommandQueue', 'cl.CommandQueue', (['ctx'], {}), '(ctx)\n', (333, 338), True, 'import pyopencl as cl\n'), ((364, 425), 'pyopencl.Buffer', 'cl.Buffer', (['ctx', '... |
#!/usr/bin/env python3
import unittest
from unittest import TestCase
import numpy as np
import dynet as dy
from dynn import activations
from dynn.layers import functional_layers
class TestConstantLayer(TestCase):
def setUp(self):
self.scalar = 5
self.list = [5, 6]
self.nparray = np.rand... | [
"unittest.main",
"dynet.renew_cg",
"dynn.layers.functional_layers.IdentityLayer",
"dynet.inputTensor",
"dynn.layers.functional_layers.ConstantLayer",
"dynn.layers.functional_layers.AdditionLayer",
"dynn.layers.functional_layers.CmultLayer",
"dynet.sum_elems",
"dynn.layers.functional_layers.NegationL... | [((5676, 5691), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5689, 5691), False, 'import unittest\n'), ((313, 335), 'numpy.random.rand', 'np.random.rand', (['(10)', '(12)'], {}), '(10, 12)\n', (327, 335), True, 'import numpy as np\n'), ((415, 459), 'dynn.layers.functional_layers.ConstantLayer', 'functional_laye... |
from imgtoolpy.sharpen import sharpen, read_image
from numpy import random
import pytest
img = read_image("img/free-wallpaper.jpg")
img_orig, img_sharpened = sharpen(img)
img3 = random.random((20, 20, 3))
img4 = random.random((60, 60))
img5 = random.random((60, 60, 4))
# class test_sharpen():
def test_read_image():... | [
"imgtoolpy.sharpen.read_image",
"imgtoolpy.sharpen.sharpen",
"numpy.random.random",
"pytest.raises"
] | [((96, 132), 'imgtoolpy.sharpen.read_image', 'read_image', (['"""img/free-wallpaper.jpg"""'], {}), "('img/free-wallpaper.jpg')\n", (106, 132), False, 'from imgtoolpy.sharpen import sharpen, read_image\n'), ((159, 171), 'imgtoolpy.sharpen.sharpen', 'sharpen', (['img'], {}), '(img)\n', (166, 171), False, 'from imgtoolpy.... |
import numpy as np
import MDAnalysis
import os
import sys
import scipy.cluster
def writewaterfile(filename, watercoods, finalwaterscores):
numwater = watercoods.shape[0]
f1 = open(filename, 'w')
for j in range(0, numwater):
header = 'HETATM'
serial = j+1
name = 'OW'
resnam... | [
"os.remove",
"numpy.abs",
"numpy.amin",
"MDAnalysis.lib.distances.distance_array",
"numpy.argmax",
"os.path.isfile",
"numpy.mean",
"numpy.transpose",
"numpy.genfromtxt",
"MDAnalysis.Universe",
"numpy.max",
"numpy.ravel_multi_index",
"numpy.reshape",
"numpy.size",
"os.system",
"numpy.co... | [((817, 853), 'MDAnalysis.Universe', 'MDAnalysis.Universe', (['proteinfilename'], {}), '(proteinfilename)\n', (836, 853), False, 'import MDAnalysis\n'), ((960, 995), 'MDAnalysis.Universe', 'MDAnalysis.Universe', (['ligandfilename'], {}), '(ligandfilename)\n', (979, 995), False, 'import MDAnalysis\n'), ((1288, 1327), 'M... |
# Copyright 2021 The Private Cardinality Estimation Framework Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
"wfa_planning_evaluation_framework.data_generators.data_set.DataSet",
"absl.testing.absltest.main",
"wfa_planning_evaluation_framework.data_generators.publisher_data.PublisherData",
"numpy.random.default_rng"
] | [((1954, 1969), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (1967, 1969), False, 'from absl.testing import absltest\n'), ((1110, 1144), 'wfa_planning_evaluation_framework.data_generators.publisher_data.PublisherData', 'PublisherData', (['[(1, 100.0)]', '"""pdf"""'], {}), "([(1, 100.0)], 'pdf')\n", ... |
from robosuite.controllers.base_controller import Controller
import numpy as np
from scipy.spatial.transform import Rotation as R
from robosuite.utils.min_jerk_planner import PathPlan
import robosuite.utils.angle_transformation as at
import matplotlib.pyplot as plt
from copy import deepcopy
import robosuite.utils.trans... | [
"robosuite.utils.min_jerk_planner.PathPlan",
"robosuite.utils.transform_utils.euler2mat",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.ones",
"numpy.append",
"numpy.array",
"scipy.spatial.transform.Rotation.from_matrix",
"numpy.dot",
"matplotlib.pyplot.subplots",
"numpy.sqrt"
] | [((1968, 1993), 'numpy.append', 'np.append', (['Kp_pos', 'Kp_ori'], {}), '(Kp_pos, Kp_ori)\n', (1977, 1993), True, 'import numpy as np\n'), ((2102, 2127), 'numpy.append', 'np.append', (['Kd_pos', 'Kd_ori'], {}), '(Kd_pos, Kd_ori)\n', (2111, 2127), True, 'import numpy as np\n'), ((2908, 2921), 'numpy.array', 'np.array',... |
from transforms import NormalizeShift
import json
import pdb
from os import listdir
from os.path import isfile, join
import numpy as np
import pytorch3d
from pytorch3d.io import load_obj
import torch
from tqdm import tqdm
def convert_cloud(file, i):
try:
bin_file_name = f'{i:06}.bin'
point_cloud =... | [
"numpy.mean",
"pytorch3d.io.load_obj",
"numpy.array",
"numpy.vstack"
] | [((321, 348), 'pytorch3d.io.load_obj', 'pytorch3d.io.load_obj', (['file'], {}), '(file)\n', (342, 348), False, 'import pytorch3d\n'), ((882, 917), 'numpy.vstack', 'np.vstack', (['(np_x, np_y, np_z, np_i)'], {}), '((np_x, np_y, np_z, np_i))\n', (891, 917), True, 'import numpy as np\n'), ((577, 609), 'numpy.array', 'np.a... |
# -*- utf-8 -*-
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
def img_endecoding():
image_raw_data = tf.gfile.FastGFile("backGround.jpg", 'rb').read()
img_data = tf.image.decode_jpeg(image_raw_data)
print(type(img_data.eval()))
print(img_data.eval().ndim)
print(img_d... | [
"tensorflow.image.flip_left_right",
"tensorflow.slice",
"tensorflow.clip_by_value",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"tensorflow.image.per_image_standardization",
"tensorflow.image.resize_image_with_crop_or_pad",
"tensorflow.image.adjust_contrast",
"tensorflow.image.random_contras... | [((203, 239), 'tensorflow.image.decode_jpeg', 'tf.image.decode_jpeg', (['image_raw_data'], {}), '(image_raw_data)\n', (223, 239), True, 'import tensorflow as tf\n'), ((475, 505), 'tensorflow.image.encode_jpeg', 'tf.image.encode_jpeg', (['img_data'], {}), '(img_data)\n', (495, 505), True, 'import tensorflow as tf\n'), (... |
import numpy as np
import matplotlib.pyplot as plt
import imageio
data = np.loadtxt("adveccion.dat")
print(np.shape(data))
n_times = np.shape(data)[0]
n_space = np.shape(data)[1]
x = np.linspace(0.0, 1.0, n_space)
t = np.linspace(0.0, 2.0, n_times)
for i in range(n_times):
filename = "snap_{}.png".format(i)
... | [
"imageio.get_writer",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.close",
"imageio.imread",
"numpy.shape",
"matplotlib.pyplot.figure",
"numpy.loadtxt",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.p... | [((74, 101), 'numpy.loadtxt', 'np.loadtxt', (['"""adveccion.dat"""'], {}), "('adveccion.dat')\n", (84, 101), True, 'import numpy as np\n'), ((186, 216), 'numpy.linspace', 'np.linspace', (['(0.0)', '(1.0)', 'n_space'], {}), '(0.0, 1.0, n_space)\n', (197, 216), True, 'import numpy as np\n'), ((221, 251), 'numpy.linspace'... |
#############################################################################
# Taken from https://github.com/zygmuntz/hyperband/blob/master/hyperband.py #
#############################################################################
# n_i: number of configurations
# r_i: number of iterations/epochs
# max_iter = 81 ... | [
"copy.deepcopy",
"gym.make",
"math.ceil",
"os.path.realpath",
"os.path.exists",
"agents.make_agent",
"time.ctime",
"time.time",
"numpy.argsort",
"random.random",
"multiprocessing.cpu_count",
"numpy.mean",
"shutil.rmtree",
"math.log",
"numpy.var",
"hpsearch.utils.get_stats"
] | [((1186, 1212), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (1202, 1212), False, 'import gym, os, shutil, re, multiprocessing, json, copy\n'), ((1312, 1318), 'time.time', 'time', ([], {}), '()\n', (1316, 1318), False, 'from time import time, ctime\n'), ((5754, 5780), 'copy.deepcopy', 'co... |
import os
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.layers import Conv2D, MaxPooling2D, GlobalMaxPooling2D, BatchNormalization
from keras.preprocessing.image import img_to_array
def prepare_image(image):
if image.mode != 'L':
image = image.c... | [
"numpy.argmax",
"keras.layers.Dropout",
"os.path.realpath",
"numpy.expand_dims",
"keras.preprocessing.image.img_to_array",
"numpy.max",
"keras.layers.Dense",
"keras.layers.Conv2D",
"keras.layers.GlobalMaxPooling2D",
"keras.models.Sequential",
"keras.layers.MaxPooling2D",
"keras.layers.BatchNor... | [((380, 399), 'keras.preprocessing.image.img_to_array', 'img_to_array', (['image'], {}), '(image)\n', (392, 399), False, 'from keras.preprocessing.image import img_to_array\n'), ((412, 441), 'numpy.expand_dims', 'np.expand_dims', (['image'], {'axis': '(0)'}), '(image, axis=0)\n', (426, 441), True, 'import numpy as np\n... |
import csv
import itertools
import os
import pathlib
import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
import nashpy as nash
import numpy as np
import pandas as pd
import ambulance_game as abg
# from nashpy.algorithms.lemke_howson_lex import lemke_howson_lex
def get_index_of_values(problem_parame... | [
"matplotlib.pyplot.title",
"numpy.load",
"numpy.sum",
"csv.reader",
"numpy.random.seed",
"numpy.argmax",
"matplotlib.pyplot.bar",
"nashpy.Game.lemke_howson_enumeration",
"matplotlib.pyplot.figure",
"numpy.isclose",
"pathlib.Path",
"numpy.round",
"nashpy.Game",
"numpy.max",
"numpy.linspac... | [((2161, 2179), 'os.system', 'os.system', (['command'], {}), '(command)\n', (2170, 2179), False, 'import os\n'), ((4210, 4243), 'numpy.load', 'np.load', (["(target_path / 'main.npz')"], {}), "(target_path / 'main.npz')\n", (4217, 4243), True, 'import numpy as np\n'), ((6111, 6126), 'nashpy.Game', 'nash.Game', (['A', 'B... |
import numpy as np
import torch
from PIL import ImageFilter
class RandomGaussianBlur(object):
def __init__(self, stddev):
self.stddev = stddev
def __call__(self, image):
radius = np.abs(np.random.normal(scale=self.stddev))
return image.filter(ImageFilter.GaussianBlur(radius))
class ... | [
"PIL.ImageFilter.GaussianBlur",
"torch.randn_like",
"numpy.random.normal"
] | [((213, 248), 'numpy.random.normal', 'np.random.normal', ([], {'scale': 'self.stddev'}), '(scale=self.stddev)\n', (229, 248), True, 'import numpy as np\n'), ((278, 310), 'PIL.ImageFilter.GaussianBlur', 'ImageFilter.GaussianBlur', (['radius'], {}), '(radius)\n', (302, 310), False, 'from PIL import ImageFilter\n'), ((575... |
"""
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual,
royalty-free right to use, copy, and modify the software code provided by us
("Software Code"). You may not sublicense the Software Code or any use of it
(except to your affiliates... | [
"tensorflow.random.set_seed",
"pandas.DataFrame",
"numpy.random.seed",
"pandas.read_csv",
"keras.layers.LSTM",
"keras.layers.Dense",
"numpy.array",
"pandas.to_datetime",
"keras.models.Sequential",
"os.path.join",
"sklearn.metrics.mean_squared_error"
] | [((1749, 1769), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (1763, 1769), True, 'import numpy as np\n'), ((1770, 1794), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(1234)'], {}), '(1234)\n', (1788, 1794), True, 'import tensorflow as tf\n'), ((2784, 2796), 'keras.models.Sequential', '... |
from flask import Flask, render_template, request, redirect
from werkzeug.utils import secure_filename
import os
from shutil import copyfile
import numpy as np
from keras.preprocessing import image
from keras.models import load_model
import sys
from PIL import Image
sys.modules['Image'] = Image
import tensorflow as ... | [
"keras.models.load_model",
"os.path.abspath",
"flask.Flask",
"numpy.expand_dims",
"keras.preprocessing.image.img_to_array",
"keras.preprocessing.image.load_img",
"flask.render_template",
"shutil.copyfile",
"os.path.join"
] | [((345, 360), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (350, 360), False, 'from flask import Flask, render_template, request, redirect\n'), ((480, 501), 'keras.models.load_model', 'load_model', (['pathmodel'], {}), '(pathmodel)\n', (490, 501), False, 'from keras.models import load_model\n'), ((568, 6... |
# -*- coding: utf-8 -*-
"""
Reinforcement Learning by <NAME> Barto
7. Eligibility Traces
7.1 n-Step TD Prediction
Example 7.1: n-Step TD Methods on the Random Walk
"""
import numpy as np
from collections import defaultdict
import matplotlib.pyplot as plt
from collections import deque
class Environment(object):
de... | [
"numpy.random.seed",
"matplotlib.pyplot.ylim",
"numpy.power",
"matplotlib.pyplot.legend",
"collections.defaultdict",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.random.choice",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"collections.deque",
"numpy.sqrt"
] | [((2375, 2392), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (2389, 2392), True, 'import numpy as np\n'), ((2592, 2604), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (2602, 2604), True, 'import matplotlib.pyplot as plt\n'), ((2983, 2998), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""... |
import numpy
from collections import defaultdict
from kelpie.data import STD_ATOMIC_WEIGHTS
class AtomError(Exception):
"""Base class for error(s) in Atom objects."""
pass
class Atom(object):
"""Base class to store an atom."""
def __init__(self,
coordinates=None,
s... | [
"numpy.isnan",
"collections.defaultdict",
"numpy.shape",
"numpy.array",
"numpy.linalg.det"
] | [((8120, 8136), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (8131, 8136), False, 'from collections import defaultdict\n'), ((1064, 1103), 'numpy.array', 'numpy.array', (['coordinates'], {'dtype': '"""float"""'}), "(coordinates, dtype='float')\n", (1075, 1103), False, 'import numpy\n'), ((4923, 4... |
#!/usr/bin/env python
import os
import pickle
import numpy as np
import dataset.lfw
import aegan
def run():
experiment_name = 'lfw'
img_size = 64
epoch_size = 250
batch_size = 64
np.random.seed(1)
train_feed, test_feed = dataset.lfw.feeds(
alignment='landmarks', crop_size=150, resca... | [
"pickle.dump",
"numpy.random.seed",
"aegan.build_model",
"aegan.train",
"os.path.join"
] | [((204, 221), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (218, 221), True, 'import numpy as np\n'), ((468, 658), 'aegan.build_model', 'aegan.build_model', (['experiment_name', 'img_size'], {'n_hidden': '(128)', 'recon_depth': '(9)', 'recon_vs_gan_weight': '(1e-06)', 'real_vs_gen_weight': '(0.33)', '... |
#!/usr/bin/env python2
import os
import numpy as np
import pandas as pd
import cPickle as pickle
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.dates as mdates
from scipy import integrate
import sklearn.metrics as metrics
def fit_trend(x, y):
z = np... | [
"numpy.sum",
"numpy.abs",
"numpy.polyfit",
"pandas.read_csv",
"sklearn.metrics.r2_score",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"numpy.std",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.rcParams.update",
"seaborn.set_style",
"pandas.date_range",
"numpy.corrcoef"... | [((318, 337), 'numpy.polyfit', 'np.polyfit', (['x', 'y', '(1)'], {}), '(x, y, 1)\n', (328, 337), True, 'import numpy as np\n'), ((349, 361), 'numpy.poly1d', 'np.poly1d', (['z'], {}), '(z)\n', (358, 361), True, 'import numpy as np\n'), ((1345, 1371), 'sklearn.metrics.r2_score', 'metrics.r2_score', (['obs', 'mod'], {}), ... |
# Please contact the author(s) of this library if you have any questions.
# Authors: <NAME> ( <EMAIL> )
import numpy as np
class DubinsCarDyn(object):
def __init__(self, doneType='toEnd'):
# State bounds.
self.bounds = np.array([[-1.1, 1.1], # axis_0 = state, axis_1 = bounds.
... | [
"numpy.random.uniform",
"numpy.random.seed",
"numpy.abs",
"numpy.copy",
"numpy.zeros",
"numpy.mod",
"numpy.sin",
"numpy.array",
"numpy.linalg.norm",
"numpy.cos"
] | [((250, 302), 'numpy.array', 'np.array', (['[[-1.1, 1.1], [-1.1, 1.1], [0, 2 * np.pi]]'], {}), '([[-1.1, 1.1], [-1.1, 1.1], [0, 2 * np.pi]])\n', (258, 302), True, 'import numpy as np\n'), ((745, 807), 'numpy.array', 'np.array', (['[-self.max_turning_rate, 0.0, self.max_turning_rate]'], {}), '([-self.max_turning_rate, 0... |
from . import utils
from .errors import logger
from .relax import relax
import numpy as np
from skimage.exposure import rescale_intensity
import cv2
SCALING = dict(Landsat_pan=(0.001, 0.05),
Sentinel2_10m=(2e-5, 0.003),
RGB=(0, 0.25),
cropnet=(0, 1),
log=(-... | [
"skimage.exposure.rescale_intensity",
"numpy.uint8",
"numpy.array",
"numpy.where"
] | [((339, 390), 'numpy.array', 'np.array', (['[[1.0, 0.7], [0.7, 1.0]]'], {'dtype': '"""float32"""'}), "([[1.0, 0.7], [0.7, 1.0]], dtype='float32')\n", (347, 390), True, 'import numpy as np\n'), ((6751, 6783), 'numpy.uint8', 'np.uint8', (['(self.egm_proba * 255.0)'], {}), '(self.egm_proba * 255.0)\n', (6759, 6783), True,... |
"""
VAE + Pixel RNN/CNN
<NAME>
"""
import os, sys
sys.path.append(os.getcwd())
try: # This only matters on Ishaan's computer
import experiment_tools
experiment_tools.wait_for_gpu(high_priority=False)
except ImportError:
pass
import lsun
import lib
import lib.debug
import lib.mnist_binarized
import lib.m... | [
"numpy.sum",
"lib.ops.softmax_and_sample.softmax_and_sample",
"numpy.random.multinomial",
"theano.tensor.maximum",
"lib.ops.conv_decoder.ConvDecoder",
"lib.ops.diagonal_bilstm.DiagonalBiLSTM",
"theano.sandbox.rng_mrg.MRG_RandomStreams",
"lsun.load",
"numpy.exp",
"numpy.random.normal",
"scipy.mis... | [((2153, 2176), 'theano.sandbox.rng_mrg.MRG_RandomStreams', 'RandomStreams', ([], {'seed': '(234)'}), '(seed=234)\n', (2166, 2176), True, 'from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams\n'), ((7643, 7667), 'theano.tensor.iscalar', 'T.iscalar', (['"""total_iters"""'], {}), "('total_iters')\n", (76... |
import torch
import logging
import numpy as np
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
from temperature_scaling import ModelWithTemperature
from data_processor import processors, bert_base_model_config, output_modes
from utils.data_structure import Dataset
from tqdm impor... | [
"tqdm.tqdm",
"numpy.count_nonzero",
"logging.FileHandler",
"logging.basicConfig",
"torch.utils.data.DataLoader",
"numpy.corrcoef",
"os.path.dirname",
"transformers.AutoTokenizer.from_pretrained",
"torch.nn.Softmax",
"numpy.array",
"transformers.AutoModelForSequenceClassification.from_pretrained"... | [((492, 636), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(name)s - %(message)s"""', 'datefmt': '"""%m/%d/%Y %H:%M:%S"""', 'level': 'logging.DEBUG'}), "(format=\n '%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt=\n '%m/%d/%Y %H:%M:%S', level=... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""
MobileNetV1 for ImageNet using TL models
- mobilenetv2 : https://github.com/tensorflow/models/tree/master/research/slim/nets/mobilenet
- tf.slim : https://github.com/tensorflow/models/tree/master/research/slim#pre-trained-models
"""
import time
import... | [
"tensorflow.nn.softmax",
"mobilenetv1.MobileNetV1",
"tensorlayer.logging.set_verbosity",
"time.time",
"numpy.argsort",
"tensorlayer.prepro.imresize",
"tensorlayer.vis.read_image"
] | [((533, 575), 'tensorlayer.logging.set_verbosity', 'tl.logging.set_verbosity', (['tl.logging.DEBUG'], {}), '(tl.logging.DEBUG)\n', (557, 575), True, 'import tensorlayer as tl\n'), ((671, 699), 'mobilenetv1.MobileNetV1', 'MobileNetV1', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (682, 699), False, 'from mobil... |
#!/usr/bin/env python3
import cv2
import numpy as np
def preprocess_image(image_path):
img1 = cv2.imread(image_path)
a = np.double(img1)
b = a + 15
img2 = np.uint8(b)
sharpen_kernel = np.array([[-1,-1,-1], [-1,9,-1], [-1,-1,-1]])
sharpen = cv2.filter2D(img2, -1, sharpen_kernel)
cv2.imshow... | [
"numpy.uint8",
"cv2.filter2D",
"numpy.double",
"cv2.imwrite",
"cv2.imread",
"numpy.array",
"cv2.imshow"
] | [((100, 122), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (110, 122), False, 'import cv2\n'), ((131, 146), 'numpy.double', 'np.double', (['img1'], {}), '(img1)\n', (140, 146), True, 'import numpy as np\n'), ((173, 184), 'numpy.uint8', 'np.uint8', (['b'], {}), '(b)\n', (181, 184), True, 'import n... |
"""
Plots mooring records as pcolormesh fields C(t,z).
Currently oriented around NPZD variables.
"""
# setup
import netCDF4 as nc
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.dates as mdates
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from datetime import datetime
import os; ... | [
"netCDF4.Dataset",
"zfun.filt_godin_mat",
"os.path.abspath",
"Lfun.choose_item",
"matplotlib.pyplot.show",
"numpy.sum",
"Lfun.modtime_to_datetime",
"matplotlib.pyplot.close",
"matplotlib.dates.num2date",
"matplotlib.pyplot.vlines",
"matplotlib.pyplot.figure",
"numpy.diff",
"mpl_toolkits.axes... | [((425, 438), 'Lfun.Lstart', 'Lfun.Lstart', ([], {}), '()\n', (436, 438), False, 'import Lfun\n'), ((814, 828), 'netCDF4.Dataset', 'nc.Dataset', (['fn'], {}), '(fn)\n', (824, 828), True, 'import netCDF4 as nc\n'), ((958, 982), 'matplotlib.dates.date2num', 'mdates.date2num', (['dt_list'], {}), '(dt_list)\n', (973, 982),... |
"""Common ombre methods"""
import numpy as np
from numpy import ma
import matplotlib.pyplot as plt
from matplotlib import animation
import warnings
from astropy.io import fits
from astropy.modeling.blackbody import blackbody_lambda
from astropy.stats import sigma_clipped_stats
import astropy.units as u
from scipy.op... | [
"numpy.nanpercentile",
"numpy.sum",
"exoplanet.optimize",
"pymc3.math.sum",
"pymc3.Deterministic",
"astropy.stats.sigma_clipped_stats",
"exoplanet.ImpactParameter",
"pymc3.Normal",
"numpy.ones",
"numpy.argmin",
"tqdm.notebook.tqdm",
"numpy.product",
"numpy.mean",
"pymc3.Uniform",
"numpy.... | [((902, 930), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(6, 6)'}), '(figsize=(6, 6))\n', (914, 930), True, 'import matplotlib.pyplot as plt\n'), ((1085, 1103), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['cmap'], {}), '(cmap)\n', (1097, 1103), True, 'import matplotlib.pyplot as plt\n'), ((1353... |
from connector_components.orderbook import OrderBook
from datetime import datetime as dt
from time import time
import requests
import numpy as np
from configurations.configs import RECORD_DATA
class CoinbaseOrderBook(OrderBook):
def __init__(self, sym):
super(CoinbaseOrderBook, self).__init__(sym, 'coinb... | [
"requests.get",
"datetime.datetime.now",
"numpy.isnan",
"time.time"
] | [((559, 565), 'time.time', 'time', ([], {}), '()\n', (563, 565), False, 'from time import time\n'), ((1047, 1053), 'time.time', 'time', ([], {}), '()\n', (1051, 1053), False, 'from time import time\n'), ((750, 756), 'time.time', 'time', ([], {}), '()\n', (754, 756), False, 'from time import time\n'), ((1120, 1141), 'da... |
import flow
import warnings
from flow import FlowProject, directives
from mosdef_slitpore.utils.cassandra_helpers import check_simulation
warnings.filterwarnings("ignore", category=DeprecationWarning)
class Project(FlowProject):
pass
@Project.label
def equil_complete(job):
"""Check if the equilibration ... | [
"warnings.filterwarnings",
"mosdef_slitpore.utils.utils.get_ff",
"mosdef_cassandra.run",
"mbuild.Box",
"mosdef_cassandra.restart",
"numpy.exp",
"flow.directives",
"mosdef_cassandra.MoveSet",
"mosdef_cassandra.System"
] | [((142, 204), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', category=DeprecationWarning)\n", (165, 204), False, 'import warnings\n'), ((645, 674), 'flow.directives', 'directives', ([], {'omp_num_threads': '(4)'}), '(omp_num_threads=4)\n', (655,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
DeepLab V3+ EdgeTPUV2 and AutoSeg EdgeTPU Image segmenation with OpenCV.
Copyright (c) 2020 <NAME>
This software is released under the MIT License.
See the LICENSE file in the project root for more information.
"""
import argparse
import time
import... | [
"cv2.resize",
"utils.label_util.label_to_color_image",
"argparse.ArgumentParser",
"utils.tflite_util.set_input_tensor",
"cv2.cvtColor",
"cv2.imwrite",
"numpy.unique",
"numpy.expand_dims",
"cv2.imread",
"utils.tflite_util.make_interpreter",
"utils.label_util.create_pascal_label_colormap",
"nump... | [((487, 513), 'numpy.expand_dims', 'np.expand_dims', (['im'], {'axis': '(0)'}), '(im, axis=0)\n', (501, 513), True, 'import numpy as np\n'), ((689, 722), 'utils.tflite_util.get_output_tensor', 'get_output_tensor', (['interpreter', '(0)'], {}), '(interpreter, 0)\n', (706, 722), False, 'from utils.tflite_util import get_... |
import re
import numbers
from .utility import convert_units
from scipy.integrate import odeint
import numpy as np
class Solution(object):
""" PhreeqPy Solution Class """
def __init__(self, phreeqpython, number):
self.pp = phreeqpython
self.factor = 1
self.number = number
def copy(... | [
"scipy.integrate.odeint",
"numpy.diff",
"re.search"
] | [((5410, 5455), 'scipy.integrate.odeint', 'odeint', (['calc_rate', '(0)', 'time'], {'args': '((m0,) + args)'}), '(calc_rate, 0, time, args=(m0,) + args)\n', (5416, 5455), False, 'from scipy.integrate import odeint\n'), ((3400, 3426), 're.search', 're.search', (['regexp', 'species'], {}), '(regexp, species)\n', (3409, 3... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import inspect
import numpy as np
import emcee
import george
from george import kernels
import os
import sys
currentframe = inspect.currentframe()
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(currentframe)))
parentdir = os.path.dirname(currentdir)
sys.pa... | [
"numpy.ones_like",
"numpy.argmax",
"emcee.EnsembleSampler",
"numpy.random.randn",
"os.path.dirname",
"sys.path.insert",
"inspect.getfile",
"numpy.array",
"numpy.loadtxt",
"inspect.getargspec",
"inspect.currentframe",
"gpew.plot_lines",
"george.kernels.ExpSquaredKernel"
] | [((174, 196), 'inspect.currentframe', 'inspect.currentframe', ([], {}), '()\n', (194, 196), False, 'import inspect\n'), ((286, 313), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (301, 313), False, 'import os\n'), ((314, 343), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parentdir'], ... |
import pandas as ps
import numpy as np
import time
from analysis.correlation import corr
from analysis.covariance import cov
from analysis.symmetric import isSymmetric
from analysis.definite import isPositiveDefinite
from discrete.transformation import test
#from algorithms.morgan import morgan
import tests.morgan as ... | [
"pandas.read_csv",
"tests.morgan.testbed",
"numpy.array"
] | [((371, 416), 'pandas.read_csv', 'ps.read_csv', (['"""resources/WIKI-FB.csv"""'], {'sep': '""","""'}), "('resources/WIKI-FB.csv', sep=',')\n", (382, 416), True, 'import pandas as ps\n'), ((545, 579), 'numpy.array', 'np.array', (['matrix'], {'dtype': 'np.float64'}), '(matrix, dtype=np.float64)\n', (553, 579), True, 'imp... |
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from models import nn_tf
from data_utils import get_data, segment_data, get_mfcc_train, get_mfcc_valid, augment_audio_train, augment_audio_valid,augment_mfcc_train,augment_mfcc_valid
from tools import plot_confusion_matrix_raw, cached
from... | [
"data_utils.get_data",
"numpy.argmax",
"sklearn.model_selection.train_test_split",
"data_utils.augment_mfcc_valid",
"data_utils.augment_audio_train",
"data_utils.get_mfcc_valid",
"wandb.keras.WandbCallback",
"tools.plot_confusion_matrix_raw",
"models.nn_tf.NN_model",
"matplotlib.pyplot.show",
"t... | [((502, 545), 'wandb.init', 'wandb.init', ([], {'project': '"""cbc"""', 'entity': '"""mandula"""'}), "(project='cbc', entity='mandula')\n", (512, 545), False, 'import wandb\n'), ((3602, 3631), 'tools.cached', 'cached', (['"""./cache/dataset.pkl"""'], {}), "('./cache/dataset.pkl')\n", (3608, 3631), False, 'from tools im... |
#!/usr/bin/env python3.8
'''View garden depth measurement results in 3D.
This process is resource intensive. For a full garden scan it requires:
* ~200MB disk space for Python packages
* ~8GB RAM
* ~2GB disk space for data files
'''
import os
import sys
import json
from time import time
START = time()
print('load... | [
"os.mkdir",
"numpy.load",
"os.remove",
"os.removedirs",
"json.dumps",
"cv2.warpAffine",
"numpy.rot90",
"os.path.join",
"cv2.getRotationMatrix2D",
"cv2.imwrite",
"os.path.exists",
"open3d.io.write_point_cloud",
"open3d.geometry.TriangleMesh.create_box",
"open3d.geometry.AxisAlignedBoundingB... | [((302, 308), 'time.time', 'time', ([], {}), '()\n', (306, 308), False, 'from time import time\n'), ((685, 691), 'time.time', 'time', ([], {}), '()\n', (689, 691), False, 'from time import time\n'), ((744, 813), 'open3d.utility.VerbosityContextManager', 'o3d.utility.VerbosityContextManager', (['o3d.utility.VerbosityLev... |
# 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... | [
"numpy.ones",
"numpy.isnan",
"numpy.arange",
"numpy.round",
"numpy.max",
"makani.lib.python.batch_sim.scoring_functions.scoring_functions_util.IsSelectionValid",
"numpy.reshape",
"numpy.size",
"csv.writer",
"makani.lib.python.batch_sim.batch_sim_util.GetTelemetryIndices",
"numpy.argwhere",
"ma... | [((1060, 1115), 'makani.lib.python.c_helpers.EnumHelper', 'c_helpers.EnumHelper', (['"""GroundStationMode"""', 'plc_messages'], {}), "('GroundStationMode', plc_messages)\n", (1080, 1115), False, 'from makani.lib.python import c_helpers\n'), ((29557, 29582), 'collections.OrderedDict', 'collections.OrderedDict', ([], {})... |
import numpy as np
import pandas as pd
import math
import matplotlib.pyplot as plt
data = pd.read_csv('../dataset/3D_spatial_network.csv')
# data = pd.read_csv('../dataset/test.csv')
N = len(data)
data = data.sample(frac=1).reset_index(drop=True)
print(data)
train_set_size = int(0.7 * N)
test_set_size = int(0.3 * N)
... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"math.sqrt",
"pandas.read_csv",
"numpy.power",
"numpy.square",
"numpy.min",
"numpy.mean",
"numpy.array",
"numpy.max",
"numpy.dot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((91, 139), 'pandas.read_csv', 'pd.read_csv', (['"""../dataset/3D_spatial_network.csv"""'], {}), "('../dataset/3D_spatial_network.csv')\n", (102, 139), True, 'import pandas as pd\n'), ((1714, 1736), 'numpy.array', 'np.array', (['([1] * w_size)'], {}), '([1] * w_size)\n', (1722, 1736), True, 'import numpy as np\n'), ((... |
from __future__ import absolute_import, division, print_function
import argparse
import gzip
import os
import time
import numpy as np
import six
import tensorflow as tf
import zhusuan as zs
from six.moves import cPickle as pickle
import dataset
import utils
@zs.meta_bayesian_net(scope="gen", reuse_variables=True)... | [
"argparse.ArgumentParser",
"tensorflow.train.latest_checkpoint",
"numpy.mean",
"os.path.join",
"os.path.dirname",
"tensorflow.concat",
"tensorflow.placeholder",
"zhusuan.variational.elbo",
"utils.save_image_collections",
"zhusuan.BayesianNet",
"zhusuan.meta_bayesian_net",
"numpy.random.binomia... | [((265, 320), 'zhusuan.meta_bayesian_net', 'zs.meta_bayesian_net', ([], {'scope': '"""gen"""', 'reuse_variables': '(True)'}), "(scope='gen', reuse_variables=True)\n", (285, 320), True, 'import zhusuan as zs\n'), ((834, 867), 'zhusuan.reuse_variables', 'zs.reuse_variables', ([], {'scope': '"""q_net"""'}), "(scope='q_net... |
"""
This module contains classes that define the stress tensor for various
solid materials. The parent class :class:`ElasticMaterial` is used for
all class definitions. Then materials are separated into isotropic and
anisotropic using :class:`IsotropicMaterial` and
:class:`AnisotropicMaterial`.
Parameters required by ... | [
"ufl.domain.find_geometric_dimension",
"dolfin.tr",
"dolfin.inner",
"dolfin.grad",
"dolfin.cross",
"dolfin.outer",
"dolfin.Identity",
"dolfin.det",
"dolfin.inv",
"dolfin.ln",
"dolfin.Constant",
"dolfin.sym",
"dolfin.div",
"dolfin.exp",
"numpy.sqrt"
] | [((74913, 74929), 'dolfin.Constant', 'dlf.Constant', (['nu'], {}), '(nu)\n', (74925, 74929), True, 'import dolfin as dlf\n'), ((74978, 74993), 'dolfin.Constant', 'dlf.Constant', (['E'], {}), '(E)\n', (74990, 74993), True, 'import dolfin as dlf\n'), ((75050, 75069), 'dolfin.Constant', 'dlf.Constant', (['kappa'], {}), '(... |
"""
Author: Outcast (https://stackoverflow.com/users/9024698/outcast)
Source: https://stackoverflow.com/a/52897289/2664718
License: CC BY-SA 4.0
"""
def set_seed(seed_value):
# Seed value
# Apparently you may use different seed values at each stage
# 1. Set `PYTHONHASHSEED` environment variable at a fixe... | [
"tensorflow.compat.v1.keras.backend.set_session",
"numpy.random.seed",
"tensorflow.compat.v1.get_default_graph",
"tensorflow.compat.v1.set_random_seed",
"random.seed",
"tensorflow.compat.v1.ConfigProto"
] | [((488, 511), 'random.seed', 'random.seed', (['seed_value'], {}), '(seed_value)\n', (499, 511), False, 'import random\n'), ((602, 628), 'numpy.random.seed', 'np.random.seed', (['seed_value'], {}), '(seed_value)\n', (616, 628), True, 'import numpy as np\n'), ((796, 836), 'tensorflow.compat.v1.set_random_seed', 'tf.compa... |
import numpy as np
import pandas as pa
from skimage import measure
from nilabels.tools.aux_methods.utils_nib import one_voxel_volume
from nilabels.tools.aux_methods.label_descriptor_manager import LabelsDescriptorManager
def check_missing_labels(im_segm, labels_descriptor, pfi_where_log=None):
"""
:param im_... | [
"pandas.DataFrame",
"skimage.measure.label",
"numpy.where",
"numpy.array",
"pandas.Series",
"nilabels.tools.aux_methods.utils_nib.one_voxel_volume"
] | [((2263, 2314), 'pandas.Series', 'pa.Series', (['num_voxels_per_label'], {'index': 'labels_names'}), '(num_voxels_per_label, index=labels_names)\n', (2272, 2314), True, 'import pandas as pa\n'), ((2439, 2564), 'pandas.DataFrame', 'pa.DataFrame', (["{'Num voxels': se_voxels, 'Volumes': se_volume, 'Connected components':... |
import numpy as np
import matplotlib.pyplot as plt
from lmfit import Model
from glob import glob
path = r'D:\data\20191008\*\*_lin_avg.dat'
files = glob(path)
wm = 6.583815*1e6
for file in files:
plt.figure(figsize = (5, 4))
freq1, psd1 = np.loadtxt(file, unpack = True)
baseline = np.mean... | [
"matplotlib.pyplot.tight_layout",
"numpy.sum",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.loadtxt",
"glob.glob",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig"
] | [((158, 168), 'glob.glob', 'glob', (['path'], {}), '(path)\n', (162, 168), False, 'from glob import glob\n'), ((217, 243), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(5, 4)'}), '(figsize=(5, 4))\n', (227, 243), True, 'import matplotlib.pyplot as plt\n'), ((265, 294), 'numpy.loadtxt', 'np.loadtxt', (['f... |
import os
import numpy as np
import torch
from zeroshot.datasets.prevideo import ZSLPrecompERVideoLabelWordDataset
class ZSLConceptVideoLabelWordDataset(ZSLPrecompERVideoLabelWordDataset):
def __init__(self, name_file, video_concept_file, label_text_file, meta_file,
class_idxs_file, k_class_split, bit_cpt_lemm... | [
"numpy.stack",
"numpy.array",
"torch.sum",
"torch.LongTensor"
] | [((3105, 3151), 'torch.LongTensor', 'torch.LongTensor', (["[x['targets'] for x in data]"], {}), "([x['targets'] for x in data])\n", (3121, 3151), False, 'import torch\n'), ((3202, 3244), 'numpy.array', 'np.array', (["[x['vis_cpt_ids'] for x in data]"], {}), "([x['vis_cpt_ids'] for x in data])\n", (3210, 3244), True, 'i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.