def satisfied_by_node()

in src/hpc/autoscale/node/constraints.py [0:0]


    def satisfied_by_node(self, node: "Node") -> SatisfiedResult:
        reasons: List[str] = []
        xor_result: Optional[SatisfiedResult] = None

        for n, c in enumerate(self.constraints):
            expr_result = c.satisfied_by_node(node)

            if expr_result:
                # true ^ true == false

                if xor_result:
                    msg = "Multiple expressions evaluated as true. See below:\n\t{}\n\t{}".format(
                        xor_result.message, expr_result.message
                    )
                    return SatisfiedResult(
                        "XORFailed",
                        self,
                        node,
                        [msg] + reasons,
                    )
                # assign the first true expression as the final result
                xor_result = expr_result
            elif hasattr(expr_result, "reasons"):
                # if this does end up failing for all expressions, keep
                # track of the set of reasons
                reasons.extend(expr_result.reasons)

        if xor_result:
            return xor_result

        return SatisfiedResult("CompoundFailure", self, node, reasons)