def get_appid():
  from google.appengine.api import apiproxy_stub_map
  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 kay import PROJECT_DIR
      appconfig, unused = dev_appserver.LoadAppConfig(PROJECT_DIR, {})
      appid = appconfig.application
    except __HOLE__:
      appid = None
  return appid
dataset/ETHPy150Open IanLewis/kay/kay/misc/__init__.py/get_appid