code: def remove_peer(self, peer):
          
          if peer.index < 0 or peer.index >= self.size():
              raise IndexError('Peer index is out of range')
  
          assert peer is self.peers[peer.index], "peer is not in the heap"
  
          return heap.remove(self, peer.index)
docs: Remove the peer from the heap.
  
          Return: removed peer if peer exists. If peer's index is out of range,
          raise IndexError.