o
    ooi	                     @   sh   d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ dgZG d	d dej	ej
ejZdS )
:Pipe source through the Graphviz *unflatten* preprocessor.    N   )_tools)base)backend)encoding	Unflattenc                
   @   sL   e Zd ZdZejddd			ddeje de	d	eje d
dfddZ
dS )r   r   r   self)supported_number
ignore_argNFstaggerfanoutchainreturnzgraphviz.Sourcec                 C   sr   ddl m} | j| j|||| jd}|  }|j||d|d|d|d|d|d	|d
dd	S )a  Return a new :class:`.Source` instance with the source
            piped through the Graphviz *unflatten* preprocessor.

        Args:
            stagger: Stagger the minimum length
                of leaf edges between 1 and this small integer.
            fanout: Fanout nodes with indegree = outdegree = 1
                when staggering (requires ``stagger``).
            chain: Form disconnected nodes into chains
                of up to this many nodes.

        Returns:
            Prepocessed DOT source code (improved layout aspect ratio).

        Raises:
            graphviz.RequiredArgumentError: If ``fanout`` is given
                but ``stagger`` is None.
            graphviz.ExecutableNotFound: If the Graphviz ``unflatten`` executable
                is not found.
            graphviz.CalledProcessError: If the returncode (exit status)
                of the unflattening 'unflatten' subprocess is non-zero.

        See also:
            Upstream documentation:
            https://www.graphviz.org/pdf/unflatten.1.pdf
        r   )sources)r   r   r   r   filename	directoryformatenginer   renderer	formatterN)r   r   r   r   r   r   r   loaded_from_path) r   
_unflattensourcer   _copy_kwargsSourceget)r	   r   r   r   r   outkwargs r    I/home/ubuntu/.local/lib/python3.10/site-packages/graphviz/unflattening.py	unflatten   s    zUnflatten.unflatten)NFN)__name__
__module____qualname____doc__r   deprecate_positional_argstypingOptionalintboolr"   r    r    r    r!   r      s    )r&   r(   graphvizr   r   r   r   r   __all__EncodingBaser   r    r    r    r!   <module>   s    