code: def _delegator(method):
      """Automatically decorate ForecastingHorizon class with pandas.Index methods.
  
      Also delegates method calls to wrapped pandas.Index object. methods from
      pandas.Index and delegate method calls to wrapped pandas.Index
      """
  
      def delegated(obj, *args, **kwargs):
          return getattr(obj.to_pandas(), method)(*args, **kwargs)
  
      return delegated
  
imports: from functools import lru_cache
  from typing import Optional, Union
  import numpy
  import pandas
  from pandas.tseries.frequencies import to_offset
  from sktime.utils.datetime import _coerce_duration_to_int
  from sktime.utils.validation import array_is_int, array_is_timedelta_or_date_offset, is_array, is_int, is_timedelta_or_date_offset
  from sktime.utils.validation._dependencies import _check_soft_dependencies
  from sktime.utils.validation.series import VALID_INDEX_TYPES, is_in_valid_absolute_index_types, is_in_valid_index_types, is_in_valid_relative_index_types, is_integer_index
label_desc: Use image node_id 1 for calling a global function with example usage: _delegator(method) and returns: delegated, getattr