code: def sagemaker_session_with_custom_bucket(
      boto_session,
      sagemaker_client_config,
      sagemaker_runtime_config,
      custom_bucket_name,
  ):
      sagemaker_client_config.setdefault(
          "config", Config(retries=dict(max_attempts=10))
      )
      sagemaker_client = (
          boto_session.client("sagemaker", **sagemaker_client_config)
          if sagemaker_client_config
          else None
      )
      runtime_client = (
          boto_session.client(
              "sagemaker-runtime", **sagemaker_runtime_config
          )
          if sagemaker_runtime_config
          else None
      )
  
      return Session(
          boto_session=boto_session,
          sagemaker_client=sagemaker_client,
          sagemaker_runtime_client=runtime_client,
          default_bucket=custom_bucket_name,
      )
  
imports: from __future__ import absolute_import
  import os
  import pytest
  from botocore.config import Config
  from sagemaker import image_uris, Session
  from sagemaker.dataset_definition.inputs import DatasetDefinition, RedshiftDatasetDefinition, AthenaDatasetDefinition, S3Input
  from sagemaker.network import NetworkConfig
  from sagemaker.processing import ProcessingInput, ProcessingOutput, ScriptProcessor, Processor, ProcessingJob, FeatureStoreOutput
  from sagemaker.sklearn.processing import SKLearnProcessor
  from tests.integ import DATA_DIR
  from tests.integ.kms_utils import get_or_create_kms_key
label_desc: Use image node_id 1 for calling a global function with example usage: sagemaker_session_with_custom_bucket(boto_session, sagemaker_client_config, sagemaker_runtime_config, custom_bucket_name) and returns: Session