code: def _is_valid_devices_attributes(fn: Callable) -> bool:
      if hasattr(fn, "supported_devices") and hasattr(
          fn, "unsupported_devices"
      ):
          fn_supported_devices = fn.supported_devices
          fn_unsupported_devices = fn.unsupported_devices
          if isinstance(fn_supported_devices, dict):
              if isinstance(fn_unsupported_devices, dict):
                  backend_str = ivy.current_backend_str()
                  if (
                      backend_str in fn_supported_devices
                      and backend_str in fn_unsupported_devices
                  ):
                      return False
          elif isinstance(fn_unsupported_devices, tuple):
              return False
      return True
  
imports: import os
  import gc
  import abc
  import math
  import psutil
  import warnings
  import types
  from typing import Type, Optional, Tuple
  from typing import Union, Callable, Iterable, Any
  import ivy
  from ivy.func_wrapper import handle_out_argument, to_native_arrays_and_back, inputs_to_native_arrays, handle_nestable, handle_array_like_without_promotion, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 28 for calling a global function with example usage: _is_valid_devices_attributes(fn) and returns: True, False, False