def GroupDecoder(field_number, is_repeated, is_packed, key, new_default):
end_tag_bytes = encoder.TagBytes(field_number,<EOL>wire_format.WIRETYPE_END_GROUP)<EOL>end_tag_len = len(end_tag_bytes)<EOL>assert not is_packed<EOL>if is_repeated:<EOL><INDENT>tag_bytes = encoder.TagBytes(field_number,<EOL>wire_format.WIRETYPE_START_GROUP)<EOL>tag_len = len(tag_bytes)<EOL>def DecodeRepeatedField(buffer, pos, end, message, field_dict):<EOL><INDENT>value = field_dict.get(key)<EOL>if value is None:<EOL><INDENT>value = field_dict.setdefault(key, new_default(message))<EOL><DEDENT>while <NUM_LIT:1>:<EOL><INDENT>value = field_dict.get(key)<EOL>if value is None:<EOL><INDENT>value = field_dict.setdefault(key, new_default(message))<EOL><DEDENT>pos = value.add()._InternalParse(buffer, pos, end)<EOL>new_pos = pos+end_tag_len<EOL>if buffer[pos:new_pos] != end_tag_bytes or new_pos > end:<EOL><INDENT>raise _DecodeError('<STR_LIT>')<EOL><DEDENT>pos = new_pos + tag_len<EOL>if buffer[new_pos:pos] != tag_bytes or new_pos == end:<EOL><INDENT>return new_pos<EOL><DEDENT><DEDENT><DEDENT>return DecodeRepeatedField<EOL><DEDENT>else:<EOL><INDENT>def DecodeField(buffer, pos, end, message, field_dict):<EOL><INDENT>value = field_dict.get(key)<EOL>if value is None:<EOL><INDENT>value = field_dict.setdefault(key, new_default(message))<EOL><DEDENT>pos = value._InternalParse(buffer, pos, end)<EOL>new_pos = pos+end_tag_len<EOL>if buffer[pos:new_pos] != end_tag_bytes or new_pos > end:<EOL><INDENT>raise _DecodeError('<STR_LIT>')<EOL><DEDENT>return new_pos<EOL><DEDENT>return DecodeField<EOL><DEDENT>
Returns a decoder for a group field.