code: def send_frame(self, cmd, headers=None, body=''):
          
          if headers is None:
              headers = {}
          frame = utils.Frame(cmd, headers, body)
  
          if cmd == CMD_BEGIN:
              trans = headers[HDR_TRANSACTION]
              if trans in self.transactions:
                  self.notify('error', {}, 'Transaction %s already started' % trans)
              else:
                  self.transactions[trans] = []
          elif cmd == CMD_COMMIT:
              trans = headers[HDR_TRANSACTION]
              if trans not in self.transactions:
                  self.notify('error', {}, 'Transaction %s not started' % trans)
              else:
                  for f in self.transactions[trans]:
                      self.transport.transmit(f)
                  del self.transactions[trans]
          elif cmd == CMD_ABORT:
              trans = headers['transaction']
              del self.transactions[trans]
          else:
              if 'transaction' in headers:
                  trans = headers['transaction']
                  if trans not in self.transactions:
                      self.transport.notify('error', {}, 'Transaction %s not started' % trans)
                      return
                  else:
                      self.transactions[trans].append(frame)
              else:
                  self.transport.transmit(frame)
docs: :param str cmd:
          :param dict headers:
          :param body: