def update(self, *args, **kwargs):
if not self:<EOL><INDENT>self._dict_update(*args, **kwargs)<EOL>self._list_update(self._iter())<EOL>return<EOL><DEDENT>if not kwargs and len(args) == <NUM_LIT:1> and isinstance(args[<NUM_LIT:0>], dict):<EOL><INDENT>pairs = args[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>pairs = dict(*args, **kwargs)<EOL><DEDENT>if (<NUM_LIT:10> * len(pairs)) > len(self):<EOL><INDENT>self._dict_update(pairs)<EOL>self._list_clear()<EOL>self._list_update(self._iter())<EOL><DEDENT>else:<EOL><INDENT>for key in pairs:<EOL><INDENT>self[key] = pairs[key]<EOL><DEDENT><DEDENT>
Update the dictionary with the key/value pairs from *other*, overwriting
existing keys.

*update* accepts either another dictionary object or an iterable of
key/value pairs (as a tuple or other iterable of length two).  If
keyword arguments are specified, the dictionary is then updated with
those key/value pairs: ``d.update(red=1, blue=2)``.