o
    b                     @   s   d dl Z d dlmZ d dlmZ d dlmZ d dlZd ZZ	zd dl
mZ	 d dlmZ W n	 ey5   Y nw edddgZdd	efd
dZdded	efddZdedee fddZdS )    N)
namedtuple)partial)OptionalFunctionTypeargtypesreturnsFparse_python_twoc                 C   s   | rt }nt}|p
tS )N)_ast_py2_ast_py3ast)r   Zparser_module r   K/var/www/secure340b-portal/env/lib/python3.10/site-packages/astroid/_ast.py_get_parser_module   s   r   stringc                 C   s0   t |d}|j}tr|st|tjjd}|| S )N)r   )feature_version)r   parser
   r   sysversion_infominor)r   r   Zparse_moduleZ
parse_funcr   r   r   _parse   s
   
r   type_commentreturnc                 C   s*   t du rdS t | dd}t|j|jdS )z:Given a correct type comment, obtain a FunctionType objectNz<type_comment>	func_type)r   r   )r
   r   r   r   r   )r   r   r   r   r   parse_function_type_comment"   s   r   )F)r   collectionsr   	functoolsr   typingr   r   r	   r
   Ztyped_ast.ast3Zast3Ztyped_ast.ast27Zast27ImportErrorr   boolr   strr   r   r   r   r   r   <module>   s     