def _bool_tag(self, bool_name: str, priority_name: str) -> bool:
        """Common logic for obtaining the value of a boolean tag from ``tags`` if defined.

        If boolean tag is not defined, this methods returns ``True`` if priority tag is non-positive,
        ``False`` otherwise.

        :param bool_name: name of the boolean tag (``nofailover``. ``nosync``).
        :param priority_name: name of the priority tag (``failover_priority``, ``sync_priority``).

        :returns: boolean value based on the defined tags.
        """
        from_tags = self.tags.get(bool_name)
        if from_tags is not None:
            # Value of bool tag takes precedence over priority tag
            return bool(from_tags)
        priority = parse_int(self.tags.get(priority_name))
        return priority is not None and priority <= 0
Common logic for obtaining the value of a boolean tag from ``tags`` if defined.

        If boolean tag is not defined, this methods returns ``True`` if priority tag is non-positive,
        ``False`` otherwise.

        :param bool_name: name of the boolean tag (``nofailover``. ``nosync``).
        :param priority_name: name of the priority tag (``failover_priority``, ``sync_priority``).

        :returns: boolean value based on the defined tags.
        
patroni/tags.py