class_docstr: Downloader from AWS S3 buckets
      
class_docstr_tok: ["Downloader","from","AWS","S3","buckets"]
code: def get_downloader_session(self, url, **kwargs):
      bucket_name, url_filepath, params = self._parse_url(url)
      if params:
          newkeys = set(params.keys()) - {"versionId"}
          if newkeys:
              raise NotImplementedError(
                  "Did not implement support for %s" % newkeys
              )
      assert self._bucket.name == bucket_name  # must be the same
  
      self._check_credential()
      try:
          key = try_multiple_dec_s3(self._get_key)(
              url_filepath, version_id=params.get("versionId", None)
          )
      except S3ResponseError as e:
          raise TargetFileAbsent(
              "S3 refused to provide the key for %s from url %s"
              % (url_filepath, url)
          ) from e
      if key is None:
          raise TargetFileAbsent(
              "No key returned for %s from url %s" % (url_filepath, url)
          )
  
      target_size = key.size  # S3 specific
      headers = {
          "Content-Length": key.size,
          "Content-Disposition": key.name,
      }
  
      if key.last_modified:
          headers["Last-Modified"] = rfc2822_to_epoch(key.last_modified)
  
      # Consult about filename
      url_filename = get_url_straight_filename(url)
  
      if "versionId" not in params and key.version_id:
          # boto adds version_id to the request if it is known present.
          # It is a good idea in general to avoid race between moment of retrieving
          # the key information and actual download.
          # But depending on permissions, we might be unable (like in the case with NDA)
          # to download a guaranteed version of the key.
          # So we will just download the latest version (if still there)
          # if no versionId was specified in URL
          # Alternative would be to make this a generator and generate sessions
          # but also remember if the first download succeeded so we do not try
          # again to get versioned one first.
          key.version_id = None
          # TODO: ask NDA to allow download of specific versionId?
  
      return S3DownloaderSession(
          size=target_size,
          filename=url_filename,
          url=url,
          headers=headers,
          key=key,
      )
  
imports: import re
  from urllib.parse import urlsplit, unquote
  from ..utils import auto_repr, ensure_dict_from_str
  from ..dochelpers import borrowkwargs
  from ..support.network import get_url_straight_filename, iso8601_to_epoch, rfc2822_to_epoch
  from .base import Authenticator
  from .base import BaseDownloader, DownloaderSession
  from ..support.exceptions import AccessPermissionExpiredError, CapturedException, TargetFileAbsent
  from ..support.s3 import Key, OrdinaryCallingFormat, S3ResponseError, boto, get_bucket, try_multiple_dec_s3
  from ..support.status import FileStatus
  import logging
  from logging import getLogger
label_desc: Use image node_id 9 for calling the S3Downloader obj's underlying member method code with example usage: obj.get_downloader_session(url) and returns: S3DownloaderSession