We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Quote doesn't return valid lists
```
=> (car (quote [if 1 2 3]))
u'if'
=> (cdr (quote [if 1 2 3]))
[1, 2, 3]
```

=> OK

```
=> (car (quote (if 1 2 3)))
u'_hy_hoisted_fn_1'
=> (car (car (quote (if 1 2 3))))
u'_'
=> (cdr (quote (if 1 2 3)))
[]
```

=> Not ok


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `hy/core/mangles.py`
Content:
```
1 # Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
12 #
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
16 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 # DEALINGS IN THE SOFTWARE.
20 
21 from hy.models.expression import HyExpression
22 from hy.models.symbol import HySymbol
23 from hy.models.list import HyList
24 
25 import hy.mangle
26 
27 
28 class HoistableMangle(hy.mangle.Mangle):
29     def should_hoist(self):
30         for frame in self.stack:
31             if frame is self.scope:
32                 return False
33 
34             if isinstance(frame, HyExpression) and frame != []:
35                 call = frame[0]
36                 if call in self.ignore:
37                     continue
38             return True
39         return False
40 
41 
42 class FunctionMangle(HoistableMangle):
43     hoistable = ["fn"]
44     ignore = ["def", "decorate_with", "setf", "setv", "foreach", "do"]
45 
46     def __init__(self):
47         self.series = 0
48 
49     def unique_name(self):
50         self.series += 1
51         return "_hy_hoisted_fn_%s" % (self.series)
52 
53     def visit(self, tree):
54         if isinstance(tree, HyExpression) and tree != []:
55             call = tree[0]
56             if call == "fn" and self.should_hoist():
57                 new_name = HySymbol(self.unique_name())
58                 new_name.replace(tree)
59                 fn_def = HyExpression([HySymbol("def"),
60                                        new_name,
61                                        tree])
62                 fn_def.replace(tree)
63                 self.hoist(fn_def)
64                 return new_name
65 
66 
67 class IfMangle(HoistableMangle):
68     ignore = ["foreach", "do"]
69 
70     def __init__(self):
71         self.series = 0
72 
73     def visit(self, tree):
74         if isinstance(tree, HyExpression) and tree != []:
75             call = tree[0]
76             if call == "if" and self.should_hoist():
77                 fn = HyExpression([HyExpression([HySymbol("fn"),
78                                    HyList([]),
79                                    tree])])
80                 fn.replace(tree)
81                 return fn
82 
83 
84 hy.mangle.MANGLES.append(IfMangle)
85 hy.mangle.MANGLES.append(FunctionMangle)
86
```
--- 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/hy/core/mangles.py b/hy/core/mangles.py
--- a/hy/core/mangles.py
+++ b/hy/core/mangles.py
@@ -27,6 +27,11 @@
 
 class HoistableMangle(hy.mangle.Mangle):
     def should_hoist(self):
+        for frame in self.stack:
+            if (isinstance(frame, HyExpression) and
+                    frame and frame[0] == "quote"):
+                return False
+
         for frame in self.stack:
             if frame is self.scope:
                 return False

{"golden_diff": "diff --git a/hy/core/mangles.py b/hy/core/mangles.py\n--- a/hy/core/mangles.py\n+++ b/hy/core/mangles.py\n@@ -27,6 +27,11 @@\n \n class HoistableMangle(hy.mangle.Mangle):\n     def should_hoist(self):\n+        for frame in self.stack:\n+            if (isinstance(frame, HyExpression) and\n+                    frame and frame[0] == \"quote\"):\n+                return False\n+\n         for frame in self.stack:\n             if frame is self.scope:\n                 return False\n", "issue": "Quote doesn't return valid lists\n```\n=> (car (quote [if 1 2 3]))\nu'if'\n=> (cdr (quote [if 1 2 3]))\n[1, 2, 3]\n```\n\n=> OK\n\n```\n=> (car (quote (if 1 2 3)))\nu'_hy_hoisted_fn_1'\n=> (car (car (quote (if 1 2 3))))\nu'_'\n=> (cdr (quote (if 1 2 3)))\n[]\n```\n\n=> Not ok\n\n", "before_files": [{"content": "# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the \"Software\"),\n# to deal in the Software without restriction, including without limitation\n# the rights to use, copy, modify, merge, publish, distribute, sublicense,\n# and/or sell copies of the Software, and to permit persons to whom the\n# Software is furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\n# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n# DEALINGS IN THE SOFTWARE.\n\nfrom hy.models.expression import HyExpression\nfrom hy.models.symbol import HySymbol\nfrom hy.models.list import HyList\n\nimport hy.mangle\n\n\nclass HoistableMangle(hy.mangle.Mangle):\n    def should_hoist(self):\n        for frame in self.stack:\n            if frame is self.scope:\n                return False\n\n            if isinstance(frame, HyExpression) and frame != []:\n                call = frame[0]\n                if call in self.ignore:\n                    continue\n            return True\n        return False\n\n\nclass FunctionMangle(HoistableMangle):\n    hoistable = [\"fn\"]\n    ignore = [\"def\", \"decorate_with\", \"setf\", \"setv\", \"foreach\", \"do\"]\n\n    def __init__(self):\n        self.series = 0\n\n    def unique_name(self):\n        self.series += 1\n        return \"_hy_hoisted_fn_%s\" % (self.series)\n\n    def visit(self, tree):\n        if isinstance(tree, HyExpression) and tree != []:\n            call = tree[0]\n            if call == \"fn\" and self.should_hoist():\n                new_name = HySymbol(self.unique_name())\n                new_name.replace(tree)\n                fn_def = HyExpression([HySymbol(\"def\"),\n                                       new_name,\n                                       tree])\n                fn_def.replace(tree)\n                self.hoist(fn_def)\n                return new_name\n\n\nclass IfMangle(HoistableMangle):\n    ignore = [\"foreach\", \"do\"]\n\n    def __init__(self):\n        self.series = 0\n\n    def visit(self, tree):\n        if isinstance(tree, HyExpression) and tree != []:\n            call = tree[0]\n            if call == \"if\" and self.should_hoist():\n                fn = HyExpression([HyExpression([HySymbol(\"fn\"),\n                                   HyList([]),\n                                   tree])])\n                fn.replace(tree)\n                return fn\n\n\nhy.mangle.MANGLES.append(IfMangle)\nhy.mangle.MANGLES.append(FunctionMangle)\n", "path": "hy/core/mangles.py"}], "after_files": [{"content": "# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the \"Software\"),\n# to deal in the Software without restriction, including without limitation\n# the rights to use, copy, modify, merge, publish, distribute, sublicense,\n# and/or sell copies of the Software, and to permit persons to whom the\n# Software is furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\n# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n# DEALINGS IN THE SOFTWARE.\n\nfrom hy.models.expression import HyExpression\nfrom hy.models.symbol import HySymbol\nfrom hy.models.list import HyList\n\nimport hy.mangle\n\n\nclass HoistableMangle(hy.mangle.Mangle):\n    def should_hoist(self):\n        for frame in self.stack:\n            if (isinstance(frame, HyExpression) and\n                    frame and frame[0] == \"quote\"):\n                return False\n\n        for frame in self.stack:\n            if frame is self.scope:\n                return False\n\n            if isinstance(frame, HyExpression) and frame != []:\n                call = frame[0]\n                if call in self.ignore:\n                    continue\n            return True\n        return False\n\n\nclass FunctionMangle(HoistableMangle):\n    hoistable = [\"fn\"]\n    ignore = [\"def\", \"decorate_with\", \"setf\", \"setv\", \"foreach\", \"do\"]\n\n    def __init__(self):\n        self.series = 0\n\n    def unique_name(self):\n        self.series += 1\n        return \"_hy_hoisted_fn_%s\" % (self.series)\n\n    def visit(self, tree):\n        if isinstance(tree, HyExpression) and tree != []:\n            call = tree[0]\n            if call == \"fn\" and self.should_hoist():\n                new_name = HySymbol(self.unique_name())\n                new_name.replace(tree)\n                fn_def = HyExpression([HySymbol(\"def\"),\n                                       new_name,\n                                       tree])\n                fn_def.replace(tree)\n                self.hoist(fn_def)\n                return new_name\n\n\nclass IfMangle(HoistableMangle):\n    ignore = [\"foreach\", \"do\"]\n\n    def __init__(self):\n        self.series = 0\n\n    def visit(self, tree):\n        if isinstance(tree, HyExpression) and tree != []:\n            call = tree[0]\n            if call == \"if\" and self.should_hoist():\n                fn = HyExpression([HyExpression([HySymbol(\"fn\"),\n                                   HyList([]),\n                                   tree])])\n                fn.replace(tree)\n                return fn\n\n\nhy.mangle.MANGLES.append(IfMangle)\nhy.mangle.MANGLES.append(FunctionMangle)\n", "path": "hy/core/mangles.py"}]}