def __eq__(self, other):
if not isinstance(other, Mapping):<EOL><INDENT>return NotImplemented<EOL><DEDENT>is_MIMapping = isinstance(other, MIMapping)<EOL>if not is_MIMapping: <EOL><INDENT>if len(self.indices) not in [<NUM_LIT:0>,<NUM_LIT:2>]:<EOL><INDENT>return False <EOL><DEDENT><DEDENT>eq = super(MIMapping, self).__eq__(other)<EOL>if not eq:<EOL><INDENT>return False<EOL><DEDENT>if is_MIMapping:<EOL><INDENT>eq = force_list(self.indices.keys()) == force_list(other.indices.keys())<EOL><DEDENT>return eq<EOL>
Test for equality with ``other``.

if ``other`` is a regular mapping/dict, compare only order-insensitive keys/values.
if ``other`` is also a OrderedDict, also compare the order of keys.
if ``other`` is also a MIDict, also compare the index names.