code: def test_permitted_range(
      self,
      desired_class,
      method,
      total_CFs,
      permitted_range,
      sample_custom_query_2,
      custom_public_data_interface,
      sklearn_binary_classification_model_interface,
  ):
      exp = dice_ml.Dice(
          custom_public_data_interface,
          sklearn_binary_classification_model_interface,
          method=method,
      )
      ans = exp.generate_counterfactuals(
          query_instances=sample_custom_query_2,
          permitted_range=permitted_range,
          total_CFs=total_CFs,
          desired_class=desired_class,
      )
  
      for feature in permitted_range:
          if method != "kdtree":
              assert all(
                  permitted_range[feature][0]
                  <= ans.cf_examples_list[0]
                  .final_cfs_df[feature]
                  .values[i]
                  <= permitted_range[feature][1]
                  for i in range(total_CFs)
              )
          else:
              assert all(
                  permitted_range[feature][0]
                  <= ans.cf_examples_list[0]
                  .final_cfs_df_sparse[feature]
                  .values[i]
                  <= permitted_range[feature][1]
                  for i in range(total_CFs)
              )
  
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 13 for calling the TestExplainerBaseBinaryClassification obj's underlying member method code with example usage: obj.test_permitted_range(desired_class, method, total_CFs, permitted_range, sample_custom_query_2, custom_public_data_interface, sklearn_binary_classification_model_interface) without return types