    def _make_loop_ranges(init_values: List[str]):
        """
        For the given list, return a list of tuples, where each tuple contains
        (start_idx, end_idx, val). It means that in the input list, all the elements
        between [start_idx, end_idx) have the same value 'val'
        """
        start_idx = 0
        res = []
        for end_idx in range(1, len(init_values)):
            if init_values[end_idx] == init_values[end_idx - 1]:
                continue
            res.append((start_idx, end_idx, init_values[start_idx]))
            start_idx = end_idx
        if len(init_values) > 0:
            res.append((start_idx, len(init_values), init_values[start_idx]))

        return res
For the given list, return a list of tuples, where each tuple contains
(start_idx, end_idx, val). It means that in the input list, all the elements
between [start_idx, end_idx) have the same value 'val'
python/aitemplate/backend/common/concatenate_common.py