code: def _index_diff(
      self: Union[pd.Timestamp, int],
      other: Union[pd.Timestamp, int],
      freq: pd.offsets,
  ):
      """Returns the difference between two indexes `other` and `self` (`other` - `self`) of frequency `freq`."""
      if isinstance(freq, int):
          return int(other - self)
  
      elif freq.freqstr in DIVISIBLE_FREQS:
          return int((other - self) / freq)
  
      # /!\ THIS IS TAKING LINEAR TIME IN THE LENGTH OF THE SERIES
      # it won't scale if the end of target and covariates are far apart and the freq is not in DIVISIBLE_FREQS
      # (Not sure there's a way around it for exotic freqs)
      if other >= self:
          return -1 + len(
              pd.date_range(start=self, end=other, freq=freq)
          )
      else:
          return 1 - len(
              pd.date_range(start=other, end=self, freq=freq)
          )
  
file_path: darts/darts/utils/data/utils.py
imports: from enum import Enum
  from typing import Union
  import pandas
  from darts import TimeSeries
  from darts.logging import raise_if_not
label_desc: Use image node_id 2 for calling a global function with example usage: _index_diff(other, freq) and returns: int, unknown, unknown, int