code: def _np_reduce(dat, axis, keepdims, numpy_reduce_func):
      if isinstance(axis, int):
          axis = [axis]
      else:
          axis = (
              list(axis) if axis is not None else range(len(dat.shape))
          )
      ret = dat
      for i in reversed(sorted(axis)):
          ret = numpy_reduce_func(ret, axis=i)
      if keepdims:
          keepdims_shape = list(dat.shape)
          for i in axis:
              keepdims_shape[i] = 1
          ret = ret.reshape(tuple(keepdims_shape))
      return ret
  
imports: import os
  import mxnet
  import numpy
  import pickle
label_desc: Use image node_id 1 for calling a global function with example usage: _np_reduce(dat, axis, keepdims, numpy_reduce_func) and returns: ret