code: def _delivery_report(err, msg):
      ''' Called once for each message produced to indicate delivery result.
          Triggered by poll() or flush(). '''
      if err is not None:
          log.error('Message delivery failed: %s', err)
      else:
          log.debug('Message delivered to %s [%s]', msg.topic(), msg.partition()f _delivery_report(err, msg):
      ''' Called once for each message produced to indicate delivery result.
          Triggered by poll() or flush(). '''
      if err is not None:
          log.error('Message delivery failed: %s', err)
      else:
          log.debug('Message delivered to %s [%s]', msg.topic(), msg.partition())
docs: Called once for each message produced to indicate delivery result.
          Triggered by poll() or flush().