def decode(self) -> "Deck": '''Decode the string in `self.code`, rebuild the batches and return self.''' lor_deck = decode_deck(self.code) self.batches = [] for lor_card in lor_deck: self.append(lor_card) return self
def from_deckcode(cls, deckcode: str): return cls(decode_deck(deckcode))