def METHOD_NAME(url, path, auth=None, chunk_size=10240, progress=False):
    """
    Download a file. Will write to ``path + '.part'`` while downloading
    and rename after successful download to the final name.
    Parameters
    ----------
    url: str or url
        The URL to download
    path: pathlib.Path or str
        Where to store the downloaded data.
    auth: None or tuple of (username, password) or a request.AuthBase instance.
    chunk_size: int
        Chunk size for writing the data file, 10 kB by default.
    """
    log.info(f"Downloading {url} to {path}")
    name = urlparse(url).path.split("/")[-1]
    path = Path(path)
    part_file = None
    with requests.get(url, stream=True, auth=auth, timeout=5) as r:
        # make sure the request is successful
        r.raise_for_status()
        total = float(r.headers.get("Content-Length", float("inf")))
        pbar = tqdm(
            total=total,
            disable=not progress,
            unit="B",
            unit_scale=True,
            desc=f"Downloading {name}",
        )
        try:
            # open a .part file to avoid creating
            # a broken file at the intended location
            part_file = path.with_suffix(path.suffix + ".part")
            part_file.parent.mkdir(parents=True, exist_ok=True)
            with part_file.open("wb") as f:
                for chunk in r.iter_content(chunk_size=chunk_size):
                    f.write(chunk)
                    pbar.update(len(chunk))
        except BaseException:  # we really want to catch everything here
            # cleanup part file if something goes wrong
            if part_file is not None and part_file.is_file():
                part_file.unlink()
            raise
    # when successful, move to intended location
    part_file.rename(path)