Ë
    Æ[;jÿU  ã                   óp  — d Z ddlZddlZddlZddlZddlZddlZddlZddl	Z	 ej                  «       ZddlZddlmZmZ ddlmZ ddlmZ ddlmZ ddlmZmZmZ 	 ddlmZ dd	lmZ d
dlm Z! d
dl"m#Z# ddl$m%Z%m&Z& ddl'm(Z( d
dl)m*Z*m+Z+ ddgg d¢dœdgdgdœdœZ,e,d   e,d<   e G d„ de«      «       Z-e j]                   ee-j^                  j                   ja                  dd«      «       ee-jJ                  j                   «       ee-jb                  j                   «      ¬«      Z y# e$ r	 ddlmZ Y ŒÑw xY w)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                   óà  ‡ — e Zd Zˆ fd„Zd„ Zed„ «       Zed„ «       Z ej                  «        ej                  ddddd	d
¬«       ej                  dddd	d¬«       ej                  ddddd¬«       ej                  dddddd¬«       ej                  dddddd¬«       ej                  ddddd ¬«       ej                  d!d"d#g d$¬«       ej                  d%d#g d&¬«       ej                  d'd(d#g d)¬«       ej                  d*d+d,¬-«       ej                  d.d/d0d#g d1¬2«       ej                  d3d4d#g d5¬«       ej                  d6d7d#g d8¬«       ej                  d9d:ddd;¬<«       ej                  d=d>d?d@dA¬<«      edB„ «       «       «       «       «       «       «       «       «       «       «       «       «       «       «       «       «       Z
dC„ ZdKdD„ZdLdE„ZdF„ ZedG„ «       ZdH„ ZddddefdI„ZedKdJ„«       Zˆ xZS )MÚCythonMagicsc                 óN   •— t         ‰| �  |«       i | _        i | _        d| _        y )NF)ÚsuperÚ__init__Ú_reloadsÚ_code_cacheÚ_pyximport_installed)ÚselfÚshellÚ	__class__s     €úbG:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\Cython/Build/IpythonMagic.pyr    zCythonMagics.__init__`   s'   ø€ Ü‰Ñ˜ÔØˆŒØˆÔØ$)ˆÕ!ó    c                 ó  — |j                   }d|v r|d   }n!|D �cg c]  }|j                  d«      rŒ|‘Œ }}|D ]#  }	 | j                  j                  |||   i«       Œ% y c c}w # t        $ r d|z  }t        |«      ‚w xY w)NÚ__all__Ú_z%'module' object has no attribute '%s')Ú__dict__Ú
startswithr%   ÚpushÚKeyErrorÚAttributeError)r$   ÚmoduleÚmdictÚkeysÚkÚmsgs         r'   Ú_import_allzCythonMagics._import_allf   sŽ   € Ø—‘ˆØ˜ÑØ˜Ñ#‰Dá$Ó>™u˜!¨A¯L©L¸Õ,=’A˜uˆDÐ>ãˆAð*Ø—
‘
—‘  E¨!¡H Õ.ñ ùò ?øô
 ò *Ø=ÀÑA�Ü$ SÓ)Ð)ð*ús   ›A!²A!¾ A&Á&B c                 óv   — | j                   j                  }| j                   j                  }t        |||¬«      S )a¬  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   zCythonMagics.cython_inlinet   s1   € ð �z‰z×(Ñ(ˆØ—
‘
×"Ñ"ˆÜ˜T¨$¸Ô>Ð>r(   c                 óÚ  — |j                  «       }|st        d«      ‚|dz   }t        |dd¬«      5 }|j                  |«       ddd«       dt        j
                  vs| j                  sddl}|j                  «        d	| _        || j                  v r| j                  |   }n-t        |«       t        j
                  |   }|| j                  |<   | j                  |«       y# 1 sw Y   ŒŸxY w)
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#   rF   Úinstallr!   Ú
__import__r6   )r$   r<   r=   Úmodule_nameÚfnameÚfrF   r1   s           r'   Úcython_pyximportz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Ø)/ˆD�M‰M˜+Ñ&Ø×Ñ˜Õ ÷# 0Ð/ús   ±C!Ã!C*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.)rV   rT   rY   z-3Úlanguage_levelé   NzSelect Python 3 syntax.)rX   rV   rW   rT   rY   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.)rY   z-LÚlibrary_dirsÚdirzPAdd a path to the list of library directories (can be specified multiple times).)rX   ÚmetavarrV   rT   rY   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.)rX   rV   rT   rY   z	--verboseÚquietÚstore_falseTz_Print debug information like generated .c/.cpp file location and exact gcc/g++ command invoked.c                 óT  — t        j                  | j                  |«      }|j                  d«      r|n|dz   }t        j
                  j                  t        «       d«      }||t        j                  t        j                  t        f}t        j
                  j                  |«      st	        j                  |«       |j                  r|dz  }|j                  r|t!        j                   «       fz  }|j"                  rt%        |j"                  «      }n>dt'        j(                  t%        |«      j+                  d«      «      j-                  «       z   }t        j
                  j                  ||dz   «      }t        j
                  j                  ||| j.                  z   «      }	t        j
                  j1                  |	«      }
|j                  xs |
 }|j2                  r!t        j
                  j1                  |«      sd}d}|re| j5                  |||||j6                  ¬	«      }|€yt9        |«      d
k(  sJ ‚|d   }|| j:                  |<   |j                  r| j=                  ||«       d„ }dx}}	 t?        d
«      5 }t?        d«      5 }| jA                  |||j                  rdnd|j6                  ¬«       ddd«       ddd«        | |«        |«       t        jL                  «       tO        ||	«      }| jQ                  |«       |j2                  rK	 tS        |d¬«      5 }|jU                  «       }ddd«       tW        jX                  | j[                  «      «      S y# 1 sw Y   Œ¨xY w# 1 sw Y   Œ¬xY w# tB        jD                  jF                  tB        jD                  jH                  f$ r%  | |«        |«       t        jJ                  «       Y yw xY w# 1 sw Y   Œ¥xY w# t\        $ r@}t_        dt        jJ                  ¬«       t_        |t        jJ                  ¬«       Y d}~yd}~ww xY w)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)rb   Ú_cython_magic_rC   z.htmlTN)rc   r   r   c                 ó8   — t        | |d«       t        ||d«       y )NzContent of stdout:
zContent of stderr:
)r   )ÚstdoutÚstderrÚwheres      r'   Úprint_compiler_outputz2CythonMagics.cython.<locals>.print_compiler_outputI  s   € ä˜6 5Ð*@ÔAÜ˜6 5Ð*@ÕAr(   r   r   )Úpgo_step_namerc   rD   zICython completed successfully but the annotated source could not be read.©Úfile)0r   Úparse_argstringrg   ÚendswithÚosÚpathÚjoinr   rK   Úversion_infoÚ
executableÚcython_versionÚexistsÚmakedirsrb   ÚforceÚtimeÚnameÚstrÚhashlibÚsha256ÚencodeÚ	hexdigestÚso_extÚisfilerU   Ú
_cythonizerc   Úlenr"   Ú_profile_pgo_wrapperr   Ú_build_extensionÚ	distutilsÚerrorsr   Ú	LinkErrorrk   rj   r   r6   rI   Úreadr   ÚHTMLÚclean_annotated_htmlÚOSErrorÚprint)r$   r<   r=   ÚargsÚcodeÚlib_dirÚkeyrO   Ú	html_fileÚmodule_pathÚhave_moduleÚneed_cythonizeÚ	extensionÚ
extensionsrm   Ú
get_stderrÚ
get_stdoutr1   rQ   Úannotated_htmlÚes                        r'   rg   zCythonMagics.cython­   s;  € ôd ×.Ñ.¨t¯{©{¸DÓAˆØ—}‘} TÔ*‰t°°t±ˆÜ—'‘'—,‘,Ô4Ó6¸ÓAˆØ�Tœ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¨K¸$¿+¹+Ñ,EÓFˆä—g‘g—n‘n [Ó1ˆØŸ™Ò4¨ _ˆà�=Š=Ü—7‘7—>‘> )Ô,Ø!%�àˆ	ÙØŸ™¨°d¸GÀTÐQU×Q[ÑQ[˜Ó\ˆJØÐ!àÜ�z“? aÒ'Ð'Ð'Ø" 1™ˆIØ$/ˆD×Ñ˜SÑ!à�xŠxØ×)Ñ)¨)°WÔ=ò	Bð
 #'Ð&ˆ
�Zð	Ü˜Q” :Ü  ”^ zØ×)Ñ)Ø! 7À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×)Ò)ûð*úss   É/M3 É:M'Ê.MÊ4M'Ê<M3 ÌO ÌOÌ.O ÍM$	Í M'Í'M0Í,M3 Í3AOÏOÏOÏO Ï	P'Ï'6P"Ð"P'c           	      ó  — t        j                   |«      }|j                  }d|z   }t        j                  j	                  ||dz   «      }t        |dd¬«      5 }|j                  t        j                  d||dœz  «      «       ddd«       |j                  |gz   |_	        ||_        | j                  ||d	¬
«       t        j                  j	                  ||| j                  z   «      }t        ||«       y# 1 sw Y   ŒsxY w)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.crB   rC   rD   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();
            }
            )rO   Úpgo_module_nameNr   )rn   )Úcopyr}   rs   rt   ru   rI   rJ   Útextwrapr   Úsourcesrˆ   rƒ   r   )r$   r™   r“   rO   r¡   Úpgo_wrapper_c_filerQ   Úso_module_paths           r'   r‡   z!CythonMagics._profile_pgo_wrappern  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ˆÜ�_ nÕ5÷# =Ð<ús   Á+C5Ã5C>c           
      óî  — t         j                  j                  ||dz   «      }|j                  }t	        t        t        |j                  «      «      }d|v r#dd l}	|j                  |	j                  «       «       t        |dd¬«      5 }
|
j                  |«       d d d «       t        ||g|z   ||j                  |j                  |j                   |j"                  |j$                  rdnd¬	«      }	 t'        ||j(                  d
t+        dt,        j.                  d   «      ¬«      }|j0                  �|j0                  dv sJ ‚|j0                  |d<   t3        |gfi |¤ŽS # 1 sw Y   ŒÃxY w# t4        $ r Y y w xY w)NrA   Únumpyr   rB   rC   rD   zc++Úc)r}   r¤   Úinclude_dirsr_   Úextra_compile_argsÚextra_link_argsÚ	librariesÚlanguageTr]   )rc   rU   r{   r\   )r   r]   r\   )rs   rt   ru   ÚincludeÚlistÚmapr~   Úsrcr¨   r^   Úget_includerI   rJ   r   r_   Úcompile_argsÚ	link_argsÚlibÚcplusÚdictrU   ÚminrK   rv   r\   r   r   )r$   rO   r’   r“   r‘   rc   Úpyx_fileÚc_include_dirsÚc_src_filesr¨   rQ   r™   Úoptss                r'   r…   zCythonMagics._cythonizeŽ  sO  € Ü—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%Å(	E4Å3E4c                 ód  — | j                  ||||¬«      }d }	 |s7t        j                  j                  t        j                  j                  «      }|j                  «        |s#|� t        j                  j                  |«       y y y # |s#|� t        j                  j                  |«       w w w xY w)N)r“   Útemp_dirrn   )Ú_get_build_extensionr‰   ÚlogÚset_thresholdÚDEBUGÚrun)r$   r™   r“   r¿   rn   rc   Úbuild_extensionÚold_thresholds           r'   rˆ   zCythonMagics._build_extension°  s›   € Ø×3Ñ3Ø˜w°Èð 4ó Xˆàˆð	;ÙÜ )§¡× ;Ñ ;¼I¿M¹M×<OÑ<OÓ P�Ø×ÑÔ!á˜]Ð6Ü—‘×+Ñ+¨MÕ:ð 7�5ø‘5˜]Ð6Ü—‘×+Ñ+¨MÕ:ð 7�5ús   ™A	B Â'B/c                 ól  — |j                   j                  }|dk(  rP|j                   j                  }|sn7d|v sd|d   v rd}n)d|v sd|d   v rd}nd|v sd|d   v rd}nd|v sd|d   v rd}t        j	                  |«      }g }|rˆ||v r„||   D �cg c]  }|j                  |¬«      ‘Œ }	}|j                  D ]Q  }
|j                  |
j                  |
j                  f«       |
j                  |	z   |
_        |
j                  |	z   |
_	        ŒS |S t        d|›d	|›d
�t        j                  ¬«       |S c c}w )NÚunixÚclangr   r   r   zg++)ÚTEMPDIRzNo PGO z* configuration known for C compiler type 'Ú'ro   )ÚcompilerÚcompiler_typeÚcompiler_soÚ
PGO_CONFIGÚgetÚformatrš   r^   r«   r¬   r�   rK   rk   )r$   rÅ   Ú	step_namer¿   rÍ   Úcompiler_cmdÚconfigÚ
orig_flagsrQ   Úflagsr™   s              r'   Ú_add_pgo_flagszCythonMagics._add_pgo_flags¼  sW  € Ø'×0Ñ0×>Ñ>ˆØ˜FÒ"Ø*×3Ñ3×?Ñ?ˆLáØØ˜LÑ(¨G°|ÀA±Ñ,FØ '‘Ø˜,Ñ&¨%°<À±?Ñ*BØ %‘Ø˜,Ñ&¨%°<À±?Ñ*BØ %‘Ø˜,Ñ&¨%°<À±?Ñ*BØ %�Ü—‘ Ó.ˆØˆ
Ù�i 6Ñ)Ø9?À	Ò9JÓKÑ9J°A�Q—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   ÂD1c                 óš   — 	 | j                   S # t        $ r3 | j                  «       j                  d«      | _         | j                   cY S w xY w)z*The extension suffix for compiled modules.Ú )Ú_so_extr0   rÀ   Úget_ext_filename)r$   s    r'   rƒ   zCythonMagics.so_extØ  sE   € ð	 Ø—<‘<ÐøÜò 	 Ø×4Ñ4Ó6×GÑGÈÓKˆDŒLØ—<‘<Òð	 ús   ‚ Ž9A
Á	A
c                 óP   — 	 ddl m} |j                  «        y# t        $ r Y yw xY w)zzclear 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_cachez*CythonMagics._clear_distutils_mkpath_cacheá  s,   € ð
	"Ý8ð ×ÑÕ!øô ò 	Ùð	ús   ‚ ™	%¤%c                 óv  ‡‡‡	‡
— | j                  «        t        «       }|j                  «       }	 |j                  d«       |j                  |«       ‰s|Š| j                  Š	‰r|Š
 G ˆ	ˆ
ˆˆfd„d|«      } ||«      }|j                  «        ‰r‰|_        |r||_	        |�|g|_
        |S # t        $ r Y Œvw xY w)Nz	setup.cfgc                   ó   •— e Zd Zˆ ˆˆˆfd„Zy)ú5CythonMagics._get_build_extension.<locals>._build_extc                 ó<   •—  ‰| ‰‰«       ‰j                  | «       y )N)Úbuild_extensions)r$   Úadd_pgo_flagsÚbase_build_extrn   r¿   s    €€€€r'   ræ   zFCythonMagics._get_build_extension.<locals>._build_ext.build_extensionsÿ  s   ø€ Ù! $¨°xÔ@Ø"×3Ñ3°DÕ9r(   N)Ú__name__Ú
__module__Ú__qualname__ræ   )rç   rè   rn   r¿   s   €€€€r'   Ú
_build_exträ   þ  s   ø„ ÷:ð :r(   rì   )rá   r   Úfind_config_filesÚremoverH   Úparse_config_filesr×   Úfinalize_optionsÚ
build_tempÚ	build_librš   )r$   r™   r“   r¿   rn   rì   ÚdistÚconfig_filesrÅ   rç   rè   s      ``    @@r'   rÀ   z!CythonMagics._get_build_extensioní  sË   û€ à×*Ñ*Ô,Ü‹~ˆØ×-Ñ-Ó/ˆð	Ø×Ñ Ô,ð 	×Ñ Ô-áØˆHØ×+Ñ+ˆáØ'ˆN÷:ñ :˜Zô :ñ
 % TÓ*ˆØ×(Ñ(Ô*ÙØ)1ˆOÔ&ÙØ(/ˆOÔ%ØÐ Ø*3¨ˆOÔ&ØÐøô/ ò 	Ùð	ús   °B, Â,	B8Â7B8c                 óÞ  — g }|rGt        j                  d| t         j                  t         j                  z  «      }|j	                  |«       t        j
                  d| t         j                  t         j                  z  «      j                  d«      }t        j                  d«      }|j                  «       D ]%  }|j                  |«      rŒ|j                  |«       Œ' dj                  |«      S )aY  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>rf   )ÚreÚfindallÚ	MULTILINEÚDOTALLÚextendÚsearchÚgroupÚcompileÚ
splitlinesÚmatchr^   ru   )ÚhtmlÚinclude_styleÚchunksÚstylesÚbodyÚrr<   s          r'   rŽ   z!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(   )T)NNT)ré   rê   rë   r    r6   r
   r   rR   r   Úargumentrg   r‡   r…   rˆ   r×   Úpropertyrƒ   rá   r   rÀ   ÚstaticmethodrŽ   Ú__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)2Ú__doc__Úiors   rö   rK   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   rx   ÚCompiler.Errorsr   ÚInliner   r   ÚDependenciesr   ÚUtilsr   r   rÏ   r   rÑ   rg   ÚreplacerR   © r(   r'   Ú<module>r      s8  ðñ$ó\ 
Û 	Û 	Û 
Û Û Û Û à'ˆc×'Ñ'Ó)€ã ß 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' Ä'D5Ä4D5