code: def _get_ordinal_range(start, end, periods, freq, mult: int = 1):
      if com.count_not_none(start, end, periods) != 2:
          raise ValueError(
              "Of the three parameters: start, end, and periods, "
              "exactly two must be specified"
          )
  
      if freq is not None:
          freq = to_offset(freq, is_period=True)
          mult = freq.n
  
      if start is not None:
          start = Period(start, freq)
      if end is not None:
          end = Period(end, freq)
  
      is_start_per = isinstance(start, Period)
      is_end_per = isinstance(end, Period)
  
      if is_start_per and is_end_per and start.freq != end.freq:
          raise ValueError("start and end must have same freq")
      if start is NaT or end is NaT:
          raise ValueError("start and end must not be NaT")
  
      if freq is None:
          if is_start_per:
              freq = start.freq
          elif is_end_per:
              freq = end.freq
          else:  # pragma: no cover
              raise ValueError("Could not infer freq from start/end")
          mult = freq.n
  
      if periods is not None:
          periods = periods * mult
          if start is None:
              data = np.arange(
                  end.ordinal - periods + mult,
                  end.ordinal + 1,
                  mult,
                  dtype=np.int64,
              )
          else:
              data = np.arange(
                  start.ordinal,
                  start.ordinal + periods,
                  mult,
                  dtype=np.int64,
              )
      else:
          data = np.arange(
              start.ordinal, end.ordinal + 1, mult, dtype=np.int64
          )
  
      return data, freq
  
imports: from __future__ import annotations
  from datetime import timedelta
  import operator
  from typing import TYPE_CHECKING, Any, Callable, Literal, TypeVar, cast, overload
  import warnings
  import numpy
  from pandas._libs import algos, lib
  from pandas._libs.arrays import NDArrayBacked
  from pandas._libs.tslibs import BaseOffset, NaT, NaTType, Timedelta, add_overflowsafe, astype_overflowsafe, dt64arr_to_periodarr, get_unit_from_dtype, iNaT, parsing, period, to_offset
  from pandas._libs.tslibs.dtypes import FreqGroup, PeriodDtypeBase, freq_to_period_freqstr
  from pandas._libs.tslibs.fields import isleapyear_arr
  from pandas._libs.tslibs.offsets import Tick, delta_to_tick
  from pandas._libs.tslibs.period import DIFFERENT_FREQ, IncompatibleFrequency, Period, get_period_field_arr, period_asfreq_arr
  from pandas.util._decorators import cache_readonly, doc
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.common import ensure_object, pandas_dtype
  from pandas.core.dtypes.dtypes import DatetimeTZDtype, PeriodDtype
  from pandas.core.dtypes.generic import ABCIndex, ABCPeriodIndex, ABCSeries, ABCTimedeltaArray
  from pandas.core.dtypes.missing import isna
  from pandas.core.arrays import datetimelike
  import pandas.core.common
label_desc: Use image node_id 8 for calling a global function with example usage: _get_ordinal_range(start, end, periods, freq, mult) and returns: data,  freq