code: def farewell(self):
      for rn in list(self.r_edges):
          rn.rem_edge(self)
  
      for n in list(self.edges):
          self.rem_edge(n)
  
      self.flags = None
      self.worst_edge = None
  
      Vertex._isolated.discard(self)
  
imports: from __future__ import annotations
  import heapq
  import itertools
  import math
  import random
  from river import base
label_desc: Use image node_id 5 for calling the Vertex obj's underlying member method code with example usage: obj.farewell() without return types