def METHOD_NAME(
    self, accounts: list[UserInfo], username_is_email=False, expected_existing=None
):
    if expected_existing is None:
        expected_existing = []
    csv_path = self.write_test_csv(accounts)
    _, existing = import_accounts_impl(csv_path, "testpass")
    self.assertEqual(set(expected_existing), {u.name for u in existing})
    for a in accounts:
        if a.email:
            u = User.get_by_email(a.email)
            expected_email = a.email
        else:
            u = User.get_by_name(a.username)
            expected_email = None
        self.assertEqual(a.full_name, u.real_name)
        self.assertEqual(expected_email, u.email)
        if username_is_email:
            self.assertEqual(a.email, u.name)
        else:
            self.assertEqual(a.username, u.name)