code: def test_set_backend(backend, array_type):
      # recording data before backend change
      stack_before = []
      func_address_before = id(ivy.sum)
      stack_before.extend(ivy.backend_stack)
  
      ivy.set_backend(backend)
      stack_after = ivy.backend_stack
      # check that the function id has changed as inverse=True.
      ivy.utils.assertions.check_equal(
          func_address_before, id(ivy.sum), inverse=True, as_array=False
      )
      # using ivy assertions to ensure the desired backend is set
      ivy.utils.assertions.check_less(
          len(stack_before), len(stack_after), as_array=False
      )
      ivy.utils.assertions.check_equal(
          ivy.current_backend_str(), backend, as_array=False
      )
      backend = importlib.import_module(_backend_dict[backend])
      ivy.utils.assertions.check_equal(
          stack_after[-1], backend, as_array=False
      )
      x = ivy.array([1, 2, 3])
      ivy.utils.assertions.check_equal(
          str(type(ivy.to_native(x))), array_type, as_array=False
      )
  
file_path: ivy/ivy_tests/test_ivy/test_misc/test_backend_utils/test_backend_handler.py
imports: from packaging import version
  import pytest
  import importlib
  import types
  import numpy
  import ivy
  from ivy.utils.backend.handler import _backend_dict
  from ivy_tests.test_ivy.helpers.available_frameworks import _available_frameworks
label_desc: Use image node_id 7 for calling a global function with example usage: test_set_backend(backend, array_type) without return types