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

# %% auto 0
__all__ = ['T', 'G', 'D', 'P', 'adata', 'adatas', 'array', 'artist', 'augmenter', 'bool01', 'boolic', 'boolindex', 'bools',
           'booltensor', 'brownianintervial', 'bsrarray', 'bsrmatrix', 'builtinfunctype', 'catindex', 'colormap',
           'cooarray', 'coomatrix', 'cscarray', 'cscmatrix', 'csrarray', 'csrmatrix', 'cv2vidcap', 'dataframe',
           'datasource', 'datatype', 'device', 'diaarray', 'diamatrix', 'dictitems', 'dictkeys', 'dictvalues', 'dim1',
           'dim2', 'dim3', 'dim4', 'dimmed', 'dokarray', 'dokmatrix', 'dtype', 'floatq', 'floats', 'floattensor',
           'functiontype', 'graphtype', 'groupkey', 'ichain', 'image', 'indexlike', 'indextype', 'intq', 'ints',
           'inttensor', 'iprod', 'iterbool', 'iternum', 'iterstr', 'itertype', 'lilarray', 'lilmatrix', 'logger',
           'lscolormap', 'mapping', 'matrix', 'memfmt', 'moduleloader', 'modulespec', 'moduletype', 'mplaxes',
           'mplpatch', 'nan', 'nanq', 'nans', 'nantensor', 'neuraldynamics', 'neuralode', 'neuralsde', 'nilstr',
           'nnmodule', 'none', 'notnilstr', 'notstrbytes', 'nparray', 'npbool', 'npdatasource', 'npempty', 'npmatrix',
           'npnan', 'num', 'numq', 'nums', 'numstr', 'odefunc', 'param', 'pathlike', 'ospathlike', 'plibpath',
           'posixpath', 'pdcataccessor', 'pdcatindex', 'pddataframe', 'pddelegate', 'pdindex', 'pdna', 'pdseries',
           'pilimage', 'pldatamodule', 'plmodule', 'presfmt', 'ptdataloader', 'ptdataset', 'ptdevice', 'ptmodule',
           'ptsize', 'pttensor', 'pttn', 'pttype', 'pynan', 'real', 'realq', 'reals', 'recarray', 'richcons',
           'richprog', 'richtask', 'richtext', 'richtree', 'sdefunc', 'sdeito', 'serialized', 'serieslike',
           'seriestype', 'shaped', 'sig', 'size', 'sparray', 'sparse', 'sparsearray', 'sparsematrix', 'spmatrix',
           'strbytes', 'strq', 'strs', 'strtmpl', 'tensor', 'tqdmauto', 'typerapp', 'trackbacktype', 'wrappertype',
           'vidcap', 'ziplong', 'Bool01', 'BoolFunc', 'BoolCall', 'BoolCalls', 'BoolFuncQ', 'BoolCallQ', 'FlagFunc',
           'FlagFuncQ', 'Numeric', 'Numbers', 'NumStr', 'EmptyString', 'NotEmptyEmptyString', 'StrTmpl', 'StrLike',
           'Pttn', 'PttnDict', 'StrBytes', 'NotStrBytes', 'DocGen', 'PathType', 'PathLike', 'DirPath', 'DirNames',
           'FileNames', 'WalkTuple', 'WalkParts', 'EnumAuto', 'EnumDict', 'EnumMember', 'Intum', 'Strum', 'Inhum',
           'ByteLike', 'Literals', 'TypingLike', 'GuardLike', 'Module', 'Loader', 'ModuleSpec', 'Sig', 'Param',
           'Logger', 'ArgsType', 'SysExcInfoType', 'FormatStyle', 'ClsInt', 'ClsSet', 'ClsStr', 'ClsObj', 'ClsBool',
           'ClsBoolish', 'ClsCall', 'ClsType', 'ClsList', 'ClsFloat', 'ClsNumber', 'ClsComplex', 'TypeLike',
           'GuardFunc', 'TypeDesc', 'StrGuard', 'IterStr', 'IterNum', 'IterBool', 'ListStr', 'ListNum', 'ListBool',
           'Strs', 'Nums', 'Bools', 'SetStr', 'SetNum', 'SetBool', 'SliceSpec', 'SliceSpecs', 'Slc', 'Slcs', 'RichTree',
           'RichText', 'RichCons', 'RichProg', 'RichTask', 'TQDM', 'Axes', 'ColorMap', 'CBarPos', 'Grid', 'TyperApp',
           'Adata', 'Adatas', 'AnnData', 'AnnDatas', 'Size', 'DType', 'TType', 'TrcType', 'TorchType', 'TorchDType',
           'DataType', 'Tens', 'Tensor', 'TrcTensor', 'NanTensor', 'IntTens', 'BoolTens', 'FloatTens', 'IntTensor',
           'BoolTensor', 'FloatTensor', 'Device', 'Layer', 'TorchLayer', 'TorchModule', 'Dataset', 'DataLoader',
           'DataModule', 'PILImage', 'Img', 'Image', 'ImageLike', 'ImageSize', 'ImgSize', 'CV2VidCap', 'Video',
           'VideoCapture', 'VidCap', 'VideoSize', 'VidSize', 'Coordinate', 'Coord', 'Point', 'XYPos', 'Width', 'Height',
           'Rect', 'BBox', 'BoundingBox', 'RGB', 'RGBA', 'Color', 'PathFormatFunc', 'Mixin', 'NPArray', 'ndarray',
           'NPMatrix', 'ndmatrix', 'DataSource', 'Idx', 'Index', 'CIdx', 'CIndex', 'CatIndex', 'CategoricalIndex',
           'BoolIndex', 'BIdx', 'BooleanIndex', 'Series', 'DFrame', 'DataFrame', 'DataFrames', 'IndexLike',
           'SeriesLike', 'IterLike', 'SPArray', 'SPMatrix', 'AnyQ', 'IntQ', 'SetQ', 'StrQ', 'ObjQ', 'BoolQ', 'DictQ',
           'CallQ', 'TypeQ', 'ListQ', 'IterQ', 'FloatQ', 'TupleQ', 'NumberQ', 'ComplexQ', 'StrLikeQ', 'NumStrQ',
           'PttnQ', 'PatternQ', 'LoggerQ', 'ModuleQ', 'PathLikeQ', 'ClsAnyQ', 'ClsIntQ', 'ClsSetQ', 'ClsStrQ',
           'ClsObjQ', 'ClsBoolQ', 'ClsCallQ', 'ClsTypeQ', 'ClsListQ', 'ClsIterQ', 'ClsFloatQ', 'ClsNumberQ',
           'ClsComplexQ', 'RichTreeQ', 'RichTextQ', 'RichConsQ', 'RichProgQ', 'RichTaskQ', 'TQDMQ', 'IdxQ', 'IndexQ',
           'SeriesQ', 'DataFrameQ', 'CatQ', 'CIdxQ', 'CatIndexQ', 'BIdxQ', 'BoolIndexQ', 'IndexLikeQ', 'NPArrayQ',
           'NPMatrixQ', 'SPArrayQ', 'SPMatrixQ', 'AxesQ', 'DTypeQ', 'DeviceQ', 'TensorQ', 'IntTensorQ', 'BoolTensorQ',
           'FloatTensorQ', 'TensQ', 'IntTensQ', 'BoolTensQ', 'FloatTensQ', 'DatasetQ', 'DataLoaderQ', 'DataModuleQ',
           'VidCapQ', 'ImgSizeQ']

# %% ../nbs/00_inst.ipynb 6
import os, pathlib
from enum import IntEnum, StrEnum, _EnumDict, member

# %% ../nbs/00_inst.ipynb 8
from types import TracebackType

from typing import (
    Any, List, Set, Type, Union, Tuple, Callable, Literal, 
    TypeVar, ClassVar, TypeAlias, ParamSpec, Optional,
    Iterable, ForwardRef, Mapping, TypeGuard
)

T = TypeVar('T')
'''Type variable for generic types''';

G = TypeVar('G')
'''Type variable for generic types, graphs, guards, etc''';

D = TypeVar('D', bound=dict)
'''Type variable for dictionaries, typed dictionaries, etc''';

P = ParamSpec('P')
'''Type variable for parameter specifications''';

# %% ../nbs/00_inst.ipynb 10
#| export


# %% ../nbs/00_inst.ipynb 12
from quac import (
    itertype,
    npbool, 
    boolic, bool01, bools, 
    intq, ints, floatq, floats, real, realq, reals, num, numq, nums, 
    numstr,
    none, 
    pynan, pdna, npnan, 
    nan, nanq, nans, 
    pattern as pttn, 
    strtmpl, strq, nilstr, strbytes, notnilstr, notstrbytes, strs, 
    moduleloader, modulespec, 
    
     
    ospathlike, plibpath, posixpath, pathlike,
    sig, param, logger, ichain, iprod, ziplong, dictkeys, dictvalues, dictitems, 
    moduletype, wrappertype, builtinfunctype, trackbacktype, functiontype, mapping, 
    richtree, richtext, richcons, richprog, richtask, tqdmauto, typerapp,
    artist, colormap, lscolormap, mplpatch, mplaxes,
    
    cv2vidcap, pilimage, vidcap, image,
    
    npmatrix, nparray, recarray, npempty,
    sparray, spmatrix, cscarray, cscmatrix, cooarray, coomatrix, csrarray, csrmatrix, 
    diaarray, diamatrix, dokarray, dokmatrix, lilarray, lilmatrix, bsrarray, bsrmatrix,
    sparsearray, sparsematrix, sparse,
    array, matrix,
    
    groupkey, 
    pddelegate, pdcataccessor,
    pdindex, pdcatindex, boolindex, catindex, 
    indextype, indexlike, pdseries, 
    seriestype, serieslike,  pddataframe, dataframe,
    
    pttype, 
    serieslike as serialized,
    memfmt, presfmt,
    ptsize,
    ptdevice,
    pttensor, inttensor, booltensor, floattensor, nantensor, tensor,
    ptmodule, plmodule, nnmodule,
    ptdataset, pldatamodule, ptdataloader,
    
    neuralode, neuralsde, neuraldynamics,
    odefunc, sdefunc, sdeito, brownianintervial, 
    augmenter,
    
    dtype, device, size, npdatasource, datasource,
    adata, adatas,
    graphtype, datatype, shaped,
    
    dimmed, dim1, dim2, dim3, dim4,
)

# %% ../nbs/00_inst.ipynb 14
#| export


# %% ../nbs/00_inst.ipynb 16
adata: TypeAlias = adata
adatas: TypeAlias = adatas
array: TypeAlias = array
artist: TypeAlias = artist
augmenter: TypeAlias = augmenter
bool01: TypeAlias = bool01
boolic: TypeAlias = boolic
boolindex: TypeAlias = boolindex
bools: TypeAlias = bools
booltensor: TypeAlias = booltensor
brownianintervial: TypeAlias = brownianintervial
bsrarray: TypeAlias = bsrarray
bsrmatrix: TypeAlias = bsrmatrix
builtinfunctype: TypeAlias = builtinfunctype
catindex: TypeAlias = catindex
colormap: TypeAlias = colormap
cooarray: TypeAlias = cooarray
coomatrix: TypeAlias = coomatrix
cscarray: TypeAlias = cscarray
cscmatrix: TypeAlias = cscmatrix
csrarray: TypeAlias = csrarray
csrmatrix: TypeAlias = csrmatrix
cv2vidcap: TypeAlias = cv2vidcap
dataframe: TypeAlias = dataframe
datasource: TypeAlias = datasource
datatype: TypeAlias = datatype
device: TypeAlias = device
diaarray: TypeAlias = diaarray
diamatrix: TypeAlias = diamatrix
dictitems: TypeAlias = dictitems
dictkeys: TypeAlias = dictkeys
dictvalues: TypeAlias = dictvalues
dim1: TypeAlias = dim1
dim2: TypeAlias = dim2
dim3: TypeAlias = dim3
dim4: TypeAlias = dim4
dimmed: TypeAlias = dimmed
dokarray: TypeAlias = dokarray
dokmatrix: TypeAlias = dokmatrix
dtype: TypeAlias = dtype
floatq: TypeAlias = floatq
floats: TypeAlias = floats
floattensor: TypeAlias = floattensor
functiontype: TypeAlias = functiontype
graphtype: TypeAlias = graphtype
groupkey: TypeAlias = groupkey
ichain: TypeAlias = ichain
image: TypeAlias = image
indexlike: TypeAlias = indexlike
indextype: TypeAlias = indextype
intq: TypeAlias = intq
ints: TypeAlias = ints
inttensor: TypeAlias = inttensor
iprod: TypeAlias = iprod
iterbool: TypeAlias = bools # iterbool
iternum: TypeAlias = nums # iternum
iterstr: TypeAlias = strs # iterstr
itertype: TypeAlias = itertype
lilarray: TypeAlias = lilarray
lilmatrix: TypeAlias = lilmatrix
logger: TypeAlias = logger
lscolormap: TypeAlias = lscolormap
mapping: TypeAlias = mapping
matrix: TypeAlias = matrix
memfmt: TypeAlias = memfmt
moduleloader: TypeAlias = moduleloader
modulespec: TypeAlias = modulespec
moduletype: TypeAlias = moduletype
mplaxes: TypeAlias = mplaxes
mplpatch: TypeAlias = mplpatch
nan: TypeAlias = nan
nanq: TypeAlias = nanq
nans: TypeAlias = nans
nantensor: TypeAlias = nantensor
neuraldynamics: TypeAlias = neuraldynamics
neuralode: TypeAlias = neuralode
neuralsde: TypeAlias = neuralsde
nilstr: TypeAlias = nilstr
nnmodule: TypeAlias = nnmodule
none: TypeAlias = none
notnilstr: TypeAlias = notnilstr
notstrbytes: TypeAlias = notstrbytes
nparray: TypeAlias = nparray
npbool: TypeAlias = npbool
npdatasource: TypeAlias = npdatasource
npempty: TypeAlias = npempty
npmatrix: TypeAlias = npmatrix
npnan: TypeAlias = npnan
num: TypeAlias = num
numq: TypeAlias = numq
nums: TypeAlias = nums
numstr: TypeAlias = numstr
odefunc: TypeAlias = odefunc
param: TypeAlias = param
pathlike: TypeAlias = pathlike
ospathlike: TypeAlias = ospathlike 
plibpath: TypeAlias = plibpath
posixpath: TypeAlias = posixpath
pdcataccessor: TypeAlias = pdcataccessor
pdcatindex: TypeAlias = pdcatindex
pddataframe: TypeAlias = pddataframe
pddelegate: TypeAlias = pddelegate
pdindex: TypeAlias = pdindex
pdna: TypeAlias = pdna
pdseries: TypeAlias = pdseries
pilimage: TypeAlias = pilimage
pldatamodule: TypeAlias = pldatamodule
plmodule: TypeAlias = plmodule
presfmt: TypeAlias = presfmt
ptdataloader: TypeAlias = ptdataloader
ptdataset: TypeAlias = ptdataset
ptdevice: TypeAlias = ptdevice
ptmodule: TypeAlias = ptmodule
ptsize: TypeAlias = ptsize
pttensor: TypeAlias = pttensor
pttn: TypeAlias = pttn
pttype: TypeAlias = pttype
pynan: TypeAlias = pynan
real: TypeAlias = real
realq: TypeAlias = realq
reals: TypeAlias = reals
recarray: TypeAlias = recarray
richcons: TypeAlias = richcons
richprog: TypeAlias = richprog
richtask: TypeAlias = richtask
richtext: TypeAlias = richtext
richtree: TypeAlias = richtree
sdefunc: TypeAlias = sdefunc
sdeito: TypeAlias = sdeito
serialized: TypeAlias = serialized
serieslike: TypeAlias = serieslike
seriestype: TypeAlias = seriestype
shaped: TypeAlias = shaped
sig: TypeAlias = sig
size: TypeAlias = size
sparray: TypeAlias = sparray
sparse: TypeAlias = sparse
sparsearray: TypeAlias = sparsearray
sparsematrix: TypeAlias = sparsematrix
spmatrix: TypeAlias = spmatrix
strbytes: TypeAlias = strbytes
strq: TypeAlias = strq
strs: TypeAlias = strs
strtmpl: TypeAlias = strtmpl
tensor: TypeAlias = tensor
tqdmauto: TypeAlias = tqdmauto
typerapp: TypeAlias = typerapp
trackbacktype: TypeAlias = trackbacktype
wrappertype: TypeAlias = wrappertype
vidcap: TypeAlias = vidcap
ziplong: TypeAlias = ziplong

# %% ../nbs/00_inst.ipynb 18
Bool01: TypeAlias = bool01

BoolFunc: TypeAlias = Callable[P, bool01]
'''A type alias for a function that returns a boolean.'''

BoolCall: TypeAlias = Union[bool01, BoolFunc]
'''A type alias for a boolean or a callable that returns a boolean.'''

BoolCalls: TypeAlias = List[BoolCall]
'''A type alias for a list of booleans or callables that each returns a boolean.''';

BoolFuncQ: TypeAlias = Optional[BoolFunc]

BoolCallQ: TypeAlias = Optional[BoolCall]

FlagFunc: TypeAlias = BoolFunc
'''A type alias for a "flag" function i.e. a function that returns a boolean.''';
FlagFuncQ: TypeAlias = BoolFuncQ

# %% ../nbs/00_inst.ipynb 20
Numeric = num

Numbers = nums

NumStr = numstr

# %% ../nbs/00_inst.ipynb 22
EmptyString = nilstr
NotEmptyEmptyString = notnilstr
 
StrTmpl: TypeAlias = strtmpl
StrLike: TypeAlias = Union[str, 'strfix', 'fuzstr', 'nymstr', 'synset', 'brvstr', 'strfix']

Pttn: TypeAlias = pttn
PttnDict: TypeAlias = dict[str, pttn]


StrBytes = strbytes
NotStrBytes = notstrbytes

# %% ../nbs/00_inst.ipynb 23
DocGen: TypeAlias = Callable[P, str]

# %% ../nbs/00_inst.ipynb 25
PathType: TypeAlias = Union[pathlib.Path, pathlib.PosixPath]
PathLike: TypeAlias = Union[str, os.PathLike, pathlib.Path, PathType]

# %% ../nbs/00_inst.ipynb 27
DirPath:   TypeAlias = PathLike
DirNames:  TypeAlias = List[PathLike]
FileNames: TypeAlias = List[PathLike]
WalkTuple: TypeAlias = Tuple[DirPath, DirNames, FileNames]
WalkParts: TypeAlias = Iterable[WalkTuple]

# %% ../nbs/00_inst.ipynb 29
EnumAuto: TypeAlias = member
EnumDict: TypeAlias = _EnumDict
EnumMember: TypeAlias = member

Intum: TypeAlias = Union[IntEnum, 'LitIntEnum', 'Intum']
Strum: TypeAlias = Union[StrEnum, 'LitStrEnum', 'Strum', 'LiteralEnum']

Inhum = ForwardRef('Inhum', module='inhum', is_class=True)

# %% ../nbs/00_inst.ipynb 31
ByteLike: TypeAlias = Union[bytes, 'BytesUnit', 'Bytes']

# %% ../nbs/00_inst.ipynb 34
Literals = TypeVar('Literals')
TypingLike: TypeAlias = Union['TTyp', 'TType', 'TypingUnit', 'Typing']
GuardLike: TypeAlias = Union['TTypGuard', 'TTypeGuard']

# %% ../nbs/00_inst.ipynb 36
Module: TypeAlias = moduletype

# %% ../nbs/00_inst.ipynb 38
Loader: TypeAlias = moduleloader
ModuleSpec: TypeAlias = modulespec

# %% ../nbs/00_inst.ipynb 40
Sig:   TypeAlias = sig
Param: TypeAlias = param

# %% ../nbs/00_inst.ipynb 42
Logger: TypeAlias = logger

ArgsType: TypeAlias = type[tuple[object, ...]] | type[Mapping[str, object]]

SysExcInfoType: TypeAlias = \
    type[tuple[type[BaseException], BaseException, TracebackType | None]] | \
    type[tuple[None, None, None]]

FormatStyle: TypeAlias = Literal['%', '{', '$']

# %% ../nbs/00_inst.ipynb 44
ClsInt = ClassVar[int]
ClsSet = ClassVar[set]
ClsStr = ClassVar[str]
ClsObj = ClassVar[object]

ClsBool = ClassVar[bool]
ClsBoolish = ClassVar[bool01]
ClsCall = ClassVar[Callable]

ClsType = ClassVar[type]
ClsList = ClassVar[list]

ClsFloat = ClassVar[float]
ClsNumber = ClassVar[num]
ClsComplex = ClassVar[complex]

# %% ../nbs/00_inst.ipynb 46
TypeLike:  TypeAlias = Union[Type, TypeAlias, Type[T]]

GuardFunc: TypeAlias = Callable[P, TypeGuard[TypeLike]]
TypeDesc: TypeAlias = Callable[[TypeLike], str]
StrGuard: TypeAlias = Callable[[str], TypeGuard[str]]

# %% ../nbs/00_inst.ipynb 48
IterStr: TypeAlias = iterstr
IterNum: TypeAlias = iternum
IterBool: TypeAlias = bools

# %% ../nbs/00_inst.ipynb 50
ListStr: TypeAlias = strs
ListNum: TypeAlias = nums
ListBool: TypeAlias = bools

Strs: TypeAlias = strs
Nums: TypeAlias = nums
Bools: TypeAlias = bools

# %% ../nbs/00_inst.ipynb 52
SetStr: TypeAlias = Set[str]
SetNum: TypeAlias = Set[num]
SetBool: TypeAlias = Set[bool01]

# %% ../nbs/00_inst.ipynb 54
SliceSpec: TypeAlias = Union[slice, tuple]
SliceSpecs: TypeAlias = Tuple[SliceSpec, ...]

Slc: TypeAlias = SliceSpec
Slcs: TypeAlias = SliceSpecs

# %% ../nbs/00_inst.ipynb 56
RichTree: TypeAlias = richtree
RichText: TypeAlias = richtext
RichCons: TypeAlias = richcons
RichProg: TypeAlias = richprog
RichTask: TypeAlias = richtask

# %% ../nbs/00_inst.ipynb 58
TQDM: TypeAlias = tqdmauto

# %% ../nbs/00_inst.ipynb 60
Axes: TypeAlias = mplaxes
ColorMap: TypeAlias = colormap

CBarPos: TypeAlias = Tuple[float, float, float, float]
'''tuple of (left, bottom, width, height)''';

Grid: TypeAlias = Tuple[int, int]
'''the number of rows and columns of a grid''';

# %% ../nbs/00_inst.ipynb 62
TyperApp: TypeAlias = typerapp

# %% ../nbs/00_inst.ipynb 64
Adata: TypeAlias = adata
Adatas: TypeAlias = adatas

AnnData: TypeAlias = adata
AnnDatas: TypeAlias = adatas

# %% ../nbs/00_inst.ipynb 66
Size: TypeAlias = tuple[int, ...]
Axes: TypeAlias = Union[int, tuple[int, ...]]

# %% ../nbs/00_inst.ipynb 68
dtype: TypeAlias = dtype
DType: TypeAlias = dtype

TType: TypeAlias = dtype
TrcType: TypeAlias = dtype

TorchType: TypeAlias = dtype
TorchDType: TypeAlias = dtype

DataType: TypeAlias = dtype

# %% ../nbs/00_inst.ipynb 70
Tens: TypeAlias = tensor
Tensor: TypeAlias = tensor
TrcTensor: TypeAlias = tensor

# %% ../nbs/00_inst.ipynb 71
NanTensor = nantensor

IntTens: TypeAlias = inttensor
BoolTens: TypeAlias = booltensor
FloatTens: TypeAlias = floattensor

IntTensor: TypeAlias = inttensor
BoolTensor: TypeAlias = booltensor
FloatTensor: TypeAlias = floattensor

# %% ../nbs/00_inst.ipynb 73
Device: TypeAlias = device

# %% ../nbs/00_inst.ipynb 75
Layer: TypeAlias = ptmodule
TorchLayer: TypeAlias = ptmodule
TorchModule: TypeAlias = ptmodule

# %% ../nbs/00_inst.ipynb 77
Dataset: TypeAlias = ptdataset
DataLoader: TypeAlias = ptdataloader

# %% ../nbs/00_inst.ipynb 79
DataModule: TypeAlias = pldatamodule

# %% ../nbs/00_inst.ipynb 82
PILImage: TypeAlias = pilimage

Img: TypeAlias = image
Image: TypeAlias = image
ImageLike: TypeAlias = Union[array, Image]

ImageSize: TypeAlias = Union[Tuple[int, int], Tuple[int, int, int]]
ImgSize: TypeAlias = ImageSize

# %% ../nbs/00_inst.ipynb 84
CV2VidCap: TypeAlias = cv2vidcap

Video: TypeAlias = vidcap
VideoCapture: TypeAlias = Video
VidCap: TypeAlias = Video

VideoSize: TypeAlias = Union[Tuple[int, int, int], Tuple[int, int, int, int]]
VidSize: TypeAlias = VideoSize

# %% ../nbs/00_inst.ipynb 86
Coordinate: TypeAlias = Tuple[Numeric, ...]
Coord: TypeAlias = Coordinate
Point: TypeAlias = Coordinate

XYPos: TypeAlias = Tuple[int, int]

Width: TypeAlias = int
'''the width of an object'''
Height: TypeAlias = int
'''the height of an object'''
Rect: TypeAlias = Tuple[Width, Height]
'''the width and height of a rectangle'''

BBox: TypeAlias = Tuple[XYPos, XYPos]
BoundingBox: TypeAlias = BBox
Size: TypeAlias = Tuple[int, ...]

# %% ../nbs/00_inst.ipynb 88
RGB: TypeAlias = Tuple[int, int, int]
RGBA: TypeAlias = Tuple[int, int, int, int]

Color: TypeAlias = Union[RGB, RGBA]

# %% ../nbs/00_inst.ipynb 91
PathFormatFunc: TypeAlias = Callable[[os.PathLike, strq, strq, strq], str]

# %% ../nbs/00_inst.ipynb 93
Mixin: TypeAlias =  Union[Tuple[Type, Callable], 'MixinType']

# %% ../nbs/00_inst.ipynb 95
NPArray: TypeAlias = nparray
ndarray: TypeAlias = nparray

NPMatrix: TypeAlias = npmatrix
ndmatrix: TypeAlias = npmatrix

DataSource: TypeAlias = npdatasource

# %% ../nbs/00_inst.ipynb 97
Idx: TypeAlias = pdindex
Index: TypeAlias = pdindex

CIdx: TypeAlias = pdcatindex
CIndex: TypeAlias = pdcatindex
CatIndex: TypeAlias = pdcatindex
CategoricalIndex: TypeAlias = pdcatindex

# %% ../nbs/00_inst.ipynb 98
BoolIndex = boolindex

BIdx: TypeAlias = BoolIndex
BooleanIndex: TypeAlias = BoolIndex

# %% ../nbs/00_inst.ipynb 99
Series: TypeAlias = pdseries

DFrame: TypeAlias = pddataframe
DataFrame: TypeAlias = pddataframe
DataFrames: TypeAlias = List[pddataframe]

# %% ../nbs/00_inst.ipynb 101
IndexLike = indexlike
SeriesLike = serieslike
IterLike: TypeAlias = Union[Iterable, serieslike, indexlike]

# %% ../nbs/00_inst.ipynb 103
SPArray: TypeAlias = sparray
SPMatrix: TypeAlias = spmatrix

# %% ../nbs/00_inst.ipynb 106
AnyQ: TypeAlias = Optional[Any]
IntQ: TypeAlias = Optional[int]
SetQ: TypeAlias = Optional[set]
StrQ: TypeAlias = Optional[str]
ObjQ: TypeAlias = Optional[object]

BoolQ: TypeAlias = Optional[bool01]
DictQ: TypeAlias = Optional[dict]
CallQ: TypeAlias = Optional[Callable]
TypeQ: TypeAlias = Optional[Type]
ListQ: TypeAlias = Optional[list]
IterQ: TypeAlias = Optional[Iterable]
FloatQ: TypeAlias = Optional[float]
TupleQ: TypeAlias = Optional[tuple]
NumberQ: TypeAlias = Optional[num]
ComplexQ: TypeAlias = Optional[complex]

StrLikeQ: TypeAlias = Optional[StrLike]
NumStrQ: TypeAlias = Optional[numstr]

# %% ../nbs/00_inst.ipynb 108
PttnQ: TypeAlias = Optional[pttn]
PatternQ: TypeAlias = Optional[pttn]

# %% ../nbs/00_inst.ipynb 110
LoggerQ: TypeAlias = Optional[Logger]

# %% ../nbs/00_inst.ipynb 112
ModuleQ: TypeAlias = Optional[Module]

PathLikeQ: TypeAlias = Optional[PathLike]

# %% ../nbs/00_inst.ipynb 114
BoolFuncQ: TypeAlias = Optional[BoolFunc]

BoolCallQ: TypeAlias = Optional[BoolCall]

# %% ../nbs/00_inst.ipynb 116
ClsAnyQ = ClassVar[AnyQ]
ClsIntQ = ClassVar[IntQ]
ClsSetQ = ClassVar[SetQ]
ClsStrQ = ClassVar[StrQ]
ClsObjQ = ClassVar[ObjQ]
ClsBoolQ = ClassVar[BoolQ]
ClsCallQ = ClassVar[CallQ]
ClsTypeQ = ClassVar[TypeQ]
ClsListQ = ClassVar[ListQ]
ClsIterQ = ClassVar[IterQ]
ClsFloatQ = ClassVar[FloatQ]
ClsNumberQ = ClassVar[NumberQ]
ClsComplexQ = ClassVar[ComplexQ]

StrLikeQ: TypeAlias = Optional[StrLike]

# %% ../nbs/00_inst.ipynb 118
RichTreeQ: TypeAlias = Optional[RichTree]
RichTextQ: TypeAlias = Optional[RichText]
RichConsQ: TypeAlias = Optional[RichCons]
RichProgQ: TypeAlias = Optional[RichProg]
RichTaskQ: TypeAlias = Optional[RichTask]
TQDMQ: TypeAlias = Optional[TQDM]

# %% ../nbs/00_inst.ipynb 120
IdxQ: TypeAlias = Optional[Idx]
IndexQ: TypeAlias = Optional[Index]
SeriesQ: TypeAlias = Optional[Series]
DataFrameQ: TypeAlias = Optional[DataFrame]

# %% ../nbs/00_inst.ipynb 121
CatQ: TypeAlias = Optional[CatIndex]
CIdxQ: TypeAlias = Optional[CatIndex]
CatIndexQ: TypeAlias = Optional[CatIndex]


BIdxQ: TypeAlias = Optional[BoolIndex]
BoolIndexQ: TypeAlias = Optional[BoolIndex]
IndexLikeQ: TypeAlias = Optional[IndexLike]

# %% ../nbs/00_inst.ipynb 122
NPArrayQ: TypeAlias = Optional[NPArray]
NPMatrixQ: TypeAlias = Optional[NPMatrix]

SPArrayQ: TypeAlias = Optional[SPArray]
SPMatrixQ: TypeAlias = Optional[SPMatrix]

# %% ../nbs/00_inst.ipynb 124
AxesQ: TypeAlias = Optional[Axes]

# %% ../nbs/00_inst.ipynb 125
DTypeQ: TypeAlias = Optional[DType]
DeviceQ: TypeAlias = Optional[Device]

TensorQ: TypeAlias = Optional[Tensor]
IntTensorQ: TypeAlias = Optional[IntTensor]
BoolTensorQ: TypeAlias = Optional[BoolTensor]
FloatTensorQ: TypeAlias = Optional[FloatTensor]


TensQ: TypeAlias = Optional[Tensor]
IntTensQ: TypeAlias = Optional[IntTensor]
BoolTensQ: TypeAlias = Optional[BoolTensor]
FloatTensQ: TypeAlias = Optional[FloatTensor]

# %% ../nbs/00_inst.ipynb 126
DatasetQ: TypeAlias = Optional[Dataset]
DataLoaderQ: TypeAlias = Optional[DataLoader]
DataModuleQ: TypeAlias = Optional[DataModule]

# %% ../nbs/00_inst.ipynb 128
VidCapQ: TypeAlias = Optional[VidCap]
ImgSizeQ: TypeAlias = Optional[ImgSize]
