def MessageSetItemEncoder(field_number):
 start_bytes = ''.join([TagBytes(1, wire_format.WIRETYPE_START_GROUP), TagBytes(2, wire_format.WIRETYPE_VARINT), _VarintBytes(field_number), TagBytes(3, wire_format.WIRETYPE_LENGTH_DELIMITED)])
 end_bytes = TagBytes(1, wire_format.WIRETYPE_END_GROUP)
 local_EncodeVarint = _EncodeVarint
 def EncodeField(write, value):
  write(start_bytes)
  local_EncodeVarint(write, value.ByteSize())
  value._InternalSerialize(write)
  return write(end_bytes)
 return EncodeField

def MessageSetItemEncoder ( field_number ) : start_bytes = '' . join ( [ TagBytes ( 1 , wire_format . WIRETYPE_START_GROUP ) , TagBytes ( 2 , wire_format . WIRETYPE_VARINT ) , _VarintBytes ( field_number ) , TagBytes ( 3 , wire_format . WIRETYPE_LENGTH_DELIMITED ) ] ) end_bytes = TagBytes ( 1 , wire_format . WIRETYPE_END_GROUP ) local_EncodeVarint = _EncodeVarint def EncodeField ( write , value ) : write ( start_bytes ) local_EncodeVarint ( write , value . ByteSize ( ) ) value . _InternalSerialize ( write ) return write ( end_bytes ) return EncodeField
encoder for extensions of messageset .