def _sort_by(key):
@staticmethod<EOL>def sort_by(p_list, reverse=False):<EOL><INDENT>return sorted(<EOL>p_list,<EOL>key=lambda p: getattr(p, key),<EOL>reverse=reverse,<EOL>)<EOL><DEDENT>return sort_by<EOL>
High order function for sort methods.