#NEWLINE# def gce_credentials_from_config( gce_credentials_config = None ) : #NEWLINE# #INDENT# '\n    This function creates a proper GCE credentials object either from a passed\n    in configuration blob or, if this code is being run on a GCE instance, from\n    the default service account credentials associated with the VM.\n\n    :param dict gce_credentials_config: A credentials dict used to authenticate\n        against GCE. This should have the same content as the JSON blob you\n        download when you create a new key for a service account. If this is\n        ``None``, then the instances implicit credentials will be used.\n\n    :returns: A GCE credentials object for use with the GCE API.\n    ' #NEWLINE# if ( credentials is not None ) : #NEWLINE# #INDENT# credentials = SignedJwtAssertionCredentials ( gce_credentials_config [ 'client_email' ] , gce_credentials_config [ 'private_key' ] , scope = [ 'https://www.googleapis.com/auth/compute' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# credentials = GoogleCredentials . get_application_default ( ) #NEWLINE# #UNINDENT# return credentials