def _process_relations(relations):
result = []<EOL>for rel_type, rels in relations.items():<EOL><INDENT>for rel in rels:<EOL><INDENT>result.append((rel_type, rel.from_object.title, rel.to_object.title))<EOL><DEDENT><DEDENT>result.sort()<EOL>return result<EOL>
extract relation indices from a relation list