code: def _check_index(X):
      """Check input value frequency is set and we have the correct index.
  
      Parameters
      ----------
      X : Series or pd.DataFrame
          Data used to be inversed transformed.
  
      Raises
      ------
      ValueError : Input index must be class pd.DatetimeIndex or pd.PeriodIndex.
      ValueError : Input index frequency cannot be inferred and is not set.
      ValueError : Frequency of data not suitable for transformer as is.
  
      Returns
      -------
      freq_ind : str or None
          Frequency of data in string format
      """
      if not (isinstance(X.index, pd.DatetimeIndex)) | (
          isinstance(X.index, pd.PeriodIndex)
      ):
          raise ValueError(
              "Input index must be class pd.DatetimeIndex or pd.PeriodIndex."
          )
      # check that it has a frequency, if not infer
      freq_ind = X.index.freq
      if freq_ind is None:
          freq_ind = pd.infer_freq(X.index)
          if freq_ind is None:
              raise ValueError(
                  "Input index frequency cannot be inferred and is not set."
              )
  
      tod = pd.timedelta_range(start="0T", end="1D", freq=freq_ind)
      # check frequency of tod
      if (tod.freq > pd.offsets.Day(1)) | (
          tod.freq < pd.offsets.Second(1)
      ):
          raise ValueError(
              """
              Transformer intended to be used with input frequency of greater than
              or equal to one day and with a frequency of less or equal to than
              1 second. Contributions welcome on adapting for these use cases.
              """
          )
      return freq_ind
  
file_path: sktime/sktime/transformations/series/clear_sky.py
imports: import numpy
  import pandas
  from joblib import Parallel, delayed
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 2 for calling a global function with example usage: _check_index(X) and returns: freq_ind