code: def fit(self, y):
          
          event, time = check_y_survival(y)
          if event.all():
              self.unique_time_ = numpy.unique(time)
              self.prob_ = numpy.ones(self.unique_time_.shape[0])
          else:
              unique_time, prob = kaplan_meier_estimator(~event, time)
              self.unique_time_ = numpy.concatenate(([-numpy.infty], unique_time))
              self.prob_ = numpy.concatenate(([1.], prob))
  
          return self
docs: Estimate censoring distribution from training data.
  
          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
          -------
          self