<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_state_by_X(self, x, xtyp):
 """ Find the state value by providing the x value. Will raise an exception if the x value is absent from the state data base. :param x: The x value :return: The state value """

        _state = self.state_db.get(KEY_PATTERN[xtyp].format(x))
        if _state:
            return _state
        else:
            raise KeyError('Unknown {}: "{}"'.format(xtyp, x))