code: def test_build_skeleton_from_ind(self):
      # Specify a set of independencies
      for variant in ["orig", "stable", "parallel"]:
          ind = Independencies(["B", "C"], ["A", ["B", "C"], "D"])
          ind = ind.closure()
          estimator = PC(independencies=ind)
          skel, sep_sets = estimator.estimate(
              variant=variant,
              ci_test="independence_match",
              return_type="skeleton",
              n_jobs=2,
              show_progress=False,
          )
  
          expected_edges = {("A", "D"), ("B", "D"), ("C", "D")}
          expected_sepsets = {
              frozenset(("A", "C")): tuple(),
              frozenset(("A", "B")): tuple(),
              frozenset(("C", "B")): tuple(),
          }
          for u, v in skel.edges():
              self.assertTrue(
                  ((u, v) in expected_edges)
                  or ((v, u) in expected_edges)
              )
          self.assertEqual(sep_sets, expected_sepsets)
  
          # Generate independencies from a model.
          model = BayesianNetwork(
              [("A", "C"), ("B", "C"), ("B", "D"), ("C", "E")]
          )
          estimator = PC(independencies=model.get_independencies())
          skel, sep_sets = estimator.estimate(
              variant=variant,
              ci_test="independence_match",
              return_type="skeleton",
              n_jobs=2,
              show_progress=False,
          )
  
          expected_edges = model.edges()
          expected_sepsets1 = {
              frozenset(("D", "C")): ("B",),
              frozenset(("E", "B")): ("C",),
              frozenset(("A", "D")): tuple(),
              frozenset(("E", "D")): ("C",),
              frozenset(("E", "A")): ("C",),
              frozenset(("A", "B")): tuple(),
          }
          expected_sepsets2 = {
              frozenset(("D", "C")): ("B",),
              frozenset(("E", "B")): ("C",),
              frozenset(("A", "D")): tuple(),
              frozenset(("E", "D")): ("B",),
              frozenset(("E", "A")): ("C",),
              frozenset(("A", "B")): tuple(),
          }
          for u, v in skel.edges():
              self.assertTrue(
                  ((u, v) in expected_edges)
                  or ((v, u) in expected_edges)
              )
  
          self.assertTrue(
              (sep_sets == expected_sepsets1)
              or (sep_sets == expected_sepsets2)
          )
  
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 1 for calling the TestPCEstimatorFromIndependencies obj's underlying member method code with example usage: obj.test_build_skeleton_from_ind() without return types