code: def is_alive(self):
          
          if hasattr(self.device, 'remote_conn'):
              return self.device.remote_conn.transport.is_active() and self._xml_agent_alive
          return False
docs: Returns the XML agent connection state (and SSH connection state).