code: def run_numpy(
      reduce_fn, batch_fn, keep_dims, axes, output_type, ddof=None
  ):
      result = []
      args = {"keepdims": keep_dims, "axis": axes}
      if output_type is not None:
          args["dtype"] = output_type
  
      if ddof is not None:
          args["ddof"] = ddof
  
      for _ in range(batch_fn.num_iter()):
          batch = batch_fn()
          sample_result = []
          for sample in batch:
              sample_reduced = reduce_fn(sample, **args)
              sample_result.append(sample_reduced)
  
          result.append(sample_result)
      return result
  
imports: import nvidia.dali.fn
  from nvidia.dali.pipeline import Pipeline
  from nose.tools import nottest
  import numpy
  from test_utils import np_type_to_dali
  from nose_utils import assert_raises
label_desc: Use image node_id 4 for calling a global function with example usage: run_numpy(reduce_fn, batch_fn, keep_dims, axes, output_type, ddof) and returns: result