code: def ping(self):
          
  
          if self.session.transitions.is_connected():
              yield from self._handler.mqtt_ping()
          else:
              self.logger.warning("MQTT PING request incompatible with current session state '%s'" %
                                  self.session.transitions.state)
docs: Ping the broker.
  
              Send a MQTT `PINGREQ <http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718081>`_ message for response.
  
              This method is a *coroutine*.