code: def formatreturn(arg, input_is_array=False):
      
      if not input_is_array and arg.size == 1:
          arg = arg.item()
      return arg
docs: If the given argument is a numpy array with shape (1,), just returns
      that value.