# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/13_duck.ipynb.

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

# %% ../nbs/13_duck.ipynb 6
#| export


# %% ../nbs/13_duck.ipynb 8
from typing import Iterable

# %% ../nbs/13_duck.ipynb 10
#| export

# %% ../nbs/13_duck.ipynb 12
#| export

# %% ../nbs/13_duck.ipynb 14
from .base import Duck
from . import mods
from . import spec
from .enum import Species

# %% ../nbs/13_duck.ipynb 17
class moduleloader(Duck):
    '''`importlib.Loader`'''
    __ducktype__ = (spec.il_moduleloader.duck, )
    
class modulespec(Duck):
    '''`importlib.machinery.ModuleSpec`'''
    __ducktype__ = (spec.il_modulespec.duck, )

# %% ../nbs/13_duck.ipynb 19
class iterable(Duck):
    '''`typings.Iterable`, `collections.abc.Iterable`'''
    __ducktype__ = (Iterable, spec.c_iterable.duck, )
    
class itertype(Duck):
    '''iterable type (i.e. `Iterable`, `list`, or `tuple`)'''
    __ducktype__ = (iterable, list, tuple)

# %% ../nbs/13_duck.ipynb 21
class moduletype(Duck):
    '''`types.ModuleType`'''
    __ducktype__ = (spec.t_moduletype.duck, )
    
class wrappertype(Duck):
    '''`types.MethodWrapperType`'''
    __ducktype__ = (spec.t_methodwrappertype.duck, )
    
class builtinfunctype(Duck):
    '''`types.BuiltinFunctionType`'''
    __ducktype__ = (spec.t_builtinfunctiontype.duck, )
    
class trackbacktype(Duck):
    '''`types.TracebackType`'''
    __ducktype__ = (spec.t_tracebacktype.duck, )
    
class functiontype(Duck):
    '''`types.FunctionType`'''
    __ducktype__ = (spec.t_functiontype.duck, )
    
class mapping(Duck):
    '''`collections.Mapping`'''
    __ducktype__ = (spec.c_mapping.duck, )

# %% ../nbs/13_duck.ipynb 23
class dictkeys(Duck):
    '''`_collections_abc.dict_keys`'''
    __ducktype__ = (spec.c_dict_keys.duck, )
    
class dictvalues(Duck):
    '''`_collections_abc.dict_values`'''
    __ducktype__ = (spec.c_dict_values.duck, )
    
class dictitems(Duck):
    '''`_collections_abc.dict_items`'''
    __ducktype__ = (spec.c_dict_items.duck, )

# %% ../nbs/13_duck.ipynb 25
class sig(Duck):
    '''`inspect.Signature`'''
    __ducktype__ = (spec.i_sig.duck, )
    
class param(Duck):
    '''`inspect.Parameter`'''
    __ducktype__ = (spec.i_param.duck, )
    
class paramkind(Duck):
    '''`inspect._ParameterKind`'''
    __ducktype__ = (spec.i_paramkind.duck, )

# %% ../nbs/13_duck.ipynb 27
class logger(Duck):
    '''`logging.Logger`'''
    __ducktype__ = (spec.l_logger.duck, )

# %% ../nbs/13_duck.ipynb 29
class ichain(Duck):
    '''`itertools.chain`'''
    __ducktype__ = (spec.it_chain.duck, )
    
class iprod(Duck):
    '''`itertools.product`'''
    __ducktype__ = (spec.it_prod.duck, )
    
class ziplong(Duck):
    '''`itertools.zip_longest`'''
    __ducktype__ = (spec.it_ziplong.duck, )

# %% ../nbs/13_duck.ipynb 31
class boolic(Duck): 
    '''`bool`, `np.bool_`'''
    __ducktype__ = (bool, spec.np_bool.duck)

class bool01(Duck):
    '''`bool`, `np.bool_`, `0`, `1`'''
    __ducktype__ = (boolic, 0, 1)
    
class bools(Duck):
    '''list of bool01'''
    __ducktype__ = (itertype, list, tuple)
    __expected__ = dict(dtype=bool01)

# %% ../nbs/13_duck.ipynb 33
class intq(Duck):
    '''`int` or None'''
    __ducktype__ = (int, )
    __species__ = Species.OPT
    
class ints(Duck):
    '''iterable of `int`s'''
    __ducktype__ = (itertype,)
    __expected__ = dict(dtype=int)

# %% ../nbs/13_duck.ipynb 34
class floatq(Duck):
    '''`float` or None'''
    __ducktype__ = (float, )
    __species__ = Species.OPT
    
class floats(Duck):
    '''iterable of `float`s'''
    __ducktype__ = (itertype,)
    __expected__ = dict(dtype=float)

# %% ../nbs/13_duck.ipynb 35
class real(Duck):
    '''R (i.e. `int` or `float`)'''
    __ducktype__ = (int, float, )
    
class realq(Duck):
    '''`real` or None'''
    __ducktype__ = (int, float, )
    __species__ = Species.OPT
    
class reals(Duck):
    '''iterable of `real`'''
    __ducktype__ = (itertype,)
    __expected__ = dict(dtype=real)

# %% ../nbs/13_duck.ipynb 36
class num(Duck):
    '''`int`, `float`, `complex`, or `Number`'''
    __ducktype__ = (int, float, complex, spec.n_number.duck)
    
class numq(Duck):
    '''`real` or None'''
    __ducktype__ = (num, )
    __species__ = Species.OPT
    
class nums(Duck):
    '''iterable of `num`'''
    __ducktype__ = (itertype,)
    __expected__ = dict(dtype=num)

# %% ../nbs/13_duck.ipynb 38
class numstr(Duck):
    '''`num` or str'''
    __ducktype__ = (num, str,)

# %% ../nbs/13_duck.ipynb 40
class none(Duck): 
    '''`None` or `NoneType`'''
    __ducktype__ = (None, spec.t_nonetype.duck)

# %% ../nbs/13_duck.ipynb 42
class nan(Duck):
    '''`math.nan`, `pd.NA`, `np.nan`, `np.NaN`, or `np.NAN`'''
    __ducktype__ = (
        spec.m_nan.duck, spec.np_nan.duck, spec.np_NaN.duck, spec.np_NAN.duck, 
        spec.pd_na.duck, spec.pd_natype.duck, float('nan')
    )
    
class nanq(Duck):
    '''`nan` or None'''
    __ducktype__ = (nan,)
    __species__ = Species.OPT
    
class nans(Duck):
    '''iterable of `nan`'''
    __ducktype__ = (itertype,)
    __expected__ = dict(dtype=nan)

# %% ../nbs/13_duck.ipynb 44
class pattern(Duck): 
    '''`re.Pattern`'''
    __ducktype__ = (spec.re_pattern.duck, )

class rematch(Duck): 
    '''`re.Match`'''
    __ducktype__ = (spec.re_match.duck, )

class strtmpl(Duck): 
    '''`string.Template`'''
    __ducktype__ = (spec.s_template.duck, )

# %% ../nbs/13_duck.ipynb 46
class nilstr(Duck):
    '''`''` (the nil string)'''
    __ducktype__ = ('', )
    __guard__ = lambda x: x == ''
    
class notnilstr(nilstr): 
    '''not `nilstr` (not `''`, the nil string)'''
    __species__ = Species.NOT

# %% ../nbs/13_duck.ipynb 47
class strbytes(Duck):
    '''str or bytes'''
    __ducktype__ = (str, bytes)
    
class notstrbytes(strbytes): 
    '''not (str or bytes)'''
    __species__ = Species.NOT

# %% ../nbs/13_duck.ipynb 48
class strq(Duck): 
    '''`str` or None'''
    __ducktype__ = (str, )
    __species__ = Species.OPT

class strs(Duck): 
    '''iterable of `str`'''
    __ducktype__ = (itertype, notstrbytes, )
    __expected__ = dict(dtype=str)

# %% ../nbs/13_duck.ipynb 50
class ospathlike(Duck):
    '''`os.PathLike`'''
    __ducktype__ = (spec.os_pathlike.duck, )

class plibpath(Duck):
    '''`pathlib.Path`'''
    __ducktype__ = (spec.pl_path.duck, )

class posixpath(Duck):
    '''`pathlib.PosixPath`'''
    __ducktype__ = (spec.pl_posixpath.duck, )

# %% ../nbs/13_duck.ipynb 52
class pathlike(Duck):
    '''`os.PathLike`, `pathlib.Path`, `pathlib.PosixPath`'''
    __ducktype__ = (str, bytes, spec.os_pathlike.duck, spec.pl_path.duck, spec.pl_posixpath.duck)    

# %% ../nbs/13_duck.ipynb 54
class _mpl_base(Duck):
    '''`matplotlib.axes._base`''';
    __ducktype__ = (spec._mpl_base.duck, )
    
class _mpl_axes(Duck):
    '''`matplotlib.axes._axes`''';
    __ducktype__ = (spec._mpl_axes.duck, )
    

class artist(Duck): 
    '''`matplotlib.artist.Artist`'''
    __ducktype__ = (spec.mpl_artist.duck, )
    
class colormap(Duck): 
    '''`matplotlib.colors.Colormap`'''
    __ducktype__ = (spec.mpl_colormap.duck, )

class lcolormap(Duck): 
    '''`matplotlib.colors.ListedColormap`'''
    __ducktype__ = (spec.mpl_lcolormap.duck, )
    
class lscolormap(Duck): 
    '''`matplotlib.colors.LinearSegmentedColormap`'''
    __ducktype__ = (spec.mpl_lscolormap.duck, )
    
class mplpatch(Duck): 
    '''`matplotlib.patches.Patch`'''
    __ducktype__ = (spec.mpl_patch.duck, )

class mplaxbase(Duck): 
    '''`matplotlib.axes._base._AxesBase`'''
    __ducktype__ = (spec.mpl_axbase.duck, )

class mplaxes(Duck): 
    '''`matplotlib.axes._axes.Axes`'''
    __ducktype__ = (spec.mpl_axes.duck, )
    

# %% ../nbs/13_duck.ipynb 56
class nparray(Duck):
    '''`numpy.ndarray`''';
    __ducktype__ = (spec.np_array.duck, )
    
class npmatrix(Duck):
    '''`numpy.matrix`''';
    __ducktype__ = (spec.np_matrix.duck, )

class recarray(Duck):
    '''`numpy.recarray`''';
    __ducktype__ = (spec.np_recarray.duck, )
    
class npempty(Duck):
    '''`numpy.empty`''';
    __ducktype__ = (spec.np_empty.duck, )

# %% ../nbs/13_duck.ipynb 57
class npdatasource(Duck): 
    '''`numpy.DataSource`''';
    __ducktype__ = (spec.np_datasource.duck, )

# %% ../nbs/13_duck.ipynb 59
class sparray(Duck): 
    '''`scipy.sparse.aparray`''';
    __ducktype__ = (spec.sp_sparray.duck, )

class spmatrix(Duck): 
    '''`scipy.sparse.spmatrix`''';
    __ducktype__ = (spec.sp_spmatrix.duck, )
    

# %% ../nbs/13_duck.ipynb 61
class cscarray(Duck):
    '''`scipy.sparse.csc_array`''';
    __ducktype__ = (spec.sp_csc_array.duck, )
    
class cscmatrix(Duck):
    '''`scipy.sparse.csc_matrix`''';
    __ducktype__ = (spec.sp_csc_matrix.duck, )

class cooarray(Duck):
    '''`scipy.sparse.coo_array`''';
    __ducktype__ = (spec.sp_coo_array.duck, )

class coomatrix(Duck):
    '''`scipy.sparse.coo_matrix`''';
    __ducktype__ = (spec.sp_coo_matrix.duck, )

class csrarray(Duck):
    '''`scipy.sparse.csr_array`''';
    __ducktype__ = (spec.sp_csr_array.duck, )

class csrmatrix(Duck):
    '''`scipy.sparse.csr_matrix`''';
    __ducktype__ = (spec.sp_csr_matrix.duck, )

class diaarray(Duck):
    '''`scipy.sparse.dia_array`''';
    __ducktype__ = (spec.sp_dia_array.duck, )

class diamatrix(Duck):
    '''`scipy.sparse.dia_matrix`''';
    __ducktype__ = (spec.sp_dia_matrix.duck, )

class dokarray(Duck):
    '''`scipy.sparse.dok_array`''';
    __ducktype__ = (spec.sp_dok_array.duck, )

class dokmatrix(Duck):
    '''`scipy.sparse.dok_matrix`''';
    __ducktype__ = (spec.sp_dok_matrix.duck, )

class lilarray(Duck):
    '''`scipy.sparse.lil_array`''';
    __ducktype__ = (spec.sp_lil_array.duck, )

class lilmatrix(Duck):
    '''`scipy.sparse.lil_matrix`''';
    __ducktype__ = (spec.sp_lil_matrix.duck, )

class bsrarray(Duck):
    '''`scipy.sparse.bsr_array`''';
    __ducktype__ = (spec.sp_bsr_array.duck, )

class bsrmatrix(Duck):
    '''`scipy.sparse.bsr_matrix`''';
    __ducktype__ = (spec.sp_bsr_matrix.duck, )

# %% ../nbs/13_duck.ipynb 63
class sparsearray(Duck): 
    '''sparse array (e.g. 
    `scipy.sparse.sparray`, `scipy.sparse.cscarray`, `scipy.sparse.cooarray`, 
    `scipy.sparse.csrarray`, `scipy.sparse.diaarray`, `scipy.sparse.dokarray`, 
    `scipy.sparse.lilarray`, or `scipy.sparse.bsrarray`)'''
    __ducktype__ = (sparray, cscarray, cooarray, csrarray, diaarray, dokarray, lilarray, bsrarray)
    
    
class sparsematrix(Duck): 
    '''sparse type (e.g.  
    `scipy.sparse.spmatrix`, `scipy.sparse.cscmatrix`, `scipy.sparse.coomatrix`, 
    `scipy.sparse.csrmatrix`, `scipy.sparse.diamatrix`, `scipy.sparse.dokmatrix`, 
    `scipy.sparse.lilmatrix`, or `scipy.sparse.bsrmatrix`)'''
    __ducktype__ = (spmatrix, cscmatrix, coomatrix, csrmatrix, diamatrix, dokmatrix, lilmatrix, bsrmatrix)


# %% ../nbs/13_duck.ipynb 65
class sparse(Duck): 
    '''sparse type (e.g. `sparsearray` or `sparsematrix`)'''
    __ducktype__ = (sparray, sparsematrix)
    
class array(Duck): 
    '''array type (e.g. `np.array`, `np.recarray`, `sp.sparray`, `itertype`, or `list`)'''
    __ducktype__ = (nparray, recarray, sparray, itertype, list)
    
class matrix(Duck): 
    '''matrix type(e.g. `np.matrix`, `sp.matrix`, `itertype`, or `list`)'''
    __ducktype__ = (npmatrix, spmatrix, itertype, list)

# %% ../nbs/13_duck.ipynb 67
class cv2vidcap(Duck): 
    '''`cv2.VideoCapture`''';
    __ducktype__ = (spec.cv_vidcap.duck, )

class pilimage(Duck): 
    '''`PIL.Image.Image`''';
    __ducktype__ = (spec.pil_image.duck, )    

# %% ../nbs/13_duck.ipynb 69
class vidcap(Duck): 
    '''`cv2.VideoCapture`''';
    __ducktype__ = (spec.cv_vidcap.duck, )
    
class image(Duck): 
    '''`PIL.Image.Image`''';
    __ducktype__ = (spec.pil_image.duck, )

# %% ../nbs/13_duck.ipynb 71
class groupkey(Duck): 
    '''groupby key (e.g. `str`, `tuple`, or `numstr`)'''
    __ducktype__ = (str, tuple, numstr)
    
class pddelegate(Duck):
    '''`pandas.core.accessor.PandasDelegate`''';
    __ducktype__ = (object, spec.pd_delegate.duck, )
    
class pdcataccessor(Duck):
    '''`pandas.core.arrays.categorical.CategoricalAccessor`''';
    __ducktype__ = (object, spec.pd_cataccessor.duck, )

# %% ../nbs/13_duck.ipynb 73
class pdindex(Duck):
    '''`pandas.Index`''';
    __ducktype__ = (spec.pd_index.duck, )
    
class pdcatindex(Duck):
    '''`pandas.CategoricalIndex`''';
    __ducktype__ = (spec.pd_catindex.duck, )

# %% ../nbs/13_duck.ipynb 75
class pdseries(Duck):
    '''`pandas.Series`''';
    __ducktype__ = (spec.pd_series.duck, )
    

# %% ../nbs/13_duck.ipynb 77
class boolindex(Duck): 
    '''boolean index'''
    __ducktype__ = (list, pdindex, nparray, bools, )
    __expected__ = dict(dtype=bool01)
    
class catindex(Duck): 
    '''categorical index'''
    __ducktype__ = (pdcatindex, )

# %% ../nbs/13_duck.ipynb 78
class indextype(Duck): 
    '''index types(e.g. `pd.Index`, `pd.CategoricalIndex`, `np.ndarray`, or `boolindex`)'''
    __ducktype__ = (pdindex, pdcatindex, boolindex, nparray)
    
    
class indexlike(Duck): 
    '''index-like objects (e.g. `list`, `tuple`,`bools`, `nums`, 
    `itertype`, `pd.Index`, `pd.CategoricalIndex`, `boolindex`, or `np.array`)'''
    __ducktype__ = (list, tuple, bools, nums, itertype, pdindex, pdcatindex, boolindex, nparray)

# %% ../nbs/13_duck.ipynb 80
class seriestype(Duck): 
    '''series type (e.g. `pd.Series`, `np.array`, `np.recarray`, `list`, or `indexlike`)'''
    __ducktype__ = (pdseries, nparray, recarray, list, indexlike)
    

class serieslike(Duck): 
    '''series-like type'''
    __ducktype__ = (pdseries, nparray, recarray, list, indexlike)

# %% ../nbs/13_duck.ipynb 82
class pddataframe(Duck): 
    '''`pandas.DataFrame`''';
    __ducktype__ = (spec.pd_dataframe.duck, )

# %% ../nbs/13_duck.ipynb 84
class dataframe(Duck): 
    '''`pandas.DataFrame`''';
    __ducktype__ = (spec.pd_dataframe.duck, )

# %% ../nbs/13_duck.ipynb 87
class memfmt(Duck): 
    '''`torch.memory_format`''';
    __ducktype__ = (spec.pt_memoryformat.duck, )

class presfmt(Duck): 
    '''`torch.preserve_format`''';
    __ducktype__ = (spec.pt_preserveformat.duck, )


# %% ../nbs/13_duck.ipynb 89
class ptsize(Duck): 
    '''`torch.Size`'''
    __ducktype__ = (spec.pt_size.duck, iterable, tuple, )

# %% ../nbs/13_duck.ipynb 91
class ptdevice(Duck): 
    '''`torch.device`'''
    __ducktype__ = (spec.pt_device.duck, iterable, tuple, )


# %% ../nbs/13_duck.ipynb 93
class pttensor(Duck): 
    '''`torch.Tensor`''';
    __ducktype__ = (spec.pt_tensor.duck, )
    
class inttensor(Duck): 
    '''`torch.IntTensor`''';
    __ducktype__ = (spec.pt_inttensor.duck, )
    
class booltensor(Duck): 
    '''`torch.BoolTensor`''';
    __ducktype__ = (spec.pt_booltensor.duck, )
    
class floattensor(Duck): 
    '''`torch.FloatTensor`''';
    __ducktype__ = (spec.pt_floattensor.duck, )
    
class longtensor(Duck): 
    '''`torch.LongTensor`''';
    __ducktype__ = (spec.pt_longtensor.duck, )
    
class doubletensor(Duck): 
    '''`torch.DoubleTensor`''';
    __ducktype__ = (spec.pt_doubletensor.duck, )

# %% ../nbs/13_duck.ipynb 95
class nantensor(Duck): 
    '''tensor of `nan`s'''
    __ducktype__ = (pttensor, nans, )
    __expected__ = dict(dtype=nan)

# %% ../nbs/13_duck.ipynb 97
class tensor(Duck): 
    '''tensor type (e.g. `torch.tensor`, `torch.IntTensor`, `torch.BoolTensor`, or `torch.FloatTensor`)'''
    __ducktype__ = (pttensor, inttensor, booltensor, floattensor, longtensor, doubletensor, )

# %% ../nbs/13_duck.ipynb 99
class ptmodule(Duck): 
    '''`torch.nn.Module`'''
    __ducktype__ = (spec.pt_module.duck, )

class plmodule(Duck): 
    '''`pytorch_lightning.LightningModule`'''
    __ducktype__ = (spec.pl_module.duck, )

# %% ../nbs/13_duck.ipynb 100
class nnmodule(Duck): 
    '''module type (e.g. `torch.nn.Module` or `pytorch_lightning.LightningModule`)'''
    __ducktype__ = (ptmodule, plmodule, )

# %% ../nbs/13_duck.ipynb 102
class ptdataset(Duck): 
    '''`torch.utils.data.Dataset`'''
    __ducktype__ = (spec.pt_dataset.duck, )

class pldatamodule(Duck): 
    '''`pytorch_lightning.LightningDataModule`'''
    __ducktype__ = (spec.pl_datamodule.duck, )

class ptdataloader(Duck): 
    '''`torch.utils.data.DataLoader`'''
    __ducktype__ = (spec.pt_dataloader.duck, )


# %% ../nbs/13_duck.ipynb 104
class neuralode(Duck): 
    '''torchdyn neural ODE'''
    __ducktype__ = (spec.td_neuralode.duck, )

class neuralsde(Duck): 
    '''torchdyn neural SDE'''
    __ducktype__ = (spec.td_neuralsde.duck, )

class neuraldynamics(Duck): 
    '''neuralode or neuralsde'''
    __ducktype__ = (neuralode, neuralsde, )


# %% ../nbs/13_duck.ipynb 105
class augmenter(Duck): 
    '''`torchdyn.nn.augmenter`''';
    __ducktype__ = (spec.td_augmenter.duck, )

# %% ../nbs/13_duck.ipynb 106
class odefunc(Duck): 
    '''`torchdyn.ODEFunc`'''
    __ducktype__ = (spec.td_odefunc.duck, )

class sdefunc(Duck): 
    '''`torchdyn.SDEFunc`'''
    __ducktype__ = (spec.td_sdefunc.duck, )


# %% ../nbs/13_duck.ipynb 108
class sdeito(Duck): 
    '''`torchsde.ito`'''
    __ducktype__ = (spec.ts_sdeito.duck, )

class brownianintervial(Duck): 
    '''`torchsde.BrownianInterval`'''
    __ducktype__ = (spec.ts_brownianinterval.duck, )


# %% ../nbs/13_duck.ipynb 110
class dtype(Duck): 
    '''Type of data (e.g. `np.dtype` or `torch.dtype`)'''
    __ducktype__ = (type, spec.np_type.duck, spec.pt_type.duck, )

# %% ../nbs/13_duck.ipynb 112
class device(Duck): 
    '''`torch.device`'''
    __ducktype__ = (spec.pt_device.duck, )

# %% ../nbs/13_duck.ipynb 114
class size(Duck): 
    '''size type (e.g. `tuple`, `torch.Size`, `itertype`)'''
    __ducktype__ = (tuple, ptsize, itertype, )
    __expected__ = dict(dtype=int)

# %% ../nbs/13_duck.ipynb 116
class datasource(Duck): 
    '''`numpy.DataSource`''';
    __ducktype__ = (spec.np_datasource.duck, )   

# %% ../nbs/13_duck.ipynb 118
class adata(Duck): 
    '''`anndata.AnnData`''';
    __ducktype__ = (spec.ad_adata.duck, )

class adatas(Duck): 
    '''`anndata.AnnData`''';
    __ducktype__ = (itertype, )
    __expected__ = dict(dtype=adata)

# %% ../nbs/13_duck.ipynb 120
class graphtype(Duck): 
    '''graph type (e.g. `BaseGraph`, `DataGraph`, `LandmarkGraph`, `kNNGraph`, `TraditionalGraph`, 
    `MNNGraph`, `kNNLandmarkGraph`, `TraditionalLandmarkGraph`, or `MNNLandmarkGraph`)'''
    __ducktype__ = (
        spec.gt_bgraph.duck, spec.gt_dgraph.duck, spec.gt_lgraph.duck, 
        spec.gt_kgraph.duck, spec.gt_tgraph.duck, spec.gt_mgraph.duck, 
        spec.gt_klgraph.duck, spec.gt_tlgraph.duck, spec.gt_mlgraph.duck
    )

# %% ../nbs/13_duck.ipynb 122
class datatype(Duck): 
    '''data type (e.g.  `np.array`, `np.matrix`, `sp.array`, `sp.matrix`,  `np.recarray`, or `anndata`)'''
    __ducktype__ = (array, matrix, adata, )


# %% ../nbs/13_duck.ipynb 123
class shaped(Duck): 
    '''shaped `datatype`'''
    __ducktype__ = (datatype, indextype, seriestype, dataframe, tensor, )
    __required__ = ('shape', )

# %% ../nbs/13_duck.ipynb 125
class dimmed(Duck): 
    '''`np.ndarray` with shape `(i, ...)`'''
    __ducktype__ = (list, nparray, list, itertype, )
    __required__ = ('ndim', )

class dim1(dimmed): 
    '''`np.ndarray` with shape `(i, )`'''
    __ducktype__ = (dimmed, )
    __expected__ = dict(ndim=1)
    

class dim2(dimmed): 
    '''`np.ndarray` with shape `(i, j, )`'''
    __ducktype__ = (dimmed, )
    __expected__ = dict(ndim=2)
    

class dim3(dimmed): 
    '''`np.ndarray` with shape `(i, j, k, )`'''
    __ducktype__ = (dimmed, )
    __expected__ = dict(ndim=3)

class dim4(dimmed): 
    '''`np.ndarray` with shape `(i, j, k, l, )`'''
    __ducktype__ = (dimmed, )
    __expected__ = dict(ndim=4)

# %% ../nbs/13_duck.ipynb 127
class richtree(Duck):
    '''`rich.tree.Tree`'''
    __ducktype__ = (spec.r_richtree.duck, )
    
class richtext(Duck):
    '''`rich.text.Text`'''
    __ducktype__ = (spec.r_richtext.duck, )
    
class richcons(Duck):
    '''`rich.console.Console`'''
    __ducktype__ = (spec.r_richcons.duck, )
    
class richprog(Duck):
    '''`rich.progress.Progress`'''
    __ducktype__ = (spec.r_richprog.duck, )
    
class richtask(Duck):
    '''`rich.progress.Task`'''
    __ducktype__ = (spec.r_richtask.duck, )

# %% ../nbs/13_duck.ipynb 129
class tqdmauto(Duck):
    '''`tqdm.auto.tqdm`'''
    __ducktype__ = (spec.tq_as.duck, )

# %% ../nbs/13_duck.ipynb 131
class typerapp(Duck):
    '''`typer.Typer`'''
    __ducktype__ = (spec.t_typer.duck, )
    
