<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_(self, state):
 """Set new state for machine."""

    if not self.can_be_(state):
        state = self._meta['translator'].translate(state)
        raise TransitionError(
            "Cannot transit from '{actual_value}' to '{value}'."
            .format(actual_value=self.actual_state.value, value=state.value)
        )

    self.force_set(state)