code: def test_estimate_tan(self):
      for weight_fn in [
          "mutual_info",
          "adjusted_mutual_info",
          "normalized_mutual_info",
      ]:
          for n_jobs in [2, 1]:
              # learn graph structure
              est = TreeSearch(
                  self.data22, root_node="R", n_jobs=n_jobs
              )
              dag = est.estimate(
                  estimator_type="tan",
                  class_node="A",
                  edge_weights_fn=weight_fn,
                  show_progress=False,
              )
  
              # check number of nodes and edges are as expected
              self.assertCountEqual(
                  dag.nodes(), ["A", "B", "C", "D", "E", "R"]
              )
              self.assertCountEqual(
                  dag.edges(),
                  [
                      ("A", "B"),
                      ("A", "C"),
                      ("A", "D"),
                      ("A", "E"),
                      ("A", "R"),
                      ("R", "B"),
                      ("R", "C"),
                      ("R", "D"),
                      ("R", "E"),
                  ],
              )
  
              # check directed edge between class and independent variables
              self.assertTrue(dag.has_edge("A", "B"))
              self.assertTrue(dag.has_edge("A", "C"))
              self.assertTrue(dag.has_edge("A", "D"))
              self.assertTrue(dag.has_edge("A", "E"))
  
              # check tree structure exists over independent variables
              self.assertTrue(dag.has_edge("R", "B"))
              self.assertTrue(dag.has_edge("R", "C"))
              self.assertTrue(dag.has_edge("R", "D"))
              self.assertTrue(dag.has_edge("R", "E"))
  
imports: import unittest
  import networkx
  import numpy
  import pandas
  from joblib.externals.loky import get_reusable_executor
  from pgmpy.estimators import TreeSearch
  from pgmpy.factors.discrete import TabularCPD
  from pgmpy.models import BayesianNetwork
  from pgmpy.sampling import BayesianModelSampling
  from pgmpy.utils import get_example_model
label_desc: Use image node_id 3 for calling the TestTreeSearch obj's underlying member method code with example usage: obj.test_estimate_tan() without return types