code: def test_differencer_same_series(y, lags, index_type):
      """Test transform against inverse_transform."""
      if index_type == "int":
          y = y.reset_index(drop=True)
      transformer = Differencer(lags=lags, na_handling="drop_na")
      y_transform = transformer.fit_transform(y)
      y_reconstructed = transformer.inverse_transform(y_transform)
  
      # Reconstruction should return the reconstructed series for same indices
      # that are in the `Z` timeseries passed to inverse_transform
      _assert_array_almost_equal(
          y.loc[y_reconstructed.index], y_reconstructed
      )
  
file_path: sktime/sktime/transformations/series/tests/test_differencer.py
imports: import numpy
  import pandas
  import pytest
  from sktime.datasets import load_airline
  from sktime.transformations.series.difference import Differencer
  from sktime.utils._testing.estimator_checks import _assert_array_almost_equal
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 2 for calling a global function with example usage: test_differencer_same_series(y, lags, index_type) without return types