code: def _is_txn_to_replay(self, txn_id, possible_successor, already_seen):
          
  
          is_successor = self._is_predecessor_of_possible_successor(
              txn_id,
              possible_successor)
          in_different_batch = not self._is_in_same_batch(txn_id,
                                                          possible_successor)
          has_not_been_seen = possible_successor not in already_seen
  
          return is_successor and in_different_batch and has_not_been_seen
docs: Decide if possible_successor should be replayed.
  
          Args:
              txn_id (str): Id of txn in failed batch.
              possible_successor (str): Id of txn to possibly replay.
              already_seen (list): A list of possible_successors that have
                  been replayed.
  
          Returns:
              (bool): If the possible_successor should be replayed.