def METHOD_NAME(cfg, include_defaults):
    if "DEFAULT" not in cfg:
        return cfg
    defaults = cfg["DEFAULT"]
    not_defaults = cfg[~eq("DEFAULT")]
    for c in not_defaults:
        for d in defaults.grandchildren:
            if d.name not in c:
                c.children.append(d)
    if not include_defaults:
        cfg.children = list(not_defaults)
    return cfg