code: def check_batch(
      inflated, baseline, batch_size, layout=None, oversized_shape=False
  ):
      layout = layout or ""
      assert inflated.layout() == layout, (
          f"The batch layout '({inflated.layout()})' does "
          f"not match the expected layout ({layout})"
      )
      inflated_samples = [
          np.array(sample) for sample in inflated.as_cpu()
      ]
      baseline_samples = [np.array(sample) for sample in baseline]
      assert batch_size == len(inflated) == len(baseline)
      if not oversized_shape:
          for inflated_sample, baseline_sample in zip(
              inflated_samples, baseline_samples
          ):
              np.testing.assert_array_equal(
                  inflated_sample, baseline_sample
              )
      else:
          for inflated_sample, baseline_sample in zip(
              inflated_samples, baseline_samples
          ):
              assert len(inflated_sample) == len(baseline_sample)
              for inflated_frame, baseline_frame in zip(
                  inflated_sample, baseline_sample
              ):
                  flat_inflated = inflated_frame.reshape(-1)
                  baseline_size = baseline_frame.size
                  actually_inflated = flat_inflated[
                      :baseline_size
                  ].reshape(baseline_frame.shape)
                  np.testing.assert_array_equal(
                      actually_inflated, baseline_frame
                  )
                  output_tail = flat_inflated[baseline_size:]
                  assert np.all(output_tail == 0), (
                      f"Oversized output was not properly padded with 0s. "
                      f"Tail size {len(output_tail)}, the tail {output_tail}"
                  )
  
file_path: DALI/dali/test/python/operator_1/test_inflate.py
imports: import numpy
  from nvidia.dali import pipeline_def, fn, types
  from test_utils import np_type_to_dali, has_operator, restrict_platform
  from nose_utils import assert_raises
  from nose2.tools import params
label_desc: Use image node_id 2 for calling a global function with example usage: check_batch(inflated, baseline, batch_size, layout, oversized_shape) without return types