def get_modules_for_includes(included_files, include_file_index):
    """ given a set of included files return the set of modules that
        contain these files, as well as the set of include files which
        were not found in any module """
    included_modules = set()
    unknown_includes = set()
    for included_file in included_files:
        mods = include_file_index.get_modules_containing(included_file)
        if len(mods) > 1:
            print("WARNING: {} is present in multiple modules: {}".format(
                  included_file, mods))
        if len(mods) == 0:
            unknown_includes.add(included_file)
        included_modules = included_modules.union(mods)
    return (included_modules, unknown_includes)