code: def test_register_model_with_model_repack_with_estimator(
      estimator,
      model_metrics,
      drift_check_baselines,
      source_dir,
  ):
      model_data = f"s3://{BUCKET}/model.tar.gz"
      dummy_requirements = f"{DATA_DIR}/dummy_requirements.txt"
      register_model = RegisterModel(
          name="RegisterModelStep",
          estimator=estimator,
          model_data=model_data,
          content_types=["content_type"],
          response_types=["response_type"],
          inference_instances=["inference_instance"],
          transform_instances=["transform_instance"],
          model_package_group_name="mpg",
          model_metrics=model_metrics,
          drift_check_baselines=drift_check_baselines,
          approval_status="Approved",
          description="description",
          entry_point=f"{source_dir}/inference.py",
          dependencies=[dummy_requirements],
          depends_on=["TestStep"],
          tags=[{"Key": "myKey", "Value": "myValue"}],
          sample_payload_url="s3://test-bucket/model",
          task="IMAGE_CLASSIFICATION",
          framework="TENSORFLOW",
          framework_version="2.9",
          nearest_model_name="resnet50",
      )
  
      request_dicts = register_model.request_dicts()
      assert len(request_dicts) == 2
  
      for request_dict in request_dicts:
          if request_dict["Type"] == "Training":
              assert (
                  request_dict["Name"]
                  == "RegisterModelStep-RepackModel"
              )
              assert len(request_dict["DependsOn"]) == 1
              assert request_dict["DependsOn"][0] == "TestStep"
              arguments = request_dict["Arguments"]
              assert (
                  BUCKET
                  in arguments["HyperParameters"][
                      "sagemaker_submit_directory"
                  ]
              )
              arguments["HyperParameters"].pop(
                  "sagemaker_submit_directory"
              )
              assert ordered(arguments) == ordered(
                  {
                      "AlgorithmSpecification": {
                          "TrainingImage": MODEL_REPACKING_IMAGE_URI,
                          "TrainingInputMode": "File",
                      },
                      "DebugHookConfig": {
                          "CollectionConfigurations": [],
                          "S3OutputPath": f"s3://{BUCKET}/",
                      },
                      "ProfilerConfig": {"DisableProfiler": True},
                      "HyperParameters": {
                          "inference_script": '"inference.py"',
                          "dependencies": f'"{dummy_requirements}"',
                          "model_archive": '"s3://my-bucket/model.tar.gz"',
                          "sagemaker_program": f'"{REPACK_SCRIPT_LAUNCHER}"',
                          "sagemaker_container_log_level": "20",
                          "sagemaker_region": f'"{REGION}"',
                          "source_dir": "null",
                      },
                      "InputDataConfig": [
                          {
                              "ChannelName": "training",
                              "DataSource": {
                                  "S3DataSource": {
                                      "S3DataDistributionType": "FullyReplicated",
                                      "S3DataType": "S3Prefix",
                                      "S3Uri": f"s3://{BUCKET}/model.tar.gz",
                                  }
                              },
                          }
                      ],
                      "OutputDataConfig": {
                          "S3OutputPath": f"s3://{BUCKET}/"
                      },
                      "ResourceConfig": {
                          "InstanceCount": 1,
                          "InstanceType": "ml.m5.large",
                          "VolumeSizeInGB": 30,
                      },
                      "RoleArn": ROLE,
                      "StoppingCondition": {
                          "MaxRuntimeInSeconds": 86400
                      },
                      "Tags": [{"Key": "myKey", "Value": "myValue"}],
                      "VpcConfig": [
                          ("SecurityGroupIds", ["123", "456"]),
                          ("Subnets", ["abc", "def"]),
                      ],
                  }
              )
          elif request_dict["Type"] == "RegisterModel":
              assert (
                  request_dict["Name"]
                  == "RegisterModelStep-RegisterModel"
              )
              assert "DependsOn" not in request_dict
              arguments = request_dict["Arguments"]
              assert (
                  len(arguments["InferenceSpecification"]["Containers"])
                  == 1
              )
              assert (
                  arguments["InferenceSpecification"]["Containers"][0][
                      "Image"
                  ]
                  == estimator.training_image_uri()
              )
              assert isinstance(
                  arguments["InferenceSpecification"]["Containers"][0][
                      "ModelDataUrl"
                  ],
                  Properties,
              )
              del arguments["InferenceSpecification"]["Containers"]
              assert ordered(arguments) == ordered(
                  {
                      "InferenceSpecification": {
                          "SupportedContentTypes": ["content_type"],
                          "SupportedRealtimeInferenceInstanceTypes": [
                              "inference_instance"
                          ],
                          "SupportedResponseMIMETypes": [
                              "response_type"
                          ],
                          "SupportedTransformInstanceTypes": [
                              "transform_instance"
                          ],
                      },
                      "ModelApprovalStatus": "Approved",
                      "SkipModelValidation": "None",
                      "ModelMetrics": {
                          "Bias": {},
                          "Explainability": {},
                          "ModelQuality": {
                              "Statistics": {
                                  "ContentType": "text/csv",
                                  "S3Uri": f"s3://{BUCKET}/metrics.csv",
                              },
                          },
                      },
                      "DriftCheckBaselines": {
                          "ModelQuality": {
                              "Constraints": {
                                  "ContentType": "text/csv",
                                  "S3Uri": f"s3://{BUCKET}/constraints_metrics.csv",
                              }
                          }
                      },
                      "ModelPackageDescription": "description",
                      "ModelPackageGroupName": "mpg",
                      "Tags": [{"Key": "myKey", "Value": "myValue"}],
                      "SamplePayloadUrl": "s3://test-bucket/model",
                      "Task": "IMAGE_CLASSIFICATION",
                  }
              )
          else:
              raise Exception(
                  "A step exists in the collection of an invalid type."
              )
  
imports: from __future__ import absolute_import
  import json
  import os
  import tempfile
  import shutil
  import pytest
  from sagemaker.drift_check_baselines import DriftCheckBaselines
  from sagemaker.workflow._utils import REPACK_SCRIPT_LAUNCHER
  from sagemaker.workflow.condition_step import ConditionStep
  from sagemaker.workflow.conditions import ConditionEquals
  from sagemaker.workflow.model_step import ModelStep, _CREATE_MODEL_NAME_BASE, _REPACK_MODEL_NAME_BASE
  from sagemaker.workflow.parameters import ParameterString
  from sagemaker.workflow.pipeline import Pipeline, PipelineGraph
  from sagemaker.workflow.utilities import list_to_request
  from tests.unit import DATA_DIR
  from sagemaker import PipelineModel
  from sagemaker.estimator import Estimator
  from sagemaker.model import Model, FrameworkModel
  from sagemaker.tensorflow import TensorFlow
  from sagemaker.inputs import CreateModelInput, TransformInput
  from sagemaker.model_metrics import MetricsSource, ModelMetrics
  from sagemaker.workflow.properties import Properties
  from sagemaker.workflow.steps import CreateModelStep
  from sagemaker.workflow.step_collections import EstimatorTransformer, StepCollection, RegisterModel
  from sagemaker.workflow.retry import StepRetryPolicy, StepExceptionTypeEnum
  from tests.unit.sagemaker.workflow.helpers import ordered, CustomStep
  from tests.unit.sagemaker.workflow.conftest import IMAGE_URI, ROLE, BUCKET, REGION
label_desc: Use image node_id 17 for calling a global function with example usage: test_register_model_with_model_repack_with_estimator(estimator, model_metrics, drift_check_baselines, source_dir) without return types