code: def _print_colorful_text(input_tokens, tokenizer, pred_triples):
      """
      pred_triples:
          Assumes no overlapping triples
      """
      sort_idxs = sorted(
          range(len(pred_triples)), key=lambda idx: pred_triples[idx][1]
      )
  
      init()  # colorful output
      msg = ""
      if pred_triples and (len(pred_triples) > 0):
          msg += tokenizer.decode(
              input_tokens[0 : int(pred_triples[sort_idxs[0]][1])]
          )
          for i, idx in enumerate(sort_idxs):
              triple = pred_triples[idx]
              msg += " " + colored(
                  tokenizer.decode(
                      input_tokens[int(triple[1]) : int(triple[2])]
                  ),
                  "grey",
                  HIGHLIGHTS[idx % len(HIGHLIGHTS)],
              )
              if i < len(sort_idxs) - 1:
                  msg += " " + tokenizer.decode(
                      input_tokens[
                          int(triple[2]) : int(
                              pred_triples[sort_idxs[i + 1]][1]
                          )
                      ]
                  )
              else:
                  msg += " " + tokenizer.decode(
                      input_tokens[int(triple[2]) :]
                  )
      else:
          msg = tokenizer.decode(input_tokens)
      print("\n" + str(msg) + "\n")
  
imports: import argparse
  import json
  import sys
  from elq.index.faiss_indexer import DenseFlatIndexer, DenseHNSWFlatIndexer, DenseIVFFlatIndexer
  import logging
  import torch
  import numpy
  from colorama import init
  from termcolor import colored
  import torch.nn.functional
  import blink.ner
  from torch.utils.data import DataLoader, SequentialSampler, TensorDataset
  from elq.biencoder.biencoder import BiEncoderRanker, load_biencoder, to_bert_input
  from elq.biencoder.data_process import process_mention_data, get_context_representation_single_mention, get_candidate_representation
  import elq.candidate_ranking.utils
  import math
  from elq.vcg_utils.measures import entity_linking_tp_with_overlap
  from elq.biencoder.utils import batch_reshape_mask_left
  import os
  import sys
  from tqdm import tqdm
  import pdb
  import time
  from transformers import BertTokenizer
label_desc: Use image node_id 1 for calling a global function with example usage: _print_colorful_text(input_tokens, tokenizer, pred_triples) without return types