code: def report_idle_after(seconds):
      
  
      def decorator(func):
          def wrapper(*args, **kwargs):
              def _handle_timeout(signum, frame):
                  config = get_config()
                  if not config.ready:
                      config.load()
                  message = {
                      "subject": "Idle Experiment.",
                      "body": idle_template.format(
                          app_id=config.get("id"), minutes_so_far=round(seconds / 60)
                      ),
                  }
                  log("Reporting problem with idle experiment...")
                  get_messenger(config).send(message)
  
              signal.signal(signal.SIGALRM, _handle_timeout)
              signal.alarm(seconds)
              try:
                  result = func(*args, **kwargs)
              finally:
                  signal.alarm(0)
              return result
  
          return wraps(func)(wrapper)
  
      return decorator
docs: Report_idle_after after certain number of seconds.