code: def run_checks(
      samples_allowed,
      batches_allowed,
      samples_disallowed,
      batches_disallowed,
  ):
      for sample, baseline in samples_allowed:
          yield passes_assert, external_source_impl.assert_cpu_sample_data_type, sample
          yield converts, external_source_impl.sample_to_numpy, sample, baseline
      for sample, baseline in samples_allowed + batches_allowed:
          yield passes_assert, external_source_impl.assert_cpu_batch_data_type, sample
          yield converts, external_source_impl.batch_to_numpy, sample, baseline
      for sample in samples_disallowed:
          yield raises(TypeError, "Unsupported callback return type.")(
              external_source_impl.assert_cpu_sample_data_type
          ), sample
      for sample in samples_disallowed + batches_disallowed:
          yield raises(TypeError, "Unsupported callback return type")(
              external_source_impl.assert_cpu_batch_data_type
          ), sample
  
file_path: DALI/dali/test/python/test_external_source_impl_utils.py
imports: from nvidia.dali._utils import external_source_impl
  from nvidia.dali import tensors, pipeline_def
  import nvidia.dali.fn
  from nose.tools import assert_equals
  from nose_utils import raises
  from nose.plugins.attrib import attr
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: run_checks(samples_allowed, batches_allowed, samples_disallowed, batches_disallowed) without return types