<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def commit(self, cb=None):
        '''
        Commit the current transaction.  Caller can specify a callback to use
        when the transaction is committed.
        '''
        # Could call select() but spec 1.9.2.3 says to raise an exception
        if not self.enabled:
            raise self.TransactionsNotEnabled()

        self.send_frame(MethodFrame(self.channel_id, 90, 20))
        self._commit_cb.append(cb)
        self.channel.add_synchronous_cb(self._recv_commit_ok)