code: def test_imputer(method, Z):
      """Test univariate and multivariate Imputer with all methods."""
      forecaster = NaiveForecaster() if method == "forecaster" else None
      value = 3 if method == "constant" else None
      t = Imputer(method=method, forecaster=forecaster, value=value)
      y_hat = t.fit_transform(Z)
      assert not y_hat.isnull().to_numpy().any()
  
imports: import numpy
  import pytest
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.transformations.series.impute import Imputer
  from sktime.utils._testing.forecasting import make_forecasting_problem
  from sktime.utils._testing.hierarchical import _make_hierarchical
label_desc: Use image node_id 1 for calling a global function with example usage: test_imputer(method, Z) without return types