code: def gradient_unsupported_dtypes(*, fn):
      visited = set()
      to_visit = [fn]
      out, res = {}, {}
      while to_visit:
          fn = to_visit.pop()
          if fn in visited:
              continue
          visited.add(fn)
          unsupported_grads = (
              fn.unsupported_gradients
              if hasattr(fn, "unsupported_gradients")
              else {}
          )
          for k, v in unsupported_grads.items():
              if k not in out:
                  out[k] = []
              out[k].extend(v)
          # skip if it's not a function
          if not (inspect.isfunction(fn) or inspect.ismethod(fn)):
              continue
          fl = _get_function_list(fn)
          res = _get_functions_from_string(
              fl, __import__(fn.__module__)
          )
          to_visit.extend(res)
      return out
  
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 35 for calling a global function with example usage: gradient_unsupported_dtypes() and returns: out