code: def test_right_and_left_padding(self):
      tokenizer = self.tokenizer
      notes = self.get_input_notes()
      notes = notes[0]
      max_length = 20
  
      padding_idx = tokenizer.pad_token_id
  
      # RIGHT PADDING - Check that it correctly pads when a maximum length is specified along with the padding flag set to True
      tokenizer.padding_side = "right"
      padded_notes = tokenizer(
          notes, padding="max_length", max_length=max_length
      )["token_ids"]
      padded_notes_length = len(padded_notes)
      notes_without_padding = tokenizer(notes, padding="do_not_pad")[
          "token_ids"
      ]
      padding_size = max_length - len(notes_without_padding)
  
      self.assertEqual(padded_notes_length, max_length)
      self.assertEqual(
          notes_without_padding + [padding_idx] * padding_size,
          padded_notes,
      )
  
      # LEFT PADDING - Check that it correctly pads when a maximum length is specified along with the padding flag set to True
      tokenizer.padding_side = "left"
      padded_notes = tokenizer(
          notes, padding="max_length", max_length=max_length
      )["token_ids"]
      padded_notes_length = len(padded_notes)
      notes_without_padding = tokenizer(notes, padding="do_not_pad")[
          "token_ids"
      ]
      padding_size = max_length - len(notes_without_padding)
  
      self.assertEqual(padded_notes_length, max_length)
      self.assertEqual(
          [padding_idx] * padding_size + notes_without_padding,
          padded_notes,
      )
  
      # RIGHT & LEFT PADDING - Check that nothing is done for 'longest' and 'no_padding'
      notes_without_padding = tokenizer(notes)["token_ids"]
  
      tokenizer.padding_side = "right"
      padded_notes_right = tokenizer(notes, padding=False)["token_ids"]
      self.assertEqual(
          len(padded_notes_right), len(notes_without_padding)
      )
      self.assertEqual(padded_notes_right, notes_without_padding)
  
      tokenizer.padding_side = "left"
      padded_notes_left = tokenizer(notes, padding="longest")[
          "token_ids"
      ]
      self.assertEqual(
          len(padded_notes_left), len(notes_without_padding)
      )
      self.assertEqual(padded_notes_left, notes_without_padding)
  
      tokenizer.padding_side = "right"
      padded_notes_right = tokenizer(notes, padding="longest")[
          "token_ids"
      ]
      self.assertEqual(
          len(padded_notes_right), len(notes_without_padding)
      )
      self.assertEqual(padded_notes_right, notes_without_padding)
  
      tokenizer.padding_side = "left"
      padded_notes_left = tokenizer(notes, padding=False)["token_ids"]
      self.assertEqual(
          len(padded_notes_left), len(notes_without_padding)
      )
      self.assertEqual(padded_notes_left, notes_without_padding)
  
imports: import os
  import pickle
  import shutil
  import tempfile
  import unittest
  from transformers.feature_extraction_utils import BatchFeature
  from transformers.testing_utils import is_pretty_midi_available, is_torch_available, require_pretty_midi, require_torch
  from transformers.tokenization_utils import BatchEncoding
label_desc: Use image node_id 11 for calling the Pop2PianoTokenizerTest obj's underlying member method code with example usage: obj.test_right_and_left_padding() without return types