def _detect_gce_environment():
<EOL>http = transport.get_http_object(timeout=GCE_METADATA_TIMEOUT)<EOL>try:<EOL><INDENT>response, _ = transport.request(<EOL>http, _GCE_METADATA_URI, headers=_GCE_HEADERS)<EOL>return (<EOL>response.status == http_client.OK and<EOL>response.get(_METADATA_FLAVOR_HEADER) == _DESIRED_METADATA_FLAVOR)<EOL><DEDENT>except socket.error:  <EOL><INDENT>logger.info('<STR_LIT>')<EOL>return False<EOL><DEDENT>
Determine if the current environment is Compute Engine.

    Returns:
        Boolean indicating whether or not the current environment is Google
        Compute Engine.