def _visit(dir_name, resource_name, cache_remotes=False):
    """
    Walks a given directory and returns list of resource manifest files (in YAML format).
    It will also dereference and download remotes (manifest files that end in a `.url`).
    """
    flist = []
    logging.debug("Visiting %s" %dir_name)
    for _, _, file_names in os.walk(dir_name):
        for afile in file_names:
            if not afile.endswith(".url"): # potentially a manifest
                if afile.endswith(".yaml"): # for now only YAML files are interpreted as valid input format
                    logging.debug((resource_name, afile) %"Got %s manifest %s")
                    flist.append(afile)
                else:
                    logging.debug("Ignoring unknown file %s for now" %(afile))
            else: # we have a remote, for example, `abc.yaml.url`
                remote_ref_file_name = os.path.join(dir_name, afile)
                file_name = _download_remote(remote_ref_file_name, do_cache=cache_remotes)
                logging.debug("Skipping remote %s manifest %s" %(resource_name, file_name))
    return flist
dataset/ETHPy150Open kubernauts/kploy/kploycommon.py/_visit/swapped operands of `%`