code: def send(self, event):
          # type(Event) -> bytes
          
          data = b""
          if isinstance(event, Request):
              data += self._initiate_connection(event)
          elif isinstance(event, AcceptConnection):
              data += self._accept(event)
          elif isinstance(event, RejectConnection):
              data += self._reject(event)
          elif isinstance(event, RejectData):
              data += self._send_reject_data(event)
          else:
              raise LocalProtocolError(
                  "Event {} cannot be sent during the handshake".format(event)
              )
          return data
docs: Send an event to the remote.
  
          This will return the bytes to send based on the event or raise
          a LocalProtocolError if the event is not valid given the
          state.