<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(unit_id, **kwargs):
 """ Returns a single unit """

    try:
        unit = db.DBSession.query(Unit).filter(Unit.id==unit_id).one()
        return JSONObject(unit)
    except NoResultFound:
        # The dimension does not exist
        raise ResourceNotFoundError("Unit %s not found"%(unit_id))