code: def annotate_segments(self, Z):
          
          # We need a way to go from compressed idices to original indices
          P = Z.copy()
          P[~np.isfinite(P)] = -1
          _, mapping = np.unique(np.cumsum(P >= 0), return_index=True)
  
          dZ = Z.compressed()
          uniq, idx = np.unique(dZ, return_inverse=True)
          segments = []
          for i, mean_cn in enumerate(uniq):
              if not np.isfinite(mean_cn):
                  continue
              for rr in contiguous_regions(idx == i):
                  segments.append((mean_cn, mapping[rr]))
  
          return segments
docs: Report the copy number and start-end segment