code: def _prepare_output(partitions, verbose):
      
      out = {}
      partitions_count = len(partitions)
      out['raw'] = {
          'not_enough_replicas_count': partitions_count,
      }
  
      if partitions_count == 0:
          out['message'] = 'All replicas in sync.'
      else:
          out['message'] = (
              "{0} partition(s) have the number of replicas in "
              "sync that is lower than the specified min ISR."
          ).format(partitions_count)
  
          if verbose:
              lines = (
                  "isr={isr} is lower than min_isr={min_isr} for {topic}:{partition}"
                  .format(
                      isr=p['isr'],
                      min_isr=p['min_isr'],
                      topic=p['topic'],
                      partition=p['partition'],
                  )
                  for p in partitions
              )
              out['verbose'] = "Partitions:\n" + "\n".join(lines)
      if verbose:
          out['raw']['partitions'] = partitions
  
      return out
docs: Returns dict with 'raw' and 'message' keys filled.