code: def _create_text_labels(classes, scores, class_names, is_crowd=None):
      """
      Args:
          classes (list[int] or None):
          scores (list[float] or None):
          class_names (list[str] or None):
          is_crowd (list[bool] or None):
  
      Returns:
          list[str] or None
      """
      labels = None
      if classes is not None:
          if class_names is not None and len(class_names) > 0:
              labels = [class_names[i] for i in classes]
          else:
              labels = [str(i) for i in classes]
      if scores is not None:
          if labels is None:
              labels = ["{:.0f}%".format(s * 100) for s in scores]
          else:
              labels = [
                  "{} {:.0f}%".format(l, s * 100)
                  for l, s in zip(labels, scores)
              ]
      if labels is not None and is_crowd is not None:
          labels = [
              l + ("|crowd" if crowd else "")
              for l, crowd in zip(labels, is_crowd)
          ]
      return labels
  
imports: import colorsys
  import logging
  import math
  import numpy
  from enum import Enum, unique
  import cv2
  import matplotlib
  import matplotlib.colors
  import matplotlib.figure
  import pycocotools.mask
  import torch
  from matplotlib.backends.backend_agg import FigureCanvasAgg
  from PIL import Image
  from detectron2.data import MetadataCatalog
  from detectron2.structures import BitMasks, Boxes, BoxMode, Keypoints, PolygonMasks, RotatedBoxes
  from detectron2.utils.file_io import PathManager
  from .colormap import random_color
label_desc: Use image node_id 1 for calling a global function with example usage: _create_text_labels(classes, scores, class_names, is_crowd) and returns: labels