code: def test_torch_encode_plus_sent_to_model(self):
      import torch
  
      from transformers import MODEL_MAPPING, TOKENIZER_MAPPING
  
      MODEL_TOKENIZER_MAPPING = merge_model_tokenizer_mappings(
          MODEL_MAPPING, TOKENIZER_MAPPING
      )
  
      tokenizers = self.get_tokenizers(do_lower_case=False)
      for tokenizer in tokenizers:
          with self.subTest(f"{tokenizer.__class__.__name__}"):
              if tokenizer.__class__ not in MODEL_TOKENIZER_MAPPING:
                  return
  
              config_class, model_class = MODEL_TOKENIZER_MAPPING[
                  tokenizer.__class__
              ]
              config = config_class()
  
              if (
                  config.is_encoder_decoder
                  or config.pad_token_id is None
              ):
                  return
  
              model = model_class(config)
  
              # Make sure the model contains at least the full vocabulary size in its embedding matrix
              is_using_common_embeddings = hasattr(
                  model.get_input_embeddings(), "weight"
              )
              assert (
                  (
                      model.get_input_embeddings().weight.shape[0]
                      >= len(tokenizer)
                  )
                  if is_using_common_embeddings
                  else True
              )
  
              # Build sequence
              nodes, xpaths = self.get_nodes_and_xpaths()
              encoded_sequence = tokenizer.encode_plus(
                  nodes, xpaths=xpaths, return_tensors="pt"
              )
              batch_encoded_sequence = tokenizer.batch_encode_plus(
                  [nodes, nodes], [xpaths, xpaths], return_tensors="pt"
              )
              # This should not fail
  
              with torch.no_grad():  # saves some time
                  model(**encoded_sequence)
                  model(**batch_encoded_sequence)
  
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 30 for calling the MarkupLMTokenizationTest obj's underlying member method code with example usage: obj.test_torch_encode_plus_sent_to_model() without return types