code: def chop(self, begin, end, datafunc=None):
          
          insertions = set()
          begin_hits = [iv for iv in self.at(begin) if iv.begin < begin]
          end_hits = [iv for iv in self.at(end) if iv.end > end]
  
          if datafunc:
              for iv in begin_hits:
                  insertions.add(Interval(iv.begin, begin, datafunc(iv, True)))
              for iv in end_hits:
                  insertions.add(Interval(end, iv.end, datafunc(iv, False)))
          else:
              for iv in begin_hits:
                  insertions.add(Interval(iv.begin, begin, iv.data))
              for iv in end_hits:
                  insertions.add(Interval(end, iv.end, iv.data))
  
          self.remove_envelop(begin, end)
          self.difference_update(begin_hits)
          self.difference_update(end_hits)
          self.update(insertions)
docs: Like remove_envelop(), but trims back Intervals hanging into
          the chopped area so that nothing overlaps.