code: def test_function_ground_truth_computation(
      ground_truth_backend,
      on_device,
      args_np,
      arg_np_arrays,
      arrays_args_indices,
      kwargs_np,
      arrays_kwargs_indices,
      kwarg_np_arrays,
      input_dtypes,
      test_flags,
      fn_name,
  ):
      with BackendHandler.update_backend(
          ground_truth_backend
      ) as gt_backend:
          gt_backend.set_default_device(on_device)  # TODO remove
          args, kwargs = create_args_kwargs(
              backend=test_flags.ground_truth_backend,
              args_np=args_np,
              arg_np_vals=arg_np_arrays,
              args_idxs=arrays_args_indices,
              kwargs_np=kwargs_np,
              kwargs_idxs=arrays_kwargs_indices,
              kwarg_np_vals=kwarg_np_arrays,
              input_dtypes=input_dtypes,
              test_flags=test_flags,
              on_device=on_device,
          )
          (
              ret_from_gt,
              ret_np_from_gt_flat,
          ) = get_ret_and_flattened_np_array(
              test_flags.ground_truth_backend,
              gt_backend.__dict__[fn_name],
              *args,
              test_trace=test_flags.test_trace,
              precision_mode=test_flags.precision_mode,
              **kwargs,
          )
          assert gt_backend.nested_map(
              lambda x: gt_backend.is_ivy_array(x)
              if gt_backend.is_array(x)
              else True,
              ret_from_gt,
          ), f"Ground-truth function returned non-ivy arrays: {ret_from_gt}"
          if test_flags.with_out and not test_flags.test_trace:
              test_ret_from_gt = (
                  ret_from_gt[
                      getattr(gt_backend.__dict__[fn_name], "out_index")
                  ]
                  if hasattr(gt_backend.__dict__[fn_name], "out_index")
                  else ret_from_gt
              )
              out_from_gt = gt_backend.nested_map(
                  gt_backend.zeros_like,
                  test_ret_from_gt,
                  to_mutable=True,
                  include_derived=True,
              )
              (
                  ret_from_gt,
                  ret_np_from_gt_flat,
              ) = get_ret_and_flattened_np_array(
                  test_flags.ground_truth_backend,
                  gt_backend.__dict__[fn_name],
                  *args,
                  test_trace=test_flags.test_trace,
                  precision_mode=test_flags.precision_mode,
                  **kwargs,
                  out=out_from_gt,
              )
  
          # TODO enable
          fw_list = gradient_unsupported_dtypes(
              fn=gt_backend.__dict__[fn_name]
          )
          ret_from_gt_device = None
          if isinstance(
              ret_from_gt, gt_backend.Array
          ):  # TODO use str for now
              ret_from_gt_device = gt_backend.dev(ret_from_gt)
      return (
          ret_from_gt,
          ret_np_from_gt_flat,
          ret_from_gt_device,
          test_flags,
          fw_list,
      )
  
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 5 for calling a global function with example usage: test_function_ground_truth_computation(ground_truth_backend, on_device, args_np, arg_np_arrays, arrays_args_indices, kwargs_np, arrays_kwargs_indices, kwarg_np_arrays, input_dtypes, test_flags, fn_name) and returns: ret_from_gt,  ret_np_from_gt_flat,  ret_from_gt_device,  test_flags,  fw_list