def update_without_overwrite(d, *args, **kwds):
if args:<EOL><INDENT>assert len(args) == <NUM_LIT:1>,'<STR_LIT>'.format(args)<EOL>(other,) = args<EOL>if isinstance(other, Mapping):<EOL><INDENT>for key in other:<EOL><INDENT>setitem_without_overwrite(d, key, other[key])<EOL><DEDENT><DEDENT>elif hasattr(other, "<STR_LIT>"):<EOL><INDENT>for key in other.keys():<EOL><INDENT>setitem_without_overwrite(d, key, other[key])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for key, value in other:<EOL><INDENT>setitem_without_overwrite(d, key, value)<EOL><DEDENT><DEDENT><DEDENT>for key, value in kwds.items():<EOL><INDENT>setitem_without_overwrite(d, key, value)<EOL><DEDENT>
This has the same interface as dict.update except it uses
setitem_without_overwrite for all updates.

Note: The implementation is derived from
collections.MutableMapping.update.