code: def _run_test_explain(
      name_from_base,
      clarify_processor,
      clarify_processor_with_job_name_prefix,
      data_config,
      model_config,
      shap_config,
      pdp_config,
      model_scores,
      expected_predictor_config,
      expected_text_config=None,
      expected_image_config=None,
  ):
      with patch.object(
          SageMakerClarifyProcessor, "_run", return_value=None
      ) as mock_method:
          explanation_configs = None
          if shap_config and pdp_config:
              explanation_configs = [shap_config, pdp_config]
          elif shap_config:
              explanation_configs = shap_config
          elif pdp_config:
              explanation_configs = pdp_config
  
          clarify_processor.run_explainability(
              data_config,
              model_config,
              explanation_configs,
              model_scores=model_scores,
              wait=True,
              job_name="test",
              experiment_config={"ExperimentName": "AnExperiment"},
          )
          expected_analysis_config = {
              "dataset_type": "text/csv",
              "headers": [
                  "Label",
                  "F1",
                  "F2",
                  "F3",
                  "F4",
              ],
              "label": "Label",
              "joinsource_name_or_index": "F4",
              "predictor": expected_predictor_config,
          }
          expected_explanation_configs = {}
          if shap_config:
              expected_explanation_configs["shap"] = {
                  "baseline": [
                      [
                          0.26124998927116394,
                          0.2824999988079071,
                          0.06875000149011612,
                      ]
                  ],
                  "num_samples": 100,
                  "agg_method": "mean_sq",
                  "use_logit": False,
                  "save_local_shap_values": True,
              }
              if expected_text_config:
                  expected_explanation_configs["shap"][
                      "text_config"
                  ] = expected_text_config
              if expected_image_config:
                  expected_explanation_configs["shap"][
                      "image_config"
                  ] = expected_image_config
          if pdp_config:
              expected_explanation_configs["pdp"] = {
                  "features": ["F1", "F2"],
                  "grid_resolution": 20,
                  "top_k_features": 10,
              }
          expected_analysis_config["methods"] = {
              "report": {"name": "report", "title": "Analysis Report"},
              **expected_explanation_configs,
          }
          mock_method.assert_called_with(
              data_config,
              expected_analysis_config,
              True,
              True,
              "test",
              None,
              {"ExperimentName": "AnExperiment"},
          )
          clarify_processor_with_job_name_prefix.run_explainability(
              data_config,
              model_config,
              explanation_configs,
              model_scores=model_scores,
              wait=True,
              experiment_config={"ExperimentName": "AnExperiment"},
          )
          name_from_base.assert_called_with(JOB_NAME_PREFIX)
          mock_method.assert_called_with(
              data_config,
              expected_analysis_config,
              True,
              True,
              JOB_NAME,
              None,
              {"ExperimentName": "AnExperiment"},
          )
  
imports: from __future__ import absolute_import, print_function
  import copy
  import pytest
  from mock import MagicMock, Mock, patch
  from sagemaker import Processor, image_uris
  from sagemaker.clarify import BiasConfig, DataConfig, ModelConfig, ModelPredictedLabelConfig, PDPConfig, SageMakerClarifyProcessor, SHAPConfig, TextConfig, ImageConfig, _AnalysisConfigGenerator, DatasetType, ProcessingOutputHandler, SegmentationConfig
label_desc: Use image node_id 40 for calling a global function with example usage: _run_test_explain(name_from_base, clarify_processor, clarify_processor_with_job_name_prefix, data_config, model_config, shap_config, pdp_config, model_scores, expected_predictor_config, expected_text_config, expected_image_config) without return types