code: def get_poker_hand(txt: str) -> "PokerHand":
      """In: some text, e.g. 'AA' or 'QQJJ', out: an instance of a subclass of PokerHand"""
      hands = []
      for cls in (
          HighCard,
          OnePair,
          TwoPair,
          ThreeOfAKind,
          FullHouse,
          FourOfAKind,
      ):
          hand = cls.from_string(txt)
          if hand is not None:
              hands.append(hand)
      if len(hands) > 1:
          raise ValueError(
              f"Hand descrption {txt} fits multiple hands: {','.join([str(x) for x in hands])}"
          )
      elif len(hands) == 0:
          raise ValueError(
              f"Hand description {txt} doesn't describe any poker hand"
          )
      else:
          return hands[0]
  
imports: from functools import total_ordering
  from itertools import combinations
  from typing import Literal, Union
label_desc: Use image node_id 1 for calling a global function with example usage: get_poker_hand(txt) and returns: hands