#NEWLINE# @ classmethod #NEWLINE# def update_offloading_modes( cls , instance , new_modes , keep_states = False ) : #NEWLINE# #INDENT# 'Update information about offloading modes for the interface.\n\n        :param instance: Interface object\n        :param new_modes: New offloading modes\n        :param keep_states: If True, information about available modes will be\n               updated, but states configured by user will not be overwritten.\n        ' #NEWLINE# if keep_states : #NEWLINE# #INDENT# old_modes_states = instance . offloading_modes_as_flat_dict ( instance . offloading_modes ) #NEWLINE# for mode in new_modes : #NEWLINE# #INDENT# if ( mode [ 'name' ] in old_modes_states ) : #NEWLINE# #INDENT# mode [ 'state' ] = old_modes_states [ mode [ 'name' ] ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# instance . offloading_modes = keep_states