<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(self, name: str = None, acc_type: str = None):
 """ Search accounts by passing parameters. name = exact name name_part = part of name parent_id = id of the parent account type = account type """

        query = self.query

        if name is not None:
            query = query.filter(Account.name == name)

        if acc_type is not None:
            # account type is capitalized
            acc_type = acc_type.upper()
            query = query.filter(Account.type == acc_type)

        return query.all()