def _get_reset_code(self, reset_name):
        """ Given the name of a reset action, return its code. """
        for reset in self.reset_types:
            if reset_name == self.reset_types[reset]:
                return reset
        logging.warning("Unknown reset type: {}".format(reset_name))
        return 0