code: def _build_forecast_series(
      points_preds: Union[np.ndarray, Sequence[np.ndarray]],
      input_series: TimeSeries,
      custom_columns: List[str] = None,
      with_static_covs: bool = True,
      with_hierarchy: bool = True,
      pred_start: Optional[Union[pd.Timestamp, int]] = None,
  ) -> TimeSeries:
      """
      Builds a forecast time series starting after the end of an input time series, with the
      correct time index (or after the end of the input series, if specified).
  
      Parameters
      ----------
      points_preds
          Forecasted values, can be either the target(s) or parameters of the likelihood model
      input_series
          TimeSeries used as input for the prediction
      custom_columns
          New names for the forecast TimeSeries, used when the number of components changes
      with_static_covs
          If set to False, do not copy the input_series `static_covariates` attribute
      with_hierarchy
          If set to False, do not copy the input_series `hierarchy` attribute
      pred_start
          Optionally, give a custom prediction start point.
  
      Returns
      -------
      TimeSeries
          New TimeSeries instance starting after the input series
      """
      time_index_length = (
          len(points_preds)
          if isinstance(points_preds, np.ndarray)
          else len(points_preds[0])
      )
  
      time_index = _generate_new_dates(
          time_index_length,
          input_series=input_series,
          start=pred_start,
      )
      values = (
          points_preds
          if isinstance(points_preds, np.ndarray)
          else np.stack(points_preds, axis=2)
      )
  
      return TimeSeries.from_times_and_values(
          time_index,
          values,
          freq=input_series.freq_str,
          columns=input_series.columns
          if custom_columns is None
          else custom_columns,
          static_covariates=input_series.static_covariates
          if with_static_covs
          else None,
          hierarchy=input_series.hierarchy if with_hierarchy else None,
      )
  
file_path: darts/darts/utils/timeseries_generation.py
imports: import math
  from typing import List, Optional, Sequence, Tuple, Union
  import holidays
  import numpy
  import pandas
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
label_desc: Use image node_id 11 for calling a global function with example usage: _build_forecast_series(points_preds, input_series, custom_columns, with_static_covs, with_hierarchy, pred_start) and returns: TimeSeries