<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_accounts_from_institute(accounts_query, institute):
 """ Remove accounts from institute. """


    query = accounts_query.filter(date_deleted__isnull=True)

    for account in query:
        remove_account_from_institute(account, institute)