#NEWLINE# @ classmethod #NEWLINE# def _read_options( mcs , name , bases , attrs ) : #NEWLINE# #INDENT# '\n        Parses `ModelOptions` instance into the options value attached to\n        `Model` instances.\n        ' #NEWLINE# options_members = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for base in reversed ( bases ) : #NEWLINE# #INDENT# if hasattr ( base , '_options' ) : #NEWLINE# #INDENT# for ( key , value ) in inspect . getmembers ( base . _options ) : #NEWLINE# #INDENT# if ( ( not key . startswith ( '_' ) ) and ( not ( key == 'klass' ) ) ) : #NEWLINE# #INDENT# options_members [ key ] = value #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# options_class = attrs . get ( '__optionsclass__' , ModelOptions ) #NEWLINE# if ( 'Options' in attrs ) : #NEWLINE# #INDENT# for ( key , value ) in inspect . getmembers ( attrs [ 'Options' ] ) : #NEWLINE# #INDENT# if ( not key . startswith ( '_' ) ) : #NEWLINE# #INDENT# if ( key == 'roles' ) : #NEWLINE# #INDENT# roles = options_members . get ( 'roles' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) . copy ( ) #NEWLINE# roles . update ( value ) #NEWLINE# options_members [ 'roles' ] = roles #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# options_members [ key ] = value #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return options_class ( mcs , ** base )