class_docstr: A Pytorch DataSet class to process a multimodal pd.DataFrame. It first uses a preprocessor to
  produce model-agnostic features. Then, each processor prepares customized data for one modality
  per model. For code simplicity, here we treat ground-truth label as one modality. This class is
  independent of specific data modalities and models.
docstr: Iterate through all data processors to prepare model inputs. The data processors are
  organized first by modalities and then by models.
  
  Parameters
  ----------
  idx
      Index of sample to process.
  
  Returns
  -------
  Input data formatted as a dictionary.
code: def __getitem__(self, idx):
      """
      Iterate through all data processors to prepare model inputs. The data processors are
      organized first by modalities and then by models.
  
      Parameters
      ----------
      idx
          Index of sample to process.
  
      Returns
      -------
      Input data formatted as a dictionary.
      """
      ret = dict()
      try:
          for group_id, per_processors_group in enumerate(
              self.processors
          ):
              per_sample_features = get_per_sample_features(
                  modality_features=getattr(
                      self, f"modality_features_{group_id}"
                  ),
                  modality_types=getattr(
                      self, f"modality_types_{group_id}"
                  ),
                  idx=idx,
                  id_mappings=self.id_mappings,
              )
              per_ret = apply_data_processor(
                  per_sample_features=per_sample_features,
                  data_processors=per_processors_group,
                  feature_modalities=getattr(
                      self, f"modality_types_{group_id}"
                  ),
                  is_training=self.is_training,
              )
              ret.update(per_ret)
      except Exception as e:
          logger.debug(f"Skipping sample {idx} due to '{e}'")
          self._consecutive_errors += 1
          if self._consecutive_errors < GET_ITEM_ERROR_RETRY:
              return self.__getitem__((idx + 1) % self.__len__())
          else:
              raise e
      self._consecutive_errors = 0
      return ret
  
file_path: autogluon/multimodal/src/autogluon/multimodal/data/dataset.py
imports: import logging
  from typing import Dict, List, Optional, Union
  import pandas
  import torch
  from ..constants import AUTOMM, GET_ITEM_ERROR_RETRY
  from .preprocess_dataframe import MultiModalFeaturePreprocessor
  from .utils import apply_data_processor, apply_df_preprocessor, get_per_sample_features
label_desc: Use image node_id 3 for calling the BaseDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: ret, self