OwlCyberSecurity - MANAGER
Edit File: _pylab_helpers.cpython-38.pyc
U ��] � @ s4 d Z ddlZddlZG dd� de�Ze�ej� dS )z& Manage figures for pyplot interface. � Nc @ s� e Zd ZdZg Zi Zedd� �Zedd� �Zedd� �Z edd � �Z ed d� �Zedd � �Zedd� �Z edd� �Zedd� �Zeddd��ZdS )�Gcfa� Singleton to manage a set of integer-numbered figures. This class is never instantiated; it consists of two class attributes (a list and a dictionary), and a set of static methods that operate on those attributes, accessing them directly as class attributes. Attributes: *figs*: dictionary of the form {*num*: *manager*, ...} *_activeQue*: list of *managers*, with active one at the end c C s$ | j �|d�}|dk r | �|� |S )z� If figure manager *num* exists, make it the active figure and return the manager; otherwise return *None*. N)�figs�get� set_active��cls�num�manager� r �;/usr/lib/python3/dist-packages/matplotlib/_pylab_helpers.py�get_fig_manager s zGcf.get_fig_managerc C sP | � |�sdS | j| }|j�|j� | j�|� | j|= |�� t� d� dS )z� Try to remove all traces of figure *num*. In the interactive backends, this is bound to the window "destroy" and "delete" events. N� ) � has_fignumr �canvas�mpl_disconnect�_cidgcf� _activeQue�remove�destroy�gc�collectr r r r r ) s zGcf.destroyc s4 t � fdd�| j�� D �d�}|dk r0| �|� dS )z*fig* is a Figure instancec 3 s | ]}|j j� kr|jV qd S )N)r �figurer )�.0r ��figr r � <genexpr>= s �z"Gcf.destroy_fig.<locals>.<genexpr>N)�nextr �valuesr )r r r r r r �destroy_fig: s �zGcf.destroy_figc C sP dd l }t| j�� �D ]}|j�|j� |�� qg | _| j� � |� d� d S )Nr r )r �listr r r r r r r �clearr )r r r r r r �destroy_allB s zGcf.destroy_allc C s || j kS )z7 Return *True* if figure *num* exists. )r )r r r r r r O s zGcf.has_fignumc C s t | j�� �S )z3 Return a list of figure managers. )r r r �r r r r �get_all_fig_managersV s zGcf.get_all_fig_managersc C s t | j�S )z= Return the number of figures being managed. )�lenr r"