code: def test_encoding_type(self):
      # 检查传入的tag_vocab与encoding_type不符合时，是否会报错
      vocabs = {}
      import random
      from itertools import product
  
      for encoding_type in ["bio", "bioes", "bmeso"]:
          vocab = Vocabulary(unknown=None, padding=None)
          for i in range(random.randint(10, 100)):
              label = str(random.randint(1, 10))
              for tag in encoding_type:
                  if tag != "o":
                      vocab.add_word(f"{tag}-{label}")
                  else:
                      vocab.add_word("o")
          vocabs[encoding_type] = vocab
      for e1, e2 in product(
          ["bio", "bioes", "bmeso"], ["bio", "bioes", "bmeso"]
      ):
          if e1 == e2:
              metric = SpanFPreRecMetric(
                  tag_vocab=vocabs[e1], encoding_type=e2
              )
          else:
              s2 = set(e2)
              s2.update(set(e1))
              if s2 == set(e2):
                  continue
              with pytest.raises(AssertionError):
                  metric = SpanFPreRecMetric(
                      tag_vocab=vocabs[e1], encoding_type=e2
                  )
      for encoding_type in ["bio", "bioes", "bmeso"]:
          with pytest.raises(AssertionError):
              metric = SpanFPreRecMetric(
                  tag_vocab=vocabs[encoding_type], encoding_type="bmes"
              )
  
      vocab = Vocabulary(unknown=None, padding=None).add_word_lst(
          list("bmes")
      )
      metric = SpanFPreRecMetric(tag_vocab=vocab, encoding_type="bmeso")
      vocab = Vocabulary().add_word_lst(list("bmes"))
      metric = SpanFPreRecMetric(tag_vocab=vocab, encoding_type="bmeso")
  
imports: import pytest
  from collections import Counter
  import os, sys
  import copy
  from functools import partial
  import numpy
  import socket
  from fastNLP.core.vocabulary import Vocabulary
  from fastNLP.core.metrics import SpanFPreRecMetric
  from fastNLP.core.dataset import DataSet
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH
  from .utils import find_free_network_port, setup_ddp
label_desc: Use image node_id 6 for calling the TestSpanFPreRecMetric obj's underlying member method code with example usage: obj.test_encoding_type() without return types