def __setitem__(self, item, value):
item2, single = convert_index_to_keys(self, item)<EOL>super_setitem = super(IndexDict, self).__setitem__<EOL>if single:<EOL><INDENT>super_setitem(item2, value)<EOL><DEDENT>else:<EOL><INDENT>if len(item2) != len(value):<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' % (len(item2), item, len(value)))<EOL><DEDENT>map(IndexDict_check_key_type, item2)<EOL>return map(super_setitem, item2, value)<EOL><DEDENT>
Set one or more items using flexible indexing.

The slice and int syntax (including int in the tuple/list syntax) can
only be used to change values of existing keys, rather than set values
for new keys.