code: def bulk_send(self, topic, kmsgs, timeout=60):
          
  
          try:
              for kmsg in kmsgs:
                  self.client.send(
                      topic, self._onmessage(kmsg).dumps().encode("UTF-8")
                  )
              self.client.flush(timeout=timeout)
              return Result(stdout="{} message(s) sent".format(len(kmsgs)))
  
          except Exception as exc:
              return Result.from_exception(exc)
docs: Send a batch of messages
  
          :param str topic: a kafka topic
          :param ksr.transport.Message kmsgs: Messages to serialize
          :param int timeout: Timeout in seconds
          :return: Execution result
          :rtype: kser.result.Result