def map_helper(data):
as_list = []<EOL>length = <NUM_LIT:2><EOL>for field, value in data.items():<EOL><INDENT>as_list.append(Container(field=bytes(field, ENCODING),<EOL>value=bytes(value, ENCODING)))<EOL>length += len(field) + len(value) + <NUM_LIT:4><EOL><DEDENT>return (Container(<EOL>num=len(as_list),<EOL>map=as_list<EOL>), length)<EOL>
Build a map message.