code: def _get_sagemaker_session(region):
      """Get sagemaker session for interacting with AWS or Sagemaker services"""
      boto_session = boto3.session.Session(region_name=region)
      return Session(boto_session=boto_session)
  
file_path: sagemaker-python-sdk/src/sagemaker/remote_function/invoke_function.py
imports: from __future__ import absolute_import
  import argparse
  import sys
  import json
  import os
  from typing import TYPE_CHECKING
  import boto3
  from sagemaker.remote_function.job import KEY_EXPERIMENT_NAME, KEY_RUN_NAME
  from sagemaker.session import Session
  from sagemaker.s3 import s3_path_join
  from sagemaker.remote_function.errors import handle_error
  from sagemaker.remote_function import logging_config
  from sagemaker.remote_function.core.pipeline_variables import Context
label_desc: Use image node_id 2 for calling a global function with example usage: _get_sagemaker_session(region) and returns: Session