<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_pool(self, pool, match=None):
 """ Adds a new account pool. If the given match argument is None, the pool the default pool. Otherwise, the match argument is a callback function that is invoked to decide whether or not the given pool should be used for a host. When Exscript logs into a host, the account is chosen in the following order: # Exscript checks whether an account was attached to the :class:`Host` object using :class:`Host.set_account()`), and uses that. # If the :class:`Host` has no account attached, Exscript walks through all pools that were passed to :class:`Queue.add_account_pool()`. For each pool, it passes the :class:`Host` to the function in the given match argument. If the return value is True, the account pool is used to acquire an account. (Accounts within each pool are taken in a round-robin fashion.) # If no matching account pool is found, an account is taken from the default account pool. # Finally, if all that fails and the default account pool contains no accounts, an error is raised. Example usage:: def do_nothing(conn):
 conn.autoinit() def use_this_pool(host):
 return host.get_name().startswith('foo') default_pool = AccountPool() default_pool.add_account(Account('default-user', 'password')) other_pool = AccountPool() other_pool.add_account(Account('user', 'password')) queue = Queue() queue.account_manager.add_pool(default_pool) queue.account_manager.add_pool(other_pool, use_this_pool) host = Host('localhost') queue.run(host, do_nothing) In the example code, the host has no account attached. As a result, the queue checks whether use_this_pool() returns True. Because the hostname does not start with 'foo', the function returns False, and Exscript takes the 'default-user' account from the default pool. :type pool: AccountPool :param pool: The account pool that is added. :type match: callable :param match: A callback to check if the pool should be used. """

        if match is None:
            self.default_pool = pool
        else:
            self.pools.append((match, pool))