class_docstr: A generic dataset class for loading model training and evaluation dataset.
  
  For each ML task, such as image classification, text classification etc., a
  subclass can be derived from this class to provide task-specific data loading
  utilities.
docstr: Returns the number of element of the dataset.
  
  If size is not set, this method will fallback to using the __len__ method
  of the tf.data.Dataset in self._dataset. Calling __len__ on a
  tf.data.Dataset instance may throw a TypeError because the dataset may
  be lazy-loaded with an unknown size or have infinite size.
  
  In most cases, however, when an instance of this class is created by helper
  functions like 'from_folder', the size of the dataset will be preprocessed,
  and the _size instance variable will be already set.
  
  Raises:
    TypeError if self._size is not set and the cardinality of self._dataset
      is INFINITE_CARDINALITY or UNKNOWN_CARDINALITY.
docstr_tok: ["Returns","the","number","of","element","of","the","dataset",".","If","size","is","not","set",",","this","method","will","fallback","to","using","the","__len__","method","of","the","tf.data.Dataset","in","self._dataset",".","Calling","__len__","on","a","tf.data.Dataset","instance","may","throw","a","TypeError","because","the","dataset","may","be","lazy-loaded","with","an","unknown","size","or","have","infinite","size",".","In","most","cases",",","however",",","when","an","instance","of","this","class","is","created","by","helper","functions","like","'from_folder","'",",","the","size","of","the","dataset","will","be","preprocessed",",","and","the","_size","instance","variable","will","be","already","set",".","Raises",":","TypeError","if","self._size","is","not","set","and","the","cardinality","of","self._dataset","is","INFINITE_CARDINALITY","or","UNKNOWN_CARDINALITY","."]
code: def __len__(self) -> int:
      """Returns the number of element of the dataset.
  
      If size is not set, this method will fallback to using the __len__ method
      of the tf.data.Dataset in self._dataset. Calling __len__ on a
      tf.data.Dataset instance may throw a TypeError because the dataset may
      be lazy-loaded with an unknown size or have infinite size.
  
      In most cases, however, when an instance of this class is created by helper
      functions like 'from_folder', the size of the dataset will be preprocessed,
      and the _size instance variable will be already set.
  
      Raises:
        TypeError if self._size is not set and the cardinality of self._dataset
          is INFINITE_CARDINALITY or UNKNOWN_CARDINALITY.
      """
      if self._size is not None:
          return self._size
      else:
          return len(self._dataset)
  
file_path: mediapipe/mediapipe/model_maker/python/core/data/dataset.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  from typing import Any, Callable, Optional, Tuple, TypeVar
  import tensorflow
label_desc: Use image node_id 4 for calling the Dataset obj's underlying member method code with example usage: obj.__len__() and returns: self, len