+
    i	\                      a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIHtHtHt ^ RIHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHt ]	P<                  ! ]4      t ]PB                  PE                  R	4      '       d   RXt#RYt$RZt%MR[t#R\t$R]t%]PL                  ! R
4      ]PL                  ! R4      0t']
PP                  R8X  dl   ]'PS                  ]
PT                  PW                  ]PX                  R4      4        ]'PS                  ]
PT                  PW                  ]PZ                  R4      4       ]
PP                  R8X  dX    ]PZ                  t,R]0R&   R R lt1]'PS                  ]1! R4      4       ]Pd                  R^8  d   ]'PS                  ]1! R4      4       ]PL                  ! R4      ]PL                  ! R4      0t3]4Pk                  ]Pl                  R4      t7 ! R R]84      t9R R lt:]3R R llt;R R lt<]R  R! l4       t=R" R# lt>R$ R% lt?R& R' lt@R( R) ltAR* R+ ltBR, R- ltCR. R/ ltDR_R0 R1 lltER`R2 R3 lltFR_R4 R5 lltGR_R6 R7 lltHR`R8 R9 lltIRaR: R; lltJRbR< R= lltKR> R? ltLR@ RA ltMRB RC ltNR`RD RE lltORF RG ltP]! RHRI7      RJ RK l4       tQR_RL RM lltRRN RO ltS]! RHRI7      RP RQ l4       tTRR RS ltURT RU ltVRV RW ltWR#   ]. dJ     ]'PS                  ]
PT                  PW                  ]P^                  R4      4        EL  ]. d      ELi ; ii ; i  ]. d    ]PX                  t, ELi ; i)caV  Python modules manipulation utility functions.

:type PY_SOURCE_EXTS: tuple(str)
:var PY_SOURCE_EXTS: list of possible python source file extension

:type STD_LIB_DIRS: set of str
:var STD_LIB_DIRS: directories where standard modules are located

:type BUILTIN_MODULES: dict
:var BUILTIN_MODULES: dictionary with builtin module names has key
)annotationsN)CallableIterableSequence)redirect_stderrredirect_stdout)	lru_cache)stdlib_module_names)	IS_JYTHON)specutilwinstdlib
platstdlibntdllsposixstrprefixc                    V ^8  d   QhRRRR/#    pathr   return )formats   "2/usr/lib/python3/dist-packages/astroid/modutils.py__annotate__r   R   s     7 7# 7# 7    c                    R \         P                  R,          ,          p\        P                  P	                  \
        W4      # )zpython%d.%d:Nr   N)sysversion_infoosr   joinr   )r   base_pythons   & r   _posix_pathr%   R   s,    #c&6&6r&::ww||FD66r   liblib64purelibplatlibTc                      ] tR t^etRtRtR# )NoSourceFilezZException raised when we are not able to get a python
source file for a precompiled file.
r   N)__name__
__module____qualname____firstlineno____doc____static_attributes__r   r   r   r+   r+   e   s    r   r+   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   k   s     4 4# 4# 4r   c                z    \         P                  P                  \         P                  P                  V 4      4      # )zResolve symlinks in path and convert to absolute path.

Note that environment variables and ~ in the path need to be expanded in
advance.

This can be cached by using _cache_normalize_path.
)r"   r   normcaserealpathr   s   &r   _normalize_pathr7   k   s(     77BGG,,T233r   c               $    V ^8  d   QhRRRRRR/# )r   filenamer   	is_jythonboolr   r   )r   s   "r   r   r   v   s!      # $ s r   c                d    V'       g   V # V P                  R 4      w  r#pV'       d
   VR,           # V # )z	$py.class.py)	partition)r9   r:   headhas_pyclass_s   &&   r   _path_from_filenamerB   v   s1    #--k:Dqe|Or   c               (    V ^8  d   QhRRRRRRRR/# )r   	blacklistSequence[str]dirnames	list[str]	filenamesr   Noner   )r   s   "r   r   r      s,     ' ''(1'>G'	'r   c                |    V  F5  pW19   d   VP                  V4       K  W29   g   K$  VP                  V4       K7  	  R# )zYRemove files/directories in the black list.

dirnames/filenames are usually from os.walk
N)remove)rD   rF   rH   norecurss   &&& r   _handle_blacklistrM      s4     OOH%"X&	 r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s     ! ! ! !r   c                    \        V 4      # N)r7   r6   s   &r   _cache_normalize_path_rQ      s    4  r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s     ( ( ( (r   c                >    V '       g   \        V 4      # \        V 4      # )zNormalize path with caching.)r7   rQ   r6   s   &r   _cache_normalize_pathrT      s    
 t$$!$''r   c                    V ^8  d   QhRRRR/# )r   dotted_namer   r   types.ModuleTyper   )r   s   "r   r   r      s     # #s #/? #r   c           	     H    \         P                  V ,          #   \         d     Mi ; i\        \        P
                  ! 4       4      ;_uu_ 4       p\        \        P
                  ! 4       4      ;_uu_ 4       p\        P                  ! T 4      pRRR4       M  + '       g   i     M; iRRR4       M  + '       g   i     M; iXP                  4       pT'       d   \        P                  RY4       XP                  4       pT'       d   \        P                  RY4       X# )zLoad a Python module from its name.

:type dotted_name: str
:param dotted_name: python name of a module or package

:raise ImportError: if the module or package is not found

:rtype: module
:return: the loaded module
Nz&Captured stderr while importing %s:
%sz&Captured stdout while importing %s:
%s)r    modulesKeyErrorr   ioStringIOr   	importlibimport_modulegetvalueloggererrorinfo)rV   stderrstdoutmodulestderr_valuestdout_values   &     r   load_module_from_namerh      s    {{;''  	&&&&&&((5 	'&&& 	'&&&
 ??$L5{	
 ??$L5{	
 Ms0    '''B37B		B3B'"B33C	c                    V ^8  d   QhRRRR/# )r   partsrE   r   rW   r   )r   s   "r   r   r      s     
2 
2M 
26F 
2r   c                6    \        RP                  V 4      4      # )zLoad a python module from its split name.

:param parts:
  python name of a module or package split on '.'

:raise ImportError: if the module or package is not found

:return: the loaded module
.)rh   r#   )rj   s   &r   load_module_from_modpathrm      s     !%11r   c                    V ^8  d   QhRRRR/# )r   filepathr   r   rW   r   )r   s   "r   r   r      s     - -C -,< -r   c                .    \        V 4      p\        V4      # )zLoad a Python module from it's path.

:type filepath: str
:param filepath: path to the python module or package

:raise ImportError: if the module or package is not found

:rtype: module
:return: the loaded module
)modpath_from_filerm   )ro   modpaths   & r   load_module_from_filers      s      )G#G,,r   c               $    V ^8  d   QhRRRRRR/# )r   r   r   mod_pathrG   r   r;   r   )r   s   "r   r   r      s!     
 
 
	 
d 
r   c                   . pV Fv  pVP                  V4       \        P                  P                  W4      p \	        V 4      '       d   KF  \
        P                  ! RP                  V4      4      pV'       d   Ku   R# 	  R# )z3Check there are some __init__.py all along the way.rl   FT)appendr"   r   r#   	_has_initr   is_namespace)r   ru   rr   partold_namespaces   &&   r   check_modpath_has_initr|      s^    Gtww||D' --chhw.?@M =  r   c               $    V ^8  d   QhRRRRRR/# )r   r   r   baser   r;   r   )r   s   "r   r   r      s!     	 	c 	 	 	r   c                   \         P                  P                  \         P                  P                  V 4      4      p \         P                  P                  \         P                  P                  V4      4      pV P	                  V4      '       g   R # \        V 4      \        V4      8H  ;'       g    V \        V4      ,          \         P                  P                  8H  ;'       gf    VP                  \         P                  P                  4      ;'       d5    V \        V4      ^,
          ,          \         P                  P                  8H  # F)r"   r   r4   normpath
startswithlensependswith)r   r~   s   &&r   _is_subpathr      s    77BGG,,T23D77BGG,,T23D??4  	Tc$i	 	O 	OTOrww{{*	O 	OMM"''++&MM4D	A+>"''+++Mr   c               $    V ^8  d   QhRRRRRR/# )r   r9   r   path_to_checkr   list[str] | Noner   )r   s   "r   r   r      s"      c # BR r   c                   \         P                  P                  \         P                  P                  V4      4      p\         P                  P	                  V 4      p\        W!4      '       d   \         P                  P                  V4      ^ ,          pV\        V4      R P                  \         P                  P                  4      pVP                  \         P                  4       Uu. uF  qU'       g   K  VNK  	  up# \         P                  P                  V 4      p\        Wa4      '       d   \         P                  P                  V4      ^ ,          pV\        V4      R P                  \         P                  P                  4      pVP                  \         P                  4       Uu. uF  qU'       g   K  VNK  	  up# R# u upi u upi )a  Extracts the relative mod path of the file to import from.

Check if a file is within the passed in path and if so, returns the
relative mod path from the one passed in.

If the filename is no in path_to_check, returns None

Note this function will look for both abs and realpath of the file,
this allows to find the relative base path even if the file is a
symlink of a file in the passed in path

Examples:
    _get_relative_base_path("/a/b/c/d.py", "/a/b") ->  ["c","d"]
    _get_relative_base_path("/a/b/c/d.py", "/dev") ->  None
N)r"   r   r4   r   abspathr   splitextr   lstripr   splitr5   )r9   r   abs_filename	base_pathrelative_base_pathpkgreal_filenames   &&     r   _get_relative_base_pathr      sD     GG$$RWW%5%5m%DEM77??8,L<//GG$$\215	&s='9';<CCBGGKKP177?G?3?GGGG$$X.M=00GG$$]3A6	&s='9';<CCBGGKKP177?G?3?GG H Hs   )	G7G,	G
:G
c               (    V ^8  d   QhRRRRRRRR/# )	r   r9   r   r   r   is_package_cbz'Callable[[str, list[str]], bool] | Noner   rG   r   )r   s   "r   r   r     s0      
 ; 	r   c                   \         P                  P                  \        V 4      4      p \        P                  P                  4       pV'       d	   W,           p\        P                  ! V\        \        V4      4       F=  pV'       g   K  \        W4      pV'       g   K"  Vf   Q hV! WER R 4      '       g   K;  Vu # 	  \        RP                  V RP                  V4      4      4      h)Nz"Unable to find module for {} in {}z, 
)r"   r   
expanduserrB   r    copy	itertoolschainmaprT   r   ImportErrorr   r#   )r9   r   r   paths_to_checkpathnamerr   s   &&&   r   modpath_from_file_with_callbackr     s    
 ww!!"5h"?@HXX]]_N.OO1>B )(=(((3B<00N ,33fkk.1	
 r   c               $    V ^8  d   QhRRRRRR/# )r   r9   r   r   r   r   rG   r   )r   s   "r   r   r   4  s'     S S S+; Sy Sr   c                "    \        W\        4      # )a  Get the corresponding split module's name from a filename.

This function will return the name of a module or package split on `.`.

:type filename: str
:param filename: file's path for which we want the module's name

:type Optional[List[str]] path:
  Optional list of paths where the module or package should be
  searched, additionally to sys.path

:raise ImportError:
  if the corresponding module's name has not been found

:rtype: list(str)
:return: the corresponding split module's name
)r   r|   )r9   r   s   &&r   rq   rq   4  s    $ +8;QRRr   c               (    V ^8  d   QhRRRRRRRR/# )r   rr   rG   r   Sequence[str] | Nonecontext_file
str | Noner   r   )r   s   "r   r   r   I  s6     H HH
H H 	Hr   c                .    \        WV4      P                  # rP   )file_info_from_modpathlocation)rr   r   r   s   &&&r   file_from_modpathr   I  s    
 "'>GGGr   c               (    V ^8  d   QhRRRRRRRR/# )	r   rr   rG   r   r   r   r   r   spec.ModuleSpecr   )r   s   "r   r   r   Q  s0     06 0606
06 06 	06r   c                   Ve!   \         P                  P                  V4      pMTpV ^ ,          R8X  d    \        R.V R,          OW4      # V RR.8X  dJ   \
        P                  ! R\         P                  P                  \
        P                  P                  R7      # \        WV4      #   \         d    \        YT4      u # i ; i)a,  Given a mod path (i.e. split module / package name), return the
corresponding file.

Giving priority to source file over precompiled file if it exists.

:param modpath:
  split module's name (i.e name of a module or package split
  on '.')
  (this means explicit relative imports that start with dots have
  empty strings in this list!)

:param path:
  optional list of path where the module or package should be
  searched (use sys.path if nothing or None is given)

:param context_file:
  context file to consider, necessary if the identifier has been
  introduced using a relative import unresolvable in the actual
  context (i.e. modutils)

:raise ImportError: if there is no such module in the directory

:return:
  the path to the module's file or None if it's an integrated
  builtin module such as 'sys'
xml_xmlplus   NNr"   r   os.path)namer   type)
r"   r   dirname_spec_from_modpathr   r   
ModuleSpec__file__
ModuleType	PY_SOURCE)rr   r   r   contexts   &&& r   r   r   Q  s    >  ggool;qzU	>%z&@GBK&@$PP 
T6N	"WW%%**
 	

 gW55  	>%gW==	>s   B* *CCc               $    V ^8  d   QhRRRRRR/# )r   rV   r   r   r   r   r   )r   s   "r   r   r     s!     : : :J :# :r   c           	        V P                  R4      '       d   R# V P                  R4      pVe7   V^ ,          \        9   d%   \        V4      ^8  d   \	        V 4      hV^ ,          # Rp^ pV^ ,          R8X  d   Vf   Q R4       h. p^pV\        V4      8  dC   W$,          R8X  d6   V^,          pVf   Q R4       h\
        P                  P                  V4      pKR  \        V\        V4      4       F  p \        W$V^,            W1R7       K  	  V #   \         d<    T\        ^\        T4      ^,
          4      8  d   h RP                  TRT 4      u u # i ; i)au  Given a dotted name return the module part of the name :

>>> get_module_part('astroid.as_string.dump')
'astroid.as_string'

:param dotted_name: full name of the identifier we are interested in

:param context_file:
  context file to consider, necessary if the identifier has been
  introduced using a relative import unresolvable in the actual
  context (i.e. modutils)

:raise ImportError: if there is no such module in the directory

:return:
  the module part of the name or None if we have not been able at
  all to import the given name

XXX: deprecated, since it doesn't handle package precedence over module
(see #10066)
r   rl   N z.explicit relative import, but no context_file?)r   r   )r   r   BUILTIN_MODULESr   r   r"   r   r   ranger   maxr#   )rV   r   rj   r   startiis   &&    r   get_module_partr     sN   . i((c"E 8&5zA~!+..8O!DFQx2~$	<;	<$
3u:
%-2"5!$	<;	<$ww|463u:&	'q1u%D ' 	  	'3q#e*q.))88E"1I&&	's   1DAEEc               (    V ^8  d   QhRRRRRRRR/# )	r   src_directoryr   rD   rE   list_allr;   r   rG   r   )r   s   "r   r   r     s,         #0 <@  r   c                Z   . p\         P                  ! V 4       F  w  rEpWA9   d   K  \        WV4       V'       g!   RR0P                  V4      '       d   RVR&   KB  V FF  p\	        V4      '       g   K  \         P
                  P                  WG4      pVP                  V4       KH  	  K  	  V# )a  Given a package directory return a list of all available python
module's files in the package and its subpackages.

:param src_directory:
  path of the directory corresponding to the package

:param blacklist: iterable
  list of files or directories to ignore.

:param list_all:
    get files from all paths, including ones without __init__.py

:return:
  the list of all available python module's files in the package and
  its subpackages
z__init__.pyz__init__.pyi:NNNr   )r"   walkrM   
isdisjoint_is_python_filer   r#   rw   )	r   rD   r   files	directoryrF   rH   r9   srcs	   &&&      r   get_module_filesr     s    & E*,''-*@&	Y!)y9]N;FFyQQHQK!Hx((ggll97S! " +A Lr   c               (    V ^8  d   QhRRRRRRRR/# )r   r9   r   include_no_extr;   prefer_stubsr   r   )r   s   "r   r   r     s,     ! !!#'!?C!!r   c                H   \         P                  P                  \        V 4      4      p \         P                  P	                  V 4      w  r4VP                  R4      pV\        9  d2   \         P                  P                  V RV 24      '       d   V RV 2# V'       d   \        M\         F3  pV RV 2p\         P                  P                  V4      '       g   K1  Vu # 	  V'       d0   V'       g(   \         P                  P                  V4      '       d   V# \        V 4      h)aW  Given a python module's file name return the matching source file
name (the filename will be returned identically if it's already an
absolute path to a python source file).

:param filename: python module's file name

:raise NoSourceFile: if no source file exists on the file system

:return: the absolute path of the source file if it exists
rl   )
r"   r   r   rB   r   r   PY_SOURCE_EXTSexistsPY_SOURCE_EXTS_STUBS_FIRSTr+   )r9   r   r   r~   orig_extextsource_paths   &&&    r   get_source_filer     s     ww28<=HWW%%h/NDs#H~%"''..D68*9M*N*Nq
##-9)~Mauo77>>+&& N h277>>$+?+?
x
  r   c                    V ^8  d   QhRRRR/# )r   r9   r   r   r;   r   )r   s   "r   r   r     s     ? ?z ?d ?r   c                ~    V '       g   R# \         P                  P                  V 4      ^,          R,          \        9   # )z5Return: True if the filename is a python source file.Fr   )r"   r   r   r   r9   s   &r   is_python_sourcer     s,    77H%a(,>>r   c                    V ^8  d   QhRRRR/# )r   modnamer   r   r;   r   )r   s   "r   r   r     s     8 8c 8d 8r   c                @    V P                  R4      ^ ,          \        9   # )z6Return: True if the modname is in the standard libraryrl   )r   r	   )r   s   &r   is_stdlib_moduler     s    ==a $777r   c               $    V ^8  d   QhRRRRRR/# )r   r   r   r   zstr | Iterable[str]r   r;   r   )r   s   "r   r   r     s'     T TC T': Tt Tr   c                h  a V P                  R4      ^ ,          p  \        V .4      oSf   R# \        S4      o\	        T\
        4      '       d   SP                  \        T4      4      # \        ;QJ d    T3R lT 4       F  '       g   K   R# 	  R# ! T3R lT 4       4      #   \         d     R# i ; i)zTry to determine if a module is imported from one of the specified paths

:param modname: name of the module

:param path: paths to consider

:return:
  true if the module:
  - is located on the path listed in one of the directory in `paths`
rl   Fc              3  X   <"   T F  pSP                  \        V4      4      x  K!  	  R # 5irP   r   rT   ).0entryr9   s   & r   	<genexpr>!module_in_path.<locals>.<genexpr>&  s%     SdUx""#8#?@@d   '*T)	r   r   r   r7   
isinstancer   r   rT   any)r   r   r9   s   &&@r   module_in_pathr     s     mmC #G$gY/
 x(H$""#8#>??3SdS33S3S3SdSSS  s   B" "B10B1c               $    V ^8  d   QhRRRRRR/# )r   r   r   std_pathzIterable[str] | Noner   r;   r   )r   s   "r   r   r   )  s'     &V &V &V/C &Vt &Vr   c                  a \         P                  ! R\        ^R7       V P                  R4      ^ ,          p  \	        V .4      oSf   \        P                  ! T 4      '       * # \        S4      o\         F&  pSP                  \        T4      4      '       g   K%   R# 	  Tf   \        p\        ;QJ d    T3R lT 4       F  '       g   K   R# 	  R# ! T3R lT 4       4      #   \
         d     R# i ; i)a\  Try to guess if a module is a standard python module (by default,
see `std_path` parameter's description).

:param modname: name of the module we are interested in

:param std_path: list of path considered has standard

:return:
  true if the module:
  - is located on the path listed in one of the directory in `std_path`
  - is a built-in module
zWis_standard_module() is deprecated. Use, is_stdlib_module() or module_in_path() instead)
stacklevelrl   Fc              3  X   <"   T F  pSP                  \        V4      4      x  K!  	  R # 5irP   r   )r   r   r9   s   & r   r   %is_standard_module.<locals>.<genexpr>O  s%     UHDx""#8#>??Hr   T)warningswarnDeprecationWarningr   r   r   r   ry   r7   EXT_LIB_DIRSr   rT   STD_LIB_DIRSr   )r   r   r   r9   s   && @r   is_standard_moduler   )  s     MMa mmC #G$gY/ $$W---x(H4T:;;  3UHU33U3U3UHUUU!   s   C" "C10C1c               $    V ^8  d   QhRRRRRR/# )r   r   r   	from_filer   r;   r   )r   s   "r   r   r   R  s!         r   c           	     P   \         P                  P                  V4      '       g    \         P                  P                  V4      pV\        P                  9   d   R# \        \        P                  P                  P                  V P                  R^R7      ^ ,          V.4      4      # )a  Return true if the given module name is relative to the given
file name.

:param modname: name of the module we are interested in

:param from_file:
  path of the module from which modname has been imported

:return:
  true if the module has been imported relatively to `from_file`
Frl   )maxsplit)r"   r   isdirr   r    r;   r]   	machinery
PathFinder	find_specr   )r   r   s   &&r   is_relativer  R  sx     77==##GGOOI.	CHH&&00MM#M*1-	{	
 r   i   )maxsizec                    V ^8  d   QhRRRR/# )r   r   zstr | os.PathLike[str]r   r;   r   )r   s   "r   r   r   j  s         6  4  r   c                @    \         P                  P                  V 4      # )zBA cached version of os.path.isfile that helps avoid repetitive I/O)r"   r   isfiler6   s   &r   cached_os_path_isfiler	  i  s     77>>$r   c               (    V ^8  d   QhRRRRRRRR/# )	r   rr   rG   r   r   r   r   r   r   r   )r   s   "r   r   r   r  s0     & &&
& & 	&r   c                   V '       g   Q hRpVe&    \         P                  ! W.4      pVP                  pM\         P                  ! W4      pVP                  \         P
                  P                  8X  dR    VP                  f   Q h\        VP                  4      pVP                  V\         P
                  P                  R7      # VP                  \         P
                  P                  8X  d   VP                  RR7      # VP                  \         P
                  P                  8X  dQ   VP                  f   Q h\        VP                  4      pVP                  V\         P
                  P                  R7      # V#   \         d'    \         P                  ! Y4      pTP                  p EL`i ; i  \         d    TP                  TR7      u # i ; i)zGiven a mod path (i.e. split module / package name), return the
corresponding spec.

this function is used internally, see `file_from_modpath`'s
documentation for more information
N)r   r   )r   )r   r  r   r   r   r   PY_COMPILEDr   _replacer   r+   	C_BUILTINPKG_DIRECTORYrx   )rr   r   r   r   
found_specs   &&&  r   r   r   r  s    N7H	+;J!**H
 ^^G2
$//555	:&&222&z':':;H&&!(A(A '  
 
DOO55	5""D"11	DOO99	9""...Z001""H4??;T;T"UU+  	+6J!**H	+  	:&&&99	:s$   #E< 6AF0 <-F-,F-0GGc                    V ^8  d   QhRRRR/# )r   r9   r   r   r;   r   )r   s   "r   r   r     s     E Ec Ed Er   c                $    V P                  R4      # )zdReturn true if the given filename should be considered as a python file.

.pyc and .pyo are ignored
)r=   z.pyiz.soz.pydz.pyw)r   r   s   &r   r   r     s    
 CDDr   c                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   r     s        r   c                    \         P                  P                  V R4      p. \        ORNRN FH  p\         P                  P	                  VR,           V,           4      '       g   K8  VR,           V,           u # 	  R# )zUIf the given directory has a valid __init__ file, return its path,
else return None.
__init__pycpyorl   N)r"   r   r#   r   r   )r   mod_or_packr   s   &  r   rx   rx     sc    
 '',,y*5K....77>>++c122$s** / r   c                    V ^8  d   QhRRRR/# r   specobjr   r   r;   r   )r   s   "r   r   r     s     8 8/ 8d 8r   c                P    V P                   \        P                  P                  8H  # rP   )r   r   r   PY_NAMESPACEr  s   &r   ry   ry     s    <<4??7777r   c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   r     s     9 9/ 9d 9r   c                P    V P                   \        P                  P                  8H  # rP   )r   r   r   r  r  s   &r   is_directoryr!    s    <<4??8888r   c               $    V ^8  d   QhRRRRRR/# )r   module_namer   package_whitelistzset[str]r   r;   r   )r   s   "r   r   r     s$      )1	r   c           	       aa V P                  R4      o\        ;QJ d:    VV3R l\        ^\        S4      ^,           4       4       F  '       g   K   R# 	  R# ! VV3R l\        ^\        S4      ^,           4       4       4      # )z
Returns True if one part of the module name is in the package whitelist.

>>> is_module_name_part_of_extension_package_whitelist('numpy.core.umath', {'numpy'})
True
rl   c              3  R   <"   T F  pR P                  SRV 4      S9   x  K  	  R# 5i)rl   N)r#   )r   xr$  rj   s   & r   r   Eis_module_name_part_of_extension_package_whitelist.<locals>.<genexpr>  s*      :RQr00:Rs   $'TF)r   r   r   r   )r#  r$  rj   s   &f@r   2is_module_name_part_of_extension_package_whitelistr)    sp     c"E3 :?3u:PQ>:R33 3 3 :?3u:PQ>:R  r   )pypywpyi)r,  r+  r*  )dllpyd)r*  r,  )r,  r*  )sol        )NNrP   r   )FF)X__conditional_annotations__r0   
__future__r   r]   importlib.machineryimportlib.utilr[   r   loggingr"   r    	sysconfigtypesr   collections.abcr   r   r   
contextlibr   r   	functoolsr   r	   astroid.constr
   astroid.interpreter._importr   r   	getLoggerr,   r`   platformr   r   r   PY_COMPILED_EXTSget_pathr   r   addr   r#   r   real_prefixAttributeErrorbase_exec_prefix__annotations__r%   r  r   dictfromkeysbuiltin_module_namesr   	Exceptionr+   r7   rB   rM   rQ   rT   rh   rm   rs   r|   r   r   r   rq   r   r   r   r   r   r   r   r   r   r  r	  r   r   rx   ry   r!  r)  )r0  s   @r   <module>rI     s  

 #    	   	 
    8 8 7  # # 2			8	$ <<5!!)N!5%"N!.
 ""8,i.@.@.NO77d?RWW\\#**f56
 	coov>? 77g
oo%7 ['(
{{U 	W-.""9-y/A/A)/LM-- 8 8$?9 4 :C ' ! !(#L
2-
	B8S*H06f:z F!6?8
T<&VR. 4   &RE 4 89q  	RWW\\#*>*>GH 		   s<   5K  L3  L0(5L  L,'L0+L,,L03M
	M
