code: def _adapt_data_from_data_loader(
      input_data: InputData,
      batch_size: int,
  ) -> Union[tf.keras.utils.Sequence, SequenceAdapter, tf.data.Dataset]:
      if isinstance(input_data, tf.data.Dataset):
          return input_data
  
      if isinstance(
          input_data, (tf.keras.utils.Sequence, SequenceAdapter)
      ):
          return input_data
  
      if not isinstance(input_data, tuple) or len(input_data) not in (
          2,
          3,
      ):
          raise det.errors.InvalidDataTypeException(
              type(input_data),
              "input_data is invalid type. See the instruction below for details: \n"
              f"{keras.TFKerasTrial.build_training_data_loader.__doc__}",
          )
  
      x = input_data[0]
      y = input_data[1]
      sample_weight = input_data[2] if len(input_data) == 3 else None
  
      return _ArrayLikeAdapter(x, y, batch_size, sample_weight)
  
file_path: determined/harness/determined/keras/_data.py
imports: import math
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import tensorflow
  import determined
  from determined import keras
  from determined.common import check
label_desc: Use image node_id 5 for calling a global function with example usage: _adapt_data_from_data_loader(input_data, batch_size) and returns: _ArrayLikeAdapter, input_data, input_data