We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Simplify emoji code
This pull requests contains the squashed changes from #894 (thanks
@bakonydraco!) and provides some simplifications so that we have a base set of
features to work with and can subsequently make additions or modifications as
necessary.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `praw/models/reddit/emoji.py`
Content:
```
1 """Provide the Emoji class."""
2 import os
3 
4 from ...const import API_PATH
5 from ...exceptions import ClientException
6 from .base import RedditBase
7 
8 
9 class Emoji(RedditBase):
10     """An individual Emoji object."""
11 
12     __hash__ = RedditBase.__hash__
13     STR_FIELD = 'name'
14 
15     def __init__(self, reddit, subreddit, name, _data=None):
16         """Construct an instance of the Emoji object."""
17         self.name = name
18         self.subreddit = subreddit
19         super(Emoji, self).__init__(reddit, _data)
20 
21     def _fetch(self):
22         for emoji in self.subreddit.emoji:
23             if emoji.name.lower() == self.name.lower():
24                 self.__dict__.update(emoji.__dict__)
25                 self._fetched = True
26                 return
27         raise ClientException('/r/{} does not have the emoji {}'
28                               .format(self.subreddit, self.name))
29 
30     def delete(self):
31         """Delete an emoji from this subreddit by Emoji.
32 
33         To delete ``'test'`` as an emoji on the subreddit ``'praw_test'`` try:
34 
35         .. code:: python
36 
37            reddit.subreddit('praw_test').emoji['test'].delete()
38 
39         """
40         url = API_PATH['emoji_delete'].format(
41             emoji_name=self.name, subreddit=self.subreddit)
42         self._reddit.request('DELETE', url)
43 
44 
45 class SubredditEmoji(RedditBase):
46     """Provides a set of functions to a Subreddit for emoji."""
47 
48     __hash__ = RedditBase.__hash__
49 
50     def __getitem__(self, name):
51         """Lazily return the Emoji for the subreddit named ``name``.
52 
53         :param name: The name of the emoji
54 
55         This method is to be used to fetch a specific emoji url, like so:
56 
57         .. code:: python
58 
59            emoji = reddit.subreddit('praw_test').emoji['test']
60            print(emoji)
61 
62         """
63         return Emoji(self._reddit, self.subreddit, name)
64 
65     def __init__(self, subreddit):
66         """Create a SubredditEmoji instance.
67 
68         :param subreddit: The subreddit whose emoji are affected.
69 
70         """
71         self.subreddit = subreddit
72         super(SubredditEmoji, self).__init__(subreddit._reddit, None)
73 
74     def __iter__(self):
75         """Return a list of Emoji for the subreddit.
76 
77         This method is to be used to discover all emoji for a subreddit:
78 
79         .. code:: python
80 
81            for emoji in reddit.subreddit('praw_test').emoji:
82                print(emoji)
83 
84         """
85         response = self.subreddit._reddit.get(
86             API_PATH['emoji_list'].format(subreddit=self.subreddit))
87         for emoji_name, emoji_data in \
88                 response[self.subreddit.fullname].items():
89             yield Emoji(self._reddit, self.subreddit, emoji_name,
90                         _data=emoji_data)
91 
92     def add(self, name, image_path):
93         """Add an emoji to this subreddit.
94 
95         :param name: The name of the emoji
96         :param image_path: A path to a jpeg or png image.
97         :returns: The Emoji added.
98 
99         To add ``'test'`` to the subreddit ``'praw_test'`` try:
100 
101         .. code:: python
102 
103            reddit.subreddit('praw_test').emoji.add('test','test.png')
104 
105         """
106         data = {'filepath': os.path.basename(image_path),
107                 'mimetype': 'image/jpeg'}
108         if image_path.lower().endswith('.png'):
109             data['mimetype'] = 'image/png'
110         url = API_PATH['emoji_lease'].format(subreddit=self.subreddit)
111 
112         # until we learn otherwise, assume this request always succeeds
113         upload_lease = self._reddit.post(url, data=data)['s3UploadLease']
114         upload_data = {item['name']: item['value']
115                        for item in upload_lease['fields']}
116         upload_url = 'https:{}'.format(upload_lease['action'])
117 
118         with open(image_path, 'rb') as image:
119             response = self._reddit._core._requestor._http.post(
120                 upload_url, data=upload_data, files={'file': image})
121         response.raise_for_status()
122 
123         url = API_PATH['emoji_upload'].format(
124             subreddit=self.subreddit)
125         self._reddit.post(url,
126                           data={'name': name, 's3_key': upload_data['key']})
127         return Emoji(self._reddit, self.subreddit, name)
128
```
--- 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/praw/models/reddit/emoji.py b/praw/models/reddit/emoji.py
--- a/praw/models/reddit/emoji.py
+++ b/praw/models/reddit/emoji.py
@@ -9,9 +9,20 @@
 class Emoji(RedditBase):
     """An individual Emoji object."""
 
-    __hash__ = RedditBase.__hash__
     STR_FIELD = 'name'
 
+    def __eq__(self, other):
+        """Return whether the other instance equals the current."""
+        if isinstance(other, str):
+            return other == str(self)
+        return (isinstance(other, self.__class__) and
+                str(self) == str(other) and other.subreddit == self.subreddit)
+
+    def __hash__(self):
+        """Return the hash of the current instance."""
+        return (hash(self.__class__.__name__) ^ hash(str(self)) ^
+                hash(self.subreddit))
+
     def __init__(self, reddit, subreddit, name, _data=None):
         """Construct an instance of the Emoji object."""
         self.name = name
@@ -20,7 +31,7 @@
 
     def _fetch(self):
         for emoji in self.subreddit.emoji:
-            if emoji.name.lower() == self.name.lower():
+            if emoji.name == self.name:
                 self.__dict__.update(emoji.__dict__)
                 self._fetched = True
                 return

{"golden_diff": "diff --git a/praw/models/reddit/emoji.py b/praw/models/reddit/emoji.py\n--- a/praw/models/reddit/emoji.py\n+++ b/praw/models/reddit/emoji.py\n@@ -9,9 +9,20 @@\n class Emoji(RedditBase):\n     \"\"\"An individual Emoji object.\"\"\"\n \n-    __hash__ = RedditBase.__hash__\n     STR_FIELD = 'name'\n \n+    def __eq__(self, other):\n+        \"\"\"Return whether the other instance equals the current.\"\"\"\n+        if isinstance(other, str):\n+            return other == str(self)\n+        return (isinstance(other, self.__class__) and\n+                str(self) == str(other) and other.subreddit == self.subreddit)\n+\n+    def __hash__(self):\n+        \"\"\"Return the hash of the current instance.\"\"\"\n+        return (hash(self.__class__.__name__) ^ hash(str(self)) ^\n+                hash(self.subreddit))\n+\n     def __init__(self, reddit, subreddit, name, _data=None):\n         \"\"\"Construct an instance of the Emoji object.\"\"\"\n         self.name = name\n@@ -20,7 +31,7 @@\n \n     def _fetch(self):\n         for emoji in self.subreddit.emoji:\n-            if emoji.name.lower() == self.name.lower():\n+            if emoji.name == self.name:\n                 self.__dict__.update(emoji.__dict__)\n                 self._fetched = True\n                 return\n", "issue": "Simplify emoji code\nThis pull requests contains the squashed changes from #894 (thanks\n@bakonydraco!) and provides some simplifications so that we have a base set of\nfeatures to work with and can subsequently make additions or modifications as\nnecessary.\n", "before_files": [{"content": "\"\"\"Provide the Emoji class.\"\"\"\nimport os\n\nfrom ...const import API_PATH\nfrom ...exceptions import ClientException\nfrom .base import RedditBase\n\n\nclass Emoji(RedditBase):\n    \"\"\"An individual Emoji object.\"\"\"\n\n    __hash__ = RedditBase.__hash__\n    STR_FIELD = 'name'\n\n    def __init__(self, reddit, subreddit, name, _data=None):\n        \"\"\"Construct an instance of the Emoji object.\"\"\"\n        self.name = name\n        self.subreddit = subreddit\n        super(Emoji, self).__init__(reddit, _data)\n\n    def _fetch(self):\n        for emoji in self.subreddit.emoji:\n            if emoji.name.lower() == self.name.lower():\n                self.__dict__.update(emoji.__dict__)\n                self._fetched = True\n                return\n        raise ClientException('/r/{} does not have the emoji {}'\n                              .format(self.subreddit, self.name))\n\n    def delete(self):\n        \"\"\"Delete an emoji from this subreddit by Emoji.\n\n        To delete ``'test'`` as an emoji on the subreddit ``'praw_test'`` try:\n\n        .. code:: python\n\n           reddit.subreddit('praw_test').emoji['test'].delete()\n\n        \"\"\"\n        url = API_PATH['emoji_delete'].format(\n            emoji_name=self.name, subreddit=self.subreddit)\n        self._reddit.request('DELETE', url)\n\n\nclass SubredditEmoji(RedditBase):\n    \"\"\"Provides a set of functions to a Subreddit for emoji.\"\"\"\n\n    __hash__ = RedditBase.__hash__\n\n    def __getitem__(self, name):\n        \"\"\"Lazily return the Emoji for the subreddit named ``name``.\n\n        :param name: The name of the emoji\n\n        This method is to be used to fetch a specific emoji url, like so:\n\n        .. code:: python\n\n           emoji = reddit.subreddit('praw_test').emoji['test']\n           print(emoji)\n\n        \"\"\"\n        return Emoji(self._reddit, self.subreddit, name)\n\n    def __init__(self, subreddit):\n        \"\"\"Create a SubredditEmoji instance.\n\n        :param subreddit: The subreddit whose emoji are affected.\n\n        \"\"\"\n        self.subreddit = subreddit\n        super(SubredditEmoji, self).__init__(subreddit._reddit, None)\n\n    def __iter__(self):\n        \"\"\"Return a list of Emoji for the subreddit.\n\n        This method is to be used to discover all emoji for a subreddit:\n\n        .. code:: python\n\n           for emoji in reddit.subreddit('praw_test').emoji:\n               print(emoji)\n\n        \"\"\"\n        response = self.subreddit._reddit.get(\n            API_PATH['emoji_list'].format(subreddit=self.subreddit))\n        for emoji_name, emoji_data in \\\n                response[self.subreddit.fullname].items():\n            yield Emoji(self._reddit, self.subreddit, emoji_name,\n                        _data=emoji_data)\n\n    def add(self, name, image_path):\n        \"\"\"Add an emoji to this subreddit.\n\n        :param name: The name of the emoji\n        :param image_path: A path to a jpeg or png image.\n        :returns: The Emoji added.\n\n        To add ``'test'`` to the subreddit ``'praw_test'`` try:\n\n        .. code:: python\n\n           reddit.subreddit('praw_test').emoji.add('test','test.png')\n\n        \"\"\"\n        data = {'filepath': os.path.basename(image_path),\n                'mimetype': 'image/jpeg'}\n        if image_path.lower().endswith('.png'):\n            data['mimetype'] = 'image/png'\n        url = API_PATH['emoji_lease'].format(subreddit=self.subreddit)\n\n        # until we learn otherwise, assume this request always succeeds\n        upload_lease = self._reddit.post(url, data=data)['s3UploadLease']\n        upload_data = {item['name']: item['value']\n                       for item in upload_lease['fields']}\n        upload_url = 'https:{}'.format(upload_lease['action'])\n\n        with open(image_path, 'rb') as image:\n            response = self._reddit._core._requestor._http.post(\n                upload_url, data=upload_data, files={'file': image})\n        response.raise_for_status()\n\n        url = API_PATH['emoji_upload'].format(\n            subreddit=self.subreddit)\n        self._reddit.post(url,\n                          data={'name': name, 's3_key': upload_data['key']})\n        return Emoji(self._reddit, self.subreddit, name)\n", "path": "praw/models/reddit/emoji.py"}], "after_files": [{"content": "\"\"\"Provide the Emoji class.\"\"\"\nimport os\n\nfrom ...const import API_PATH\nfrom ...exceptions import ClientException\nfrom .base import RedditBase\n\n\nclass Emoji(RedditBase):\n    \"\"\"An individual Emoji object.\"\"\"\n\n    STR_FIELD = 'name'\n\n    def __eq__(self, other):\n        \"\"\"Return whether the other instance equals the current.\"\"\"\n        if isinstance(other, str):\n            return other == str(self)\n        return (isinstance(other, self.__class__) and\n                str(self) == str(other) and other.subreddit == self.subreddit)\n\n    def __hash__(self):\n        \"\"\"Return the hash of the current instance.\"\"\"\n        return (hash(self.__class__.__name__) ^ hash(str(self)) ^\n                hash(self.subreddit))\n\n    def __init__(self, reddit, subreddit, name, _data=None):\n        \"\"\"Construct an instance of the Emoji object.\"\"\"\n        self.name = name\n        self.subreddit = subreddit\n        super(Emoji, self).__init__(reddit, _data)\n\n    def _fetch(self):\n        for emoji in self.subreddit.emoji:\n            if emoji.name == self.name:\n                self.__dict__.update(emoji.__dict__)\n                self._fetched = True\n                return\n        raise ClientException('/r/{} does not have the emoji {}'\n                              .format(self.subreddit, self.name))\n\n    def delete(self):\n        \"\"\"Delete an emoji from this subreddit by Emoji.\n\n        To delete ``'test'`` as an emoji on the subreddit ``'praw_test'`` try:\n\n        .. code:: python\n\n           reddit.subreddit('praw_test').emoji['test'].delete()\n\n        \"\"\"\n        url = API_PATH['emoji_delete'].format(\n            emoji_name=self.name, subreddit=self.subreddit)\n        self._reddit.request('DELETE', url)\n\n\nclass SubredditEmoji(RedditBase):\n    \"\"\"Provides a set of functions to a Subreddit for emoji.\"\"\"\n\n    __hash__ = RedditBase.__hash__\n\n    def __getitem__(self, name):\n        \"\"\"Lazily return the Emoji for the subreddit named ``name``.\n\n        :param name: The name of the emoji\n\n        This method is to be used to fetch a specific emoji url, like so:\n\n        .. code:: python\n\n           emoji = reddit.subreddit('praw_test').emoji['test']\n           print(emoji)\n\n        \"\"\"\n        return Emoji(self._reddit, self.subreddit, name)\n\n    def __init__(self, subreddit):\n        \"\"\"Create a SubredditEmoji instance.\n\n        :param subreddit: The subreddit whose emoji are affected.\n\n        \"\"\"\n        self.subreddit = subreddit\n        super(SubredditEmoji, self).__init__(subreddit._reddit, None)\n\n    def __iter__(self):\n        \"\"\"Return a list of Emoji for the subreddit.\n\n        This method is to be used to discover all emoji for a subreddit:\n\n        .. code:: python\n\n           for emoji in reddit.subreddit('praw_test').emoji:\n               print(emoji)\n\n        \"\"\"\n        response = self.subreddit._reddit.get(\n            API_PATH['emoji_list'].format(subreddit=self.subreddit))\n        for emoji_name, emoji_data in \\\n                response[self.subreddit.fullname].items():\n            yield Emoji(self._reddit, self.subreddit, emoji_name,\n                        _data=emoji_data)\n\n    def add(self, name, image_path):\n        \"\"\"Add an emoji to this subreddit.\n\n        :param name: The name of the emoji\n        :param image_path: A path to a jpeg or png image.\n        :returns: The Emoji added.\n\n        To add ``'test'`` to the subreddit ``'praw_test'`` try:\n\n        .. code:: python\n\n           reddit.subreddit('praw_test').emoji.add('test','test.png')\n\n        \"\"\"\n        data = {'filepath': os.path.basename(image_path),\n                'mimetype': 'image/jpeg'}\n        if image_path.lower().endswith('.png'):\n            data['mimetype'] = 'image/png'\n        url = API_PATH['emoji_lease'].format(subreddit=self.subreddit)\n\n        # until we learn otherwise, assume this request always succeeds\n        upload_lease = self._reddit.post(url, data=data)['s3UploadLease']\n        upload_data = {item['name']: item['value']\n                       for item in upload_lease['fields']}\n        upload_url = 'https:{}'.format(upload_lease['action'])\n\n        with open(image_path, 'rb') as image:\n            response = self._reddit._core._requestor._http.post(\n                upload_url, data=upload_data, files={'file': image})\n        response.raise_for_status()\n\n        url = API_PATH['emoji_upload'].format(\n            subreddit=self.subreddit)\n        self._reddit.post(url,\n                          data={'name': name, 's3_key': upload_data['key']})\n        return Emoji(self._reddit, self.subreddit, name)\n", "path": "praw/models/reddit/emoji.py"}]}