code: def predict_ipcw(self, y):
          
          event, time = check_y_survival(y)
          Ghat = self.predict_proba(time[event])
  
          if (Ghat == 0.0).any():
              raise ValueError("censoring survival function is zero at one or more time points")
  
          weights = numpy.zeros(time.shape[0])
          weights[event] = 1.0 / Ghat
  
          return weights
docs: Return inverse probability of censoring weights at given time points.
  
          :math:`\\omega_i = \\delta_i / \\hat{G}(y_i)`
  
          Parameters
          ----------
          y : structured array, shape = (n_samples,)
              A structured array containing the binary event indicator
              as first field, and time of event or time of censoring as
              second field.
  
          Returns
          -------
          ipcw : array, shape = (n_samples,)
              Inverse probability of censoring weights.