code: def test_desired_range(
      self,
      features_to_vary,
      desired_class,
      desired_range,
      sample_custom_query_2,
      total_CFs,
      permitted_range,
  ):
      ans = self.exp._generate_counterfactuals(
          features_to_vary=features_to_vary,
          query_instance=sample_custom_query_2,
          total_CFs=total_CFs,
          desired_class=desired_class,
          desired_range=desired_range,
          permitted_range=permitted_range,
      )
      assert all(
          [desired_range[0]] * total_CFs
          <= ans.final_cfs_df[
              self.exp.data_interface.outcome_name
          ].values
      )
      assert all(
          ans.final_cfs_df[self.exp.data_interface.outcome_name].values
          <= [desired_range[1]] * total_CFs
      )
  
imports: import pytest
  from raiutils.exceptions import UserConfigValidationException
  from dice_ml.counterfactual_explanations import CounterfactualExplanations
  from dice_ml.diverse_counterfactuals import CounterfactualExamples
label_desc: Use image node_id 2 for calling the TestDiceRandomRegressionMethods obj's underlying member method code with example usage: obj.test_desired_range(features_to_vary, desired_class, desired_range, sample_custom_query_2, total_CFs, permitted_range) without return types