nodes: 0, module; 1, function_definition; 2, function_name:_sort_cards; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, typed_parameter; 8, identifier:list; 9, expression_statement; 10, return_statement; 11, identifier:cards; 12, type; 13, string; 14, call; 15, identifier:Generator; 16, string_content:sort cards by blocknum and blockseq; 17, identifier:sorted; 18, argument_list; 19, list_comprehension; 20, keyword_argument; 21, attribute; 22, for_in_clause; 23, identifier:key; 24, call; 25, identifier:card; 26, identifier:__dict__; 27, identifier:card; 28, identifier:cards; 29, identifier:itemgetter; 30, argument_list; 31, string; 32, string; 33, string; 34, string_content:blocknum; 35, string_content:blockseq; 36, string_content:cardseq
code: def _sort_cards(self, cards: Generator) -> list:
          '''sort cards by blocknum and blockseq'''
  
          return sorted([card.__dict__ for card in cards],
                              key=itemgetter('blocknum', 'blockseq', 'cardseq'))