code: def _reconcile_from_S_and_G(
      series: TimeSeries, S: np.ndarray, G: np.ndarray
  ) -> TimeSeries:
      """
      Returns the TimeSeries linearly reconciled from the projection matrix G and the summation matrix S.
      """
      y_hat = series.all_values(copy=False)
      reconciled_values = (
          S @ G @ y_hat
      )  # (n, m) * (m, n) * (time, n, samples)
      return series.with_values(reconciled_values)
  
imports: from typing import Any, Mapping, Optional
  import numpy
  from darts.dataprocessing.transformers import BaseDataTransformer, FittableDataTransformer
  from darts.timeseries import TimeSeries
  from darts.utils.utils import raise_if_not
label_desc: Use image node_id 2 for calling a global function with example usage: _reconcile_from_S_and_G(series, S, G) and returns: series