def _fields_sort_by_indicators(fields):
field_dict = {}<EOL>field_positions_global = []<EOL>for field in fields:<EOL><INDENT>field_dict.setdefault(field[<NUM_LIT:1>:<NUM_LIT:3>], []).append(field)<EOL>field_positions_global.append(field[<NUM_LIT:4>])<EOL><DEDENT>indicators = list(field_dict.keys())<EOL>indicators.sort()<EOL>field_list = []<EOL>for indicator in indicators:<EOL><INDENT>for field in field_dict[indicator]:<EOL><INDENT>field_list.append(field[:<NUM_LIT:4>] + (field_positions_global.pop(<NUM_LIT:0>),))<EOL><DEDENT><DEDENT>return field_list<EOL>
Sort a set of fields by their indicators.

    Return a sorted list with correct global field positions.