docs: def apply(self, func):
          """
          Apply given function on each of the underlying AtomicInterval instances and return a new
          Interval instance. The function is expected to return an AtomicInterval, an Interval
          or a 4-uple (left, lower, upper, right).
  
          :param func: function to apply on each of the underlying AtomicInterval instances.
          :return: an Interval instance.
          """
          intervals = []
  
          for interval in self:
              value = func(interval)
  
              if isinstance(value, (Interval, AtomicInterval)):
                  intervals.append(value)
              elif isinstance(value, tuple):
                  intervals.append(AtomicInterval(*value))
              else:
                  raise TypeError('Unsupported return type {} for {}'.format(type(value), value))
  
          return Interval(*intervals)