<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def __check_last_ping(self, run_listen):
 """ Check if the last timeout is too old. If it is, kills the run_listen task """

        if self.__last_ping < time.time()-10:
            self._logger.warning("Last ping too old. Restarting the agent.")
            run_listen.cancel()
            self.__cancel_remaining_safe_tasks()
        else:
            self._loop.call_later(1, self._create_safe_task, self.__check_last_ping(run_listen))