Ë
    O/æj¬X  ã                   ó|   — d 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 ddlmZ d„ Zd	„ Zd
„ ZdZ	 	 	 	 	 	 	 dd„Zy)z7Tools for setting up printing in interactive sessions. é    )Úversion_tuple)ÚBytesIO)Úlatex)Úpreview)Údebug)Ú	Printablec                 ó6   ‡ ‡‡— ddl }ddlŠˆˆˆ fd„}||_        y)z.Setup printing in Python interactive session. r   Nc                 óL   •— | �!d‰_         t         ‰| fi ‰¤Ž«       | ‰_         yy)z’Python's pretty-printer display hook.

           This function was adapted from:

            https://www.python.org/dev/peps/pep-0217/

        N)Ú_Úprint)ÚargÚbuiltinsÚsettingsÚstringify_funcs    €€€ú]/root/repos/pocs/video-evals/.venv/lib/python3.12/site-packages/sympy/interactive/printing.pyÚ_displayhookz+_init_python_printing.<locals>._displayhook   s/   ø€ ð ˆ?ØˆHŒJÜ‘. Ñ1¨Ñ1Ô2ØˆH�Jð ó    )Úsysr   Údisplayhook)r   r   r   r   r   s   ``  @r   Ú_init_python_printingr      s   ú€ ãÛöð #€C…Or   c                 ó¶  ‡‡‡‡‡‡‡
‡‡‡‡ ‡!‡"‡#‡$‡%‡&‡'‡(— 	 ddl mŠ' ‰€8| j                  j	                  «       }|dk(  rdŠn
|dk(  rdŠndŠt        d	‰«       |d
k(  rd‰z  Š%ndŠ%d}d}t        d‰
z  «      }d|||‰|fz  }|j                  «       Š#d‰
z  }ddj                  |«      gŠ$t        d‰#«       t        d‰$«       |	xs t        Š&ˆˆˆfd„}ˆ#ˆˆ%ˆfd„Š!ˆ$ˆˆ%ˆfd„Š"ˆˆ'ˆ
fd„Š dŠ(ˆˆˆ(fd„Šˆˆ ˆ!ˆ&ˆˆfd„}ˆˆ"ˆ&ˆˆfd„}ˆˆ ˆ&ˆfd„}ˆˆ&ˆˆfd„}ˆfd „}ddl
Št        ‰j                  «      t        d!«      k\  �r{t        t        t        t         t"        t$        t&        g}| j(                  j*                  d"   }|t,        gz   D ]  }|j/                  ||«       Œ | j(                  j*                  d#   }|d$v r0t        d%«       |D ]  }|j/                  ||«       Œ |t,        _        nUt        d&«       |D ],  }||j2                  v sŒ|j2                  j5                  |«       Œ. t,        j6                  t,        _        | j(                  j*                  d'   }|d(v r0t        d)«       |D ]  }|j/                  ||«       Œ |t,        _        nŠ|d*k(  r0t        d+«       |D ]  }|j/                  ||«       Œ |t,        _        nUt        d,«       |D ],  }||j2                  v sŒ|j2                  j5                  |«       Œ. t,        j6                  t,        _        | j(                  j*                  d-   }|d.v r0t        d/«       |D ]  }|j/                  ||«       Œ |t,        _        yt        d0«       |D ],  }||j2                  v sŒ|j2                  j5                  |«       Œ. t,        j6                  t,        _        y| j=                  d1|«       y# t        $ r Y �Œ¼w xY w)2z/Setup printing in IPython interactive session. r   )Úlatex_to_pngNÚlightbgÚBlackÚlinuxÚWhiteÚGrayz*init_printing: Automatic foreground color:Úsvgz
\special{color %s}Ú Útightz0cm,0cmé–   z-T %s -D %d -bg %s -fg %s -O %sg«ªªªªª @z
--no-fontsz
--scale={}zinit_printing: DVIOPTIONS:zinit_printing: DVIOPTIONS_SVG:c                 ó®   •—  ‰| «      r|j                   ‰| «      «       y|j                  ‰j                  j                  j                  | «      «       y)z*caller for pretty, for use in IPython 0.11N)ÚtextÚlibÚpretty)r   ÚpÚcycleÚIPythonÚ
_can_printr   s      €€€r   Ú_print_plainz,_init_ipython_printing.<locals>._print_plainO   s<   ø€ á�cŒ?Ø�F‰F‘> #Ó&Õ'à�F‰F�7—;‘;×%Ñ%×,Ñ,¨SÓ1Õ2r   c           
      ó°   •— t        «       }	 t        | dd‰|‰‰‰¬«       |j                  «       S # t        $ r}t        ddt	        |«      «       ‚ d }~ww xY w)NÚpngr   ©ÚoutputÚviewerÚeulerÚoutputbufferÚextra_preambleÚ
dvioptionsÚfontsizezpng printing:ú"_preview_wrapper exception raised:)r   r   Ú	Exceptionr   ÚreprÚgetvalue)ÚoÚ
exprbufferÚer3   r0   r2   r4   s      €€€€r   Ú_preview_wrapperz0_init_ipython_printing.<locals>._preview_wrapperV   sc   ø€ Ü“Yˆ
ð	Ü�A˜e¨I¸UØ!+¸NØ)°Hõ>ð ×"Ñ"Ó$Ð$øô ò 	ä�/Ð#GÜ�q“'ôàûð		ús   �0 °	A¹AÁAc           
      óÎ   •— t        «       }	 t        | dd‰|‰‰‰¬«       |j                  «       j                  d«      S # t        $ r}t        ddt	        |«      «       ‚ d }~ww xY w)Nr   r   r-   zsvg printing:r5   zutf-8)r   r   r6   r   r7   r8   Údecode)r9   r:   r;   Údvioptions_svgr0   r2   r4   s      €€€€r   Ú_svg_wrapperz,_init_ipython_printing.<locals>._svg_wrapperc   so   ø€ Ü“Yˆ
ð	Ü�A˜e¨I¸UØ!+¸NØ-¸õBð ×"Ñ"Ó$×+Ñ+¨GÓ4Ð4øô ò 	ä�/Ð#GÜ�q“'ôàûð		ús   �? ¿	A$ÁAÁA$c                 ó¢   •— 	 	  ‰| ‰‰¬«      S # t         $ r  ‰| «      cY S w xY w# t        $ r}t        dt        |«      «       Y d }~y d }~ww xY w)N)ÚcolorÚscalezmatplotlib exception caught:)Ú	TypeErrorÚ
ValueErrorr   r7   )r9   r;   Ú	forecolorr   rC   s     €€€r   Ú_matplotlib_wrapperz3_init_ipython_printing.<locals>._matplotlib_wrapperp   sV   ø€ ð	ð'Ù# A¨Y¸eÔDÐDøÜò 'Ù# A“Ò&ð'ûäò 	ÜÐ0´$°q³'Ô:Üûð	ús$   „
 �# & ¢#£& ¦	A¯A	Á	A)Ú_latexÚ	_sympystrÚ_prettyÚ
_sympyreprc                 óø  •‡ — 	 t         t        t        t        f}t	        ‰ |«      rQt        ‰ «      j                  d„ |D «       vst        ‰ «      j                  d„ |D «       vryt        ˆfd„‰ D «       «      S t	        ‰ t        «      rt        ˆˆ fd„‰ D «       «      S t	        ‰ t        «      ryt	        ‰ t        «      ryt        ˆ fd„‰D «       «      ryt	        ‰ t        t        f«      r‰ryy# t        $ r Y yw xY w)zÃReturn True if type o can be printed with one of the SymPy printers.

        If o is a container type, this is True if and only if every element of
        o can be printed in this way.
        c              3   ó4   K  — | ]  }|j                   –— Œ y ­w©N)Ú__str__©Ú.0Úis     r   ú	<genexpr>z=_init_ipython_printing.<locals>._can_print.<locals>.<genexpr>‘   s   è ø€ Ò+M¸!¨A¯I­IÑ+Mùó   ‚c              3   ó4   K  — | ]  }|j                   –— Œ y ­wrN   )Ú__repr__rP   s     r   rS   z=_init_ipython_printing.<locals>._can_print.<locals>.<genexpr>’   s   è ø€ Ò,O¸A¨Q¯Z­ZÑ,OùrT   Fc              3   ó.   •K  — | ]  } ‰|«      –— Œ y ­wrN   © )rQ   rR   r)   s     €r   rS   z=_init_ipython_printing.<locals>._can_print.<locals>.<genexpr>”   s   øè ø€ Ò4¨Q™: aŸ=Ñ4ùs   ƒc              3   óH   •K  — | ]  } ‰|«      xr  ‰‰|   «      –— Œ y ­wrN   rX   )rQ   rR   r)   r9   s     €€r   rS   z=_init_ipython_printing.<locals>._can_print.<locals>.<genexpr>–   s&   øè ø€ ÒIÀ!™: a›=Ò=©Z¸¸!¹Ó-=Ó=ÑIùs   ƒ"Tc              3   ó6   •K  — | ]  }t        ‰|«      –— Œ y ­wrN   )Úhasattr)rQ   Úhookr9   s     €r   rS   z=_init_ipython_printing.<locals>._can_print.<locals>.<genexpr>œ   s   øè ø€ ÒA¨$”W˜Q ×%ÑAùs   ƒ)ÚlistÚtupleÚsetÚ	frozensetÚ
isinstanceÚtyperO   rV   ÚallÚdictÚboolr   ÚanyÚfloatÚintÚRuntimeError)r9   Úbuiltin_typesr)   Úprint_builtinÚprinting_hookss   ` €€€r   r)   z*_init_ipython_printing.<locals>._can_print‚   sÔ   ù€ ð	ô "¤5¬#¬yÐ9ˆMÜ˜!˜]Ô+ô ˜“G—O‘OÑ+M¸}Ô+MÑMÜ˜“G×$Ñ$Ñ,OÀÔ,OÑOØ ÜÓ4°!Ô4Ó4Ð4Ü˜AœtÔ$ÜÔIÀqÔIÓIÐIÜ˜AœtÔ$ØÜ˜AœyÔ)àÜÓA°.ÔAÔAàÜ˜A¤¤s˜|Ô,±ØØøÜò 	Ùð	ús6   „AC- Á#C- Á7$C- ÂC- Â-C- Â>C- ÃC- Ã-	C9Ã8C9c                 óÚ   •—  ‰| «      r ‰| fd‰i‰¤Ž}‰dk(  rd|z  }	  ‰|«      S y# t         $ r8}t        dt        |«      d«       ‰dk7  r ‰| fddi‰¤Ž} ‰|«      cY d}~S d}~ww xY w)zˆ
        A function that returns a png rendered by an external latex
        distribution, falling back to matplotlib rendering
        ÚmodeÚplainú$\displaystyle %s$úpreview failed with:z# Falling back to matplotlib backendÚinlineN©ri   r   r7   )	r9   Úsr;   r)   rG   r<   r   Ú
latex_moder   s	      €€€€€€r   Ú_print_latex_pngz0_init_ipython_printing.<locals>._print_latex_png¨   s”   ø€ ñ
 �aŒ=Ù�aÑ5˜jÐ5¨HÑ5ˆAØ˜WÒ$Ø)¨AÑ-�ð.Ù'¨Ó*Ð*ð øô  ò .ÜÐ,¬d°1«gØ;ô=à Ò)Ù˜aÑ; hÐ;°(Ñ;�AÙ*¨1Ó-Õ-ûð.ús    ) ©	A*²-A%ÁA*Á%A*c                 óª   •—  ‰| «      r ‰| fd‰i‰¤Ž}‰dk(  rd|z  }	  ‰|«      S y# t         $ r }t        dt        |«      d«       Y d}~yd}~ww xY w)zz
        A function that returns a svg rendered by an external latex
        distribution, no fallback available.
        rn   ro   rp   rq   z No fallback available.Nrs   )r9   rt   r;   r)   r@   r   ru   r   s      €€€€€r   Ú_print_latex_svgz0_init_ipython_printing.<locals>._print_latex_svgº   sq   ø€ ñ
 �aŒ=Ù�aÑ5˜jÐ5¨HÑ5ˆAØ˜WÒ$Ø)¨AÑ-�ð1Ù# A“Ð&ð øô  ò 1ÜÐ,¬d°1«gØ/÷1ñ 1ûð1ús    ) ©	A²AÁAc                 ó<   •—  ‰| «      r ‰| fddi‰¤Ž} ‰|«      S y)zD
        A function that returns a png rendered by mathtext
        rn   rr   NrX   )r9   rt   r)   rG   r   r   s     €€€€r   Ú_print_latex_matplotlibz7_init_ipython_printing.<locals>._print_latex_matplotlibÉ   s0   ø€ ñ �aŒ=Ù�aÑ3˜hÐ3¨(Ñ3ˆAÙ& qÓ)Ð)ð r   c                 óD   •—  ‰| «      r ‰| fd‰i‰¤Ž}‰dk(  rd|z  S |S y)zW
        A function to generate the latex representation of SymPy expressions.
        rn   ro   rp   NrX   )r9   rt   r)   r   ru   r   s     €€€€r   Ú_print_latex_textz1_init_ipython_printing.<locals>._print_latex_textÑ   s=   ø€ ñ �aŒ=Ù�aÑ5˜jÐ5¨HÑ5ˆAØ˜WÒ$Ø,¨qÑ0Ð0ØˆHð	 r   c                 óž   •— | j                   j                  r" ‰|«      }d|v r
t        «        t        |«       yt        t        |«      «       y)zžIPython's pretty-printer display hook, for use in IPython 0.10

           This function was adapted from:

            ipython/IPython/hooks.py:155

        ú
N)ÚrcÚpprintr   r7   )Úselfr   Úoutr   s      €r   Ú_result_displayz/_init_ipython_printing.<locals>._result_displayÛ   s9   ø€ ð �7‰7�>Š>Ù  Ó%ˆCà�s‰{Ü”ä�#�Jä”$�s“)Õr   z0.11z
text/plainzimage/svg+xml)r   z"init_printing: using svg formatterz*init_printing: not using any svg formatterz	image/png)Tr,   z"init_printing: using png formatterÚ
matplotlibz)init_printing: using matplotlib formatterz*init_printing: not using any png formatterz
text/latex)TÚmathjaxz&init_printing: using mathjax formatterz-init_printing: not using text/latex formatterÚresult_display)ÚIPython.lib.latextoolsr   ÚImportErrorÚcolorsÚlowerr   ÚroundÚsplitÚformatÚdefault_latexr(   r   Ú__version__rg   r^   r]   r_   r`   rd   rh   Údisplay_formatterÚ
formattersr   Úfor_typeÚ
_repr_svg_Útype_printersÚpopÚ_repr_disabledÚ
_repr_png_Ú_repr_latex_Úset_hook))Úipr   Ú	use_latexr0   rF   Ú	backcolorr4   ru   rk   Úlatex_printerrC   r   rB   Ú	imagesizeÚoffsetÚ
resolutionÚdviÚ	svg_scaler*   rv   rx   rz   r|   rƒ   Úprintable_typesÚplaintext_formatterÚclsÚsvg_formatterÚpng_formatterÚlatex_formatterr(   r)   rG   r<   r@   r3   r?   r2   r   r   rl   s)    ` `` ``` ``                  @@@@@@@@@@@r   Ú_init_ipython_printingr©   !   sÑ  ÿÿú€ ðÝ7ð ÐØ—	‘	—‘Ó!ˆØ�IÒØ‰IØ�gÒØ‰Ið ˆIÜÐ:¸IÔFà�EÒØ0°9Ñ<‰àˆà€IØ€FÜ�s˜5‘yÓ!€JØ
,Ø�:˜y¨)°Vð0=ñ =€Cà—‘“€Jà�u‘€IØ" L×$7Ñ$7¸	Ó$BÐC€Nä	Ð
&¨
Ô3Ü	Ð
*¨NÔ;àÒ*œ]€Eö3÷%÷5öð F€Nö!÷L.ñ .÷$1ð 1÷*÷ôó$ Ü�W×(Ñ(Ó)¬]¸6Ó-BÓBô !¤%¬¬s´I¼tÄSÐIˆà ×2Ñ2×=Ñ=¸lÑKÐð
 #¤i [Ñ0ò 	<ˆCØ×(Ñ(¨¨lÕ;ð	<ð ×,Ñ,×7Ñ7¸ÑHˆØ˜	Ñ!ÜÐ6Ô7Ø&ò >�Ø×&Ñ& sÐ,<Õ=ð>à#3ŒIÕ äÐ>Ô?Ø&ò 9�ð ˜-×5Ñ5Ò5Ø!×/Ñ/×3Ñ3°CÕ8ð	9ô
 $-×#;Ñ#;ŒIÔ à×,Ñ,×7Ñ7¸ÑDˆØ˜Ñ%ÜÐ6Ô7Ø&ò >�Ø×&Ñ& sÐ,<Õ=ð>à#3ŒIÕ Ø˜,Ò&ÜÐ=Ô>Ø&ò E�Ø×&Ñ& sÐ,CÕDðEà#:ŒIÕ äÐ>Ô?Ø&ò 9�ð ˜-×5Ñ5Ò5Ø!×/Ñ/×3Ñ3°CÕ8ð	9ô
 $-×#;Ñ#;ŒIÔ à×.Ñ.×9Ñ9¸,ÑGˆØÐ)Ñ)ÜÐ:Ô;Ø&ò A�Ø×(Ñ(¨Ð.?Õ@ðAà%6ŒIÕ"äÐAÔBØ&ò ;�ð ˜/×7Ñ7Ò7Ø#×1Ñ1×5Ñ5°cÕ:ð	;ô
 &/×%=Ñ%=ŒIÕ"ð 	�‰Ð$ oÕ6øôU ò Úðús   •O Ï	OÏOc                 óŒ   — ddl m} d|vry	 ddlm} t        | |«      S # t        $ r 	 ddlm} n# t        $ r Y Y yw xY wY Œ/w xY w)z%Is a shell instance an IPython shell?r   )Úmodulesr(   F)ÚInteractiveShell)r   r«   ÚIPython.core.interactiveshellr¬   rˆ   ÚIPython.iplibra   )Úshellr«   r¬   s      r   Ú_is_ipythonr°   3  s\   € õ Ø˜ÑØð	ÝBô �eÐ-Ó.Ð.øô ò ð	Þ6øÜò 	ò ð	úñ 7ðús*   � Ÿ	A©0¯A°	=¹A¼=½AÁAFNc                 óÐ  ‡‡‡‡‡— ddl }ddlm} | r|�|}nddlm} n|�|}nddlm} d}|€	 t        «       }|du}|r|st        |«      }|r…| rƒ	 ddl	}t        |j                  «      t        d«      k\  rddlm} nddlm} dd	lm} t#        |||f«      s<d
dj%                  |j&                  «      vr‰€t)        d«       dŠ|€t)        d«       d}	 t,        s|s|j/                  ‰‰‰‰¬«       n|Š| r
ˆˆˆˆˆfd„}nˆˆfd„}|r6|j1                  dd«      }|rt)        d«       t3        |||||	|
|||||fi |¤Ž yt5        |fi |¤Ž y# t        $ r Y �Œw xY w# t*        $ r Y Œ’w xY w)a2  
    Initializes pretty-printer depending on the environment.

    Parameters
    ==========

    pretty_print : bool, default=True
        If ``True``, use :func:`~.pretty_print` to stringify or the provided pretty
        printer; if ``False``, use :func:`~.sstrrepr` to stringify or the provided string
        printer.
    order : string or None, default='lex'
        There are a few different settings for this parameter:
        ``'lex'`` (default), which is lexographic order;
        ``'grlex'``, which is graded lexographic order;
        ``'grevlex'``, which is reversed graded lexographic order;
        ``'old'``, which is used for compatibility reasons and for long expressions;
        ``None``, which sets it to lex.
    use_unicode : bool or None, default=None
        If ``True``, use unicode characters;
        if ``False``, do not use unicode characters;
        if ``None``, make a guess based on the environment.
    use_latex : string, bool, or None, default=None
        If ``True``, use default LaTeX rendering in GUI interfaces (png and
        mathjax);
        if ``False``, do not use LaTeX rendering;
        if ``None``, make a guess based on the environment;
        if ``'png'``, enable LaTeX rendering with an external LaTeX compiler,
        falling back to matplotlib if external compilation fails;
        if ``'matplotlib'``, enable LaTeX rendering with matplotlib;
        if ``'mathjax'``, enable LaTeX text generation, for example MathJax
        rendering in IPython notebook or text rendering in LaTeX documents;
        if ``'svg'``, enable LaTeX rendering with an external latex compiler,
        no fallback
    wrap_line : bool
        If True, lines will wrap at the end; if False, they will not wrap
        but continue as one line. This is only relevant if ``pretty_print`` is
        True.
    num_columns : int or None, default=None
        If ``int``, number of columns before wrapping is set to num_columns; if
        ``None``, number of columns before wrapping is set to terminal width.
        This is only relevant if ``pretty_print`` is ``True``.
    no_global : bool, default=False
        If ``True``, the settings become system wide;
        if ``False``, use just for this console/session.
    ip : An interactive console
        This can either be an instance of IPython,
        or a class that derives from code.InteractiveConsole.
    euler : bool, optional, default=False
        Loads the euler package in the LaTeX preamble for handwritten style
        fonts (https://www.ctan.org/pkg/euler).
    forecolor : string or None, optional, default=None
        DVI setting for foreground color. ``None`` means that either ``'Black'``,
        ``'White'``, or ``'Gray'`` will be selected based on a guess of the IPython
        terminal color setting. See notes.
    backcolor : string, optional, default='Transparent'
        DVI setting for background color. See notes.
    fontsize : string or int, optional, default='10pt'
        A font size to pass to the LaTeX documentclass function in the
        preamble. Note that the options are limited by the documentclass.
        Consider using scale instead.
    latex_mode : string, optional, default='plain'
        The mode used in the LaTeX printer. Can be one of:
        ``{'inline'|'plain'|'equation'|'equation*'}``.
    print_builtin : boolean, optional, default=True
        If ``True`` then floats and integers will be printed. If ``False`` the
        printer will only print SymPy types.
    str_printer : function, optional, default=None
        A custom string printer function. This should mimic
        :func:`~.sstrrepr()`.
    pretty_printer : function, optional, default=None
        A custom pretty printer. This should mimic :func:`~.pretty()`.
    latex_printer : function, optional, default=None
        A custom LaTeX printer. This should mimic :func:`~.latex()`.
    scale : float, optional, default=1.0
        Scale the LaTeX output when using the ``'png'`` or ``'svg'`` backends.
        Useful for high dpi screens.
    settings :
        Any additional settings for the ``latex`` and ``pretty`` commands can
        be used to fine-tune the output.

    Examples
    ========

    >>> from sympy.interactive import init_printing
    >>> from sympy import Symbol, sqrt
    >>> from sympy.abc import x, y
    >>> sqrt(5)
    sqrt(5)
    >>> init_printing(pretty_print=True) # doctest: +SKIP
    >>> sqrt(5) # doctest: +SKIP
      ___
    \/ 5
    >>> theta = Symbol('theta') # doctest: +SKIP
    >>> init_printing(use_unicode=True) # doctest: +SKIP
    >>> theta # doctest: +SKIP
    \u03b8
    >>> init_printing(use_unicode=False) # doctest: +SKIP
    >>> theta # doctest: +SKIP
    theta
    >>> init_printing(order='lex') # doctest: +SKIP
    >>> str(y + x + y**2 + x**2) # doctest: +SKIP
    x**2 + x + y**2 + y
    >>> init_printing(order='grlex') # doctest: +SKIP
    >>> str(y + x + y**2 + x**2) # doctest: +SKIP
    x**2 + x + y**2 + y
    >>> init_printing(order='grevlex') # doctest: +SKIP
    >>> str(y * x**2 + x * y**2) # doctest: +SKIP
    x**2*y + x*y**2
    >>> init_printing(order='old') # doctest: +SKIP
    >>> str(x**2 + y**2 + x + y) # doctest: +SKIP
    x**2 + x + y**2 + y
    >>> init_printing(num_columns=10) # doctest: +SKIP
    >>> x**2 + x + y**2 + y # doctest: +SKIP
    x + y +
    x**2 + y**2

    Notes
    =====

    The foreground and background colors can be selected when using ``'png'`` or
    ``'svg'`` LaTeX rendering. Note that before the ``init_printing`` command is
    executed, the LaTeX rendering is handled by the IPython console and not SymPy.

    The colors can be selected among the 68 standard colors known to ``dvips``,
    for a list see [1]_. In addition, the background color can be
    set to  ``'Transparent'`` (which is the default value).

    When using the ``'Auto'`` foreground color, the guess is based on the
    ``colors`` variable in the IPython console, see [2]_. Hence, if
    that variable is set correctly in your IPython console, there is a high
    chance that the output will be readable, although manual settings may be
    needed.


    References
    ==========

    .. [1] https://en.wikibooks.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips

    .. [2] https://ipython.readthedocs.io/en/stable/config/details.html#terminal-colors

    See Also
    ========

    sympy.printing.latex
    sympy.printing.pretty

    r   N)ÚPrinter)r%   )ÚsstrreprFz1.0)ÚTerminalInteractiveShell)ÚInteractiveConsolezipython-consoler   z*init_printing: Setting use_unicode to TrueTz(init_printing: Setting use_latex to True©ÚorderÚuse_unicodeÚ	wrap_lineÚnum_columnsc                 ó    •—  ‰| f‰‰‰‰dœ|¤ŽS )Nr¶   rX   )Úexprr   Ú_stringify_funcrº   r·   r¸   r¹   s     €€€€€r   ú<lambda>zinit_printing.<locals>.<lambda>  s,   ø€ Ù,¨Tð 9¸Ø9DØ7@Ø9Dñ9ð 08ñ	9ð r   c                 ó   •—  ‰| fd‰i|¤ŽS )Nr·   rX   )r¼   r   r½   r·   s     €€r   r¾   zinit_printing.<locals>.<lambda>%  s   ø€ ©Øñ*3Ø %ð*3Ø)1ñ*3€ r   rn   zMinit_printing: Mode is not able to be set due to internalsof IPython printing)r   Úsympy.printing.printerr²   Úsympy.printingr%   r³   Úget_ipythonÚ	NameErrorr°   r(   r   r�   Ú!IPython.terminal.interactiveshellr´   Ú*IPython.frontend.terminal.interactiveshellÚcoderµ   ra   ÚjoinÚargvr   rˆ   Ú	NO_GLOBALÚset_global_settingsr•   r©   r   )Úpretty_printr·   r¸   r›   r¹   rº   Ú	no_globalrš   r0   rF   rœ   r4   ru   rk   Ústr_printerÚpretty_printerr�   rC   r   r   r²   r   Ú
in_ipythonr(   r´   rµ   Úmode_in_settingsr½   s    `` ``                     @r   Úinit_printingrÑ   H  s   ü€ óv Ý.áØÐ%Ø+‰Næ?àÐ"Ø(‰NåAð €JØ	€zð	*Ü“ˆBð  D˜.ˆJá	‘*Ü  “_ˆ
á‘lð	%Ûô ˜W×0Ñ0Ó1´]À5Ó5IÒIÞVå_Ý/ô
 ˜bÐ#5Ð7OÐ"PÔQØ)°·±¸¿¹Ó1BÑBØÐ&ÜÐFÔGØ"&�KØÐ$ÜÐDÔEØ $‘Iå™YØ×#Ñ#¨%¸[Ø.7À[ð 	$õ 	Rð )ˆá÷9‰Nô3ð ñ Ø#Ÿ<™<¨°Ó5ÐÙÜð (ô )ä˜r >°9¸eØ(¨)°X¸zØ,¨m¸Uñ	+ð "*ó	+ô
 	˜nÑ9°Ó9øôy ò 	Úð	ûô& ò 	Ùð	ús#   ®
E	 Á8E Å		EÅEÅ	E%Å$E%)TNNNNNFNFNÚTransparentÚ10ptro   TNNNg      ð?)Ú__doc__Úsympy.external.importtoolsr   Úior   Úsympy.printing.latexr   rŽ   Úsympy.printing.previewr   Úsympy.utilities.miscr   Úsympy.printing.defaultsr   r   r©   r°   rÉ   rÑ   rX   r   r   ú<module>rÛ      sM   ðÙ =å 4Ý å 7Ý *Ý &Ý -ò#ò*P7òd/ð& €	à=AØ>BØCGØ4:Ø48Ø37Ø,/ôj:r   