code: def test_token_type_ids(self):
      tokenizers = self.get_tokenizers()
      for tokenizer in tokenizers:
          with self.subTest(f"{tokenizer.__class__.__name__}"):
              # test 1: single sequence
              words, boxes = self.get_words_and_boxes()
  
              output = tokenizer(
                  words, boxes=boxes, return_token_type_ids=True
              )
  
              # Assert that the token type IDs have the same length as the input IDs
              self.assertEqual(
                  len(output["token_type_ids"]),
                  len(output["input_ids"]),
              )
  
              # Assert that the token type IDs have the same length as the attention mask
              self.assertEqual(
                  len(output["token_type_ids"]),
                  len(output["attention_mask"]),
              )
  
              self.assertIn(0, output["token_type_ids"])
              self.assertNotIn(1, output["token_type_ids"])
  
              # test 2: two sequences (question + words)
              (
                  question,
                  words,
                  boxes,
              ) = self.get_question_words_and_boxes()
  
              output = tokenizer(
                  question, words, boxes, return_token_type_ids=True
              )
  
              # Assert that the token type IDs have the same length as the input IDs
              self.assertEqual(
                  len(output["token_type_ids"]),
                  len(output["input_ids"]),
              )
  
              # Assert that the token type IDs have the same length as the attention mask
              self.assertEqual(
                  len(output["token_type_ids"]),
                  len(output["attention_mask"]),
              )
  
              self.assertIn(0, output["token_type_ids"])
              self.assertNotIn(1, output["token_type_ids"])
  
imports: import inspect
  import shutil
  import tempfile
  import unittest
  from typing import List
  from transformers import AddedToken, LayoutXLMTokenizerFast, SpecialTokensMixin, is_tf_available, is_torch_available, logging
  from transformers.models.layoutxlm.tokenization_layoutxlm import LayoutXLMTokenizer
  from transformers.testing_utils import get_tests_dir, is_pt_tf_cross_test, require_pandas, require_scatter, require_sentencepiece, require_tokenizers, require_torch, slow
  from ...test_tokenization_common import SMALL_TRAINING_CORPUS, TokenizerTesterMixin, filter_non_english, merge_model_tokenizer_mappings
label_desc: Use image node_id 32 for calling the LayoutXLMTokenizationTest obj's underlying member method code with example usage: obj.test_token_type_ids() without return types