code: def _get_reduction_func(reduction):
      if reduction == "none":
  
          def ret(x):
              return x
  
      elif reduction == "mean":
          ret = ivy.mean
      elif reduction == "sum":
          ret = ivy.sum
      else:
          raise ivy.utils.exceptions.IvyException(
              f"{reduction} is not a valid value for reduction"
          )
      return ret
  
imports: import ivy
  import ivy.functional.frontends.torch
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
label_desc: Use image node_id 3 for calling a global function with example usage: _get_reduction_func(reduction) and returns: ret, x