class_docstr: Add bottom-right padding to a raw image or annotation image.
  Args:
      target_size (list|tuple): The target size after padding.
      im_padding_value (list, optional): The padding value of raw image.
          Default: [127.5, 127.5, 127.5].
      label_padding_value (int, optional): The padding value of annotation image. Default: 255.
  Raises:
      TypeError: When target_size is neither list nor tuple.
      ValueError: When the length of target_size is not 2.
docstr: Args:
      im (np.ndarray): The Image data.
      label (np.ndarray, optional): The label data. Default: None.
  Returns:
      (tuple). When label is None, it returns (im, ), otherwise it returns (im, label).
docstr_tok: ["Args",":","im","(","np.ndarray",")",":","The","Image","data",".","label","(","np.ndarray",",","optional",")",":","The","label","data",".","Default",":","None",".","Returns",":","(","tuple",")",".","When","label","is","None",",","it","returns","(","im",",",")",",","otherwise","it","returns","(","im",",","label",")","."]
code: def __call__(self, im: np.ndarray, label: np.ndarray = None) -> Tuple:
      """
      Args:
          im (np.ndarray): The Image data.
          label (np.ndarray, optional): The label data. Default: None.
      Returns:
          (tuple). When label is None, it returns (im, ), otherwise it returns (im, label).
      """
  
      im_height, im_width = im.shape[0], im.shape[1]
      if isinstance(self.target_size, int):
          target_height = self.target_size
          target_width = self.target_size
      else:
          target_height = self.target_size[1]
          target_width = self.target_size[0]
      pad_height = target_height - im_height
      pad_width = target_width - im_width
      if pad_height < 0 or pad_width < 0:
          raise ValueError(
              "The size of image should be less than `target_size`, but the size of image ({}, {}) is larger than `target_size` ({}, {})".format(
                  im_width, im_height, target_width, target_height
              )
          )
      else:
          im = cv2.copyMakeBorder(
              im,
              0,
              pad_height,
              0,
              pad_width,
              cv2.BORDER_CONSTANT,
              value=self.im_padding_value,
          )
          if label is not None:
              label = cv2.copyMakeBorder(
                  label,
                  0,
                  pad_height,
                  0,
                  pad_width,
                  cv2.BORDER_CONSTANT,
                  value=self.label_padding_value,
              )
      if label is None:
          return (im,)
      else:
          return (im, label)
  
imports: import os
  import random
  from typing import Callable, Union, List, Tuple
  import cv2
  import numpy
  from PIL import Image
  import paddlehub.vision.functional
label_desc: Use image node_id 2 for calling the Padding obj's underlying member method code with example usage: obj.__call__(im, label) and returns: im, im,  label