docs: def _check_hyperedge_id_consistency(self):
          """Consistency Check 4: check for misplaced hyperedge ids
  
          :raises: ValueError -- detected inconsistency among dictionaries
  
          """
          # Get list of hyperedge_ids from the hyperedge attributes dict
          hyperedge_ids_from_attributes = set(self._hyperedge_attributes.keys())
  
          # get hyperedge ids in the forward star
          forward_star_hyperedge_ids = set()
          for hyperedge_id_set in self._forward_star.values():
              forward_star_hyperedge_ids.update(hyperedge_id_set)
  
          # get hyperedge ids in the backward star
          backward_star_hyperedge_ids = set()
          for hyperedge_id_set in self._backward_star.values():
              backward_star_hyperedge_ids.update(hyperedge_id_set)
  
          # Check 4.1: hyperedge ids in the forward star must be the
          # same as the hyperedge ids from attributes
          if forward_star_hyperedge_ids != hyperedge_ids_from_attributes:
              raise ValueError(
                  'Consistency Check 4.1 Failed: hyperedge ids ' +
                  'are different in the forward star ' +
                  'values and the hyperedge ids from ' +
                  'attribute keys.')
  
          # Check 4.2: hyperedge ids in the backward star must be the
          # same as the hyperedge ids from attributes
          if backward_star_hyperedge_ids != hyperedge_ids_from_attributes:
              raise ValueError(
                  'Consistency Check 4.2 Failed: hyperedge ids ' +
                  'are different in the backward star ' +
                  'values and the hyperedge ids from ' +
                  'attribute keys.')
  
          # Note that by Check 4.1 and 4.2, forward_star_hyperedge_ids =
          # backward_star_hyperedge_ids
  
          # get hyperedge ids in the predecessors dict
          predecessor_hyperedge_ids = set()
          for all_tails_from_predecessor in self._predecessors.values():
              for hyperedge_id in all_tails_from_predecessor.values():
                  predecessor_hyperedge_ids.add(hyperedge_id)
  
          # get hyperedge ids in the successors dict
          successor_hyperedge_ids = set()
          for all_heads_from_successor in self._successors.values():
              for hyperedge_id in all_heads_from_successor.values():
                  successor_hyperedge_ids.add(hyperedge_id)
  
          # Check 4.3: hyperedge ids in the predecessor dict must be the
          # same as the hyperedge ids from attributes
          if predecessor_hyperedge_ids != hyperedge_ids_from_attributes:
              raise ValueError(
                  'Consistency Check 4.3 Failed: hyperedge ids are ' +
                  'different in the predecessor values and ' +
                  'hyperedge ids from attribute keys.')
  
          # Check 4.4: hyperedge ids in the successor dict must be the
          # same as the hyperedge ids from attributes
          if successor_hyperedge_ids != hyperedge_ids_from_attributes:
              raise ValueError(
                  'Consistency Check 4.4 Failed: hyperedge ids are ' +
                  'different in the successor values and ' +
                  'hyperedge ids from attribute keys.')