def replace__from___to__from(d: dict):
    """Replace recursive keys in the object from_ to from."""
    res = {}
    if not isinstance(d, (dict, list)):
        return d
    if isinstance(d, list):
        return [replace__from___to__from(v) for v in d]

    for key, value in d.items():
        if key == 'from_':
            res['from'] = replace__from___to__from(d['from_'])
        else:
            res[key] = replace__from___to__from(d[key])
    return res