code: def color_sentence(sentence: str, word: str) -> str:
      """
      Searches for a given token in the sentence and returns the sentence where the given token is colored red
  
      Parameters
      ----------
      sentence:
          a sentence where the word is searched
  
      word:
          keyword to find in `sentence`. Assumes the word exists in the sentence.
      Returns
      ---------
      colored_sentence:
          `sentence` where the every occurrence of the word is colored red, using ``termcolor.colored``
  
      Examples
      --------
      >>> from cleanlab.internal.token_classification_utils import color_sentence
      >>> sentence = "This is a sentence."
      >>> word = "sentence"
      >>> color_sentence(sentence, word)
      'This is a \x1b[31msentence\x1b[0m.'
  
      Also works for multiple occurrences of the word
  
      >>> document = "This is a sentence. This is another sentence."
      >>> word = "sentence"
      >>> color_sentence(document, word)
      'This is a \x1b[31msentence\x1b[0m. This is another \x1b[31msentence\x1b[0m.'
      """
      colored_word = colored(word, "red")
      return _replace_sentence(
          sentence=sentence, word=word, new_word=colored_word
      )
  
file_path: cleanlab/cleanlab/internal/token_classification_utils.py
imports: from __future__ import annotations
  import re
  import string
  import numpy
  from termcolor import colored
  from typing import List, Optional, Callable, Tuple, TypeVar, TYPE_CHECKING
label_desc: Use image node_id 6 for calling a global function with example usage: color_sentence(sentence, word) and returns: _replace_sentence