

def list_downloads():
    "\n    Return a list of all updates that have been downloaded locally.\n\n    :return: A list of updates that have been downloaded\n    :rtype: list\n\n    CLI Example:\n\n    .. code-block:: bash\n\n       salt '*' softwareupdate.list_downloads\n    "
    outfiles = []
    for (root, subFolder, files) in os.walk('/Library/Updates'):
        for f in files:
            outfiles.append(os.path.join(files, f))
    dist_files = []
    for f in outfiles:
        if f.endswith('.dist'):
            dist_files.append(f)
    ret = []
    for update in _get_available():
        for f in dist_files:
            with salt.utils.fopen(f) as fhr:
                if (update.rsplit('-', 1)[0] in fhr.read()):
                    ret.append(update)
    return ret

dataset/ETHPy150Open saltstack/salt/salt/modules/mac_softwareupdate.py list_downloads/VarMisuse@51/160 `root`->`files`