code: def test_tokenization_python_rust_equals(self):
      if not self.test_slow_tokenizer:
          # as we don't have a slow version, we can't compare the outputs between slow and fast versions
          return
  
      for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
          with self.subTest(
              f"{tokenizer.__class__.__name__} ({pretrained_name})"
          ):
              tokenizer_r = self.rust_tokenizer_class.from_pretrained(
                  pretrained_name, **kwargs
              )
              tokenizer_p = self.tokenizer_class.from_pretrained(
                  pretrained_name, **kwargs
              )
  
              words, boxes = self.get_words_and_boxes()
  
              # Ensure basic input match
              input_p = tokenizer_p.encode_plus(words, boxes=boxes)
              input_r = tokenizer_r.encode_plus(words, boxes=boxes)
  
              for key in filter(
                  lambda x: x
                  in [
                      "input_ids",
                      "token_type_ids",
                      "attention_mask",
                      "bbox",
                  ],
                  input_p.keys(),
              ):
                  self.assertSequenceEqual(input_p[key], input_r[key])
  
              input_pairs_p = tokenizer_p.encode_plus(
                  words, boxes=boxes
              )
              input_pairs_r = tokenizer_r.encode_plus(
                  words, boxes=boxes
              )
  
              for key in filter(
                  lambda x: x
                  in [
                      "input_ids",
                      "token_type_ids",
                      "attention_mask",
                      "bbox",
                  ],
                  input_p.keys(),
              ):
                  self.assertSequenceEqual(
                      input_pairs_p[key], input_pairs_r[key]
                  )
  
              words = ["hello" for _ in range(1000)]
              boxes = [[1000, 1000, 1000, 1000] for _ in range(1000)]
  
              # Ensure truncation match
              input_p = tokenizer_p.encode_plus(
                  words, boxes=boxes, max_length=512, truncation=True
              )
              input_r = tokenizer_r.encode_plus(
                  words, boxes=boxes, max_length=512, truncation=True
              )
  
              for key in filter(
                  lambda x: x
                  in [
                      "input_ids",
                      "token_type_ids",
                      "attention_mask",
                      "bbox",
                  ],
                  input_p.keys(),
              ):
                  self.assertSequenceEqual(input_p[key], input_r[key])
  
              # Ensure truncation with stride match
              input_p = tokenizer_p.encode_plus(
                  words,
                  boxes=boxes,
                  max_length=512,
                  truncation=True,
                  stride=3,
                  return_overflowing_tokens=True,
              )
              input_r = tokenizer_r.encode_plus(
                  words,
                  boxes=boxes,
                  max_length=512,
                  truncation=True,
                  stride=3,
                  return_overflowing_tokens=True,
              )
  
              for key in filter(
                  lambda x: x
                  in [
                      "input_ids",
                      "token_type_ids",
                      "attention_mask",
                      "bbox",
                  ],
                  input_p.keys(),
              ):
                  self.assertSequenceEqual(
                      input_p[key], input_r[key][0]
                  )
  
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 36 for calling the LayoutXLMTokenizationTest obj's underlying member method code with example usage: obj.test_tokenization_python_rust_equals() without return types