code: def input_generator(num_inputs, batch_size, ndim, variable_axis=None):
      if ndim <= 0:
          max_extent = 1
      else:
          max_extent = int(
              math.ceil(
                  math.pow(1e6 / (batch_size * num_inputs), 1 / ndim)
              )
          )
  
      def gen():
          if ndim == 0:
              inputs = []
              for i in range(num_inputs):
                  inputs.append(
                      [
                          np.float32(np.random.random())
                          for _ in range(batch_size)
                      ]
                  )
              return inputs
  
          inputs = [[] for _ in range(num_inputs)]
          for i in range(batch_size):
              base_shape = np.random.randint(1, max_extent, [ndim])
              for j in range(num_inputs):
                  shape = list(base_shape)
                  if variable_axis is not None:
                      shape[variable_axis] = np.random.randint(1, 10)
                  inputs[j].append(
                      np.random.random(shape).astype(np.float32)
                  )
          return inputs
  
      return gen
  
file_path: DALI/dali/test/python/operator_1/test_join.py
imports: import nvidia.dali
  import nvidia.dali.fn
  import numpy
  import math
  from test_utils import check_batch
label_desc: Use image node_id 1 for calling a global function with example usage: input_generator(num_inputs, batch_size, ndim, variable_axis) and returns: gen, inputs, inputs