code: def _calc_starts(dims):
      
      # NB: Python uses 0-indexing; R uses 1-indexing.
      l = len(dims)
      s = [np.prod(d) for d in dims]
      starts = np.cumsum([0] + s)[0:l].tolist()
      # coerce things into ints before returning
      return [int(i) for i in starts]
docs: Calculate starting indexes
  
      Parameters
      ----------
      dims : list of list of int
          from (via cython conversion) vector[vector[uint]] dims
  
      Examples
      --------
      >>> _calc_starts([[8, 2], [5], [6, 2]])
      [0, 16, 21]