code: def ts_transform(
      series: TimeSeries, params: Mapping[str, Any], **kwargs
  ) -> TimeSeries:
      lags, dropna = (
          params["fixed"]["_lags"],
          params["fixed"]["_dropna"],
      )
      component_mask = Diff._get_component_mask(kwargs, dropna)
      diffed = Diff.apply_component_mask(
          series, component_mask, return_ts=True
      )
      for lag in lags:
          diffed = diffed.diff(n=1, periods=lag, dropna=dropna)
      # `series` needs same `n_timesteps` as `diffed` for `unapply_component_mask`
      if dropna:
          series = series.drop_before(sum(lags) - 1)
      return Diff.unapply_component_mask(series, diffed, component_mask)
  
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 3 for calling the Diff obj's underlying member method code with example usage: obj.ts_transform(series, params) and returns: Diff