code: def test_ansi_256_color():
      assert to_formatted_text(ANSI("\x1b[38;5;124mtest")) == [
          ("#af0000", "t"),
          ("#af0000", "e"),
          ("#af0000", "s"),
          ("#af0000", "t"),
      ]
  
file_path: catboost/contrib/python/prompt-toolkit/py3/tests/test_formatted_text.py
imports: from __future__ import annotations
  from prompt_toolkit.formatted_text import ANSI, HTML, FormattedText, PygmentsTokens, Template, merge_formatted_text, to_formatted_text
  from prompt_toolkit.formatted_text.utils import split_lines
label_desc: Use image node_id 4 for calling a global function with example usage: test_ansi_256_color() without return types