docs: def _check_node_attributes_consistency(self):
          """Consistency Check 2: consider all nodes listed in
          _node_attributes
  
          :raises: ValueError -- detected inconsistency among dictionaries
  
          """
          # Get list of nodes from the node attributes dict
          nodes_from_attributes = set(self._node_attributes.keys())
  
          # Perform consistency checks on each node.
          for node in nodes_from_attributes:
  
              # Check 2.1: make sure that the forward star for the node
              # exists.
              if node not in self._forward_star:
                  raise ValueError(
                      'Consistency Check 2.1 Failed: node ' +
                      '%s not in forward star dict' % (str(node)))
  
              # Check 2.2: make sure that the backward star for the node
              # exists.
              if node not in self._backward_star:
                  raise ValueError(
                      'Consistency Check 2.2 Failed: node ' +
                      '%s not in backward star dict' % (str(node)))
  
              # Get backward star and forward star
              node_fstar = self._forward_star[node]
              node_bstar = self._backward_star[node]
  
              # Check 2.3: make sure every hyperedge id in the forward
              # star contains the node in the tail
              for hyperedge_id in node_fstar:
                  if hyperedge_id not in self._hyperedge_attributes or \
                     node not in \
                     self._hyperedge_attributes[hyperedge_id]['tail']:
                      raise ValueError(
                          'Consistency Check 2.3 Failed: node %s ' % str(node) +
                          'has hyperedge id %s in the forward ' % hyperedge_id +
                          'star, but %s is not in the tail of ' % str(node) +
                          '%s' % hyperedge_id)
  
              # Check 2.4: make sure every hyperedge id in the backward
              # star contains the node in the head
              for hyperedge_id in node_bstar:
                  if hyperedge_id not in self._hyperedge_attributes or \
                     node not in \
                     self._hyperedge_attributes[hyperedge_id]['head']:
                      raise ValueError(
                          'Consistency Check 2.4 Failed: node %s ' % str(node) +
                          'has hyperedge id %s in the forward ' % hyperedge_id +
                          'star, but %s is not in the tail of ' % str(node) +
                          '%s' % hyperedge_id)