code: def ts_inverse_transform(
      series: TimeSeries,
      params: Mapping[str, Any],
      **kwargs,
  ) -> TimeSeries:
      lags, dropna = (
          params["fixed"]["_lags"],
          params["fixed"]["_dropna"],
      )
      start_vals, fit_component_mask, start_time, freq = params[
          "fitted"
      ]
      raise_if_not(
          series.freq == freq,
          (
              f"Series is of frequency {series.freq}, but "
              f"transform was fitted to data of frequency {freq}."
          ),
          logger,
      )
      # Start dates 'missing' from differenced series if dropna = True, so need to shift forward:
      expected_start = (
          start_time + sum(lags) * series.freq if dropna else start_time
      )
      raise_if_not(
          series.start_time() == expected_start,
          (
              f"Expected series to begin at time {expected_start}; "
              f"instead, it begins at time {series.start_time()}."
          ),
          logger,
      )
      component_mask = Diff._get_component_mask(kwargs, dropna)
      raise_if_not(
          np.all(fit_component_mask == component_mask),
          (
              "Provided `component_mask` does not match "
              "`component_mask` specified when `fit` was called."
          ),
          logger,
      )
      if dropna:
          nan_shape = (sum(lags), series.n_components, series.n_samples)
          nan_vals = np.full(nan_shape, fill_value=np.nan)
          series = series.prepend_values(nan_vals)
      vals = Diff.apply_component_mask(
          series, component_mask, return_ts=False
      )
      raise_if_not(
          vals.shape[1] == start_vals.shape[1],
          (
              f"Expected series to have {start_vals.shape[1]} components; "
              f"instead, it has {vals.shape[1]}."
          ),
          logger,
      )
      raise_if_not(
          vals.shape[2] == start_vals.shape[2],
          (
              f"Expected series to have {start_vals.shape[2]} samples; "
              f"instead, it has {vals.shape[2]}."
          ),
          logger,
      )
      cutoff = sum(lags)
      for lag in reversed(lags):
          cutoff -= lag
          to_undiff = vals[cutoff:, :, :]
          to_undiff[:lag, :, :] = start_vals[
              cutoff : cutoff + lag, :, :
          ]
          for i in range(lag):
              to_undiff[i::lag, :, :] = np.cumsum(
                  to_undiff[i::lag, :, :], axis=0
              )
          vals[cutoff:, :, :] = to_undiff
      vals = Diff.unapply_component_mask(series, vals, component_mask)
      return series.with_values(vals)
  
file_path: darts/darts/dataprocessing/transformers/diff.py
imports: from typing import Any, Mapping, Sequence, Union
  import numpy
  from darts.logging import get_logger, raise_if, raise_if_not
  from darts.timeseries import TimeSeries
  from .fittable_data_transformer import FittableDataTransformer
  from .invertible_data_transformer import InvertibleDataTransformer
label_desc: Use image node_id 4 for calling the Diff obj's underlying member method code with example usage: obj.ts_inverse_transform(series, params) and returns: series