parameters: (left, right)
return_statement: return IncompatibleFrequency(msg)
docstring: Helper function to render a consistent error message when raising
      IncompatibleFrequency.
  
      Parameters
      ----------
      left : PeriodArray
      right : None, DateOffset, Period, ndarray, or timedelta-like
  
      Returns
      -------
      IncompatibleFrequency
          Exception to be raised by the caller.
docstring_summary: Helper function to render a consistent error message when raising
      IncompatibleFrequency.
docstring_tokens: Helper function to render a consistent error message when raising IncompatibleFrequency .
function: def raise_on_incompatible(left, right):
      """
      Helper function to render a consistent error message when raising
      IncompatibleFrequency.
  
      Parameters
      ----------
      left : PeriodArray
      right : None, DateOffset, Period, ndarray, or timedelta-like
  
      Returns
      -------
      IncompatibleFrequency
          Exception to be raised by the caller.
      """
      # GH#24283 error message format depends on whether right is scalar
      if isinstance(right, np.ndarray) or right is None:
          other_freq = None
      elif isinstance(right, (ABCPeriodIndex, PeriodArray, Period, DateOffset)):
          other_freq = right.freqstr
      else:
          other_freq = _delta_to_tick(Timedelta(right)).freqstr
  
      msg = DIFFERENT_FREQ.format(
          cls=type(left).__name__, own_freq=left.freqstr, other_freq=other_freq
      )
      return IncompatibleFrequency(msg)
function_tokens: def raise_on_incompatible ( left , right ) : # GH#24283 error message format depends on whether right is scalar if isinstance ( right , np . ndarray ) or right is None : other_freq = None elif isinstance ( right , ( ABCPeriodIndex , PeriodArray , Period , DateOffset ) ) : other_freq = right . freqstr else : other_freq = _delta_to_tick ( Timedelta ( right ) ) . freqstr msg = DIFFERENT_FREQ . format ( cls = type ( left ) . __name__ , own_freq = left . freqstr , other_freq = other_freq ) return IncompatibleFrequency ( msg )