code: def generate_ids(source_input, output_data, expand: bool):
      """
      Create new indices for fitted time series values. Process shift after
      starting clipping.
  
      :param source_input: source idx, features and target
      :param output_data: OutputData after pipeline fit
      :param expand: there is a need to take into account the forecasting horizon.
      If True, expand indices.
      """
      forecast_len = source_input.task.task_params.forecast_length
      source_idx = source_input.idx[:-forecast_len]
  
      # Calculate difference between source idx len and new
      clipped_starting_values = len(source_idx) - len(output_data.idx)
  
      if expand:
          indices_range = np.arange(
              clipped_starting_values + 1,
              len(source_idx) + forecast_len + 1,
          )
      else:
          indices_range = np.arange(
              clipped_starting_values + 1, len(source_idx) + 1
          )
      return indices_range
  
file_path: FEDOT/fedot/core/pipelines/ts_wrappers.py
imports: import math
  from copy import copy
  from typing import Union, Optional
  import numpy
  from fedot.core.data.data import InputData, OutputData
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.operations.evaluation.operation_implementations.data_operations.ts_transformations import ts_to_table
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import TaskTypesEnum
label_desc: Use image node_id 9 for calling a global function with example usage: generate_ids(source_input, output_data, expand) and returns: indices_range