<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_unit_by_abbreviation(unit_abbreviation, **kwargs):
 """ Returns a single unit by abbreviation. Used as utility function to resolve string to id """

    try:
        if unit_abbreviation is None:
            unit_abbreviation = ''
        unit_i = db.DBSession.query(Unit).filter(Unit.abbreviation==unit_abbreviation.strip()).one()
        return JSONObject(unit_i)
    except NoResultFound:
        # The dimension does not exist
        raise ResourceNotFoundError("Unit '%s' not found"%(unit_abbreviation))