def from_nodes()

in runtool/runtool/datatypes.py [0:0]


    def from_nodes(cls, node_1: dict, node_2: dict) -> "Experiment":
        """
        Given two dictionaries tries to generate an Experiment object.
        If not exactly one node is a valid Dataset and one exactly node
        is a valid Algorithm this raises a TypeError.
        """
        try:
            return cls({"algorithm": node_1, "dataset": node_2})
        except TypeError:
            pass

        try:
            return cls({"algorithm": node_2, "dataset": node_1})
        except TypeError:
            raise TypeError(
                "An Experiment requires one Dataset and one Algorithm, got: "
                f"{node_1} and {node_2}"
            )