code: def add_relationship(self, txn_id, predecessors):
          
  
          all_pred = set(predecessors)
          for pred in predecessors:
              all_pred.update(self._predecessors_by_id[pred])
  
          self._predecessors_by_id[txn_id] = all_pred
docs: Add a predecessor-successor relationship between one txn id and
          a set of predecessors.
  
          Args:
              txn_id (str): The transaction id of the transaction.
              predecessors (set): The transaction ids of the
                  transaction's predecessors
  
          Returns:
              None