code: def assert_cpu_batch_data_type(
      batch, error_str="Unsupported callback return type. Got: `{}`."
  ):
      import_numpy()
      if isinstance(batch, tensors.TensorListCPU):
          return True
      elif isinstance(batch, list):
          for sample in batch:
              assert_cpu_sample_data_type(sample, error_str)
          return True
      elif assert_cpu_sample_data_type(batch, error_str):
          # Bach can be represented as dense tensor
          return True
      else:
          raise TypeError(error_str.format(type(batch)))
  
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 3 for calling a global function with example usage: assert_cpu_batch_data_type(batch, error_str) and returns: True, True, True