class_docstr: Downloader from AWS S3 buckets
      
class_docstr_tok: ["Downloader","from","AWS","S3","buckets"]
docstr: Parses s3:// url and returns bucket name, prefix, additional query elements
  as a dict (such as VersionId)
docstr_tok: ["Parses","s3",":","\/\/","url","and","returns","bucket","name",",","prefix",",","additional","query","elements","as","a","dict","(","such","as","VersionId",")"]
code: def _parse_url(cls, url, bucket_only=False):
      """Parses s3:// url and returns bucket name, prefix, additional query elements
      as a dict (such as VersionId)"""
      rec = urlsplit(url)
      if bucket_only:
          return rec.netloc
      assert rec.scheme == "s3"
      # We are often working with urlencoded URLs so we could safely interact
      # with git-annex via its text based protocol etc.  So, if URL looks like
      # it was urlencoded the filepath, we should revert back to an original key
      # name.  Since we did not demarcate whether it was urlencoded, we will do
      # magical check, which would fail if someone had % followed by two digits
      filepath = rec.path.lstrip("/")
      if re.search("%[0-9a-fA-F]{2}", filepath):
          lgr.debug("URL unquoting S3 URL filepath %s", filepath)
          filepath = urlunquote(filepath)
      # TODO: needs replacement to ensure_ since it doesn't
      # deal with non key=value
      return (
          rec.netloc,
          filepath,
          ensure_dict_from_str(rec.query, sep="&") or {},
      )
  
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 4 for calling the S3Downloader obj's underlying member method code with example usage: obj._parse_url(cls, url, bucket_only) and returns: rec,  filepath,  unknown, rec