def download(self, directory):
    '\n        Downloads the file.\n\n        :param directory: the directory to download the file to.  This must exist.\n        :return: the path to the downloaded file.\n        '
    rsp = self.session.get(('/files/%s' % self.id), stream=True)
    filename = self.filename_regex.search(rsp.headers['content-disposition']).group(1)
    path = os.path.join(directory, filename)
    with open(path, 'wb') as f:
        for block in rsp.iter_content(1024):
            if (not block):
                break
            f.write(block)
    return path
Downloads the file.

:param directory: the directory to download the file to.  This must exist.
:return: the path to the downloaded file.
def download(self, directory):
    '\n        Downloads the file.\n\n        :param directory: the directory to download the file to.  This must exist.\n        :return: the path to the downloaded file.\n        '
    rsp = self.session.get(('/files/%s' % self.id), stream=True)
    filename = self.filename_regex.search(rsp.headers['content-disposition']).group(1)
    path = os.path.join(directory, filename)
    with open(path, 'wb') as f:
        for block in rsp.iter_content(1024):
            if (not block):
                break
            f.write(block)
    return path