Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/matplotlib_inline/__pycache__/backend_inline.cpython-39.pyc
Ðазад
a j�hZ, � @ s d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZ dd l mZ dd lmZ ddlmZ dd lmZ e d�dd�Zdd� Zd'dd�Zde_g e_dd� ZeZdd� Zdd� Ze� dd� Zdd� Zd d!� Z d"d#� Z!d(d%d&�Z"dS ))z<A matplotlib backend for publishing figures via display_data� N)�colors)�backend_agg)�FigureCanvasAgg)�Gcf)�Figure)�InteractiveShell)�get_ipython)�select_figure_formats)�display� )� InlineBackend)�FigureClassc O s t | ||i |���S )z� Return a new figure manager for a new figure instance. This function is part of the API expected by Matplotlib backends. )�new_figure_manager_given_figure)�numr �args�kwargs� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/matplotlib_inline/backend_inline.py�new_figure_manager s r c sj t �| � �}t� d�s$� fdd�� _t�� s0|S ztj�� � W n tyR Y n0 tj� � � dt_ |S )z� Return a new figure manager for a given figure instance. This function is part of the API expected by Matplotlib backends. �showc s t � t� �d�S )N��metadata)r �_fetch_figure_metadata)�a��figurer r �<lambda>0 s �z1new_figure_manager_given_figure.<locals>.<lambda>T)r r �hasattrr � matplotlib�is_interactive�_to_draw�remove� ValueError�append�_draw_called)r r �managerr r r r s r c C s� | du rt �� j} zHt�� D ]}t|jjt|jj�d� qW g t _ | r|t�� r|tj� d� n g t _ | rzt�� rztj� d� 0 dS )a Show all figures as SVG/PNG payloads sent to the IPython clients. Parameters ---------- close : bool, optional If true, a ``plt.close('all')`` call is automatically issued after sending all the figures. If this is set, the figures will entirely removed from the internal list of figures. block : Not used. The `block` parameter is a Matplotlib experimental parameter. We accept it in the function signature for compatibility with other backends. Nr �all)r �instance� close_figuresr �get_all_fig_managersr �canvasr r r r r Zpyplot�close)r+ �blockZfigure_managerr r r r H s � �r Fc sV t js dS �z6t�� jr�zt d�W W g t _dt _S ty� } zDt� }|du rT| �n$|�� W Y d} ~ W g t _dt _dS W Y d} ~ n d} ~ 0 0 t dd� t �� D ��� � fdd�t jD �D ]z}zt|t |�d� W q� t�y0 } zFt� }|du r�| �n&|�� W Y d} ~ W g t _dt _dS W Y d} ~ q�d} ~ 0 0 q�W g t _dt _ng t _dt _0 dS )a� Send all figures that changed This is meant to be called automatically and will call show() if, during prior code execution, there had been any calls to draw_if_interactive. This function is meant to be used as a post_execute callback in IPython, so user-caused errors are handled with showtraceback() instead of being allowed to raise. If this function is not called from within IPython, then these exceptions will raise. NTFc S s g | ]}|j j�qS r )r* r )�.0�fmr r r � <listcomp>� � z!flush_figures.<locals>.<listcomp>c s g | ]}|� v r|�qS r r )r- �fig�Zactiver r r/ � r0 r )r r$ r r'