<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_templatetype(type_id,**kwargs):
 """ Get a specific resource type by ID. """


    templatetype = db.DBSession.query(TemplateType).filter(
                        TemplateType.id==type_id).options(
                        joinedload_all("typeattrs")).one()

    return templatetype