<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def search_mappings(kb, key=None, value=None, match_type=None, sortby=None, page=None, per_page=None):
 """Search tags for knowledge."""

        if kb.kbtype == models.KnwKB.KNWKB_TYPES['written_as']:
            return pagination.RestfulSQLAlchemyPagination(
                api.query_kb_mappings(
                    kbid=kb.id,
                    key=key or '',
                    value=value or '',
                    match_type=match_type or 's',
                    sortby=sortby or 'to',
                ), page=page or 1, per_page=per_page or 10
            ).items
        return []