HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_vendor/rich/__pycache__/jupyter.cpython-310.pyc
o

��h��@s�ddlmZmZmZmZmZmZerddlmZddl	m
Z
ddlmZddl
mZer2ddlmZdZGdd	�d	�ZGd
d�d�Zdeed
efdd�Zdeeded
dfdd�Zdeded
dfdd�ZdS)�)�
TYPE_CHECKING�Any�Dict�Iterable�List�Sequence)�ConsoleRenderable�)�get_console)�Segment)�DEFAULT_TERMINAL_THEMEz�<pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">{code}</pre>
c
@sPeZdZdZdededdfdd�Zdeed	eed
edeeeffdd�Z	dS)
�JupyterRenderablez)A shim to write html to Jupyter notebook.�html�text�returnNcCs||_||_dS)N)rr)�selfrr�r�C/usr/local/lib/python3.10/dist-packages/pip/_vendor/rich/jupyter.py�__init__s
zJupyterRenderable.__init__�include�exclude�kwargscsF|j|jd�}�r�fdd�|��D�}�r!�fdd�|��D�}|S)N�z
text/plainz	text/htmlc�i|]\}}|�vr||�qSrr��.0�k�v�rrr�
<dictcomp>�z7JupyterRenderable._repr_mimebundle_.<locals>.<dictcomp>c�i|]\}}|�vr||�qSrrr�rrrr r )rr�items)rrrr�datar�rrr�_repr_mimebundle_sz#JupyterRenderable._repr_mimebundle_)
�__name__�
__module__�__qualname__�__doc__�strrrrrr&rrrrr
s���
�r
c@sBeZdZdZdZdddeedeededeeeff
d	d
�Z	dS)�JupyterMixinz@Add to an Rich renderable to make it render in Jupyter notebook.rrrrrrrc	slt�}t|�||j��}t|�}|�|�}||d�}�r'�fdd�|��D�}�r4�fdd�|��D�}|S)Nrcrrrrrrrr5r z2JupyterMixin._repr_mimebundle_.<locals>.<dictcomp>cr!rrrr"rrr7r )r
�list�render�options�_render_segments�_render_bufferr#)	rrrr�console�segmentsrrr$rr%rr&)s

zJupyterMixin._repr_mimebundle_N)
r'r(r)r*�	__slots__rr+rrr&rrrrr,$s����
�r,r3rcCs�dtdtfdd�}g}|j}t}t�|�D]1\}}}|rq||�}|rB|�|�}|r3d|�d|�d�n|}|jrBd|j�d	|�d
�}||�qd�|�}	tj	|	d�}
|
S)
NrrcSs|�dd��dd��dd�S)zEscape html.�&z&amp;�<z&lt;�>z&gt;)�replace)rrrr�escape<sz _render_segments.<locals>.escapez
<span style="z">z</span>z	<a href="z" target="_blank">z</a>�)�code)
r+�appendrr�simplify�get_html_style�link�join�JUPYTER_HTML_FORMAT�format)r3r9�	fragments�append_fragment�themer�style�control�ruler;rrrrr0;s"


r0rNcCsBt|�}t||�}z
ddlm}||�WdSty YdSw)zRender segments to Jupyter.r)�displayN)r0r
�IPython.displayrI�ModuleNotFoundError)r3rr�jupyter_renderable�ipython_displayrrrrITs
�rI�argsrcOst�}|j|i|��S)zProxy for Console print.)r
�print)rNrr2rrrrObsrO)�typingrrrrrr�pip._vendor.rich.consolerr:r
�segmentr�terminal_themerrAr
r,r+r0rIrOrrrr�<module>s