def wrap_stateful_plan(*args):
    role = translation_plan.role
    state = args[(- 1)]
    if ((0 < len(role.state.state_placeholders) == len(state)) and isinstance(state, (list, tuple))):
        state_placeholders = tuple((role.placeholders[ph.id.value] for ph in role.state.state_placeholders))
        PlaceHolder.instantiate_placeholders(role.state.state_placeholders, state)
        PlaceHolder.instantiate_placeholders(state_placeholders, state)
    return translation_plan(*args[:(- 1)])
def wrap_stateful_plan(*args):
    role = translation_plan.role
    state = args[(- 1)]
    if ((0 < len(role.state.state_placeholders) == len(state)) and isinstance(state, (list, tuple))):
        state_placeholders = tuple((role.placeholders[ph.id.value] for ph in role.state.state_placeholders))
        PlaceHolder.instantiate_placeholders(role.state.state_placeholders, state)
        PlaceHolder.instantiate_placeholders(state_placeholders, state)
    return translation_plan(*args[:(- 1)])