code: def _get_freq(x):
      """Get unit for conversion of time deltas to integer."""
      if hasattr(x, "freqstr"):
          if x.freqstr is None:
              return None
          elif "-" in x.freqstr:
              return x.freqstr.split("-")[0]
          else:
              return x.freqstr
      else:
          return None
  
file_path: sktime/sktime/utils/datetime.py
imports: import warnings
  from functools import singledispatch
  from typing import Optional, Tuple, Union
  import numpy
  import pandas
  from sktime.datatypes import VectorizedDF
  from sktime.datatypes._utilities import get_time_index
  from sktime.utils.validation.series import check_time_index, is_integer_index
label_desc: Use image node_id 3 for calling a global function with example usage: _get_freq(x) and returns: None, None, x, x