code: def remove_accounts_from_institute(accounts_query, institute):
      
  
      query = accounts_query.filter(date_deleted__isnull=True)
  
      for account in query:
          remove_account_from_institute(account, institute)
docs: Remove accounts from institute.