code: def test_validate_with_test_data_classification_target_filter_validations(
      self, target_filter_type
  ):
      test_data_classification = get_toy_binary_classification_dataset()
  
      with pytest.raises(
          UserConfigValidationException,
          match="{0} can only be configured with "
          "filter {1} for classification".format(
              target_filter_type, CohortFilterMethods.METHOD_INCLUDES
          ),
      ):
          cohort_filter_classification = CohortFilter(
              method=CohortFilterMethods.METHOD_EXCLUDES,
              arg=["X"],
              column=target_filter_type,
          )
          cohort_filter_classification._validate_with_test_data(
              test_data=test_data_classification,
              target_column="target",
              categorical_features=[],
              is_classification=True,
          )
  
      with pytest.raises(
          UserConfigValidationException,
          match="Found a class in arg which is not present in "
          "test data",
      ):
          cohort_filter_classification = CohortFilter(
              method=CohortFilterMethods.METHOD_INCLUDES,
              arg=["Z"],
              column=target_filter_type,
          )
          cohort_filter_classification._validate_with_test_data(
              test_data=test_data_classification,
              target_column="target",
              categorical_features=[],
              is_classification=True,
          )
  
imports: import json
  import pandas
  import pytest
  from raiutils.cohort import ClassificationOutcomes, Cohort, CohortFilter, CohortFilterMethods, cohort_filter_json_converter
  from raiutils.exceptions import UserConfigValidationException
label_desc: Use image node_id 6 for calling the TestCohortFilterDataValidations obj's underlying member method code with example usage: obj.test_validate_with_test_data_classification_target_filter_validations(target_filter_type) without return types