parameters: (field_number, is_repeated, is_packed)
docstring: Returns an encoder for a group field.
docstring_summary: Returns an encoder for a group field.
docstring_tokens: Returns an encoder for a group field .
function: def GroupEncoder(field_number, is_repeated, is_packed):
    """Returns an encoder for a group field."""
  
    start_tag = TagBytes(field_number, wire_format.WIRETYPE_START_GROUP)
    end_tag = TagBytes(field_number, wire_format.WIRETYPE_END_GROUP)
    assert not is_packed
    if is_repeated:
      def EncodeRepeatedField(write, value):
        for element in value:
          write(start_tag)
          element._InternalSerialize(write)
          write(end_tag)
      return EncodeRepeatedField
    else:
      def EncodeField(write, value):
        write(start_tag)
        value._InternalSerialize(write)
        return write(end_tag)
      return EncodeField
function_tokens: def GroupEncoder ( field_number , is_repeated , is_packed ) : start_tag = TagBytes ( field_number , wire_format . WIRETYPE_START_GROUP ) end_tag = TagBytes ( field_number , wire_format . WIRETYPE_END_GROUP ) assert not is_packed if is_repeated : def EncodeRepeatedField ( write , value ) : for element in value : write ( start_tag ) element . _InternalSerialize ( write ) write ( end_tag ) return EncodeRepeatedField else : def EncodeField ( write , value ) : write ( start_tag ) value . _InternalSerialize ( write ) return write ( end_tag ) return EncodeField