docstr: Tests that `Diff` correctly behaves when given multiple time series, both when a `component_mask`
  is provided and when one is not.
docstr_tok: ["Tests","that","`","Diff","`","correctly","behaves","when","given","multiple","time","series",",","both","when","a","`","component_mask","`","is","provided","and","when","one","is","not","."]
code: def test_diff_multi_ts(self):
      """
      Tests that `Diff` correctly behaves when given multiple time series, both when a `component_mask`
      is provided and when one is not.
      """
  
      # (`lags`, `dropna`, `component_mask`) triplets; note that combination of `dropna = True``
      # AND `component_mask is not None` is not tested here, since this should throw error
      # (see `test_diff_dropna_and_component_mask_specified`):
      component_mask = np.array([True, False, True])
      test_cases = [
          (1, True, None),
          (1, False, None),
          ([1, 2, 3, 2, 1], True, None),
          ([1, 2, 3, 2, 1], False, None),
          (1, False, component_mask),
          ([1, 2, 3, 2, 1], False, component_mask),
      ]
      for lags, dropna, mask in test_cases:
          diff = Diff(lags=lags, dropna=dropna)
          transformed = diff.fit_transform(
              [self.sine_series, self.sine_series], component_mask=mask
          )
          if mask is not None:
              # Masked components should be undifferenced:
              self.assert_series_equal(
                  self.sine_series,
                  transformed[0],
                  equal_nan=(not dropna),
                  to_compare=~mask,
              )
              self.assert_series_equal(
                  self.sine_series,
                  transformed[1],
                  equal_nan=(not dropna),
                  to_compare=~mask,
              )
          # Should recover original sine_series:
          back = diff.inverse_transform(
              transformed, component_mask=mask
          )
          self.assert_series_equal(
              self.sine_series, back[0], equal_nan=(not dropna)
          )
          self.assert_series_equal(
              self.sine_series, back[1], equal_nan=(not dropna)
          )
  
imports: from copy import deepcopy
  from typing import Optional, Sequence
  import numpy
  import pandas
  import pytest
  from darts.dataprocessing.transformers import Diff
  from darts.timeseries import TimeSeries
  from darts.timeseries import concatenate
  from darts.utils.timeseries_generation import linear_timeseries, sine_timeseries
label_desc: Use image node_id 4 for calling the TestDiff obj's underlying member method code with example usage: obj.test_diff_multi_ts() without return types