code: def html_escape(text: object) -> str:
      # The string interpolation functions also take integers and other types.
      # Convert to string first.
      if not isinstance(text, str):
          text = f"{text}"
  
      return (
          text.replace("&", "&amp;")
          .replace("<", "&lt;")
          .replace(">", "&gt;")
          .replace('"', "&quot;")
      )
  
file_path: catboost/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/html.py
imports: from __future__ import annotations
  import xml.dom.minidom
  from string import Formatter
  from typing import Any
  from .base import FormattedText, StyleAndTextTuples
label_desc: Use image node_id 1 for calling a global function with example usage: html_escape(text) and returns: text