# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/01_inst.ipynb.

# %% auto 0
__all__ = ['moduleloader', 'modulespec', 'pathlike', 'path', 'posixpath', 'sig', 'param', 'logger', 'ichain', 'iprod', 'ziplong',
           'dict_keys', 'dict_values', 'dict_items', 'moduletype', 'wrappertype', 'builtinfunctype', 'trackbacktype',
           'functiontype', 'nonetype', 'mapping', 'iterable', 'nan', 'npnan', 'npNaN', 'npNAN', 'pdna', 'ptnan',
           'number', 'npbool', 'repattern', 'strtemplate', 'nptype', 'npmatrix', 'npdatasource', 'nparray', 'recarray',
           'npempty', 'sparray', 'spmatrix', 'splinalg', 'speigs', 'sppdist', 'cscarray', 'cscmatrix', 'cooarray',
           'coomatrix', 'csrarray', 'csrmatrix', 'diaarray', 'diamatrix', 'dokarray', 'dokmatrix', 'lilarray',
           'lilmatrix', 'bsrarray', 'bsrmatrix', 'pdindex', 'pdseries', 'pdcatindex', 'pddataframe', 'pddelegate',
           'pdcataccessor', 'ptsize', 'pttype', 'ptdevice', 'ptmodule', 'ptdataset', 'ptdataloader', 'pttensorbase',
           'pttensor', 'ptinttensor', 'ptbooltensor', 'ptfloattensor', 'ptmemfmt', 'ptpresfmt', 'ptdatasets',
           'pttransforms', 'ptfunctional', 'plmodule', 'pldatamodule', 'odefn', 'sdefn', 'neurode', 'neursde',
           'augmenter', 'ito', 'brownian', 'anndata', 'gtbase', 'gtdata', 'bgraph', 'dgraph', 'lgraph', 'kgraph',
           'tgraph', 'mgraph', 'klgraph', 'mlgraph', 'tlgraph', 'vidcap', 'image', 'mpl', 'plt', 'artist', 'colormap',
           'lscolormap', 'mplpatch', 'mplaxbase', 'mplaxes', 'sns', 'skestimator', 'skpairwise', 'PHATE', 'richtree',
           'richtext', 'richcons', 'richprog', 'richtask', 'tqdmauto', 'typer']

# %% ../nbs/01_inst.ipynb 5
from functools import wraps

# %% ../nbs/01_inst.ipynb 7
from types import ModuleType
from typing import (Self, Type, Union, Optional, NamedTuple, ClassVar, Iterable, )

# %% ../nbs/01_inst.ipynb 11
from .core import matr

# %% ../nbs/01_inst.ipynb 14
moduleloader = matr('importlib', 'Loader')
'''`importlib.Loader`''';

modulespec = matr('inspect.machinery', 'ModuleSpec')
'''`importlib.machinery.ModuleSpec`''';

# %% ../nbs/01_inst.ipynb 16
pathlike = matr('os', 'PathLike')
'''`os.PathLike`''';

path = matr('pathlib', 'Path')
'''`pathlib.Path`''';

posixpath = matr('pathlib', 'PosixPath')
'''`pathlib.PosixPath`''';

# %% ../nbs/01_inst.ipynb 18
sig = matr('inspect', 'Signature')
'''`inspect.Signature`''';

param = matr('inspect', 'Parameter')
'''`inspect.Parameter`''';

# %% ../nbs/01_inst.ipynb 20
logger = matr('logging', 'Logger')
'''`logging.Logger`''';

# %% ../nbs/01_inst.ipynb 22
ichain = matr('itertools', 'chain')
'''`itertools.chain`''';

iprod = matr('itertools', 'product')
'''`itertools.product`''';

ziplong = matr('itertools', 'zip_longest')
'''`itertools.zip_longest`''';

# %% ../nbs/01_inst.ipynb 24
dict_keys = matr('_collections_abc', 'dict_keys')
'''`collections.abc.dict_keys`''';

dict_values = matr('_collections_abc', 'dict_values')
'''`collections.abc.dict_values`''';

dict_items = matr('_collections_abc', 'dict_items')
'''`collections.abc.dict_items`''';

# %% ../nbs/01_inst.ipynb 26
moduletype = matr('types', 'ModuleType')
'''`types.ModuleType`''';

wrappertype = matr('types', 'MethodWrapperType')
'''`types.MethodWrapperType`''';

builtinfunctype = matr('types', 'BuiltinFunctionType')
'''`types.BuiltinFunctionType`''';

trackbacktype = matr('types', 'TracebackType')
'''`types.TracebackType`''';

functiontype = matr('types', 'FunctionType')
'''`types.FunctionType`''';

nonetype = matr('types', 'NoneType')
'''`types.NoneType`''';

mapping = matr('collections', 'Mapping')
'''`collections.Mapping`''';

iterable = matr('collections', 'Iterable')
'''`collections.Iterable`''';

nonetype = matr('types', 'NoneType')
'''`types.NoneType`''';

# %% ../nbs/01_inst.ipynb 28
nan = matr('math', 'nan')
'''`math.nan`''';

# %% ../nbs/01_inst.ipynb 29
npnan = matr('numpy', 'nan', default=nan)
'''`numpy.nan`''';

npNaN = matr('numpy', 'NaN', default=nan)
'''`numpy.NaN`''';

npNAN = matr('numpy', 'NAN', default=nan)
'''`numpy.NAN`''';
# npnan, npNaN, npNAN = matrs('numpy', 'nan', 'NaN', 'NAN', default=nan)
pdna = matr('pandas', 'NA', default=nan)
'''`pandas.NA`''';

ptnan = matr('torch', 'nan', default=nan)
'''`torch.nan`''';

# %% ../nbs/01_inst.ipynb 31
number = matr('numbers', 'Number')
'''`numbers.Number`''';

npbool = matr('numpy', 'bool_', default=bool)
'''`numpy.bool_`''';

# %% ../nbs/01_inst.ipynb 33
repattern = matr('re', 'Pattern')
'''`re.Pattern`''';

strtemplate = matr('string', 'Template')
'''`string.Template`''';

# %% ../nbs/01_inst.ipynb 35
nptype = matr('numpy', 'dtype', default=type)
'''`numpy.dtype`''';

npmatrix = matr('numpy', 'matrix', default=list)
'''`numpy.matrix`''';

npdatasource = matr('numpy', 'DataSource', default=pathlike)
'''`numpy.DataSource`''';

nparray = matr('numpy', 'ndarray', default=list)
'''`numpy.ndarray`''';

recarray = matr('numpy', 'recarray', default=list)
'''`numpy.recarray`''';

npempty = matr('numpy', 'empty', default=list)
'''`numpy.empty`''';

# npmatrix, nparray, recarray, npempty = \
#     matrs('numpy', 'matrix', 'ndarray', 'recarray', 'empty', default=list)

# %% ../nbs/01_inst.ipynb 37
sparray = matr('scipy.sparse._arrays', '_sparray')
sparray = matr('scipy.sparse', 'sparray', default=(sparray or list))
'''`scipy.sparse.sparray`''';

spmatrix = matr('scipy.sparse', 'spmatrix', default=list)
'''`scipy.sparse.spmatrix`''';

# %% ../nbs/01_inst.ipynb 38
splinalg = matr('scipy.sparse', 'linalg')
'''`scipy.sparse.linalg`''';

speigs = matr('scipy.sparse.linalg', 'eigs')
'''`scipy.sparse.linalg.eigs`''';

sppdist = matr('scipy.spatial.distance', 'pdist')
'''`scipy.spatial.distance.pdist`''';

# %% ../nbs/01_inst.ipynb 39
cscarray = matr('scipy.sparse', 'csc_array')
'''`scipy.sparse.csc_array`''';

cscmatrix = matr('scipy.sparse', 'csc_matrix')
'''`scipy.sparse.csc_matrix`''';

cooarray = matr('scipy.sparse', 'coo_array')
'''`scipy.sparse.coo_array`''';

coomatrix = matr('scipy.sparse', 'coo_matrix')
'''`scipy.sparse.coo_matrix`''';

csrarray = matr('scipy.sparse', 'csr_array')
'''`scipy.sparse.csr_array`''';

csrmatrix = matr('scipy.sparse', 'csr_matrix')
'''`scipy.sparse.csr_matrix`''';

diaarray = matr('scipy.sparse', 'dia_array')
'''`scipy.sparse.dia_array`''';

diamatrix = matr('scipy.sparse', 'dia_matrix')
'''`scipy.sparse.dia_matrix`''';

dokarray = matr('scipy.sparse', 'dok_array')
'''`scipy.sparse.dok_array`''';

dokmatrix = matr('scipy.sparse', 'dok_matrix')
'''`scipy.sparse.dok_matrix`''';

lilarray = matr('scipy.sparse', 'lil_array')
'''`scipy.sparse.lil_array`''';

lilmatrix = matr('scipy.sparse', 'lil_matrix')
'''`scipy.sparse.lil_matrix`''';

bsrarray = matr('scipy.sparse', 'bsr_array')
'''`scipy.sparse.bsr_array`''';

bsrmatrix = matr('scipy.sparse', 'bsr_matrix')
'''`scipy.sparse.bsr_matrix`''';

# %% ../nbs/01_inst.ipynb 41
pdindex = matr('pandas', 'Index', default=list)
'''`pandas.Index`''';

pdseries = matr('pandas', 'Series', default=list)
'''`pandas.Series`''';

pdcatindex = matr('pandas', 'CategoricalIndex', default=list)
'''`pandas.CategoricalIndex`''';

pddataframe = matr('pandas', 'DataFrame', default=list)
'''`pandas.DataFrame`''';

# pdindex, pdseries, pdcatindex, pddataframe = \
#     matrs('pandas', 'Index', 'Series', 'CategoricalIndex', 'DataFrame', default=list)

# %% ../nbs/01_inst.ipynb 42
pddelegate = matr('pandas.core.accessor', 'PandasDelegate')
'''`pandas.core.accessor.PandasDelegate`''';

pdcataccessor = matr('pandas.core.arrays.categorical', 'CategoricalAccessor')
'''`pandas.core.arrays.categorical.CategoricalAccessor`''';

# %% ../nbs/01_inst.ipynb 44
ptsize = matr('torch', 'size', default=tuple)
'''`torch.Size`''';

pttype = matr('torch', 'dtype', default=type)
'''`torch.dtype`''';

ptdevice = matr('torch', 'device', default=str)
'''`torch.device`''';

# %% ../nbs/01_inst.ipynb 45
ptmodule = matr('torch.nn', 'Module')
'''`torch.nn.Module`''';

ptdataset = matr('torch.utils.data', 'Dataset')
'''`torch.utils.data.Dataset`''';

ptdataloader = matr('torch.utils.data', 'DataLoader')
'''`torch.utils.data.DataLoader`''';
# ptdataset, ptdataloader = matrs('torch.utils.data', 'Dataset', 'DataLoader')

pttensorbase = matr('torch._C', '_TensorBase')
'''`torch._C._TensorBase`''';

pttensor = matr('torch', 'Tensor', bases=(pttensorbase, ))
'''`torch.Tensor`''';

ptinttensor = matr('torch', 'IntTensor', bases=(pttensor, ))
'''`torch.IntTensor`''';

ptbooltensor = matr('torch', 'BoolTensor', bases=(pttensor, ))
'''`torch.BoolTensor`''';

ptfloattensor = matr('torch', 'FloatTensor', bases=(pttensor, ))
'''`torch.FloatTensor`''';

# ptinttensor, ptbooltensor, ptfloattensor = \
#     matrs('torch', 'IntTensor', 'BoolTensor', 'FloatTensor', bases=(pttensor, ))

# %% ../nbs/01_inst.ipynb 46
ptmemfmt = matr('torch', 'memory_format', bases=(type, ))
'''`torch.memory_format`''';

ptpresfmt = matr('torch', 'preserve_format', bases=(ptmemfmt, ))
'''`torch.preserve_format`''';

# %% ../nbs/01_inst.ipynb 48
ptdatasets = matr('torchvision.datasets')
'''`torchvision.datasets`''';

pttransforms = matr('torchvision.transforms')
'''`torchvision.transforms`''';

ptfunctional = matr('torchvision.transforms.functional')
'''`torchvision.transforms.functional`''';

# %% ../nbs/01_inst.ipynb 50
plmodule = matr('pytorch_lightning', 'LightningModule', default=ptmodule)
'''`lightning.LightningModule`''';

pldatamodule = matr('pytorch_lightning', 'LightningDataModule', default=list)
'''`lightning.LightningDataModule`''';

# %% ../nbs/01_inst.ipynb 52
odefn = matr('torchdyn.core.defunc', 'ODEFunc')
'''`torchdyn.core.defunc.ODEFunc`''';

sdefn = matr('torchdyn.core.defunc', 'SDEFunc')
'''`torchdyn.core.defunc.SDEFunc`''';
# odefn, sdefn = matrs('torchdyn.core.defunc', 'ODEFunc', 'SDEFunc')

neurode = matr('torchdyn.core', 'NeuralODE', default=ptmodule)
'''`torchdyn.core.NeuralODE`''';

neursde = matr('torchdyn.core', 'NeuralSDE', default=ptmodule)
'''`torchdyn.core.NeuralSDE`''';
# neurode, neursde = matrs('torchdyn.core', 'NeuralODE', 'NeuralSDE', default=ptmodule)

augmenter = matr('torchdyn.nn', 'Augmenter')
'''`torchdyn.nn.augmenter`''';

# %% ../nbs/01_inst.ipynb 54
ito = matr('torchsde', 'SDEIto')
'''`torchsde.ito`''';

brownian = matr('torchsde', 'BrownianInterval')
'''`torchsde.BrownianInterval`''';

# %% ../nbs/01_inst.ipynb 56
anndata = matr('anndata', 'AnnData')
'''`anndata.AnnData`''';

# %% ../nbs/01_inst.ipynb 58
gtbase = matr('graphtools.base', 'Base')
'''`graphtools.base.Base`''';

gtdata = matr('graphtools.base', 'Data', bases=(gtbase, ))
'''`graphtools.base.Data`''';

bgraph = matr('graphtools.base', 'BaseGraph', bases=(gtbase, ))
'''`graphtools.base.BaseGraph`''';

dgraph = matr('graphtools.base', 'DataGraph', bases=(gtdata, bgraph))
'''`graphtools.base.DataGraph`''';

# %% ../nbs/01_inst.ipynb 59
lgraph = matr('graphtools.graphs', 'LandmarkGraph', bases=(dgraph, ))
'''`graphtools.graphs.LandmarkGraph`''';

kgraph = matr('graphtools.graphs', 'kNNGraph', bases=(dgraph, ))
'''`graphtools.graphs.kNNGraph`''';

tgraph = matr('graphtools.graphs', 'TraditionalGraph', bases=(dgraph, ))
'''`graphtools.graphs.TraditionalGraph`''';

mgraph = matr('graphtools.graphs', 'MNNGraph', bases=(dgraph, ))
'''`graphtools.graphs.MNNGraph`''';

# lgraph, kgraph, tgraph, mgraph = \
#     matrs('graphtools.graphs', 'LandmarkGraph', 'kNNGraph', 'TraditionalGraph', 'MNNGraph', bases=(dgraph, ))

# %% ../nbs/01_inst.ipynb 60
klgraph = matr('graphtools.graphs', 'kNNLandmarkGraph', bases=(kgraph, lgraph, ))
'''`graphtools.graphs.kNNLandmarkGraph`''';

mlgraph = matr('graphtools.graphs', 'MNNLandmarkGraph', bases=(mgraph, lgraph, ))
'''`graphtools.graphs.MNNLandmarkGraph`''';

tlgraph = matr('graphtools.graphs', 'TraditionalLandmarkGraph', bases=(tgraph, lgraph, ))
'''`graphtools.graphs.TraditionalLandmarkGraph`''';

# %% ../nbs/01_inst.ipynb 62
vidcap = matr('cv2', 'VideoCapture')
'''`cv2.VideoCapture`''';

# %% ../nbs/01_inst.ipynb 64
image = matr('PIL.Image', 'Image')
'''`PIL.Image.Image`''';

# %% ../nbs/01_inst.ipynb 66
mpl = matr('matplotlib')
'''`matplotlib`''';

plt = matr('matplotlib', 'pyplot', bases=(ModuleType, ))
'''`matplotlib.pyplot`''';

artist = matr('matplotlib.artist', 'Artist')
'''`matplotlib.artist.Artist`''';

colormap = matr('matplotlib.colors', 'Colormap')
'''`matplotlib.colors.Colormap`''';

lscolormap = matr('matplotlib.colors', 'LinearSegmentedColormap', bases=(colormap, ))
'''`matplotlib.colors.LinearSegmentedColormap`''';

mplpatch = matr('matplotlib.patches', 'Patch', bases=(artist, ))
'''`matplotlib.patches.Patch`''';

mplaxbase = matr('matplotlib.axes._axes', '_AxesBase', bases=(artist, ))
'''`matplotlib.axes._axes._AxesBase`''';

mplaxes = matr('matplotlib.axes._axes', 'Axes', bases=(mplaxbase, ))
'''`matplotlib.axes._axes.Axes`''';

# %% ../nbs/01_inst.ipynb 68
sns = matr('seaborn')
'''`seaborn`''';

# %% ../nbs/01_inst.ipynb 70
skestimator = matr('sklearn.base', 'BaseEstimator')
'''`sklearn.base.BaseEstimator`''';

skpairwise = matr('sklearn.metrics', 'pairwise')
'''`sklearn.metrics.pairwise`''';

# %% ../nbs/01_inst.ipynb 72
PHATE = matr('phate', 'PHATE', bases=(skestimator, ))
'''`phate.PHATE`''';

# %% ../nbs/01_inst.ipynb 74
_jupmix: object = matr('rich.jupyter', 'JupyterMixin')
'''`rich.jupyter.JupyterMixin`''';

# %% ../nbs/01_inst.ipynb 75
richtree: type = matr('rich.tree', 'Tree', bases=(_jupmix, ))
'''`rich.tree.Tree`''';
richtext: type = matr('rich.text', 'Text', bases=(_jupmix, ))
'''`rich.text.Text`''';
richcons: type = matr('rich.console', 'Console', bases=(_jupmix, ))
'''`rich.console.Console`''';
richprog: type = matr('rich.progress', 'Progress', bases=(_jupmix, ))
'''`rich.progress.Progress`''';
richtask: type = matr('rich.progress', 'Task', bases=(_jupmix, ))
'''`rich.tree.Task`''';

# %% ../nbs/01_inst.ipynb 77
_com: object = matr('tqdm.utils', 'Comparable')
'''`tqdm.utils.Comparable`''';
_std: type = matr('tqdm.std', 'tqdm', __bases__=(_com, ))
'''`tqdm.std.tqdm`''';
_t_a: type = matr('tqdm.tqdm_asyncio', 'tqdm_asyncio', __bases__=(_std, ))
'''`tqdm.tqdm_asyncio.tqdm_asyncio`''';
_t_n: type = matr('tqdm.notebook', 'tqdm_notebook', __bases__=(_std, ))
'''`tqdm.notebook.tqdm_notebook`''';

# %% ../nbs/01_inst.ipynb 78
tqdmauto: type = matr('tqdm.auto', 'tqdm', __bases__=(_t_n, _t_a), default=lambda x, desc='': x)
'''`tqdm.auto.tqdm`''';

# %% ../nbs/01_inst.ipynb 80
typer: type = matr('typer', 'Typer')
