code: def remove_hyperedge(self, hyperedge_id):
          
          if not self.has_hyperedge_id(hyperedge_id):
              raise ValueError("No such hyperedge exists.")
  
          frozen_tail = \
              self._hyperedge_attributes[hyperedge_id]["__frozen_tail"]
          frozen_head = \
              self._hyperedge_attributes[hyperedge_id]["__frozen_head"]
  
          # Remove this hyperedge from the forward-star of every tail node
          for node in frozen_tail:
              self._forward_star[node].remove(hyperedge_id)
          # Remove this hyperedge from the backward-star of every head node
          for node in frozen_head:
              self._backward_star[node].remove(hyperedge_id)
  
          # Remove frozen_head as a successor of frozen_tail
          del self._successors[frozen_tail][frozen_head]
          # If that tail is no longer the tail of any hyperedge, remove it
          # from the successors dictionary
          if self._successors[frozen_tail] == {}:
              del self._successors[frozen_tail]
          # Remove frozen_tail as a predecessor of frozen_head
          del self._predecessors[frozen_head][frozen_tail]
          # If that head is no longer the head of any hyperedge, remove it
          # from the predecessors dictionary
          if self._predecessors[frozen_head] == {}:
              del self._predecessors[frozen_head]
  
          # Remove hyperedge's attributes dictionary
          del self._hyperedge_attributes[hyperedge_id]
docs: Removes a hyperedge and its attributes from the hypergraph.
  
          :param hyperedge_id: ID of the hyperedge to be removed.
          :raises: ValueError -- No such hyperedge exists.
  
          Examples:
          ::
  
              >>> H = DirectedHypergraph()
              >>> xyz = hyperedge_list = ((["A"], ["B", "C"]),
                                          (("A", "B"), ("C"), {'weight': 2}),
                                          (set(["B"]), set(["A", "C"])))
              >>> H.add_hyperedges(hyperedge_list)
              >>> H.remove_hyperedge(xyz[0])