code: def serialize_close(code: int, reason: str) -> bytes:
      
      check_close(code)
      return struct.pack("!H", code) + reason.encode("utf-8")
docs: Serialize the data for a close frame.
  
      This is the reverse of :func:`parse_close`.