code: def test_pre_training_bias(
      name_from_base,
      clarify_processor,
      clarify_processor_with_job_name_prefix,
      data_config,
      data_bias_config,
  ):
      with patch.object(
          SageMakerClarifyProcessor, "_run", return_value=None
      ) as mock_method:
          clarify_processor.run_pre_training_bias(
              data_config,
              data_bias_config,
              wait=True,
              job_name="test",
              experiment_config={"ExperimentName": "AnExperiment"},
          )
          expected_analysis_config = {
              "dataset_type": "text/csv",
              "headers": [
                  "Label",
                  "F1",
                  "F2",
                  "F3",
                  "F4",
              ],
              "joinsource_name_or_index": "F4",
              "label": "Label",
              "label_values_or_threshold": [1],
              "facet": [{"name_or_index": "F1"}],
              "group_variable": "F2",
              "methods": {
                  "report": {
                      "name": "report",
                      "title": "Analysis Report",
                  },
                  "pre_training_bias": {"methods": "all"},
              },
          }
          mock_method.assert_called_with(
              data_config,
              expected_analysis_config,
              True,
              True,
              "test",
              None,
              {"ExperimentName": "AnExperiment"},
          )
          clarify_processor_with_job_name_prefix.run_pre_training_bias(
              data_config,
              data_bias_config,
              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 37 for calling a global function with example usage: test_pre_training_bias(name_from_base, clarify_processor, clarify_processor_with_job_name_prefix, data_config, data_bias_config) without return types