code: def is_last_attempt(request):
      
      environ = request.environ
      attempt = environ.get('retry.attempt')
      attempts = environ.get('retry.attempts')
      if attempt is None or attempts is None:
          return True
  
      return attempt + 1 == attempts
docs: Return ``True`` if the request is on its last attempt, meaning that
      ``pyramid_retry`` will not be issuing any new attempts, regardless of
      what happens when executing this request.
  
      This will return ``True`` if ``pyramid_retry`` is inactive for the
      request.