original_docstring: 
      Match two strategies against each other.
  
      Returns the match history as seen from the point of view of the first strategy.
      
docstring: Match two strategies against each other.
  Returns the match history as seen from the point of view of the first strategy.
docstring_tokens: Match two strategies against each other . Returns the match history as seen from the point of view of the first strategy .
code: def match(strat1_cls: Type[Strategy], strat2_cls: Type[Strategy]) -> History:
      """
      Match two strategies against each other.
  
      Returns the match history as seen from the point of view of the first strategy.
      """
      # init the strategies
      strat1: Strategy = strat1_cls()
      strat2: Strategy = strat2_cls()
      # simulate
      history1: History = []
      history2: History = []
      for i in range(ROUND_LEN):
          result1: int = strat1.play(history1)
          if not (isinstance(result1, int) and 0 <= result1 <= 2):
              raise RuntimeError(
                  f"Strategy {strat1_cls.name} returned an invalid move: {result1}"
              )
          result2: int = strat2.play(history2)
          if not (isinstance(result2, int) and 0 <= result2 <= 2):
              raise RuntimeError(
                  f"Strategy {strat2_cls.name} returned an invalid move: {result2}"
              )
          # enforce int for bools
          if isinstance(result1, bool):
              result1 = int(result1)
          if isinstance(result2, bool):
              result2 = int(result2)
          history1.append((result1, result2))
          history2.append((result2, result1))
      return history1
code_tokens: def match ( strat1_cls : Type [ Strategy ] , strat2_cls : Type [ Strategy ] ) -> History : strat1 : Strategy = strat1_cls ( ) strat2 : Strategy = strat2_cls ( ) history1 : History = [ ] history2 : History = [ ] for i in range ( ROUND_LEN ) : result1 : int = strat1 . play ( history1 ) if not ( isinstance ( result1 , int ) and 0 <= result1 <= 2 ) : raise RuntimeError ( f"Strategy {strat1_cls.name} returned an invalid move: {result1}" ) result2 : int = strat2 . play ( history2 ) if not ( isinstance ( result2 , int ) and 0 <= result2 <= 2 ) : raise RuntimeError ( f"Strategy {strat2_cls.name} returned an invalid move: {result2}" ) if isinstance ( result1 , bool ) : result1 = int ( result1 ) if isinstance ( result2 , bool ) : result2 = int ( result2 ) history1 . append ( ( result1 , result2 ) ) history2 . append ( ( result2 , result1 ) ) return history1
short_docstring: Match two strategies against each other.
short_docstring_tokens: Match two strategies against each other .
comment: """
      Match two strategies against each other.
  
      Returns the match history as seen from the point of view of the first strategy.
      """$SEP$# init the strategies$SEP$# simulate$SEP$# enforce int for bools