code: def check_sizes(size, width, height):
      
  
      if not size:
          return width, height
  
      if len(size) != 2:
          raise ProtocolError(
              "size argument should be a pair (width, height)")
      if width is not None and width != size[0]:
          raise ProtocolError(
              "size[0] (%r) and width (%r) should match when both are used."
              % (size[0], width))
      if height is not None and height != size[1]:
          raise ProtocolError(
              "size[1] (%r) and height (%r) should match when both are used."
              % (size[1], height))
      return size
docs: Check that these arguments, if supplied, are consistent.
      Return a (width, height) pair.