403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/matplotlib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/matplotlib/__pycache__/blocking_input.cpython-312.pyc
�

G8�c�+����dZddlZddlmZddlmZddlmZddlm	Z
ejded��eje�ZGd	�d
�ZGd�de�ZGd
�de�ZGd�de�Zy)a�
Classes used for blocking interaction with figure windows:

`BlockingInput`
    Creates a callable object to retrieve events in a blocking way for
    interactive sessions.  Base class of the other classes listed here.

`BlockingKeyMouseInput`
    Creates a callable object to retrieve key or mouse clicks in a blocking
    way for interactive sessions.  Used by `~.Figure.waitforbuttonpress`.

`BlockingMouseInput`
    Creates a callable object to retrieve mouse clicks in a blocking way for
    interactive sessions.  Used by `~.Figure.ginput`.

`BlockingContourLabeler`
    Creates a callable object to retrieve mouse clicks in a blocking way that
    will then be used to place labels on a `.ContourSet`.  Used by
    `~.Axes.clabel`.
�N)�Integral)�_api)�MouseButtonz3.5�module)�name�obj_typec�D�eZdZdZd
d�Zd�Zd�Zd�Zd�Zdd�Z	e	Z
dd�Zy	)
�
BlockingInputz1Callable for retrieving events in a blocking way.c� �||_||_y�N��fig�
eventslist)�selfrrs   �;/usr/lib/python3/dist-packages/matplotlib/blocking_input.py�__init__zBlockingInput.__init__$s�����$���c�8�|j|�tjdt|j��|j�t|j�|jcxk\rdkDr(ny|jjj�yy)zY
        Event handler; will be passed to the current figure to retrieve events.
        zEvent %irN)
�	add_event�_log�info�len�events�
post_event�nr�canvas�stop_event_loop�r�events  r�on_eventzBlockingInput.on_event(sh��	
���u���	�	�*�c�$�+�+�.�/�	
�����t�{�{��t�v�v�)��)��H�H�O�O�+�+�-�*rc��y)z-For baseclass, do nothing but collect events.N��rs rrzBlockingInput.post_event8s�rc�~�|jD]'}|jjj|��)g|_y)zDisconnect all callbacks.N)�	callbacksrr�mpl_disconnect)r�cbs  r�cleanupzBlockingInput.cleanup;s2���.�.�	/�B��H�H�O�O�*�*�2�.�	/���rc�:�|jj|�y)z5For base class, this just appends an event to events.N)r�appendrs  rrzBlockingInput.add_eventAs�������5�!rc�:�|jj|�y)z�
        Remove an event from the event list -- by default, the last.

        Note that this does not check that there are events, much like the
        normal pop method.  If no events exist, this will throw an exception.
        N)r�pop)r�indexs  r�	pop_eventzBlockingInput.pop_eventEs��	
������rc��tjt|��||_g|_|j
jjr|j
j�|jD�cgc]2}|j
jj||j���4c}|_	|j
jj|��|j�|jScc}w#|j�wxYw)z%Blocking call to retrieve *n* events.)r)�timeout)r�check_isinstancerrrrr�manager�showr�mpl_connectr r%�start_event_loopr()rrr0rs    r�__call__zBlockingInput.__call__Ps������h�!�,��������8�8�?�?�"�"��H�H�M�M�O�'+�o�o�7�"��(�(�/�/�5�5�d�D�M�M�J�7���	��H�H�O�O�,�,�W�,�=�
�L�L�N��{�{���7��
�L�L�N�s�27C4�2&C9�9DN)r"����)��)�__name__�
__module__�__qualname__�__doc__rr rr(rr.r,r6r"rrr
r
!s/��;�%�.� <��"���C�rr
c���eZdZdZej
ZejZejZ
ej
ejejf�fd�	Zd�Zd�Z
d�Zd�Zd�Zd�Zd	�Zdd
�Zd�fd�	Zd�fd�	Zd�fd
�	Z�xZS)�BlockingMouseInputa
    Callable for retrieving mouse clicks in a blocking way.

    This class will also retrieve keypresses and map them to mouse clicks:
    delete and backspace are a right click, enter is like a middle click,
    and all others are like a left click.
    c�R��t�|�|d��||_||_||_y�N)�button_press_event�key_press_eventr
)�superr�
button_add�
button_pop�button_stop)rr�	mouse_add�	mouse_pop�
mouse_stop�	__class__s     �rrzBlockingMouseInput.__init__ss3���	���S�$M�	�	O�#���#���%��rc���t|j�dk(rtjd�y|jdjdk(r|j�y|j
�y)zProcess an event.rz
No events yetr8rDN)rrr�warningr�	key_event�mouse_eventr#s rrzBlockingMouseInput.post_event}sL���t�{�{��q� ��L�L��)�
�[�[��_�
!�
!�%6�
6��N�N�����rc��|jd}|j}||jk(r|j|�y||jk(r|j|�y||jk(r|j|�yy)zProcess a mouse click event.r8N)r�buttonrG�mouse_event_poprH�mouse_event_stoprF�mouse_event_add)rrrRs   rrPzBlockingMouseInput.mouse_event�sm�����B��������T�_�_�$�� � ��'�
�t�'�'�
'��!�!�%�(�
�t���
&�� � ��'�'rc���|jd}|j�y|jdvr|j|�y|jdvr|j|�y|j	|�y)zV
        Process a key press event, mapping keys to appropriate mouse clicks.
        r8N)�	backspace�delete)�escape�enter)r�keyrSrTrUrs  rrOzBlockingMouseInput.key_event�sb�����B����9�9����9�9�/�/�� � ��'�
�Y�Y�-�
-��!�!�%�(�� � ��'rc�j�|jr|j|�ytj|�y)z�
        Process an button-1 event (add a click if inside axes).

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        N)�inaxes�	add_clickr
r,rs  rrUz"BlockingMouseInput.mouse_event_add�s%���<�<��N�N�5�!����d�#rc�v�tj|�|jjj	�y)z�
        Process an button-2 event (end blocking input).

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        N)r
r,rrrrs  rrTz#BlockingMouseInput.mouse_event_stop�s(��	���$��	
�����'�'�)rc�j�tj|�|jr|j|�yy)z�
        Process an button-3 event (remove the last click).

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        N)r
r,rrs  rrSz"BlockingMouseInput.mouse_event_pop�s)��	���$���;�;��H�H�U�O�rc��|jj|j|jf�tjdt
|j�|j|j�|jr�tj|jg|jgdd��}|jj|�|jj|�|jjj�yy)z�
        Add the coordinates of an event to the list of clicks.

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        zinput %i: %f, %f�+�r)�marker�colorN)�clicksr*�xdata�ydatarrr�show_clicks�mlines�Line2Dr]�add_line�marksrr�draw)rr�lines   rr^zBlockingMouseInput.add_click�s���	
�����E�K�K����5�6��	�	�$��d�k�k�"�E�K�K����	>�����=�=�%�+�+�����
�(+�3�8�D��L�L�!�!�$�'��J�J���d�#��H�H�O�O� � �"�rc���|jj|�|jrN|jj|�j	�|j
jj�yy)z�
        Remove a click (by default, the last) from the list of clicks.

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        N)rfr,rirm�removerrrn�rrr-s   r�	pop_clickzBlockingMouseInput.pop_click�sO��	
�����������J�J�N�N�5�!�(�(�*��H�H�O�O� � �"�rc�H��|j||�t�|�	|�y)zw
        Remove a click and the associated event from the list of clicks.

        Defaults to the last click.
        N)rsrEr,)rrr-rLs   �rr,zBlockingMouseInput.pop�s���	
���u�e�$�
���E�rc����|jrL|jD]}|j��g|_|jjj�t�|��y)z{
        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`, optional
            Not used
        N)rirmrqrrrnrEr()rr�markrLs   �rr(zBlockingMouseInput.cleanup�sO�������
�
�
�����
�
��D�J��H�H�O�O� � �"�
���rc�h��||_g|_g|_t�|�||��|jS)zV
        Blocking call to retrieve *n* coordinate pairs through mouse clicks.
        �rr0)rirfrmrEr6)rrr0rirLs    �rr6zBlockingMouseInput.__call__s7���'��������
�
���1�g��.��{�{�rr7r)r9r:T)r;r<r=r>r�LEFTrF�RIGHTrG�MIDDLErHrrrPrOrUrTrSr^rsr,r(r6�
__classcell__�rLs@rr@r@fs������!�!�J��"�"�J��$�$�K�'�+�+�&�,�,�'�.�.�&��	(�
(�$�
*��#�&#��� �rr@c�H��eZdZdZ�fd�Zd�Zdd�Zd�Zd�Zd	�fd�	Z	�xZ
S)
�BlockingContourLabelerzt
    Callable for retrieving mouse clicks and key presses in a blocking way.

    Used to place contour labels.
    c�\��||_t�|�	|jj��y)N)r)�csrEr�axes�figure)rr�rLs  �rrzBlockingContourLabeler.__init__s"������
���R�W�W�^�^��,rc�&�|j|�yr)�button1rs  rr^z BlockingContourLabeler.add_click������U�rc�&�|j|�yr)�button3rrs   rrsz BlockingContourLabeler.pop_clickr�rc�N�|j|jjk(rm|jj|j|j
|j|jd��|jjj�ytj|�y)z�
        Process an button-1 event (add a label to a contour).

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        F)�inline_spacing�	transformN)
r]r��ax�add_label_near�x�y�inliner�rrrnr
r,rs  rr�zBlockingContourLabeler.button1sq���<�<�4�7�7�:�:�%��G�G�"�"�5�7�7�E�G�G�T�[�[�26�2E�2E�-2�
#�
4�
�H�H�O�O� � �"����d�#rc���|jry|jj�|jjjj
j
�y)a�
        Process an button-3 event (remove a label if not in inline mode).

        Unfortunately, if one is doing inline labels, then there is currently
        no way to fix the broken contour - once humpty-dumpty is broken, he
        can't be put back together.  In inline mode, this does nothing.

        Parameters
        ----------
        event : `~.backend_bases.MouseEvent`
        N)r�r��	pop_labelr�r�rrnrs  rr�zBlockingContourLabeler.button30s>���;�;���G�G�����G�G�J�J���$�$�)�)�+rc�F��||_||_t�|�
||d��y)NF)rr0ri)r�r�rEr6)rr�r�rr0rLs     �rr6zBlockingContourLabeler.__call__Bs&������,���
���1�g�5��Arr7)�r8r8)r;r<r=r>rr^rsr�r�r6r|r}s@rrrs-����-���$�",�$B�Brrc�4��eZdZdZ�fd�Zd�Zd�fd�	Z�xZS)�BlockingKeyMouseInputzQ
    Callable for retrieving mouse clicks and key presses in a blocking way.
    c�(��t�|�|d��yrB)rEr)rrrLs  �rrzBlockingKeyMouseInput.__init__Ms���
���S�$M�	�	Orc��|jr"|jdjdk(|_ytj	d�y)zDetermine if it is a key event.r8rDzNo events yet.N)rr�
keyormouserrNr#s rrz BlockingKeyMouseInput.post_eventQs1���;�;�"�k�k�"�o�2�2�6G�G�D�O��L�L�)�*rc�L��d|_t�|�	d|��|jS)z�
        Blocking call to retrieve a single mouse click or key press.

        Returns ``True`` if key press, ``False`` if mouse click, or ``None`` if
        timed out.
        Nr9rx)r�rEr6)rr0rLs  �rr6zBlockingKeyMouseInput.__call__Xs(������
���1�g��.����r)r:)r;r<r=r>rrr6r|r}s@rr�r�Hs����O�+�
�
rr�)r>�logging�numbersr�
matplotlibr�matplotlib.backend_basesr�matplotlib.lines�linesrj�warn_deprecatedr;�	getLoggerrr
r@rr�r"rr�<module>r�sy���*���0�!�����U��H�=��w����"��B�B�Je��e�P7B�/�7B�t�M�r

Youez - 2016 - github.com/yon3zu
LinuXploit