code: def close(self):
          
          if not self._closed:
              closed = False
              event = self.event('connection_lost')
              if self.transport:
                  if self._loop.get_debug():
                      self.logger.debug('Closing connection %s', self)
                  if self.transport.can_write_eof():
                      try:
                          self.transport.write_eof()
                      except Exception:
                          pass
                  try:
                      worker = self.close_pipeline()
                      self.transport.close()
                      closed = self._loop.create_task(
                          self._close(event.waiter(), worker)
                      )
                  except Exception:
                      pass
              self._closed = closed or True
              if not closed:
                  event.fire()
          return self._closed
docs: Close by closing the :attr:`transport`
  
          Return the ``connection_lost`` event which can be used to wait
          for complete transport closure.