def manage_matches(matches): matches_evaluation = [m for m in matches if m.status != 'give the cold shoulder']; prearrival_sorting = lambda x: (x.date, -x.importance); matches.sort(key=prearrival_sorting); for match in matches: if match.status == 'prearrival': match.status = 'commence again'; return [m for m in matches if imperceptible_changes(m)]