old_contents: from google.appengine.api import apiproxy_stub_map
  import os
  
  have_appserver = bool(apiproxy_stub_map.apiproxy.GetStub('datastore_v3'))
  
  if have_appserver:
      appid = os.environ.get('APPLICATION_ID')
  else:
      try:
          from google.appengine.tools import dev_appserver
          from .boot import PROJECT_DIR
          appconfig, unused = dev_appserver.LoadAppConfig(PROJECT_DIR, {})
          appid = appconfig.application
      except ImportError, e:
          raise Exception('Could not get appid. Is your app.yaml file missing? '
                          'Error was: %s' % e)
  
  on_production_server = have_appserver and \
      not os.environ.get('SERVER_SOFTWARE', '').lower().startswith('devel')
  
new_contents: from google.appengine.api import apiproxy_stub_map
  import os
  
  have_appserver = bool(apiproxy_stub_map.apiproxy.GetStub('datastore_v3'))
  
  if have_appserver:
      appid = os.environ.get('APPLICATION_ID')
  else:
      try:
          from google.appengine.tools import dev_appserver
          from .boot import PROJECT_DIR
          try:
              appconfig, unused = dev_appserver.LoadAppConfig(PROJECT_DIR, {})
          except ValueError:
              # https://bitbucket.org/wkornewald/django-nonrel/issue/13/managepy-test-broken-with-gae-sdk-16
              appconfig, unused, from_cache = dev_appserver.LoadAppConfig(PROJECT_DIR, {})
          appid = appconfig.application
      except ImportError, e:
          raise Exception('Could not get appid. Is your app.yaml file missing? '
                          'Error was: %s' % e)
  
  on_production_server = have_appserver and \
      not os.environ.get('SERVER_SOFTWARE', '').lower().startswith('devel')
  
subject: Make prosthetic-runner work with GAE SDK 1.6