We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Should we compare Entity._meanings in __eq__
/cc @tseaver @pcostell 


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `gcloud/datastore/entity.py`
Content:
```
1 # Copyright 2014 Google Inc. All rights reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 """Class for representing a single entity in the Cloud Datastore."""
16 
17 
18 from gcloud._helpers import _ensure_tuple_or_list
19 
20 
21 class Entity(dict):
22     """Entities are akin to rows in a relational database
23 
24     An entity storing the actual instance of data.
25 
26     Each entity is officially represented with a
27     :class:`gcloud.datastore.key.Key` class, however it is possible that
28     you might create an Entity with only a partial Key (that is, a Key
29     with a Kind, and possibly a parent, but without an ID).  In such a
30     case, the datastore service will automatically assign an ID to the
31     partial key.
32 
33     Entities in this API act like dictionaries with extras built in that
34     allow you to delete or persist the data stored on the entity.
35 
36     Entities are mutable and act like a subclass of a dictionary.
37     This means you could take an existing entity and change the key
38     to duplicate the object.
39 
40     Use :func:`gcloud.datastore.get` to retrieve an existing entity.
41 
42       >>> datastore.get(key)
43       <Entity[{'kind': 'EntityKind', id: 1234}] {'property': 'value'}>
44 
45     You can the set values on the entity just like you would on any
46     other dictionary.
47 
48     >>> entity['age'] = 20
49     >>> entity['name'] = 'JJ'
50     >>> entity
51     <Entity[{'kind': 'EntityKind', id: 1234}] {'age': 20, 'name': 'JJ'}>
52 
53     And you can convert an entity to a regular Python dictionary with the
54     ``dict`` builtin:
55 
56     >>> dict(entity)
57     {'age': 20, 'name': 'JJ'}
58 
59     .. note::
60 
61        When saving an entity to the backend, values which are "text"
62        (``unicode`` in Python2, ``str`` in Python3) will be saved using
63        the 'text_value' field, after being encoded to UTF-8.  When
64        retrieved from the back-end, such values will be decoded to "text"
65        again.  Values which are "bytes" (``str`` in Python2, ``bytes`` in
66        Python3), will be saved using the 'blob_value' field, without
67        any decoding / encoding step.
68 
69     :type key: :class:`gcloud.datastore.key.Key`
70     :param key: Optional key to be set on entity. Required for
71                 :func:`gcloud.datastore.put()` and
72                 :func:`gcloud.datastore.put_multi()`
73 
74     :type exclude_from_indexes: tuple of string
75     :param exclude_from_indexes: Names of fields whose values are not to be
76                                  indexed for this entity.
77     """
78 
79     def __init__(self, key=None, exclude_from_indexes=()):
80         super(Entity, self).__init__()
81         self.key = key
82         self._exclude_from_indexes = set(_ensure_tuple_or_list(
83             'exclude_from_indexes', exclude_from_indexes))
84         # NOTE: This will be populated when parsing a protobuf in
85         #       gcloud.datastore.helpers.entity_from_protobuf.
86         self._meanings = {}
87 
88     def __eq__(self, other):
89         """Compare two entities for equality.
90 
91         Entities compare equal if their keys compare equal, and their
92         properties compare equal.
93 
94         :rtype: boolean
95         :returns: True if the entities compare equal, else False.
96         """
97         if not isinstance(other, Entity):
98             return False
99 
100         return (self.key == other.key and
101                 super(Entity, self).__eq__(other))
102 
103     def __ne__(self, other):
104         """Compare two entities for inequality.
105 
106         Entities compare equal if their keys compare equal, and their
107         properties compare equal.
108 
109         :rtype: boolean
110         :returns: False if the entities compare equal, else True.
111         """
112         return not self.__eq__(other)
113 
114     @property
115     def kind(self):
116         """Get the kind of the current entity.
117 
118         .. note::
119           This relies entirely on the :class:`gcloud.datastore.key.Key`
120           set on the entity.  That means that we're not storing the kind
121           of the entity at all, just the properties and a pointer to a
122           Key which knows its Kind.
123         """
124         if self.key:
125             return self.key.kind
126 
127     @property
128     def exclude_from_indexes(self):
129         """Names of fields which are *not* to be indexed for this entity.
130 
131         :rtype: sequence of field names
132         """
133         return frozenset(self._exclude_from_indexes)
134 
135     def __repr__(self):
136         if self.key:
137             return '<Entity%s %s>' % (self.key.path,
138                                       super(Entity, self).__repr__())
139         else:
140             return '<Entity %s>' % (super(Entity, self).__repr__())
141
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/gcloud/datastore/entity.py b/gcloud/datastore/entity.py
--- a/gcloud/datastore/entity.py
+++ b/gcloud/datastore/entity.py
@@ -98,6 +98,8 @@
             return False
 
         return (self.key == other.key and
+                self._exclude_from_indexes == other._exclude_from_indexes and
+                self._meanings == other._meanings and
                 super(Entity, self).__eq__(other))
 
     def __ne__(self, other):

{"golden_diff": "diff --git a/gcloud/datastore/entity.py b/gcloud/datastore/entity.py\n--- a/gcloud/datastore/entity.py\n+++ b/gcloud/datastore/entity.py\n@@ -98,6 +98,8 @@\n             return False\n \n         return (self.key == other.key and\n+                self._exclude_from_indexes == other._exclude_from_indexes and\n+                self._meanings == other._meanings and\n                 super(Entity, self).__eq__(other))\n \n     def __ne__(self, other):\n", "issue": "Should we compare Entity._meanings in __eq__\n/cc @tseaver @pcostell \n\n", "before_files": [{"content": "# Copyright 2014 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Class for representing a single entity in the Cloud Datastore.\"\"\"\n\n\nfrom gcloud._helpers import _ensure_tuple_or_list\n\n\nclass Entity(dict):\n    \"\"\"Entities are akin to rows in a relational database\n\n    An entity storing the actual instance of data.\n\n    Each entity is officially represented with a\n    :class:`gcloud.datastore.key.Key` class, however it is possible that\n    you might create an Entity with only a partial Key (that is, a Key\n    with a Kind, and possibly a parent, but without an ID).  In such a\n    case, the datastore service will automatically assign an ID to the\n    partial key.\n\n    Entities in this API act like dictionaries with extras built in that\n    allow you to delete or persist the data stored on the entity.\n\n    Entities are mutable and act like a subclass of a dictionary.\n    This means you could take an existing entity and change the key\n    to duplicate the object.\n\n    Use :func:`gcloud.datastore.get` to retrieve an existing entity.\n\n      >>> datastore.get(key)\n      <Entity[{'kind': 'EntityKind', id: 1234}] {'property': 'value'}>\n\n    You can the set values on the entity just like you would on any\n    other dictionary.\n\n    >>> entity['age'] = 20\n    >>> entity['name'] = 'JJ'\n    >>> entity\n    <Entity[{'kind': 'EntityKind', id: 1234}] {'age': 20, 'name': 'JJ'}>\n\n    And you can convert an entity to a regular Python dictionary with the\n    ``dict`` builtin:\n\n    >>> dict(entity)\n    {'age': 20, 'name': 'JJ'}\n\n    .. note::\n\n       When saving an entity to the backend, values which are \"text\"\n       (``unicode`` in Python2, ``str`` in Python3) will be saved using\n       the 'text_value' field, after being encoded to UTF-8.  When\n       retrieved from the back-end, such values will be decoded to \"text\"\n       again.  Values which are \"bytes\" (``str`` in Python2, ``bytes`` in\n       Python3), will be saved using the 'blob_value' field, without\n       any decoding / encoding step.\n\n    :type key: :class:`gcloud.datastore.key.Key`\n    :param key: Optional key to be set on entity. Required for\n                :func:`gcloud.datastore.put()` and\n                :func:`gcloud.datastore.put_multi()`\n\n    :type exclude_from_indexes: tuple of string\n    :param exclude_from_indexes: Names of fields whose values are not to be\n                                 indexed for this entity.\n    \"\"\"\n\n    def __init__(self, key=None, exclude_from_indexes=()):\n        super(Entity, self).__init__()\n        self.key = key\n        self._exclude_from_indexes = set(_ensure_tuple_or_list(\n            'exclude_from_indexes', exclude_from_indexes))\n        # NOTE: This will be populated when parsing a protobuf in\n        #       gcloud.datastore.helpers.entity_from_protobuf.\n        self._meanings = {}\n\n    def __eq__(self, other):\n        \"\"\"Compare two entities for equality.\n\n        Entities compare equal if their keys compare equal, and their\n        properties compare equal.\n\n        :rtype: boolean\n        :returns: True if the entities compare equal, else False.\n        \"\"\"\n        if not isinstance(other, Entity):\n            return False\n\n        return (self.key == other.key and\n                super(Entity, self).__eq__(other))\n\n    def __ne__(self, other):\n        \"\"\"Compare two entities for inequality.\n\n        Entities compare equal if their keys compare equal, and their\n        properties compare equal.\n\n        :rtype: boolean\n        :returns: False if the entities compare equal, else True.\n        \"\"\"\n        return not self.__eq__(other)\n\n    @property\n    def kind(self):\n        \"\"\"Get the kind of the current entity.\n\n        .. note::\n          This relies entirely on the :class:`gcloud.datastore.key.Key`\n          set on the entity.  That means that we're not storing the kind\n          of the entity at all, just the properties and a pointer to a\n          Key which knows its Kind.\n        \"\"\"\n        if self.key:\n            return self.key.kind\n\n    @property\n    def exclude_from_indexes(self):\n        \"\"\"Names of fields which are *not* to be indexed for this entity.\n\n        :rtype: sequence of field names\n        \"\"\"\n        return frozenset(self._exclude_from_indexes)\n\n    def __repr__(self):\n        if self.key:\n            return '<Entity%s %s>' % (self.key.path,\n                                      super(Entity, self).__repr__())\n        else:\n            return '<Entity %s>' % (super(Entity, self).__repr__())\n", "path": "gcloud/datastore/entity.py"}], "after_files": [{"content": "# Copyright 2014 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Class for representing a single entity in the Cloud Datastore.\"\"\"\n\n\nfrom gcloud._helpers import _ensure_tuple_or_list\n\n\nclass Entity(dict):\n    \"\"\"Entities are akin to rows in a relational database\n\n    An entity storing the actual instance of data.\n\n    Each entity is officially represented with a\n    :class:`gcloud.datastore.key.Key` class, however it is possible that\n    you might create an Entity with only a partial Key (that is, a Key\n    with a Kind, and possibly a parent, but without an ID).  In such a\n    case, the datastore service will automatically assign an ID to the\n    partial key.\n\n    Entities in this API act like dictionaries with extras built in that\n    allow you to delete or persist the data stored on the entity.\n\n    Entities are mutable and act like a subclass of a dictionary.\n    This means you could take an existing entity and change the key\n    to duplicate the object.\n\n    Use :func:`gcloud.datastore.get` to retrieve an existing entity.\n\n      >>> datastore.get(key)\n      <Entity[{'kind': 'EntityKind', id: 1234}] {'property': 'value'}>\n\n    You can the set values on the entity just like you would on any\n    other dictionary.\n\n    >>> entity['age'] = 20\n    >>> entity['name'] = 'JJ'\n    >>> entity\n    <Entity[{'kind': 'EntityKind', id: 1234}] {'age': 20, 'name': 'JJ'}>\n\n    And you can convert an entity to a regular Python dictionary with the\n    ``dict`` builtin:\n\n    >>> dict(entity)\n    {'age': 20, 'name': 'JJ'}\n\n    .. note::\n\n       When saving an entity to the backend, values which are \"text\"\n       (``unicode`` in Python2, ``str`` in Python3) will be saved using\n       the 'text_value' field, after being encoded to UTF-8.  When\n       retrieved from the back-end, such values will be decoded to \"text\"\n       again.  Values which are \"bytes\" (``str`` in Python2, ``bytes`` in\n       Python3), will be saved using the 'blob_value' field, without\n       any decoding / encoding step.\n\n    :type key: :class:`gcloud.datastore.key.Key`\n    :param key: Optional key to be set on entity. Required for\n                :func:`gcloud.datastore.put()` and\n                :func:`gcloud.datastore.put_multi()`\n\n    :type exclude_from_indexes: tuple of string\n    :param exclude_from_indexes: Names of fields whose values are not to be\n                                 indexed for this entity.\n    \"\"\"\n\n    def __init__(self, key=None, exclude_from_indexes=()):\n        super(Entity, self).__init__()\n        self.key = key\n        self._exclude_from_indexes = set(_ensure_tuple_or_list(\n            'exclude_from_indexes', exclude_from_indexes))\n        # NOTE: This will be populated when parsing a protobuf in\n        #       gcloud.datastore.helpers.entity_from_protobuf.\n        self._meanings = {}\n\n    def __eq__(self, other):\n        \"\"\"Compare two entities for equality.\n\n        Entities compare equal if their keys compare equal, and their\n        properties compare equal.\n\n        :rtype: boolean\n        :returns: True if the entities compare equal, else False.\n        \"\"\"\n        if not isinstance(other, Entity):\n            return False\n\n        return (self.key == other.key and\n                self._exclude_from_indexes == other._exclude_from_indexes and\n                self._meanings == other._meanings and\n                super(Entity, self).__eq__(other))\n\n    def __ne__(self, other):\n        \"\"\"Compare two entities for inequality.\n\n        Entities compare equal if their keys compare equal, and their\n        properties compare equal.\n\n        :rtype: boolean\n        :returns: False if the entities compare equal, else True.\n        \"\"\"\n        return not self.__eq__(other)\n\n    @property\n    def kind(self):\n        \"\"\"Get the kind of the current entity.\n\n        .. note::\n          This relies entirely on the :class:`gcloud.datastore.key.Key`\n          set on the entity.  That means that we're not storing the kind\n          of the entity at all, just the properties and a pointer to a\n          Key which knows its Kind.\n        \"\"\"\n        if self.key:\n            return self.key.kind\n\n    @property\n    def exclude_from_indexes(self):\n        \"\"\"Names of fields which are *not* to be indexed for this entity.\n\n        :rtype: sequence of field names\n        \"\"\"\n        return frozenset(self._exclude_from_indexes)\n\n    def __repr__(self):\n        if self.key:\n            return '<Entity%s %s>' % (self.key.path,\n                                      super(Entity, self).__repr__())\n        else:\n            return '<Entity %s>' % (super(Entity, self).__repr__())\n", "path": "gcloud/datastore/entity.py"}]}