code: def test_skeleton_to_pdag(self):
      skel = nx.Graph([("A", "D"), ("A", "C"), ("B", "C")])
      sep_sets = {
          frozenset({"D", "C"}): ("A",),
          frozenset({"A", "B"}): tuple(),
          frozenset({"D", "B"}): ("A",),
      }
      pdag = PC.skeleton_to_pdag(
          skeleton=skel, separating_sets=sep_sets
      )
      self.assertSetEqual(
          set(pdag.edges()),
          set([("B", "C"), ("A", "D"), ("A", "C"), ("D", "A")]),
      )
  
      skel = nx.Graph([("A", "B"), ("A", "C")])
      sep_sets = {frozenset({"B", "C"}): ()}
      self.assertSetEqual(
          set(
              PC.skeleton_to_pdag(
                  skeleton=skel, separating_sets=sep_sets
              ).edges()
          ),
          set([("B", "A"), ("C", "A")]),
      )
  
      sep_sets = {frozenset({"B", "C"}): ("A",)}
      pdag = PC.skeleton_to_pdag(
          skeleton=skel, separating_sets=sep_sets
      )
      self.assertSetEqual(
          set(PC.skeleton_to_pdag(skel, sep_sets).edges()),
          set([("A", "B"), ("B", "A"), ("A", "C"), ("C", "A")]),
      )
  
      skel = nx.Graph([("A", "C"), ("B", "C"), ("C", "D")])
      sep_sets = {
          frozenset({"A", "B"}): tuple(),
          frozenset({"A", "D"}): ("C",),
          frozenset({"B", "D"}): ("C",),
      }
      pdag = PC.skeleton_to_pdag(
          skeleton=skel, separating_sets=sep_sets
      )
      self.assertSetEqual(
          set(pdag.edges()), set([("A", "C"), ("B", "C"), ("C", "D")])
      )
  
      skel = nx.Graph([("A", "B"), ("A", "C"), ("B", "C"), ("B", "D")])
      sep_sets = {
          frozenset({"A", "D"}): tuple(),
          frozenset({"C", "D"}): ("A", "B"),
      }
      pdag = PC.skeleton_to_pdag(
          skeleton=skel, separating_sets=sep_sets
      )
      self.assertSetEqual(
          set(pdag.edges()),
          set([("A", "B"), ("B", "C"), ("A", "C"), ("D", "B")]),
      )
  
      skel = nx.Graph(
          [("A", "B"), ("B", "C"), ("A", "D"), ("B", "D"), ("C", "D")]
      )
      sep_sets = {frozenset({"A", "C"}): ("B",)}
      pdag = PC.skeleton_to_pdag(
          skeleton=skel, separating_sets=sep_sets
      )
      self.assertSetEqual(
          set(pdag.edges()),
          set(
              [
                  ("A", "B"),
                  ("B", "A"),
                  ("B", "C"),
                  ("C", "B"),
                  ("A", "D"),
                  ("B", "D"),
                  ("C", "D"),
              ]
          ),
      )
  
imports: import unittest
  import networkx
  import numpy
  import pandas
  from joblib.externals.loky import get_reusable_executor
  from pgmpy.estimators import PC
  from pgmpy.independencies import Independencies
  from pgmpy.models import BayesianNetwork
  from pgmpy.sampling import BayesianModelSampling
  from pgmpy.utils import get_example_model
label_desc: Use image node_id 2 for calling the TestPCEstimatorFromIndependencies obj's underlying member method code with example usage: obj.test_skeleton_to_pdag() without return types