def move_id_ahead(element_id, reference_id, idstr_list):
if element_id == reference_id:<EOL><INDENT>return idstr_list<EOL><DEDENT>idstr_list.remove(str(element_id))<EOL>reference_index = idstr_list.index(str(reference_id))<EOL>idstr_list.insert(reference_index, str(element_id))<EOL>return idstr_list<EOL>
Moves element_id ahead of reference_id in the list