code: def test_padding(self, max_length=6):
      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_r.pad_token = None # Hotfixing padding = None
              # Simple input
              s = "This is a simple input"
              s2 = [
                  "This is a simple input 1",
                  "This is a simple input 2",
              ]
              p = ("This is a simple input", "This is a pair")
              p2 = [
                  (
                      "This is a simple input 1",
                      "This is a simple input 2",
                  ),
                  (
                      "This is a simple pair 1",
                      "This is a simple pair 2",
                  ),
              ]
  
              # Simple input tests
              try:
                  tokenizer_r.encode(s, max_length=max_length)
                  tokenizer_r.encode_plus(s, max_length=max_length)
  
                  tokenizer_r.batch_encode_plus(
                      s2, max_length=max_length
                  )
                  tokenizer_r.encode(p, max_length=max_length)
                  tokenizer_r.batch_encode_plus(
                      p2, max_length=max_length
                  )
              except ValueError:
                  self.fail(
                      "Bloom Tokenizer should be able to deal with padding"
                  )
  
              tokenizer_r.pad_token = None  # Hotfixing padding = None
              self.assertRaises(
                  ValueError,
                  tokenizer_r.encode,
                  s,
                  max_length=max_length,
                  padding="max_length",
              )
  
              # Simple input
              self.assertRaises(
                  ValueError,
                  tokenizer_r.encode_plus,
                  s,
                  max_length=max_length,
                  padding="max_length",
              )
  
              # Simple input
              self.assertRaises(
                  ValueError,
                  tokenizer_r.batch_encode_plus,
                  s2,
                  max_length=max_length,
                  padding="max_length",
              )
  
              # Pair input
              self.assertRaises(
                  ValueError,
                  tokenizer_r.encode,
                  p,
                  max_length=max_length,
                  padding="max_length",
              )
  
              # Pair input
              self.assertRaises(
                  ValueError,
                  tokenizer_r.encode_plus,
                  p,
                  max_length=max_length,
                  padding="max_length",
              )
  
              # Pair input
              self.assertRaises(
                  ValueError,
                  tokenizer_r.batch_encode_plus,
                  p2,
                  max_length=max_length,
                  padding="max_length",
              )
  
file_path: transformers/tests/models/bloom/test_tokenization_bloom.py
imports: import unittest
  from datasets import load_dataset
  from transformers import BloomTokenizerFast
  from transformers.testing_utils import require_jinja, require_tokenizers
  from ...test_tokenization_common import TokenizerTesterMixin
label_desc: Use image node_id 5 for calling the BloomTokenizationTest obj's underlying member method code with example usage: obj.test_padding(max_length) without return types