code: def test_html_with_style():
      """
      Text `print_formatted_text` with `HTML` wrapped in `to_formatted_text`.
      """
      f = _Capture()
  
      html = HTML("<ansigreen>hello</ansigreen> <b>world</b>")
      formatted_text = to_formatted_text(html, style="class:myhtml")
      pt_print(formatted_text, file=f, color_depth=ColorDepth.DEFAULT)
  
      assert (
          f.data
          == "\x1b[0m\x1b[?7h\x1b[0;32mhello\x1b[0m \x1b[0;1mworld\x1b[0m\r\n\x1b[0m"
      )
  
file_path: catboost/contrib/python/prompt-toolkit/py3/tests/test_print_formatted_text.py
imports: from __future__ import annotations
  import pytest
  from prompt_toolkit import print_formatted_text
  from prompt_toolkit.formatted_text import HTML, FormattedText, to_formatted_text
  from prompt_toolkit.output import ColorDepth
  from prompt_toolkit.styles import Style
  from prompt_toolkit.utils import is_windows
label_desc: Use image node_id 4 for calling a global function with example usage: test_html_with_style() without return types