code: def test_failed_training_job(
      sagemaker_session,
      sklearn_latest_version,
      sklearn_latest_py_version,
      cpu_instance_type,
  ):
      with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
          script_path = os.path.join(
              DATA_DIR, "sklearn_mnist", "failure_script.py"
          )
          data_path = os.path.join(DATA_DIR, "sklearn_mnist")
  
          sklearn = SKLearn(
              entry_point=script_path,
              role=ROLE,
              framework_version=sklearn_latest_version,
              py_version=sklearn_latest_py_version,
              instance_count=1,
              instance_type=cpu_instance_type,
              sagemaker_session=sagemaker_session,
          )
  
          train_input = sklearn.sagemaker_session.upload_data(
              path=os.path.join(data_path, "train"),
              key_prefix="integ-test-data/sklearn_mnist/train",
          )
          job_name = unique_name_from_base("test-sklearn-failed")
  
          with pytest.raises(ValueError):
              sklearn.fit(train_input, job_name=job_name)
  
imports: from __future__ import absolute_import
  import os
  import time
  import pytest
  import numpy
  from sagemaker.serverless import ServerlessInferenceConfig
  from sagemaker.sklearn import SKLearn, SKLearnModel, SKLearnProcessor
  from sagemaker.utils import unique_name_from_base
  from tests.integ import DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES
  from tests.integ.timeout import timeout, timeout_and_delete_endpoint_by_name
label_desc: Use image node_id 8 for calling a global function with example usage: test_failed_training_job(sagemaker_session, sklearn_latest_version, sklearn_latest_py_version, cpu_instance_type) without return types