class_docstr: A SageMaker ``Session`` class for Local Mode.
  
  This class provides alternative Local Mode implementations for the functionality of
  :class:`~sagemaker.session.Session`.
class_docstr_tok: ["A","SageMaker","``","Session","``","class","for","Local","Mode",".","This","class","provides","alternative","Local","Mode","implementations","for","the","functionality","of",":","class",":","`","~sagemaker.session.Session","`","."]
docstr: Initialize this Local SageMaker Session.
  
  Args:
    boto_session:
    sagemaker_client:
    sagemaker_runtime_client:
    kwargs:
  
  Returns:
code: def _initialize(
      self,
      boto_session,
      sagemaker_client,
      sagemaker_runtime_client,
      **kwargs,
  ):  # pylint: disable=unused-argument
      """Initialize this Local SageMaker Session.
  
      Args:
        boto_session:
        sagemaker_client:
        sagemaker_runtime_client:
        kwargs:
  
      Returns:
  
      """
  
      if boto_session is None:
          self.boto_session = boto3.Session()
      else:
          self.boto_session = boto_session
  
      self._region_name = self.boto_session.region_name
  
      if self._region_name is None:
          raise ValueError(
              "Must setup local AWS configuration with a region supported by SageMaker."
          )
  
      self.sagemaker_client = LocalSagemakerClient(self)
      self.sagemaker_runtime_client = LocalSagemakerRuntimeClient(
          self.config
      )
  
      self.local_mode = True
      sagemaker_config = kwargs.get("sagemaker_config", None)
      if sagemaker_config:
          validate_sagemaker_config(sagemaker_config)
  
      if self.s3_endpoint_url is not None:
          self.s3_resource = boto_session.resource(
              "s3", endpoint_url=self.s3_endpoint_url
          )
          self.s3_client = boto_session.client(
              "s3", endpoint_url=self.s3_endpoint_url
          )
          self.sagemaker_config = (
              sagemaker_config
              if sagemaker_config
              else load_sagemaker_config(s3_resource=self.s3_resource)
          )
      else:
          self.s3_resource = self.boto_session.resource(
              "s3", region_name=self._region_name
          )
          self.s3_client = self.boto_session.client(
              "s3", region_name=self._region_name
          )
          self.sagemaker_config = (
              sagemaker_config
              if sagemaker_config
              else load_sagemaker_config()
          )
  
      sagemaker_config = kwargs.get("sagemaker_config", None)
      if sagemaker_config:
          validate_sagemaker_config(sagemaker_config)
          self.sagemaker_config = sagemaker_config
      else:
          # self.s3_resource might be None. If it is None, load_sagemaker_config will
          # create a default S3 resource, but only if it needs to fetch from S3
          self.sagemaker_config = load_sagemaker_config(
              s3_resource=self.s3_resource
          )
  
      # after sagemaker_config initialization, update self._default_bucket_name_override if needed
      self._default_bucket_name_override = resolve_value_from_config(
          direct_input=self._default_bucket_name_override,
          config_path=SESSION_DEFAULT_S3_BUCKET_PATH,
          sagemaker_session=self,
      )
      # after sagemaker_config initialization, update self.default_bucket_prefix if needed
      self.default_bucket_prefix = resolve_value_from_config(
          direct_input=self.default_bucket_prefix,
          config_path=SESSION_DEFAULT_S3_OBJECT_KEY_PREFIX_PATH,
          sagemaker_session=self,
      )
  
      self.config = load_local_mode_config()
      if (
          self._disable_local_code
          and self.config
          and "local" in self.config
      ):
          self.config["local"]["local_code"] = False
  
imports: from __future__ import absolute_import, annotations
  import logging
  import platform
  from datetime import datetime
  from typing import Dict
  import boto3
  from botocore.exceptions import ClientError
  import jsonschema
  from sagemaker.config import SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA, SESSION_DEFAULT_S3_BUCKET_PATH, SESSION_DEFAULT_S3_OBJECT_KEY_PREFIX_PATH, load_local_mode_config, load_sagemaker_config, validate_sagemaker_config
  from sagemaker.local.image import _SageMakerContainer
  from sagemaker.local.utils import get_docker_host
  from sagemaker.local.entities import _LocalEndpointConfig, _LocalEndpoint, _LocalModel, _LocalProcessingJob, _LocalTrainingJob, _LocalTransformJob, _LocalPipeline
  from sagemaker.session import Session
  from sagemaker.utils import get_config_value, _module_import_error, resolve_value_from_config, format_tags
label_desc: Use image node_id 2 for calling the LocalSession obj's underlying member method code with example usage: obj._initialize(boto_session, sagemaker_client, sagemaker_runtime_client) without return types