<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def state(self):
 """Get the Document's state"""

        state = self._resource.get('state', self.default_state)

        if state in State:
            return state
        else:
            return getattr(State, state)