code: def _encode_message_header(cls, client_id, correlation_id, request_key,
                                 version=0):
          
          return struct.pack('>hhih%ds' % len(client_id),
                             request_key,          # ApiKey
                             version,              # ApiVersion
                             correlation_id,       # CorrelationId
                             len(client_id),       # ClientId size
                             client_id)
docs: Encode the common request envelope