nodes: 0, module; 1, function_definition; 2, function_name:_get_rows; 3, parameters; 4, block; 5, identifier:self; 6, identifier:options; 7, expression_statement; 8, if_statement; 9, comment:# Sort; 10, if_statement; 11, comment:# Slice if necessary; 12, if_statement; 13, return_statement; 14, comment:"""Return only those data rows that should be printed, based on slicing and sorting.
  
          Arguments:
  
          options - dictionary of option settings."""; 15, subscript; 16, block; 17, else_clause; 18, subscript; 19, block; 20, not_operator; 21, block; 22, identifier:rows; 23, identifier:options; 24, string:"oldsortslice"; 25, expression_statement; 26, block; 27, identifier:options; 28, string:"sortby"; 29, expression_statement; 30, comment:# Decorate; 31, expression_statement; 32, comment:# Sort; 33, expression_statement; 34, comment:# Undecorate; 35, expression_statement; 36, subscript; 37, expression_statement; 38, assignment; 39, expression_statement; 40, assignment; 41, assignment; 42, call; 43, assignment; 44, identifier:options; 45, string:"oldsortslice"; 46, assignment; 47, identifier:rows; 48, call; 49, assignment; 50, identifier:sortindex; 51, call; 52, identifier:rows; 53, list_comprehension; 54, attribute; 55, argument_list; 56, identifier:rows; 57, list_comprehension; 58, identifier:rows; 59, subscript; 60, attribute; 61, argument_list; 62, identifier:rows; 63, call; 64, attribute; 65, argument_list; 66, binary_operator:[row[sortindex]] + row; 67, for_in_clause; 68, identifier:rows; 69, identifier:sort; 70, keyword_argument; 71, keyword_argument; 72, subscript; 73, for_in_clause; 74, identifier:rows; 75, slice; 76, identifier:copy; 77, identifier:deepcopy; 78, subscript; 79, attribute; 80, argument_list; 81, attribute; 82, identifier:index; 83, subscript; 84, list; 85, identifier:row; 86, identifier:row; 87, identifier:rows; 88, identifier:reverse; 89, subscript; 90, identifier:key; 91, subscript; 92, identifier:row; 93, slice; 94, identifier:row; 95, identifier:rows; 96, subscript; 97, subscript; 98, attribute; 99, slice; 100, identifier:copy; 101, identifier:deepcopy; 102, attribute; 103, identifier:self; 104, identifier:_field_names; 105, identifier:options; 106, string:"sortby"; 107, subscript; 108, identifier:options; 109, string:"reversesort"; 110, identifier:options; 111, string:"sort_key"; 112, integer:1; 113, identifier:options; 114, string:"start"; 115, identifier:options; 116, string:"end"; 117, identifier:self; 118, identifier:_rows; 119, subscript; 120, subscript; 121, identifier:self; 122, identifier:_rows; 123, identifier:row; 124, identifier:sortindex; 125, identifier:options; 126, string:"start"; 127, identifier:options; 128, string:"end"
code: def _get_rows(self, options):
          """Return only those data rows that should be printed, based on slicing and sorting.
  
          Arguments:
  
          options - dictionary of option settings."""
  
          if options["oldsortslice"]:
              rows = copy.deepcopy(self._rows[options["start"]:options["end"]])
          else:
              rows = copy.deepcopy(self._rows)
  
          # Sort
          if options["sortby"]:
              sortindex = self._field_names.index(options["sortby"])
              # Decorate
              rows = [[row[sortindex]] + row for row in rows]
              # Sort
              rows.sort(reverse=options["reversesort"], key=options["sort_key"])
              # Undecorate
              rows = [row[1:] for row in rows]
  
          # Slice if necessary
          if not options["oldsortslice"]:
              rows = rows[options["start"]:options["end"]]
  
          return rows