<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def release(self, session):
 """Release a machine session resource."""

        if session.state != SessionState.locked:
            return
        with self._lock():
            return self._power_down(session)