code: def test_method_backend_computation(
      init_input_dtypes,
      init_flags,
      backend_to_test,
      init_all_as_kwargs_np,
      on_device,
      method_input_dtypes,
      method_flags,
      method_all_as_kwargs_np,
      class_name,
      method_name,
      init_with_v,
      test_trace,
      method_with_v,
  ):
      init_input_dtypes = ivy.default(init_input_dtypes, [])
  
      # Constructor arguments #
      init_all_as_kwargs_np = ivy.default(init_all_as_kwargs_np, {})
      # split the arguments into their positional and keyword components
      (
          args_np_constructor,
          kwargs_np_constructor,
      ) = kwargs_to_args_n_kwargs(
          num_positional_args=init_flags.num_positional_args,
          kwargs=init_all_as_kwargs_np,
      )
  
      # extract all arrays from the arguments and keyword arguments
      (
          con_arg_np_vals,
          con_args_idxs,
          con_c_arg_vals,
      ) = _get_nested_np_arrays(args_np_constructor)
      (
          con_kwarg_np_vals,
          con_kwargs_idxs,
          con_c_kwarg_vals,
      ) = _get_nested_np_arrays(kwargs_np_constructor)
  
      # make all lists equal in length
      num_arrays_constructor = con_c_arg_vals + con_c_kwarg_vals
      if len(init_input_dtypes) < num_arrays_constructor:
          init_input_dtypes = [
              init_input_dtypes[0]
              for _ in range(num_arrays_constructor)
          ]
      if len(init_flags.as_variable) < num_arrays_constructor:
          init_flags.as_variable = [
              init_flags.as_variable[0]
              for _ in range(num_arrays_constructor)
          ]
      if len(init_flags.native_arrays) < num_arrays_constructor:
          init_flags.native_arrays = [
              init_flags.native_arrays[0]
              for _ in range(num_arrays_constructor)
          ]
  
      # update variable flags to be compatible with float dtype
      with BackendHandler.update_backend(
          backend_to_test
      ) as ivy_backend:
          init_flags.as_variable = [
              v if ivy_backend.is_float_dtype(d) else False
              for v, d in zip(init_flags.as_variable, init_input_dtypes)
          ]
  
      # Save original constructor data for inplace operations
      constructor_data = OrderedDict(
          args_np=args_np_constructor,
          arg_np_vals=con_arg_np_vals,
          args_idxs=con_args_idxs,
          kwargs_np=kwargs_np_constructor,
          kwarg_np_vals=con_kwarg_np_vals,
          kwargs_idxs=con_kwargs_idxs,
          input_dtypes=init_input_dtypes,
          test_flags=init_flags,
          on_device=on_device,
      )
      org_con_data = copy.deepcopy(constructor_data)
  
      # Create Args
      args_constructor, kwargs_constructor = create_args_kwargs(
          backend=backend_to_test, **constructor_data
      )
      # end constructor #
  
      # method arguments #
      method_input_dtypes = ivy.default(method_input_dtypes, [])
      args_np_method, kwargs_np_method = kwargs_to_args_n_kwargs(
          num_positional_args=method_flags.num_positional_args,
          kwargs=method_all_as_kwargs_np,
      )
  
      # extract all arrays from the arguments and keyword arguments
      (
          met_arg_np_vals,
          met_args_idxs,
          met_c_arg_vals,
      ) = _get_nested_np_arrays(args_np_method)
      (
          met_kwarg_np_vals,
          met_kwargs_idxs,
          met_c_kwarg_vals,
      ) = _get_nested_np_arrays(kwargs_np_method)
  
      # make all lists equal in length
      num_arrays_method = met_c_arg_vals + met_c_kwarg_vals
      if len(method_input_dtypes) < num_arrays_method:
          method_input_dtypes = [
              method_input_dtypes[0] for _ in range(num_arrays_method)
          ]
      if len(method_flags.as_variable) < num_arrays_method:
          method_flags.as_variable = [
              method_flags.as_variable[0]
              for _ in range(num_arrays_method)
          ]
      if len(method_flags.native_arrays) < num_arrays_method:
          method_flags.native_arrays = [
              method_flags.native_arrays[0]
              for _ in range(num_arrays_method)
          ]
      if len(method_flags.container) < num_arrays_method:
          method_flags.container = [
              method_flags.container[0]
              for _ in range(num_arrays_method)
          ]
  
      with BackendHandler.update_backend(
          backend_to_test
      ) as ivy_backend:
          method_flags.as_variable = [
              v if ivy_backend.is_float_dtype(d) else False
              for v, d in zip(
                  method_flags.as_variable, method_input_dtypes
              )
          ]
  
      # Create Args
      args_method, kwargs_method = create_args_kwargs(
          backend=backend_to_test,
          args_np=args_np_method,
          arg_np_vals=met_arg_np_vals,
          args_idxs=met_args_idxs,
          kwargs_np=kwargs_np_method,
          kwarg_np_vals=met_kwarg_np_vals,
          kwargs_idxs=met_kwargs_idxs,
          input_dtypes=method_input_dtypes,
          test_flags=method_flags,
          on_device=on_device,
      )
      # End Method #
  
      # Run testing
      with BackendHandler.update_backend(
          backend_to_test
      ) as ivy_backend:
          ins = ivy_backend.__dict__[class_name](
              *args_constructor, **kwargs_constructor
          )
          # TODO remove when the handle_method can properly compute unsupported dtypes
          if any(
              dtype
              in ivy_backend.function_unsupported_dtypes(
                  ins.__getattribute__(method_name)
              )
              for dtype in method_input_dtypes
          ):
              return
          v_np = None
          if isinstance(ins, ivy_backend.Module):
              if init_with_v:
                  v = ivy_backend.Container(
                      ins._create_variables(
                          device=on_device, dtype=method_input_dtypes[0]
                      )
                  )
                  ins = ivy_backend.__dict__[class_name](
                      *args_constructor, **kwargs_constructor, v=v
                  )
              v = ins.__getattribute__("v")
              v_np = v.cont_map(
                  lambda x, kc: ivy_backend.to_numpy(x)
                  if ivy_backend.is_array(x)
                  else x
              )
              if method_with_v:
                  kwargs_method = dict(**kwargs_method, v=v)
          ret, ret_np_flat = get_ret_and_flattened_np_array(
              backend_to_test,
              ins.__getattribute__(method_name),
              *args_method,
              test_trace=test_trace,
              precision_mode=method_flags.precision_mode,
              **kwargs_method,
          )
          if isinstance(ret, ivy_backend.Array):
              ret_device = ivy_backend.dev(ret)
          else:
              ret_device = None
      fw_list = gradient_unsupported_dtypes(
          fn=ins.__getattribute__(method_name)
      )
  
      return (
          ret,
          ret_np_flat,
          ret_device,
          org_con_data,
          args_np_method,
          met_arg_np_vals,
          met_args_idxs,
          kwargs_np_method,
          met_kwarg_np_vals,
          met_kwargs_idxs,
          v_np,
          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 13 for calling a global function with example usage: test_method_backend_computation(init_input_dtypes, init_flags, backend_to_test, init_all_as_kwargs_np, on_device, method_input_dtypes, method_flags, method_all_as_kwargs_np, class_name, method_name, init_with_v, test_trace, method_with_v) and returns: ret,  ret_np_flat,  ret_device,  org_con_data,  args_np_method,  met_arg_np_vals,  met_args_idxs,  kwargs_np_method,  met_kwarg_np_vals,  met_kwargs_idxs,  v_np,  fw_list