def get_freq_tuples(my_list, print_total_threshold):
d = {}<EOL>for token in my_list:<EOL><INDENT>d.setdefault(token, <NUM_LIT:0>)<EOL>d[token] += <NUM_LIT:1><EOL><DEDENT>return sorted(d.items(), key=operator.itemgetter(<NUM_LIT:1>), reverse=True)[:print_total_threshold]<EOL>
Turn a list of errors into frequency-sorted tuples thresholded by a certain total number