<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transact_with_contract_function( address, web3, function_name=None, transaction=None, contract_abi=None, fn_abi=None, *args, **kwargs):
 """ Helper function for interacting with a contract function by sending a transaction. This is copied from web3 `transact_with_contract_function` so we can use `personal_sendTransaction` when possible. """

    transact_transaction = prepare_transaction(
        address,
        web3,
        fn_identifier=function_name,
        contract_abi=contract_abi,
        transaction=transaction,
        fn_abi=fn_abi,
        fn_args=args,
        fn_kwargs=kwargs,
    )

    passphrase = None
    if transaction and 'passphrase' in transaction:
        passphrase = transaction['passphrase']
        transact_transaction.pop('passphrase')

    if passphrase:
        txn_hash = web3.personal.sendTransaction(transact_transaction, passphrase)
    else:
        txn_hash = web3.eth.sendTransaction(transact_transaction)

    return txn_hash