code: def test_KD_tree_output(
      self,
      desired_class,
      sample_custom_query_2,
      total_CFs,
      posthoc_sparsity_algorithm,
  ):
      self.exp_multi._generate_counterfactuals(
          query_instance=sample_custom_query_2,
          total_CFs=total_CFs,
          desired_class=desired_class,
          posthoc_sparsity_algorithm=posthoc_sparsity_algorithm,
      )
      assert all(i == desired_class for i in self.exp_multi.cfs_preds)
  
imports: import numpy
  import pytest
  from dice_ml.counterfactual_explanations import CounterfactualExplanations
  from dice_ml.diverse_counterfactuals import CounterfactualExamples
label_desc: Use image node_id 2 for calling the TestDiceKDMultiClassificationMethods obj's underlying member method code with example usage: obj.test_KD_tree_output(desired_class, sample_custom_query_2, total_CFs, posthoc_sparsity_algorithm) without return types