def METHOD_NAME(obj):
    nonlocal i
    if isinstance(obj, jt.Var):
        v = vars[i]
        i += 1
        return v
    if isinstance(obj, (int, float, bool, str, type(None))):
        return obj
    if isinstance(obj, (list, tuple)):
        return [ METHOD_NAME(v) for v in obj ]
    if isinstance(obj, dict):
        ret = { k:METHOD_NAME(v) for k, v in obj.items() }
        return obj.__class__(ret)
    raise ValueError(f"Unknown type {type(obj)}")