class_docstr: Padding input image if crop size is greater than image size. Otherwise, crop the input image to given size.
  
  Args:
      crop_size(Union[List[int], Tuple[int], int]): Targeted image size.
      im_padding_value(list): Border value for 3 channels, default is [127.5, 127.5, 127.5].
class_docstr_tok: ["Padding","input","image","if","crop","size","is","greater","than","image","size",".","Otherwise",",","crop","the","input","image","to","given","size",".","Args",":","crop_size","(","Union","[","List","[","int","]",",","Tuple","[","int","]",",","int","]",")",":","Targeted","image","size",".","im_padding_value","(","list",")",":","Border","value","for","3","channels",",","default","is","[","127.5",",","127.5",",","127.5","]","."]
code: def __init__(self, crop_size, im_padding_value=[127.5, 127.5, 127.5]):
      if isinstance(crop_size, list) or isinstance(crop_size, tuple):
          if len(crop_size) != 2:
              raise ValueError(
                  "when crop_size is list or tuple, it should include 2 elements, but it is {}".format(
                      crop_size
                  )
              )
      elif not isinstance(crop_size, int):
          raise TypeError(
              "Type of crop_size is invalid. Must be Integer or List or tuple, now is {}".format(
                  type(crop_size)
              )
          )
      self.crop_size = crop_size
      self.im_padding_value = im_padding_value
  
imports: import random
  from typing import Callable, Union, List, Tuple
  import cv2
  import PIL
  import numpy
  import paddlehub.vision.functional
label_desc: Use image node_id 1 to create a new RandomPaddingCrop object  with example: obj = RandomPaddingCrop(crop_size, im_padding_value)