code: def flatten_frontend_fw_to_np(
      frontend_ret, isscalar_func, is_native_array_func, to_numpy_func
  ):
      if not isinstance(frontend_ret, tuple):
          frontend_ret = (frontend_ret,)
      frontend_ret_idxs = ivy.nested_argwhere(
          frontend_ret, is_native_array_func
      )
      if len(frontend_ret_idxs) == 0:  # handle scalars
          frontend_ret_idxs = ivy.nested_argwhere(
              frontend_ret, isscalar_func
          )
          frontend_ret_flat = ivy.multi_index_nest(
              frontend_ret, frontend_ret_idxs
          )
      else:
          frontend_ret_flat = ivy.multi_index_nest(
              frontend_ret, frontend_ret_idxs
          )
      return [to_numpy_func(x) for x in frontend_ret_flat]
  
imports: import copy
  import time
  from typing import Union, List, Optional
  import numpy
  import types
  import importlib
  import inspect
  from collections import OrderedDict
  from .globals import mod_backend
  from .pipeline_helper import BackendHandler, BackendHandlerMode, get_frontend_config
  import ivy
  from ivy_tests.test_ivy.helpers.test_parameter_flags import FunctionTestFlags
  import ivy_tests.test_ivy.helpers.test_parameter_flags
  import ivy_tests.test_ivy.helpers.globals
  from ivy.functional.ivy.data_type import _get_function_list, _get_functions_from_string
  from ivy_tests.test_ivy.test_frontends import NativeClass
  from ivy_tests.test_ivy.helpers.structs import FrontendMethodData
  from ivy_tests.test_ivy.helpers.testing_helpers import _create_transpile_report
  from .assertions import value_test, assert_same_type, check_unsupported_dtype
label_desc: Use image node_id 26 for calling a global function with example usage: flatten_frontend_fw_to_np(frontend_ret, isscalar_func, is_native_array_func, to_numpy_func) and returns: unknown