def run(self):
        """ Runs the event loop

        This method starts the main asyncio event loop and stays in the loop until a SIGINT or
        SIGTERM is received (see `_sigint_handler`)
        """
        try:
            self.logger.debug("Starting event loop and calling `get_ready`")

            if self.is_safe():
                self.logger.debug("System safe, calling get_ready")
                self._loop.call_soon(self.get_ready)
            else:
                self.logger.warning("Not safe, calling wait_until_safe")
                self._loop.call_soon(self.wait_until_safe)

            self._loop.run_forever()
        except __HOLE__:
            self.logger.warning("Interrupted")
            self.power_down()
        finally:
            self.logger.debug("Event loop stopped")
            if self._loop.is_running():
                self.logger.debug("Stopping event loop")
                self._loop.stop()

            if not self._loop.is_closed():
                self.logger.debug("Closing event loop")
                self._loop.close()
dataset/ETHPy150Open panoptes/POCS/panoptes/state/event.py/PanEventManager.run