
    <BhF                       S r SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SS	KJrJr  SS
KJrJr  SSKJr  SSKJrJrJrJr  SSKJrJr  SSKJr  SSKJ r J!r!J"r"J#r#  SSK$J%r%  SSK&J'r'  SSK(J)r)  \
(       a  SSK*r*SSK+J,r,  SSK-J.r.  SSK	J/r/J0r0  \" \15      r2/ r3\" SSSS9S7S j5       r4 " S S\5      r5 " S S \55      r6\" S!5      \" S"SS#S9S$S%SS&S&SS\Rn                  S'   4                 S8S( jj5       5       r8\" S"SS#S9S&S\Rn                  S'   4         S9S) jj5       r9S:S* jr:\" S"SS+S9      S;S, j5       r;\" S"SS+S9S<S- j5       r<\" S"SS.S9 S=       S>S/ jj5       r=\" S"SS0S9/ 4     S?S1 jj5       r>\" S"SS+S9S@S2 j5       r?SAS3 jr@    SB         SCS4 jjrA\" S"SS5S9            SDS6 j5       rBg)Ez%Tools for fetching the current index.    )annotations)UserDict)chain)	getLogger)TYPE_CHECKING)
IndexedSet   )contextvalidate_channels)ThreadLimitedThreadPoolExecutortime_recorder)
deprecated)CondaKeyErrorInvalidSpecOperationNotAllowedPackagesNotFoundError)Channelall_channel_urls	MatchSpec)
EMPTY_LINKPackageCacheRecordPackageRecordPrefixRecord   )PackageCacheData)
PrefixData)
SubdirDataN)Iterable)Path)AnySelfz25.9z26.3z3Use `conda.base.context.validate_channels` instead.)addendumc                    [        U 5        g)a
  
Check if the given channel URLs are allowed by the context's allowlist.
:param channel_urls: A list of channel URLs to check against the allowlist.
:raises ChannelNotAllowed: If any URL is not in the allowlist.
:raises ChannelDenied: If any URL is in the denylist.
N)r   )channel_urlss    0lib/python3.13/site-packages/conda/core/index.pycheck_allowlistr'   *   s     l#    c            	         \ rS rSrSrSSSSSSS\R                  S   S4	                   SS jjr\SS	 j5       r	\SS
 j5       r
\SS j5       rSSSSS.         S S jjrS!S jrS"S jr\SS j5       r\R                   S#S j5       rS$S jrS$S jrS$S jrS%S jrS&S jr      S'S jr      S'S jrS(S jrS)S jrS*S jrSrg)+Index9   a  The ``Index`` provides information about available packages from all relevant sources.

There are four types of sources for package information, namely

Channels
    represent packages available from standard sources identified with a url, mostly online,
    but can also be on a local filesystem using the ``file://`` scheme.
    Programatically, channels are represented by :class:`conda.models.channel.Channel`, their data
    is fetched using :class:`conda.core.subdir_data.SubdirData`.

    For more information see :ref:`concepts-channels`.

    Individual packages from channels are usually represented by :class:`conda.models.records.PackageRecord`.

Prefix
    represents packages that are already installed. Every :class:`Index` can be associated
    with exactly one Prefix, which is the location of one of the conda :ref:`concepts-conda-environments`.
    The package information about the installed packages is represented by :class:`conda.core.prefix_data.PrefixData`.

    Individual packages from prefixes are usually represented by :class:`conda.models.records.PrefixRecord`.

Package Cache
    represents packages that are locally unpacked, but may not be installed in the environment
    associated with this index. These are usually packages that have been installed in any environment
    of the local conda installation, but may have been removed from all environments by now.

    Individual packages from the package are usually represented by :class:`conda.models.records.PackageCacheRecord`.

Virtual Packages
    represent properties of the system, not actual conda packages in the normal sense. These are,
    for example, system packages that inform the solver about the operating system in use, or
    track features that can be used to steer package priority.

    Individual virtual packages are represented by special :class:`conda.models.records.PackageRecord`,
    see :meth:`conda.models.records.PackageRecord.virtual_package` and
    :meth:`conda.models.records.PackageRecord.feature`.
 TNFc
           	        [        U5      nU(       a  S/UQnU(       a  U[        R                  -  n[        U5      U l        U(       a  U(       a  [
        R                  SXC5        OUb  US4O[        R                  nX@l        Xl	        0 U l        [        5       U l
        U R                   Hy  n
[        U
5      R                  SU5      nUVs/ s H  n[        U5      PM     nnUVs/ s H  n[        XS9PM     snU R                  U
'   U R                  R                  U5        M{     [        R!                  5         [        R#                  U R                  5        Uc  SU l        O,['        U[(        5      (       a  Xpl        O[)        U5      U l        Uc  [        R*                  (       a  SOUU l        Xl        gs  snf s  snf )a0  Initializes a new index with the desired components.

Args:
  channels: channels identified by canonical names or URLS or Channel objects;
    for more details, see :meth:`conda.models.channel.Channel.from_value`
  prepend: if ``True`` (default), add configured channel with higher priority than passed channels;
    if ``False``, do *not* add configured channels.
  platform: see ``subdirs``.
  subdirs: platform and subdirs determine the selection of subdirs in the channels;
    if both are ``None``, subdirs is taken from the configuration;
    if both are given, ``subdirs`` takes precedence and ``platform`` is ignored;
    if only ``platform`` is given, subdirs will be ``(platform, "noarch")``;
    if ``subdirs`` is given, subdirs will be ``subdirs``.
  use_local: if ``True``, add the special "local" channel for locally built packages with lowest priority.
  use_cache: if ``True``, add packages from the package cache.
  prefix: associate prefix with this index and add its packages.
  repodata_fn: filename of the repodata, default taken from config, almost always "repodata.json".
  use_system: if ``True``, add system packages, that is virtual packages defined by plugins, usually used
    to make intrinsic information about the system, such as cpu architecture or operating system, available
    to the solver.
localz#subdirs is %s, ignoring platform %sNnoarchTrepodata_fn)listr
   channelsr   	_channelslogwarningsubdirs_subdirs_repodata_fnexpanded_channelsr   urlsr   updateLAST_CHANNEL_URLSclearextendprefix_data
isinstancer   offline	use_cache
use_system)selfr4   prependplatformr8   	use_localrD   prefixr2   rE   channelr<   urlr;   expanded_channels                  r&   __init__Index.__init__`   sz   B >+(+H(((H#H-A7U.6.Bx*G'!+~~G7#((w7D9= ># > ):&(9$ +E(9&DMM'" ""))*;< & 	!  !7!78>#D
++%)&1D!*!2wI$! !?&s   F;'G c                p     U R                   $ ! [         a    U R                  SS9   U R                   $ f = f)zdContents of the package cache if active.

Returns:
  All packages available from the package cache.
T)cache)_cache_entriesAttributeErrorreloadrF   s    r&   cache_entriesIndex.cache_entries   s<    	$&&& 	$KKdK#"""	$    55c                p     U R                   $ ! [         a    U R                  SS9   U R                   $ f = f)zrSystem packages provided by plugins.

Returns:
  Identity mapping of the available system packages in a ``dict``.
T)system)_system_packagesrS   rT   rU   s    r&   system_packagesIndex.system_packages   s<    	%((( 	%KKtK$$$$	%rX   c                p     U R                   $ ! [         a    U R                  SS9   U R                   $ f = f)zeActive tracking features.

Returns:
  Identity mapping of the local tracking features in a ``dict``.
T)features)	_featuresrS   rT   rU   s    r&   r_   Index.features   s8    	'>>! 	'KKK&~~	'rX   )rJ   rQ   r_   rZ   c                  [        U S5      nU(       aB  U R                  (       a  U R                  R                  5         U(       a  U R                  5         U(       a1  [        R
                  " 5       U l        U(       a  U R                  5         U(       ag  [        R                  Vs0 s H  n[        R                  " U5      =ow_M     snU l        U(       a%  U R                  R                  U R                  5        U(       aa  [        R                   R#                  5       Vs0 s H  nX_M     snU l        U(       a&  U R                  R                  U R&                  5        gggs  snf s  snf )aw  Reload one or more of the index components.

Can be used to refresh the index with new information, for example after a new
package has been installed into the index.

Args:
  prefix: if ``True``, reload the prefix data.
  cache: if ``True``, reload the package cache.
  features: if ``True``, reload the tracking features.
  system: if ``True``, reload the system packages.
_dataN)hasattrrA   rT   "_supplement_index_dict_with_prefixr   get_all_extracted_entriesrR   !_supplement_index_dict_with_cacher
   track_featuresr   featurer`   rc   r=   r_   plugin_managerget_virtual_package_recordsr[   r\   )	rF   rJ   rQ   r_   rZ   has_datatrack_featurerecpackages	            r&   rT   Index.reload   s    & 4)  '')779"2"L"L"ND668 &-%;%;%;M &--m<<B%;DN 

!!$--0  '55QQS%SG  S%D! 

!!$"6"67  %s   &"E%"E*c                    SR                  U R                  R                  5       5      nSU R                  R                   SU S3$ )N, <z(channels=[])>)joinr4   keys	__class____name__rF   r4   s     r&   __repr__Index.__repr__   s=    99T]]//124>>**+;xjDDr(   c                    [        UU R                  SU R                  SU R                  U R                  U R
                  U R                  S9	$ )a%  Create a reduced index with a subset of packages.

Can be used to create a reduced index as a subset from an existing index.

Args:
  specs: the specs that span the subset.

Returns:
  a reduced index with the same sources as this index, but limited to ``specs``
  and their dependency graph.
F)	specsr4   rG   r8   rI   rD   rJ   r2   rE   )ReducedIndexr5   r9   rD   rA   r:   rE   )rF   r}   s     r&   get_reduced_indexIndex.get_reduced_index   sH     ^^MMnn##))

 
	
r(   c                t     U R                   $ ! [         a    U R                  5         U R                   s $ f = f)a  The entire index as a dict; avoid if possible.

Warning:
  This returns the entire contents of the index as a single identity mapping in
  a ``dict``. This may be convenient, but it comes at a cost because all sources
  must be fully loaded at significant overhead for :class:`~conda.models.records.PackageRecord`
  construction for **every** package.

  Hence, all uses of :attr:`data`, including all iteration over the entire index,
  is strongly discouraged.
)rc   rS   _realizerU   s    r&   data
Index.data  s3    	:: 	MMO::	s    &77c                    Xl         g N)rc   )rF   values     r&   r   r   &  s    
r(   c                   U R                   c  gU R                   R                  5        H  nXR                  ;   a  U R                  U   nUR                  UR                  :X  aB  UR	                  S5      =(       d    [
        n[        R                  " X!US9U R                  U'   M}  UR                  nUR                  5       Ul	        U?
XR                  U'   M  XR                  U'   M     g)z8
Supplement the index with information from its prefix.
Nlinkr   )rA   iter_recordsrc   rK   getr   r   from_objectsrL   _Channel__canonical_name_PackageRecord__pkey)rF   prefix_recordcurrent_recordr   prefix_channels        r&   re   (Index._supplement_index_dict_with_prefix*  s     # "--::<M

*!%M!:!))]-B-BB ),,V4B
D0<0I0I&D1DJJ}- &3%:%:N>L>P>P>RN;%:0=JJ}- -:

=)= =r(   c                    U R                    HT  nXR                  ;   a4  U R                  U   n[        R                  " X!5      U R                  U'   MF  XR                  U'   MV     g r   )rV   rc   r   r   )rF   pcrecr   s      r&   rg   'Index._supplement_index_dict_with_cacheR  sT    ''E

"!%E!2$6$C$C"%

5! %*

5! (r(   c                   0 U l         U R                  R                  5        H;  nU H2  nU R                   R                  S UR	                  5       5       5        M4     M=     U R                  5         U R                  (       a  U R                  5         U R                   R                  U R                  5        U R                  (       a&  U R                   R                  U R                  5        g g )Nc              3  (   #    U  H  oU4v   M
     g 7fr   r,   ).0precs     r&   	<genexpr>!Index._realize.<locals>.<genexpr>b  s     !V;U4,;U   )rc   r4   valuesr=   r   re   rD   rg   r_   rE   r\   )rF   subdir_datassubdir_datas      r&   r   Index._realize^  s    
 MM002L+

!!!V;;S;S;U!VV  , 3 	//1>>224

$--(??JJd223 r(   c                V   [        U R                  R                  5       5       H  nU Hy  nUR                  UR                  R                  :w  a  M)  [        UR                  U5      5      nU(       d  ML  [        U5      S:  a  [        US5      eUS   nU(       d  Mu  Us  s  $    M     g )Nr   z1More than one matching package found in channels.r   )	reversedr4   r   subdirrK   r3   querylenr   )rF   keyr   r   prec_candidatesr   s         r&   _retrieve_from_channelsIndex._retrieve_from_channelsj  s    $T]]%9%9%;<L+::!4!4!;!;;"&{'8'8'=">&'!+'P  'q)4K  , = r(   c                   / n[        U R                  R                  5       5       Hc  nU HZ  n[        US5      (       a&  UR                  UR
                  R                  :w  a  M:  UR                  UR                  U5      5        M\     Me     U$ )Nr   )r   r4   r   rd   r   rK   r@   r   )rF   r   precsr   r   s        r&   _retrieve_all_from_channels!Index._retrieve_all_from_channels{  sr    $T]]%9%9%;<L+3))cjjK<O<O<V<V.V[..s34  , =
 r(   c                   U R                   (       a&  U R                   R                  UR                  S 5      OS nU(       a  X2:X  a  U(       aw  UR                  UR                  :X  a5  UR                  S5      =(       d    [        n[
        R                  " X#US9nU$ UR                  nUR                  5       Ul        U?	Un U$ UnU$ )Nr   r   )
rA   r   namerK   r   r   r   rL   r   r   )rF   r   r   prefix_precr   r   s         r&   _update_from_prefixIndex._update_from_prefix  s     ?C>N>Nd&&**388T:TX;.<<;#6#66&??62@jD'44TTRD  &1%8%8N>L>P>P>RN;#8&D  #r(   c                |    U R                    H+  nX1:X  d  M
  U(       a  [        R                  " X#5      s  $ Us  $    U$ r   )rV   r   r   )rF   r   r   r   s       r&   _update_from_cacheIndex._update_from_cache  s9     ''E|-::4GG L ( r(   c                @   [        U[        5      (       d  [        S[        U5      5      e U R                  U   $ ! [
         a     Of = fUR                  R                  S5      (       a    U R                  U   $ ! [         a     Of = fUR                  R                  S5      (       a    U R                  U   $ ! [         a     Of = fU R                  U5      nU R                  X5      nU R                  (       a  U R                  X5      nUc  [        U45      eU$ )Nz0Can only retrieve PackageRecord objects. Got {}.__@)rB   r   	TypeErrortyperc   rS   r   
startswithr\   KeyErrorendswithr_   r   r   rD   r   )rF   r   r   s      r&   __getitem__Index.__getitem__  s   #}--BDI 	::c?" 		88t$$++C00 88S!!}}S)) ++C0''2>>**35D<C6""s3   ; 
AA,A; ;
BB,B; ;
CCc                :     X   ng! [         [        4 a     gf = f)NTF)r   r   )rF   r   _s      r&   __contains__Index.__contains__  s(    		A%x0 		s    c                   U R                   R                  U R                   5      nUR                  R                  U R                  5        SU R                  ;   a*  U R                  S   R	                  5       UR                  S'   U$ )Nrc   )rw   __new____dict__r=   copy)rF   insts     r&   __copy__Index.__copy__  sa    ~~%%dnn5T]]+dmm#%)]]7%;%@%@%BDMM'"r(   )rR   r5   rc   r`   r:   r9   r[   r4   r;   rA   rD   rE   )r4   Iterable[str | Channel]rG   boolrH   
str | Noner8   tuple[str, ...] | NonerI   r   rD   bool | NonerJ   1str | os.PathLike[str] | Path | PrefixData | Noner2   r   rE   r   returnNone)r   ztuple[PackageCacheRecord, ...])r   "dict[PackageRecord, PackageRecord])
rJ   r   rQ   r   r_   r   rZ   r   r   r   r   str)r}   Iterable[MatchSpec]r   r~   )r   r   r   r   r   r   )r   r   r   PackageRecord | None)r   r   r   zlist[PackageRecord])r   r   r   r   r   r   )r   r   r   r   )r   r   r   r   )r   r"   )rx   
__module____qualname____firstlineno____doc__r
   repodata_fnsrN   propertyrV   r\   r_   rT   rz   r   r   setterre   rg   r   r   r   r   r   r   r   r   __static_attributes__r,   r(   r&   r*   r*   9   s   $P -/#*.!%DH")"6"6r": B%)B% B% 	B%
 (B% B% B% BB%  B% B% 
B%H 
# 
# 
% 
% 
 
 *8 *8 	*8
 *8 *8 
*8XE
0  $ 
[[ &:P
*
4" (<	$
 
(<
	
6r(   r*   c            	         ^  \ rS rSrSrSSSSSSS\R                  S   S4	                     SU 4S jjjrSS	 jrSS
 jr	Sr
U =r$ )r~   i  a  Index that contains a subset of available packages.

Like :class:`Index`, this makes information about packages from the same four
sources available. However, the contents of the reduced index is limited to
a subset of packages relevant to a given specification.
This works by taking into account all packages that match the given specification
together with their dependencies and their dependencies dependencies, etc.

Note:
    See :meth:`Index.get_reduced_index` for convenient construction.
r,   TNFr-   c                `   > [         TU ]  UUUUUUUU	U
5	        Xl        U R                  5         g)zInitialize a new reduced index.

Args:
  specs: the collection of specifications that span the subset of packages.
  all other args: see :class:`Index`.
N)superrN   r}   _derive_reduced_index)rF   r}   r4   rG   rH   r8   rI   rD   rJ   r2   rE   rw   s              r&   rN   ReducedIndex.__init__  s@    & 	
	
 
""$r(   c                    SR                  U R                  R                  5       5      nSU R                  R                   SU R
                   SU S3$ )Nrr   rs   z(spec=z, channels=[rt   )ru   r4   rv   rw   rx   r}   ry   s     r&   rz   ReducedIndex.__repr__  sH    99T]]//124>>**+6$**\(SVWWr(   c                   ^
^^^^ [        5       n[        5       m
[        5       m[        5       m[        5       mSU
UUU4S jjmSU4S jjnU R                  (       a  U" U R                  R                  5       6   T" U R                  6   T(       d  T(       a  T(       a\  TR                  5       nT
R                  U5        [        U5      nU R                  U5      nU" U6   UR                  U5        T(       a  M\  T(       aZ  TR                  5       nTR                  U5        [        US9nU R                  U5      nU" U6   UR                  U5        T(       a  MZ  T(       a  M  T(       a  M  UVs0 s H  owU_M     snU l
        U R                  5         U R                  (       a  U R                  5         [        5       nU R                  R                  5        H-  nUR                  / UR                  QUR                   Q75        M/     UR                  ["        R                  5        U H'  n	[$        R&                  " U	5      nXpR                  U'   M)     U R                  R                  U R(                  5        g s  snf )Nc                 
  > [        [        U 5       Hn  nUR                  S5      nU(       a  UT;  a  TR                  U5        UR                  S5      nU(       d  ML  U H  nUT;  d  M  TR                  U5        M     Mp     g)zr
Add a package name or track feature from a MatchSpec to the pending set.

:param spec: The MatchSpec to process.
r   rh   N)mapr   get_raw_valueadd)	r}   specr   rh   ftr_namecollected_namescollected_track_featurespending_namespending_track_featuress	        r&   
push_specs6ReducedIndex._derive_reduced_index.<locals>.push_specs  su     Iu-))&1D7!%%d+!%!3!34D!E!>$2#+CC266x@ %3 .r(   c                   > U  H5  n UR                   nT" UR                  /UQS UR                  5       Q76   M7     g! [         a=  n[        R                  SUR	                  5       UR
                  S   5         SnA  gSnAff = f)zs
Process a package record to collect its dependencies and features.

:param record: The package record to process.
z"Skipping %s due to InvalidSpec: %sinvalid_specNc              3  4   #    U  H  n[        US 9v   M     g7f)rh   Nr   )r   r   s     r&   r   KReducedIndex._derive_reduced_index.<locals>.push_records.<locals>.<genexpr>(  s      (=H ":(=s   )combined_dependsr   r6   r7   	record_id_kwargsr   rh   )recordsrecordr   er   s       r&   push_records8ReducedIndex._derive_reduced_index.<locals>.push_records  s     "'-'>'>$ KK%(.(=(= " # KK<((*		.1
 s   >
B2B  Br   )r}   zMatchSpec | strr   r   )r   r   r   r   )r   setrA   r   r}   popr   r   r   r=   rc   re   rD   rg   r   rh   r_   r
   r   ri   r\   )rF   r   r  r   r   new_recordsfeature_namern   known_featuresknown_featurer   r   r   r   r   s             @@@@@r&   r   "ReducedIndex._derive_reduced_index  s   ,%#&5 !$	A 	A 	2 $**779:DJJ5$((*##D)  #>>tDk*{+  - )599;(,,\: = #>>tDk*{+ )( m55. +22'33h'2
//1>>224 ::$$&C!!"FC$6$6"F"FG 'g445+M''6C!JJsO , 	

$../! 3s   /I;)rc   r}   )r}   r   r4   ztuple[str, ...]rG   r   rH   r   r8   r   rI   r   rD   r   rJ   r   r2   r   rE   r   r   r   r   r   )rx   r   r   r   r   r
   r   rN   rz   r   r   __classcell__)rw   s   @r&   r~   r~     s    
 %'#*.!%DH")"6"6r": %"% "% 	%
 % (% % % B%  % % 
% %BX[0 [0r(   r~   	get_indexz25.3zUse `conda.core.Index` instead.r,   TFr-   c           
     &    [        U UUSUUUU5      $ )a  
Return the index of packages available on the channels

If prepend=False, only the channels passed in as arguments are used.
If platform=None, then the current platform is used.
If prefix is supplied, then the packages installed in that prefix are added.

:param channel_urls: Channels to include in the index.
:param prepend: If False, only the channels passed in are used.
:param platform: Target platform for the index.
:param use_local: Whether to use local channels.
:param use_cache: Whether to use cached index information.
:param unknown: Include unknown packages.
:param prefix: Path to environment prefix to include in the index.
:param repodata_fn: Filename of the repodata file.
:return: A dictionary representing the package index.
N)r*   )r%   rG   rH   rI   rD   unknownrJ   r2   s           r&   r  r  \  s)    : 	 	r(   c                  ^ [         R                  S[        U 5      -   5        0 n[        5        nU4S jnUR	                  XP5       H(  nUR                  S UR                  5       5       5        M*     SSS5        U$ ! , (       d  f       U$ = f)ah  
Fetch the package index from the specified channels.

:param channel_urls: A list of channel URLs to fetch the index from.
:param use_cache: Whether to use the cached index data.
:param index: An optional pre-existing index to update.
:param repodata_fn: The name of the repodata file.
:return: A dictionary representing the fetched or updated package index.
zchannel_urls=c                *   > [        [        U 5      TS9$ )Nr1   )r   r   )rL   r2   s    r&   <lambda>fetch_index.<locals>.<lambda>  s    *CLk+
r(   c              3  (   #    U  H  oU4v   M
     g 7fr   r,   )r   rn   s     r&   r   fetch_index.<locals>.<genexpr>  s     @/?s/?r   N)r6   debugreprr   r   r=   r   )r%   rD   indexr2   executorsubdir_instantiatorfs      `   r&   fetch_indexr    s|      IIo\ 223E	(	*h
 1@ALL@q~~/?@@ A	 
+ L 
+	* Ls   AA==
Bc                t   ^ [         R                  " U5      m[        U4S jU R                  5       5       5      $ )z
Check if a distribution string matches any package in the index.

:param index: The package index.
:param dist_str: The distribution string to match against the index.
:return: True if there is a match; False otherwise.
c              3  F   >#    U  H  nTR                  U5      v   M     g 7fr   )match)r   r   
match_specs     r&   r   $dist_str_in_index.<locals>.<genexpr>  s     A.$z%%.s   !)r   from_dist_stranyr   )r  dist_strr  s     @r&   dist_str_in_indexr#    s,     ((2JA%,,.AAAr(   z&Use `conda.core.Index.reload` instead.c                   [        U[        5      (       a  UO
[        U5      n[        U [        5      (       a+  U R                  U:w  a  [	        S5      eU R                  SS9  gUR                  5        H  nX0;   a~  X   nUR                  UR                  :X  a7  UR                  S5      =(       d    [        n[        R                  " XCUS9X'   M]  UR                  nUR                  5       Ul        U?X0U'   M  X0U'   M     g)z
Supplement the given index with information from the specified environment prefix.

:param index: The package index to supplement.
:param prefix: The path to the environment prefix.
z6An index can only be supplemented with its own prefix.T)rJ   Nr   r   )rB   r   r*   rA   r   rT   r   rK   r   r   r   r   rL   r   r   )r  rJ   rA   r   r   r   r   s          r&   _supplement_index_with_prefixr%    s     'vz::&
6@RK%+%H  	D!$113!"1N%%)>)>> %((0>J'3'@'@"($ "/!6!6:H:L:L:N7!6'4m$ $1- = 4r(   c                    [         R                  " 5        H*  nX;   a  X   n[        R                  " X!5      X'   M&  XU'   M,     g)zj
Supplement the given index with packages from the cache.

:param index: The package index to supplement.
N)r   rf   r   r   )r  r   r   s      r&   _supplement_index_with_cacher'    s<     ";;=>"\N-::>QEL %L >r(   zFUse `conda.core.models.records.PackageRecord.virtual_package` instead.c                0    [         R                  " XU5      $ )a   
Create a virtual package record.

:param name: The name of the virtual package.
:param version: The version of the virtual package, defaults to "0".
:param build_string: The build string of the virtual package, defaults to "0".
:return: A PackageRecord representing the virtual package.
)r   virtual_package)r   versionbuild_strings      r&   _make_virtual_packager,    s      ((EEr(   z<Use :meth:`~conda.core.Index.reload(features=True)` instead.c                z    [        [        R                  U5       H  n[        R                  " U5      nX0U'   M     g)z
Supplement the given index with virtual feature records.

:param index: The package index to supplement.
:param features: A list of feature names to add to the index.
N)r   r
   rh   r   ri   )r  r_   ri   rn   s       r&   _supplement_index_with_featuresr.    s2     //:##G,c
 ;r(   c                    [        U [        5      (       a  g[        R                  R	                  5        H  nXU'   M	     g)z
Loads and populates virtual package records from conda plugins
and adds them to the provided index, unless there is a naming
conflict.

:param index: The package index to supplement.
N)rB   r*   r
   rj   rk   )r  ro   s     r&   _supplement_index_with_systemr0    s5     %))EEG g Hr(   c                 `   SSK Jn Jn  [        R                  R                  S5      u  p#X1;   a  UnO,US:X  a  gUR                  5       (       a  U [        U5         nOg[        R                  " 5       nU[        R                  :w  a  U$ SSK	n[        UR                  R                  5       5      $ )z
Determine the architecture specification name for the current environment.

:return: The architecture name if available, otherwise None.
r	   )_arch_namesnon_x86_machines-zosNr   )base.contextr2  r3  r
   r   splitisdigitint_native_subdirarchspec.cpur   cpuhost)r2  r3  target_plattarget_archmachinenative_subdirarchspecs          r&   get_archspec_namerC  (  s     =&~~33C8K&							c+./**,M&8<<$$&''r(   c                    U(       a  S/[        U 5      -   n U(       a  U [        R                  -  n Ub  US4O[        R                  n[	        XS9$ )aa  
Calculate the full list of channel URLs to use based on the given parameters.

:param channel_urls: Initial list of channel URLs.
:param prepend: Whether to prepend default channels to the list.
:param platform: The target platform for the channels.
:param use_local: Whether to include the local channel.
:return: The calculated list of channel URLs.
r/   r0   )r8   )r3   r
   r4   r8   r   )r%   rG   rH   rI   r8   s        r&   calculate_channel_urlsrE  E  sK     y4#55(((&.&:x"GL::r(   zNUse `conda.core.ReducedIndex` or `conda.core.Index.get_reduced_index` instead.c                $    [        UUSUSSU USS9	$ )a=  
Generate a reduced package index based on the given specifications.

This function is useful for optimizing the solver by reducing the amount
of data it needs to consider.

:param prefix: Path to an environment prefix to include installed packages.
:param channels: A list of channel names to include in the index.
:param subdirs: A list of subdirectories to consider for each channel.
:param specs: A list of MatchSpec objects to filter the packages.
:param repodata_fn: Filename of the repodata file to use.
:return: A dictionary representing the reduced package index.
FNT)r4   rG   r8   rI   rD   rJ   r2   rE   )r~   )rJ   r4   r8   r}   r2   s        r&   r   r   ]  s,    4 
 
r(   )r%   	list[str]r   r   )r%   r   rG   r   rH   r   rI   r   rD   r   r  r   rJ   r   r2   r   r   r*   )
r%   rG  rD   r   r  zdict | Noner2   r   r   dict)r  dict[Any, Any]r"  r   r   r   )r  zIndex | dict[Any, Any]rJ   z*str | os.PathLike[str] | Path | PrefixDatar   r   )r  rI  r   r   )NN)r   r   r*  r   r+  r   r   r   )r  r   r_   rG  r   r   )r  r   r   r   )r   r   )r,   TNF)
r%   z
tuple[str]rG   r   rH   r   rI   r   r   rG  )rJ   r   r4   rG  r8   rG  r}   zlist[MatchSpec]r2   r   r   rH  )Cr   
__future__r   collectionsr   	itertoolsr   loggingr   typingr   boltons.setutilsr   r6  r
   r   	common.ior   r   deprecationsr   
exceptionsr   r   r   r   models.channelr   r   models.match_specr   models.recordsr   r   r   r   package_cache_datar   rA   r   r   r   oscollections.abcr   pathlibr    r!   r"   rx   r6   r>   r'   r*   r~   r   r  r  r#  r%  r'  r,  r.  r0  rC  rE  r   r,   r(   r&   <module>rZ     s^   , "       ' 5 F %  7 ) X X 0 # #(    

B
$
$PH PfM05 M0` {FF%FG,.++B/$)$$ $ 	$
 $ $ $ $ $ H $N FF%FG ++B/	  	
 
 H4	B FF%MN21!21621 
21 O21j FF%MN! O!  

U GKF
F"F9CFF
F 

K FH-9B	
 FF%MN! O!(<  "	;;; ; 	;
 ;0 

]
  	
  

r(   