code: def test_desired_class(
      self,
      desired_class,
      total_CFs,
      method,
      genetic_initialization,
      sample_custom_query_2,
      custom_public_data_interface,
      sklearn_multiclass_classification_model_interface,
  ):
      exp = dice_ml.Dice(
          custom_public_data_interface,
          sklearn_multiclass_classification_model_interface,
          method=method,
      )
  
      if method != "genetic":
          ans = exp.generate_counterfactuals(
              query_instances=sample_custom_query_2,
              total_CFs=total_CFs,
              desired_class=desired_class,
          )
      else:
          ans = exp.generate_counterfactuals(
              query_instances=sample_custom_query_2,
              total_CFs=total_CFs,
              desired_class=desired_class,
              initialization=genetic_initialization,
          )
  
      assert ans is not None
      if method != "kdtree":
          assert all(
              ans.cf_examples_list[0]
              .final_cfs_df[exp.data_interface.outcome_name]
              .values
              == [desired_class] * total_CFs
          )
      else:
          assert all(
              ans.cf_examples_list[0]
              .final_cfs_df_sparse[exp.data_interface.outcome_name]
              .values
              == [desired_class] * total_CFs
          )
      assert all(i == desired_class for i in exp.cfs_preds)
  
      exp.serialize_explainer(method + ".pkl")
      new_exp = ExplainerBase.deserialize_explainer(method + ".pkl")
  
      if method != "genetic":
          ans = new_exp.generate_counterfactuals(
              query_instances=sample_custom_query_2,
              total_CFs=total_CFs,
              desired_class=desired_class,
          )
      else:
          ans = new_exp.generate_counterfactuals(
              query_instances=sample_custom_query_2,
              total_CFs=total_CFs,
              desired_class=desired_class,
              initialization=genetic_initialization,
          )
  
      assert ans is not None
      if method != "kdtree":
          assert all(
              ans.cf_examples_list[0]
              .final_cfs_df[new_exp.data_interface.outcome_name]
              .values
              == [desired_class] * total_CFs
          )
      else:
          assert all(
              ans.cf_examples_list[0]
              .final_cfs_df_sparse[new_exp.data_interface.outcome_name]
              .values
              == [desired_class] * total_CFs
          )
      assert all(i == desired_class for i in new_exp.cfs_preds)
  
imports: import re
  import numpy
  import pandas
  import pytest
  from rai_test_utils.datasets.tabular import create_housing_data
  from raiutils.exceptions import UserConfigValidationException
  from sklearn.ensemble import RandomForestRegressor
  import dice_ml
  from dice_ml.diverse_counterfactuals import CounterfactualExamples
  from dice_ml.explainer_interfaces.explainer_base import ExplainerBase
  from dice_ml.utils import helpers
  from ..conftest import _load_custom_testing_binary_model
label_desc: Use image node_id 2 for calling the TestExplainerBaseMultiClassClassification obj's underlying member method code with example usage: obj.test_desired_class(desired_class, total_CFs, method, genetic_initialization, sample_custom_query_2, custom_public_data_interface, sklearn_multiclass_classification_model_interface) without return types