o
    DDi                     @   sr   d dl Z d dlmZ d dlmZmZ d dlZd dlmZm	Z	 G dd de	eZ
G dd de
ZG d	d
 d
e
ZdS )    N)ABC)PatternUnion)CodemodContextVisitorBasedCodemodCommandc                       sV   e Zd ZU eed< deddf fddZdejdejde	ejej
f fd	d
Z  ZS )RemovePyreDirectiveCommandPYRE_TAGcontextreturnNc                    s&   t  | td| j d| _d S )Nz
^#\s+pyre-z\s*$)super__init__recompiler   _regex_pattern)selfr	   	__class__ f/var/www/Datamplify/venv/lib/python3.10/site-packages/libcst/codemod/commands/remove_pyre_directive.pyr      s   
z#RemovePyreDirectiveCommand.__init__original_nodeupdated_nodec                 C   s4   |j d u st| jt|j tjjs|S t S )N)	commentboolr   searchlibcstensure_typeCommentvalueRemoveFromParent)r   r   r   r   r   r   leave_EmptyLine   s   z*RemovePyreDirectiveCommand.leave_EmptyLine)__name__
__module____qualname__str__annotations__r   r   r   	EmptyLiner   RemovalSentinelr   __classcell__r   r   r   r   r      s   
 r   c                   @   *   e Zd ZU dZdZeed< dZeed< dS )RemovePyreStrictCommandzc
    Given a source file, we'll remove the any strict tag if the file already
    contains it.
    z,Removes the 'pyre-strict' tag from a module.DESCRIPTIONstrictr   Nr    r!   r"   __doc__r*   r#   r$   r   r   r   r   r   r)   %      
 r)   c                   @   r(   )RemovePyreUnsafeCommandzc
    Given a source file, we'll remove the any unsafe tag if the file already
    contains it.
    z,Removes the 'pyre-unsafe' tag from a module.r*   unsafer   Nr,   r   r   r   r   r/   0   r.   r/   )r   abcr   typingr   r   r   libcst.codemodr   r   r   r)   r/   r   r   r   r   <module>   s   