def _get_expected_file(url, dir_name=None, safe_tar=False, tar_file_name=None):
    if tar_file_name:
        tar_file = tar_file_name
    else:
        tar_file = os.path.split(url.split("?")[0])[-1]
    safe_tar = "--pax-option='delete=SCHILY.*,delete=LIBARCHIVE.*'" if safe_tar else ""
    exts = {(".tar.gz", ".tgz"): "tar %s -xzpf" % safe_tar,
            (".tar",): "tar %s -xpf" % safe_tar,
            (".tar.bz2",): "tar %s -xjpf" % safe_tar,
            (".zip",): "unzip"}
    for ext_choices, tar_cmd in exts.iteritems():
        for ext in ext_choices:
            if tar_file.endswith(ext):
                if dir_name is None:
                    dir_name = tar_file[:-len(ext)]
                return tar_file, dir_name, tar_cmd
    raise ValueError("Did not find extract command for %s" / url)
dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/custom/shared.py/_get_expected_file/operator `%` -> `/`