code: def _is_known_loaded_type(f, module_name, entity_name):
      """Tests whether the function or method is an instance of a known type."""
      if module_name not in sys.modules or not hasattr(
          sys.modules[module_name], entity_name
      ):
          return False
      type_entity = getattr(sys.modules[module_name], entity_name)
      if isinstance(f, type_entity):
          # The method if of this type. Example:
          #
          # o = ClassType()
          # function(o.method)()
          return True
      # Note: inspect is required here, to avoid unpacking tf.function decorators.
      if inspect.ismethod(f):
          # The unbound method if of this type. Example:
          #
          # class ClassType:
          #   @function
          #   def method(self):
          #     ...
          # o = ClassType()
          # o.method()
          if isinstance(f.__func__, type_entity):
              return True
      return False
  
file_path: DALI/dali/python/nvidia/dali/_autograph/impl/conversion.py
imports: import functools
  import inspect
  import sys
  import unittest
  from nvidia.dali._autograph.core import config
  from nvidia.dali._autograph.pyct import cache
  from nvidia.dali._autograph.pyct import inspect_utils
  from nvidia.dali._autograph.utils import ag_logging
label_desc: Use image node_id 2 for calling a global function with example usage: _is_known_loaded_type(f, module_name, entity_name) and returns: False, False, True, True