code: def _test_chunks(
      seed,
      batch_size,
      ndim,
      dtype,
      layout,
      mode,
      permute,
      oversized_shape,
      sequence_axis_name,
  ):
      rng = np.random.default_rng(seed=seed)
      source = seq_source(
          rng, ndim, dtype, mode, permute, oversized_shape
      )
  
      @pipeline_def
      def pipeline():
          (
              baseline,
              deflated,
              reported_shape,
              *rest,
          ) = fn.external_source(
              source=source,
              batch=False,
              num_outputs=5 if mode == "offset_and_size" else 4,
          )
          if mode == "offset_only":
              (offsets,) = rest
              sizes = None
          elif mode == "size_only":
              (sizes,) = rest
              offsets = None
          else:
              offsets, sizes = rest
          inflated = fn.experimental.inflate(
              deflated.gpu(),
              shape=reported_shape,
              dtype=np_type_to_dali(dtype),
              chunk_offsets=offsets,
              chunk_sizes=sizes,
              layout=layout,
              sequence_axis_name=sequence_axis_name,
          )
          return inflated, baseline
  
      pipe = pipeline(batch_size=batch_size, num_threads=4, device_id=0)
      pipe.build()
      if layout:
          layout = (sequence_axis_name or "F") + layout
      for _ in range(4):
          inflated, baseline = pipe.run()
          check_batch(
              inflated,
              baseline,
              batch_size,
              layout,
              oversized_shape=oversized_shape,
          )
  
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 8 for calling a global function with example usage: _test_chunks(seed, batch_size, ndim, dtype, layout, mode, permute, oversized_shape, sequence_axis_name) and returns: inflated,  baseline