class_docstr: Downloader from AWS S3 buckets
      
class_docstr_tok: ["Downloader","from","AWS","S3","buckets"]
code: def _get_key(self, key_name, version_id=None, headers=None):
      try:
          return self._bucket.get_key(
              key_name, version_id=version_id, headers=headers
          )
      except S3ResponseError as e:
          if e.status != 400:
              raise  # we will not deal with those here
          # e.g. 400 Bad request could happen due to timed out key.
          # Since likely things went bad if credential expired, just raise general
          # AccessDeniedError. Logic upstream should retry
          self._check_credential()
          ce1 = CapturedException(e)
          lgr.debug(
              "bucket.get_key (HEAD) failed with %s, trying GET request now",
              ce1,
          )
          try:
              return self._get_key_via_get(
                  key_name, version_id=version_id, headers=headers
              )
          except S3ResponseError:
              # propagate S3 exceptions since they actually can provide the reason why we failed!
              raise
          except Exception as e2:
              ce2 = CapturedException(e2)
              lgr.debug(
                  "We failed to get a key via HEAD due to %s and then via partial GET due to %s",
                  ce1,
                  ce2,
              )
              # reraise original one
              raise e
  
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 7 for calling the S3Downloader obj's underlying member method code with example usage: obj._get_key(key_name, version_id, headers) and returns: self, self