code: def get_multi_label_stats(labels, outfile="stats.tsv", verbose=True):
      """
      Args:
          labels: list of tuples containing labels for each utterance
              Example: If there are 5 intents in total, then (0,1,1,1,0) represents the labels
                       for an individual utterance. (0,1,1,1,0) indicates that the utterance has labels
                       at index/line 1,2, and 3 in dict.intents. The list of tuples contain labels for
                       all utterances.
  
          outfile: path to the file where to save label stats
  
      Returns:
          total (int): total number of labels
          freq_dict (list of tuples): each tuple represents class counts in the form of (negative, positive)
      """
      total = len(labels)
      positive_class_total = 0
      class_count_dict = {}
  
      # Get the count of each label in the label dictionary, both the positive and negative classes
      for label in labels:
          for label_index, val in enumerate(label):
              if label_index not in class_count_dict:
                  class_count_dict[label_index] = [0, 0]
  
              if val == 1:
                  positive_class_total += 1
                  class_count_dict[label_index][1] += 1
              else:
                  class_count_dict[label_index][0] += 1
  
      if verbose:
          three_most_frequent_classes = sorted(
              class_count_dict,
              key=lambda idx: class_count_dict[idx][1],
              reverse=True,
          )
  
          for cnt, idx in enumerate(three_most_frequent_classes):
              if cnt > 2:
                  break
  
              positives = class_count_dict[idx][1]
              logging.info(
                  f"label: {idx}, {positives} out of {positive_class_total} ({(positives / positive_class_total)*100.0:.2f}%)."
              )
  
      return total, class_count_dict, len(labels[0]) - 1
  
imports: import csv
  import json
  import os
  import pickle
  import random
  import re
  import string
  from collections import Counter
  import numpy
  import torch
  from tqdm.auto import tqdm
  from nemo.utils import logging
  from nemo.utils.env_var_parsing import get_envint
label_desc: Use image node_id 5 for calling a global function with example usage: get_multi_label_stats(labels, outfile, verbose) and returns: total,  class_count_dict,  unknown