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