def acquire_account(self, account=None, owner=None):
        """
        Acquires the given account. If no account is given, one is chosen
        from the default pool.

        :type  account: Account
        :param account: The account that is added.
        :type  owner: object
        :param owner: An optional descriptor for the owner.
        :rtype:  :class:`Account`
        :return: The account that was acquired.
        """
        if account is not None:
            for _, pool in self.pools:
                if pool.has_account(account):
                    return pool.acquire_account(account, owner)

            if not self.default_pool.has_account(account):
                # The account is not in any pool.
                account.acquire()
                return account

        return self.default_pool.acquire_account(account, owner)
Acquires the given account. If no account is given, one is chosen
        from the default pool.

        :type  account: Account
        :param account: The account that is added.
        :type  owner: object
        :param owner: An optional descriptor for the owner.
        :rtype:  :class:`Account`
        :return: The account that was acquired.