code: def ping_hub(self):
          '''
          Attempt to ping the ZeroMQ plugin hub to verify connection is alive.
  
          If ping is successful, record timestamp.
          If ping is unsuccessful, call `on_heartbeat_error` method.
          '''
          if self.plugin is not None:
              try:
                  self.plugin.execute(self.plugin.hub_name, 'ping', timeout_s=1,
                                      silent=True)
              except IOError:
                  self.on_heartbeat_error()
              else:
                  self.heartbeat_alive_timestamp = datetime.now()
                  logger.debug('Hub connection alive as of %s',
                               self.heartbeat_alive_timestamp)
                  return Truf ping_hub(self):
          '''
          Attempt to ping the ZeroMQ plugin hub to verify connection is alive.
  
          If ping is successful, record timestamp.
          If ping is unsuccessful, call `on_heartbeat_error` method.
          '''
          if self.plugin is not None:
              try:
                  self.plugin.execute(self.plugin.hub_name, 'ping', timeout_s=1,
                                      silent=True)
              except IOError:
                  self.on_heartbeat_error()
              else:
                  self.heartbeat_alive_timestamp = datetime.now()
                  logger.debug('Hub connection alive as of %s',
                               self.heartbeat_alive_timestamp)
                  return True
docs: Attempt to ping the ZeroMQ plugin hub to verify connection is alive.
  
          If ping is successful, record timestamp.
          If ping is unsuccessful, call `on_heartbeat_error` method.