def update(self, *args, **kw):
if len(args) > <NUM_LIT:1> and self.indices:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if not self.indices:  <EOL><INDENT>_MI_init(self, *args, **kw)<EOL>return<EOL><DEDENT>d = MIMapping(*args, **kw)<EOL>if not d.indices:<EOL><INDENT>return<EOL><DEDENT>names = force_list(self.indices.keys())<EOL>if len(d.indices) != len(names):<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(len(d.indices), len(names)))<EOL><DEDENT>for key in d:<EOL><INDENT>self[key] = d[key]<EOL><DEDENT>
Update the dictionary with items and names::

    (items, names, **kw)
    (dict, names, **kw)
    (MIDict, names, **kw)

Optional positional argument ``names`` is only allowed when ``self.indices``
is empty (no indices are set yet).