def flatten_dict(dic: dict, prefix="", sep=".") -> dict:
    """
    Flatten a nested dictionary into a flat dictionary with dotted namespace.
    """

    out = {}
    for k, v in dic.items():
        k = f"{prefix}{k}"
        if isinstance(v, dict):
            out.update(flatten_dict(v, f"{k}{sep}"))
        else:
            out[k] = v
    return out