docstr: Check that an exception is thrown for an unknown label
docstr_tok: ["Check","that","an","exception","is","thrown","for","an","unknown","label"]
code: def test_check_labels(self, train_file):
      """
      Check that an exception is thrown for an unknown label
      """
      train_set = data.read_dataset(str(train_file), WVType.OTHER, 1)
      labels = sorted(set([x["sentiment"] for x in DATASET]))
      assert len(labels) > 1
      data.check_labels(labels, train_set)
      with pytest.raises(RuntimeError):
          data.check_labels(labels[:1], train_set)
  
file_path: stanza/stanza/tests/classifiers/test_data.py
imports: import json
  import pytest
  import stanza.models.classifiers.data
  from stanza.models.classifiers.utils import WVType
  from stanza.models.common.vocab import PAD, UNK
  from stanza.models.constituency.parse_tree import Tree
label_desc: Use image node_id 6 for calling the TestClassifierData obj's underlying member method code with example usage: obj.test_check_labels(train_file) without return types