def _in_gae_environment():
if SETTINGS.env_name is not None:<EOL><INDENT>return SETTINGS.env_name in ('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>import google.appengine  <EOL><DEDENT>except ImportError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>server_software = os.environ.get(_SERVER_SOFTWARE, '<STR_LIT>')<EOL>if server_software.startswith('<STR_LIT>'):<EOL><INDENT>SETTINGS.env_name = '<STR_LIT>'<EOL>return True<EOL><DEDENT>elif server_software.startswith('<STR_LIT>'):<EOL><INDENT>SETTINGS.env_name = '<STR_LIT>'<EOL>return True<EOL><DEDENT><DEDENT>return False<EOL>
Detects if the code is running in the App Engine environment.

    Returns:
        True if running in the GAE environment, False otherwise.