code: def month_roll(self):
          
          if self._prefix.endswith('S'):
              # MonthBegin
              roll_func = self.m_offset.rollback
          else:
              # MonthEnd
              roll_func = self.m_offset.rollforward
          return roll_func
docs: Define default roll function to be called in apply method.