def power_down(self):
        """ Actions to be performed upon shutdown

        Note:
            This method is automatically called from the interrupt handler. The definition should
            include what you want to happen upon shutdown but you don't need to worry about calling
            it manually.
        """
        if self._connected:
            self.logger.info("Shutting down {}, please be patient and allow for exit.".format(self.name))

            if ['parking', 'parked', 'sleeping', 'housekeeping'] not in self.state:
                if self.observatory.mount.is_connected:
                    if not self.observatory.mount.is_parked:
                        self.logger.info("Parking mount")
                        self.park()

            if self.state == 'parking':
                if self.observatory.mount.is_connected:
                    if not self.observatory.mount.is_parked:
                        self.logger.info("Parking mount")
                        self.set_park()

            # Stop the monitors
            self.observatory.power_down()

            self.logger.info("Bye!")
            print("Thanks! Bye!")

            # Remove shutdown file
            if os.path.exists(self._shutdown_file):
                os.unlink(self._shutdown_file)

            self._connected = False
dataset/ETHPy150Open panoptes/POCS/panoptes/core.py/Panoptes.power_down/swapped operands of `not in`