code: def _prepare_output(partitions, unavailable_brokers, verbose):
      
      partitions_count = len(partitions)
      out = {}
      out['raw'] = {
          'replica_unavailability_count': partitions_count,
      }
  
      if partitions_count == 0:
          out['message'] = 'All replicas available for communication.'
      else:
          out['message'] = "{replica_unavailability} replicas unavailable for communication. " \
              "Unavailable Brokers: {unavailable_brokers}".format(
              replica_unavailability=partitions_count,
              unavailable_brokers=', '.join([str(e) for e in unavailable_brokers]),
          )
          if verbose:
              lines = (
                  '{}:{}'.format(topic, partition)
                  for (topic, partition) in partitions
              )
              out['verbose'] = "Partitions:\n" + "\n".join(lines)
  
      if verbose:
          out['raw']['partitions'] = [
              {'topic': topic, 'partition': partition}
              for (topic, partition) in partitions
          ]
  
      return out
docs: Returns dict with 'raw' and 'message' keys filled.