
    niue              
         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
 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Z.ddZ/ddZ0dd"Z1dd#Z2dd%Z3dd&Z4dd(Z5i d)e,d*e d+e/d,d- d.e2d/e/d0e/d1e4d2e3d3e!d4d5 d6d7 d8d9 d:d; d<d= d>d? d@dA dB e/e/e!dC e-e-dDZ6dEe(dF<   e67                                Z8dEe(dG<   e89                    i d)e,d,dH d.dI d1dJ d2dK d4e-d6e-d8e-d:dL d<e-d>dM d@dN dOe-dPe0dQe-dRe-           	 dddWZ:	 dddXZ;	 	 dddaZ<dddZ=ddfZ>ddiZ?ej@        fddqZAddsZBddvZCddyZDdd}ZEdd~ZF G d deG          ZHdS )    )annotationsN)StringIO)      )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      O/var/www/html/gpu-tools/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_regexr2   	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_infor2   r   r   c                `    t          j        d|  dt          |           j         d|           )Nz<Expected a list or a stringified version thereof, but got: 'z', of type .)r3   r4   typer%   )rF   rH   s     r#   complainztry_split.<locals>.complainA   s@    (}1}}Y]^_Y`Y`Yi}}l{}}
 
 	
r$   c                6    g | ]}|                                 S  strip.0ps     r#   
<listcomp>ztry_split.<locals>.<listcomp>G   s     ===q===r$   c                |    g | ]8}t          |t                    r|                                n |d           9S )z (As an element of the list.))rH   r9   r2   rP   )rR   rS   rL   s     r#   rT   ztry_split.<locals>.<listcomp>L   sZ     
 
 
  a%%R			Xa1PQQQ	
 
 
r$   N)rE   )rF   rG   rH   r2   r   r   )r9   r2   r0   splitpopr	   )r*   rB   itemsrL   s      @r#   	try_splitr[   =   s    
 
 
 
 

 !S ==BH[!$<$<=== 	U2Y"__IIbMMM	Ax	 	  

 
 
 
 
 
 
 	
 	r$   
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))r3   r4   )r\   rS   r>   s      r#   validate_package_allow_listra   X   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.
    )osrb   
expandvars
expanduser)rb   s    r#   expand_pathrg   f   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 rN   rO   rQ   s     r#   rT   z(str_or_array_as_list.<locals>.<listcomp>q   s-    ...!AGGII.AGGII...r$   rW   )r*   s    r#   str_or_array_as_listrk   n   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)rg   rP   fileglobglobextendappend)rl   expanded_pathsrb   globbed_filess       r#   split_and_match_files_listrv   t   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
    )rv   split_commas)rl   s    r#   split_and_match_filesry      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 {}), c              3  "   K   | ]
}d | d V  dS 'NrN   rR   rF   s     r#   	<genexpr>z'check_follow_imports.<locals>.<genexpr>   *      !<!<q(a(((!<!<!<!<!<!<r$   r3   r4   r8   joinrz   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   rN   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 )Nr@   rU   rE   )rX   rY   )r   rZ   s     r#   rx   rx      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 rN   )rg   rP   rQ   s     r#   rT   z<lambda>.<locals>.<listcomp>   s(    PPPqK		22PPPr$   [,:])r0   rX   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 rN   rO   rQ   s     r#   rT   z<lambda>.<locals>.<listcomp>   s     ===!''))===r$   rx   r   s    r#   r   r      s    ==\!__=== r$   always_truec                4    d t          |           D             S )Nc                6    g | ]}|                                 S rN   rO   rQ   s     r#   rT   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 rN   rO   rQ   s     r#   rT   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 rN   rO   rQ   s     r#   rT   z<lambda>.<locals>.<listcomp>   s     ,,,q,,,r$   )ra   rx   r   s    r#   r   r      s(    'B,,LOO,,,( ( r$   enable_incomplete_featurec                4    d t          |           D             S )Nc                6    g | ]}|                                 S rN   rO   rQ   s     r#   rT   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                4    d t          |           D             S )Nc                6    g | ]}|                                 S rN   rO   rQ   s     r#   rT   z<lambda>.<locals>.<listcomp>   s     $H$H$H1QWWYY$H$H$Hr$   r   r   s    r#   r   r      s    $H$HQ$H$H$H r$   enable_error_codec                4    d t          |           D             S )Nc                6    g | ]}|                                 S rN   rO   rQ   s     r#   rT   z<lambda>.<locals>.<listcomp>   s     #G#G#G!AGGII#G#G#Gr$   r   r   s    r#   r   r      s    #G#G|A#G#G#G r$   c                4    d t          |           D             S )Nc                6    g | ]}|                                 S rN   rO   rQ   s     r#   rT   z<lambda>.<locals>.<listcomp>   r   r$   r   r   s    r#   r   r      r   r$   c                ,    |                                  gS r   rO   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 rN   )rg   rQ   s     r#   rT   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   )rv   r[   r   s    r#   r   r      s    5illCC r$   c                :    t          t          |                     S r   )r   r2   r   s    r#   r   r      s    "4SVV"<"< r$   c                :    t          t          |                     S r   )r   r2   r   s    r#   r   r      s    $8Q$@$@ r$   c                :    t          t          |                     S r   )ra   r[   r   s    r#   r   r      s    +FyQR||+T+T r$   c                     t          |           S r   r   r   s    r#   r   r      s    	! r$   c                     t          |           S r   r   r   s    r#   r   r      s    y|| 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)rd   rb   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   )rd   rb   r   r   )rR   cvs_rootcurrent_dirs     r#   r   z$_find_config_file.<locals>.<genexpr>  sR       
 
DLBGNN27<<X>>??
 
 
 
 
 
r$   )z.gitz.hg)rd   rb   abspathgetcwdr   CONFIG_NAMESr   relpathr   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 )_reportNrN   )rR   r   s     r#   r   z$parse_config_file.<locals>.<genexpr>a  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 rN   )r   )rR   kr*   s      r#   
<dictcomp>z%parse_config_file.<locals>.<dictcomp>m  s)    WWWDAqqDV?V?V1a?V?V?Vr$      r@   rJ   c              3      K   | ]}|v V  	d S r   rN   )rR   crq   s     r#   r   z$parse_config_file.<locals>.<genexpr>v  s'      11QqDy111111r$   z?[]!c              3  *   K   | ]}d |v o|d k    V  dS )r^   NrN   r   s     r#   r   z$parse_config_file.<locals>.<genexpr>v  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   rd   rb   r   r   environr   r   r   r   parse_sectionrZ   setattrreport_dirsupdate
startswith
get_prefixr8   r   sortedsetr   rX   replacesepaltsepr   per_module_options)r  r  r  r  r   r   r   r   	file_readsectionprefixupdatesr  r  r*   r   globsrq   s                    @r#   parse_config_filer&  .  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   r   rX   )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   )r9   listr   copyr2   rZ   )	r   resultoverrider   r1  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   getattrr-  r  r   REPORTER_NAMESr2   r  hasattrrK   r*  r9   dictconvert_to_booleanr   
getbooleancallabler   r   r3   r4   
ValueError)r#  r:  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: )r9   r*  r2   r,  r   r   BOOLEAN_STATESrO  )r   s    r#   rL  rL  P  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   r@   rE   "r-   z+Unterminated quote in configuration comment)lenrs   r   rP   clear)r   partscurerrorsis        r#   split_directivere  [  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   rO   r   s     r#   r   z.mypy_comments_to_config_map.<locals>.<genexpr>  s*      BB17799BBBBBBr$   r-   r(  r@  True)re  rX   r  )rf  r:  r  entriesrc  entryr   r   s           r#   mypy_comments_to_config_maprn  x  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   rN   rR   rF   linenos     r#   r   z&parse_mypy_comments.<locals>.<genexpr>  s'      88avqk888888r$   Fr   r   c                     d d S )NTrN   )strict_founds   r#   r  z-parse_mypy_comments.<locals>.set_strict_flags  s    LLLr$   rE   )r   c              3  $   K   | ]
}||fV  d S r   rN   rt  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   rn  rs   rr   r   r  r   getvaluerP   rX   r9   r2  r   r  r  r  )r   r:  rc  sectionsrf  r   r  parse_errorsr   r  new_sectionsreportsneeceecndecdecru  rw  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 )NrE   r   c              3  "   K   | ]
}d | dV  dS )z[mypy-]NrN   )rR   r1  s     r#   r   z*get_config_module_names.<locals>.<genexpr>  s.      BB+&+++BBBBBBr$   zmodule = ['%s']z', ')r   r   r  )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'   rN   r$   r#   r   r     s        Dr$   r   )r*   r+   r   r   )r@   )r*   rA   rB   r2   r   rC   )r\   rC   r   rC   )rb   r2   r   r2   )r*   rh   r   rC   )rl   rm   r   rC   )rl   r2   r   rC   )rz   r2   r   r2   )r   r2   r   rC   r   )r   r2   r   r   r   r   )r   r   r   r   )NN)r  r   r  r  r  r  r  r   r   r   r   r   )r!  r2   r   r2   r   r2   )r  r2   r   r*  )r   r.  r   r.  )r#  r2   r:  r   r  r  r"  r;  r   r.  r   r   r   r<  )r   rY  r   r*  )r   r2   r   r\  )rf  r2   r:  r   r   rg  )r   ro  r:  r   r   rp  )r  r  r   rC   r   r2   )I
__future__r   r3   r   rq   rp   rd   r0   r  ior   version_infor   tomlicollections.abcr   r   r	   typingr
   r   r   r   r   typing_extensionsr   r   r   r   mypy.optionsr   r   r2   r*  r5   r:   rK  r2  tupler   __annotations__r   r4   r   r?   r[   ra   rg   rk   rv   ry   r   r   rx   r   r3  r   r  r   r   r&  r  r   r   r   r  rL  re  rn  r  r  rO  r   rN   r$   r#   <module>r     s3   " " " " " " "          				 				 



      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#<$ HH%<& GG'<( CB$$$5< < <     < =M<Q<Q<S<S  S S S S   -MM 	CC 	<<	
 	@@ 	9 	y 		 	 !T!T 	$Y 	44 	33 		 	' 	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$   