Construct the DAG pattern (representing the I-equivalence class) for
        a given DAG. This is the "inverse" to pdag_to_dag.

def model_to_pdag(model):
        """Construct the DAG pattern (representing the I-equivalence class) for
        a given DAG. This is the "inverse" to pdag_to_dag.
        """

        if not isinstance(model, DAG):
            raise TypeError("model: Expected DAG instance, " +
                            "got type {model_type}".format(model_type=type(model)))

        skel, separating_sets = ConstraintBasedEstimator.build_skeleton(
                                    model.nodes(),
                                    model.get_independencies())
        pdag = ConstraintBasedEstimator.skeleton_to_pdag(skel, separating_sets)

        return pdag