<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pay(self, payees, change_account=None, utxo_confirmations=6, mfa_token=None, redirect_uri=None):
 """Create, verify, and sign a new Transaction. If this Account is owned by a User object, the user must be redirected to a URL (`mfa_uri`) returned by this call to input their MFA token. After they complete that step, the Transaction will be approved and published to the bitcoin network. If a `redirect_uri` is provided in this call, the user will be redirected to that uri after they complete the MFA challenge so it's a good idea to have an endpoint in your app (or custom scheme on mobile) that can provide the user a seamless flow for returning to your application. If they have not configured a TOTP MFA application (e.g. Google Authenticator), then an SMS will be sent to their phone number with their token. If this Account is owned by an Application, the `mfa_token` can be included in this call and the Transaction will be automatically approved and published to the blockchain. Args: payees (list of dict):
 list of outputs in the form: [{'amount': 10000(satoshis), change_account (str or Account):
 if supplied, this account will be used to generate a change address in the event that a change output is required. This account must be owned by the same Wallet. utxo_confirmations (int, optional):
 Required confirmations for UTXO selection ( > 0) mfa_token (str/function, optional):
 TOTP token for the Application owning this Account's wallet OR a callable/function which will generate such a token. The latter is suggested (e.g. application.get_mfa) as otherwise, the token might be invalidated by the time tx.create and tx.update complete (before the tx.approve call which actually requires the mfa_token). redirect_uri (str, optional):
 URI to redirect a user to after they input an mfa token on the page referenced by the `mfa_uri` returned by this function. Returns: An "unapproved" Transaction with an `mfa_uri` attribute to route the user to the MFA confirmation page -- if called with Gem-Device authentication. An "unconfirmed" Transaction -- if called with Gem-Application auth (and an `mfa_token` was supplied). """

        # Check that wallet is unlocked
        if self.wallet.is_locked():
            raise DecryptionError("This wallet must be unlocked with "
                                  "wallet.unlock(passphrase)")

        # First create the unsigned tx.
        content = dict(payees=payees,
                       utxo_confirmations=utxo_confirmations,
                       remainder_account=self.resource.attributes['key'],
                       network=self.network)

        if change_account: content['change_account'] = \
           self.wallet._get_account_attr(change_account)

        try:
            unsigned = self.resource.transactions().create(content)
        except ResponseError as e:
            if "cannot cover" in e.message:
                raise BalanceError(e.message)
            raise e

        # Sign the tx with the primary private key.
        coinoptx = CoinopTx(data=unsigned.attributes)
        signatures = self.wallet.signatures(coinoptx)

        # Update the tx with the signatures.
        transaction = dict(signatures=dict(inputs=signatures,
                                           transaction_hash=coinoptx.hash))
        if redirect_uri:
            transaction['redirect_uri'] = redirect_uri

        signed = Transaction(unsigned.update(transaction), self.client)

        # If this is an Application wallet, approve the transaction.
        if mfa_token and self.wallet.application:
            try:
                return Transaction(signed.with_mfa(mfa_token).approve(),
                                   self.client)
            except Exception as e:
                signed = signed.cancel()
                logger.debug(e.message)
                logger.debug("If you are having trouble with MFA tokens, make "
                             "sure your system time is accurate with `date -u`!")

        # Otherwise return the unapproved tx (now redirect the user to the
        # `mfa_uri` attribute to approve!)
        return signed