code: def check_labels(labels, dataset):
      """
      Check that all of the labels in the dataset are in the known labels.
  
      Actually, unknown labels could be acceptable if we just treat the model as always wrong.
      However, this is a good sanity check to make sure the datasets match
      """
      new_labels = dataset_labels(dataset)
      not_found = [i for i in new_labels if i not in labels]
      if not_found:
          raise RuntimeError(
              "Dataset contains labels which the model does not know about:"
              + str(not_found)
          )
  
imports: import collections
  from collections import namedtuple
  import logging
  import json
  import random
  import re
  from typing import List
  from stanza.models.classifiers.utils import WVType
  from stanza.models.common.vocab import PAD, PAD_ID, UNK, UNK_ID
  import stanza.models.constituency.tree_reader
label_desc: Use image node_id 7 for calling a global function with example usage: check_labels(labels, dataset) without return types