def MapSizer(field_descriptor):
<EOL>message_type = field_descriptor.message_type<EOL>message_sizer = MessageSizer(field_descriptor.number, False, False)<EOL>def FieldSize(map_value):<EOL><INDENT>total = <NUM_LIT:0><EOL>for key in map_value:<EOL><INDENT>value = map_value[key]<EOL>entry_msg = message_type._concrete_class(key=key, value=value)<EOL>total += message_sizer(entry_msg)<EOL><DEDENT>return total<EOL><DEDENT>return FieldSize<EOL>
Returns a sizer for a map field.