def read_translation(filename):
translation = triple_pb.Translation()<EOL>with open(filename, "<STR_LIT:rb>") as f:<EOL><INDENT>translation.ParseFromString(f.read())<EOL><DEDENT>def unwrap_translation_units(units):<EOL><INDENT>for u in units: yield u.element, u.index<EOL><DEDENT>return (list(unwrap_translation_units(translation.entities)),<EOL>list(unwrap_translation_units(translation.relations)))<EOL>
Returns protobuf mapcontainer. Read from translation file.