
    hif              
         U d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl	m
Z
 d dlmZ ej        dk    rd dlZnd dlZd dlmZmZmZ d dlmZmZmZmZmZ d dlmZmZ d d	lmZ d d
lm Z m!Z! ee"e#e$e%e&e"e"f         e'e"         e(e$e$f         f         Z)de*d<   eege)f         Z+de*d<    G d dej,                  Z-ddZ.dddZ/ddZ0ddZ1dd Z2dd"Z3dd%Z4dd&Z5dd(Z6dd)Z7dd+Z8i d,e.d-e"d.e2d/d0 d1e5d2e2d3e2d4e7d5e6d6e#d7d8 d9d: d;d< d=d> d?d@ dAdB dCdD dE e2e2e#dF e/e/dGZ9dHe*dI<   e9:                                Z;dHe*dJ<   e;<                    i d,e.d/dK d1dL d4dM d5dN d7e/d9e/d;e/d=dO d?e/dAdP dCdQ dRe/dSe3dTe/dUe/           	 dddZZ=	 ddd[Z>	 	 ddddZ?ddgZ@ddiZAddlZBejC        fddtZDddvZEddyZFdd|ZGddZHddZI G d deJ          ZKdS )    )annotationsN)StringIO)error_codes)      )MappingMutableMappingSequence)AnyCallableFinalTextIOUnion)Never	TypeAlias)defaults)PER_MODULE_OPTIONSOptionsr   _CONFIG_VALUE_TYPES_INI_PARSER_CALLABLEc                  $     e Zd ZdZd	 fdZ xZS )
VersionTypeErrorz>Provide a fallback value if the Python version is unsupported.argsr   fallbacktuple[int, int]returnNonec               B    || _          t                      j        |  d S N)r   super__init__)selfr   r   	__class__s      b/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/mypy/config_parser.pyr!   zVersionTypeError.__init__"   s$     $    )r   r   r   r   r   r   )__name__
__module____qualname____doc__r!   __classcell__)r#   s   @r$   r   r      sC        HH                   r%   r   vstr | floatr   r   c                (   t          j        dt          |                     }|st          j        d|  d          t          |                    d                    t          |                    d                    }}|dk    r|dk    rn|dk    rd|t          j        d         k     rM dj	        |gt          j        R  }t          | t                    r|d	z  }t          |t          j        
          nt          j        d| d          ||fS )Nz\A(\d)\.(\d+)\ZzInvalid python version 'z' (expected format: 'x.y')         r   z6Python 3.{} is not supported (must be {}.{} or higher)z7. You may need to put quotes around your Python version)r   zPython major version 'z' out of range (must be 3))rematchstrargparseArgumentTypeErrorintgroupr   PYTHON3_VERSION_MINformat
isinstancefloatr   )r+   mmajorminormsgs        r$   parse_versionr@   '   s-   
#SVV,,A c()aA)a)a)abbbqwwqzz??C

OO5Ezzeqjj	!8/222QJQ 4  C !U## QPP"31MNNNN 3 (FUFFF
 
 	
 %<r%   ,str | Sequence[str] | objectsplit_regexr3   	list[str]c                    dddt          | t                    rDd	 t          j        ||           D             }|r!|d
         dk    r|                    d
           |S t          | t
                    rfd| D             S  |            dS )zSplit and trim a str or sequence (eg: list) of str into a list of str.
    If an element of the input is not str, a type error will be raised. xobjectadditional_infor3   r   r   c                `    t          j        d|  dt          |           j         d|           )Nz<Expected a list or a stringified version thereof, but got: 'z', of type .)r4   r5   typer&   )rG   rI   s     r$   complainztry_split.<locals>.complainC   s@    (}1}}Y]^_Y`Y`Yi}}l{}}
 
 	
r%   c                6    g | ]}|                                 S  strip.0ps     r$   
<listcomp>ztry_split.<locals>.<listcomp>I   s     ===q===r%   c                |    g | ]8}t          |t                    r|                                n |d           9S )z (As an element of the list.))rI   r:   r3   rQ   )rS   rT   rM   s     r$   rU   ztry_split.<locals>.<listcomp>N   sZ     
 
 
  a%%R			Xa1PQQQ	
 
 
r%   N)rF   )rG   rH   rI   r3   r   r   )r:   r3   r1   splitpopr
   )r+   rC   itemsrM   s      @r$   	try_splitr\   ?   s    
 
 
 
 

 !S ==BH[!$<$<=== 	U2Y"__IIbMMM	Ax	 	  

 
 
 
 
 
 
 	
 	r%   codesc                    t          |           t          t          j                              z
  }|r7t          j        dd                    t          |                               | S )NzInvalid error code(s): , )setr   keysr4   r5   joinsorted)r]   invalid_codess     r$   validate_codesre   Z   sf    JJ[%5%7%7!8!88M 
(Hdii}0E0E&F&FHH
 
 	
 Lr%   
allow_listc                    | D ]A}d| }d|v rt          j        | d          d|v sd|v rt          j        | d          B| S )NzInvalid allow list entry: *z5 (entries are already prefixes so must not contain *)\/zA (entries must be packages like foo.bar not directories or files))r4   r5   )rf   rT   r?   s      r$   validate_package_allow_listrk   c   s     	 	.1..!88,MMM   199q,YYY   ! r%   pathc                z    t           j                            t           j                            |                     S )ziExpand the user home directory and any environment variables contained within
    the provided path.
    )osrl   
expandvars
expanduser)rl   s    r$   expand_pathrq   q   s*    
 7bg0066777r%   str | Sequence[str]c                    t          | t                    r+|                                 r|                                 gng S d | D             S )Nc                ^    g | ]*}|                                 |                                 +S rO   rP   rR   s     r$   rU   z(str_or_array_as_list.<locals>.<listcomp>|   s-    ...!AGGII.AGGII...r%   rX   )r+   s    r$   str_or_array_as_listru   y   sI    !S 0ggii/		{{R/..q....r%   pathsSequence[str]c                    g }| D ]f}t          |                                          }t          j        |d          }|r|                    |           Q|                    |           g|S )zTake a list of files/directories (with support for globbing through the glob library).

    Where a path/glob matches no file, we still include the raw path in the resulting list.

    Returns a list of file paths
    T)	recursive)rq   rQ   fileglobglobextendappend)rv   expanded_pathsrl   globbed_filess       r$   split_and_match_files_listr      s}     N ( (4::<<(( dd;;; 	(!!-0000!!$''''r%   c                :    t          t          |                     S )zTake a string representing a list of files/directories (with support for globbing
    through the glob library).

    Where a path/glob matches no file, we still include the raw path in the resulting list.

    Returns a list of file paths
    )r   split_commas)rv   s    r$   split_and_match_filesr      s     &l5&9&9:::r%   choicec           	         g d}| |vrEt          j        d                    | d                    d |D                                           | S )N)normalsilentskiperror$invalid choice '{}' (choose from {})r_   c              3  "   K   | ]
}d | d V  dS 'NrO   rS   rG   s     r$   	<genexpr>z'check_follow_imports.<locals>.<genexpr>   *      !<!<q(a(((!<!<!<!<!<!<r%   r4   r5   r9   rb   r   choicess     r$   check_follow_importsr      sg    333GW(299		!<!<G!<!<!<<< 
 
 	

 Mr%   c           	         ddg}| |vrEt          j        d                    | d                    d |D                                           | S )Nglobalper_filer   r_   c              3  "   K   | ]
}d | d V  dS r   rO   r   s     r$   r   z%check_junit_format.<locals>.<genexpr>   r   r%   r   r   s     r$   check_junit_formatr      sf    $GW(299		!<!<G!<!<!<<< 
 
 	

 Mr%   valuec                v    |                      d          }|r!|d         dk    r|                    d           |S )NrA   rV   rF   )rY   rZ   )r   r[   s     r$   r   r      s=     KKE rb		"Lr%   python_versioncustom_typing_modulecustom_typeshed_dir	mypy_pathc                @    d t          j        d|           D             S )Nc                P    g | ]#}t          |                                          $S rO   )rq   rQ   rR   s     r$   rU   z<lambda>.<locals>.<listcomp>   s(    PPPqK		22PPPr%   [,:])r1   rY   ss    r$   <lambda>r      s!    PPBHVQ<O<OPPP r%   filesquickstart_file	junit_xmljunit_formatfollow_importsno_site_packagespluginsc                4    d t          |           D             S )Nc                6    g | ]}|                                 S rO   rP   rR   s     r$   rU   z<lambda>.<locals>.<listcomp>   s     ===!''))===r%   r   r   s    r$   r   r      s    ==\!__=== r%   always_truec                4    d t          |           D             S )Nc                6    g | ]}|                                 S rO   rP   rR   s     r$   rU   z<lambda>.<locals>.<listcomp>   s     AAAAaggiiAAAr%   r   r   s    r$   r   r      s    AAaAAA r%   always_falsec                4    d t          |           D             S )Nc                6    g | ]}|                                 S rO   rP   rR   s     r$   rU   z<lambda>.<locals>.<listcomp>        BBBQqwwyyBBBr%   r   r   s    r$   r   r          BB,q//BBB r%   untyped_calls_excludec                N    t          d t          |           D                       S )Nc                6    g | ]}|                                 S rO   rP   rR   s     r$   rU   z<lambda>.<locals>.<listcomp>   s     ,,,q,,,r%   )rk   r   r   s    r$   r   r      s(    'B,,LOO,,,( ( r%   enable_incomplete_featurec                4    d t          |           D             S )Nc                6    g | ]}|                                 S rO   rP   rR   s     r$   rU   z<lambda>.<locals>.<listcomp>   s     +O+O+O!AGGII+O+O+Or%   r   r   s    r$   r   r      s    +O+O|A+O+O+O r%   disable_error_codec                N    t          d t          |           D                       S )Nc                6    g | ]}|                                 S rO   rP   rR   s     r$   rU   z<lambda>.<locals>.<listcomp>   s     3W3W3W!AGGII3W3W3Wr%   re   r   r   s    r$   r   r      s$    N3W3W|TU3W3W3W$X$X r%   enable_error_codec                N    t          d t          |           D                       S )Nc                6    g | ]}|                                 S rO   rP   rR   s     r$   rU   z<lambda>.<locals>.<listcomp>   s     2V2V2V177992V2V2Vr%   r   r   s    r$   r   r      s$    >2V2VlSToo2V2V2V#W#W r%   c                4    d t          |           D             S )Nc                6    g | ]}|                                 S rO   rP   rR   s     r$   rU   z<lambda>.<locals>.<listcomp>   r   r%   r   r   s    r$   r   r      r   r%   c                ,    |                                  gS r   rP   r   s    r$   r   r      s    !'')) r%   )package_root	cache_dirpython_executablestrictexcludepackagesmodulesz&Final[dict[str, _INI_PARSER_CALLABLE]]ini_config_typestoml_config_typesc                6    d t          | d          D             S )Nc                ,    g | ]}t          |          S rO   )rq   rR   s     r$   rU   z<lambda>.<locals>.<listcomp>   s    MMM1AMMMr%   r   )r\   r   s    r$   r   r      s    MM	!V8L8LMMM r%   c                :    t          t          |                     S r   )r   r\   r   s    r$   r   r      s    5illCC r%   c                :    t          t          |                     S r   )r   r3   r   s    r$   r   r      s    "4SVV"<"< r%   c                :    t          t          |                     S r   )r   r3   r   s    r$   r   r      s    $8Q$@$@ r%   c                :    t          t          |                     S r   )rk   r\   r   s    r$   r   r      s    +FyQR||+T+T r%   c                :    t          t          |                     S r   re   r\   r   s    r$   r   r      s    y||(D(D r%   c                :    t          t          |                     S r   r   r   s    r$   r   r      s    ~ill'C'C r%   r   r   r   r   config_filestderrTextIO | NoneLtuple[MutableMapping[str, Any], dict[str, _INI_PARSER_CALLABLE], str] | Nonec                   t           j                            |           sd S 	 t          |           ryt	          | d          5 }t          j        |          }d d d            n# 1 swxY w Y   |                    di           }d|vrd S d|d         i}t          |          }t          }n/t          j                    }|                    |            t          }nE# t
          j        t          j        t           f$ r!}t#          |  d| |           Y d }~d S d }~ww xY wt           j                            |           t&          j        v rd|vrd S ||| fS )Nrbtoolmypy: file)rn   rl   existsis_tomlopentomllibloadgetdestructure_overridesr   configparserRawConfigParserreadr   TOMLDecodeErrorErrorConfigTOMLValueErrorprintbasenamer   SHARED_CONFIG_NAMES)r   r   f	toml_dataparserconfig_typeserrs          r$   _parse_individual_filer      s    7>>+&& t; 	,k4(( ,A#LOO	, , , , , , , , , , , , , , , "fb11IY&&t6!23I*955F,LL!133FKK$$$+L#\%79MN   %%%%F3333ttttt 
w$$(DDDW]I]I]t<,,sB   C A#C #A''C *A'+C 
AC !D<DDc                   t           j                            t          j                              	 t          j        t          j        z   D ]U}t           j                            t           j                            |                    }t          ||           }|R|c S t          fddD                       rn)t           j                                      }|k    rn|t          j        D ]}t          ||           }||c S d S )NTc              3     K   | ]A}t           j                            t           j                            |                    V  Bd S r   )rn   rl   r   rb   )rS   cvs_rootcurrent_dirs     r$   r   z$_find_config_file.<locals>.<genexpr>'  sR       
 
DLBGNN27<<X>>??
 
 
 
 
 
r%   )z.gitz.hg)rn   rl   abspathgetcwdr   CONFIG_NAMESr   relpathrb   r   anydirnameUSER_CONFIG_FILES)r   namer   ret
parent_dirr   s        @r$   _find_config_filer	    s!    '//")++..K!)H,HH 	 	D'//"',,{D*I*IJJK(f==C{JJJ 
 
 
 
P_
 
 
 
 
 	 W__[11
$$ !"  1  $[&99;


4r%   optionsr   set_strict_flagsCallable[[], None]filename
str | Nonestdoutr   c                   |pt           j        }|pt           j        }|t          ||          nt	          |          }|dS |\  }}}|| _        t          j                            t          j        	                    |                    t          j
        d<   d|vrB|s+t          j                            |          t          j        vrt          | d|           ni|d         }	| d}
t          |
| ||	||          \  }}|                                D ]\  }}t#          | ||           | j                            |           |                                D ]\  }}	|                    d          rt+          ||          }
t          |
| ||	||          \  }}|rOt          |
d                    d	                    d
 t1          |          D                                 |           t3          |          t4          z
  rxt          |
d                    d	                    t1          t3          |          t4          z
                                |           d |                                D             }|dd         }|                    d          D ]                    t          j        d          t          j        r                     t          j        d          t?          fddD                       s,t?          d                     d          D                       rt          |
d|           || j         <   dS )zParse a config file into an Options object.

    Errors are written to stderr but are not fatal.

    If filename is None, fall back to default config files.
    NMYPY_CONFIG_FILE_DIRr   z": No [mypy] section in config filer   z
: [mypy]: mypy-z3Per-module sections should not specify reports ({})r_   c              3      K   | ]	}|d z   V  
dS )_reportNrO   )rS   r   s     r$   r   z$parse_config_file.<locals>.<genexpr>l  s&      !M!MA!i-!M!M!M!M!M!Mr%   z=Per-module sections should only specify per-module flags ({})c                ,    i | ]\  }}|t           v ||S rO   )r   )rS   kr+   s      r$   
<dictcomp>z%parse_config_file.<locals>.<dictcomp>x  s)    WWWDAqqDV?V?V1a?V?V?Vr%      rA   rK   c              3      K   | ]}|v V  	d S r   rO   )rS   cr{   s     r$   r   z$parse_config_file.<locals>.<genexpr>  s'      11QqDy111111r%   z?[]!c              3  *   K   | ]}d |v o|d k    V  dS )rh   NrO   r   s     r$   r   z$parse_config_file.<locals>.<genexpr>  s@       9 9./C1H)c9 9 9 9 9 9r%   ziPatterns must be fully-qualified module names, optionally with '*' in some components (e.g spam.*.eggs.*))!sysr  r   r   r	  r   rn   rl   r  r   environr   r   r   r   parse_sectionr[   setattrreport_dirsupdate
startswith
get_prefixr9   rb   rc   r`   r   rY   replacesepaltsepr  per_module_options)r
  r  r  r  r   r  r   r   	file_readsectionprefixupdatesr   r  r+   r  globsr{   s                    @r$   parse_config_filer-  9  s    !szF!szF  	x000v&& 
 {&)#FL)#G)+9S9S)T)TBJ%&V 	Qrw''	22(:VVVYBBBPPPP.))),G-wf 
  
 MMOO 	# 	#DAqGQ"""""";/// )? )?g??7## (	?	400F#0!17L&$ $ G[  IPP		!M!M9L9L!M!M!MMM       7||00 XSZZ		&W8J)J"K"KLL       XWGMMOOWWWHEC(( ? ?||BFC009 8<<	377D1111&11111 
?S 9 937::c??9 9 9 6 6 
? J#	     8?G.t44S)? )?r%   r(  r  c                    t          |           r4dd                    |                    d          dd                    z  }n|}|  d| dS )Nzmodule = "%s"-r.   z: [z]:)r   rb   rY   )r(  r  module_name_strs      r$   r#  r#    sY    y )CHHTZZ__QRR5H,I,II//O////r%   boolc                P    |                                                      d          S )Nz.toml)lowerendswith)r  s    r$   r   r     s     >>$$W---r%   r   dict[str, Any]c           
        d| d         vr| S t          | d         d         t                    st          d          |                                 }|d         d         D ]}d|vrt          d          t          |d         t                    r
|d         g}n3t          |d         t                    r	|d         }nt          d          |D ]}|                                }|d= d| }||vr|||<   (|                                D ]B\  }}|||         v r(||         |         |k    rt          d| d	| d
          |||         |<   C|d         d= |S )aF  Take the new [[tool.mypy.overrides]] section array in the pyproject.toml file,
    and convert it back to a flatter structure that the existing config_parser can handle.

    E.g. the following pyproject.toml file:

        [[tool.mypy.overrides]]
        module = [
            "a.b",
            "b.*"
        ]
        disallow_untyped_defs = true

        [[tool.mypy.overrides]]
        module = 'c'
        disallow_untyped_defs = false

    Would map to the following config dict that it would have gotten from parsing an equivalent
    ini file:

        {
            "mypy-a.b": {
                disallow_untyped_defs = true,
            },
            "mypy-b.*": {
                disallow_untyped_defs = true,
            },
            "mypy-c": {
                disallow_untyped_defs: false,
            },
        }
    	overridesr   z~tool.mypy.overrides sections must be an array. Please make sure you are using double brackets like so: [[tool.mypy.overrides]]modulezetoml config file contains a [[tool.mypy.overrides]] section, but no module to override was specified.zytoml config file contains a [[tool.mypy.overrides]] section with a module value that is not a string or a list of stringsr  z\toml config file contains [[tool.mypy.overrides]] sections with conflicting values. Module 'z ' has two different values for 'r   )r:   listr   copyr3   r[   )	r   resultoverrider   r8  module_overridesold_config_namenew_key	new_values	            r$   r   r     s   @ )F+++i'4d;; 
"R
 
 	

 ^^F6N;/ #A #A8##&D  
 hx(#.. 		)*GG*D11 	x(GG&    	A 	AF'}} *.f..Of,,*:''*:*@*@*B*B 
A 
A&GY6/#:::"?3G<	II2b/5b bW^b b b  
 8AF?+G44
A	A& 	v{#Mr%   r*  templater)  Mapping[str, Any]r   r   (tuple[dict[str, object], dict[str, str]]c                F   i }i }ddd}|D ]}	d}
|	}|	|v r
||	         }n|	|v r*t          |  d|	 d||	          d||	          d|	           Ct          ||	d
          }||	                    d          r\|	d
d                             dd          }|t          j        v rt          ||	                   ||<   nt          |  d|	 |	           |	                    d          rn
|	                    d          r%t          ||	dd
                   r|	dd
         }d}
n|	                    d          rt          |d|	z             rd|	z   }d}
n|	                    d          r%t          ||	dd
                   r|	dd
         }d}
nf|	                    d          r+t          |d|	dd
         z             rd|	dd
         z   }d}
n&|	dk    rnt          |  d|	 d||	          |	           |
rt          ||d
          }nt          |          }d
}	 |t          u rSt          |t                    r#t          |                    |	                    }n|                    |	          }|
r| }nt!          |          r|
rt          |  d| |	           	  ||                    |	                    }n# t"          $ r)}t          |  |	 d| |	           |j        }Y d
}~nQd
}~wt&          j        $ r#}t          |  |	 d| |	           Y d
}~d
}~ww xY wt          |  d|	 d|	           5n0# t*          $ r#}t          |  |	 d| |	           Y d
}~^d
}~ww xY w|	dk    r|r
 |             z|||<   d|vrg |d<   d|vrg |d<   ||fS )z|Parse one section of a config file.

    Returns a dict of option values encountered, and a dict of report directories.
    r   r   )enabled_error_codesdisabled_error_codesFzUnrecognized option: z = z (did you mean z?)r   Nr  i_r/  zUnrecognized report type: x_no_r   Tallowdisdisallowshow_hide_r  r   zCan not invert non-boolean key r   zDon't know what type z should have)r   getattrr4  r$  r   REPORTER_NAMESr3   r"  hasattrrL   r1  r:   dictconvert_to_booleanr   
getbooleancallabler   r   r4   r5   
ValueError)r*  rA  r  r)  r   r   resultsr   invalid_optionskeyinvertoptions_keyctdvreport_typer+   err_versionr   s                     r$   r  r    s$    "$G"$K
  3 4 O
  L! L!,c"BBO## ; ; ; ; ; ;"1#"6; ; ;   
 3--Bz<<	** "%crc("2"23"<"<K"h&===36ws|3D3DK00HH3HHvVVVV>>$'' _^^E** _wxQRR/I/I _"%abb'K!FF^^G,, _53;1O1O _"'#+K!FF^^J// 	_GHc!""g4N4N 	_"%abb'K!FF^^G,, _7SQRQSQSWCT1U1U _")CG"3K!FFH__VPP#PP'#,PPW]^^^^  ;==BBbB	Tzzgt,, 0*7;;s+;+;<<AA**3//A A"  VQQKQQX^____7;;s++,,AA' - - -V9S99K99GGGG#,AAAAAA1   V1S11C11????HHHH GGcGGGfUUUU 	 	 	V)S))C))7777HHHH	 (?? #  """  7**(*$%'))')#$KsU   BM#KM
L%K0+M0L%L M L%%M
M/M**M/
Any | Nonec                8   t          | t                    r| S t          | t                    st          |           } |                                 t          j        j        vrt          d|            t          j        j        |                                          S )zAReturn a boolean value translating from other types if necessary.zNot a boolean: )r:   r1  r3   r3  r   r   BOOLEAN_STATESrV  )r   s    r$   rS  rS  [  s    % eS!! E

{{}}L8GGG2522333'6u{{}}EEr%   r   tuple[list[str], list[str]]c                   g }g }g }d}|t          |           k     r)| |         dk    r=|                    d                    |                                                     g }n| |         dk    r|dz  }|t          |           k     rK| |         dk    r?|                    | |                    |dz  }|t          |           k     r| |         dk    ?|t          |           k    r)|                    d           |                                 n|                    | |                    |dz  }|t          |           k     )|r:|                    d                    |                                                     ||fS )zfSplit s on commas, except during quoted sections.

    Returns the parts and a list of error messages.r   rA   rF   "r.   z+Unterminated quote in configuration comment)lenr}   rb   rQ   clear)r   partscurerrorsis        r$   split_directiverl  f  sn    ECF	A
c!ff**Q43;;LL++--...CCqTS[[FAc!ff**1

1Q4   Q c!ff**1 CFF{{KLLL		JJqt	Q c!ff**  +RWWS\\''))***&=r%   line tuple[dict[str, str], list[str]]c                    i }t          |           \  }}|D ]M}d|vr|}d}n#d |                    dd          D             \  }}|                    dd          }|d}|||<   N||fS )z5Rewrite the mypy comment syntax into ini file syntax.=Nc              3  >   K   | ]}|                                 V  d S r   rP   r   s     r$   r   z.mypy_comments_to_config_map.<locals>.<genexpr>  s*      BB17799BBBBBBr%   r.   r/  rG  True)rl  rY   r$  )rm  rA  r
  entriesrj  entryr  r   s           r$   mypy_comments_to_config_mapru    s    G%d++OGV 
 
eDEEBBekk#q.A.ABBBKD%||C%%=EF?r%   r   list[tuple[int, str]]/tuple[dict[str, object], list[tuple[int, str]]]c           	     l   g }g g d}| D ]$\  }t          j                    }t          ||          \  }}d|v r|                    df           |d= ||d<   |                    fd|D                        t                      }ddfd	}	t          d
||	|d         t          |          \  }
}|                    fd|                                	                                
                    d          D                        |r|                    df           r|                    df           d|
v rjt          |
d         x}t                    rMt          |                    dg           x}t                    r"t          t          ||z                       |
d<   d|
v rjt          |
d         x}t                    rMt          |                    dg           x}t                    r"t          t          ||z                       |
d<   |                    |
           &||fS )zParse a collection of inline mypy: configuration comments.

    Returns a dictionary of options to be applied and a list of error messages
    generated.
    )r   r   r   z4python_version not supported in inline configurationdummyc              3      K   | ]}|fV  	d S r   rO   rS   rG   linenos     r$   r   z&parse_mypy_comments.<locals>.<genexpr>  s'      88avqk888888r%   Fr   r   c                     d d S )NTrO   )strict_founds   r$   r  z-parse_mypy_comments.<locals>.set_strict_flags  s    LLLr%   rF   )r   c              3  $   K   | ]
}||fV  d S r   rO   r{  s     r$   r   z&parse_mypy_comments.<locals>.<genexpr>  s-      VVaTUVvqkVVVVVVr%   
z-Reports not supported in inline configurationzSetting "strict" not supported in inline configuration: specify it in a configuration file instead, or set individual inline flags (see "mypy -h" for the list of flags enabled in strict mode)r   r   )r   r   )r   r   ru  r}   r|   r   r  r   getvaluerQ   rY   r:   r9  r   rc   r`   r!  )r   rA  rj  sectionsrm  r   r
  parse_errorsr   r  new_sectionsreportsneeceecndecdecr|  r~  s                   @@r$   parse_mypy_commentsr    s    %'F8:RT"U"UH 4& 4& -// ;D( K Kw&&MM6#YZ[[[()!w8888<888888	  	  	  	  	  	  !.*F7O=MV\!
 !
 !
g 	VVVV6??+<+<+B+B+D+D+J+J4+P+PVVVVVV 	UMM6#RSTTT 	MMS    <//<0C#DD4dKK 0(,,/BB"G"GG3NN 0 17s4#:0G0GL,- L00<0D#EE4tLL 1(,,/CR"H"HH3$OO 1 28D3J1H1HL-.%%%%Vr%   c                    | r|sdS t          |           sd                    d |D                       S dd                    t          |                    z  S )NrF   r_   c              3  "   K   | ]
}d | dV  dS )z[mypy-]NrO   )rS   r8  s     r$   r   z*get_config_module_names.<locals>.<genexpr>  s.      BB+&+++BBBBBBr%   zmodule = ['%s']z', ')r   rb   rc   )r  r   s     r$   get_config_module_namesr    se     7 r8 CyyBB'BBBBBBF7OO < <==r%   c                      e Zd ZdS )r   N)r&   r'   r(   rO   r%   r$   r   r     s        Dr%   r   )r+   r,   r   r   )rA   )r+   rB   rC   r3   r   rD   )r]   rD   r   rD   )rf   rD   r   rD   )rl   r3   r   r3   )r+   rr   r   rD   )rv   rw   r   rD   )rv   r3   r   rD   )r   r3   r   r3   )r   r3   r   rD   r   )r   r3   r   r   r   r   )r   r   r   r   )NN)r
  r   r  r  r  r  r  r   r   r   r   r   )r(  r3   r  r3   r   r3   )r  r3   r   r1  )r   r5  r   r5  )r*  r3   rA  r   r  r  r)  rB  r   r5  r   r   r   rC  )r   r`  r   r1  )r   r3   r   rc  )rm  r3   rA  r   r   rn  )r   rv  rA  r   r   rw  )r  r  r   rD   r   r3   )L
__future__r   r4   r   r{   rz   rn   r1   r  ior   mypy.errorcodesr   version_infor   tomlicollections.abcr   r	   r
   typingr   r   r   r   r   typing_extensionsr   r   r   r   mypy.optionsr   r   r3   r1  r6   r;   rR  r9  tupler   __annotations__r   r5   r   r@   r\   re   rk   rq   ru   r   r   r   r   r   r   r:  r   r!  r   r	  r-  r#  r   r   r   r  rS  rl  ru  r  r  rV  r   rO   r%   r$   <module>r     sY   " " " " " " "          				 				 



       ' ' ' ' ' 'wNNNN = = = = = = = = = = 6 6 6 6 6 6 6 6 6 6 6 6 6 6 . . . . . . . .       4 4 4 4 4 4 4 4!&sE4S>49eCHoE"      #+C52E+E"F  F F F F         x1         0    6      8 8 8 8/ / / /   (	; 	; 	; 	;         <m<C< ;< PP	<
 "< {< < &< *< < ==< AA< BB<   <"  !O!O#<$ XX%<& WW'<( CB$$$5< < <     < =M<Q<Q<S<S  S S S S   -MM 	CC 	<<	
 	@@ 	9 	y 		 	 !T!T 	$Y 	DD 	CC 		 	' 	I  	9!  . /3- - - - -F !    H ! R? R? R? R? R?j0 0 0 0. . . .P P P Pr Zj  j  j  j  j ZF F F F   :   &@ @ @ @F> > > >	 	 	 	 	: 	 	 	 	 	r%   