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))
Returns a single unit by abbreviation. Used as utility function to resolve string to id