
    Mh                     X    d Z ddlZddlmZ  ej        d          Z G d d          ZdS )z)Support for interactive macros in IPython    N)DEFAULT_ENCODINGz#\s*coding[:=]\s*([-\w.]+)c                   0    e Zd ZdZd Zd Zd Zd Zd ZdS )MacrozSimple class to store the value of macros as strings.

    Macro is just a callable that executes a string of IPython
    input when called.
    c                 j   g }d}|                                 D ]I}t                              |          }|r|                    d          }4|                    |           Jd                    |          }t          |t                    r|                    |pt                    }|dz   | _
        dS )z?store the macro value, as a single string which can be executedN   
)
splitlinescoding_declarationmatchgroupappendjoin
isinstancebytesdecoder   value)selfcodelinesenclinecoding_matchs         R/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/IPython/core/macro.py__init__zMacro.__init__   s    OO%% 	# 	#D-33D99L #"((++T""""yydE"" 	8;;s6&677DD[


    c                     | j         S Nr   r   s    r   __str__zMacro.__str__&   s
    zr   c                 0    dt          | j                  z  S )NzIPython.macro.Macro(%s))reprr   r   s    r   __repr__zMacro.__repr__)   s    (4
+;+;;;r   c                     d| j         iS )z% needed for safe pickling via %store r   r   r   s    r   __getstate__zMacro.__getstate__,   s    $$r   c                     t          |t                    rt          | j        |j        z             S t          |t                    rt          | j        |z             S t          r   )r   r   r   str	TypeError)r   others     r   __add__zMacro.__add__0   sW    eU## 	-ek1222s## 	-e+,,,r   N)	__name__
__module____qualname____doc__r   r    r#   r%   r*    r   r   r   r      si         ! ! !  < < <% % %    r   r   )r.   reIPython.utils.encodingr   compiler
   r   r/   r   r   <module>r3      sm    / / 
			 3 3 3 3 3 3RZ =>> % % % % % % % % % %r   