class_docstr: ## [History](../index.html#History)
  
  This defines when a game ends, calculates the utility and sample chance events (dealing cards).
  
  The history is stored in a string:
  
  * First two characters are the cards dealt to player 1 and player 2
  * The third character is the action by the first player
  * Fourth character is the action by the second player
docstr: Sample a chance action
docstr_tok: ["Sample","a","chance","action"]
code: def sample_chance(self) -> Action:
      """
      Sample a chance action
      """
      while True:
          # Randomly pick a card
          r = np.random.randint(len(CHANCES))
          chance = CHANCES[r]
          # See if the card was dealt before
          for c in self.history:
              if c == chance:
                  chance = None
                  break
  
          # Return the card if it was not dealt before
          if chance is not None:
              return cast(Action, chance)
  
imports: from typing import List, cast, Dict
  import numpy
  from labml import experiment
  from labml.configs import option
  from labml_nn.cfr import History, InfoSet, Action, Player, CFRConfigs
  from labml_nn.cfr.infoset_saver import InfoSetSaver
label_desc: Use image node_id 8 for calling the History obj's underlying member method code with example usage: obj.sample_chance() and returns: cast