def _mode(elems):
if len(elems) == <NUM_LIT:0>:<EOL><INDENT>return None<EOL><DEDENT>c = collections.Counter()<EOL>c.update(elems)<EOL>most_common = c.most_common(<NUM_LIT:1>)<EOL>most_common.sort()<EOL>return most_common[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>
Find the mode (most common element) in list elems. If there are ties, this function returns the least value.

If elems is an empty list, returns None.