code: def print_class_histogram(roidbs):
      """
      Args:
          roidbs (list[dict]): the same format as the output of `training_roidbs`.
      """
      class_names = DatasetRegistry.get_metadata(
          cfg.DATA.TRAIN[0], "class_names"
      )
      # labels are in [1, NUM_CATEGORY], hence +2 for bins
      hist_bins = np.arange(cfg.DATA.NUM_CATEGORY + 2)
  
      # Histogram of ground-truth objects
      gt_hist = np.zeros((cfg.DATA.NUM_CATEGORY + 1,), dtype=np.int)
      for entry in roidbs:
          # filter crowd?
          gt_inds = np.where(
              (entry["class"] > 0) & (entry["is_crowd"] == 0)
          )[0]
          gt_classes = entry["class"][gt_inds]
          if len(gt_classes):
              assert gt_classes.max() <= len(class_names) - 1
          gt_hist += np.histogram(gt_classes, bins=hist_bins)[0]
      data = list(
          itertools.chain(
              *[
                  [class_names[i + 1], v]
                  for i, v in enumerate(gt_hist[1:])
              ]
          )
      )
      COL = min(6, len(data))
      total_instances = sum(data[1::2])
      data.extend([None] * ((COL - len(data) % COL) % COL))
      data.extend(["total", total_instances])
      data = itertools.zip_longest(*[data[i::COL] for i in range(COL)])
      # the first line is BG
      table = tabulate(
          data,
          headers=["class", "#box"] * (COL // 2),
          tablefmt="pipe",
          stralign="center",
          numalign="left",
      )
      logger.info(
          "Ground-Truth category distribution:\n"
          + colored(table, "cyan")
      )
  
imports: import copy
  import itertools
  import numpy
  import cv2
  from tabulate import tabulate
  from termcolor import colored
  from tensorpack.dataflow import DataFromList, MapData, MapDataComponent, MultiProcessMapData, MultiThreadMapData, TestDataSpeed, imgaug
  from tensorpack.utils import logger
  from tensorpack.utils.argtools import log_once
  from modeling.model_rpn import get_all_anchors
  from modeling.model_fpn import get_all_anchors_fpn
  from common import CustomResize, DataFromListOfDict, box_to_point4, filter_boxes_inside_shape, np_iou, point4_to_box, polygons_to_mask
  from config import config
  from dataset import DatasetRegistry, register_coco
  from utils.np_box_ops import area
  from utils.np_box_ops import ioa
label_desc: Use image node_id 1 for calling a global function with example usage: print_class_histogram(roidbs) without return types