<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_transaction(self, to_account):
 """Create a transaction for this statement amount and account, into to_account This will also set this StatementLine's ``transaction`` attribute to the newly created transaction. Args: to_account (Account):
 The account the transaction is into / out of. Returns: Transaction: The newly created (and committed) transaction. """

        from_account = self.statement_import.bank_account

        transaction = Transaction.objects.create()
        Leg.objects.create(
            transaction=transaction, account=from_account, amount=+(self.amount * -1)
        )
        Leg.objects.create(transaction=transaction, account=to_account, amount=-(self.amount * -1))

        transaction.date = self.date
        transaction.save()

        self.transaction = transaction
        self.save()
        return transaction