a
    a                     @   sP   d dl mZmZmZ eeeef dddZdeee  eeeeddd	Zd
S )    )ListOptionalTuple)linereturnc                 C   s:   |  d}|dkr2| d| | |d d  fS | dfS )zkParses import lines for comments and returns back the
    import statement and the associated comment.
    #N    )findstrip)r   Zcomment_start r   -lib/python3.9/site-packages/isort/comments.pyparse   s    
 r   r
   F)commentsoriginal_stringremovedcomment_prefixr   c                 C   sX   |rt |d S | s|S g }| D ]}||vr || q t |d  | dd| S )z;Returns a string with comments added if removed is not set.r    z; )r   appendjoin)r   r   r   r   Zunique_commentsZcommentr   r   r   add_to_line   s    r   N)r
   Fr
   )typingr   r   r   strr   boolr   r   r   r   r   <module>   s      
