docs: def check_obsolete_version(calculation_mode='WebUI'):
      """
      Check if there is a newer version of the engine.
  
      :param calculation_mode:
           - the calculation mode when called from the engine
           - an empty string when called from the WebUI
      :returns:
          - a message if the running version of the engine is obsolete
          - the empty string if the engine is updated
          - None if the check could not be performed (i.e. github is down)
      """
      if os.environ.get('JENKINS_URL') or os.environ.get('TRAVIS'):
          # avoid flooding our API server with requests from CI systems
          return
  
      headers = {'User-Agent': 'OpenQuake Engine %s;%s;%s;%s' %
                 (__version__, calculation_mode, platform.platform(),
                  config.distribution.oq_distribute)}
      try:
          req = Request(OQ_API + '/engine/latest', headers=headers)
          # NB: a timeout < 1 does not work
          data = urlopen(req, timeout=1).read()  # bytes
          tag_name = json.loads(decode(data))['tag_name']
          current = version_triple(__version__)
          latest = version_triple(tag_name)
      except Exception:  # page not available or wrong version tag
          return
      if current < latest:
          return ('Version %s of the engine is available, but you are '
                  'still using version %s' % (tag_name, __version__))
      else:
          return ''