#NEWLINE# def __getitem__( self , key , * args , **kwargs ) : #NEWLINE# #INDENT# value = super ( BaseDict , self ) . __getitem__ ( key ) #NEWLINE# EmbeddedDocument = _import_class ( 'EmbeddedDocument' ) #NEWLINE# if ( isinstance ( value , EmbeddedDocument ) and ( value . _instance is None ) ) : #NEWLINE# #INDENT# value . _instance = self . _instance #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( not isinstance ( value , BaseDict ) ) and isinstance ( value , dict ) ) : #NEWLINE# #INDENT# value = BaseDict ( value , None , ( '%s.%s' % ( self . _name , key ) ) ) #NEWLINE# super ( BaseDict , self ) . __setitem__ ( key , value ) #NEWLINE# value . _instance = self . _instance #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( not isinstance ( value , BaseList ) ) and isinstance ( value , list ) ) : #NEWLINE# #INDENT# value = BaseList ( value , None , ( '%s.%s' % ( self . _name , key ) ) ) #NEWLINE# super ( BaseDict , self ) . __setitem__ ( key , value ) #NEWLINE# value . _instance = self . _instance #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return value