<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_perm(perm_id,**kwargs):
 """ Get all permissions """


    try:
        perm = db.DBSession.query(Perm).filter(Perm.id==perm_id).one()
        return perm
    except NoResultFound:
        raise ResourceNotFoundError("Permission not found (perm_id={})".format(perm_id))