<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _one(self, query):
 """Gets one row from the query. Raises NotFoundError if there isn't a row or if there are multiple rows"""

        try:
            result = query.one()
            if result.has_expired(self._expirations):
                raise NotFoundError
            return result
        except (NoResultFound, MultipleResultsFound):
            raise NotFoundError