docs: def merge_overlaps(self, threshold=0.0):
          """
          Merge overlapping labels with the same value.
          Two labels are considered overlapping,
          if ``l2.start - l1.end < threshold``.
  
          Args:
              threshold (float): Maximal distance between two labels
                                 to be considered as overlapping.
                                 (default: 0.0)
  
          Example:
              >>> ll = LabelList(labels=[
              ...     Label('a_label', 1.0, 2.0),
              ...     Label('a_label', 1.5, 2.7),
              ...     Label('b_label', 1.0, 2.0),
              ... ])
              >>> ll.merge_overlapping_labels()
              >>> ll.labels
              [
                  Label('a_label', 1.0, 2.7),
                  Label('b_label', 1.0, 2.0),
              ]
          """
  
          updated_labels = []
          all_intervals = self.label_tree.copy()
  
          # recursivly find a group of overlapping labels with the same value
          def recursive_overlaps(interval):
              range_start = interval.begin - threshold
              range_end = interval.end + threshold
  
              direct_overlaps = all_intervals.overlap(range_start, range_end)
              all_overlaps = [interval]
              all_intervals.discard(interval)
  
              for overlap in direct_overlaps:
                  if overlap.data.value == interval.data.value:
                      all_overlaps.extend(recursive_overlaps(overlap))
  
              return all_overlaps
  
          # For every remaining interval
          # - Find overlapping intervals recursively
          # - Remove them
          # - Create a concatenated new label
          while not all_intervals.is_empty():
              next_interval = list(all_intervals)[0]
              overlapping = recursive_overlaps(next_interval)
  
              ov_start = float('inf')
              ov_end = 0.0
              ov_value = next_interval.data.value
  
              for overlap in overlapping:
                  ov_start = min(ov_start, overlap.begin)
                  ov_end = max(ov_end, overlap.end)
                  all_intervals.discard(overlap)
  
              updated_labels.append(Label(
                  ov_value,
                  ov_start,
                  ov_end
              ))
  
          # Replace the old labels with the updated ones
          self.label_tree.clear()
          self.update(updated_labels)