code: def test_permitted_range_categorical(
      self,
      desired_class,
      desired_range,
      total_CFs,
      sample_custom_query_2,
      permitted_range,
  ):
      features_to_vary = self.exp.setup(
          "all", permitted_range, sample_custom_query_2, "inverse_mad"
      )
      ans = self.exp._generate_counterfactuals(
          query_instance=sample_custom_query_2,
          features_to_vary=features_to_vary,
          permitted_range=permitted_range,
          total_CFs=total_CFs,
          desired_class=desired_class,
          desired_range=desired_range,
      )
  
      for feature in permitted_range:
          assert all(
              permitted_range[feature][0]
              <= ans.final_cfs_df[feature].values[i]
              <= permitted_range[feature][1]
              for i in range(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 6 for calling the TestDiceRandomBinaryClassificationMethods obj's underlying member method code with example usage: obj.test_permitted_range_categorical(desired_class, desired_range, total_CFs, sample_custom_query_2, permitted_range) without return types