code: def _patch_sys_path(append):
      """A context manager that appends the given value to the path once entered.
  
      Args:
          append: The value to append to the path.
  
      """
      if append in sys.path:
          yield
          return
  
      sys.path.append(append)
  
      try:
          yield
      finally:
          sys.path.remove(append)
  
imports: import inspect
  import os
  import sys
  import traceback
  import types
  from contextlib import contextmanager
  from copy import copy
  from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Type, Union
  from lightning.app.utilities.exceptions import MisconfigurationException
  from lightning.app.utilities.app_helpers import Logger, _mock_missing_imports
label_desc: Use image node_id 9 for calling a global function with example usage: _patch_sys_path(append) without return types