code: def test_KD_tree_output(
      self,
      desired_class,
      sample_custom_query_1,
      total_CFs,
      posthoc_sparsity_algorithm,
  ):
      self.exp._generate_counterfactuals(
          query_instance=sample_custom_query_1,
          desired_class=desired_class,
          total_CFs=total_CFs,
          posthoc_sparsity_algorithm=posthoc_sparsity_algorithm,
      )
      self.exp.final_cfs_df.Numerical = (
          self.exp.final_cfs_df.Numerical.astype(int)
      )
      assert len(self.exp.final_cfs_df) == total_CFs
  
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 3 for calling the TestDiceKDBinaryClassificationMethods obj's underlying member method code with example usage: obj.test_KD_tree_output(desired_class, sample_custom_query_1, total_CFs, posthoc_sparsity_algorithm) without return types