code: def _get_event_windows(Yk: np.ndarray) -> List[Tuple[int, int]]:
      """
      Find continuous segmentation labels and group them
      """
      Yk_diff = np.diff(np.concatenate([[0], Yk, [0]]))
      start = np.argwhere(Yk_diff == 1).flatten()
      end = np.argwhere(Yk_diff == -1).flatten()
      return [(ss, ee - 1) for ss, ee in zip(start, end)]
  
imports: from typing import List, Optional, Tuple
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: _get_event_windows(Yk) and returns: unknown