code: def sagemaker_session():
      boto_mock = Mock(name="boto_session", region_name=REGION)
      sms = Mock(
          name="sagemaker_session",
          boto_session=boto_mock,
          region_name=REGION,
          config=None,
          local_mode=False,
          settings=SessionSettings(),
          default_bucket_prefix=None,
      )
      sms.boto_region_name = REGION
      sms.default_bucket = Mock(
          name="default_bucket", return_value=BUCKET_NAME
      )
      returned_job_description = {
          "AlgorithmSpecification": {
              "TrainingInputMode": "File",
              "TrainingImage": image_uris.retrieve("pca", "us-west-2"),
          },
          "ModelArtifacts": {
              "S3ModelArtifacts": "s3://some-bucket/model.tar.gz"
          },
          "HyperParameters": {
              "sagemaker_submit_directory": '"s3://some/sourcedir.tar.gz"',
              "checkpoint_path": '"s3://other/1508872349"',
              "sagemaker_program": '"iris-dnn-classifier.py"',
              "sagemaker_container_log_level": '"logging.INFO"',
              "sagemaker_job_name": '"neo"',
              "training_steps": "100",
          },
          "RoleArn": "arn:aws:iam::366:role/IMRole",
          "ResourceConfig": {
              "VolumeSizeInGB": 30,
              "InstanceCount": 1,
              "InstanceType": "ml.c4.xlarge",
          },
          "StoppingCondition": {"MaxRuntimeInSeconds": 24 * 60 * 60},
          "TrainingJobName": "neo",
          "TrainingJobStatus": "Completed",
          "OutputDataConfig": {
              "KmsKeyId": "",
              "S3OutputPath": "s3://place/output/neo",
          },
          "TrainingJobOutput": {
              "S3TrainingJobOutput": "s3://here/output.tar.gz"
          },
      }
      sms.sagemaker_client.describe_training_job = Mock(
          name="describe_training_job",
          return_value=returned_job_description,
      )
      # For tests which doesn't verify config file injection, operate with empty config
      sms.sagemaker_config = {}
      return sms
  
imports: from __future__ import absolute_import
  import numpy
  import pytest
  from mock import ANY, Mock, patch, call
  from sagemaker import image_uris
  from sagemaker.amazon.pca import PCA
  from sagemaker.amazon.amazon_estimator import upload_numpy_to_s3_shards, _build_shards, FileSystemRecordSet
  from sagemaker.session_settings import SessionSettings
  from tests.unit import DEFAULT_S3_OBJECT_KEY_PREFIX_NAME, DEFAULT_S3_BUCKET_NAME, _test_default_bucket_and_prefix_combinations
label_desc: Use image node_id 1 for calling a global function with example usage: sagemaker_session() and returns: sms