code: def get_batch_iterable_from_callback(source_desc: SourceDescription):
      """Transform batch callback accepting one argument into an Iterable"""
      first = source_desc.source(
          types.BatchInfo(0, 0) if source_desc.batch_info else 0
      )
      dtype, shape = _inspect_data(first, True)
  
      class CallableBatchIterator:
          first_value = first
  
          def __init__(self):
              self.iteration = 0
              self.source = source_desc.source
  
          def __iter__(self):
              self.iteration = 0
              return self
  
          def __next__(self):
              if (
                  self.iteration == 0
                  and CallableBatchIterator.first_value is not None
              ):
                  result = CallableBatchIterator.first_value
                  CallableBatchIterator.first_value = None
              else:
                  if source_desc.batch_info:
                      # There is no notion of epochs when iterating over DALI Dataset
                      # as the "raise" policy is not supported, so we use epoch 0 only.
                      argument = types.BatchInfo(self.iteration, 0)
                  else:
                      argument = self.iteration
                  result = self.source(argument)
              self.iteration += 1
              return batch_to_numpy(
                  result,
                  _tf_batch_error_msg,
                  non_uniform_str=_tf_uniform_error_msg,
              )
  
      return CallableBatchIterator, dtype, shape
  
imports: from enum import Enum
  from nvidia.dali import types
  from nvidia.dali import tensors
  import inspect
  import functools
label_desc: Use image node_id 11 for calling a global function with example usage: get_batch_iterable_from_callback(source_desc) and returns: CallableBatchIterator,  dtype,  shape, self, batch_to_numpy