code: def get_roll_start_idx(df, id_col, window_size):
      import itertools
  
      if not id_col:
          id_start_idxes = [0, len(df.index)]
      else:
          id_start_idxes = df.index[
              df[id_col] != df[id_col].shift(1)
          ].tolist() + [len(df.index)]
      roll_start_idx_iter = (
          (
              range(
                  id_start_idxes[i],
                  id_start_idxes[i + 1] - window_size + 1,
              )
          )
          for i in range(len(id_start_idxes) - 1)
      )
      roll_start_idxes = np.fromiter(
          itertools.chain.from_iterable(roll_start_idx_iter), np.int
      )
      return roll_start_idxes
  
file_path: analytics-zoo/pyzoo/zoo/chronos/data/utils/roll_dataset.py
imports: import numpy
  from torch.utils.data import Dataset
  import torch
  from zoo.chronos.data.utils.utils import _check_cols_no_na, _to_list
label_desc: Use image node_id 1 for calling a global function with example usage: get_roll_start_idx(df, id_col, window_size) and returns: roll_start_idxes