nodes: 0, module; 1, function_definition; 2, function_name:_update_sorting; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, if_statement; 13, expression_statement; 14, expression_statement; 15, comment:""" Insert new entries into the merged iterator.
  
          :param sorted_tops: A SortedDict.
          :param tops: The most recent entry from each iterator.
          :param idxs: The indices to update.
          """; 16, assignment; 17, assignment; 18, assignment; 19, assignment; 20, identifier:idx; 21, attribute; 22, block; 23, comparison_operator:len(sorted_tops) == 0; 24, block; 25, assignment; 26, assignment; 27, identifier:key; 28, attribute; 29, identifier:sorted_tops; 30, attribute; 31, identifier:tops; 32, attribute; 33, identifier:iterators; 34, attribute; 35, identifier:self; 36, identifier:idxs; 37, try_statement; 38, call; 39, integer:0; 40, raise_statement; 41, pattern_list; 42, call; 43, attribute; 44, integer:0; 45, identifier:self; 46, identifier:key; 47, identifier:self; 48, identifier:sorted_tops; 49, identifier:self; 50, identifier:tops; 51, identifier:self; 52, identifier:iterators; 53, block; 54, except_clause; 55, identifier:len; 56, argument_list; 57, identifier:StopIteration; 58, identifier:key; 59, attribute; 60, attribute; 61, argument_list; 62, identifier:self; 63, identifier:c_idx; 64, expression_statement; 65, expression_statement; 66, if_statement; 67, expression_statement; 68, identifier:StopIteration; 69, block; 70, identifier:sorted_tops; 71, identifier:self; 72, identifier:idxs; 73, identifier:sorted_tops; 74, identifier:popitem; 75, keyword_argument; 76, assignment; 77, assignment; 78, comparison_operator:top_key not in sorted_tops; 79, block; 80, call; 81, pass_statement; 82, identifier:last; 83, False; 84, subscript; 85, call; 86, identifier:top_key; 87, call; 88, identifier:top_key; 89, identifier:sorted_tops; 90, expression_statement; 91, attribute; 92, argument_list; 93, identifier:tops; 94, identifier:idx; 95, identifier:next; 96, argument_list; 97, identifier:key; 98, argument_list; 99, assignment; 100, subscript; 101, identifier:append; 102, identifier:idx; 103, subscript; 104, subscript; 105, subscript; 106, list; 107, identifier:sorted_tops; 108, identifier:top_key; 109, identifier:iterators; 110, identifier:idx; 111, identifier:tops; 112, identifier:idx; 113, identifier:sorted_tops; 114, identifier:top_key
code: def _update_sorting(self):
          """ Insert new entries into the merged iterator.
  
          :param sorted_tops: A SortedDict.
          :param tops: The most recent entry from each iterator.
          :param idxs: The indices to update.
          """
          key = self.key
          sorted_tops = self.sorted_tops
          tops = self.tops
          iterators = self.iterators
          for idx in self.idxs:
              try:
                  tops[idx] = next(iterators[idx])
                  top_key = key(tops[idx])
                  if top_key not in sorted_tops:
                      sorted_tops[top_key] = []
                  sorted_tops[top_key].append(idx)
              except StopIteration:
                  pass
          if len(sorted_tops) == 0:
              raise StopIteration
          key, self.idxs = sorted_tops.popitem(last=False)
          self.c_idx = 0