code: def _fit_estimator(estimator, X, y, intervals):
      """Fit an estimator on input data (X, y)."""
      transformed_x = _transform(X, intervals)
      return estimator.fit(transformed_x, y)
  
file_path: sktime/sktime/series_as_features/base/estimators/interval_based/_tsf.py
imports: import math
  from typing import Optional
  import numpy
  from joblib import Parallel, delayed
  from numpy.random import RandomState
  from sklearn.utils.multiclass import class_distribution
  from sklearn.utils.validation import check_random_state
  from sktime.base._base import _clone_estimator
  from sktime.utils.slope_and_trend import _slope
  from sktime.utils.validation import check_n_jobs
label_desc: Use image node_id 4 for calling a global function with example usage: _fit_estimator(estimator, X, y, intervals) and returns: estimator