docs: def encode_fetch_request(cls, client_id, correlation_id, payloads=None,
                               max_wait_time=100, min_bytes=4096):
          """
          Encodes some FetchRequest structs
  
          Arguments:
              client_id: string
              correlation_id: int
              payloads: list of FetchRequest
              max_wait_time: int, how long to block waiting on min_bytes of data
              min_bytes: int, the minimum number of bytes to accumulate before
                         returning the response
          """
  
          payloads = [] if payloads is None else payloads
          grouped_payloads = group_by_topic_and_partition(payloads)
  
          message = []
          message.append(cls._encode_message_header(client_id, correlation_id,
                                                    KafkaProtocol.FETCH_KEY))
  
          # -1 is the replica id
          message.append(struct.pack('>iiii', -1, max_wait_time, min_bytes,
                                     len(grouped_payloads)))
  
          for topic, topic_payloads in grouped_payloads.items():
              message.append(write_short_string(topic))
              message.append(struct.pack('>i', len(topic_payloads)))
              for partition, payload in topic_payloads.items():
                  message.append(struct.pack('>iqi', partition, payload.offset,
                                             payload.max_bytes))
  
          msg = b''.join(message)
          return struct.pack('>i%ds' % len(msg), len(msg), msg)