code: def test_to_request_step_with_all_fields(
      self, mock_name_from_base, mock_execution_variables
  ):
      self.maxDiff = None
      parameters = {"param1": "value1", "param2": "value2"}
      environment_variables = {
          "env_var1": "value1",
          "env_var2": "value2",
      }
      initialization_script = (
          "tests/data/workflow/notebook_job_step/my-init.sh"
      )
      s3_kms_key = "arn:aws:kms:us-east-1:123456789012:key/abc123"
      instance_type = "ml.m5.large"
      volume_size = 50
      volume_kms_key = "arn:aws:kms:us-east-1:123456789012:key/xyz456"
      encrypt_inter_container_traffic = True
      security_group_ids = ["sg-12345678", "sg-87654321"]
      subnets = ["subnet-12345678", "subnet-87654321"]
      max_retry_attempts = 2
      max_runtime_in_seconds = 3600
      tags = {"TagKey": "TagValue", "TagKey2": "TagValue2"}
      additional_dependencies = [
          "tests/data/workflow/notebook_job_step",
          "tests/data/workflow/notebook_job_step/subfolder",
      ]
      retry_policies = []
      depends_on = []
  
      expected_input_folder = "input-abc"
      mock_name_from_base.return_value = expected_input_folder
      mock_execution_variables.PIPELINE_EXECUTION_ID = Mock()
  
      # Create a NotebookJobStep instance
      notebook_step = NotebookJobStep(
          name=STEP_NAME,
          display_name=DISPLAY_NAME,
          description=DESCRIPTION,
          notebook_job_name=NOTEBOOK_JOB_NAME,
          input_notebook=INPUT_NOTEBOOK,
          image_uri=IMAGE_URI,
          kernel_name=KERNEL_NAME,
          role=ROLE,
          s3_root_uri=S3_ROOT_URI,
          parameters=parameters,
          environment_variables=environment_variables,
          initialization_script=initialization_script,
          s3_kms_key=s3_kms_key,
          instance_type=instance_type,
          volume_size=volume_size,
          volume_kms_key=volume_kms_key,
          encrypt_inter_container_traffic=encrypt_inter_container_traffic,
          security_group_ids=security_group_ids,
          subnets=subnets,
          max_retry_attempts=max_retry_attempts,
          max_runtime_in_seconds=max_runtime_in_seconds,
          tags=tags,
          additional_dependencies=additional_dependencies,
          retry_policies=retry_policies,
          depends_on=depends_on,
      )
  
      request = notebook_step.to_request()
      expected_request = {
          "Name": "NotebookStep",
          "Type": "Training",
          "Arguments": {
              "TrainingJobName": f"{notebook_step._underlying_job_prefix}",
              "RoleArn": "arn:aws:iam::123456789012:role/MySageMakerRole",
              "RetryStrategy": {"MaximumRetryAttempts": 2},
              "StoppingCondition": {"MaxRuntimeInSeconds": 3600},
              "EnableInterContainerTrafficEncryption": True,
              "AlgorithmSpecification": {
                  "TrainingImage": "236514542706.dkr.ecr.us-west-2.amazonaws.com/sagemaker-data-science-310@1",
                  "TrainingInputMode": "File",
                  "ContainerEntrypoint": ["amazon_sagemaker_scheduler"],
              },
              "InputDataConfig": [
                  {
                      "ChannelName": "sagemaker_headless_execution_pipelinestep",
                      "DataSource": {
                          "S3DataSource": {
                              "S3DataType": "S3Prefix",
                              "S3Uri": f"s3://my-bucket/abc/{PIPELINE_NAME}"
                              f"/NotebookStep/{expected_input_folder}",
                              "S3DataDistributionType": "FullyReplicated",
                          }
                      },
                  }
              ],
              "OutputDataConfig": {
                  "S3OutputPath": Join(
                      "/",
                      [
                          S3_ROOT_URI,
                          PIPELINE_NAME,
                          mock_execution_variables.PIPELINE_EXECUTION_ID,
                          STEP_NAME,
                      ],
                  ),
                  "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/abc123",
              },
              "ResourceConfig": {
                  "VolumeSizeInGB": 50,
                  "InstanceCount": 1,
                  "InstanceType": "ml.m5.large",
                  "VolumeKmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/xyz456",
              },
              "VpcConfig": {
                  "Subnets": ["subnet-12345678", "subnet-87654321"],
                  "SecurityGroupIds": ["sg-12345678", "sg-87654321"],
              },
              "Tags": [
                  {"Key": "TagKey", "Value": "TagValue"},
                  {"Key": "TagKey2", "Value": "TagValue2"},
                  {"Key": "sagemaker:name", "Value": "MyNotebookJob"},
                  {
                      "Key": "sagemaker:notebook-name",
                      "Value": "notebook1_happypath.ipynb",
                  },
                  {
                      "Key": "sagemaker:notebook-job-origin",
                      "Value": "PIPELINE_STEP",
                  },
                  {
                      "Key": "sagemaker:is-studio-archived",
                      "Value": "false",
                  },
              ],
              "Environment": {
                  "env_var1": "value1",
                  "env_var2": "value2",
                  "AWS_DEFAULT_REGION": "us-west-2",
                  "SM_JOB_DEF_VERSION": "1.0",
                  "SM_ENV_NAME": "sagemaker-default-env",
                  "SM_SKIP_EFS_SIMULATION": "true",
                  "SM_EXECUTION_INPUT_PATH": "/opt/ml/input/data/sagemaker_headless_execution_pipelinestep",
                  "SM_KERNEL_NAME": "python3",
                  "SM_INPUT_NOTEBOOK_NAME": "notebook1_happypath.ipynb",
                  "SM_OUTPUT_NOTEBOOK_NAME": f"{notebook_step._underlying_job_prefix}.ipynb",
                  "SM_INIT_SCRIPT": "my-init.sh",
              },
              "HyperParameters": {
                  "param1": "value1",
                  "param2": "value2",
              },
          },
          "DisplayName": "Display Name",
          "Description": "Description",
      }
      self.assertEqual(request, expected_request)
      # only verify it's called once as the logic uses a transient tmp folder with random name
      # The uploading function is also tested in integ testing.
      self.mocked_session.upload_data.assert_called_once()
      mock_name_from_base.assert_called_with("input")
  
imports: from __future__ import absolute_import
  import unittest
  from mock import Mock, patch
  from sagemaker.workflow.notebook_job_step import NotebookJobStep
  from sagemaker.workflow.functions import Join
label_desc: Use image node_id 13 for calling the TestNotebookJobStep obj's underlying member method code with example usage: obj.test_to_request_step_with_all_fields(mock_name_from_base, mock_execution_variables) without return types