class_docstr: Static class for storing and retrieving S3 payload artifacts.
class_docstr_tok: ["Static","class","for","storing","and","retrieving","S3","payload","artifacts","."]
docstr: Returns S3 object located at the bucket and key.
  
  Raises:
      ValueError: The object size is too large.
docstr_tok: ["Returns","S3","object","located","at","the","bucket","and","key",".","Raises",":","ValueError",":","The","object","size","is","too","large","."]
code: def get_object(
      bucket: str,
      key: str,
      region: str = JUMPSTART_DEFAULT_REGION_NAME,
      s3_client: Optional[boto3.client] = None,
  ) -> bytes:
      """Returns S3 object located at the bucket and key.
  
      Raises:
          ValueError: The object size is too large.
      """
      if s3_client is None:
          s3_client = JumpStartS3PayloadAccessor._get_default_s3_client(
              region
          )
  
      object_size_bytes = (
          JumpStartS3PayloadAccessor._get_object_size_bytes(
              bucket=bucket, key=key, region=region, s3_client=s3_client
          )
      )
      if (
          object_size_bytes
          > JumpStartS3PayloadAccessor.MAX_PAYLOAD_SIZE_BYTES
      ):
          raise ValueError(
              f"s3://{bucket}/{key} has size of {object_size_bytes} bytes, "
              "which exceeds maximum allowed size of "
              f"{JumpStartS3PayloadAccessor.MAX_PAYLOAD_SIZE_BYTES} bytes."
          )
  
      return s3_client.get_object(Bucket=bucket, Key=key)["Body"].read()
  
imports: from __future__ import absolute_import
  import functools
  from typing import Any, Dict, List, Optional
  import boto3
  from sagemaker.deprecations import deprecated
  from sagemaker.jumpstart.types import JumpStartModelHeader, JumpStartModelSpecs
  from sagemaker.jumpstart import cache
  from sagemaker.jumpstart.constants import JUMPSTART_DEFAULT_REGION_NAME
label_desc: Use image node_id 5 for calling the JumpStartS3PayloadAccessor obj's underlying member method code with example usage: obj.get_object(bucket, key, region, s3_client) and returns: s3_client