def __eq__(self, other):
if self is other:<EOL><INDENT>return True<EOL><DEDENT>try:<EOL><INDENT>if dict(self) == dict(other):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>except (TypeError, ValueError):<EOL><INDENT>pass<EOL><DEDENT>return False<EOL>
Test for equality with another python object.

Example:

..code-block:: python

    u = User('1')
    assert(u == {'_key': '1', 'name': 'Bob'})
    assert(u == User('1'))

The object you pass in should be a dict or an object that can
be coerced into a dict, like another Struct.
Returns True if all the keys and values match up.

:param other: can be another dictionary, or a Struct.
:return: bool