code: func (d *driver) Leave(nid, eid string) error {
  	if err := validateID(nid, eid); err != nil {
  		return err
  	}
  
  	n := d.network(nid)
  	if n == nil {
  		return fmt.Errorf("could not find network with id %s", nid)
  	}
  
  	ep := n.endpoint(eid)
  
  	if ep == nil {
  		return types.InternalMaskableErrorf("could not find endpoint with id %s", eid)
  	}
  
  	if d.notifyCh != nil {
  		d.notifyCh <- ovNotify{
  			action: "leave",
  			nw:     n,
  			ep:     ep,
  		}
  	}
  
  	d.peerDelete(nid, eid, ep.addr.IP, ep.addr.Mask, ep.mac, net.ParseIP(d.advertiseAddress), true)
  
  	n.leaveSandbox()
  
  	return nil
  }
docs: // Leave method is invoked when a Sandbox detaches from an endpoint.