code: def is_formatted_text(value: object) -> TypeGuard[AnyFormattedText]:
      """
      Check whether the input is valid formatted text (for use in assert
      statements).
      In case of a callable, it doesn't check the return type.
      """
      if callable(value):
          return True
      if isinstance(value, (str, list)):
          return True
      if hasattr(value, "__pt_formatted_text__"):
          return True
      return False
  
file_path: catboost/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/base.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, Callable, Iterable, List, Tuple, Union, cast
  from prompt_toolkit.mouse_events import MouseEvent
label_desc: Use image node_id 2 for calling a global function with example usage: is_formatted_text(value) and returns: False, True, True, True