'Downloads a file specified
:param url: Source URL
:param filename: Target file on filesystem
:return: True on success, False on failure'

def download(self, url, filename, **kwargs):

    try:
        r = self.get(url, timeout=10, stream=True, **kwargs)
        if (r.status_code >= 400):
            return False
        with io.open(filename, u'wb') as f:
            for chunk in r.iter_content(chunk_size=1024):
                if chunk:
                    f.write(chunk)
        chmodAsParent(filename)
    except Exception:
        remove_file_failed(filename)
        return False
    return True
