<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def purview_state(self, direction):
 """The state of the purview when we are computing coefficients in ``direction``. For example, if we are computing the cause coefficient of a mechanism in ``after_state``, the direction is``CAUSE`` and the ``purview_state`` is ``before_state``. """

        return {
            Direction.CAUSE: self.before_state,
            Direction.EFFECT: self.after_state
        }[direction]