parameters: (image_size: Union[Text, int, Tuple[int, int]])
docstring: Parse the image size and return (height, width).
  
      Args:
        image_size: A integer, a tuple (H, W), or a string with HxW format.
  
      Returns:
        A tuple of integer (height, width).
docstring_summary: Parse the image size and return (height, width).
docstring_tokens: Parse the image size and return ( height width ) .
function: def parse_image_size(image_size: Union[Text, int, Tuple[int, int]]):
      """Parse the image size and return (height, width).
  
      Args:
        image_size: A integer, a tuple (H, W), or a string with HxW format.
  
      Returns:
        A tuple of integer (height, width).
      """
      if isinstance(image_size, int):
          # image_size is integer, with the same width and height.
          return (image_size, image_size)
  
      if isinstance(image_size, str):
          # image_size is a string with format WxH
          width, height = image_size.lower().split("x")
          return (int(height), int(width))
  
      if isinstance(image_size, tuple):
          return image_size
  
      raise ValueError(
          "image_size must be an int, WxH string, or (height, width)"
          "tuple. Was %r" % image_size
      )
function_tokens: def parse_image_size ( image_size : Union [ Text , int , Tuple [ int , int ] ] ) : if isinstance ( image_size , int ) : # image_size is integer, with the same width and height. return ( image_size , image_size ) if isinstance ( image_size , str ) : # image_size is a string with format WxH width , height = image_size . lower ( ) . split ( "x" ) return ( int ( height ) , int ( width ) ) if isinstance ( image_size , tuple ) : return image_size raise ValueError ( "image_size must be an int, WxH string, or (height, width)" "tuple. Was %r" % image_size )