code: def generate_segments(
      X: npt.ArrayLike, change_points: List[int]
  ) -> npt.ArrayLike:
      """Generate separate segments from time series based on change points.
  
      Parameters
      ----------
      X: array_like
          Time series data as a 2D numpy array with sequence index along rows
          and value series in columns.
  
      change_points: list of int
          Locations of change points as integer indexes. By convention change points
          include the identity segmentation, i.e. first and last index + 1 values.
  
      Yields
      ------
      segment: npt.ArrayLike
          A segments from the input time series between two consecutive change points
      """
      for start, end in zip(change_points[:-1], change_points[1:]):
          yield X[start:end, :]
  
imports: from dataclasses import asdict, dataclass, field
  from typing import Dict, List
  import numpy
  import numpy.typing
  import pandas
  from sktime.base import BaseEstimator
  from sktime.utils.validation._dependencies import _check_estimator_deps
label_desc: Use image node_id 2 for calling a global function with example usage: generate_segments(X, change_points) without return types