§
    �Ÿj6  ã                   ó  — d Z ddlmZ ddlmZ ddlmZ ddlZddlm	Z	 ddl
mZ i dd	“d
d“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“d d “d!d!“d"d"“d#d#“d$d%d%d&œ¥Z e ee                     ¦   «         e                     ¦   «         ¦  «        ¦  «        Zd
xed'<   ed(<   ded)<   ded*<   ded+<   ded,<   ded<   ded<   ded<   ed= ed = ed!= ed"= ed#= ed$= ed%= d-„ Zd.„ Zd<d2„Zd=d3„Zd4„ Zd5„ Zd6„ Zd>d7„Zd8„ Zd?d:„Zd;„ ZdS )@z%Pylab (matplotlib) support utilities.é    )ÚBytesIO)Ú
b2a_base64)ÚpartialN)Ú_pngxy)Ú
flag_callsÚtkÚTkAggÚgtkÚGTKAggÚgtk3ÚGTK3AggÚgtk4ÚGTK4AggÚwxÚWXAggÚqt4ÚQt4AggÚqt5ÚQt5AggÚqt6ÚQtAggÚqtÚosxÚMacOSXÚnbaggÚnbAggÚwebaggÚWebAggÚnotebookÚaggÚsvgÚpdfÚpsz)module://matplotlib_inline.backend_inlineúmodule://ipympl.backend_nbagg)ÚinlineÚipymplÚwidgetÚGTKÚGTKCairoÚ	GTK3CairoÚ	GTK4CairoÚWXÚCocoaAggc                  ó   — ddl m} | s |                     ¦   «         }d„ |D ¦   «         S g }| D ]P}|j                             |¦  «        }|€t          d|z  ¦  «         Œ1|                     |j        j        ¦  «         ŒQ|S )a‡  Get a list of matplotlib figures by figure numbers.

    If no arguments are given, all available figures are returned.  If the
    argument list contains references to invalid figures, a warning is printed
    but the function continues pasting further figures.

    Parameters
    ----------
    figs : tuple
        A tuple of ints giving the figure numbers of the figures to return.
    r   )ÚGcfc                 ó&   — g | ]}|j         j        ‘ŒS © )ÚcanvasÚfigure)Ú.0Úfms     úd/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/IPython/core/pylabtools.pyú
<listcomp>zgetfigs.<locals>.<listcomp>X   s   € Ð8Ð8Ð8 R�”	Ô Ð8Ð8Ð8ó    Nz!Warning: figure %s not available.)	Úmatplotlib._pylab_helpersr/   Úget_all_fig_managersÚfigsÚgetÚprintÚappendr2   r3   )Úfig_numsr/   Úfig_managersr;   ÚnumÚfs         r6   ÚgetfigsrC   I   s¤   € ð .Ð-Ð-Ð-Ð-Ð-Øð Ø×/Ò/Ñ1Ô1ˆØ8Ð8¨<Ð8Ñ8Ô8Ð8àˆØð 	-ð 	-ˆCØ”—’˜SÑ!Ô!ˆAØˆyÝÐ9¸CÑ?Ñ@Ô@Ð@Ð@à—’˜AœHœOÑ,Ô,Ð,Ð,Øˆr8   c                 ó&   — ddl }| |g|j        d<   dS )z»Set the default figure size to be [sizex, sizey].

    This is just an easy to remember, convenience wrapper that sets::

      matplotlib.rcParams['figure.figsize'] = [sizex, sizey]
    r   Nzfigure.figsize)Ú
matplotlibÚrcParams)ÚsizexÚsizeyrE   s      r6   ÚfigsizerI   d   s(   € ð ÐÐÐØ-2°E¨N€JÔÐ(Ñ)Ð)Ð)r8   ÚpngÚtightFc                 óî  — | j         s	| j        sdS | j        }|dk    r|dz  }d}||                      ¦   «         |                      ¦   «         ||dœ}|                     |¦  «         t          ¦   «         }| j        €ddlm	}  || ¦  «          | j        j
        |fi |¤Ž |                     ¦   «         }	|dk    r|	                     d	¦  «        }	n&|r$t          |	d
¬¦  «                             d¦  «        }	|	S )a«  Print a figure to an image, and return the resulting file data

    Returned data will be bytes unless ``fmt='svg'``,
    in which case it will be unicode.

    Any keyword args are passed to fig.canvas.print_figure,
    such as ``quality`` or ``bbox_inches``.

    If `base64` is True, return base64-encoded str instead of raw bytes
    for binary-encoded image formats

    .. versionadded:: 7.29
        base64 argument
    NÚretinaé   rJ   )ÚformatÚ	facecolorÚ	edgecolorÚdpiÚbbox_inchesr   )ÚFigureCanvasBaser!   zutf-8F©ÚnewlineÚascii)ÚaxesÚlinesrR   Úget_facecolorÚget_edgecolorÚupdater   r2   Úmatplotlib.backend_basesrT   Úprint_figureÚgetvalueÚdecoder   )
ÚfigÚfmtrS   Úbase64ÚkwargsrR   ÚkwÚbytes_iorT   Údatas
             r6   r^   r^   o   s.  € ð" Œ8ð ˜CœIð Øˆà
Œ'€CØ
ˆh‚€Ø�A‰gˆØˆð Ø×%Ò%Ñ'Ô'Ø×%Ò%Ñ'Ô'ØØ!ð
ð 
€Bð ‡I‚IˆfÑÔÐå‰yŒy€HØ
„zÐØ=Ð=Ð=Ð=Ð=Ð=ØÐ˜ÑÔÐà€C„JÔ˜HÐ+Ð+¨Ð+Ð+Ð+Ø×ÒÑÔ€DØ
ˆe‚|€|Ø�{Š{˜7Ñ#Ô#ˆˆØ	ð ?Ý˜$¨Ð.Ñ.Ô.×5Ò5°gÑ>Ô>ˆØ€Kr8   c                 ó¸   — t          | fdddœ|¤Ž}|€dS t          |¦  «        \  }}|dz  |dz  dœ}|r$t          |d¬¦  «                             d¦  «        }||fS )	zÖformat a figure as a pixel-doubled (retina) PNG

    If `base64` is True, return base64-encoded str instead of raw bytes
    for binary-encoded image formats

    .. versionadded:: 7.29
        base64 argument
    rM   F©rb   rc   NrN   )ÚwidthÚheightrU   rW   )r^   r   r   r`   )ra   rc   rd   ÚpngdataÚwÚhÚmetadatas          r6   Úretina_figurerp       s„   € õ ˜3ÐE H°UÐEÐE¸fÐEÐE€Gð €ØˆÝ�'‰?Œ?�D€A€qØ˜A™¨¨1©Ð-Ð-€HØð EÝ˜W¨eÐ4Ñ4Ô4×;Ò;¸GÑDÔDˆØ�HÐÐr8   c                 ó   ‡ — ˆ fd„}|S )a\  Factory to return a matplotlib-enabled runner for %run.

    Parameters
    ----------
    safe_execfile : function
        This must be a function with the same interface as the
        :meth:`safe_execfile` method of IPython.

    Returns
    -------
    A function suitable for use as the ``runner`` argument of the %run magic
    function.
    c                 ó@  •— ddl }ddlm} |j        d         }|                     d¦  «          ‰| g|¢R i |¤Ž |                     |¦  «         |j        j        r |                     ¦   «          d|j        _        	 |j        } |¦   «          dS # t          $ r Y dS w xY w)z÷matplotlib-aware wrapper around safe_execfile.

        Its interface is identical to that of the :func:`execfile` builtin.

        This is ultimately a call to execfile(), but wrapped in safeties to
        properly handle interactive rendering.r   NÚinteractiveF)
rE   Úmatplotlib.pyplotÚpyplotrF   rs   Údraw_if_interactiveÚcalledÚdrawÚdraw_allÚAttributeError)ÚfnameÚwherere   rE   ÚpltÚis_interactiveÚdaÚsafe_execfiles          €r6   Úmpl_execfilez mpl_runner.<locals>.mpl_execfileÆ   sá   ø€ ð 	ÐÐÐØ'Ð'Ð'Ð'Ð'Ð'ð $Ô,¨]Ô;ˆØ×Ò˜uÑ%Ô%Ð%Øˆ�eÐ(˜UÐ(Ð(Ð( RÐ(Ð(Ð(Ø×Ò˜~Ñ.Ô.Ð.àÔ"Ô)ð 	3Ø�HŠH‰JŒJˆJØ-2ˆCÔ#Ô*ð	Ø”ˆBð ˆB‰DŒDˆDˆDˆDøõ ð 	ð 	ð 	ØˆDˆDð	øøøs   Á<B Â
BÂBr1   )r€   r�   s   ` r6   Ú
mpl_runnerr‚   ·   s$   ø€ ðð ð ð ð ð< Ðr8   c                 ó€   — 	 | j         j        j        } |¦   «          dS # t          $ r}t	          ¦   «         |‚d}~ww xY w)zreshow an nbagg figureN)r2   ÚmanagerÚreshowrz   ÚNotImplementedError)ra   r…   Úes      r6   Ú_reshow_nbagg_figurerˆ   ç   sT   € ðØ”Ô#Ô*ˆð 	ˆ‰Œˆˆˆøõ ð +ð +ð +Ý!Ñ#Ô#¨Ð*øøøøð+øøøs   ‚ Ÿ
=©8¸=c           	      óº  ‡— ddl }ddlmŠ | j        j        d         }| j        j        d         }| j        j        d         }| j        j        d         }t          |t          ¦  «        r|h}t          |¦  «        }ˆfd„| j        j                             ¦   «         D ¦   «          | 	                    ¦   «          
                    ¦   «         }|d	k    s|d
k    r'| j        j        }	|	                     ‰t          ¦  «         h d£}
|                     |
¦  «        }|rYdd                     d„ |D ¦   «         ¦  «        z  }dd                     d„ |
D ¦   «         ¦  «        z  }t!          d|›d|›�¦  «        ‚d|v r)|                     ‰t#          t$          fdddœ|¤Ž¦  «         d|v sd|v r(|                     ‰t#          t&          fddi|¤Ž¦  «         d|v sd|v r)|                     ‰t#          t$          fdddœ|¤Ž¦  «         d|v r(|                     ‰t#          t$          fddi|¤Ž¦  «         d|v r+|                     ‰t#          t$          fdddœ|¤Ž¦  «         dS dS )a_  Select figure formats for the inline backend.

    Parameters
    ----------
    shell : InteractiveShell
        The main IPython instance.
    formats : str or set
        One or a set of figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'.
    **kwargs : any
        Extra keyword arguments to be passed to fig.canvas.print_figure.
    r   N)ÚFigurezimage/svg+xmlz	image/pngz
image/jpegzapplication/pdfc                 ó<   •— g | ]}|                      ‰d ¦  «        ‘ŒS )N)Úpop)r4   rB   rŠ   s     €r6   r7   z)select_figure_formats.<locals>.<listcomp>
  s'   ø€ ÐPÐPÐP˜a€a‡e‚eˆF�DÑÔÐPÐPÐPr8   r   r$   >   Újpgr"   rJ   r!   ÚjpegÚpng2xrM   z%sú,c                 ó,   — g | ]}t          |¦  «        ‘ŒS r1   ©Úrepr©r4   rB   s     r6   r7   z)select_figure_formats.<locals>.<listcomp>  s   € Ð3Ð3Ð3¨!�d 1™gœgÐ3Ð3Ð3r8   c                 ó,   — g | ]}t          |¦  «        ‘ŒS r1   r’   r”   s     r6   r7   z)select_figure_formats.<locals>.<listcomp>  s   € Ð9Ð9Ð9¨!�d 1™gœgÐ9Ð9Ð9r8   zsupported formats are: z not rJ   Tri   rM   r�   rc   r�   rŽ   r!   rb   r"   )rE   Úmatplotlib.figurerŠ   Údisplay_formatterÚ
formattersÚ
isinstanceÚstrÚsetÚvaluesÚget_backendÚlowerÚipython_display_formatterÚfor_typerˆ   Ú
differenceÚjoinÚ
ValueErrorr   r^   rp   )ÚshellÚformatsrd   rE   Úsvg_formatterÚpng_formatterÚjpg_formatterÚpdf_formatterÚ
mplbackendÚ	formatterÚ	supportedÚbadÚbsÚgsrŠ   s                 @r6   Úselect_figure_formatsr°   ñ   sè  ø€ ð ÐÐÐØ(Ð(Ð(Ð(Ð(Ð(àÔ+Ô6°ÔG€MØÔ+Ô6°{ÔC€MØÔ+Ô6°|ÔD€MØÔ+Ô6Ð7HÔI€Må�'�3ÑÔð Ø�)ˆå�'‰lŒl€GàPÐPÐPÐP 5Ô#:Ô#E×#LÒ#LÑ#NÔ#NÐPÑPÔPÐPØ×'Ò'Ñ)Ô)×/Ò/Ñ1Ô1€JØ�WÒÐ 
Ð.MÒ MÐ MØÔ+ÔEˆ	Ø×Ò˜6Õ#7Ñ8Ô8Ð8àGÐGÐG€IØ
×
Ò
˜YÑ
'Ô
'€CØ
ð HØ�C—H’HÐ3Ð3¨sÐ3Ñ3Ô3Ñ4Ô4Ñ4ˆØ�C—H’HÐ9Ð9¨yÐ9Ñ9Ô9Ñ:Ô:Ñ:ˆÝˆj¸r¸r¸rÀ2À2ÐFÑGÔGÐGà�ÐÐØ×ÒØ•G�LÐK¨e¸DÐKÐKÀFÐKÐKñ	
ô 	
ð 	
ð �7ÐÐ˜g¨Ð0Ð0Ø×Ò˜v¥w­}Ð'TÐ'TÀTÐ'TÈVÐ'TÐ'TÑUÔUÐUØ�ÐÐ˜6 WÐ,Ð,Ø×ÒØ•G�LÐK¨e¸DÐKÐKÀFÐKÐKñ	
ô 	
ð 	
ð �ÐÐØ×Ò˜v¥w­|Ð'QÐ'QÀÐ'QÈ&Ð'QÐ'QÑRÔRÐRØ�ÐÐØ×ÒØ•G�LÐK¨e¸DÐKÐKÀFÐKÐKñ	
ô 	
ð 	
ð 	
ð 	
ð Ðr8   c                 óÌ   — ddl }| r| dk    rt          |          }| dk    rd} n?|j        d         }t                               |d¦  «        } |r| |k    r|} t          |          }| |fS )aÛ  Given a gui string return the gui and mpl backend.

    Parameters
    ----------
    gui : str
        Can be one of ('tk','gtk','wx','qt','qt4','inline','agg').
    gui_select : str
        Can be one of ('tk','gtk','wx','qt','qt4','inline').
        This is any gui already selected by the shell.

    Returns
    -------
    A tuple of (gui, backend) where backend is one of ('TkAgg','GTKAgg',
    'WXAgg','Qt4Agg','module://matplotlib_inline.backend_inline','agg').
    r   NÚautor    Úbackend)rE   ÚbackendsÚrcParamsOrigÚbackend2guir<   )ÚguiÚ
gui_selectrE   r³   s       r6   Úfind_gui_and_backendr¹   -  sˆ   € ð" ÐÐÐà
ð $ˆs�fŠ}ˆ}å˜3”-ˆØ�%Š<ˆ<ØˆCøð Ô)¨)Ô4ˆõ �oŠo˜g tÑ,Ô,ˆð ð 	$˜# Ò+Ð+ØˆCÝ˜s”mˆGà�ˆ<Ðr8   c                 óÌ   — ddl }|                     d¦  «         | |j        d<   ddl m} |                     | ¦  «         d|j        _        t          |j        ¦  «        |_        dS )z7Activate the given backend and set interactive to True.r   NTr³   )ru   F)	rE   rs   rF   ru   Úswitch_backendÚshowÚ	_needmainr   rv   )r³   rE   r}   s      r6   Úactivate_matplotlibr¾   X  s€   € ð ÐÐÐØ×Ò˜4Ñ Ô Ð ð
 &-€JÔ˜	Ñ"ð
 )Ð(Ð(Ð(Ð(Ð(à×Ò�wÑÔÐà€C„HÔõ )¨Ô)@ÑAÔA€CÔÐÐr8   Tc                 ó�   — d}t          || ¦  «         |rd}t          || ¦  «         t          | d<   ddlm} || d<   t          | d<   dS )	zÊPopulate the namespace with pylab-related values.

    Imports matplotlib, pylab, numpy, and everything from pylab and numpy.

    Also imports a few names from IPython (figsize, display, getfigs)

    zbimport numpy
import matplotlib
from matplotlib import pylab, mlab, pyplot
np = numpy
plt = pyplot
z3from matplotlib.pylab import *
from numpy import *
rI   r   )ÚdisplayrÀ   rC   N)ÚexecrI   ÚIPython.displayrÀ   rC   )Úuser_nsÚ
import_allÚsrÀ   s       r6   Úimport_pylabrÆ   p  sr   € ð
€Aõ 	ˆˆGÑÔÐàð ð%ˆåˆQ�ÑÔÐõ !€GˆIÑØ'Ð'Ð'Ð'Ð'Ð'à €GˆIÑÝ €GˆIÑÐÐr8   c                 ób   — t          j        dt          d¬¦  «         ddlm}  || |¦  «         dS )a
  
    .. deprecated:: 7.23

        use `matplotlib_inline.backend_inline.configure_inline_support()`

    Configure an IPython shell object for matplotlib use.

    Parameters
    ----------
    shell : InteractiveShell instance
    backend : matplotlib backend
    z‡`configure_inline_support` is deprecated since IPython 7.23, directly use `matplotlib_inline.backend_inline.configure_inline_support()`rN   )Ú
stacklevelr   )Úconfigure_inline_supportN)ÚwarningsÚwarnÚDeprecationWarningÚ matplotlib_inline.backend_inlinerÉ   )r¤   r³   Úconfigure_inline_support_origs      r6   rÉ   rÉ   ‘  sb   € õ „Mð	LåØð	ñ ô ð ðð ð ð ð ð ð "Ð! %¨Ñ1Ô1Ð1Ð1Ð1r8   )rJ   rK   F)F)NN)T)Ú__doc__Úior   Úbinasciir   Ú	functoolsr   rÊ   ÚIPython.core.displayr   ÚIPython.utils.decoratorsr   r´   ÚdictÚziprœ   Úkeysr¶   rC   rI   r^   rp   r‚   rˆ   r°   r¹   r¾   rÆ   rÉ   r1   r8   r6   ú<module>rØ      sí  ðà +Ð +ð
 Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø €€€à 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø /Ð /Ð /Ð /Ð /Ð /ðØˆ'ðà	ˆ8ðð ˆIðð ˆIð	ð
 	ˆ'ðð 
ˆ8ðð 
ˆ8ðð 
ˆ7ðð 	ˆ(ðð 
ˆ8ðð ˆWðð ˆhðð �ðð 
ˆ5ðð 
ˆ5ðð  
ˆ5ð!ð" 	ˆ$ð#ð$ :Ø-Ø-ð)ð ð €ð6 ˆd�3�3�x—’Ñ(Ô(¨(¯-ª-©/¬/Ñ:Ô:Ñ;Ô;€ð 05Ð 4€ˆEÑ �[ Ñ,Ø!€ˆKÑ Ø!€ˆKÑ Ø€ˆDÑ Ø€ˆJÑ ð €ˆGÑ Ø€ˆHÑ Ø€ˆHÑ ð �ÐØ�ÐØ�ÐØ�ÐØ�ÐØÐ;Ð<ØÐ/Ð0ðð ð ð6;ð ;ð ;ð/ð /ð /ð /ðbð ð ð ð.-ð -ð -ð`ð ð ð5
ð 5
ð 5
ðx(ð (ð (ð (ðVBð Bð Bð0!ð !ð !ð !ðB2ð 2ð 2ð 2ð 2r8   