code: def rem_edge(self, vertex: Vertex):
      self.edges.pop(vertex)
      vertex.r_edges.pop(self)
      self.flags.discard(vertex)
  
      if self.has_neighbors():
          if vertex == self.worst_edge:
              self.worst_edge = max(self.edges, key=self.edges.get)  # type: ignore
      else:
          self.worst_edge = None
  
          if not self.has_rneighbors():
              Vertex._isolated.add(self)
  
imports: from __future__ import annotations
  import heapq
  import itertools
  import math
  import random
  from river import base
label_desc: Use image node_id 8 for calling the Vertex obj's underlying member method code with example usage: obj.rem_edge(vertex) without return types