code: def undecorate(subject: _MockObject) -> Any:
      """Unwrap mock if *subject* is decorated by mocked object.
  
      If not decorated, returns given *subject* itself.
      """
      if ismock(subject) and subject.__sphinx_decorator_args__:
          return subject.__sphinx_decorator_args__[0]
      else:
          return subject
  
imports: from __future__ import annotations
  import contextlib
  import os
  import sys
  from importlib.abc import Loader, MetaPathFinder
  from importlib.machinery import ModuleSpec
  from types import MethodType, ModuleType
  from typing import TYPE_CHECKING, Any
  from sphinx.util import logging
  from sphinx.util.inspect import isboundmethod, safe_getattr
label_desc: Use image node_id 5 for calling a global function with example usage: undecorate(subject) and returns: subject, subject