nodes: 0, module; 1, function_definition; 2, function_name:folderitems; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, comment:# Fill empty positions from the layout with fake rows. The worksheet; 9, comment:# can be generated by making use of a WorksheetTemplate, so there is; 10, comment:# the chance that some slots of this worksheet being empty. We need to; 11, comment:# render a row still, at lest to display the slot number (Pos); 12, expression_statement; 13, comment:# Sort the items in accordance with the layout; 14, expression_statement; 15, comment:# Fill the slot header cells (first cell of each row). Each slot; 16, comment:# contains the analyses that belong to the same parent; 17, comment:# (AnalysisRequest, ReferenceSample), so the information about the; 18, comment:# parent must be displayed in the first cell of each slot.; 19, expression_statement; 20, return_statement; 21, comment:"""Returns an array of dictionaries, each dictionary represents an
          analysis row to be rendered in the list. The array returned is sorted
          in accordance with the layout positions set for the analyses this
          worksheet contains when the analyses were added in the worksheet.
  
          :returns: list of dicts with the items to be rendered in the list
          """; 22, assignment; 23, call; 24, assignment; 25, call; 26, identifier:items; 27, identifier:items; 28, call; 29, attribute; 30, argument_list; 31, identifier:items; 32, call; 33, attribute; 34, argument_list; 35, attribute; 36, argument_list; 37, identifier:self; 38, identifier:fill_empty_slots; 39, identifier:items; 40, identifier:sorted; 41, argument_list; 42, identifier:self; 43, identifier:fill_slots_headers; 44, identifier:items; 45, identifier:BaseView; 46, identifier:folderitems; 47, identifier:self; 48, identifier:items; 49, keyword_argument; 50, identifier:key; 51, call; 52, identifier:itemgetter; 53, argument_list; 54, string:"pos_sortkey"
code: def folderitems(self):
          """Returns an array of dictionaries, each dictionary represents an
          analysis row to be rendered in the list. The array returned is sorted
          in accordance with the layout positions set for the analyses this
          worksheet contains when the analyses were added in the worksheet.
  
          :returns: list of dicts with the items to be rendered in the list
          """
          items = BaseView.folderitems(self)
  
          # Fill empty positions from the layout with fake rows. The worksheet
          # can be generated by making use of a WorksheetTemplate, so there is
          # the chance that some slots of this worksheet being empty. We need to
          # render a row still, at lest to display the slot number (Pos)
          self.fill_empty_slots(items)
  
          # Sort the items in accordance with the layout
          items = sorted(items, key=itemgetter("pos_sortkey"))
  
          # Fill the slot header cells (first cell of each row). Each slot
          # contains the analyses that belong to the same parent
          # (AnalysisRequest, ReferenceSample), so the information about the
          # parent must be displayed in the first cell of each slot.
          self.fill_slots_headers(items)
  
          return items