code: def test_legal_operations_blacklist_whitelist(self):
      model2_legal_ops_bl = list(
          self.est_rand._legal_operations(
              model=self.model2,
              score=self.score_rand,
              structure_score=self.score_structure_prior,
              tabu_list=set(),
              max_indegree=float("inf"),
              black_list=set(
                  [("A", "B"), ("A", "C"), ("C", "A"), ("C", "B")]
              ),
              white_list=self.model2_possible_edges,
              fixed_edges=set(),
          )
      )
      model2_legal_ops_bl_ref = [
          ("+", ("B", "C")),
          ("-", ("A", "B")),
          ("flip", ("A", "B")),
      ]
      self.assertSetEqual(
          set([op for op, score in model2_legal_ops_bl]),
          set(model2_legal_ops_bl_ref),
      )
  
      model2_legal_ops_wl = list(
          self.est_rand._legal_operations(
              model=self.model2,
              score=self.score_rand,
              structure_score=self.score_structure_prior,
              tabu_list=set(),
              max_indegree=float("inf"),
              black_list=set(),
              white_list=set(
                  [("A", "B"), ("A", "C"), ("C", "A"), ("A", "B")]
              ),
              fixed_edges=set(),
          )
      )
      model2_legal_ops_wl_ref = [
          ("+", ("A", "C")),
          ("+", ("C", "A")),
          ("-", ("A", "B")),
      ]
      self.assertSetEqual(
          set([op for op, score in model2_legal_ops_wl]),
          set(model2_legal_ops_wl_ref),
      )
  
file_path: pgmpy/pgmpy/tests/test_estimators/test_HillClimbSearch.py
imports: import unittest
  import numpy
  import pandas
  from pgmpy.estimators import HillClimbSearch, K2Score
  from pgmpy.models import BayesianNetwork
label_desc: Use image node_id 3 for calling the TestHillClimbEstimator obj's underlying member method code with example usage: obj.test_legal_operations_blacklist_whitelist() without return types