def is_google_instance():
 global __IS_ON_GOOGLE
 if (__IS_ON_GOOGLE is None):
  __IS_ON_GOOGLE = fetch(GOOGLE_METADATA_URL, google=True).ok()
 return __IS_ON_GOOGLE

def is_google_instance ( ) : global __IS_ON_GOOGLE if ( __IS_ON_GOOGLE is None ) : __IS_ON_GOOGLE = fetch ( GOOGLE_METADATA_URL , google = True ) . ok ( ) return __IS_ON_GOOGLE
determine if we are running on a google cloud platform instance .