code: def test_html_rendering():
      text = (
          "Boris Johnson has been elected new Conservative leader in "
          "a ballot of party members and will become the "
          "next UK prime minister. &"
      )
      sentence = Sentence(text)
  
      print(sentence[0:2].add_label("ner", "PER"))
      print(sentence[6:7].add_label("ner", "MISC"))
      print(sentence[19:20].add_label("ner", "LOC"))
      colors = {
          "PER": "#F7FF53",
          "ORG": "#E8902E",
          "LOC": "yellow",
          "MISC": "#4647EB",
          "O": "#ddd",
      }
      actual = render_ner_html([sentence], colors=colors)
  
      expected_res = HTML_PAGE.format(
          text=PARAGRAPH.format(
              sentence=TAGGED_ENTITY.format(
                  color="#F7FF53", entity="Boris Johnson", label="PER"
              )
              + " has been elected new "
              + TAGGED_ENTITY.format(
                  color="#4647EB", entity="Conservative", label="MISC"
              )
              + " leader in a ballot of party members and will become the next "
              + TAGGED_ENTITY.format(
                  color="yellow", entity="UK", label="LOC"
              )
              + " prime minister. &amp;"
          ),
          title="Flair",
      )
  
      assert expected_res == actual
  
file_path: flair/tests/test_visual.py
imports: from flair.data import Sentence, Span, Token
  from flair.embeddings import FlairEmbeddings
  from flair.visual import Highlighter
  from flair.visual.ner_html import HTML_PAGE, PARAGRAPH, TAGGED_ENTITY, render_ner_html
  from flair.visual.training_curves import Plotter
label_desc: Use image node_id 4 for calling a global function with example usage: test_html_rendering() without return types