code: def test_extend_spark_config_to_request(
      mock_upload_spark_files, mock_get_default_image, mocked_session
  ):
      test_request_dict = dict(
          InputDataConfig=[],
          AlgorithmSpecification=dict(
              TrainingImage=IMAGE,
              TrainingInputMode="File",
              ContainerEntrypoint=[
                  "/bin/bash",
                  "/opt/ml/input/data/sagemaker_remote_function_bootstrap/job_driver.sh",
              ],
          ),
      )
  
      job_settings = _JobSettings(
          spark_config=SparkConfig(
              submit_jars=["path/to/jar"],
              submit_py_files=["path/to/py/file"],
              submit_files=["path/to/file"],
              configuration=[],
              spark_event_logs_uri="s3://event/log",
          ),
          s3_root_uri=S3_URI,
          role=ROLE_ARN,
          instance_type="ml.m5.large",
      )
  
      extended_request = _extend_spark_config_to_request(
          test_request_dict, job_settings, "s3://test/base/path"
      )
  
      assert extended_request == dict(
          AlgorithmSpecification={
              "ContainerEntrypoint": [
                  "/bin/bash",
                  "/opt/ml/input/data/sagemaker_remote_function_bootstrap/job_driver.sh",
                  "--spark-event-logs-s3-uri",
                  "s3://event/log",
                  "--jars",
                  "jars_s3_uri",
                  "--py-files",
                  "py_files_s3_uri",
                  "--files",
                  "files_s3_uri",
                  "/opt/ml/input/data/sagemaker_remote_function_bootstrap/spark_app.py",
              ],
              "TrainingImage": "image_uri",
              "TrainingInputMode": "File",
          },
          InputDataConfig=[
              {
                  "ChannelName": "conf",
                  "DataSource": {
                      "S3DataSource": {
                          "S3DataType": "S3Prefix",
                          "S3Uri": "config_file_s3_uri",
                          "S3DataDistributionType": "FullyReplicated",
                      }
                  },
              }
          ],
      )
  
imports: from __future__ import absolute_import
  import os
  import sys
  import pytest
  from mock import patch, Mock, ANY, mock_open
  from mock.mock import MagicMock
  from sagemaker.config import load_sagemaker_config
  from sagemaker.remote_function.checkpoint_location import CheckpointLocation
  from sagemaker.remote_function.core.stored_function import _SerializedData
  from sagemaker.session_settings import SessionSettings
  from sagemaker.remote_function.spark_config import SparkConfig
  from sagemaker.remote_function.custom_file_filter import CustomFileFilter
  from sagemaker.remote_function.core.pipeline_variables import Context
  from sagemaker.workflow.pipeline_context import _PipelineConfig
  from sagemaker.workflow.pipeline_definition_config import PipelineDefinitionConfig
  from sagemaker.workflow.execution_variables import ExecutionVariables
  from sagemaker.utils import sagemaker_timestamp
  from tests.unit import DATA_DIR
  from sagemaker.remote_function.job import _JobSettings, _Job, _convert_run_to_json, _prepare_and_upload_runtime_scripts, _prepare_and_upload_workspace, _prepare_and_upload_spark_dependent_files, _upload_spark_submit_deps, _upload_serialized_spark_configuration, _extend_spark_config_to_request, _prepare_dependencies_and_pre_execution_scripts
label_desc: Use image node_id 40 for calling a global function with example usage: test_extend_spark_config_to_request(mock_upload_spark_files, mock_get_default_image, mocked_session) without return types