def MessageSetItemEncoder(field_number):
start_bytes = b"<STR_LIT>".join([<EOL>TagBytes(<NUM_LIT:1>, wire_format.WIRETYPE_START_GROUP),<EOL>TagBytes(<NUM_LIT:2>, wire_format.WIRETYPE_VARINT),<EOL>_VarintBytes(field_number),<EOL>TagBytes(<NUM_LIT:3>, wire_format.WIRETYPE_LENGTH_DELIMITED)])<EOL>end_bytes = TagBytes(<NUM_LIT:1>, wire_format.WIRETYPE_END_GROUP)<EOL>local_EncodeVarint = _EncodeVarint<EOL>def EncodeField(write, value):<EOL><INDENT>write(start_bytes)<EOL>local_EncodeVarint(write, value.ByteSize())<EOL>value._InternalSerialize(write)<EOL>return write(end_bytes)<EOL><DEDENT>return EncodeField<EOL>
Encoder for extensions of MessageSet.

    The message set message looks like this:
      message MessageSet {
        repeated group Item = 1 {
          required int32 type_id = 2;
          required string message = 3;
        }
      }