code: def test_get_ancestral_graph(self):
      dag = DAG([("A", "C"), ("B", "C"), ("D", "A"), ("D", "B")])
      anc_dag = dag.get_ancestral_graph(["A", "B"])
      self.assertEqual(
          set(anc_dag.edges()), set([("D", "A"), ("D", "B")])
      )
      self.assertRaises(
          ValueError, dag.get_ancestral_graph, ["A", "gibber"]
      )
  
imports: import unittest
  import networkx
  import numpy
  import pgmpy.tests.help_functions
  from pgmpy.base import DAG, PDAG
label_desc: Use image node_id 21 for calling the TestDAGCreation obj's underlying member method code with example usage: obj.test_get_ancestral_graph() without return types