code: def fit(self, series: TimeSeries):
      super().fit(series)
      self._assert_univariate(series)
      series = self.training_series
  
      # if the model was initially created with `self.seasonal_periods=None`, make sure that
      # the model will try to automatically infer the index, otherwise it should use the
      # provided `seasonal_periods` value
      seasonal_periods_param = (
          None if self.infer_seasonal_periods else self.seasonal_periods
      )
  
      # set the seasonal periods parameter to a default value if it was not provided explicitly
      # and if it cannot be inferred due to the lack of a datetime index
      if self.seasonal_periods is None and series.has_range_index:
          seasonal_periods_param = 12
  
      hw_model = hw.ExponentialSmoothing(
          series.values(copy=False),
          trend=self.trend if self.trend is None else self.trend.value,
          damped_trend=self.damped,
          seasonal=self.seasonal
          if self.seasonal is None
          else self.seasonal.value,
          seasonal_periods=seasonal_periods_param,
          freq=series.freq if series.has_datetime_index else None,
          dates=series.time_index
          if series.has_datetime_index
          else None,
          **self.constructor_kwargs,
      )
      hw_results = hw_model.fit(**self.fit_kwargs)
      self.model = hw_results
  
      if self.infer_seasonal_periods:
          self.seasonal_periods = hw_model.seasonal_periods
  
      return self
  
file_path: darts/darts/models/forecasting/exponential_smoothing.py
imports: from typing import Any, Dict, Optional
  import numpy
  import statsmodels.tsa.holtwinters
  from darts.logging import get_logger
  from darts.models.forecasting.forecasting_model import LocalForecastingModel
  from darts.timeseries import TimeSeries
  from darts.utils.utils import ModelMode, SeasonalityMode
label_desc: Use image node_id 2 for calling the ExponentialSmoothing obj's underlying member method code with example usage: obj.fit(series) and returns: self