code: def test_vectorize_reconstruct_correct_hierarchy():
      """Tests correct transform return index in hierarchical case for primitives output.
  
      Tests that the row index is as expected if rows are vectorized over,
      by a transform that returns Primitives.
      The row index of transform return should be identical to the input,
      with temporal index level removed
  
      Raises
      ------
      AssertionError if output index is not as expected.
      """
      from sktime.transformations.series.summarize import (
          SummaryTransformer,
      )
      from sktime.utils._testing.hierarchical import _make_hierarchical
  
      # hierarchical data with 2 variables and 2 levels
      X = _make_hierarchical(n_columns=2)
  
      summary_trafo = SummaryTransformer()
  
      # this produces a pandas DataFrame with more rows and columns
      # rows should correspond to different instances in X
      Xt = summary_trafo.fit_transform(X)
  
      # check that Xt.index is the same as X.index with time level dropped and made unique
      assert (X.index.droplevel(-1).unique() == Xt.index).all()
  
imports: from inspect import isclass
  import pandas
  import pytest
  from sktime.datatypes import check_is_scitype, get_examples, mtype_to_scitype
  from sktime.transformations.compose import FitInTransform
  from sktime.transformations.panel.padder import PaddingTransformer
  from sktime.transformations.panel.tsfresh import TSFreshFeatureExtractor, TSFreshRelevantFeatureExtractor
  from sktime.transformations.series.boxcox import BoxCoxTransformer
  from sktime.transformations.series.exponent import ExponentTransformer
  from sktime.transformations.series.summarize import SummaryTransformer
  from sktime.utils._testing.scenarios_transformers import TransformerFitTransformHierarchicalMultivariate, TransformerFitTransformHierarchicalUnivariate, TransformerFitTransformPanelUnivariate, TransformerFitTransformPanelUnivariateWithClassYOnlyFit, TransformerFitTransformSeriesMultivariate, TransformerFitTransformSeriesUnivariate
  from sktime.utils._testing.series import _make_series
  from sktime.utils.parallel import _get_parallel_test_fixtures
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 18 for calling a global function with example usage: test_vectorize_reconstruct_correct_hierarchy() without return types