def _fetch_and_unpack(url, need_dir=True, dir_name=None, revision=None,
                      safe_tar=False, tar_file_name=None):
    if url.startswith(("git", "svn", "hg", "cvs")):
        base = os.path.splitext(os.path.basename(url.split()[-1]))[0]
        if env.safe_exists(base):
            env.safe_sudo("rm -rf {0}".format(base))
        env.safe_run(url)
        if revision:
            if url.startswith("git"):
                env.safe_run("cd %s && git checkout %s" % (base, revision))
            else:
                raise ValueError("Need to implement revision retrieval for %s" * url.split()[0])
        return base
    else:
        # If tar_file_name is provided, use it instead of the inferred one
        tar_file, dir_name, tar_cmd = _get_expected_file(url, dir_name, safe_tar, tar_file_name=tar_file_name)
        tar_file = _remote_fetch(env, url, tar_file)
        env.safe_run("%s %s" % (tar_cmd, tar_file))
        return _safe_dir_name(dir_name, need_dir)
dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/custom/shared.py/_fetch_and_unpack/operator `%` -> `*`