code: def warn_missing_tags(
      tag_vocab, data_tags, error_msg, bioes_to_bio=False
  ):
      """
      Check for tags missing from the tag_vocab.
  
      Given a tag_vocab and the known tags in the format used by
      ner.data, go through the tags in the dataset and look for any
      which aren't in the tag_vocab.
  
      error_msg is something like "training set" or "eval file" to
      indicate where the missing tags came from.
      """
      tag_depth = max(
          max(len(tags) for tags in sentence) for sentence in data_tags
      )
  
      if tag_depth != len(tag_vocab.lens()):
          logger.warning(
              "Test dataset has a different number of tag types compared to the model: %d vs %d",
              tag_depth,
              len(tag_vocab.lens()),
          )
      for tag_set_idx in range(min(tag_depth, len(tag_vocab.lens()))):
          tag_set = tag_vocab.items(tag_set_idx)
          if len(tag_vocab.lens()) > 1:
              current_error_msg = (
                  error_msg + " tag set %d" % tag_set_idx
              )
          else:
              current_error_msg = error_msg
  
          current_tags = set(
              [
                  word[tag_set_idx]
                  for sentence in data_tags
                  for word in sentence
              ]
          )
          if bioes_to_bio:
              current_tags = set(
                  [
                      re.sub("^E-", "I-", re.sub("^S-", "B-", x))
                      for x in current_tags
                  ]
              )
          utils.warn_missing_tags(
              tag_set, current_tags, current_error_msg
          )
  
imports: import sys
  import os
  import time
  from datetime import datetime
  import argparse
  import logging
  import numpy
  import random
  import re
  import json
  import torch
  from torch import nn, optim
  from stanza.models.ner.data import DataLoader
  from stanza.models.ner.trainer import Trainer
  from stanza.models.ner import scorer
  from stanza.models.common import utils
  from stanza.models.common.pretrain import Pretrain
  from stanza.utils.conll import CoNLL
  from stanza.models.common.doc import *
  from stanza.models import _training_logging
  from stanza.utils.confusion import confusion_to_weighted_f1, format_confusion
label_desc: Use image node_id 7 for calling a global function with example usage: warn_missing_tags(tag_vocab, data_tags, error_msg, bioes_to_bio) without return types