code: def train(self, images):
          r
          self.__stdrange = self.__compute_stdrange(images)
          
          lim = []
          for idx, i in enumerate(images):
              ci = numpy.array(numpy.percentile(i, self.__cutoffp))
              li = numpy.array(numpy.percentile(i, self.__landmarkp))
              ipf = interp1d(ci, self.__stdrange)
              lim.append(ipf(li))
  
              # treat single intensity accumulation error            
              if not len(numpy.unique(numpy.concatenate((ci, li)))) == len(ci) + len(li):
                  raise SingleIntensityAccumulationError('Image no.{} shows an unusual single-intensity accumulation that leads to a situation where two percentile values are equal. This situation is usually caused, when the background has not been removed from the image. Another possibility would be to reduce the number of landmark percentiles landmarkp or to change their distribution.'.format(idx))
              
          self.__model = [self.__stdrange[0]] + list(numpy.mean(lim, 0)) + [self.__stdrange[1]]
          self.__sc_umins = [self.__stdrange[0]] + list(numpy.min(lim, 0)) + [self.__stdrange[1]]
          self.__sc_umaxs = [self.__stdrange[0]] + list(numpy.max(lim, 0)) + [self.__stdrange[1]]
              
          return self
docs: r"""
          Train a standard intensity space and an associated transformation model.
          
          Note that the passed images should be masked to contain only the foreground.
          
          Parameters
          ----------
          images : sequence of array_likes
              A number of images.
          
          Returns
          -------
          IntensityRangeStandardization : IntensityRangeStandardization
              This instance of IntensityRangeStandardization