code: def receive_data(self, data):
          
          if data:
              if self._receive_buffer_closed:
                  raise RuntimeError(
                      "received close, then received more data?")
              self._receive_buffer += data
          else:
              self._receive_buffer_closed = True
docs: Add data to our internal recieve buffer.
  
          This does not actually do any processing on the data, just stores
          it. To trigger processing, you have to call :meth:`next_event`.
  
          Args:
              data (:term:`bytes-like object`):
                  The new data that was just received.
  
                  Special case: If *data* is an empty byte-string like ``b""``,
                  then this indicates that the remote side has closed the
                  connection (end of file). Normally this is convenient, because
                  standard Python APIs like :meth:`file.read` or
                  :meth:`socket.recv` use ``b""`` to indicate end-of-file, while
                  other failures to read are indicated using other mechanisms
                  like raising :exc:`TimeoutError`. When using such an API you
                  can just blindly pass through whatever you get from ``read``
                  to :meth:`receive_data`, and everything will work.
  
                  But, if you have an API where reading an empty string is a
                  valid non-EOF condition, then you need to be aware of this and
                  make sure to check for such strings and avoid passing them to
                  :meth:`receive_data`.
  
          Returns:
              Nothing, but after calling this you should call :meth:`next_event`
              to parse the newly received data.
  
          Raises:
              RuntimeError:
                  Raised if you pass an empty *data*, indicating EOF, and then
                  pass a non-empty *data*, indicating more data that somehow
                  arrived after the EOF.
  
                  (Calling ``receive_data(b"")`` multiple times is fine,
                  and equivalent to calling it once.)