code: def seq_source(rng, ndim, dtype, mode, permute, oversized_shape):
      def uniform(shape):
          return dtype(rng.uniform(-(2**31), 2**31 - 1, shape))
  
      def std(shape):
          return dtype(128 * rng.standard_normal(shape) + 3)
  
      def smaller_std(shape):
          return dtype(16 * rng.standard_normal(shape))
  
      def inflate_shape(shape):
          multiplier = rng.uniform(1, 2, ndim)
          return np.int32(shape * multiplier)
  
      def inner():
          max_extent_size = 64 if ndim >= 3 else 128
          distrs = [uniform, std, smaller_std]
          distrs = rng.permutation(distrs)
          num_chunks = np.int32(rng.uniform(1, 32))
          shape = np.int32(rng.uniform(0, max_extent_size, ndim))
          sample = np.array(
              [
                  (distrs[i % len(distrs)])(shape)
                  for i in range(num_chunks)
              ],
              dtype=dtype,
          )
          chunks = [sample_to_lz4(chunk) for chunk in sample]
          sizes = [len(chunk) for chunk in chunks]
          offsets = np.int32(np.cumsum([0] + sizes[:-1]))
          sizes = np.array(sizes, dtype=np.int32)
          deflated = np.concatenate(chunks)
          reported_shape = (
              shape if not oversized_shape else inflate_shape(shape)
          )
          if permute:
              assert mode == "offset_and_size"
              perm = rng.permutation(num_chunks)
              subset = rng.choice([True, False], num_chunks)
              sample = sample[perm][subset]
              offsets = offsets[perm][subset]
              sizes = sizes[perm][subset]
          if mode == "offset_only":
              return sample, deflated, reported_shape, offsets
          elif mode == "size_only":
              return sample, deflated, reported_shape, sizes
          else:
              assert mode == "offset_and_size"
              return sample, deflated, reported_shape, offsets, sizes
  
      return inner
  
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 7 for calling a global function with example usage: seq_source(rng, ndim, dtype, mode, permute, oversized_shape) and returns: inner, dtype, dtype, dtype, np, sample,  deflated,  reported_shape,  offsets, sample,  deflated,  reported_shape,  sizes, sample,  deflated,  reported_shape,  offsets,  sizes