def METHOD_NAME(
    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)