o
    DDi                     @  s   U d dl mZ d dlZd dlmZ d dlmZ d dlmZ dZ	dZ
i dd	d
e	de	de	de	de	de	de	de	de	de	de	de	de	de	de	de	e	e	e	e	e	e	e
e
e
e
e
e
dZded< 	 d/d!d"Zd0d)d*Zd+d+d+d,d1d-d.ZdS )2    )annotationsN)Sequence)CSTNode)filter_node_fieldsz&, color="#777777", fillcolor="#eeeeee"z&, color="#3e99ed", fillcolor="#b8d9f8"__default__ 	EmptyLineIndentedBlockSimpleStatementLineSimpleWhitespaceTrailingWhitespaceNewlineComma	LeftParen
RightParenLeftSquareBracketRightSquareBracketLeftCurlyBraceRightCurlyBraceBaseSmallStatementBaseCompoundStatementSimpleStatementSuite)ColonDot	SemicolonParenthesizedWhitespaceBaseParenthesizableWhitespaceCommentNameIntegerFloat	ImaginarySimpleStringFormattedStringTextzdict[str, str]
node_stylenoder   returnstrc                 C  s   | j j}|tv rt| }ntd }t| dr4t| jtr4d}d}d}| d| j|| d}|d }nd	}t|  d
| | d| dS )z2Creates the graphviz representation of a CST node.r   valuez\n"z\"<>z, shape="box"r   	 [label="])		__class____qualname__r$   hasattr
isinstancer(   r'   replaceid)r%   	node_namestyle
line_breakquoteescaped_quoter(    r9   P/var/www/Datamplify/venv/lib/python3.10/site-packages/libcst/display/graphviz.py_create_node_graphviz4   s   

r;   objectshow_defaultsboolshow_syntaxshow_whitespace	list[str]c          
      C  s   t | tsg S t| |||d}t| g}|D ]`}t| |j}t |trB|t|  dt| d|j d |t	||||d qt |t
rvt|D ]*\}}	t |	tru|t|  dt|	 d|j d| d |t	|	|||d qKq|S )zNCreates the graphviz representation of a CST node,
    and of its child nodes.r=   r?   r@   z -> r,   z"][z]"])r1   r   r   r;   getattrnameappendr3   extend_node_repr_recursiver   	enumerate)
r%   r=   r?   r@   fieldsgraphviz_linesfieldr(   indexchildr9   r9   r:   rH   J   sL   
	

&

$	rH   FrB   c             	   C  s6   t ddd }dd|gt| |||d dg S )a  
    Returns a string representation (in graphviz .dot style) of a CST node,
    and its child nodes.

    Setting ``show_defaults`` to ``True`` will add fields regardless if their
    value is different from the default value.

    Setting ``show_whitespace`` will add whitespace fields and setting
    ``show_syntax`` will add syntax fields while respecting the value of
    ``show_defaults``.
    aO  
        layout=dot;
        rankdir=TB;
        splines=line;
        ranksep=0.5;
        nodesep=1.0;
        dpi=300;
        bgcolor=transparent;
        node [
            style=filled,
            color="#fb8d3f",
            fontcolor="#4b4f54",
            fillcolor="#fdd2b3",
            fontname="Source Code Pro Semibold",
            penwidth="2",
            group=main,
        ];
        edge [
            color="#999999",
            fontcolor="#4b4f54",
            fontname="Source Code Pro Semibold",
            fontsize=12,
            penwidth=2,
        ];
           N
z	digraph {rB   })textwrapdedentjoinrH   )r%   r=   r?   r@   graphviz_settingsr9   r9   r:   dump_graphviz   s"   rV   )r%   r   r&   r'   )
r%   r<   r=   r>   r?   r>   r@   r>   r&   rA   )
r%   r<   r=   r>   r?   r>   r@   r>   r&   r'   )
__future__r   rR   collections.abcr   libcstr   libcst.helpersr   _syntax_style_value_styler$   __annotations__r;   rH   rV   r9   r9   r9   r:   <module>   s|   	


: