def METHOD_NAME(directories, ext):
    """Locate files in the directories with the given extension."""
    out = set()
    for location in directories:
        for filename in mooseutils.git_ls_files(os.path.join(MooseDocs.ROOT_DIR, location)):
            if filename.endswith(ext) and not os.path.islink(filename):
                out.add(filename)
    return out