parameters: (input, size, value)
return_statement: return cv2.copyMakeBorder(input, *size, cv2.BORDER_CONSTANT, value=value)
docstring: r"""Pad input data with *value* and given *size*.
  
      Args:
          input: input data, with `(H, W, C)` shape.
          size: padding size of input data, it could be integer or sequence.
              If it is an integer, the input data will be padded in four directions.
              If it is a sequence contains two integer, the bottom and right side
              of input data will be padded.
              If it is a sequence contains four integer, the top, bottom, left, right
              side of input data will be padded with given size.
          value: padding value of data, could be a sequence of int or float.
              If it is float value, the dtype of image will be casted to float32 also.
  
      Returns:
          padded image.
docstring_summary: r"""Pad input data with *value* and given *size*.
docstring_tokens: r Pad input data with * value * and given * size * .
function: def pad(input, size, value):
      r"""Pad input data with *value* and given *size*.
  
      Args:
          input: input data, with `(H, W, C)` shape.
          size: padding size of input data, it could be integer or sequence.
              If it is an integer, the input data will be padded in four directions.
              If it is a sequence contains two integer, the bottom and right side
              of input data will be padded.
              If it is a sequence contains four integer, the top, bottom, left, right
              side of input data will be padded with given size.
          value: padding value of data, could be a sequence of int or float.
              If it is float value, the dtype of image will be casted to float32 also.
  
      Returns:
          padded image.
      """
      if isinstance(size, int):
          size = (size, size, size, size)
      elif isinstance(size, collections.abc.Sequence) and len(size) == 2:
          size = (0, size[0], 0, size[1])
      if np.array(value).dtype == float:
          input = input.astype(np.float32)
      return cv2.copyMakeBorder(input, *size, cv2.BORDER_CONSTANT, value=value)
function_tokens: def pad ( input , size , value ) : if isinstance ( size , int ) : size = ( size , size , size , size ) elif isinstance ( size , collections . abc . Sequence ) and len ( size ) == 2 : size = ( 0 , size [ 0 ] , 0 , size [ 1 ] ) if np . array ( value ) . dtype == float : input = input . astype ( np . float32 ) return cv2 . copyMakeBorder ( input , * size , cv2 . BORDER_CONSTANT , value = value )