def METHOD_NAME(config: dict, spec: dict) -> dict:
    flat = {}
    for conf_1 in config:
        if isinstance(config[conf_1], dict):
            key = f"{conf_1}/"
            if key in spec and spec[key].type != "group":
                flat[f'{conf_1}/{""}'] = config[conf_1]
            else:
                for conf_2 in config[conf_1]:
                    flat[f"{conf_1}/{conf_2}"] = config[conf_1][conf_2]
        else:
            flat[f'{conf_1}/{""}'] = config[conf_1]
    return flat