#NEWLINE# def get_image_from_system_metadata( system_meta ) : #NEWLINE# #INDENT# image_meta = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# properties = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( not isinstance ( system_meta , dict ) ) : #NEWLINE# #INDENT# system_meta = metadata_to_dict ( system_meta , include_deleted = True ) #NEWLINE# #UNINDENT# for ( key , value ) in six . iteritems ( system_meta ) : #NEWLINE# #INDENT# if ( value is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if key . startswith ( SM_IMAGE_PROP_PREFIX ) : #NEWLINE# #INDENT# key = key [ len ( SM_IMAGE_PROP_PREFIX ) : ] #NEWLINE# #UNINDENT# if ( key in SM_SKIP_KEYS ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( key in SM_INHERITABLE_KEYS ) : #NEWLINE# #INDENT# image_meta [ key ] = value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# properties [ key ] = value #NEWLINE# #UNINDENT# #UNINDENT# image_meta [ 'properties' ] = properties #NEWLINE# return image_meta