code: def test_processor_case_2(self):
      # case 2: web page classification (training, inference) + token classification (inference), parse_html=False
  
      feature_extractor = MarkupLMFeatureExtractor()
      tokenizers = self.get_tokenizers
  
      for tokenizer in tokenizers:
          processor = MarkupLMProcessor(
              feature_extractor=feature_extractor, tokenizer=tokenizer
          )
          processor.parse_html = False
  
          # not batched
          nodes = ["hello", "world", "how", "are"]
          xpaths = [
              "/html/body/div/li[1]/div/span",
              "/html/body/div/li[1]/div/span",
              "html/body",
              "html/body/div",
          ]
          inputs = processor(
              nodes=nodes, xpaths=xpaths, return_tensors="pt"
          )
  
          # verify keys
          expected_keys = [
              "attention_mask",
              "input_ids",
              "token_type_ids",
              "xpath_subs_seq",
              "xpath_tags_seq",
          ]
          actual_keys = list(inputs.keys())
          for key in expected_keys:
              self.assertIn(key, actual_keys)
  
          # verify input_ids
          expected_decoding = "<s>helloworldhoware</s>"
          decoding = processor.decode(
              inputs.input_ids.squeeze().tolist()
          )
          self.assertSequenceEqual(decoding, expected_decoding)
  
          # batched
          nodes = [["hello", "world"], ["my", "name", "is"]]
          xpaths = [
              [
                  "/html/body/div/li[1]/div/span",
                  "/html/body/div/li[1]/div/span",
              ],
              ["html/body", "html/body/div", "html/body"],
          ]
          inputs = processor(
              nodes=nodes,
              xpaths=xpaths,
              padding=True,
              return_tensors="pt",
          )
  
          # verify keys
          expected_keys = [
              "attention_mask",
              "input_ids",
              "token_type_ids",
              "xpath_subs_seq",
              "xpath_tags_seq",
          ]
          actual_keys = sorted(inputs.keys())
          self.assertListEqual(actual_keys, expected_keys)
  
          # verify input_ids
          expected_decoding = "<s>helloworld</s><pad>"
          decoding = processor.decode(inputs.input_ids[0].tolist())
          self.assertSequenceEqual(decoding, expected_decoding)
  
imports: import json
  import os
  import shutil
  import tempfile
  import unittest
  from typing import List
  from transformers import MarkupLMProcessor, MarkupLMTokenizer, PreTrainedTokenizer, PreTrainedTokenizerBase, PreTrainedTokenizerFast
  from transformers.models.markuplm.tokenization_markuplm import VOCAB_FILES_NAMES
  from transformers.testing_utils import require_bs4, require_tokenizers, require_torch, slow
  from transformers.utils import FEATURE_EXTRACTOR_NAME, cached_property, is_bs4_available, is_tokenizers_available
label_desc: Use image node_id 4 for calling the MarkupLMProcessorIntegrationTests obj's underlying member method code with example usage: obj.test_processor_case_2() without return types