code: def generate_data(dims, batch_size, batch_norm, axes, dtype=None):
      """
      Generate random tensors with given dimensionality.
      If batch_norm is True, the extents in non-reduced axe
      If no using batch_norm, axes argument is ignored.
      """
      shapes = np.random.randint(1, 10, [batch_size, dims], dtype=int)
      if batch_norm and axes is not None:
          for i in range(1, batch_size):
              for a in range(dims):
                  if a not in axes:
                      shapes[i, a] = shapes[0, a]
      shapes = shapes.tolist()
      scale = 1
      if dtype is None:
          dtype = np.float32
      elif dtype is not np.float32:
          scale = 255
      return [
          (
              scale
              * (np.random.rand(*s).astype(np.float32) * (1 + i) - i)
          ).astype(dtype)
          for i, s in enumerate(shapes)
      ]
  
imports: from nvidia.dali.pipeline import Pipeline
  from nvidia.dali import backend
  import nvidia.dali.ops
  import numpy
  from test_utils import dali_type
  from nvidia.dali import fn, pipeline_def, types
  from nose2.tools import params
label_desc: Use image node_id 6 for calling a global function with example usage: generate_data(dims, batch_size, batch_norm, axes, dtype) and returns: unknown