code: def test_time_series_forest_classifier_feature_importance(
      extract_feature_importance_of_feature_mock: MagicMock,
      n_estimators: int,
  ):
      """Test TimeSeriesForestClassifier feature importance."""
      # Given
      given_n_intervals = 2
      given_n_estimators = n_estimators
      given_time_series_forest_classifier = TimeSeriesForestClassifier(
          n_estimators=given_n_estimators
      )
  
      given_time_series_forest_classifier.series_length = 20
      given_time_series_forest_classifier.estimators_ = MagicMock()
      given_time_series_forest_classifier.intervals_ = np.array(
          [[[0, 9], [15, 20]]] * given_n_estimators
      )
      given_time_series_forest_classifier.n_intervals = (
          given_n_intervals
      )
  
      extract_feature_importance_of_feature_mock.return_value = np.ones(
          given_time_series_forest_classifier.n_intervals
      )
  
      # When
      fi = given_time_series_forest_classifier.feature_importances_
  
      # Then
      expected_fi = pd.DataFrame(
          {
              "mean": [
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
              ],
              "std": [
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
              ],
              "slope": [
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
                  0.5,
              ],
          }
      )
      pd.testing.assert_frame_equal(expected_fi, fi)
  
imports: from unittest.mock import MagicMock, patch
  import numpy
  import pandas
  import pytest
  from sktime.classification.interval_based import TimeSeriesForestClassifier
  from sktime.utils._testing.panel import make_classification_problem
label_desc: Use image node_id 1 for calling a global function with example usage: test_time_series_forest_classifier_feature_importance(extract_feature_importance_of_feature_mock, n_estimators) without return types