code: def _flatten_fw_return(ret, backend):
      with BackendHandler.update_backend(backend) as ivy_backend:
          if not isinstance(ret, tuple):
              ret = (ret,)
          ret_idxs = ivy_backend.nested_argwhere(
              ret,
              lambda x: ivy_backend.is_ivy_array(x)
              or ivy_backend.is_native_array(x),
          )
          if len(ret_idxs) == 0:
              ret_idxs = ivy_backend.nested_argwhere(
                  ret, ivy_backend.isscalar
              )
              ret_flat = ivy_backend.multi_index_nest(ret, ret_idxs)
              ret_flat = [
                  ivy_backend.asarray(
                      x,
                      dtype=ivy_backend.Dtype(str(np.asarray(x).dtype)),
                  )
                  for x in ret_flat
              ]
          else:
              ret_flat = ivy_backend.multi_index_nest(ret, ret_idxs)
  
          # convert the return to NumPy
          ret_np_flat = [ivy_backend.to_numpy(x) for x in ret_flat]
          return ret_np_flat
  
file_path: ivy/ivy_tests/test_ivy/test_frontends/test_numpy/helpers.py
imports: import numpy
  from hypothesis import strategies
  import ivy
  import ivy_tests.test_ivy.helpers
  import ivy.functional.frontends.numpy
  from ivy_tests.test_ivy.helpers.pipeline_helper import BackendHandler, get_frontend_config
  import ivy_tests.test_ivy.helpers.globals
label_desc: Use image node_id 3 for calling a global function with example usage: _flatten_fw_return(ret, backend) and returns: ret_np_flat