code: def test_only_label_first_subword(self):
      nodes = ["hello", "niels"]
      xpaths = [
          "/html/body/div/li[1]/div/span" for _ in range(len(nodes))
      ]
      node_labels = [0, 1]
  
      # test slow tokenizer
      tokenizer_p = MarkupLMTokenizer.from_pretrained(
          "microsoft/markuplm-base"
      )
      encoding = tokenizer_p(
          nodes, xpaths=xpaths, node_labels=node_labels
      )
      self.assertListEqual(encoding.labels, [-100, 0, 1, -100, -100])
  
      tokenizer_p = MarkupLMTokenizer.from_pretrained(
          "microsoft/markuplm-base", only_label_first_subword=False
      )
      encoding = tokenizer_p(
          nodes, xpaths=xpaths, node_labels=node_labels
      )
      self.assertListEqual(encoding.labels, [-100, 0, 1, 1, -100])
  
      # test fast tokenizer
      tokenizer_r = MarkupLMTokenizerFast.from_pretrained(
          "microsoft/markuplm-base"
      )
      encoding = tokenizer_r(
          nodes, xpaths=xpaths, node_labels=node_labels
      )
      self.assertListEqual(encoding.labels, [-100, 0, 1, -100, -100])
  
      tokenizer_r = MarkupLMTokenizerFast.from_pretrained(
          "microsoft/markuplm-base", only_label_first_subword=False
      )
      encoding = tokenizer_r(
          nodes, xpaths=xpaths, node_labels=node_labels
      )
      self.assertListEqual(encoding.labels, [-100, 0, 1, 1, -100])
  
imports: import inspect
  import json
  import os
  import re
  import shutil
  import tempfile
  import unittest
  from typing import List
  from transformers import AddedToken, MarkupLMTokenizerFast, SpecialTokensMixin, is_tf_available, is_torch_available, logging
  from transformers.models.markuplm.tokenization_markuplm import VOCAB_FILES_NAMES, MarkupLMTokenizer
  from transformers.testing_utils import is_pt_tf_cross_test, require_tokenizers, require_torch, slow
  from ...test_tokenization_common import SMALL_TRAINING_CORPUS, TokenizerTesterMixin, merge_model_tokenizer_mappings
label_desc: Use image node_id 51 for calling the MarkupLMTokenizationTest obj's underlying member method code with example usage: obj.test_only_label_first_subword() without return types