We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
reddit.subreddit.mod.removal_reasons isn't indexed in display order
### Describe the Bug

reddit.subreddit.mod.removal_reasons isn't indexed in display order

### Desired Result

reddit.subreddit.mod.removal_reasons should be indexed in display order

### Relevant Logs

_No response_

### Code to reproduce the bug

_No response_

### My code example does not include the `Reddit()` initialization to prevent credential leakage.

Yes

### This code has previously worked as intended.

Yes

### Operating System/Environment

windows

### Python Version

python 3.9.1

### PRAW Version

7.4.0

### Prawcore Version

2.3.0

### Anything else?

_No response_

--- 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/removal_reasons.py`
Content:
```
1 """Provide the Removal Reason class."""
2 from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Union
3 from warnings import warn
4 
5 from ...const import API_PATH
6 from ...exceptions import ClientException
7 from ...util import _deprecate_args, cachedproperty
8 from .base import RedditBase
9 
10 if TYPE_CHECKING:  # pragma: no cover
11     import praw
12 
13 
14 class RemovalReason(RedditBase):
15     """An individual Removal Reason object.
16 
17     .. include:: ../../typical_attributes.rst
18 
19     =========== ==================================
20     Attribute   Description
21     =========== ==================================
22     ``id``      The ID of the removal reason.
23     ``message`` The message of the removal reason.
24     ``title``   The title of the removal reason.
25     =========== ==================================
26 
27     """
28 
29     STR_FIELD = "id"
30 
31     @staticmethod
32     def _warn_reason_id(*, id_value: Optional[str], reason_id_value: Optional[str]):
33         """Reason ID param is deprecated. Warns if it's used.
34 
35         :param id_value: Returns the actual value of parameter ``id`` is parameter
36             ``reason_id`` is not used.
37         :param reason_id_value: The value passed as parameter ``reason_id``.
38 
39         """
40         if reason_id_value is not None:
41             warn(
42                 "Parameter 'reason_id' is deprecated. Either use positional arguments"
43                 ' (e.g., reason_id="x" -> "x") or change the parameter name to \'id\''
44                 ' (e.g., reason_id="x" -> id="x"). This parameter will be removed in'
45                 " PRAW 8.",
46                 category=DeprecationWarning,
47                 stacklevel=3,
48             )
49             return reason_id_value
50         return id_value
51 
52     def __eq__(self, other: Union[str, "RemovalReason"]) -> bool:
53         """Return whether the other instance equals the current."""
54         if isinstance(other, str):
55             return other == str(self)
56         return isinstance(other, self.__class__) and str(self) == str(other)
57 
58     def __hash__(self) -> int:
59         """Return the hash of the current instance."""
60         return hash(self.__class__.__name__) ^ hash(str(self))
61 
62     def __init__(
63         self,
64         reddit: "praw.Reddit",
65         subreddit: "praw.models.Subreddit",
66         id: Optional[str] = None,  # pylint: disable=redefined-builtin
67         reason_id: Optional[str] = None,
68         _data: Optional[Dict[str, Any]] = None,
69     ):
70         """Initialize a :class:`.RemovalReason` instance.
71 
72         :param reddit: An instance of :class:`.Reddit`.
73         :param subreddit: An instance of :class:`.Subreddit`.
74         :param id: The ID of the removal reason.
75         :param reason_id: The original name of the ``id`` parameter. Used for backwards
76             compatibility. This parameter should not be used.
77 
78         """
79         id = self._warn_reason_id(id_value=id, reason_id_value=reason_id)
80         if (id, _data).count(None) != 1:
81             raise ValueError("Either id or _data needs to be given.")
82 
83         if id:
84             self.id = id
85         self.subreddit = subreddit
86         super().__init__(reddit, _data=_data)
87 
88     def _fetch(self):
89         for removal_reason in self.subreddit.mod.removal_reasons:
90             if removal_reason.id == self.id:
91                 self.__dict__.update(removal_reason.__dict__)
92                 self._fetched = True
93                 return
94         raise ClientException(
95             f"Subreddit {self.subreddit} does not have the removal reason {self.id}"
96         )
97 
98     def delete(self):
99         """Delete a removal reason from this subreddit.
100 
101         To delete ``"141vv5c16py7d"`` from r/test try:
102 
103         .. code-block:: python
104 
105             reddit.subreddit("test").mod.removal_reasons["141vv5c16py7d"].delete()
106 
107         """
108         url = API_PATH["removal_reason"].format(subreddit=self.subreddit, id=self.id)
109         self._reddit.delete(url)
110 
111     @_deprecate_args("message", "title")
112     def update(self, *, message: Optional[str] = None, title: Optional[str] = None):
113         """Update the removal reason from this subreddit.
114 
115         .. note::
116 
117             Existing values will be used for any unspecified arguments.
118 
119         :param message: The removal reason's new message.
120         :param title: The removal reason's new title.
121 
122         To update ``"141vv5c16py7d"`` from r/test try:
123 
124         .. code-block:: python
125 
126             reddit.subreddit("test").mod.removal_reasons["141vv5c16py7d"].update(
127                 title="New title", message="New message"
128             )
129 
130         """
131         url = API_PATH["removal_reason"].format(subreddit=self.subreddit, id=self.id)
132         data = {
133             name: getattr(self, name) if value is None else value
134             for name, value in {"message": message, "title": title}.items()
135         }
136         self._reddit.put(url, data=data)
137 
138 
139 class SubredditRemovalReasons:
140     """Provide a set of functions to a :class:`.Subreddit`'s removal reasons."""
141 
142     @cachedproperty
143     def _removal_reason_list(self) -> List[RemovalReason]:
144         """Get a list of Removal Reason objects.
145 
146         :returns: A list of instances of :class:`.RemovalReason`.
147 
148         """
149         response = self._reddit.get(
150             API_PATH["removal_reasons_list"].format(subreddit=self.subreddit)
151         )
152         return [
153             RemovalReason(self._reddit, self.subreddit, _data=reason_data)
154             for id, reason_data in response["data"].items()
155         ]
156 
157     def __getitem__(self, reason_id: Union[str, int, slice]) -> RemovalReason:
158         """Return the Removal Reason with the ID/number/slice ``reason_id``.
159 
160         :param reason_id: The ID or index of the removal reason
161 
162         .. note::
163 
164             Removal reasons fetched using a specific rule name are lazily loaded, so you
165             might have to access an attribute to get all the expected attributes.
166 
167         This method is to be used to fetch a specific removal reason, like so:
168 
169         .. code-block:: python
170 
171             reason_id = "141vv5c16py7d"
172             reason = reddit.subreddit("test").mod.removal_reasons[reason_id]
173             print(reason)
174 
175         You can also use indices to get a numbered removal reason. Since Python uses
176         0-indexing, the first removal reason is index 0, and so on.
177 
178         .. note::
179 
180             Both negative indices and slices can be used to interact with the removal
181             reasons.
182 
183         :raises: :py:class:`IndexError` if a removal reason of a specific number does
184             not exist.
185 
186         For example, to get the second removal reason of r/test:
187 
188         .. code-block:: python
189 
190             reason = reddit.subreddit("test").mod.removal_reasons[1]
191 
192         To get the last three removal reasons in a subreddit:
193 
194         .. code-block:: python
195 
196             reasons = reddit.subreddit("test").mod.removal_reasons[-3:]
197             for reason in reasons:
198                 print(reason)
199 
200         """
201         if not isinstance(reason_id, str):
202             return self._removal_reason_list[reason_id]
203         return RemovalReason(self._reddit, self.subreddit, reason_id)
204 
205     def __init__(self, subreddit: "praw.models.Subreddit"):
206         """Initialize a :class:`.SubredditRemovalReasons` instance.
207 
208         :param subreddit: The subreddit whose removal reasons to work with.
209 
210         """
211         self.subreddit = subreddit
212         self._reddit = subreddit._reddit
213 
214     def __iter__(self) -> Iterator[RemovalReason]:
215         """Return a list of Removal Reasons for the subreddit.
216 
217         This method is used to discover all removal reasons for a subreddit:
218 
219         .. code-block:: python
220 
221             for removal_reason in reddit.subreddit("test").mod.removal_reasons:
222                 print(removal_reason)
223 
224         """
225         return iter(self._removal_reason_list)
226 
227     @_deprecate_args("message", "title")
228     def add(self, *, message: str, title: str) -> RemovalReason:
229         """Add a removal reason to this subreddit.
230 
231         :param message: The message associated with the removal reason.
232         :param title: The title of the removal reason.
233 
234         :returns: The :class:`.RemovalReason` added.
235 
236         The message will be prepended with ``Hi u/username,`` automatically.
237 
238         To add ``"Test"`` to r/test try:
239 
240         .. code-block:: python
241 
242             reddit.subreddit("test").mod.removal_reasons.add(title="Test", message="Foobar")
243 
244         """
245         data = {"message": message, "title": title}
246         url = API_PATH["removal_reasons_list"].format(subreddit=self.subreddit)
247         id = self._reddit.post(url, data=data)
248         return RemovalReason(self._reddit, self.subreddit, id)
249
```
--- 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/removal_reasons.py b/praw/models/reddit/removal_reasons.py
--- a/praw/models/reddit/removal_reasons.py
+++ b/praw/models/reddit/removal_reasons.py
@@ -150,8 +150,10 @@
             API_PATH["removal_reasons_list"].format(subreddit=self.subreddit)
         )
         return [
-            RemovalReason(self._reddit, self.subreddit, _data=reason_data)
-            for id, reason_data in response["data"].items()
+            RemovalReason(
+                self._reddit, self.subreddit, _data=response["data"][reason_id]
+            )
+            for reason_id in response["order"]
         ]
 
     def __getitem__(self, reason_id: Union[str, int, slice]) -> RemovalReason:

{"golden_diff": "diff --git a/praw/models/reddit/removal_reasons.py b/praw/models/reddit/removal_reasons.py\n--- a/praw/models/reddit/removal_reasons.py\n+++ b/praw/models/reddit/removal_reasons.py\n@@ -150,8 +150,10 @@\n             API_PATH[\"removal_reasons_list\"].format(subreddit=self.subreddit)\n         )\n         return [\n-            RemovalReason(self._reddit, self.subreddit, _data=reason_data)\n-            for id, reason_data in response[\"data\"].items()\n+            RemovalReason(\n+                self._reddit, self.subreddit, _data=response[\"data\"][reason_id]\n+            )\n+            for reason_id in response[\"order\"]\n         ]\n \n     def __getitem__(self, reason_id: Union[str, int, slice]) -> RemovalReason:\n", "issue": "reddit.subreddit.mod.removal_reasons isn't indexed in display order\n### Describe the Bug\n\nreddit.subreddit.mod.removal_reasons isn't indexed in display order\n\n### Desired Result\n\nreddit.subreddit.mod.removal_reasons should be indexed in display order\n\n### Relevant Logs\n\n_No response_\n\n### Code to reproduce the bug\n\n_No response_\n\n### My code example does not include the `Reddit()` initialization to prevent credential leakage.\n\nYes\n\n### This code has previously worked as intended.\n\nYes\n\n### Operating System/Environment\n\nwindows\n\n### Python Version\n\npython 3.9.1\n\n### PRAW Version\n\n7.4.0\n\n### Prawcore Version\n\n2.3.0\n\n### Anything else?\n\n_No response_\n", "before_files": [{"content": "\"\"\"Provide the Removal Reason class.\"\"\"\nfrom typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Union\nfrom warnings import warn\n\nfrom ...const import API_PATH\nfrom ...exceptions import ClientException\nfrom ...util import _deprecate_args, cachedproperty\nfrom .base import RedditBase\n\nif TYPE_CHECKING:  # pragma: no cover\n    import praw\n\n\nclass RemovalReason(RedditBase):\n    \"\"\"An individual Removal Reason object.\n\n    .. include:: ../../typical_attributes.rst\n\n    =========== ==================================\n    Attribute   Description\n    =========== ==================================\n    ``id``      The ID of the removal reason.\n    ``message`` The message of the removal reason.\n    ``title``   The title of the removal reason.\n    =========== ==================================\n\n    \"\"\"\n\n    STR_FIELD = \"id\"\n\n    @staticmethod\n    def _warn_reason_id(*, id_value: Optional[str], reason_id_value: Optional[str]):\n        \"\"\"Reason ID param is deprecated. Warns if it's used.\n\n        :param id_value: Returns the actual value of parameter ``id`` is parameter\n            ``reason_id`` is not used.\n        :param reason_id_value: The value passed as parameter ``reason_id``.\n\n        \"\"\"\n        if reason_id_value is not None:\n            warn(\n                \"Parameter 'reason_id' is deprecated. Either use positional arguments\"\n                ' (e.g., reason_id=\"x\" -> \"x\") or change the parameter name to \\'id\\''\n                ' (e.g., reason_id=\"x\" -> id=\"x\"). This parameter will be removed in'\n                \" PRAW 8.\",\n                category=DeprecationWarning,\n                stacklevel=3,\n            )\n            return reason_id_value\n        return id_value\n\n    def __eq__(self, other: Union[str, \"RemovalReason\"]) -> bool:\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 str(self) == str(other)\n\n    def __hash__(self) -> int:\n        \"\"\"Return the hash of the current instance.\"\"\"\n        return hash(self.__class__.__name__) ^ hash(str(self))\n\n    def __init__(\n        self,\n        reddit: \"praw.Reddit\",\n        subreddit: \"praw.models.Subreddit\",\n        id: Optional[str] = None,  # pylint: disable=redefined-builtin\n        reason_id: Optional[str] = None,\n        _data: Optional[Dict[str, Any]] = None,\n    ):\n        \"\"\"Initialize a :class:`.RemovalReason` instance.\n\n        :param reddit: An instance of :class:`.Reddit`.\n        :param subreddit: An instance of :class:`.Subreddit`.\n        :param id: The ID of the removal reason.\n        :param reason_id: The original name of the ``id`` parameter. Used for backwards\n            compatibility. This parameter should not be used.\n\n        \"\"\"\n        id = self._warn_reason_id(id_value=id, reason_id_value=reason_id)\n        if (id, _data).count(None) != 1:\n            raise ValueError(\"Either id or _data needs to be given.\")\n\n        if id:\n            self.id = id\n        self.subreddit = subreddit\n        super().__init__(reddit, _data=_data)\n\n    def _fetch(self):\n        for removal_reason in self.subreddit.mod.removal_reasons:\n            if removal_reason.id == self.id:\n                self.__dict__.update(removal_reason.__dict__)\n                self._fetched = True\n                return\n        raise ClientException(\n            f\"Subreddit {self.subreddit} does not have the removal reason {self.id}\"\n        )\n\n    def delete(self):\n        \"\"\"Delete a removal reason from this subreddit.\n\n        To delete ``\"141vv5c16py7d\"`` from r/test try:\n\n        .. code-block:: python\n\n            reddit.subreddit(\"test\").mod.removal_reasons[\"141vv5c16py7d\"].delete()\n\n        \"\"\"\n        url = API_PATH[\"removal_reason\"].format(subreddit=self.subreddit, id=self.id)\n        self._reddit.delete(url)\n\n    @_deprecate_args(\"message\", \"title\")\n    def update(self, *, message: Optional[str] = None, title: Optional[str] = None):\n        \"\"\"Update the removal reason from this subreddit.\n\n        .. note::\n\n            Existing values will be used for any unspecified arguments.\n\n        :param message: The removal reason's new message.\n        :param title: The removal reason's new title.\n\n        To update ``\"141vv5c16py7d\"`` from r/test try:\n\n        .. code-block:: python\n\n            reddit.subreddit(\"test\").mod.removal_reasons[\"141vv5c16py7d\"].update(\n                title=\"New title\", message=\"New message\"\n            )\n\n        \"\"\"\n        url = API_PATH[\"removal_reason\"].format(subreddit=self.subreddit, id=self.id)\n        data = {\n            name: getattr(self, name) if value is None else value\n            for name, value in {\"message\": message, \"title\": title}.items()\n        }\n        self._reddit.put(url, data=data)\n\n\nclass SubredditRemovalReasons:\n    \"\"\"Provide a set of functions to a :class:`.Subreddit`'s removal reasons.\"\"\"\n\n    @cachedproperty\n    def _removal_reason_list(self) -> List[RemovalReason]:\n        \"\"\"Get a list of Removal Reason objects.\n\n        :returns: A list of instances of :class:`.RemovalReason`.\n\n        \"\"\"\n        response = self._reddit.get(\n            API_PATH[\"removal_reasons_list\"].format(subreddit=self.subreddit)\n        )\n        return [\n            RemovalReason(self._reddit, self.subreddit, _data=reason_data)\n            for id, reason_data in response[\"data\"].items()\n        ]\n\n    def __getitem__(self, reason_id: Union[str, int, slice]) -> RemovalReason:\n        \"\"\"Return the Removal Reason with the ID/number/slice ``reason_id``.\n\n        :param reason_id: The ID or index of the removal reason\n\n        .. note::\n\n            Removal reasons fetched using a specific rule name are lazily loaded, so you\n            might have to access an attribute to get all the expected attributes.\n\n        This method is to be used to fetch a specific removal reason, like so:\n\n        .. code-block:: python\n\n            reason_id = \"141vv5c16py7d\"\n            reason = reddit.subreddit(\"test\").mod.removal_reasons[reason_id]\n            print(reason)\n\n        You can also use indices to get a numbered removal reason. Since Python uses\n        0-indexing, the first removal reason is index 0, and so on.\n\n        .. note::\n\n            Both negative indices and slices can be used to interact with the removal\n            reasons.\n\n        :raises: :py:class:`IndexError` if a removal reason of a specific number does\n            not exist.\n\n        For example, to get the second removal reason of r/test:\n\n        .. code-block:: python\n\n            reason = reddit.subreddit(\"test\").mod.removal_reasons[1]\n\n        To get the last three removal reasons in a subreddit:\n\n        .. code-block:: python\n\n            reasons = reddit.subreddit(\"test\").mod.removal_reasons[-3:]\n            for reason in reasons:\n                print(reason)\n\n        \"\"\"\n        if not isinstance(reason_id, str):\n            return self._removal_reason_list[reason_id]\n        return RemovalReason(self._reddit, self.subreddit, reason_id)\n\n    def __init__(self, subreddit: \"praw.models.Subreddit\"):\n        \"\"\"Initialize a :class:`.SubredditRemovalReasons` instance.\n\n        :param subreddit: The subreddit whose removal reasons to work with.\n\n        \"\"\"\n        self.subreddit = subreddit\n        self._reddit = subreddit._reddit\n\n    def __iter__(self) -> Iterator[RemovalReason]:\n        \"\"\"Return a list of Removal Reasons for the subreddit.\n\n        This method is used to discover all removal reasons for a subreddit:\n\n        .. code-block:: python\n\n            for removal_reason in reddit.subreddit(\"test\").mod.removal_reasons:\n                print(removal_reason)\n\n        \"\"\"\n        return iter(self._removal_reason_list)\n\n    @_deprecate_args(\"message\", \"title\")\n    def add(self, *, message: str, title: str) -> RemovalReason:\n        \"\"\"Add a removal reason to this subreddit.\n\n        :param message: The message associated with the removal reason.\n        :param title: The title of the removal reason.\n\n        :returns: The :class:`.RemovalReason` added.\n\n        The message will be prepended with ``Hi u/username,`` automatically.\n\n        To add ``\"Test\"`` to r/test try:\n\n        .. code-block:: python\n\n            reddit.subreddit(\"test\").mod.removal_reasons.add(title=\"Test\", message=\"Foobar\")\n\n        \"\"\"\n        data = {\"message\": message, \"title\": title}\n        url = API_PATH[\"removal_reasons_list\"].format(subreddit=self.subreddit)\n        id = self._reddit.post(url, data=data)\n        return RemovalReason(self._reddit, self.subreddit, id)\n", "path": "praw/models/reddit/removal_reasons.py"}], "after_files": [{"content": "\"\"\"Provide the Removal Reason class.\"\"\"\nfrom typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Union\nfrom warnings import warn\n\nfrom ...const import API_PATH\nfrom ...exceptions import ClientException\nfrom ...util import _deprecate_args, cachedproperty\nfrom .base import RedditBase\n\nif TYPE_CHECKING:  # pragma: no cover\n    import praw\n\n\nclass RemovalReason(RedditBase):\n    \"\"\"An individual Removal Reason object.\n\n    .. include:: ../../typical_attributes.rst\n\n    =========== ==================================\n    Attribute   Description\n    =========== ==================================\n    ``id``      The ID of the removal reason.\n    ``message`` The message of the removal reason.\n    ``title``   The title of the removal reason.\n    =========== ==================================\n\n    \"\"\"\n\n    STR_FIELD = \"id\"\n\n    @staticmethod\n    def _warn_reason_id(*, id_value: Optional[str], reason_id_value: Optional[str]):\n        \"\"\"Reason ID param is deprecated. Warns if it's used.\n\n        :param id_value: Returns the actual value of parameter ``id`` is parameter\n            ``reason_id`` is not used.\n        :param reason_id_value: The value passed as parameter ``reason_id``.\n\n        \"\"\"\n        if reason_id_value is not None:\n            warn(\n                \"Parameter 'reason_id' is deprecated. Either use positional arguments\"\n                ' (e.g., reason_id=\"x\" -> \"x\") or change the parameter name to \\'id\\''\n                ' (e.g., reason_id=\"x\" -> id=\"x\"). This parameter will be removed in'\n                \" PRAW 8.\",\n                category=DeprecationWarning,\n                stacklevel=3,\n            )\n            return reason_id_value\n        return id_value\n\n    def __eq__(self, other: Union[str, \"RemovalReason\"]) -> bool:\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 str(self) == str(other)\n\n    def __hash__(self) -> int:\n        \"\"\"Return the hash of the current instance.\"\"\"\n        return hash(self.__class__.__name__) ^ hash(str(self))\n\n    def __init__(\n        self,\n        reddit: \"praw.Reddit\",\n        subreddit: \"praw.models.Subreddit\",\n        id: Optional[str] = None,  # pylint: disable=redefined-builtin\n        reason_id: Optional[str] = None,\n        _data: Optional[Dict[str, Any]] = None,\n    ):\n        \"\"\"Initialize a :class:`.RemovalReason` instance.\n\n        :param reddit: An instance of :class:`.Reddit`.\n        :param subreddit: An instance of :class:`.Subreddit`.\n        :param id: The ID of the removal reason.\n        :param reason_id: The original name of the ``id`` parameter. Used for backwards\n            compatibility. This parameter should not be used.\n\n        \"\"\"\n        id = self._warn_reason_id(id_value=id, reason_id_value=reason_id)\n        if (id, _data).count(None) != 1:\n            raise ValueError(\"Either id or _data needs to be given.\")\n\n        if id:\n            self.id = id\n        self.subreddit = subreddit\n        super().__init__(reddit, _data=_data)\n\n    def _fetch(self):\n        for removal_reason in self.subreddit.mod.removal_reasons:\n            if removal_reason.id == self.id:\n                self.__dict__.update(removal_reason.__dict__)\n                self._fetched = True\n                return\n        raise ClientException(\n            f\"Subreddit {self.subreddit} does not have the removal reason {self.id}\"\n        )\n\n    def delete(self):\n        \"\"\"Delete a removal reason from this subreddit.\n\n        To delete ``\"141vv5c16py7d\"`` from r/test try:\n\n        .. code-block:: python\n\n            reddit.subreddit(\"test\").mod.removal_reasons[\"141vv5c16py7d\"].delete()\n\n        \"\"\"\n        url = API_PATH[\"removal_reason\"].format(subreddit=self.subreddit, id=self.id)\n        self._reddit.delete(url)\n\n    @_deprecate_args(\"message\", \"title\")\n    def update(self, *, message: Optional[str] = None, title: Optional[str] = None):\n        \"\"\"Update the removal reason from this subreddit.\n\n        .. note::\n\n            Existing values will be used for any unspecified arguments.\n\n        :param message: The removal reason's new message.\n        :param title: The removal reason's new title.\n\n        To update ``\"141vv5c16py7d\"`` from r/test try:\n\n        .. code-block:: python\n\n            reddit.subreddit(\"test\").mod.removal_reasons[\"141vv5c16py7d\"].update(\n                title=\"New title\", message=\"New message\"\n            )\n\n        \"\"\"\n        url = API_PATH[\"removal_reason\"].format(subreddit=self.subreddit, id=self.id)\n        data = {\n            name: getattr(self, name) if value is None else value\n            for name, value in {\"message\": message, \"title\": title}.items()\n        }\n        self._reddit.put(url, data=data)\n\n\nclass SubredditRemovalReasons:\n    \"\"\"Provide a set of functions to a :class:`.Subreddit`'s removal reasons.\"\"\"\n\n    @cachedproperty\n    def _removal_reason_list(self) -> List[RemovalReason]:\n        \"\"\"Get a list of Removal Reason objects.\n\n        :returns: A list of instances of :class:`.RemovalReason`.\n\n        \"\"\"\n        response = self._reddit.get(\n            API_PATH[\"removal_reasons_list\"].format(subreddit=self.subreddit)\n        )\n        return [\n            RemovalReason(\n                self._reddit, self.subreddit, _data=response[\"data\"][reason_id]\n            )\n            for reason_id in response[\"order\"]\n        ]\n\n    def __getitem__(self, reason_id: Union[str, int, slice]) -> RemovalReason:\n        \"\"\"Return the Removal Reason with the ID/number/slice ``reason_id``.\n\n        :param reason_id: The ID or index of the removal reason\n\n        .. note::\n\n            Removal reasons fetched using a specific rule name are lazily loaded, so you\n            might have to access an attribute to get all the expected attributes.\n\n        This method is to be used to fetch a specific removal reason, like so:\n\n        .. code-block:: python\n\n            reason_id = \"141vv5c16py7d\"\n            reason = reddit.subreddit(\"test\").mod.removal_reasons[reason_id]\n            print(reason)\n\n        You can also use indices to get a numbered removal reason. Since Python uses\n        0-indexing, the first removal reason is index 0, and so on.\n\n        .. note::\n\n            Both negative indices and slices can be used to interact with the removal\n            reasons.\n\n        :raises: :py:class:`IndexError` if a removal reason of a specific number does\n            not exist.\n\n        For example, to get the second removal reason of r/test:\n\n        .. code-block:: python\n\n            reason = reddit.subreddit(\"test\").mod.removal_reasons[1]\n\n        To get the last three removal reasons in a subreddit:\n\n        .. code-block:: python\n\n            reasons = reddit.subreddit(\"test\").mod.removal_reasons[-3:]\n            for reason in reasons:\n                print(reason)\n\n        \"\"\"\n        if not isinstance(reason_id, str):\n            return self._removal_reason_list[reason_id]\n        return RemovalReason(self._reddit, self.subreddit, reason_id)\n\n    def __init__(self, subreddit: \"praw.models.Subreddit\"):\n        \"\"\"Initialize a :class:`.SubredditRemovalReasons` instance.\n\n        :param subreddit: The subreddit whose removal reasons to work with.\n\n        \"\"\"\n        self.subreddit = subreddit\n        self._reddit = subreddit._reddit\n\n    def __iter__(self) -> Iterator[RemovalReason]:\n        \"\"\"Return a list of Removal Reasons for the subreddit.\n\n        This method is used to discover all removal reasons for a subreddit:\n\n        .. code-block:: python\n\n            for removal_reason in reddit.subreddit(\"test\").mod.removal_reasons:\n                print(removal_reason)\n\n        \"\"\"\n        return iter(self._removal_reason_list)\n\n    @_deprecate_args(\"message\", \"title\")\n    def add(self, *, message: str, title: str) -> RemovalReason:\n        \"\"\"Add a removal reason to this subreddit.\n\n        :param message: The message associated with the removal reason.\n        :param title: The title of the removal reason.\n\n        :returns: The :class:`.RemovalReason` added.\n\n        The message will be prepended with ``Hi u/username,`` automatically.\n\n        To add ``\"Test\"`` to r/test try:\n\n        .. code-block:: python\n\n            reddit.subreddit(\"test\").mod.removal_reasons.add(title=\"Test\", message=\"Foobar\")\n\n        \"\"\"\n        data = {\"message\": message, \"title\": title}\n        url = API_PATH[\"removal_reasons_list\"].format(subreddit=self.subreddit)\n        id = self._reddit.post(url, data=data)\n        return RemovalReason(self._reddit, self.subreddit, id)\n", "path": "praw/models/reddit/removal_reasons.py"}]}