code: def is_transactional(self, state):
          '''
          Decide if a request should be wrapped in a transaction, based
          upon the state of the request. By default, wraps all but ``GET``
          and ``HEAD`` requests in a transaction, along with respecting
          the ``transactional`` decorator from :mod:pecan.decorators.
  
          :param state: The Pecan state object for the current request.
          '''
  
          controller = getattr(state, 'controller', None)
          if controller:
              force_transactional = _cfg(controller).get('transactional', False)
          else:
              force_transactional = False
  
          if state.request.method not in ('GET', 'HEAD') or force_transactional:
              return True
          return Falsf is_transactional(self, state):
          '''
          Decide if a request should be wrapped in a transaction, based
          upon the state of the request. By default, wraps all but ``GET``
          and ``HEAD`` requests in a transaction, along with respecting
          the ``transactional`` decorator from :mod:pecan.decorators.
  
          :param state: The Pecan state object for the current request.
          '''
  
          controller = getattr(state, 'controller', None)
          if controller:
              force_transactional = _cfg(controller).get('transactional', False)
          else:
              force_transactional = False
  
          if state.request.method not in ('GET', 'HEAD') or force_transactional:
              return True
          return False
docs: Decide if a request should be wrapped in a transaction, based
          upon the state of the request. By default, wraps all but ``GET``
          and ``HEAD`` requests in a transaction, along with respecting
          the ``transactional`` decorator from :mod:pecan.decorators.
  
          :param state: The Pecan state object for the current request.