code: def test_get_minimal_adjustment_set(self):
      # Without latent variables
      dag1 = BayesianNetwork([("X", "Y"), ("Z", "X"), ("Z", "Y")])
      infer = CausalInference(dag1)
      adj_set = infer.get_minimal_adjustment_set(X="X", Y="Y")
      self.assertEqual(adj_set, {"Z"})
  
      self.assertRaises(
          ValueError, infer.get_minimal_adjustment_set, X="W", Y="Y"
      )
  
      # M graph
      dag2 = BayesianNetwork(
          [
              ("X", "Y"),
              ("Z1", "X"),
              ("Z1", "Z3"),
              ("Z2", "Z3"),
              ("Z2", "Y"),
          ]
      )
      infer = CausalInference(dag2)
      adj_set = infer.get_minimal_adjustment_set(X="X", Y="Y")
      self.assertEqual(adj_set, set())
  
      # With latents
      dag_lat1 = BayesianNetwork(
          [("X", "Y"), ("Z", "X"), ("Z", "Y")], latents={"Z"}
      )
      infer = CausalInference(dag_lat1)
      adj_set = infer.get_minimal_adjustment_set(X="X", Y="Y")
      self.assertIsNone(adj_set)
  
      # Pearl's Simpson machine
      dag_lat2 = BayesianNetwork(
          [
              ("X", "Y"),
              ("Z1", "U"),
              ("U", "X"),
              ("Z1", "Z3"),
              ("Z3", "Y"),
              ("U", "Z2"),
              ("Z3", "Z2"),
          ],
          latents={"U"},
      )
      infer = CausalInference(dag_lat2)
      adj_set = infer.get_minimal_adjustment_set(X="X", Y="Y")
      self.assertTrue((adj_set == {"Z1"}) or (adj_set == {"Z3"}))
  
imports: import unittest
  import numpy
  import numpy.testing
  import pandas
  from pgmpy.factors.discrete import TabularCPD
  from pgmpy.inference.CausalInference import CausalInference
  from pgmpy.models import BayesianNetwork
label_desc: Use image node_id 5 for calling the TestAdjustmentSet obj's underlying member method code with example usage: obj.test_get_minimal_adjustment_set() without return types