def __init__(self, url, path=None, headers=None, session=None,<EOL>show_progress=True, resume=True, auto_retry=True,<EOL>max_rst_retries=<NUM_LIT:5>, pass_through_opts=None, cainfo=None,<EOL>user_agent=None, auth=None):
self.url = url  <EOL>self.path = self._get_path(path, url)<EOL>self.headers = headers<EOL>self.session = session<EOL>self.show_progress = show_progress<EOL>self.resume = resume<EOL>self.auto_retry = auto_retry<EOL>self.max_rst_retries = max_rst_retries<EOL>self.cainfo = cainfo<EOL>self.start_time = None<EOL>self.content_length = None<EOL>self.downloaded = <NUM_LIT:0><EOL>self.auth = None<EOL>if session:<EOL><INDENT>self.auth = session.auth<EOL><DEDENT>if auth:<EOL><INDENT>self.auth = auth<EOL><DEDENT>self._path = path  <EOL>self._pycurl = pycurl.Curl()<EOL>self._cookie_header = self._get_cookie_header()<EOL>self._last_time = <NUM_LIT:0.0><EOL>self._rst_retries = <NUM_LIT:0><EOL>self._pass_through_opts = pass_through_opts<EOL>self._user_agent = user_agent or '<STR_LIT>' + __version__<EOL>
:param str url: URL of the file to be downloaded
:param str path: local path for the downloaded file; if None, it will
    be the URL base name
:param dict headers: extra headers
:param session: session used to download (if you want to work with
    requests library)
:type session: `class:requests.Session`
:param bool show_progress: whether to show download progress
:param bool resume: whether to resume download (by
    filename)
:param bool auto_retry: whether to retry automatically upon closed
    transfer until the file's download is finished
:param int max_rst_retries: number of retries upon connection reset by
    peer (effective only when `auto_retry` is True)
:param dict pass_through_opts: a dictionary of options passed to cURL
:param str cainfo: optional path to a PEM file containing the CA
    certificate
:param str user_agent: set a custom user agent string
:param tuple auth: a tuple of username and password for authentication