code: def training_job_fixture(
      sagemaker_session: Session,
      cpu_instance_type: str,
  ):
      """Training job fixture used for the creation of models and model packages."""
      with timeout(minutes=MODEL_CARD_DEFAULT_TIMEOUT_MINUTES):
          # upload data
          raw_data = (
              (0.5, 0),
              (0.75, 0),
              (1.0, 0),
              (1.25, 0),
              (1.50, 0),
              (1.75, 0),
              (2.0, 0),
              (2.25, 1),
              (2.5, 0),
              (2.75, 1),
              (3.0, 0),
              (3.25, 1),
              (3.5, 0),
              (4.0, 1),
              (4.25, 1),
              (4.5, 1),
              (4.75, 1),
              (5.0, 1),
              (5.5, 1),
          )
          training_data = np.array(raw_data).astype("float32")
          labels = training_data[:, 1]
  
          bucket = sagemaker_session.default_bucket()
          prefix = "integ-test-data/model-card/binary-classifier"
  
          buf = io.BytesIO()
          smac.write_numpy_to_dense_tensor(buf, training_data, labels)
          buf.seek(0)
  
          sagemaker_session.boto_session.resource(
              "s3", region_name=sagemaker_session.boto_region_name
          ).Bucket(bucket).Object(
              os.path.join(prefix, "train")
          ).upload_fileobj(
              buf
          )
  
          # train model
          s3_train_data = f"s3://{bucket}/{prefix}/train"
          output_location = f"s3://{bucket}/{prefix}/output"
          container = retrieve(
              "linear-learner",
              sagemaker_session.boto_session.region_name,
          )
          estimator = sagemaker.estimator.Estimator(
              container,
              role=ROLE,
              instance_count=1,
              instance_type=cpu_instance_type,
              output_path=output_location,
              sagemaker_session=sagemaker_session,
          )
          estimator.set_hyperparameters(
              feature_dim=2,
              mini_batch_size=10,
              predictor_type="binary_classifier",
          )
          estimator.fit({"train": s3_train_data})
  
          return estimator
  
imports: from __future__ import absolute_import
  import os
  import io
  import numpy
  import pytest
  import logging
  from six.moves.urllib.parse import urlparse
  from typing import Tuple
  from sagemaker import s3
  from sagemaker.estimator import Estimator
  import sagemaker
  from sagemaker.session import Session
  import sagemaker.amazon.common
  from sagemaker.image_uris import retrieve
  from sagemaker.utils import unique_name_from_base
  from sagemaker.model_card import ModelCard, ModelOverview, TrainingDetails, ModelCardStatusEnum, ModelPackage, BusinessDetails, IntendedUses, schema_constraints
  from sagemaker.model_card.model_card import ModelApprovalStatusEnum
  from tests.integ import MODEL_CARD_DEFAULT_TIMEOUT_MINUTES, DATA_DIR
  from tests.integ.timeout import timeout, timeout_and_delete_model_by_name
  from tests.integ.retry import retries
label_desc: Use image node_id 1 for calling a global function with example usage: training_job_fixture(sagemaker_session, cpu_instance_type) and returns: estimator