code: def check_example_labels(example, tokenizer, text_only=False):
      # Get the input_ids, labels, and attention_mask from the dataset
      input_ids = example["input_ids"]
      labels = example["labels"]
  
      # You can compare the input_ids and labels element-wise
      # Remember to ignore positions with IGNORE_TOKEN_ID (if you use it) or attention_mask equal to 0
      colored_tokens = []
      for _, (input_id, label_id) in enumerate(zip(input_ids, labels)):
          decoded_input_token = tokenizer.decode(input_id)
          # Choose the color based on whether the label has the ignore value or not
          color = (
              "red"
              if label_id == -100
              else ("yellow" if label_id == 0 else "green")
          )
          colored_token = colored(decoded_input_token, color) + (
              not text_only
              and colored(f"({label_id}, {input_id})", "white")
              or ""
          )
          colored_tokens.append(colored_token)
  
      delimiter = "" if text_only else " "
      LOG.info(delimiter.join(colored_tokens))
      LOG.info("\n\n\n")
  
      return " ".join(colored_tokens)
  
imports: import logging
  from termcolor import colored
label_desc: Use image node_id 2 for calling a global function with example usage: check_example_labels(example, tokenizer, text_only) and returns: str