def METHOD_NAME(d, prefix="", separator="."):
    r = {}
    for k, v in d.items():
        key = separator.join([prefix, k]) if prefix else k
        if type(v) == dict:
            r.update(METHOD_NAME(v, prefix=key))
        else:
            r[key] = v
    return r