We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Update numpy to 1.26
<div id="comment:0"></div>

https://github.com/numpy/numpy/releases

1.26.0.b1 is out, with Python 3.12 support and Cython 3 compatibility.


- Depends on #35404 

CC:  @antonio-rojas @kiwifb @tornaria

Component: **packages: standard**

_Issue created by migration from https://trac.sagemath.org/ticket/34816_



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/sage/repl/ipython_kernel/kernel.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 """
3 The Sage ZMQ Kernel
4 
5 Version of the Jupyter kernel when running Sage inside the Jupyter
6 notebook or remote Jupyter sessions.
7 """
8 
9 # ***************************************************************************
10 #       Copyright (C) 2015 Volker Braun <vbraun.name@gmail.com>
11 #
12 #  Distributed under the terms of the GNU General Public License (GPL)
13 #  as published by the Free Software Foundation; either version 2 of
14 #  the License, or (at your option) any later version.
15 #                  https://www.gnu.org/licenses/
16 # ***************************************************************************
17 
18 import sys
19 from ipykernel.ipkernel import IPythonKernel
20 from ipykernel.zmqshell import ZMQInteractiveShell
21 from traitlets import Type
22 
23 from sage.env import SAGE_VERSION
24 from sage.repl.interpreter import SageNotebookInteractiveShell
25 from sage.repl.ipython_extension import SageJupyterCustomizations
26 
27 
28 class SageZMQInteractiveShell(SageNotebookInteractiveShell, ZMQInteractiveShell):
29     pass
30 
31 
32 class SageKernel(IPythonKernel):
33     implementation = 'sage'
34     implementation_version = SAGE_VERSION
35 
36     shell_class = Type(SageZMQInteractiveShell)
37 
38     def __init__(self, **kwds):
39         """
40         The Sage Jupyter Kernel
41 
42         INPUT:
43 
44         See the Jupyter documentation
45 
46         EXAMPLES::
47 
48             sage: from sage.repl.ipython_kernel.kernel import SageKernel
49             sage: SageKernel.__new__(SageKernel)
50             <sage.repl.ipython_kernel.kernel.SageKernel object at 0x...>
51         """
52         super().__init__(**kwds)
53         SageJupyterCustomizations(self.shell)
54 
55     @property
56     def banner(self):
57         r"""
58         The Sage Banner
59 
60         The value of this property is displayed in the Jupyter
61         notebook.
62 
63         OUTPUT:
64 
65         String.
66 
67         EXAMPLES::
68 
69             sage: from sage.repl.ipython_kernel.kernel import SageKernel
70             sage: sk = SageKernel.__new__(SageKernel)
71             sage: print(sk.banner)
72             ┌...SageMath version...
73         """
74         from sage.misc.banner import banner_text
75         return banner_text()
76 
77     @property
78     def help_links(self):
79         r"""
80         Help in the Jupyter Notebook
81 
82         OUTPUT:
83 
84         See the Jupyter documentation.
85 
86         .. NOTE::
87 
88             Urls starting with "kernelspecs" are prepended by the
89             browser with the appropriate path.
90 
91         EXAMPLES::
92 
93             sage: from sage.repl.ipython_kernel.kernel import SageKernel
94             sage: sk = SageKernel.__new__(SageKernel)
95             sage: sk.help_links
96             [{'text': 'Sage Documentation',
97               'url': 'kernelspecs/sagemath/doc/html/en/index.html'},
98              ...]
99         """
100         from sage.repl.ipython_kernel.install import SageKernelSpec
101         identifier = SageKernelSpec.identifier()
102 
103         def kernel_url(x):
104             return 'kernelspecs/{0}/{1}'.format(identifier, x)
105 
106         return [
107             {
108                 'text': 'Sage Documentation',
109                 'url': kernel_url('doc/html/en/index.html'),
110             },
111             {
112                 'text': 'Tutorial',
113                 'url': kernel_url('doc/html/en/tutorial/index.html'),
114             },
115             {
116                 'text': 'Thematic Tutorials',
117                 'url': kernel_url('doc/html/en/thematic_tutorials/index.html'),
118             },
119             {
120                 'text': 'FAQs',
121                 'url': kernel_url('doc/html/en/faq/index.html'),
122             },
123             {
124                 'text': 'PREP Tutorials',
125                 'url': kernel_url('doc/html/en/prep/index.html'),
126             },
127             {
128                 'text': 'Reference',
129                 'url': kernel_url('doc/html/en/reference/index.html'),
130             },
131             {
132                 'text': "Developer's Guide",
133                 'url': kernel_url('doc/html/en/developer/index.html'),
134             },
135             {
136                 'text': "Python",
137                 'url': "http://docs.python.org/%i.%i" % sys.version_info[:2],
138             },
139             {
140                 'text': "IPython",
141                 'url': "http://ipython.org/documentation.html",
142             },
143             {
144                 'text': 'Singular',
145                 'url': 'http://www.singular.uni-kl.de/Manual/latest/index.htm',
146             },
147             {
148                 'text': 'GAP',
149                 'url': 'http://gap-system.org/Manuals/doc/ref/chap0.html',
150             },
151             {
152                 'text': "NumPy",
153                 'url': "http://docs.scipy.org/doc/numpy/reference/",
154             },
155             {
156                 'text': "SciPy",
157                 'url': "http://docs.scipy.org/doc/scipy/reference/",
158             },
159             {
160                 'text': "SymPy",
161                 'url': 'http://docs.sympy.org/latest/index.html',
162             },
163             {
164                 'text': "Matplotlib",
165                 'url': "https://matplotlib.org/contents.html",
166             },
167             {
168                 'text': "Markdown",
169                 'url': "http://help.github.com/articles/github-flavored-markdown",
170             },
171         ]
172 
173     def pre_handler_hook(self):
174         """
175         Restore the signal handlers to their default values at Sage
176         startup, saving the old handler at the ``saved_sigint_handler``
177         attribute. This is needed because Jupyter needs to change the
178         ``SIGINT`` handler.
179 
180         See :trac:`19135`.
181 
182         TESTS::
183 
184             sage: from sage.repl.ipython_kernel.kernel import SageKernel
185             sage: k = SageKernel.__new__(SageKernel)
186             sage: k.pre_handler_hook()
187             sage: k.saved_sigint_handler
188             <cyfunction python_check_interrupt at ...>
189         """
190         from cysignals import init_cysignals
191         self.saved_sigint_handler = init_cysignals()
192
```

Path: `build/pkgs/numpy/lapack_conf.py`
Content:
```
1 #!/usr/bin/env python3
2 
3 import pkgconfig, os
4 
5 conf_file=open('site.cfg', 'w')
6 
7 pc_blas   = pkgconfig.parse('cblas blas')
8 pc_lapack = pkgconfig.parse('lapack')
9 
10 if os.environ['UNAME'] == 'Darwin':
11     # on macOS, if openblas is available (the default), use it instead of the
12     # macOS Accelerate framework
13     if 'openblas' in pc_blas.get('libraries', []):
14         conf_file.write('[openblas]\n')
15         conf_file.write('libraries    = '+', '.join(pc_blas['libraries'])+'\n')
16         inc_dir = pc_blas['include_dirs']
17         if len(inc_dir) > 0:
18             conf_file.write('include_dirs = '+ ':'.join(inc_dir)+'\n')
19         lib_dir = pc_blas['library_dirs']
20         if len(lib_dir) > 0:
21             conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\n')
22 else:
23     conf_file.write('[blas]\n')
24     inc_dir = pc_blas['include_dirs']
25     if len(inc_dir) > 0:
26         conf_file.write('include_dirs = '+ ':'.join(inc_dir)+'\n')
27     lib_dir = pc_blas['library_dirs']
28     if len(lib_dir) > 0:
29         conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\n')
30     conf_file.write('blas_libs    = '+', '.join(pc_blas['libraries'])+'\n')
31     conf_file.write('[lapack]\n')
32     lib_dir = pc_lapack['library_dirs']
33     if len(lib_dir) > 0:
34         conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\n')
35     conf_file.write('lapack_libs  = '+', '.join(pc_lapack['libraries'])+'\n')
36 
37 conf_file.close()
38
```
--- 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/build/pkgs/numpy/lapack_conf.py b/build/pkgs/numpy/lapack_conf.py
deleted file mode 100644
--- a/build/pkgs/numpy/lapack_conf.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python3
-
-import pkgconfig, os
-
-conf_file=open('site.cfg', 'w')
-
-pc_blas   = pkgconfig.parse('cblas blas')
-pc_lapack = pkgconfig.parse('lapack')
-
-if os.environ['UNAME'] == 'Darwin':
-    # on macOS, if openblas is available (the default), use it instead of the
-    # macOS Accelerate framework
-    if 'openblas' in pc_blas.get('libraries', []):
-        conf_file.write('[openblas]\n')
-        conf_file.write('libraries    = '+', '.join(pc_blas['libraries'])+'\n')
-        inc_dir = pc_blas['include_dirs']
-        if len(inc_dir) > 0:
-            conf_file.write('include_dirs = '+ ':'.join(inc_dir)+'\n')
-        lib_dir = pc_blas['library_dirs']
-        if len(lib_dir) > 0:
-            conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\n')
-else:
-    conf_file.write('[blas]\n')
-    inc_dir = pc_blas['include_dirs']
-    if len(inc_dir) > 0:
-        conf_file.write('include_dirs = '+ ':'.join(inc_dir)+'\n')
-    lib_dir = pc_blas['library_dirs']
-    if len(lib_dir) > 0:
-        conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\n')
-    conf_file.write('blas_libs    = '+', '.join(pc_blas['libraries'])+'\n')
-    conf_file.write('[lapack]\n')
-    lib_dir = pc_lapack['library_dirs']
-    if len(lib_dir) > 0:
-        conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\n')
-    conf_file.write('lapack_libs  = '+', '.join(pc_lapack['libraries'])+'\n')
-
-conf_file.close()
diff --git a/src/sage/repl/ipython_kernel/kernel.py b/src/sage/repl/ipython_kernel/kernel.py
--- a/src/sage/repl/ipython_kernel/kernel.py
+++ b/src/sage/repl/ipython_kernel/kernel.py
@@ -16,7 +16,18 @@
 # ***************************************************************************
 
 import sys
-from ipykernel.ipkernel import IPythonKernel
+import warnings
+with warnings.catch_warnings():
+    # When upstream pydevd (as opposed to the bundled version) is used
+    # with debugpy, a PEP 420 warning is emitted. Debugpy and/or
+    # pydevd will eventually work around this, but as of September
+    # 2023, hiding the warning gives us more flexibility in the
+    # versions of those packages that we can accept.
+    warnings.filterwarnings("ignore",
+                            message=r".*pkg_resources\.declare_namespace",
+                            category=DeprecationWarning)
+    from ipykernel.ipkernel import IPythonKernel
+
 from ipykernel.zmqshell import ZMQInteractiveShell
 from traitlets import Type

{"golden_diff": "diff --git a/build/pkgs/numpy/lapack_conf.py b/build/pkgs/numpy/lapack_conf.py\ndeleted file mode 100644\n--- a/build/pkgs/numpy/lapack_conf.py\n+++ /dev/null\n@@ -1,37 +0,0 @@\n-#!/usr/bin/env python3\n-\n-import pkgconfig, os\n-\n-conf_file=open('site.cfg', 'w')\n-\n-pc_blas   = pkgconfig.parse('cblas blas')\n-pc_lapack = pkgconfig.parse('lapack')\n-\n-if os.environ['UNAME'] == 'Darwin':\n-    # on macOS, if openblas is available (the default), use it instead of the\n-    # macOS Accelerate framework\n-    if 'openblas' in pc_blas.get('libraries', []):\n-        conf_file.write('[openblas]\\n')\n-        conf_file.write('libraries    = '+', '.join(pc_blas['libraries'])+'\\n')\n-        inc_dir = pc_blas['include_dirs']\n-        if len(inc_dir) > 0:\n-            conf_file.write('include_dirs = '+ ':'.join(inc_dir)+'\\n')\n-        lib_dir = pc_blas['library_dirs']\n-        if len(lib_dir) > 0:\n-            conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\\n')\n-else:\n-    conf_file.write('[blas]\\n')\n-    inc_dir = pc_blas['include_dirs']\n-    if len(inc_dir) > 0:\n-        conf_file.write('include_dirs = '+ ':'.join(inc_dir)+'\\n')\n-    lib_dir = pc_blas['library_dirs']\n-    if len(lib_dir) > 0:\n-        conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\\n')\n-    conf_file.write('blas_libs    = '+', '.join(pc_blas['libraries'])+'\\n')\n-    conf_file.write('[lapack]\\n')\n-    lib_dir = pc_lapack['library_dirs']\n-    if len(lib_dir) > 0:\n-        conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\\n')\n-    conf_file.write('lapack_libs  = '+', '.join(pc_lapack['libraries'])+'\\n')\n-\n-conf_file.close()\ndiff --git a/src/sage/repl/ipython_kernel/kernel.py b/src/sage/repl/ipython_kernel/kernel.py\n--- a/src/sage/repl/ipython_kernel/kernel.py\n+++ b/src/sage/repl/ipython_kernel/kernel.py\n@@ -16,7 +16,18 @@\n # ***************************************************************************\n \n import sys\n-from ipykernel.ipkernel import IPythonKernel\n+import warnings\n+with warnings.catch_warnings():\n+    # When upstream pydevd (as opposed to the bundled version) is used\n+    # with debugpy, a PEP 420 warning is emitted. Debugpy and/or\n+    # pydevd will eventually work around this, but as of September\n+    # 2023, hiding the warning gives us more flexibility in the\n+    # versions of those packages that we can accept.\n+    warnings.filterwarnings(\"ignore\",\n+                            message=r\".*pkg_resources\\.declare_namespace\",\n+                            category=DeprecationWarning)\n+    from ipykernel.ipkernel import IPythonKernel\n+\n from ipykernel.zmqshell import ZMQInteractiveShell\n from traitlets import Type\n", "issue": "Update numpy to 1.26\n<div id=\"comment:0\"></div>\r\n\r\nhttps://github.com/numpy/numpy/releases\r\n\r\n1.26.0.b1 is out, with Python 3.12 support and Cython 3 compatibility.\r\n\r\n\r\n- Depends on #35404 \r\n\r\nCC:  @antonio-rojas @kiwifb @tornaria\r\n\r\nComponent: **packages: standard**\r\n\r\n_Issue created by migration from https://trac.sagemath.org/ticket/34816_\r\n\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nThe Sage ZMQ Kernel\n\nVersion of the Jupyter kernel when running Sage inside the Jupyter\nnotebook or remote Jupyter sessions.\n\"\"\"\n\n# ***************************************************************************\n#       Copyright (C) 2015 Volker Braun <vbraun.name@gmail.com>\n#\n#  Distributed under the terms of the GNU General Public License (GPL)\n#  as published by the Free Software Foundation; either version 2 of\n#  the License, or (at your option) any later version.\n#                  https://www.gnu.org/licenses/\n# ***************************************************************************\n\nimport sys\nfrom ipykernel.ipkernel import IPythonKernel\nfrom ipykernel.zmqshell import ZMQInteractiveShell\nfrom traitlets import Type\n\nfrom sage.env import SAGE_VERSION\nfrom sage.repl.interpreter import SageNotebookInteractiveShell\nfrom sage.repl.ipython_extension import SageJupyterCustomizations\n\n\nclass SageZMQInteractiveShell(SageNotebookInteractiveShell, ZMQInteractiveShell):\n    pass\n\n\nclass SageKernel(IPythonKernel):\n    implementation = 'sage'\n    implementation_version = SAGE_VERSION\n\n    shell_class = Type(SageZMQInteractiveShell)\n\n    def __init__(self, **kwds):\n        \"\"\"\n        The Sage Jupyter Kernel\n\n        INPUT:\n\n        See the Jupyter documentation\n\n        EXAMPLES::\n\n            sage: from sage.repl.ipython_kernel.kernel import SageKernel\n            sage: SageKernel.__new__(SageKernel)\n            <sage.repl.ipython_kernel.kernel.SageKernel object at 0x...>\n        \"\"\"\n        super().__init__(**kwds)\n        SageJupyterCustomizations(self.shell)\n\n    @property\n    def banner(self):\n        r\"\"\"\n        The Sage Banner\n\n        The value of this property is displayed in the Jupyter\n        notebook.\n\n        OUTPUT:\n\n        String.\n\n        EXAMPLES::\n\n            sage: from sage.repl.ipython_kernel.kernel import SageKernel\n            sage: sk = SageKernel.__new__(SageKernel)\n            sage: print(sk.banner)\n            \u250c...SageMath version...\n        \"\"\"\n        from sage.misc.banner import banner_text\n        return banner_text()\n\n    @property\n    def help_links(self):\n        r\"\"\"\n        Help in the Jupyter Notebook\n\n        OUTPUT:\n\n        See the Jupyter documentation.\n\n        .. NOTE::\n\n            Urls starting with \"kernelspecs\" are prepended by the\n            browser with the appropriate path.\n\n        EXAMPLES::\n\n            sage: from sage.repl.ipython_kernel.kernel import SageKernel\n            sage: sk = SageKernel.__new__(SageKernel)\n            sage: sk.help_links\n            [{'text': 'Sage Documentation',\n              'url': 'kernelspecs/sagemath/doc/html/en/index.html'},\n             ...]\n        \"\"\"\n        from sage.repl.ipython_kernel.install import SageKernelSpec\n        identifier = SageKernelSpec.identifier()\n\n        def kernel_url(x):\n            return 'kernelspecs/{0}/{1}'.format(identifier, x)\n\n        return [\n            {\n                'text': 'Sage Documentation',\n                'url': kernel_url('doc/html/en/index.html'),\n            },\n            {\n                'text': 'Tutorial',\n                'url': kernel_url('doc/html/en/tutorial/index.html'),\n            },\n            {\n                'text': 'Thematic Tutorials',\n                'url': kernel_url('doc/html/en/thematic_tutorials/index.html'),\n            },\n            {\n                'text': 'FAQs',\n                'url': kernel_url('doc/html/en/faq/index.html'),\n            },\n            {\n                'text': 'PREP Tutorials',\n                'url': kernel_url('doc/html/en/prep/index.html'),\n            },\n            {\n                'text': 'Reference',\n                'url': kernel_url('doc/html/en/reference/index.html'),\n            },\n            {\n                'text': \"Developer's Guide\",\n                'url': kernel_url('doc/html/en/developer/index.html'),\n            },\n            {\n                'text': \"Python\",\n                'url': \"http://docs.python.org/%i.%i\" % sys.version_info[:2],\n            },\n            {\n                'text': \"IPython\",\n                'url': \"http://ipython.org/documentation.html\",\n            },\n            {\n                'text': 'Singular',\n                'url': 'http://www.singular.uni-kl.de/Manual/latest/index.htm',\n            },\n            {\n                'text': 'GAP',\n                'url': 'http://gap-system.org/Manuals/doc/ref/chap0.html',\n            },\n            {\n                'text': \"NumPy\",\n                'url': \"http://docs.scipy.org/doc/numpy/reference/\",\n            },\n            {\n                'text': \"SciPy\",\n                'url': \"http://docs.scipy.org/doc/scipy/reference/\",\n            },\n            {\n                'text': \"SymPy\",\n                'url': 'http://docs.sympy.org/latest/index.html',\n            },\n            {\n                'text': \"Matplotlib\",\n                'url': \"https://matplotlib.org/contents.html\",\n            },\n            {\n                'text': \"Markdown\",\n                'url': \"http://help.github.com/articles/github-flavored-markdown\",\n            },\n        ]\n\n    def pre_handler_hook(self):\n        \"\"\"\n        Restore the signal handlers to their default values at Sage\n        startup, saving the old handler at the ``saved_sigint_handler``\n        attribute. This is needed because Jupyter needs to change the\n        ``SIGINT`` handler.\n\n        See :trac:`19135`.\n\n        TESTS::\n\n            sage: from sage.repl.ipython_kernel.kernel import SageKernel\n            sage: k = SageKernel.__new__(SageKernel)\n            sage: k.pre_handler_hook()\n            sage: k.saved_sigint_handler\n            <cyfunction python_check_interrupt at ...>\n        \"\"\"\n        from cysignals import init_cysignals\n        self.saved_sigint_handler = init_cysignals()\n", "path": "src/sage/repl/ipython_kernel/kernel.py"}, {"content": "#!/usr/bin/env python3\n\nimport pkgconfig, os\n\nconf_file=open('site.cfg', 'w')\n\npc_blas   = pkgconfig.parse('cblas blas')\npc_lapack = pkgconfig.parse('lapack')\n\nif os.environ['UNAME'] == 'Darwin':\n    # on macOS, if openblas is available (the default), use it instead of the\n    # macOS Accelerate framework\n    if 'openblas' in pc_blas.get('libraries', []):\n        conf_file.write('[openblas]\\n')\n        conf_file.write('libraries    = '+', '.join(pc_blas['libraries'])+'\\n')\n        inc_dir = pc_blas['include_dirs']\n        if len(inc_dir) > 0:\n            conf_file.write('include_dirs = '+ ':'.join(inc_dir)+'\\n')\n        lib_dir = pc_blas['library_dirs']\n        if len(lib_dir) > 0:\n            conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\\n')\nelse:\n    conf_file.write('[blas]\\n')\n    inc_dir = pc_blas['include_dirs']\n    if len(inc_dir) > 0:\n        conf_file.write('include_dirs = '+ ':'.join(inc_dir)+'\\n')\n    lib_dir = pc_blas['library_dirs']\n    if len(lib_dir) > 0:\n        conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\\n')\n    conf_file.write('blas_libs    = '+', '.join(pc_blas['libraries'])+'\\n')\n    conf_file.write('[lapack]\\n')\n    lib_dir = pc_lapack['library_dirs']\n    if len(lib_dir) > 0:\n        conf_file.write('library_dirs = '+ ':'.join(lib_dir)+'\\n')\n    conf_file.write('lapack_libs  = '+', '.join(pc_lapack['libraries'])+'\\n')\n\nconf_file.close()\n", "path": "build/pkgs/numpy/lapack_conf.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nThe Sage ZMQ Kernel\n\nVersion of the Jupyter kernel when running Sage inside the Jupyter\nnotebook or remote Jupyter sessions.\n\"\"\"\n\n# ***************************************************************************\n#       Copyright (C) 2015 Volker Braun <vbraun.name@gmail.com>\n#\n#  Distributed under the terms of the GNU General Public License (GPL)\n#  as published by the Free Software Foundation; either version 2 of\n#  the License, or (at your option) any later version.\n#                  https://www.gnu.org/licenses/\n# ***************************************************************************\n\nimport sys\nimport warnings\nwith warnings.catch_warnings():\n    # When upstream pydevd (as opposed to the bundled version) is used\n    # with debugpy, a PEP 420 warning is emitted. Debugpy and/or\n    # pydevd will eventually work around this, but as of September\n    # 2023, hiding the warning gives us more flexibility in the\n    # versions of those packages that we can accept.\n    warnings.filterwarnings(\"ignore\",\n                            message=r\".*pkg_resources\\.declare_namespace\",\n                            category=DeprecationWarning)\n    from ipykernel.ipkernel import IPythonKernel\n\nfrom ipykernel.zmqshell import ZMQInteractiveShell\nfrom traitlets import Type\n\nfrom sage.env import SAGE_VERSION\nfrom sage.repl.interpreter import SageNotebookInteractiveShell\nfrom sage.repl.ipython_extension import SageJupyterCustomizations\n\n\nclass SageZMQInteractiveShell(SageNotebookInteractiveShell, ZMQInteractiveShell):\n    pass\n\n\nclass SageKernel(IPythonKernel):\n    implementation = 'sage'\n    implementation_version = SAGE_VERSION\n\n    shell_class = Type(SageZMQInteractiveShell)\n\n    def __init__(self, **kwds):\n        \"\"\"\n        The Sage Jupyter Kernel\n\n        INPUT:\n\n        See the Jupyter documentation\n\n        EXAMPLES::\n\n            sage: from sage.repl.ipython_kernel.kernel import SageKernel\n            sage: SageKernel.__new__(SageKernel)\n            <sage.repl.ipython_kernel.kernel.SageKernel object at 0x...>\n        \"\"\"\n        super().__init__(**kwds)\n        SageJupyterCustomizations(self.shell)\n\n    @property\n    def banner(self):\n        r\"\"\"\n        The Sage Banner\n\n        The value of this property is displayed in the Jupyter\n        notebook.\n\n        OUTPUT:\n\n        String.\n\n        EXAMPLES::\n\n            sage: from sage.repl.ipython_kernel.kernel import SageKernel\n            sage: sk = SageKernel.__new__(SageKernel)\n            sage: print(sk.banner)\n            \u250c...SageMath version...\n        \"\"\"\n        from sage.misc.banner import banner_text\n        return banner_text()\n\n    @property\n    def help_links(self):\n        r\"\"\"\n        Help in the Jupyter Notebook\n\n        OUTPUT:\n\n        See the Jupyter documentation.\n\n        .. NOTE::\n\n            Urls starting with \"kernelspecs\" are prepended by the\n            browser with the appropriate path.\n\n        EXAMPLES::\n\n            sage: from sage.repl.ipython_kernel.kernel import SageKernel\n            sage: sk = SageKernel.__new__(SageKernel)\n            sage: sk.help_links\n            [{'text': 'Sage Documentation',\n              'url': 'kernelspecs/sagemath/doc/html/en/index.html'},\n             ...]\n        \"\"\"\n        from sage.repl.ipython_kernel.install import SageKernelSpec\n        identifier = SageKernelSpec.identifier()\n\n        def kernel_url(x):\n            return 'kernelspecs/{0}/{1}'.format(identifier, x)\n\n        return [\n            {\n                'text': 'Sage Documentation',\n                'url': kernel_url('doc/html/en/index.html'),\n            },\n            {\n                'text': 'Tutorial',\n                'url': kernel_url('doc/html/en/tutorial/index.html'),\n            },\n            {\n                'text': 'Thematic Tutorials',\n                'url': kernel_url('doc/html/en/thematic_tutorials/index.html'),\n            },\n            {\n                'text': 'FAQs',\n                'url': kernel_url('doc/html/en/faq/index.html'),\n            },\n            {\n                'text': 'PREP Tutorials',\n                'url': kernel_url('doc/html/en/prep/index.html'),\n            },\n            {\n                'text': 'Reference',\n                'url': kernel_url('doc/html/en/reference/index.html'),\n            },\n            {\n                'text': \"Developer's Guide\",\n                'url': kernel_url('doc/html/en/developer/index.html'),\n            },\n            {\n                'text': \"Python\",\n                'url': \"http://docs.python.org/%i.%i\" % sys.version_info[:2],\n            },\n            {\n                'text': \"IPython\",\n                'url': \"http://ipython.org/documentation.html\",\n            },\n            {\n                'text': 'Singular',\n                'url': 'http://www.singular.uni-kl.de/Manual/latest/index.htm',\n            },\n            {\n                'text': 'GAP',\n                'url': 'http://gap-system.org/Manuals/doc/ref/chap0.html',\n            },\n            {\n                'text': \"NumPy\",\n                'url': \"http://docs.scipy.org/doc/numpy/reference/\",\n            },\n            {\n                'text': \"SciPy\",\n                'url': \"http://docs.scipy.org/doc/scipy/reference/\",\n            },\n            {\n                'text': \"SymPy\",\n                'url': 'http://docs.sympy.org/latest/index.html',\n            },\n            {\n                'text': \"Matplotlib\",\n                'url': \"https://matplotlib.org/contents.html\",\n            },\n            {\n                'text': \"Markdown\",\n                'url': \"http://help.github.com/articles/github-flavored-markdown\",\n            },\n        ]\n\n    def pre_handler_hook(self):\n        \"\"\"\n        Restore the signal handlers to their default values at Sage\n        startup, saving the old handler at the ``saved_sigint_handler``\n        attribute. This is needed because Jupyter needs to change the\n        ``SIGINT`` handler.\n\n        See :trac:`19135`.\n\n        TESTS::\n\n            sage: from sage.repl.ipython_kernel.kernel import SageKernel\n            sage: k = SageKernel.__new__(SageKernel)\n            sage: k.pre_handler_hook()\n            sage: k.saved_sigint_handler\n            <cyfunction python_check_interrupt at ...>\n        \"\"\"\n        from cysignals import init_cysignals\n        self.saved_sigint_handler = init_cysignals()\n", "path": "src/sage/repl/ipython_kernel/kernel.py"}, {"content": null, "path": "build/pkgs/numpy/lapack_conf.py"}]}