code: def _get_ordinal_range(start, end, periods, freq, mult=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:
          _, mult = libfrequencies.get_freq_code(freq)
  
      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")
  
      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 datetime import timedelta
  import operator
  import numpy
  from pandas._libs.tslibs import NaT, frequencies, iNaT, period
  from pandas._libs.tslibs.fields import isleapyear_arr
  from pandas._libs.tslibs.period import DIFFERENT_FREQ, IncompatibleFrequency, Period, get_period_field_arr, period_asfreq_arr
  from pandas._libs.tslibs.timedeltas import Timedelta, delta_to_nanoseconds
  import pandas.compat
  from pandas.util._decorators import Appender, cache_readonly
  from pandas.core.dtypes.common import _TD_DTYPE, ensure_object, is_datetime64_dtype, is_float_dtype, is_list_like, is_period_dtype, pandas_dtype
  from pandas.core.dtypes.dtypes import PeriodDtype
  from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCPeriodIndex, ABCSeries
  from pandas.core.dtypes.missing import isna, notna
  import pandas.core.algorithms
  from pandas.core.arrays import datetimelike
  import pandas.core.common
  from pandas.tseries import frequencies
  from pandas.tseries.offsets import DateOffset, Tick, _delta_to_tick
label_desc: Use image node_id 7 for calling a global function with example usage: _get_ordinal_range(start, end, periods, freq, mult) and returns: data,  freq