
    \j7n                       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mZ d dlmZ d dl	m
Z
mZ d dlmZmZmZ d dlmZ d dlmZ d d	lmZmZ d d
lmZmZ  G d d          Zh dZded<   eh dz  dhz
  Zded<    e eedhz
                      Z ded<   dZ!ded<   dZ"ded<   dZ#ded<   dZ$ded<   dZ%ded<   dZ&ded <    e'e#e%e&f          Z(ded!<    e'e!e"e$f          Z)ded"<    G d# d$          Z*dS )%    )annotationsN)Callable)Pattern)AnyFinal)WriteBuffer
write_bool	write_str)defaults)
write_json)	ErrorCodeerror_codes)get_class_descriptorsreplace_object_statec                  :    e Zd ZU dZded<   dZded<   dZded<   dS )		BuildTyper   r   STANDARD   MODULE   PROGRAM_TEXTN)__name__
__module____qualname__r   __annotations__r   r        P/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/mypy/options.pyr   r      sE         HFLr   r   >'   mypycalways_truedebug_cachealways_falseextra_checksignore_errorsfollow_importswarn_no_returnstrict_equalitystrict_optionalwarn_return_anywarn_unreachabledisallow_any_exprenable_error_codeimplicit_optionalimplicit_reexportallow_redefinitioncheck_untyped_defsdisable_error_codestrict_concatenateenabled_error_codeslocal_partial_typeswarn_unused_ignoresdisabled_error_codesallow_untyped_globalsdisallow_any_explicitdisallow_any_genericsdisallow_untyped_defsallow_redefinition_olddisallow_any_decorateddisallow_untyped_callsfollow_untyped_importsignore_missing_importsdisallow_any_unimporteddisallow_incomplete_defsdisallow_subclassing_anyfollow_imports_for_stubsstrict_equality_for_nonedisallow_untyped_decoratorsr   PER_MODULE_OPTIONS>   bazelpluginsplatformstrict_bytesinstall_typesnative_parserfixed_format_cacheold_type_inferenceuntyped_calls_excludeenable_incomplete_featuredisable_bytearray_promotiondisable_memoryview_promotionr!   OPTIONS_AFFECTING_CACHErI   #OPTIONS_AFFECTING_CACHE_NO_PLATFORMTypeVarTupleTYPE_VAR_TUPLEUnpackUNPACKPreciseTupleTypesPRECISE_TUPLE_TYPESNewGenericSyntaxNEW_GENERIC_SYNTAXInlineTypedDictINLINE_TYPEDDICTTypeForm	TYPE_FORMINCOMPLETE_FEATURESCOMPLETE_FEATURESc                      e Zd ZdZd#dZd$dZd%dZd&d
Zd'dZd(dZ	d)dZ
d#dZd*dZd+dZd#dZd,dZd-dZd.dZd/d Zd&d!Zd"S )0OptionszOptions collected from flags.returnNonec                   d | _         t          j        | _        t          j        d d         | _        t          j        | _        t          j
        d          }|dk    r|| _        nt          j        | _        d | _        d | _        d | _        g | _        i | _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        g | _        d| _        d| _        d| _        d| _        d| _        d| _         d| _!        g | _"        d| _#        d| _$        d| _%        d| _&        d| _'        d| _(        d| _)        d| _*        d| _+        d| _,        g | _-        d| _.        d| _/        d| _0        d| _1        d| _2        d| _3        d| _4        d| _5        d| _6        d| _7        d| _8        d| _9        d| _:        d| _;        d| _<        d| _=        d| _>        d| _?        g | _@        g | _A        g | _B        t                      | _D        g | _E        t                      | _F        d| _G        d | _H        d | _I        d | _J        d | _K        d | _L        d | _M        d| _N        d| _O        t          jQ        | _R        d| _S        t          jT        | _U        d| _V        d| _W        d| _X        d| _Y        d| _Z        d| _[        d| _\        d| _]        d| _^        d| __        d| _`        d| _a        g | _b        i | _c        g | _d        t                      | _e        d| _f        d| _g        d| _h        d| _i        d| _j        d| _k        d| _l        g | _m        d | _n        d | _o        d| _p        d| _q        d| _r        d| _s        d | _t        d| _u        d| _v        d| _w        d| _x        d| _y        d| _z        d| _{        d| _|        d| _}        d| _~        d| _        d| _        d| _        g | _        i | _        d| _        d| _        d| _        d | _        d| _        d| _        d| _        t          j        | _        d| _        d| _        d| _        d| _        d| _        d| _        d | _        d | _        d| _        d S )	Nr   MACHDEP
emscriptenFnormalTglobalr   )_per_module_cacher   r   
build_typesysversion_infopython_version
executablepython_executable	sysconfigget_config_varrI   custom_typing_modulecustom_typeshed_dirabs_custom_typeshed_dir	mypy_pathreport_dirsno_silence_site_packagesno_site_packagesr?   !ignore_missing_imports_per_moduler>   r%   rC   namespace_packagesexplicit_package_basesexcludeexclude_gitignorer9   r@   r+   r<   r8   r=   rO   r:   rA   r0   rE   rB   warn_incomplete_stubwarn_redundant_castsr&   r)   report_deprecated_as_notedeprecated_calls_excluder5   warn_unused_configsr$   r(   show_error_contextcolor_outputerror_summaryr-   r.   r7   r;   r/   r'   rD   rJ   r2   r#   r*   r    r"   r1   setr6   r,   r3   scripts_are_modulesconfig_filequickstart_filefilespackagesmodules	junit_xmljunit_formatincrementalr   	CACHE_DIR	cache_dirsqlite_cacheSQLITE_NUM_SHARDSsqlite_num_shardsrM   r!   skip_version_checkskip_cache_mtime_checksfine_grained_incrementalcache_fine_graineduse_fine_grained_cachedebug_serializer   inspectionspreserve_astsinclude_docstringsrH   per_module_options_glob_options_unused_configs	verbositypdbshow_tracebackraise_exceptionsdump_type_statsdump_inference_statsdump_build_statsrP   timing_statsline_checking_statssemantic_analysis_onlyuse_builtins_fixturestest_envnum_workersshadow_fileshow_column_numbersshow_error_endhide_error_codesshow_error_code_linksreveal_verbose_typespretty
dump_graph	dump_depslogical_depsr4   rL   rG   export_typespackage_root	cache_map	fast_exitfast_module_lookupallow_empty_bodiestransform_sourceshow_absolute_pathrK   non_interactiveMANY_ERRORS_THRESHOLDmany_errors_thresholdrN   disable_expression_cacheexport_ref_infopos_only_special_methodsrQ   rR   outputmypyc_annotation_filemypyc_skip_c_generation)selfrh   s     r   __init__zOptions.__init__h   s   <@ $,/2/?/C .1^ *955l""#DMMLDM04!/3 37$$&+-(-% %&+#16.&+#& ).%
 #' ',#"$', &+"',$!&&+#%*" ',# 13" &+" ).% #( ,1( ).% %*! %*! #  % */& 46% $)  $)  #  $ #( !! "' "& &+" ',# #(  % ).% ! #( " !& ') (* .047EE! -/3655  $)  (,
 ,0 (,
 +/ *. &*!)  !+ !)!;"& "'',$(-%"'&+#  % 

 ! # #( #% AC=?), # %$$)! %46&(,/3  ',# &+"  !"37). $) %%*"$)!!#' "
! (*57"'"' >B(-"  % &.%C""'(-%  % )-%+/(,0) #' 26" (-$$$r   boolc                (    | j         dk    p| j         S )N)      )rp   r   r   s    r   use_star_unpackzOptions.use_star_unpack  s    "g-NT5N1NNr   dict[str, object]c                    t          t          | dd                    }t          t                    D ]%}t	          | |          rt          | |          ||<   &d |                                D             }|S )z,Produce a comparable snapshot of this Option__dict__r   c                D    i | ]\  }}|                     d           ||S )_)
startswith).0kvs      r   
<dictcomp>z$Options.snapshot.<locals>.<dictcomp>  s/    AAAdaq||C/@/@AQAAAr   )dictgetattrr   rd   hasattritems)r   dr   s      r   snapshotzOptions.snapshot  sz     z2..//&w// 	( 	(AtQ (tQ''!AAaggiiAAAr   bytesc                    | j         
J d            |                                 }|d= |d= t                      }t          ||           |                                S )z-Serialize this options object to binary data.Nz%Source transform cannot be serializedr6   r3   )r   r   r   r   getvalue)r   r   bufs      r   to_byteszOptions.to_bytes  s`    $,,.U,,,==??+,*+mm3!!!||~~r   strc                V    dt          j        |                                            dS )NzOptions())pprintpformatr   r   s    r   __repr__zOptions.__repr__  s%    <&.99<<<<r   error_callbackCallable[[str], Any]c                  t          | j                  }t          | j                  }t          t          j                              }||z  |z
  }|r. |dd                    t          |                                | xj        d |D             z  c_        | xj        d |D             z  c_        | xj        | j        z  c_        dS )z?Process `--enable-error-code` and `--disable-error-code` flags.zInvalid error code(s): z, c                :    h | ]}|t           v t           |         S r   r   r   codes     r   	<setcomp>z.Options.process_error_codes.<locals>.<setcomp>  s.     &
 &
 &
"&ATATKATATATr   c                :    h | ]}|t           v t           |         S r   r   r   s     r   r   z.Options.process_error_codes.<locals>.<setcomp>  s.     %
 %
 %
"&@S@SK@S@S@Sr   N)	r   r1   r,   r   keysjoinsortedr6   r3   )r   r   disabled_code_namesenabled_code_namesvalid_error_code_namesinvalid_code_names_heres         r   process_error_codeszOptions.process_error_codes  s   !$"9:: !788!$[%5%7%7!8!8 !44"## # 	cNaTYYvF]?^?^5_5_aabbb 	!! &
 &
*=&
 &
 &
 	
!! 	   %
 %
*<%
 %
 %
 	
  
 	!!T%==!!!!r   warning_callbackc                   | j         D ]9}|t          t          z  vr |d|            |t          v r |d| d           :d S )NzUnknown incomplete feature: z	Warning: z is already enabled by default)rP   ra   rb   )r   r   r   features       r   process_incomplete_featuresz#Options.process_incomplete_features  sy     5 	V 	VG14EEEEGgGGHHH+++  !TW!T!T!TUUU		V 	Vr   c                P    | j         rd| _        d| _        d S d| _        d| _        d S )NTF)rJ   rQ   rR   r   s    r   process_strict_byteszOptions.process_strict_bytes  s9     	6/3D,04D---/4D,05D---r   changesc                x   t                      }t          || d           |                                D ]\  }}t          |||           |                    d          rd|_        | j                                        |_        | j                                        |_        |j	        D ]C}t          |         }|j                            |           |j                            |           D|j        D ]C}t          |         }|j                            |           |j                            |           D|S )NT)	copy_dictr?   )rd   r   r   setattrgetr|   r6   copyr3   r1   r   adddiscardr,   )r   r  new_optionskeyvaluecode_strr   s          r   apply_changeszOptions.apply_changes  sA   ii[$$????!--// 	- 	-JCKe,,,,;;/00 	A =AK9 ,0+D+I+I+K+K(*.*B*G*G*I*I'#6 	: 	:Hx(D,00666+33D9999#5 	; 	;Hx(D+//555,44T::::r   other_snapshotc                    t                                          |                                                                           t                                          |                                          k    S )a  Compare options in a way that is stable for snapshot() -> apply_changes() roundtrip.

        This is needed because apply_changes() has non-trivial effects for some flags, so
        Options().apply_changes(options.snapshot()) may result in a (slightly) different object.
        )rd   r  r   )r   r  s     r   compare_stablezOptions.compare_stable  sY     II##DMMOO44==??yy&&~66??AAB	
r   c                8   i | _         d | j                                        D             }d | j                                        D             }t          d |D                       }d |D             }|D ]1}| j                            ||                     |          f           2t          |          | _        ||z   D ]?}| 	                    |          }|
                    | j        |                   | j         |<   @| j                            |           d S )Nc                *    g | ]}d |dd         v |S *Nr   r   r   s     r   
<listcomp>z2Options.build_per_module_cache.<locals>.<listcomp>8  s*    !]!]!]sVWX[Y[X[V\}}!}}}r   c                *    g | ]}d |dd         v|S r  r   r  s     r   r  z2Options.build_per_module_cache.<locals>.<listcomp>9  s/    ZZZSTUXVXUXSYHYHY1HYHYHYr   c              3  D   K   | ]}|                     d           |V  dS ).*Nendswithr  s     r   	<genexpr>z1Options.build_per_module_cache.<locals>.<genexpr>:  s3      JJD9I9IJ1JJJJJJr   c                <    g | ]}|                     d           |S )r  r   r  s     r   r  z2Options.build_per_module_cache.<locals>.<listcomp>;  s)    GGG!ajj6F6FGAGGGr   )rl   r   r   r   r   appendcompile_globr   r   clone_for_moduler  update)r   unstructured_glob_keysstructured_keys	wildcardsconcreteglobr  optionss           r   build_per_module_cachezOptions.build_per_module_cache&  sC   !#" "^!]T-D-I-I-K-K!]!]!]ZZd&=&B&B&D&DZZZJJoJJJJJ	GGGGG* 	G 	GD%%tT->->t-D-D&EFFFF  ##9::x' 	^ 	^C ++C00G*1*?*?@WX[@\*]*]D"3'' 	##O44444r   modulec                   | j         |                                  | j         J || j         v r'| j                            |           | j         |         S | }|                    d          }t          t          |          dd          D ]U}d                    |d|         dgz             }|| j         v r)| j                            |           | j         |         } nV|                    d          s\| j	        D ]T\  }}|
                    |          r:| j                            |           |                    | j        |                   }U|S )zCreate an Options object that incorporates per-module options.

        NOTE: Once this method is called all Options objects should be
        considered read-only, else the caching might be incorrect.
        N.r   r  r  r  )rl   r.  r   r  splitrangelenr   r!  r   matchr  r   )r   r/  r-  pathir  patterns          r   r&  zOptions.clone_for_moduleQ  sv    !)'')))%111 T+++ ((000)&11 ||C  s4yy!R(( 	 	A((48se+,,Cd,,,$,,S11105 - t$$ 	R $ 2 R RW==(( R(00555%33D4KC4PQQG r   set[str]c                4    | j                                         S )N)r   r  r   s    r   get_unused_configszOptions.get_unused_configs|  s    #((***r   sPattern[str]c                   |                     d          }|d         dk    rt          j        |d                   nd}|dd          D ]$}||dk    rt          j        d|z             ndz  }%t          j        |dz             S )Nr1  r   r  r  r   z(\..*)?z\Z)r2  reescapecompile)r   r<  partsexprparts        r   r%  zOptions.compile_glob  s     &+Ah#ooryq"""4!""I 	I 	IDTS[[BIcDj)))jHDDz$,'''r   tuple[str, list[object]]c                    g }t           D ]D}t          | |          }|dv rt          d |D                       }|                    |           E| j        |fS )aO  Return (platform, [values...]) for options that affect the cache.

        The list contains values for OPTIONS_AFFECTING_CACHE_NO_PLATFORM
        in sorted attribute name order. Keys are omitted since the cache
        is invalidated when the mypy version changes, and keys are constant
        on any specific mypy version.
        )r6   r3   c                    g | ]	}|j         
S r   )r   r   s     r   r  z:Options.select_options_affecting_cache.<locals>.<listcomp>  s    888Ddi888r   )rT   r   r   r$  rI   )r   resultoptvals       r   select_options_affecting_cachez&Options.select_options_affecting_cache  sq      "6 	 	C$$$CEEE88C88899MM#}f$$r   c                    t                      }t          || j                   t          || j                   t          || j                   |                                S )zReturn opaque bytes with options that can affect dependent modules as well.

        The value can be compared for equality to detect changed options.
        )r   r	   r?   r
   r%   rC   r   )r   r   s     r   dep_import_optionszOptions.dep_import_options  sT    
 mm33444#t*+++35666||~~r   N)re   rf   )re   r   )re   r   )re   r   )re   r   )r   r   re   rf   )r   r   r   r   re   rf   )r  r   re   rd   )r  r   re   r   )r/  r   re   rd   )re   r9  )r<  r   re   r=  )re   rE  )r   r   r   __doc__r   r   r   r   r   r   r  r  r  r  r.  r&  r;  r%  rK  rM  r   r   r   rd   rd   e   si       ''O- O- O- O-b
O O O O	 	 	 		 	 	 	= = = => > > >0V V V V6 6 6 6   4	
 	
 	
 	
)5 )5 )5 )5V) ) ) )V+ + + +( ( ( (% % % % 	 	 	 	 	 	r   rd   )+
__future__r   r   r?  rn   rs   collections.abcr   r   typingr   r   librt.internalr   r	   r
   mypyr   
mypy.cacher   mypy.errorcodesr   r   	mypy.utilr   r   r   rF   r   rS   tupler   rT   rV   rX   rZ   r\   r^   r`   	frozensetra   rb   rd   r   r   r   <module>rY     s   " " " " " " "  				 



     $ $ $ $ $ $               = = = = = = = = = =       ! ! ! ! ! ! 2 2 2 2 2 2 2 2 A A A A A A A A       ) ) )  ) ) ) )X    O!"     ( .3U66:QU_T`:`3a3a-b-b # b b b b ' & & & &    0  0 0 0 0.  . . . .+  + + + +	    &Y(;=My'YZZ  Z Z Z Z$9nf>P%QRR  R R R R} } } } } } } } } }r   