parameters: (self, periods: int, freq=None)
return_statement: return type(self)(values, freq=self.freq)
docstring: Shift each value by `periods`.
  
          Note this is different from ExtensionArray.shift, which
          shifts the *position* of each element, padding the end with
          missing values.
  
          Parameters
          ----------
          periods : int
              Number of periods to shift by.
          freq : pandas.DateOffset, pandas.Timedelta, or str
              Frequency increment to shift by.
docstring_summary: Shift each value by `periods`.
docstring_tokens: Shift each value by periods .
function: def _time_shift(self, periods: int, freq=None) -> PeriodArray:
          """
          Shift each value by `periods`.
  
          Note this is different from ExtensionArray.shift, which
          shifts the *position* of each element, padding the end with
          missing values.
  
          Parameters
          ----------
          periods : int
              Number of periods to shift by.
          freq : pandas.DateOffset, pandas.Timedelta, or str
              Frequency increment to shift by.
          """
          if freq is not None:
              raise TypeError(
                  "`freq` argument is not supported for "
                  f"{type(self).__name__}._time_shift"
              )
          values = self.asi8 + periods * self.freq.n
          if self._hasnans:
              values[self._isnan] = iNaT
          return type(self)(values, freq=self.freq)
function_tokens: def _time_shift ( self , periods : int , freq = None ) -> PeriodArray : if freq is not None : raise TypeError ( "`freq` argument is not supported for " f"{type(self).__name__}._time_shift" ) values = self . asi8 + periods * self . freq . n if self . _hasnans : values [ self . _isnan ] = iNaT return type ( self ) ( values , freq = self . freq )