parameters: (img)
docstring: Vertically flips the given np.array.
  
      Args:
          img (np.array): Image to be flipped.
  
      Returns:
          np.array:  Vertically flipped image.
docstring_summary: Vertically flips the given np.array.
docstring_tokens: Vertically flips the given np . array .
function: def vflip(img):
      """Vertically flips the given np.array.
  
      Args:
          img (np.array): Image to be flipped.
  
      Returns:
          np.array:  Vertically flipped image.
  
      """
      cv2 = try_import('cv2')
  
      if len(img.shape) == 3 and img.shape[2] == 1:
          return cv2.flip(img, 0)[:, :, np.newaxis]
      else:
          return cv2.flip(img, 0)
function_tokens: def vflip ( img ) : cv2 = try_import ( 'cv2' ) if len ( img . shape ) == 3 and img . shape [ 2 ] == 1 : return cv2 . flip ( img , 0 ) [ : , : , np . newaxis ] else : return cv2 . flip ( img , 0 )