def flatten_dict(value):
    result = {}
    for key, val in value.items():
        if isinstance(val, dict) and val:
            for sub_key, sub_val in flatten_dict(val).items():
                result[f"{key}.{sub_key}"] = sub_val
        else:
            result[key] = val
    return result
