code: def test_null_transformer2(data):
      """Checks impute_algorithm='ts_interpolate'"""
      null_transform = NullTransformer(
          impute_algorithm="ts_interpolate", impute_all=False
      )
      null_transform.fit(data)
      assert null_transform.impute_params == dict(
          orders=[7, 14, 21], agg_func=np.mean, iter_num=5
      )
      result = null_transform.transform(data)
      # `orders` is too large for this dataset, nothing is imputed
      assert_equal(result, data)
  
      # two iterations
      null_transform = NullTransformer(
          impute_algorithm="ts_interpolate",
          impute_params=dict(
              orders=[1], agg_func=np.nanmean, iter_num=2
          ),
          impute_all=False,
      )
      result = null_transform.fit_transform(data)
      expected = pd.DataFrame(
          {
              "a": (0.0, 0.0, -1.0, 1.0),
              "b": (np.nan, 2.0, 2.0, 2.0),
              "c": (2.0, 3.0, 3.0, 9.0),
              "d": (np.nan, 4.0, -4.0, 16.0),
          }
      )
      assert_equal(result, expected)
      assert null_transform.missing_info == {
          "a": {"initial_missing_num": 1, "final_missing_num": 0},
          "b": {"initial_missing_num": 3, "final_missing_num": 1},
          "c": {"initial_missing_num": 1, "final_missing_num": 0},
          "d": {"initial_missing_num": 1, "final_missing_num": 1},
      }
  
      # impute_all=True
      null_transform = NullTransformer(
          impute_algorithm="ts_interpolate",
          impute_params=dict(
              orders=[1], agg_func=np.nanmean, iter_num=2
          ),
          impute_all=True,
      )
      result = null_transform.fit_transform(data)
      expected = pd.DataFrame(
          {
              "a": (0.0, 0.0, -1.0, 1.0),
              "b": (2.0, 2.0, 2.0, 2.0),
              "c": (2.0, 3.0, 3.0, 9.0),
              "d": (4.0, 4.0, -4.0, 16.0),
          }
      )
      assert_equal(result, expected)
      # `final_missing_num` are filled in by the second pass.
      # The counts reflect the first pass.
      assert null_transform.missing_info == {
          "a": {"initial_missing_num": 1, "final_missing_num": 0},
          "b": {"initial_missing_num": 3, "final_missing_num": 1},
          "c": {"initial_missing_num": 1, "final_missing_num": 0},
          "d": {"initial_missing_num": 1, "final_missing_num": 1},
      }
  
file_path: greykite/greykite/tests/sklearn/transform/test_null_transformer.py
imports: import numpy
  import pandas
  import pytest
  from sklearn.exceptions import NotFittedError
  from testfixtures import LogCapture
  from greykite.common.constants import LOGGER_NAME
  from greykite.common.python_utils import assert_equal
  from greykite.sklearn.transform.null_transformer import NullTransformer
label_desc: Use image node_id 3 for calling a global function with example usage: test_null_transformer2(data) without return types