code: def _assert_frontend_ret(ret, for_fn=True):
      fn_or_method = "function" if for_fn else "method"
      if not inspect.isclass(ret):
          is_ret_tuple = issubclass(ret.__class__, tuple)
      else:
          is_ret_tuple = issubclass(ret, tuple)
      if is_ret_tuple:
          non_frontend_idxs = ivy.nested_argwhere(
              ret,
              lambda _x: not _is_frontend_array(_x)
              if ivy.is_array(_x)
              else False,
          )
          assert not non_frontend_idxs, (
              f"Frontend {fn_or_method} return contains non-frontend arrays at positions"
              f" {non_frontend_idxs} (zero-based):"
              f" {ivy.multi_index_nest(ret, non_frontend_idxs)}"
          )
      elif ivy.is_array(ret):
          assert _is_frontend_array(
              ret
          ), f"Frontend {fn_or_method} returned non-frontend array: {ret}"
  
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 7 for calling a global function with example usage: _assert_frontend_ret(ret, for_fn) without return types