class_docstr: Base class for the downloaders
class_docstr_tok: ["Base","class","for","the","downloaders"]
docstr: Fetch content as pointed by the URL optionally into a file
  
  Parameters
  ----------
  url : string
    URL to access
  path : string, optional
    Filename or existing directory to store downloaded content under.
    If not provided -- deduced from the url
  
  Returns
  -------
  string
    file path
docstr_tok: ["Fetch","content","as","pointed","by","the","URL","optionally","into","a","file","Parameters","--","--","--","--","--","url",":","string","URL","to","access","path",":","string",",","optional","Filename","or","existing","directory","to","store","downloaded","content","under",".","If","not","provided","--","deduced","from","the","url","Returns","--","--","--","-","string","file","path"]
code: def download(self, url, path=None, **kwargs):
      """Fetch content as pointed by the URL optionally into a file
  
      Parameters
      ----------
      url : string
        URL to access
      path : string, optional
        Filename or existing directory to store downloaded content under.
        If not provided -- deduced from the url
  
      Returns
      -------
      string
        file path
      """
      # TODO: may be move all the path dealing logic here
      # but then it might require sending request anyways for Content-Disposition
      # so probably nah
      lgr.info("Downloading %r into %r", url, path)
      return self.access(self._download, url, path=path, **kwargs)
  
imports: import msgpack
  import os
  import sys
  import time
  from abc import ABCMeta, abstractmethod
  import os.path
  from os.path import exists, join, isdir
  from ..None import cfg
  from ..ui import ui
  from ..utils import auto_repr, ensure_unicode, unlink
  from .credentials import CompositeCredential
  from datalad.downloaders import CREDENTIAL_TYPES
  from ..support.exceptions import AccessDeniedError, AccessPermissionExpiredError, AnonymousAccessDeniedError, CapturedException, DownloadError, IncompleteDownloadError, UnaccountedDownloadError
  from ..support.locking import InterProcessLock, try_lock, try_lock_informatively
  from logging import getLogger
label_desc: Use image node_id 10 for calling the BaseDownloader obj's underlying member method code with example usage: obj.download(url, path) and returns: self