<s> import collections <EOL> def update ( d , u ) : <EOL> """<STR_LIT>""" <EOL> for k , v in u . iteritems ( ) : <EOL> if isinstance ( v , collections . Mapping ) : <EOL> r = update ( d . get ( k , { } ) , v ) <EOL> d [ k ] = r <EOL> else : <EOL> d [ k ] = u [ k ] <EOL> return d </s>
