code: def _find_exclude_eids(g, exclude_mode, eids, **kwargs):
      if exclude_mode is None:
          return None
      elif callable(exclude_mode):
          return exclude_mode(eids)
      elif F.is_tensor(exclude_mode) or (
          isinstance(exclude_mode, Mapping)
          and all(F.is_tensor(v) for v in exclude_mode.values())
      ):
          return exclude_mode
      elif exclude_mode == "self":
          return eids
      elif exclude_mode == "reverse_id":
          return _find_exclude_eids_with_reverse_id(
              g, eids, kwargs["reverse_eid_map"]
          )
      elif exclude_mode == "reverse_types":
          return _find_exclude_eids_with_reverse_types(
              g, eids, kwargs["reverse_etype_map"]
          )
      else:
          raise ValueError("unsupported mode {}".format(exclude_mode))
  
imports: import inspect
  from collections.abc import Mapping
  from ..None import backend
  from ..base import EID, NID
  from ..convert import heterograph
  from ..frame import LazyFeature
  from ..transforms import compact_graphs
  from ..utils import context_of, recursive_apply
label_desc: Use image node_id 8 for calling a global function with example usage: _find_exclude_eids(g, exclude_mode, eids) and returns: None, exclude_mode, exclude_mode, eids, _find_exclude_eids_with_reverse_id, _find_exclude_eids_with_reverse_types