code: def test_partition_default_bucket_and_prefix_combinations(
      _create_estimator,
      tar_and_upload_dir,
      _get_model_config_properties_from_s3,
      model_code_key_prefix,
      code_location,
      expected__without_user_input__with_default_bucket_and_default_prefix,
      expected__without_user_input__with_default_bucket_only,
      expected__with_user_input__with_default_bucket_and_prefix,
      expected__with_user_input__with_default_bucket_only,
  ):
      # Skip appending of timestamps that this normally does
      model_code_key_prefix.side_effect = lambda a, b, c: s3_path_join(
          a, b, c
      )
  
      def with_user_input(sess):
          model = DeepSpeedModel(
              VALID_UNCOMPRESSED_MODEL_DATA,
              ROLE,
              sagemaker_session=sess,
              data_type="fp16",
              container_log_level=logging.DEBUG,
              env=ENV,
              code_location=code_location,
              image_uri="image_uri",
          )
          model.partition(
              GPU_INSTANCE,
              s3_output_uri="s3://test-bucket/test-prefix/test-prefix-2",
          )
          kwargs = _create_estimator.call_args.kwargs
          return kwargs["s3_output_uri"]
  
      def without_user_input(sess):
          model = DeepSpeedModel(
              VALID_UNCOMPRESSED_MODEL_DATA,
              ROLE,
              sagemaker_session=sess,
              data_type="fp16",
              container_log_level=logging.DEBUG,
              env=ENV,
              code_location=code_location,
              image_uri="image_uri",
          )
          model.partition(GPU_INSTANCE)
          kwargs = _create_estimator.call_args.kwargs
          return kwargs["s3_output_uri"]
  
      actual, expected = _test_default_bucket_and_prefix_combinations(
          function_with_user_input=with_user_input,
          function_without_user_input=without_user_input,
          expected__without_user_input__with_default_bucket_and_default_prefix=(
              expected__without_user_input__with_default_bucket_and_default_prefix
          ),
          expected__without_user_input__with_default_bucket_only=expected__without_user_input__with_default_bucket_only,
          expected__with_user_input__with_default_bucket_and_prefix=(
              expected__with_user_input__with_default_bucket_and_prefix
          ),
          expected__with_user_input__with_default_bucket_only=expected__with_user_input__with_default_bucket_only,
      )
      assert actual == expected
  
imports: from __future__ import absolute_import
  import logging
  import json
  from json import JSONDecodeError
  import pytest
  from mock import Mock, MagicMock
  from mock import patch, mock_open
  from sagemaker.djl_inference import defaults, DJLModel, DJLPredictor, HuggingFaceAccelerateModel, DeepSpeedModel
  from sagemaker.djl_inference.model import DJLServingEngineEntryPointDefaults
  from sagemaker.s3_utils import s3_path_join
  from sagemaker.session_settings import SessionSettings
  from tests.unit import _test_default_bucket_and_prefix_combinations, DEFAULT_S3_BUCKET_NAME, DEFAULT_S3_OBJECT_KEY_PREFIX_NAME
label_desc: Use image node_id 17 for calling a global function with example usage: test_partition_default_bucket_and_prefix_combinations(_create_estimator, tar_and_upload_dir, _get_model_config_properties_from_s3, model_code_key_prefix, code_location, expected__without_user_input__with_default_bucket_and_default_prefix, expected__without_user_input__with_default_bucket_only, expected__with_user_input__with_default_bucket_and_prefix, expected__with_user_input__with_default_bucket_only) and returns: kwargs, kwargs