nodes: 0, module; 1, function_definition; 2, function_name:sort_precursor; 3, parameters; 4, block; 5, identifier:c; 6, identifier:loci; 7, expression_statement; 8, comment:# Original Py 2.7 code; 9, comment:#data_loci = map(lambda (x): [x, loci[x].chr, int(loci[x].start), int(loci[x].end), loci[x].strand, len(c.loci2seq[x])], c.loci2seq.keys()); 10, comment:# 2to3 suggested Py 3 rewrite; 11, expression_statement; 12, expression_statement; 13, return_statement; 14, comment:"""
      Sort loci according to number of sequences mapped there.
      """; 15, assignment; 16, assignment; 17, identifier:data_loci; 18, identifier:data_loci; 19, list_comprehension; 20, identifier:data_loci; 21, call; 22, list; 23, for_in_clause; 24, identifier:sorted; 25, argument_list; 26, identifier:x; 27, attribute; 28, call; 29, call; 30, attribute; 31, call; 32, identifier:x; 33, call; 34, identifier:data_loci; 35, keyword_argument; 36, keyword_argument; 37, subscript; 38, identifier:chr; 39, identifier:int; 40, argument_list; 41, identifier:int; 42, argument_list; 43, subscript; 44, identifier:strand; 45, identifier:len; 46, argument_list; 47, identifier:list; 48, argument_list; 49, identifier:key; 50, call; 51, identifier:reverse; 52, True; 53, identifier:loci; 54, identifier:x; 55, attribute; 56, attribute; 57, identifier:loci; 58, identifier:x; 59, subscript; 60, call; 61, identifier:itemgetter; 62, argument_list; 63, subscript; 64, identifier:start; 65, subscript; 66, identifier:end; 67, attribute; 68, identifier:x; 69, attribute; 70, argument_list; 71, integer:5; 72, identifier:loci; 73, identifier:x; 74, identifier:loci; 75, identifier:x; 76, identifier:c; 77, identifier:loci2seq; 78, attribute; 79, identifier:keys; 80, identifier:c; 81, identifier:loci2seq
code: def sort_precursor(c, loci):
      """
      Sort loci according to number of sequences mapped there.
      """
      # Original Py 2.7 code
      #data_loci = map(lambda (x): [x, loci[x].chr, int(loci[x].start), int(loci[x].end), loci[x].strand, len(c.loci2seq[x])], c.loci2seq.keys())
      # 2to3 suggested Py 3 rewrite
      data_loci = [[x, loci[x].chr, int(loci[x].start), int(loci[x].end), loci[x].strand, len(c.loci2seq[x])] for x in list(c.loci2seq.keys())]
      data_loci = sorted(data_loci, key=itemgetter(5), reverse=True)
      return data_loci