§
    �Ÿj
¦  ã                   óè  — d Z ddlmZm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
mZ ddlmZ ddlmZmZ ddlmZ ddlmZ d	d
lmZ g d¢Zg d¢Zeez   Zddl	mZ d„ Zd„ ZdCd„Zd„ Zd„ Zd„ Zd„ Z d„ Z!d„ Z"d„ Z#d„ Z$d„ Z%d„ Z& G d„ de'¦  «        Z( G d„ de(¦  «        Z) G d „ d!e)¦  «        Z* G d"„ d#e)¦  «        Z+ G d$„ d%e)¦  «        Z, G d&„ d'e)¦  «        Z- G d(„ d)e)¦  «        Z. G d*„ d+e(¦  «        Z/ G d,„ d-e(¦  «        Z0 G d.„ d/e(¦  «        Z1d0Z2d1Z3d2Z4 G d3„ d4e1¦  «        Z5 G d5„ d6e)¦  «        Z6d7Z7d8Z8d9„ Z9d:„ Z:d;„ Z; G d<„ d=e(¦  «        Z< G d>„ d?e(¦  «        Z=ed@„ ¦   «         Z>edDdB„¦   «         Z?dS )EzGTop-level display functions for displaying object in different formats.é    )Ú
b2a_base64ÚhexlifyN)Údeepcopy)Úsplitext)ÚPathÚPurePath)Úcast_unicode)Úskip_doctesté   )Údisplay_functions)Údisplay_prettyÚdisplay_htmlÚdisplay_markdownÚdisplay_svgÚdisplay_pngÚdisplay_jpegÚdisplay_latexÚdisplay_jsonÚdisplay_javascriptÚdisplay_pdfÚDisplayObjectÚTextDisplayObjectÚPrettyÚHTMLÚMarkdownÚMathÚLatexÚSVGÚProgressBarÚJSONÚGeoJSONÚ
JavascriptÚImageÚset_matplotlib_formatsÚset_matplotlib_closeÚVideo)ÚdisplayÚclear_outputÚpublish_display_dataÚupdate_displayÚDisplayHandle)Úwarnc                 ó  — | t           v r0t          d| › d�t          d¬¦  «         t          t          | ¦  «        S | t          ¦   «                              ¦   «         v rt          ¦   «         |          S t          dt          › d| › �¦  «        ‚)Nz
Importing z_ from IPython.core.display is deprecated since IPython 7.14, please import from IPython displayé   ©Ú
stacklevelzmodule z has no attribute )	Ú_deprecated_namesr,   ÚDeprecationWarningÚgetattrr   ÚglobalsÚkeysÚAttributeErrorÚ__name__)Únames    úa/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/IPython/core/display.pyÚ__getattr__r:   *   sœ   € ØÕ Ð Ð ÝÐ˜$ÐÐÐõ  BTð  abð  	cñ  	cô  	cð  	cÝÕ(¨$Ñ/Ô/Ð/à�w‰yŒy�~Š~ÑÔÐÐÝ‰yŒy˜ŒÐåÐI¥xÐIÐIÀ4ÐIÐIÑJÔJÐJó    c                 ód   — 	 t           j                             | ¦  «        S # t          $ r Y dS w xY w)z*Check path, but don't let exceptions raiseF)ÚosÚpathÚexistsÚ	Exception)r>   s    r9   Ú_safe_existsrA   9   s=   € ðÝŒw�~Š~˜dÑ#Ô#Ð#øÝð ð ð Øˆuˆuðøøøs   ‚! ¡
/®/Fc                 ó\   ‡ — |r‰ |i}|rˆ fd„|D ¦   «         }t          j        |||‰ gdœŽ dS )aú  internal implementation of all display_foo methods

    Parameters
    ----------
    mimetype : str
        The mimetype to be published (e.g. 'image/png')
    *objs : object
        The Python objects to display, or if raw=True raw text data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    c                 ó   •— g | ]}‰|i‘ŒS © rD   )Ú.0ÚobjÚmimetypes     €r9   ú
<listcomp>z%_display_mimetype.<locals>.<listcomp>U   s   ø€ Ð2Ð2Ð2 S�(˜C�Ð2Ð2Ð2r;   )ÚrawÚmetadataÚincludeN)r   r'   )rG   ÚobjsrI   rJ   s   `   r9   Ú_display_mimetyperM   A   sZ   ø€ ð  ð (Ø˜hÐ'ˆØ
ð 3à2Ð2Ð2Ð2¨DÐ2Ñ2Ô2ˆÝÔ˜t¨°xÈ(ÈÐTÐTÐTÐTÐTÐTr;   c                  ó"   — t          d| fi |¤Ž dS )a¶  Display the pretty (default) representation of an object.

    Parameters
    ----------
    *objs : object
        The Python objects to display, or if raw=True raw text data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    ú
text/plainN©rM   ©rL   Úkwargss     r9   r   r   ]   ó"   € õ �l DÐ3Ð3¨FÐ3Ð3Ð3Ð3Ð3r;   c                  ó"   — t          d| fi |¤Ž dS )a  Display the HTML representation of an object.

    Note: If raw=False and the object does not have a HTML
    representation, no HTML will be shown.

    Parameters
    ----------
    *objs : object
        The Python objects to display, or if raw=True raw HTML data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    ú	text/htmlNrP   rQ   s     r9   r   r   n   s"   € õ" �k 4Ð2Ð2¨6Ð2Ð2Ð2Ð2Ð2r;   c                  ó"   — t          d| fi |¤Ž dS )a³  Displays the Markdown representation of an object.

    Parameters
    ----------
    *objs : object
        The Python objects to display, or if raw=True raw markdown data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    ztext/markdownNrP   rQ   s     r9   r   r   ‚   s"   € õ �o tÐ6Ð6¨vÐ6Ð6Ð6Ð6Ð6r;   c                  ó"   — t          d| fi |¤Ž dS )a¨  Display the SVG representation of an object.

    Parameters
    ----------
    *objs : object
        The Python objects to display, or if raw=True raw svg data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    zimage/svg+xmlNrP   rQ   s     r9   r   r   ”   s"   € õ �o tÐ6Ð6¨vÐ6Ð6Ð6Ð6Ð6r;   c                  ó"   — t          d| fi |¤Ž dS )a¨  Display the PNG representation of an object.

    Parameters
    ----------
    *objs : object
        The Python objects to display, or if raw=True raw png data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    ú	image/pngNrP   rQ   s     r9   r   r   ¥   s"   € õ �k 4Ð2Ð2¨6Ð2Ð2Ð2Ð2Ð2r;   c                  ó"   — t          d| fi |¤Ž dS )aª  Display the JPEG representation of an object.

    Parameters
    ----------
    *objs : object
        The Python objects to display, or if raw=True raw JPEG data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    ú
image/jpegNrP   rQ   s     r9   r   r   ¶   rS   r;   c                  ó"   — t          d| fi |¤Ž dS )a¬  Display the LaTeX representation of an object.

    Parameters
    ----------
    *objs : object
        The Python objects to display, or if raw=True raw latex data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    z
text/latexNrP   rQ   s     r9   r   r   Ç   rS   r;   c                  ó"   — t          d| fi |¤Ž dS )aå  Display the JSON representation of an object.

    Note that not many frontends support displaying JSON.

    Parameters
    ----------
    *objs : object
        The Python objects to display, or if raw=True raw json data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    zapplication/jsonNrP   rQ   s     r9   r   r   Ø   s#   € õ  Ð(¨$Ð9Ð9°&Ð9Ð9Ð9Ð9Ð9r;   c                  ó"   — t          d| fi |¤Ž dS )a¶  Display the Javascript representation of an object.

    Parameters
    ----------
    *objs : object
        The Python objects to display, or if raw=True raw javascript data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    zapplication/javascriptNrP   rQ   s     r9   r   r   ë   s#   € õ Ð.°Ð?Ð?¸Ð?Ð?Ð?Ð?Ð?r;   c                  ó"   — t          d| fi |¤Ž dS )a¯  Display the PDF representation of an object.

    Parameters
    ----------
    *objs : object
        The Python objects to display, or if raw=True raw javascript data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    zapplication/pdfNrP   rQ   s     r9   r   r   ü   s#   € õ Ð'¨Ð8Ð8°Ð8Ð8Ð8Ð8Ð8r;   c                   óH   ‡ — e Zd ZdZdZdZdZd
d„Zˆ fd„Zd„ Z	d„ Z
d	„ Zˆ xZS )r   z*An object that wraps data to be displayed.ÚrFNc                 óž  — t          |t          t          f¦  «        rt          |¦  «        }|�Jt          |t          ¦  «        r5|                     d¦  «        r	|€|}d}d}nt          |¦  «        r|€d}|}d}|| _        || _        || _        |�|| _	        n| j	        €i | _	        |  
                    ¦   «          |                      ¦   «          dS )a4  Create a display object given raw data.

        When this object is returned by an expression or passed to the
        display function, it will result in the data being displayed
        in the frontend. The MIME type of the data should match the
        subclasses used, so the Png subclass should be used for 'image/png'
        data. If the data is a URL, the data will first be downloaded
        and then displayed. If

        Parameters
        ----------
        data : unicode, str or bytes
            The raw data or a URL or file to load the data from
        url : unicode
            A URL to download the data from.
        filename : unicode
            Path to a local file to load the data from.
        metadata : dict
            Dict of metadata associated to be the object when displayed
        NÚhttp)Ú
isinstancer   r   ÚstrÚ
startswithrA   ÚurlÚfilenameÚdatarJ   ÚreloadÚ_check_data)Úselfri   rg   rh   rJ   s        r9   Ú__init__zDisplayObject.__init__  sâ   € õ* �d�T¥8Ð,Ñ-Ô-ð 	Ý�t‘9”9ˆDàÐ¥
¨4µÑ 5Ô 5ÐØ�Š˜vÑ&Ô&ð ¨3¨;Ø�Ø�Ø��Ý˜dÑ#Ô#ð ¨Ð(8Ø�Ø�Ø�àˆŒØ ˆŒð ˆŒ	àÐØ$ˆDŒMˆMØŒ]Ð"ØˆDŒMà�Š‰ŒˆØ×ÒÑÔÐÐÐr;   c                 óš   •— | j         s| j        }d|j        ›d|j        ›d�}n't	          t
          | ¦  «                             ¦   «         }|S )Nú<ú.z object>)Ú_show_mem_addrÚ	__class__Ú
__module__r7   Úsuperr   Ú__repr__)rl   Úclsra   rr   s      €r9   ru   zDisplayObject.__repr__J  sO   ø€ ØÔ"ð 	6Ø”.ˆCˆCØ$'¤N N N°C´L°L°LÐAˆAˆAå•m TÑ*Ô*×3Ò3Ñ5Ô5ˆAØˆr;   c                 ó   — dS )z5Override in subclasses if there's something to check.NrD   ©rl   s    r9   rk   zDisplayObject._check_dataR  ó   € àˆr;   c                 óT   — | j         r| j        t          | j         ¦  «        fS | j        S )úBshortcut for returning metadata with shape information, if defined)rJ   ri   r   rx   s    r9   Ú_data_and_metadataz DisplayObject._data_and_metadataV  s+   € àŒ=ð 	Ø”9�h t¤}Ñ5Ô5Ð5Ð5à”9Ðr;   c                 ót  — | j         �]d| j        v rdnd}t          | j         | j        |¬¦  «        5 }|                     ¦   «         | _        ddd¦  «         dS # 1 swxY w Y   dS | j        ��Kddlm}  || j        ¦  «        }|                     ¦   «         }d}d|j        v r{|j        d          	                    d¦  «        D ]Z}| 
                    ¦   «         }|                     d	¦  «        r/| 	                    d
¦  «        d          
                    ¦   «         } nŒ[d|j        v rjd|j        d         v r[ddl}ddlm} |                      ||¦  «        d|pd¬¦  «        5 }	d}|	                     ¦   «         }ddd¦  «         n# 1 swxY w Y   |r|                     |d¦  «        | _        dS || _        dS dS )ú%Reload the raw data from file or URL.NÚbzutf-8)Úencodingr   )Úurlopenzcontent-typeú;Úcharsetú=éÿÿÿÿzcontent-encodingÚgzip)ÚBytesIOÚrtÚreplace)rh   Ú_read_flagsÚopenÚreadri   rg   Úurllib.requestr�   ÚheadersÚsplitÚstriprf   r†   Úior‡   Údecode)
rl   r€   Úfr�   Úresponseri   Úsubr†   r‡   Úfps
             r9   rj   zDisplayObject.reload]  so  € àŒ=Ð$Ø" dÔ&6Ð6Ð6�t�t¸GˆHÝ�d”m TÔ%5ÀÐIÑIÔIð %ÈQØŸFšF™HœH�”	ð%ð %ð %ñ %ô %ð %ð %ð %ð %ð %ð %ð %øøøð %ð %ð %ð %ð %ð %àŒXÑ!à.Ð.Ð.Ð.Ð.Ð.Ø�w˜tœxÑ(Ô(ˆHØ—=’=‘?”?ˆDàˆHØ Ô!1Ð1Ð1Ø#Ô+¨NÔ;×AÒAÀ#ÑFÔFð ð �CØŸ)š)™+œ+�CØ—~’~ iÑ0Ô0ð Ø#&§9¢9¨S¡>¤>°"Ô#5×#;Ò#;Ñ#=Ô#=˜Ø˜ðð " XÔ%5Ð5Ð5à˜XÔ-Ð.@ÔAÐAÐAØ�K�K�KØ*Ð*Ð*Ð*Ð*Ð*ð ŸšØ˜ ™œ t°hÐ6IÀ'ð #ñ ô ð )àØ#'˜Ø!Ÿwšw™yœy˜ð	)ð )ð )ñ )ô )ð )ð )ð )ð )ð )ð )øøøð )ð )ð )ð )ð ð !Ø ŸKšK¨°)Ñ<Ô<�”	�	�	à �”	�	�	ðC "Ð!s#   ±AÁAÁAÅ"FÆF	ÆF	©NNNN)r7   rs   Ú__qualname__Ú__doc__rŠ   rq   rJ   rm   ru   rk   r|   rj   Ú__classcell__©rr   s   @r9   r   r     s�   ø€ € € € € Ø4Ð4à€KØ€NØ€Hð/ð /ð /ð /ðbð ð ð ð ðð ð ðð ð ð'!ð '!ð '!ð '!ð '!ð '!ð '!r;   r   c                   ó   — e Zd ZdZd„ ZdS )r   a…  Create a text display object given raw data.

    Parameters
    ----------
    data : str or unicode
        The raw data or a URL or file to load the data from.
    url : unicode
        A URL to download the data from.
    filename : unicode
        Path to a local file to load the data from.
    metadata : dict
        Dict of metadata associated to be the object when displayed
    c                 ó’   — | j         �=t          | j         t          ¦  «        s%t          | j        j        ›d| j         ›�¦  «        ‚d S d S )Nz expects text, not )ri   rd   re   Ú	TypeErrorrr   r7   rx   s    r9   rk   zTextDisplayObject._check_data•  sN   € ØŒ9Ð ­°D´I½sÑ)CÔ)CÐ Ý¸¼Ô9PÐ9PÐ9PÐRVÔR[ÐR[Ð\Ñ]Ô]Ð]ð !Ð Ð Ð r;   N)r7   rs   r˜   r™   rk   rD   r;   r9   r   r   ‡  s2   € € € € € ðð ð^ð ^ð ^ð ^ð ^r;   r   c                   ó   — e Zd Zd„ ZdS )r   c                 ó6   — |                      | j        ¦  «        S ©N)Útextri   )rl   ÚppÚcycles      r9   Ú_repr_pretty_zPretty._repr_pretty_›  s   € Ø�wŠw�t”yÑ!Ô!Ð!r;   N)r7   rs   r˜   r¥   rD   r;   r9   r   r   ™  s#   € € € € € ð"ð "ð "ð "ð "r;   r   c                   ó,   ‡ — e Zd Zdˆ fd„	Zd„ Zd„ Zˆ xZS )r   Nc                 ó¨   •‡— ˆfd„} |¦   «         rt          j        d¦  «         t          t          | ¦  «                             ‰|||¬¦  «         d S )Nc                  óÐ   •— ‰sdS ‰d d…                               ¦   «         } ‰dd …                               ¦   «         }|                      d¦  «        o|                     d¦  «        S )NFé
   iöÿÿÿz<iframe z	</iframe>)Úlowerrf   Úendswith)ÚprefixÚsuffixri   s     €r9   r,   zHTML.__init__.<locals>.warn¢  sg   ø€ Øð Ø�uð ˜#˜2˜#”Y—_’_Ñ&Ô&ˆFØ˜#˜$˜$”Z×%Ò%Ñ'Ô'ˆFØ×$Ò$ ZÑ0Ô0ÐQ°V·_²_À[Ñ5QÔ5QÐQr;   z-Consider using IPython.display.IFrame instead©ri   rg   rh   rJ   )Úwarningsr,   rt   r   rm   )rl   ri   rg   rh   rJ   r,   rr   s    `    €r9   rm   zHTML.__init__¡  sr   øø€ ð
	Rð 
	Rð 
	Rð 
	Rð 
	Rð ˆ4‰6Œ6ð 	KÝŒMÐIÑJÔJÐJÝ�d�DÑÔ×"Ò"¨°#ÀÐS[Ð"Ñ\Ô\Ð\Ð\Ð\r;   c                 ó*   — |                       ¦   «         S r¡   ©r|   rx   s    r9   Ú_repr_html_zHTML._repr_html_²  ó   € Ø×&Ò&Ñ(Ô(Ð(r;   c                 ó*   — |                       ¦   «         S )zÐ
        This method exists to inform other HTML-using modules (e.g. Markupsafe,
        htmltag, etc) that this object is HTML and does not need things like
        special characters (<>&) escaped.
        )r²   rx   s    r9   Ú__html__zHTML.__html__µ  s   € ð ×ÒÑ!Ô!Ð!r;   r—   )r7   rs   r˜   rm   r²   rµ   rš   r›   s   @r9   r   r   Ÿ  sa   ø€ € € € € ð]ð ]ð ]ð ]ð ]ð ]ð")ð )ð )ð"ð "ð "ð "ð "ð "ð "r;   r   c                   ó   — e Zd Zd„ ZdS )r   c                 ó*   — |                       ¦   «         S r¡   r±   rx   s    r9   Ú_repr_markdown_zMarkdown._repr_markdown_À  r³   r;   N)r7   rs   r˜   r¸   rD   r;   r9   r   r   ¾  ó#   € € € € € ð)ð )ð )ð )ð )r;   r   c                   ó   — e Zd Zd„ ZdS )r   c                 óz   — d| j                              d¦  «        z  }| j        r|t          | j        ¦  «        fS |S )Nz$\displaystyle %s$ú$)ri   r�   rJ   r   )rl   Úss     r9   Ú_repr_latex_zMath._repr_latex_Æ  s>   € Ø! D¤I§O¢O°CÑ$8Ô$8Ñ8ˆØŒ=ð 	Ø•h˜tœ}Ñ-Ô-Ð-Ð-àˆHr;   N©r7   rs   r˜   r¾   rD   r;   r9   r   r   Ä  s#   € € € € € ðð ð ð ð r;   r   c                   ó   — e Zd Zd„ ZdS )r   c                 ó*   — |                       ¦   «         S r¡   r±   rx   s    r9   r¾   zLatex._repr_latex_Ð  r³   r;   Nr¿   rD   r;   r9   r   r   Î  r¹   r;   r   c                   óV   — e Zd ZdZdZdZed„ ¦   «         Zej        d„ ¦   «         Zd„ Z	dS )r   z”Embed an SVG into the display.

    Note if you just want to view a svg image via a URL use `:class:Image` with
    a url=URL keyword argument.
    ÚrbNc                 ó   — | j         S r¡   ©Ú_datarx   s    r9   ri   zSVG.dataà  ó
   € àŒzÐr;   c                 óä   — |€	d | _         d S ddlm} |                     |¦  «        }|                     d¦  «        }|r|d                              ¦   «         }n	 t          |¦  «        }|| _         d S )Nr   )ÚminidomÚsvg)rÆ   Úxml.domrÉ   ÚparseStringÚgetElementsByTagNameÚtoxmlr	   )rl   rÊ   rÉ   ÚxÚ	found_svgs        r9   ri   zSVG.dataä  s‡   € àˆ;ØˆDŒJØˆFà#Ð#Ð#Ð#Ð#Ð#Ø×Ò Ñ$Ô$ˆà×*Ò*¨5Ñ1Ô1ˆ	Øð 	Ø˜A”,×$Ò$Ñ&Ô&ˆCˆCð Ý˜3ÑÔˆØˆŒ
ˆ
ˆ
r;   c                 ó*   — |                       ¦   «         S r¡   r±   rx   s    r9   Ú
_repr_svg_zSVG._repr_svg_÷  r³   r;   )
r7   rs   r˜   r™   rŠ   rÆ   Úpropertyri   ÚsetterrÒ   rD   r;   r9   r   r   Ô  sq   € € € € € ðð ð €Kð €Eàðð ñ „Xðð 
„[ðð ñ „[ðð$)ð )ð )ð )ð )r;   r   c                   ór   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Ze	d„ ¦   «         Z
e
j        d„ ¦   «         Z
d	„ Zd
„ ZdS )r   z?Progressbar supports displaying a progressbar like element
    c                 ó°   — || _         d| _        d| _        d| _        t	          t          j        d¦  «        ¦  «                             d¦  «        | _        dS )z‰Creates a new progressbar

        Parameters
        ----------
        total : int
            maximum size of the progressbar
        r   Ú60exé<   é   ÚasciiN)	ÚtotalÚ	_progressÚ
html_widthÚ
text_widthr   r=   Úurandomr’   Ú_display_id)rl   rÛ   s     r9   rm   zProgressBar.__init__ý  sL   € ð ˆŒ
ØˆŒØ ˆŒØˆŒÝ"¥2¤:¨a¡=¤=Ñ1Ô1×8Ò8¸ÑAÔAˆÔÐÐr;   c                 óÌ   — | j         | j        z  }dt          || j        z  ¦  «        z  }d| j        t	          |¦  «        z
  z  }d                     ||| j         | j        ¦  «        S )Nr„   ú z[{}{}] {}/{})ÚprogressrÛ   ÚintrÞ   ÚlenÚformat)rl   ÚfractionÚfilledÚrests       r9   ru   zProgressBar.__repr__  sf   € Ø”= 4¤:Ñ-ˆØ•s˜8 d¤oÑ5Ñ6Ô6Ñ6ˆØ�d”o­¨F©¬Ñ3Ñ4ˆØ×$Ò$Ø�DØŒM˜4œ:ñ
ô 
ð 	
r;   c                 óN   — d                      | j        | j        | j        ¦  «        S )Nz:<progress style='width:{}' max='{}' value='{}'></progress>)ræ   rÝ   rÛ   rã   rx   s    r9   r²   zProgressBar._repr_html_  s'   € ØK×RÒRØŒO˜TœZ¨¬ñ8ô 8ð 	8r;   c                 ó<   — t          j        | | j        ¬¦  «         d S )N)Ú
display_id©r   r'   rà   rx   s    r9   r'   zProgressBar.display  s!   € ÝÔ! $°4Ô3CÐDÑDÔDÐDÐDÐDr;   c                 ó>   — t          j        | | j        d¬¦  «         d S )NT)rì   Úupdaterí   rx   s    r9   rï   zProgressBar.update  s#   € ÝÔ! $°4Ô3CÈDÐQÑQÔQÐQÐQÐQr;   c                 ó   — | j         S r¡   )rÜ   rx   s    r9   rã   zProgressBar.progress  s
   € àŒ~Ðr;   c                 ó<   — || _         |                      ¦   «          d S r¡   )rÜ   rï   )rl   Úvalues     r9   rã   zProgressBar.progress"  s   € àˆŒØ�Š‰Œˆˆˆr;   c                 ó<   — |                       ¦   «          d| _        | S )Nr…   )r'   rÜ   rx   s    r9   Ú__iter__zProgressBar.__iter__'  s   € Ø�Š‰ŒˆØˆŒØˆr;   c                 ól   — | xj         dz  c_         | j         | j        k     r| j         S t          ¦   «         ‚)z4Returns current value and increments display by one.r   )rã   rÛ   ÚStopIterationrx   s    r9   Ú__next__zProgressBar.__next__,  s3   € àˆŒ˜ÑˆŒØŒ=˜4œ:Ò%Ð%Ø”=Ð å‘/”/Ð!r;   N)r7   rs   r˜   r™   rm   ru   r²   r'   rï   rÓ   rã   rÔ   rô   r÷   rD   r;   r9   r   r   ú  sÈ   € € € € € ðð ðBð Bð Bð
ð 
ð 
ð8ð 8ð 8ðEð Eð EðRð Rð Rð ðð ñ „Xðð „_ðð ñ „_ððð ð ð
"ð "ð "ð "ð "r;   r   c                   óp   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zed„ ¦   «         Zej	        d„ ¦   «         Zd	„ Z
d
„ Zˆ xZS )r    z®JSON expects a JSON-able dict or list

    not an already-serialized JSON string.

    Scalar types (None, number, string) are not allowed, only dict or list containers.
    NFÚrootc                 óâ   •— ||dœ| _         |r| j                              |¦  «         |r| j                              |¦  «         t          t          | ¦  «                             |||¬¦  «         dS )aÙ  Create a JSON display object given raw data.

        Parameters
        ----------
        data : dict or list
            JSON data to display. Not an already-serialized JSON string.
            Scalar types (None, number, string) are not allowed, only dict
            or list containers.
        url : unicode
            A URL to download the data from.
        filename : unicode
            Path to a local file to load the data from.
        expanded : boolean
            Metadata to control whether a JSON display component is expanded.
        metadata : dict
            Specify extra metadata to attach to the json display object.
        root : str
            The name of the root element of the JSON tree
        )Úexpandedrù   ©ri   rg   rh   N)rJ   rï   rt   r    rm   )	rl   ri   rg   rh   rû   rJ   rù   rR   rr   s	           €r9   rm   zJSON.__init__=  s‚   ø€ ð* !Øð
ð 
ˆŒð ð 	+ØŒM× Ò  Ñ*Ô*Ð*Øð 	)ØŒM× Ò  Ñ(Ô(Ð(Ý�d�DÑÔ×"Ò"¨°#ÀÐ"ÑIÔIÐIÐIÐIr;   c                 ó    — | j         �Dt          | j         t          t          f¦  «        s%t	          | j        j        ›d| j         ›�¦  «        ‚d S d S )Nz$ expects JSONable dict or list, not )ri   rd   ÚdictÚlistrž   rr   r7   rx   s    r9   rk   zJSON._check_data[  sR   € ØŒ9Ð ­°D´IÅÅd¸|Ñ)LÔ)LÐ ÝÈ$Ì.ÔJaÐJaÐJaÐcgÔclÐclÐmÑnÔnÐnð !Ð Ð Ð r;   c                 ó   — | j         S r¡   rÅ   rx   s    r9   ri   z	JSON.data_  rÇ   r;   c                 ó   — t          |t          t          f¦  «        rt          |¦  «        }t          |t          ¦  «        r6| j        €| j        €t          j        d¦  «         t          j	        |¦  «        }|| _
        d S )Nz4JSON expects JSONable dict or list, not JSON strings)rd   r   r   re   rh   rg   r¯   r,   ÚjsonÚloadsrÆ   )rl   ri   s     r9   ri   z	JSON.datac  sp   € å�d�T¥8Ð,Ñ-Ô-ð 	Ý�t‘9”9ˆDå�d�CÑ Ô ð 	$ØŒ}Ð$¨¬Ð)9Ý”ÐTÑUÔUÐUÝ”:˜dÑ#Ô#ˆDØˆŒ
ˆ
ˆ
r;   c                 ó   — | j         | j        fS r¡   )ri   rJ   rx   s    r9   r|   zJSON._data_and_metadatan  s   € ØŒy˜$œ-Ð'Ð'r;   c                 ó*   — |                       ¦   «         S r¡   r±   rx   s    r9   Ú_repr_json_zJSON._repr_json_q  r³   r;   )NNNFNrù   )r7   rs   r˜   r™   rÆ   rm   rk   rÓ   ri   rÔ   r|   r  rš   r›   s   @r9   r    r    4  s¼   ø€ € € € € ðð ð €EðJð Jð Jð Jð Jð Jð<oð oð oð ðð ñ „Xðð 
„[ðð ñ „[ðð(ð (ð (ð)ð )ð )ð )ð )ð )ð )r;   r    z“var link = document.createElement("link");
	link.rel = "stylesheet";
	link.type = "text/css";
	link.href = "%s";
	document.head.appendChild(link);
zÔnew Promise(function(resolve, reject) {
	var script = document.createElement("script");
	script.onload = resolve;
	script.onerror = reject;
	script.src = "%s";
	document.head.appendChild(script);
}).then(() => {
z
});c                   ó(   ‡ — e Zd ZdZˆ fd„Zd„ Zˆ xZS )r!   zŸGeoJSON expects JSON-able dict

    not an already-serialized JSON string.

    Scalar types (None, number, string) are not allowed, only dict containers.
    c                 óH   •—  t          t          | ¦  «        j        |i |¤Ž dS )aú  Create a GeoJSON display object given raw data.

        Parameters
        ----------
        data : dict or list
            VegaLite data. Not an already-serialized JSON string.
            Scalar types (None, number, string) are not allowed, only dict
            or list containers.
        url_template : string
            Leaflet TileLayer URL template: http://leafletjs.com/reference.html#url-template
        layer_options : dict
            Leaflet TileLayer options: http://leafletjs.com/reference.html#tilelayer-options
        url : unicode
            A URL to download the data from.
        filename : unicode
            Path to a local file to load the data from.
        metadata : dict
            Specify extra metadata to attach to the json display object.

        Examples
        --------
        The following will display an interactive map of Mars with a point of
        interest on frontend that do support GeoJSON display.

            >>> from IPython.display import GeoJSON

            >>> GeoJSON(data={
            ...     "type": "Feature",
            ...     "geometry": {
            ...         "type": "Point",
            ...         "coordinates": [-81.327, 296.038]
            ...     }
            ... },
            ... url_template="http://s3-eu-west-1.amazonaws.com/whereonmars.cartodb.net/{basemap_id}/{z}/{x}/{y}.png",
            ... layer_options={
            ...     "basemap_id": "celestia_mars-shaded-16k_global",
            ...     "attribution" : "Celestia/praesepe",
            ...     "minZoom" : 0,
            ...     "maxZoom" : 18,
            ... })
            <IPython.core.display.GeoJSON object>

        In the terminal IPython, you will only see the text representation of
        the GeoJSON object.

        N)rt   r!   rm   )rl   ÚargsrR   rr   s      €r9   rm   zGeoJSON.__init__�  s.   ø€ ð` 	&��g�tÑÔÔ% tÐ6¨vÐ6Ð6Ð6Ð6Ð6r;   c                 óZ   — | j         ddœ}d| j        i}t          j        ||d¬¦  «         d S )Nz <IPython.display.GeoJSON object>)úapplication/geo+jsonrO   r  T)rJ   rI   )ri   rJ   r   r'   )rl   ÚbundlerJ   s      r9   Ú_ipython_display_zGeoJSON._ipython_display_Ã  sF   € à$(¤IØ<ð
ð 
ˆð
 # D¤Mð
ˆõ 	Ô! &°8ÀÐFÑFÔFÐFÐFÐFr;   )r7   rs   r˜   r™   rm   r  rš   r›   s   @r9   r!   r!   ˆ  sY   ø€ € € € € ðð ð07ð 07ð 07ð 07ð 07ðfGð Gð Gð Gð Gð Gð Gr;   r!   c                   ó&   ‡ — e Zd Zdˆ fd„	Zd„ Zˆ xZS )r"   Nc                 ó¦  •— t          |t          ¦  «        r|g}n|€g }t          |t          ¦  «        r|g}n|€g }t          |t          t          f¦  «        st	          d|z  ¦  «        ‚t          |t          t          f¦  «        st	          d|z  ¦  «        ‚|| _        || _        t          t          | ¦  «         	                    |||¬¦  «         dS )a  Create a Javascript display object given raw data.

        When this object is returned by an expression or passed to the
        display function, it will result in the data being displayed
        in the frontend. If the data is a URL, the data will first be
        downloaded and then displayed.

        In the Notebook, the containing element will be available as `element`,
        and jQuery will be available.  Content appended to `element` will be
        visible in the output area.

        Parameters
        ----------
        data : unicode, str or bytes
            The Javascript source code or a URL to download it from.
        url : unicode
            A URL to download the data from.
        filename : unicode
            Path to a local file to load the data from.
        lib : list or str
            A sequence of Javascript library URLs to load asynchronously before
            running the source code. The full URLs of the libraries should
            be given. A single Javascript library URL can also be given as a
            string.
        css : list or str
            A sequence of css files to load before running the source code.
            The full URLs of the css files should be given. A single css URL
            can also be given as a string.
        Nzexpected sequence, got: %rrü   )
rd   re   rÿ   Útuplerž   ÚlibÚcssrt   r"   rm   )rl   ri   rg   rh   r  r  rr   s         €r9   rm   zJavascript.__init__Ï  sÞ   ø€ õ< �c�3ÑÔð 	Ø�%ˆCˆCØˆ[ØˆCÝ�c�3ÑÔð 	Ø�%ˆCˆCØˆ[ØˆCÝ˜#¥¥U˜|Ñ,Ô,ð 	@ÝÐ8¸3Ñ>Ñ?Ô?Ð?Ý˜#¥¥U˜|Ñ,Ô,ð 	@ÝÐ8¸3Ñ>Ñ?Ô?Ð?ØˆŒØˆŒÝ�j˜$ÑÔ×(Ò(¨d¸ÀhÐ(ÑOÔOÐOÐOÐOr;   c                 ó¸   — d}| j         D ]}|t          |z  z  }Œ| j        D ]}|t          |z  z  }Œ|| j        z  }|t
          t          | j        ¦  «        z  z  }|S )NÚ )r  Ú_css_tr  Ú_lib_t1ri   Ú_lib_t2rå   )rl   ra   ÚcÚls       r9   Ú_repr_javascript_zJavascript._repr_javascript_ý  so   € ØˆØ”ð 	ð 	ˆAØ•˜!‘‰OˆAˆAØ”ð 	ð 	ˆAØ•˜1‘ÑˆAˆAØ	ˆTŒY‰ˆØ	�W•S˜œ‘]”]Ñ"Ñ"ˆØˆr;   )NNNNN)r7   rs   r˜   rm   r  rš   r›   s   @r9   r"   r"   Í  sS   ø€ € € € € ð,Pð ,Pð ,Pð ,Pð ,Pð ,Pð\ð ð ð ð ð ð r;   r"   s   ‰PNG

s   ÿØc                 ór   — |                       d¦  «        }t          j        d| |dz   |dz   …         ¦  «        S )z*read the (width, height) from a PNG headers   IHDRz>iié   é   )ÚindexÚstructÚunpack)ri   Úihdrs     r9   Ú_pngxyr"    s6   € à�:Š:�gÑÔ€DåŒ=˜  T¨!¡V¨D°©G ^Ô 4Ñ5Ô5Ð5r;   c                 óæ   — d}	 t          j        d| ||dz   …         ¦  «        d         }||z   }| ||dz   …         dk    r|}n|dz  }ŒEt          j        d| |dz   |d	z   …         ¦  «        \  }}||fS )
z+read the (width, height) from a JPEG headerr  Tz>Hr.   r   s   ÿÀz>HHé   é	   ©r  r   )ri   ÚidxÚ
block_sizeÚiSOFÚhÚws         r9   Ú_jpegxyr,    sš   € ð €Cð	Ý”] 4¨¨c°#°a±%¨i¬Ñ9Ô9¸!Ô<ˆ
Ø�JÑˆØ��C˜‘E�	Œ?˜kÒ)Ð)àˆDØð �1‰HˆCð	õ Œ=˜  T¨!¡V¨D°©F ]Ô 3Ñ4Ô4�D€A€qØˆaˆ4€Kr;   c                 ó<   — t          j        d| dd…         ¦  «        S )z*read the (width, height) from a GIF headerz<HHé   r©   r&  )ri   s    r9   Ú_gifxyr/  $  s   € åŒ=˜  Q r T¤
Ñ+Ô+Ð+r;   c                   ó˜   ‡ — e Zd ZdZdZdZdZeeegZededediZ	 	 	 	 	 	 	 	 	 	 	 dˆ fd
„	Z	d„ Z
ˆ fd„Zd„ Zdd„Zdd„Zd„ Zd„ Zd„ Zˆ xZS )r#   rÃ   ÚjpegÚpngÚgifrY   r[   z	image/gifNFc                 ó¤  •— t          |t          t          f¦  «        rt          |¦  «        }|�|                      |¦  «        }nz|�|                      |¦  «        }nb|€t          d¦  «        ‚t          |t          ¦  «        r:|                     d¦  «        st          |¦  «        r|                      |¦  «        }nd}|€v|�E|dk    s|dk    r| j        }n`|dk    r| j	        }nR|dk    r| j
        }nD|                     ¦   «         }n/t          |t          ¦  «        r|dd…         t          k    r| j        }|€| j	        }|                     ¦   «         dk    r| j        }|                     ¦   «         | _        |�|n|du | _        | j        r%| j        | j        vrt          d	| j        z  ¦  «        ‚| j        r$| j                             | j        ¦  «        | _        || _        || _        || _        |	| _        || _        t3          t4          | ¦  «                             ||||
¬
¦  «         | j        €(| j                             di ¦  «        r|
d         | _        | j        €(| j                             di ¦  «        r|
d         | _        | j        €(| j                             di ¦  «        r|
d         | _        |r|                      ¦   «          dS dS )a+  Create a PNG/JPEG/GIF image object given raw data.

        When this object is returned by an input cell or passed to the
        display function, it will result in the image being displayed
        in the frontend.

        Parameters
        ----------
        data : unicode, str or bytes
            The raw image data or a URL or filename to load the data from.
            This always results in embedded image data.

        url : unicode
            A URL to download the data from. If you specify `url=`,
            the image data will not be embedded unless you also specify `embed=True`.

        filename : unicode
            Path to a local file to load the data from.
            Images from a file are always embedded.

        format : unicode
            The format of the image data (png/jpeg/jpg/gif). If a filename or URL is given
            for format will be inferred from the filename extension.

        embed : bool
            Should the image data be embedded using a data URI (True) or be
            loaded using an <img> tag. Set this to True if you want the image
            to be viewable later with no internet connection in the notebook.

            Default is `True`, unless the keyword argument `url` is set, then
            default value is `False`.

            Note that QtConsole is not able to display images if `embed` is set to `False`

        width : int
            Width in pixels to which to constrain the image in html

        height : int
            Height in pixels to which to constrain the image in html

        retina : bool
            Automatically set the width and height to half of the measured
            width and height.
            This only works for embedded images because it reads the width/height
            from image data.
            For non-embedded images, you can just set the desired display width
            and height directly.

        unconfined : bool
            Set unconfined=True to disable max-width confinement of the image.

        metadata : dict
            Specify extra metadata to attach to the image.

        alt : unicode
            Alternative text for the image, for use by screen readers.

        Examples
        --------
        embedded image data, works in qtconsole and notebook
        when passed positionally, the first arg can be any of raw image data,
        a URL, or a filename from which to load image data.
        The result is always embedding image data for inline images.

        >>> Image('https://www.google.fr/images/srpr/logo3w.png') # doctest: +SKIP
        <IPython.core.display.Image object>

        >>> Image('/path/to/image.jpg')
        <IPython.core.display.Image object>

        >>> Image(b'RAW_PNG_DATA...')
        <IPython.core.display.Image object>

        Specifying Image(url=...) does not embed the image data,
        it only generates ``<img>`` tag with a link to the source.
        This will not work in the qtconsole or offline.

        >>> Image(url='https://www.google.fr/images/srpr/logo3w.png')
        <IPython.core.display.Image object>

        Nz6No image data found. Expecting filename, url, or data.rc   Újpgr1  r2  r3  r.   z"Cannot embed the '%s' image formatr®   ÚwidthÚheightÚalt)rd   r   r   re   Ú	_find_extÚ
ValueErrorrf   rA   Ú	_FMT_JPEGÚ_FMT_PNGÚ_FMT_GIFrª   ÚbytesÚ_JPEGræ   ÚembedÚ_ACCEPTABLE_EMBEDDINGSÚ
_MIMETYPESÚgetÚ	_mimetyper6  r7  ÚretinaÚ
unconfinedr8  rt   r#   rm   rJ   Ú_retina_shape)rl   ri   rg   rh   ræ   r@  r6  r7  rE  rF  rJ   r8  Úextrr   s                €r9   rm   zImage.__init__6  sß  ø€ õ~ �d�T¥8Ð,Ñ-Ô-ð 	Ý�t‘9”9ˆDàÐØ—.’. Ñ*Ô*ˆCˆCØˆ_Ø—.’. Ñ%Ô%ˆCˆCØˆ\ÝÐUÑVÔVÐVÝ˜�cÑ"Ô"ð 	Ø�OŠO˜FÑ#Ô#ð	Ý'3°DÑ'9Ô'9ð	ð —.’. Ñ&Ô&ˆCˆCàˆCàˆ>ØˆØ˜&’=�= C¨7¢N NØ!œ^�F�FØ˜F’]�]Ø!œ]�F�FØ˜F’]�]Ø!œ]�F�Fà ŸYšY™[œ[�F�FÝ˜D¥%Ñ(Ô(ð ,ð ˜˜˜”8�uÒ$Ð$Ø!œ^�Fð ˆ>Ø”]ˆFà�<Š<‰>Œ>˜UÒ"Ð"à”^ˆFà—l’l‘n”nˆŒØ#Ð/�U�U°c¸T°kˆŒ
àŒ:ð 	S˜$œ+¨TÔ-HÐHÐHÝÐAÀTÄ[ÑQÑRÔRÐRØŒ:ð 	>Ø!œ_×0Ò0°´Ñ=Ô=ˆDŒNàˆŒ
ØˆŒØˆŒØ$ˆŒØˆŒÝ�e�TÑÔ×#Ò#¨°3ÀØ!ð 	$ñ 	#ô 	#ð 	#ð Œ:Ð $¤-×"3Ò"3°G¸RÑ"@Ô"@ÐØ! 'Ô*ˆDŒJàŒ;Ð 4¤=×#4Ò#4°X¸rÑ#BÔ#BÐØ" 8Ô,ˆDŒKàŒ8Ð ¤× 1Ò 1°%¸Ñ <Ô <ÐØ ”ˆDŒHàð 	!Ø×ÒÑ Ô Ð Ð Ð ð	!ð 	!r;   c                 ó4  — | j         sdS | j        | j        k    rt          | j        ¦  «        \  }}nR| j        | j        k    rt          | j        ¦  «        \  }}n*| j        | j        k    rt          | j        ¦  «        \  }}ndS |dz  | _	        |dz  | _
        dS )z3load pixel-doubled width and height from image dataNr.   )r@  ræ   r<  r"  ri   r;  r,  r=  r/  r6  r7  )rl   r+  r*  s      r9   rG  zImage._retina_shapeÚ  sž   € àŒzð 	ØˆFØŒ;˜$œ-Ò'Ð'Ý˜$œ)Ñ$Ô$‰DˆAˆqˆqØŒ[˜DœNÒ*Ð*Ý˜4œ9Ñ%Ô%‰DˆAˆqˆqØŒ[˜DœMÒ)Ð)Ý˜$œ)Ñ$Ô$‰DˆAˆqˆqð ˆFØ˜!‘VˆŒ
Ø˜1‘fˆŒˆˆr;   c                 ó¢   •— | j         rDt          t          | ¦  «                             ¦   «          | j        r|                      ¦   «          dS dS dS )r~   N)r@  rt   r#   rj   rE  rG  )rl   rr   s    €r9   rj   zImage.reloadê  s_   ø€ àŒ:ð 	%Ý•%˜ÑÔ×$Ò$Ñ&Ô&Ð&ØŒ{ð %Ø×"Ò"Ñ$Ô$Ð$Ð$Ð$ð	%ð 	%ð%ð %r;   c                 óþ   — | j         sudx}x}x}}| j        r
d| j        z  }| j        r
d| j        z  }| j        rd}| j        rdt          j        | j        ¦  «        z  }d                     | j        ||||¬¦  «        S d S )Nr  ú width="%d"ú height="%d"z class="unconfined"z	 alt="%s"z-<img src="{url}"{width}{height}{klass}{alt}/>)rg   r6  r7  Úklassr8  )	r@  r6  r7  rF  r8  ÚhtmlÚescaperæ   rg   )rl   r6  r7  rN  r8  s        r9   r²   zImage._repr_html_ñ  s´   € ØŒzð 	Ø+-Ð-ˆEÐ-�FÐ-˜U SØŒzð 3Ø%¨¬
Ñ2�ØŒ{ð 6Ø'¨$¬+Ñ5�ØŒð .Ø-�ØŒxð :Ø!¥D¤K°´Ñ$9Ô$9Ñ9�ØB×IÒIØ”HØØØØð Jñ ô ð ð	ð 	r;   c                 ó”   — | j         r,| j        }|                      d¬¦  «        \  }}|r||i}||i|fS d|                      ¦   «         iS )zgReturn the image as a mimebundle

        Any new mimetype support should be implemented here.
        T)Úalways_bothrU   )r@  rD  r|   r²   )rl   rK   ÚexcluderG   ri   rJ   s         r9   Ú_repr_mimebundle_zImage._repr_mimebundle_  sh   € ð
 Œ:ð 	5Ø”~ˆHØ!×4Ò4ÀÐ4ÑFÔF‰NˆD�(Øð 0Ø$ hÐ/�Ø˜dÐ# XÐ-Ð-à ×!1Ò!1Ñ!3Ô!3Ð4Ð4r;   c                 óŽ  — 	 t          | j        d¬¦  «                             d¦  «        }n*# t          $ r}t	          d| j        z  ¦  «        |‚d}~ww xY wi }| j        r|                     | j        ¦  «         | j        r
| j        |d<   | j        r
| j        |d<   | j	        r
| j	        |d<   | j
        r
| j
        |d	<   |s|r||fS |S )
r{   F©ÚnewlinerÚ   zNo such file or directory: '%s'Nr6  r7  rF  r8  )r   ri   r’   rž   ÚFileNotFoundErrorrJ   rï   r6  r7  rF  r8  )rl   rR  Úb64_dataÚeÚmds        r9   r|   zImage._data_and_metadata  s	  € ð	HÝ! $¤)°UÐ;Ñ;Ô;×BÒBÀ7ÑKÔKˆHˆHøÝð 	Hð 	Hð 	HÝ#Ø1°T´YÑ?ñAô AØFGðHøøøøð	Høøøð ˆØŒ=ð 	%Ø�IŠI�d”mÑ$Ô$Ð$ØŒ:ð 	%Øœ*ˆBˆw‰KØŒ;ð 	'Øœ;ˆBˆx‰LØŒ?ð 	/Ø#œˆBˆ|ÑØŒ8ð 	!ØœˆBˆu‰IØð 	�ð 	Ø˜R�<ÐàˆOs   ‚), ¬
A¶AÁAc                 ó`   — | j         r$| j        | j        k    r|                      ¦   «         S d S d S r¡   )r@  ræ   r<  r|   rx   s    r9   Ú
_repr_png_zImage._repr_png_)  s<   € ØŒ:ð 	-˜$œ+¨¬Ò6Ð6Ø×*Ò*Ñ,Ô,Ð,ð	-ð 	-Ð6Ð6r;   c                 ó`   — | j         r$| j        | j        k    r|                      ¦   «         S d S d S r¡   )r@  ræ   r;  r|   rx   s    r9   Ú_repr_jpeg_zImage._repr_jpeg_-  s<   € ØŒ:ð 	-˜$œ+¨¬Ò7Ð7Ø×*Ò*Ñ,Ô,Ð,ð	-ð 	-Ð7Ð7r;   c                 óf   — t          |¦  «        \  }}|s|S |dd …                              ¦   «         S )Nr   )r   rª   )rl   r½   ÚbaserH  s       r9   r9  zImage._find_ext1  s6   € Ý˜Q‘K”K‰	ˆˆcàð 	ØˆKð �1�2�2Œw�}Š}‰ŒÐr;   )NNNNNNNFFNN)NN)F)r7   rs   r˜   rŠ   r;  r<  r=  rA  rB  rm   rG  rj   r²   rT  r|   r]  r_  r9  rš   r›   s   @r9   r#   r#   )  s*  ø€ € € € € à€KØ€IØ€HØ€HØ'¨°8Ð<Ðà�+Ø�<Ø�+ð€Jð ØØØØØØØØØØða!ð a!ð a!ð a!ð a!ð a!ðHð ð ð %ð %ð %ð %ð %ðð ð ð&5ð 5ð 5ð 5ðð ð ð ð.-ð -ð -ð-ð -ð -ðð ð ð ð ð ð r;   r#   c                   ó0   ‡ — e Zd Z	 	 dˆ fd„	Zd„ Zd„ Zˆ xZS )r&   NFÚcontrolsc	                 óú  •— t          |t          t          f¦  «        rt          |¦  «        }|€/t          |t          ¦  «        r|                     d¦  «        r|}d}n%|�#t
          j                             |¦  «        r|}d}|r(|s&d                     g d¢¦  «        }	t          |	¦  «        ‚|| _
        || _        || _        || _        || _        t          t           | ¦  «                             |||¬¦  «         dS )aÿ  Create a video object given raw data or an URL.

        When this object is returned by an input cell or passed to the
        display function, it will result in the video being displayed
        in the frontend.

        Parameters
        ----------
        data : unicode, str or bytes
            The raw video data or a URL or filename to load the data from.
            Raw data will require passing ``embed=True``.

        url : unicode
            A URL for the video. If you specify ``url=``,
            the image data will not be embedded.

        filename : unicode
            Path to a local file containing the video.
            Will be interpreted as a local URL unless ``embed=True``.

        embed : bool
            Should the video be embedded using a data URI (True) or be
            loaded using a <video> tag (False).

            Since videos are large, embedding them should be avoided, if possible.
            You must confirm embedding as your intention by passing ``embed=True``.

            Local files can be displayed with URLs without embedding the content, via::

                Video('./video.mp4')

        mimetype : unicode
            Specify the mimetype for embedded videos.
            Default will be guessed from file extension, if available.

        width : int
            Width in pixels to which to constrain the video in HTML.
            If not supplied, defaults to the width of the video.

        height : int
            Height in pixels to which to constrain the video in html.
            If not supplied, defaults to the height of the video.

        html_attributes : str
            Attributes for the HTML ``<video>`` block.
            Default: ``"controls"`` to get video controls.
            Other examples: ``"controls muted"`` for muted video with controls,
            ``"loop autoplay"`` for looping autoplaying video without controls.

        Examples
        --------
        ::

            Video('https://archive.org/download/Sita_Sings_the_Blues/Sita_Sings_the_Blues_small.mp4')
            Video('path/to/video.mp4')
            Video('path/to/video.mp4', embed=True)
            Video('path/to/video.mp4', embed=True, html_attributes="controls muted autoplay")
            Video(b'raw-videodata', embed=True)
        N)zhttp:zhttps:r  )z*To embed videos, you must pass embed=True z)(this may make your notebook files huge)
z!Consider passing Video(url='...')rü   )rd   r   r   re   rf   r=   r>   r?   Újoinr:  rG   r@  r6  r7  Úhtml_attributesrt   r&   rm   )rl   ri   rg   rh   r@  rG   r6  r7  rf  Úmsgrr   s             €r9   rm   zVideo.__init__=  s	  ø€ õz �d�T¥8Ð,Ñ-Ô-ð 	Ý�t‘9”9ˆDàˆ;�: d­CÑ0Ô0ˆ;°T·_²_ÐEXÑ5YÔ5Yˆ;ØˆCØˆDˆDØÐ¥"¤'§.¢.°Ñ"6Ô"6ÐØˆHØˆDàð 	"˜ð 	"Ø—'’'ð ð ð ñ ô ˆCõ
 ˜S‘/”/Ð!à ˆŒØˆŒ
ØˆŒ
ØˆŒØ.ˆÔÝ�e�TÑÔ×#Ò#¨°3ÀÐ#ÑJÔJÐJÐJÐJr;   c                 óŠ  — dx}}| j         r
d| j         z  }| j        r
d| j        z  }| j        s4| j        �| j        n| j        }d                     || j        ||¦  «        }|S | j        }| j        �`|st          j	        | j        ¦  «        \  }}t          | j        d¦  «        5 }|                     ¦   «         }d d d ¦  «         n# 1 swxY w Y   n| j        }t          |t          ¦  «        r|}	n6t          |d¬¦  «                             d¦  «                             ¦   «         }	d	                     | j        ||||	¦  «        }|S )
Nr  rL  rM  zn<video src="{0}" {1} {2} {3}>
      Your browser does not support the <code>video</code> element.
    </video>rÃ   FrV  rÚ   zz<video {0} {1} {2}>
 <source src="data:{3};base64,{4}" type="{3}">
 Your browser does not support the video tag.
 </video>)r6  r7  r@  rg   rh   ræ   rf  rG   Ú	mimetypesÚ
guess_typer‹   rŒ   ri   rd   re   r   r’   Úrstrip)
rl   r6  r7  rg   ÚoutputrG   Ú_r“   ÚvideoÚ	b64_videos
             r9   r²   zVideo._repr_html_“  s›  € ØÐˆ�ØŒ:ð 	/Ø! D¤JÑ.ˆEØŒ;ð 	2Ø# d¤kÑ1ˆFð Œzð 	Ø"œhÐ2�$”(�(¸¼ˆCðç’�s˜DÔ0°%¸Ñ@Ô@ð ð ˆMð ”=ˆØŒ=Ð$Øð BÝ'Ô2°4´=ÑAÔA‘�˜!å�d”m TÑ*Ô*ð !¨aØŸš™œ�ð!ð !ð !ñ !ô !ð !ð !ð !ð !ð !ð !øøøð !ð !ð !ð !øð ”IˆEÝ�e�SÑ!Ô!ð 	RàˆIˆIå" 5°%Ð8Ñ8Ô8×?Ò?ÀÑHÔH×OÒOÑQÔQˆIð÷ ŠV�DÔ(¨%°¸À9ÑMÔMð 	ð ˆs   Â#CÃCÃCc                 ó   — d S r¡   rD   rx   s    r9   rj   zVideo.reload¹  ry   r;   )NNNFNNNrc  )r7   rs   r˜   rm   r²   rj   rš   r›   s   @r9   r&   r&   ;  so   ø€ € € € € àAFØISðTKð TKð TKð TKð TKð TKðl$ð $ð $ðLð ð ð ð ð ð r;   r&   c                  óZ   — t          j        dt          d¬¦  «         ddlm}  || i |¤Ž dS )aä  
    .. deprecated:: 7.23

       use `matplotlib_inline.backend_inline.set_matplotlib_formats()`

    Select figure formats for the inline backend. Optionally pass quality for JPEG.

    For example, this enables PNG and JPEG output with a JPEG quality of 90%::

        In [1]: set_matplotlib_formats('png', 'jpeg', quality=90)

    To set this in your config files use the following::

        c.InlineBackend.figure_formats = {'png', 'jpeg'}
        c.InlineBackend.print_figure_kwargs.update({'quality' : 90})

    Parameters
    ----------
    *formats : strs
        One or more figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'.
    **kwargs
        Keyword args will be relayed to ``figure.canvas.print_figure``.
    zƒ`set_matplotlib_formats` is deprecated since IPython 7.23, directly use `matplotlib_inline.backend_inline.set_matplotlib_formats()`r.   r/   r   )r$   N)r¯   r,   r2   Ú matplotlib_inline.backend_inliner$   )ÚformatsrR   Úset_matplotlib_formats_origs      r9   r$   r$   ¾  se   € õ2 „Mð	JåØð	ñ ô ð ðð ð ð ð ð ð  Ð Ð3¨FÐ3Ð3Ð3Ð3Ð3r;   Tc                 ó`   — t          j        dt          d¬¦  «         ddlm}  || ¦  «         dS )a  
    .. deprecated:: 7.23

        use `matplotlib_inline.backend_inline.set_matplotlib_close()`

    Set whether the inline backend closes all figures automatically or not.

    By default, the inline backend used in the IPython Notebook will close all
    matplotlib figures automatically after each cell is run. This means that
    plots in different cells won't interfere. Sometimes, you may want to make
    a plot in one cell and then refine it in later cells. This can be accomplished
    by::

        In [1]: set_matplotlib_close(False)

    To set this in your config files use the following::

        c.InlineBackend.close_figures = False

    Parameters
    ----------
    close : bool
        Should all matplotlib figures be automatically closed after each cell is
        run?
    z`set_matplotlib_close` is deprecated since IPython 7.23, directly use `matplotlib_inline.backend_inline.set_matplotlib_close()`r.   r/   r   )r%   N)r¯   r,   r2   rr  r%   )ÚcloseÚset_matplotlib_close_origs     r9   r%   r%   ä  s`   € õ6 „Mð	HåØð	ñ ô ð ðð ð ð ð ð ð Ð˜eÑ$Ô$Ð$Ð$Ð$r;   )FN)T)@r™   Úbinasciir   r   rO  r  ri  r=   r  r¯   Úcopyr   Úos.pathr   Úpathlibr   r   ÚIPython.utils.py3compatr	   ÚIPython.testing.skipdoctestr
   r  r   Ú__all__r1   r,   r:   rA   rM   r   r   r   r   r   r   r   r   r   r   Úobjectr   r   r   r   r   r   r   r   r   r    r  r  r  r!   r"   Ú_PNGr?  r"  r,  r/  r#   r&   r$   r%   rD   r;   r9   ú<module>r�     sÿ  ðà MÐ Mð )Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ø €€€Ø €€€Ø Ð Ð Ð Ø 	€	€	€	Ø €€€Ø €€€Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "Ð "Ð "à 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø Ð Ð Ð Ð Ð ðð ð €ð kÐjÐjÐ à
Ð%Ñ
%€ð
 Ð Ð Ð Ð Ð ðKð Kð Kðð ð ðUð Uð Uð Uð84ð 4ð 4ð"3ð 3ð 3ð(7ð 7ð 7ð$7ð 7ð 7ð"3ð 3ð 3ð"4ð 4ð 4ð"4ð 4ð 4ð":ð :ð :ð&@ð @ð @ð"9ð 9ð 9ð,r!ð r!ð r!ð r!ð r!�Fñ r!ô r!ð r!ðj^ð ^ð ^ð ^ð ^˜ñ ^ô ^ð ^ð$"ð "ð "ð "ð "Ðñ "ô "ð "ð"ð "ð "ð "ð "Ðñ "ô "ð "ð>)ð )ð )ð )ð )Ð ñ )ô )ð )ðð ð ð ð Ðñ ô ð ð)ð )ð )ð )ð )Ðñ )ô )ð )ð$)ð $)ð $)ð $)ð $)ˆ-ñ $)ô $)ð $)ðL8"ð 8"ð 8"ð 8"ð 8"�-ñ 8"ô 8"ð 8"ðt>)ð >)ð >)ð >)ð >)ˆ=ñ >)ô >)ð >)ðB
€ð€ð€ðCGð CGð CGð CGð CGˆdñ CGô CGð CGðJ8ð 8ð 8ð 8ð 8Ð"ñ 8ô 8ð 8ðv €Ø€ð6ð 6ð 6ðð ð ð&,ð ,ð ,ð
Oð Oð Oð Oð OˆMñ Oô Oð Oðd@ð @ð @ð @ð @ˆMñ @ô @ð @ðF ð#4ð #4ñ „ð#4ðJ ð%%ð %%ð %%ñ „ð%%ð %%ð %%r;   