ó
    F±‰jôU  ã                   ód  • S r SSKrSSKrSSKrSSKrSSKrSSKrSSKr\R                  " 5       r
SSKrSSKJrJr  SSKJr  SSKJr  SSKJr  SSKJrJrJr   SSKJr  SS	KJr  S
SKJr   S
SK!J"r"  SSK#J$r$J%r%  SSK&J'r'  S
SK(J)r)J*r*  SS// SQS.S/S/S.S.r+\+S   \+S'   \ " S S\5      5       r,\ R[                  \" \,R\                  R                   R_                  SS5      5      \" \,RH                  R                   5      \" \,R`                  R                   5      S9r g! \ a	    SSKJr   NÏf = f)uA  
=====================
Cython related magics
=====================

Magic command interface for interactive work with Cython

.. note::

  The ``Cython`` package needs to be installed separately. It
  can be obtained using ``easy_install`` or ``pip``.

Usage
=====

To enable the magics below, execute ``%load_ext cython``.

``%%cython``

{CYTHON_DOC}

``%%cython_inline``

{CYTHON_INLINE_DOC}

``%%cython_pyximport``

{CYTHON_PYXIMPORT_DOC}

Author:
* Brian Granger

Code moved from IPython and adapted by:
* MartÃ­n GaitÃ¡n

Parts of this code were taken from Cython.inline.
é    N)ÚDistributionÚ	Extension)Ú	build_ext)Údisplay)Úmagic_arguments)ÚMagicsÚmagics_classÚ
cell_magic)Úget_ipython_cache_dir)Údedenté   )Ú__version__)ÚCompileErroré   )Úcython_inlineÚload_dynamic)Ú	cythonize)Úcaptured_fdÚprint_capturedz-fprofile-generateú-fprofile-dir={TEMPDIR})z-fprofile-usez-fprofile-correctionr   )ÚgenÚusez	-prof-genz	-prof-use)ÚgccÚiccr   Úmingw32c                   ó˜  ^ • \ rS rSrU 4S jrS r\S 5       r\S 5       r\	R                  " 5       \	R                  " SSSS	S
SS9\	R                  " SSSS
SS9\	R                  " SSSSSS9\	R                  " SSSSSSS9\	R                  " SSSSSSS9\	R                  " SS SSS!S9\	R                  " S"S#S$/ S%S9\	R                  " S&S$/ S'S9\	R                  " S(S)S$/ S*S9\	R                  " S+S,S-S.9\	R                  " S/S0S1S$/ S2S39\	R                  " S4S5S$/ S6S9\	R                  " S7S8S$/ S9S9\	R                  " S:S;SSS<S=9\	R                  " S>S?S@SASBS=9\SC 5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       rSD rSMSE jrSNSF jrSG r\SH 5       rSI rSSSS\4SJ jr\SMSK j5       rSLrU =r$ )OÚCythonMagicsé\   c                 óN   >• [         TU ]  U5        0 U l        0 U l        SU l        g )NF)ÚsuperÚ__init__Ú_reloadsÚ_code_cacheÚ_pyximport_installed)ÚselfÚshellÚ	__class__s     €Ú§C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\Cython/Build/IpythonMagic.pyr!   ÚCythonMagics.__init___   s'   ø€ Ü‰Ñ˜ÔØˆŒØˆÔØ$)ˆÕ!ó    c                 ó  • UR                   nSU;   a  US   nO)U Vs/ s H  oDR                  S5      (       a  M  UPM     nnU H#  n U R                  R                  XBU   05        M%     g s  snf ! [         a    SU-  n[        U5      ef = f)NÚ__all__Ú_z%'module' object has no attribute '%s')Ú__dict__Ú
startswithr&   ÚpushÚKeyErrorÚAttributeError)r%   ÚmoduleÚmdictÚkeysÚkÚmsgs         r(   Ú_import_allÚCythonMagics._import_alle   sŠ   € Ø—‘ˆØ˜ÓØ˜Ñ#‰Dá$Ó>šu˜!¯L©L¸×,=—A™uˆDÐ>ãˆAð*Ø—
‘
—‘ ¨!¡H Ö.ò ùò ?øô
 ó *Ø=ÀÑA�Ü$ SÓ)Ð)ð*ús   �A,ºA,ÁA1Á1Bc                 ón   • U R                   R                  nU R                   R                  n[        X#US9$ )al  Compile and run a Cython code cell using Cython.inline.

This magic simply passes the body of the cell to Cython.inline
and returns the result. If the variables `a` and `b` are defined
in the user's namespace, here is a simple example that returns
their sum::

    %%cython_inline
    return a+b

For most purposes, we recommend the usage of the `%%cython` magic.
)ÚlocalsÚglobals)r&   Úuser_global_nsÚuser_nsr   )r%   ÚlineÚcellÚlocsÚglobss        r(   r   ÚCythonMagics.cython_inlines   s/   € ð �z‰z×(Ñ(ˆØ—
‘
×"Ñ"ˆÜ˜T¸Ñ>Ð>r*   c                 óö  • UR                  5       nU(       d  [        S5      eUS-   n[        USSS9 nUR                  U5        SSS5        S[        R
                  ;  d  U R                  (       d  SSKnUR                  5         S	U l        X0R                  ;   a  U R                  U   nO,[        U5        [        R
                  U   nXpR                  U'   U R                  U5        g! , (       d  f       N«= f)
aÙ  Compile and import a Cython code cell using pyximport.

The contents of the cell are written to a `.pyx` file in the current
working directory, which is then imported using `pyximport`. This
magic requires a module name to be passed::

    %%cython_pyximport modulename
    def f(x):
        return 2.0*x

The compiled module is then imported and all of its symbols are
injected into the user's namespace. For most purposes, we recommend
the usage of the `%%cython` magic.
zmodule name must be givenú.pyxÚwúutf-8©ÚencodingNÚ	pyximportr   T)ÚstripÚ
ValueErrorÚopenÚwriteÚsysÚmodulesr$   rJ   Úinstallr"   Ú
__import__r8   )r%   r?   r@   Úmodule_nameÚfnameÚfrJ   r3   s           r(   Úcython_pyximportÚCythonMagics.cython_pyximport…   sÄ   € ð  —j‘j“lˆÞÜÐ8Ó9Ð9Ø˜fÑ$ˆÜ�%˜ wÒ/°1Ø�G‰G�DŒM÷ 0àœcŸk™kÓ)°×1J×1JÛØ×ÑÔØ(,ˆDÔ%ØŸ-™-Ó'Ø—]‘] ;Ñ/‰Fô �{Ô#Ü—[‘[ Ñ-ˆFØ)/�M‰M˜+Ñ&Ø×Ñ˜Õ ÷# 0Õ/ús   ³C*Ã*
C8z-az
--annotateÚstore_constÚdefaultÚannotatez/Produce a colorized HTML version of the source.)ÚactionÚconstÚdestÚhelpz--annotate-fullcÚfullczZProduce a colorized HTML version of the source which includes entire generated C/C++-code.z-+z--cplusÚ
store_trueFz Output a C++ rather than C file.)r[   rY   r^   z-3Úlanguage_levelé   NzSelect Python 3 syntax.)r]   r[   r\   rY   r^   z-2r   zSelect Python 2 syntax.z-fz--forcezWForce the compilation of a new module, even if the source has been previously compiled.z-cz--compile-argsÚappendzoExtra flags to pass to compiler via the `extra_compile_args` Extension flag (can be specified  multiple times).z--link-argszjExtra flags to pass to linker via the `extra_link_args` Extension flag (can be specified  multiple times).z-lz--libzNAdd a library to link the extension against (can be specified multiple times).z-nz--namez%Specify a name for the Cython module.)r^   z-LÚlibrary_dirsÚdirzPAdd a path to the list of library directories (can be specified multiple times).)r]   Úmetavarr[   rY   r^   z-Iz	--includezPAdd a path to the list of include directories (can be specified multiple times).z-Sz--srczFAdd a path to the list of src files (can be specified multiple times).z--pgoÚpgoz‡Enable profile guided optimisation in the C compiler. Compiles the cell twice and executes it in between to generate a runtime profile.)r]   r[   rY   r^   z	--verboseÚquietÚstore_falseTz_Print debug information like generated .c/.cpp file location and exact gcc/g++ command invoked.c           	      óÔ  • [         R                  " U R                  U5      nUR                  S5      (       a  UOUS-   n[        R
                  R                  [        5       S5      nXA[        R                  [        R                  [        4n[        R
                  R                  U5      (       d  [        R                  " U5        UR                  (       a  US-  nUR                  (       a  U[         R                   " 5       4-  nUR"                  (       a  [%        UR"                  5      nO?S[&        R(                  " [%        U5      R+                  S5      5      R-                  5       -   n[        R
                  R                  XWS-   5      n[        R
                  R                  XWU R.                  -   5      n	[        R
                  R1                  U	5      n
UR                  =(       d    U
(       + nUR2                  (       a&  [        R
                  R1                  U5      (       d  SnSnU(       ae  U R5                  XtXSUR6                  S	9nUc  g[9        U5      S
:X  d   eUS   nXpR:                  U'   UR                  (       a  U R=                  XÅ5        S nS=nn [?        S
5       n[?        S5       nU RA                  XÅUR                  (       a  SOSUR6                  S9  SSS5        SSS5        U" U" 5       U" 5       [        RL                  5        [O        Xy5      nU RQ                  U5        UR2                  (       aI   [S        USS9 nURU                  5       nSSS5        [V        RX                  " U R[                  W5      5      $ g! , (       d  f       N¯= f! , (       d  f       N¸= f! [B        RD                  RF                  [B        RD                  RH                  4 a%    U" U" 5       U" 5       [        RJ                  5         gf = f! , (       d  f       N¶= f! [\         a:  n[_        S[        RJ                  S9  [_        U[        RJ                  S9   SnAgSnAff = f)a�  Compile and import everything from a Cython code cell.

The contents of the cell are written to a `.pyx` file in the
directory returned by `get_ipython_cache_dir()/cython` using a filename
with the hash of the code. This file is then cythonized and compiled.
The resulting module is imported and all of its symbols are injected
into the user's namespace. The usage is similar to that of
`%%cython_pyximport` but you don't have to pass a module name::

    %%cython
    def f(x):
        return 2.0*x

To compile OpenMP codes, pass the required  `--compile-args`
and `--link-args`.  For example with gcc::

    %%cython --compile-args=-fopenmp --link-args=-fopenmp
    ...

To enable profile guided optimisation, pass the ``--pgo`` option.
Note that the cell itself needs to take care of establishing a suitable
profile when executed. This can be done by implementing the functions to
optimise, and then calling them directly in the same cell on some realistic
training data like this::

    %%cython --pgo
    def critical_function(data):
        for item in data:
            ...

    # execute function several times to build profile
    from somewhere import some_typical_data
    for _ in range(100):
        critical_function(some_typical_data)

In Python 3.5 and later, you can distinguish between the profile and
non-profile runs as follows::

    if "_pgo_" in __name__:
        ...  # execute critical code here
Ú
Úcython)rg   Ú_cython_magic_rG   z.htmlTN)rh   r   r   c                 ó4   • [        XS5        [        XS5        g )NzContent of stdout:
zContent of stderr:
)r   )ÚstdoutÚstderrÚwheres      r(   Úprint_compiler_outputÚ2CythonMagics.cython.<locals>.print_compiler_outputH  s   € ä˜6Ð*@ÔAÜ˜6Ð*@ÕAr*   r   r   )Úpgo_step_namerh   rH   zICython completed successfully but the annotated source could not be read.©Úfile)0r   Úparse_argstringrl   ÚendswithÚosÚpathÚjoinr   rO   Úversion_infoÚ
executableÚcython_versionÚexistsÚmakedirsrg   ÚforceÚtimeÚnameÚstrÚhashlibÚsha256ÚencodeÚ	hexdigestÚso_extÚisfilerZ   Ú
_cythonizerh   Úlenr#   Ú_profile_pgo_wrapperr   Ú_build_extensionÚ	distutilsÚerrorsr   Ú	LinkErrorrp   ro   r   r8   rM   Úreadr   ÚHTMLÚclean_annotated_htmlÚOSErrorÚprint)r%   r?   r@   ÚargsÚcodeÚlib_dirÚkeyrS   Ú	html_fileÚmodule_pathÚhave_moduleÚneed_cythonizeÚ	extensionÚ
extensionsrr   Ú
get_stderrÚ
get_stdoutr3   rU   Úannotated_htmlÚes                        r(   rl   ÚCythonMagics.cython¬   s/  € ôd ×.Ò.¨t¯{©{¸DÓAˆØ—}‘} T×*Ñ*‰t°°t±ˆÜ—'‘'—,‘,Ô4Ó6¸ÓAˆØœ3×+Ñ+¬S¯^©^¼^ÐLˆä�w‰w�~‰~˜g×&Ñ&Ü�KŠK˜Ô à�8�8Ø�8‰OˆCØ�:�:ð ”D—I’I“K�>Ñ!ˆCà�9�9Ü˜dŸi™i›.‰Kà*¬W¯^ª^¼CÀ»H¿O¹OÈGÓ<TÓ-U×-_Ñ-_Ó-aÑaˆKÜ—G‘G—L‘L ¸Ñ*?Ó@ˆ	Ü—g‘g—l‘l 7¸$¿+¹+Ñ,EÓFˆä—g‘g—n‘n [Ó1ˆØŸ™×4¨¤_ˆà�=�=Ü—7‘7—>‘> )×,Ñ,Ø!%�àˆ	ÞØŸ™¨¸GÐQU×Q[ÑQ[˜Ð\ˆJØÑ!àÜ�z“? aÓ'Ð'Ð'Ø" 1™ˆIØ$/×Ñ˜SÑ!à�x�xØ×)Ñ)¨)Ô=ò	Bð
 #'Ð&ˆ
�Zð	Ü˜Q” :Ü  ”^ zØ×)Ñ)Ø!À4Ç8Ç8¹%ÐQUÐ]a×]gÑ]gð *ñ i÷ $÷  ñ 	™j›l©J«L¼#¿*¹*ÔEä˜kÓ7ˆØ×Ñ˜Ô à�=�=ðOÜ˜)¨gÒ6¸!Ø%&§V¡V£X�N÷ 7ô —|’| D×$=Ñ$=¸nÓ$MÓNÐNð ÷ $•^ú÷  •ûô × Ñ ×-Ñ-¬y×/?Ñ/?×/IÑ/IÐJó 	á!¡*£,±
³¼c¿j¹jÔIÙð	ú÷ 7Õ6ûäó *ô
 ð 2Ü8;¿
¹
òDä�aœcŸj™j×)ûð*úsy   Ê!N2 Ê,N!Ê8/NË'N!Ë/N2 Í
P# ÍPÍ"P# Î
N	ÎN!Î!
N/Î+N2 Î/N2 Î2APÐPÐ
P ÐP# Ð#
Q'Ð-0Q"Ñ"Q'c           	      óø  • [         R                   " U5      nUR                  nSU-   n[        R                  R	                  X$S-   5      n[        USSS9 nUR                  [        R                  " SX4S.-  5      5        SSS5        UR                  U/-   Ul	        XAl        U R                  XS	S
9  [        R                  R	                  X$U R                  -   5      n[        XG5        g! , (       d  f       Nq= f)a’  
Generate a .c file for a separate extension module that calls the
module init function of the original module.  This makes sure that the
PGO profiler sees the correct .o file of the final module, but it still
allows us to import the module under a different name for profiling,
before recompiling it into the PGO optimised module.  Overwriting and
reimporting the same shared library is not portable.
Ú_pgo_z.crF   rG   rH   a1  
            #include "Python.h"
            extern PyMODINIT_FUNC PyInit_%(module_name)s(void);
            PyMODINIT_FUNC PyInit_%(pgo_module_name)s(void); /*proto*/
            PyMODINIT_FUNC PyInit_%(pgo_module_name)s(void) {
                return PyInit_%(module_name)s();
            }
            )rS   Úpgo_module_nameNr   )rt   )Úcopyrƒ   ry   rz   r{   rM   rN   Útextwrapr   ÚsourcesrŽ   r‰   r   )r%   rŸ   r™   rS   r¨   Úpgo_wrapper_c_filerU   Úso_module_paths           r(   r�   Ú!CythonMagics._profile_pgo_wrapperm  sÜ   € ô —I’I˜iÓ(ˆ	Ø—n‘nˆØ! KÑ/ˆÜŸW™WŸ\™\¨'ÀTÑ3IÓJÐÜÐ$ c°GÒ<ÀØ�G‰G”H—O’Oð %ð #.ÑRñ%Só Tô U÷ =ð &×-Ñ-Ð1CÐ0DÑDˆ	ÔØ(Œà×Ñ˜iÀÐÑFô Ÿ™Ÿ™ gÀÇÁÑ/LÓMˆÜ�_Õ5÷# =Õ<ús   Á+C+Ã+
C9c                 óú  • [         R                  R                  X1S-   5      nUR                  n[	        [        [        UR                  5      5      nSU;   a#  SS Kn	UR                  U	R                  5       5        [        USSS9 n
U
R                  U5        S S S 5        [        UU/U-   UUR                  UR                  UR                   UR"                  UR$                  (       a  SOSS	9n ['        UUR(                  S
[+        S[,        R.                  S   5      S9nUR0                  b!  UR0                  S;   d   eUR0                  US'   [3        U/40 UD6$ ! , (       d  f       NÊ= f! [4         a     g f = f)NrE   Únumpyr   rF   rG   rH   zc++Úc)rƒ   r«   Úinclude_dirsrd   Úextra_compile_argsÚextra_link_argsÚ	librariesÚlanguageTrb   )rh   rZ   r�   ra   )r   rb   ra   )ry   rz   r{   ÚincludeÚlistÚmapr„   Úsrcr°   rc   Úget_includerM   rN   r   rd   Úcompile_argsÚ	link_argsÚlibÚcplusÚdictrZ   ÚminrO   r|   ra   r   r   )r%   rS   r˜   r™   r—   rh   Úpyx_fileÚc_include_dirsÚc_src_filesr°   rU   rŸ   Úoptss                r(   r‹   ÚCythonMagics._cythonize�  sM  € Ü—7‘7—<‘< °vÑ)=Ó>ˆàŸ™ˆÜœ3œs D§H¡HÓ-Ó.ˆØ�d‹?ÛØ×!Ñ! %×"3Ñ"3Ó"5Ô6Ü�(˜C¨'Ò2°aØ�G‰G�DŒM÷ 3äØØ�J Ñ,Ø'Ø×*Ñ*Ø#×0Ñ0Ø ŸN™NØ—h‘hØ"ŸjŸj‘U¨cñ	
ˆ	ð	ÜØØŸ™ØÜ" 1¤c×&6Ñ&6°qÑ&9Ó:ñ	ˆDð ×"Ñ"Ñ.Ø×*Ñ*¨fÓ4Ð4Ð4Ø)-×)<Ñ)<�Ð%Ñ&Ü˜i˜[Ñ1¨DÑ1Ð1÷- 3Õ2ûô. ó 	Ùð	ús   ÂEÃ0A+E- Å
E*Å-
E:Å9E:c                 ó|  • U R                  XX4S9nS n U(       d7  [        R                  R                  [        R                  R                  5      nUR                  5         U(       d$  Ub   [        R                  R                  U5        g g g ! U(       d$  Ub   [        R                  R                  U5        f f f = f)N)r™   Útemp_dirrt   )Ú_get_build_extensionr�   ÚlogÚset_thresholdÚDEBUGÚrun)r%   rŸ   r™   rÈ   rt   rh   Úbuild_extensionÚold_thresholds           r(   rŽ   ÚCythonMagics._build_extension¯  s—   € Ø×3Ñ3Ø°ð 4ð Xˆàˆð	;ÞÜ )§¡× ;Ñ ;¼I¿M¹M×<OÑ<OÓ P�Ø×ÑÔ!æ˜]Ñ6Ü—‘×+Ñ+¨MÕ:ð 7�5ø–5˜]Ñ6Ü—‘×+Ñ+¨MÕ:ð 7�5ús   ”AB Â-B;c                 ó¢  • UR                   R                  nUS:X  ae  UR                   R                  nU(       d  OGSU;   d	  SUS   ;   a  SnO5SU;   d	  SUS   ;   a  SnO#SU;   d	  SUS   ;   a  SnOSU;   d	  SUS   ;   a  Sn[        R	                  U5      n/ nU(       a‰  X&;   a„  Xb    Vs/ s H  oˆR                  US9PM     n	nUR                   HR  n
UR                  U
R                  U
R                  45        U
R                  U	-   U
l        U
R                  U	-   U
l	        MT     U$ [        SU< S	U< S
3[        R                  S9  U$ s  snf )NÚunixÚclangr   r   r   zg++)ÚTEMPDIRzNo PGO z* configuration known for C compiler type 'Ú'ru   )ÚcompilerÚcompiler_typeÚcompiler_soÚ
PGO_CONFIGÚgetÚformatr    rc   r³   r´   r–   rO   rp   )r%   rÎ   Ú	step_namerÈ   r×   Úcompiler_cmdÚconfigÚ
orig_flagsrU   ÚflagsrŸ   s              r(   Ú_add_pgo_flagsÚCythonMagics._add_pgo_flags»  sQ  € Ø'×0Ñ0×>Ñ>ˆØ˜FÓ"Ø*×3Ñ3×?Ñ?ˆLæØØ˜LÓ(¨G°|ÀA±Ó,FØ '‘Ø˜,Ó&¨%°<À±?Ó*BØ %‘Ø˜,Ó&¨%°<À±?Ó*BØ %‘Ø˜,Ó&¨%°<À±?Ó*BØ %�Ü—‘ Ó.ˆØˆ
Þ�iÓ)Ø9?Ò9JÓKÒ9J°A—X‘X h�XÓ/Ñ9JˆEÐKØ,×7Ô7�	Ø×!Ñ! 9×#?Ñ#?À×AZÑAZÐ"[Ô\Ø/8×/KÑ/KÈeÑ/S�	Ô,Ø,5×,EÑ,EÈÑ,M�	Ö)ñ 8ð Ðõ ËiÓYfÐgÜ—z‘zò#àÐùò Ls   Â+Ec                 óœ   •  U R                   $ ! [         a3    U R                  5       R                  S5      U l         U R                   s $ f = f)z*The extension suffix for compiled modules.Ú )Ú_so_extr2   rÉ   Úget_ext_filename)r%   s    r(   r‰   ÚCythonMagics.so_ext×  sE   € ð	 Ø—<‘<ÐøÜó 	 Ø×4Ñ4Ó6×GÑGÈÓKˆDŒLØ—<‘<Òð	 ús   ‚ Ž:AÁ
Ac                 óR   •  SSK Jn  UR                  5         g! [         a     gf = f)zjclear distutils mkpath cache

prevents distutils from skipping re-creation of dirs that have been removed
r   )Ú_path_createdN)Údistutils.dir_utilré   ÚclearÚImportError)r%   ré   s     r(   Ú_clear_distutils_mkpath_cacheÚ*CythonMagics._clear_distutils_mkpath_cacheà  s,   € ð
	"Ý8ð ×ÑÕ!øô ó 	Ùð	ús   ‚ ™
&¥&c                 ó¢  ^^^	^
• U R                  5         [        5       nUR                  5       n UR                  S5        UR                  U5        T(       d  UmU R                  m	T(       a  Um
 " U	U
UU4S jSU5      nU" U5      nUR                  5         T(       a  TUl        U(       a  X(l	        Ub  U/Ul
        U$ ! [         a     NŒf = f)Nz	setup.cfgc                   ó(   >• \ rS rSrU UUU4S jrSrg)Ú5CythonMagics._get_build_extension.<locals>._build_extiý  c                 ó<   >• T" U TT5        TR                  U 5        g )N)Úbuild_extensions)r%   Úadd_pgo_flagsÚbase_build_extrt   rÈ   s    €€€€r(   ró   ÚFCythonMagics._get_build_extension.<locals>._build_ext.build_extensionsþ  s   ø€ Ù! $¨°xÔ@Ø"×3Ñ3°DÕ9r*   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ró   Ú__static_attributes__)rô   rõ   rt   rÈ   s   €€€€r(   Ú
_build_extrñ   ý  s   ø† ÷:ó :r*   rý   )rí   r   Úfind_config_filesÚremoverL   Úparse_config_filesrá   Úfinalize_optionsÚ
build_tempÚ	build_libr    )r%   rŸ   r™   rÈ   rt   rý   ÚdistÚconfig_filesrÎ   rô   rõ   s      ``    @@r(   rÉ   Ú!CythonMagics._get_build_extensionì  sÉ   û€ à×*Ñ*Ô,Ü‹~ˆØ×-Ñ-Ó/ˆð	Ø×Ñ Ô,ð 	×Ñ Ô-æØˆHØ×+Ñ+ˆæØ'ˆN÷:ò :˜Zô :ñ
 % TÓ*ˆØ×(Ñ(Ô*ÞØ)1ˆOÔ&ÞØ(/Ô%ØÑ Ø*3¨ˆOÔ&ØÐøô/ ó 	Ùð	ús   °C Ã
CÃCc                 óþ  • / nU(       aH  [         R                  " SU [         R                  [         R                  -  5      nUR	                  U5        [         R
                  " SU [         R                  [         R                  -  5      R                  S5      n[         R                  " S5      nUR                  5        H,  nUR                  U5      (       a  M  UR                  U5        M.     SR                  U5      $ )a)  Clean up the annotated HTML source.

Strips the link to the generated C or C++ file, which we do not
present to the user.

Returns an HTML snippet (no <html>, <head>, or <body>),
containing only the style tag(s) and _contents_ of the body,
appropriate for embedding multiple times in cell output.
z<style.*</style>z<body[^>]*>(.+)</body>r   z&<p>Raw output: <a href="(.*)">(.*)</a>rk   )ÚreÚfindallÚ	MULTILINEÚDOTALLÚextendÚsearchÚgroupÚcompileÚ
splitlinesÚmatchrc   r{   )ÚhtmlÚinclude_styleÚchunksÚstylesÚbodyÚrr?   s          r(   r”   Ú!CythonMagics.clean_annotated_html  s²   € ð ˆÞÜ—Z’ZÐ 2°D¼"¿,¹,ÌÏÉÑ:RÓSˆFØ�M‰M˜&Ô!ä�yŠyØ% t¬R¯\©\¼B¿I¹IÑ-Eó
ç
‰%�‹(ð 	ô
 �JŠJÐ?Ó@ˆØ—O‘OÖ%ˆDØ—7‘7˜4—=“=Ø—‘˜dÖ#ñ &ð �y‰y˜Ó Ð r*   )r#   r$   r"   rå   )T)NNT)rø   rù   rú   rû   r!   r8   r
   r   rV   r   Úargumentrl   r�   r‹   rŽ   rá   Úpropertyr‰   rí   r   rÉ   Ústaticmethodr”   rü   Ú__classcell__)r'   s   @r(   r   r   \   sÃ  ø† õ*ò*ð ñ?ó ð?ð" ñ$!ó ð$!ðL ×$Ò$Ó&Ø×ÒØˆl =¸	È
Ø>ñð ×ÒØ =¸Àjð;ñð
 ×ÒØˆi °eØ/ñð ×ÒØÐ#¨MÀÈDØ&ñð ×ÒØÐ#¨MÀÈDØ&ñð ×ÒØˆi °eð$ñð
 ×ÒØÐ x¸ðBñð
 ×ÒØ˜h°ðBñð
 ×ÒØˆg˜h°ð ñð
 ×ÒØˆhØ4ñð ×ÒØ�>¨5¸È2ð ñð
 ×ÒØˆk (°Bð ñð
 ×ÒØˆg˜h°ð ñð
 ×ÒØ�e L¸%ðbñð
 ×ÒØ˜'¨-Àð3ñð
 ñwOó óóóóóó	óóóóó	ó	ó	óó	ó 'ðPwOòr6ô@ ôD
;òð8 ñ ó ð ò
"ð .2¸4È$Ø+/¸Iôð@ ó!ó ö!r*   r   z-+, --cplusz--cplus    )Ú
CYTHON_DOCÚCYTHON_INLINE_DOCÚCYTHON_PYXIMPORT_DOC)1Ú__doc__ry   r  rO   r‚   r©   Údistutils.logr�   rª   ÚgetfilesystemencodingÚIO_ENCODINGr…   Údistutils.corer   r   Údistutils.command.build_extr   ÚIPython.corer   r   ÚIPython.core.magicr   r	   r
   ÚIPython.pathsr   rì   ÚIPython.utils.pathÚIPython.utils.textr   ÚShadowr   r~   ÚCompiler.Errorsr   ÚInliner   r   ÚDependenciesr   ÚUtilsr   r   rÙ   r   rÛ   rl   ÚreplacerV   r÷   r*   r(   Ú<module>r1     s3  ðñ$ó\ 
Û 	Û 
Û Û Û Û à×'Ò'Ó)€ã ß 2Ý 1å  Ý (ß ?Ñ ?ð9Ý3õ &å 2Ý *ß /Ý #ß /ð
 %Ð&?Ð@ÚSñð ˆ}Øˆ}ññ
€
ð # 5Ñ)€
ˆ9Ñ ð ôI!�6ó I!ó ðI!ðV �.‰.ñ �l×)Ñ)×1Ñ1ß#*¡7¨=¸-Ó#HóJá˜\×7Ñ7×?Ñ?Ó@Ù × =Ñ =× EÑ EÓFð ð �øðM ó 9ç8ð9ús   ÁD  Ä D/Ä.D/