+
    9iV3                      a  0 t $ R t^ RIHt ^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^RIHt ^RIHtHtHt ^R	IHtHt ^R
IHtHt ^RIHt ]'       d   ^ RIHtHt ^ RIHt R+tR] R&   R,t!R] R&   R-t"R] R&   R.t#R] R&   R R lt$R R lt%]%! 4       t&R] R&   ]PN                  ! R4      ;'       d    ]PN                  ! R4      t(R] R&   R R lt)R R lt*R R  lt+R! R" lt,R# R$ lt-R% R& lt.R' R( lt/R) R* lt0R# )/zKHigh-level API functions for interacting with a channel's Terms of Service.)annotationsN)Path)TYPE_CHECKING)boolify)Channel)CondaToSMissingError)get_local_metadataget_local_metadataswrite_metadata)	LocalPair
RemotePair)get_all_channel_pathsget_cache_paths)get_remote_metadata)IterableIterator)FinalCIr   CI_BOOLEAN_VARSCI_PRESENCE_VARSCONTAINER_INDICATORSPARTIAL_CI_VARSc                   V ^8  d   QhRR/#    returnbool )formats   "6lib/python3.14/site-packages/conda_anaconda_tos/api.py__annotate__r    \   s     %T %T$ %T    c                   a \         P                  ! 4       ^8H  \        \         P                  P	                  R4      4      .p  \        R4      P                  4       ;_uu_ 4       pVP                  4       o\        ;QJ d#    V3R l\         4       F  '       g   K   RM	  RM! V3R l\         4       4      '       d   V P                  R4       RRR4       \        T 4      ;'       d=    \        ;QJ d     R \         4       F  '       g   K   R# 	  R# ! R \         4       4      #   + '       g   i     L_; i  \         d     Loi ; i)a  Detect if running in a containerized CI environment.

This function combines container detection with partial CI environment variables
to address cases where CI systems run jobs in containers but don't set complete
CI environment variables (see GitHub issue #232). This is a workaround for
https://github.com/anaconda/conda-anaconda-tos/issues/232.

Returns:
    bool: True if both container indicators and partial CI variables are present

	CONTAINERz/proc/self/cgroupc              3  ,   <"   T F	  qS9   x  K  	  R # 5iNr   ).0	indicatorcgroup_contents   & r   	<genexpr>#_in_ci_container.<locals>.<genexpr>y   s     U@T9.@Ts   TFNc              3  N   "   T F  p\         P                  ! V4      x  K  	  R # 5ir%   osgetenvr&   vars   & r   r)   r*      s     (S?C3?   #%)r-   getpidr   environgetr   openreadanyr   appendOSErrorr   )container_checksfr(   s     @r   _in_ci_containerr<   \   s     			qRZZ^^K()%&++--VVXN sU@TUsssU@TUUU ''- .   SSSS(S?(SSSSSSS(S?(S%SS! .-  s<   !D8 $4D%!D%=D%D8 %D5	0D8 5D8 8EEc                   V ^8  d   QhRR/# r   r   )r   s   "r   r    r       s     Q Q Qr!   c                    \        \        P                  \        4       F!  p V '       g   K  \	        V 4      '       d   K    R# 	  \        \        P                  \        4       F  p \	        V 4      '       g   K   R# 	  \
        ;QJ d     R \         4       F  '       g   K   RM	  RM! R \         4       4      ;'       g    \        4       # )a  Determine if running in a CI environment.

This function uses a multi-layered approach to detect CI environments:
1. First checks if any CI variables are explicitly set to false
   (respects user override)
2. Then checks boolean CI variables for true values
3. Finally checks presence-based variables and container environments

Returns:
    bool: True if running in a detected CI environment

FTc              3  N   "   T F  p\         P                  ! V4      x  K  	  R # 5ir%   r,   r/   s   & r   r)   _is_ci.<locals>.<genexpr>   s     :)9#ryy~~)9r1   )mapr-   r.   r   r   r7   r   r<   )	var_values    r   _is_cirC      s     O4	9WY// 5
 O4	9 5
 3:)9:333:)9::PP>N>PPr!   JPY_SESSION_NAMEJPY_PARENT_PIDJUPYTERc                    V ^8  d   QhRRRR/# )r   channelsstr | Channelr   zIterable[Channel]r   )r   s   "r   r    r       s     
" 
"M 
".? 
"r!   c               '     "   \        4       p\        \        V 4       FZ  p\        \        VP                  4       4       F5  p\        VP                  4      pW19  g   K   Vx  VP                  V4       K7  	  K\  	  R# 5i)z2Yield all unique channels from the given channels.N)setrA   r   urlsbase_urladd)rH   seenmultichannelchannels   *   r   get_channelsrR      s`      DGX.7L$5$5$78Gg../G"!	 9 /s   AA=A=c               (    V ^8  d   QhRRRRRRRR/# )	r   rQ   rI   tos_rootstr | os.PathLike[str] | Pathcache_timeoutint | float | Noner   zLocalPair | RemotePairr   )r   s   "r   r    r       s2      
  
 
 , 
 &	 

  
r!   c               H   R;r4 \        WR7      p \        W.R7      pV'       d   VP                  V8  d   V# \	        VP                  VP
                  VR7      #   \         d   pTp Rp?L]Rp?ii ; i  \         d!   pT'       d   YEh\        TR7      u Rp?# Rp?ii ; i)z8Get the Terms of Service metadata for the given channel.NrV   extend_search_pathmetadatapathremote)r]   )r   r   r   r]   r   r^   r   )rQ   rT   rV   remote_metadata
remote_excexc
local_pairs   &$$    r   get_one_tosrd      s     $('O-gS
'JO
 *"5"5"H(("
 	
#   
   4%?334s4   A A6 A3'A..A36B!BB!B!c               $    V ^8  d   QhRRRRRR/# )r   rT   rU   rV   rW   r   z#Iterator[tuple[Channel, LocalPair]]r   )r   s   "r   r    r       s(      + & )	r!   c              #     "   \        V .R7       FP  w  r# \        W!R7      pTP                  T8  d   Y#3x  K*  T\	        TP                  TP
                  TR7      3x  KR  	  R#   \         d     Kd  i ; i5i)z.Yield metadata of all stored Terms of Service.rZ   rY   r\   N)r	   r   r   r]   r   r^   )rT   rV   rQ   rc   r`   s   $$   r   get_stored_tosrg      s       3xjQ	1'WO /1%% '00#*   R $ 		s(   A8A&AA8&A51A84A55A8c               (    V ^8  d   QhRRRRRRRR/# 	r   rQ   rI   rT   rU   rV   rW   r   r   r   )r   s   "r   r    r       s8     J JJ ,J &	J
 Jr!   c               z    \        V VVR7      pVP                  ;'       g    VP                  p\        WVRR7      # )z2Accept the Terms of Service for the given channel.rT   rV   Ttos_acceptedrd   r_   r]   r
   rQ   rT   rV   pairr]   s   &$$  r   
accept_tosrq      s=     #D
 {{++dmmH(XDIIr!   c               (    V ^8  d   QhRRRRRRRR/# ri   r   )r   s   "r   r    r      s8     K KK ,K &	K
 Kr!   c               z    \        V VVR7      pVP                  ;'       g    VP                  p\        WVRR7      # )z2Reject the Terms of Service for the given channel.rk   Frl   rn   ro   s   &$$  r   
reject_tosrt     s=     #D
 {{++dmmH(XEJJr!   c               (    V ^8  d   QhRRRRRRRR/# )	r   rH   rI   rT   zstr | os.PathLike | PathrV   rW   r   z7Iterator[tuple[Channel, LocalPair | RemotePair | None]]r   )r   s   "r   r    r      s0      & & =	r!   c              '    "   \        4       p\        V!   F&  p V\        W@VR7      3x  VP	                  V4       K(  	  \        V VR7       F#  w  rEWC9  g   K  WE3x  VP	                  V4       K%  	  R#   \         d
    TR3x   L^i ; i5i)zHList all channels and whether their Terms of Service have been accepted.rk   N)rK   rR   rd   r   rN   rg   )rT   rV   rH   rO   rQ   metadata_pairs   $$*   r   get_all_tosrx     s      D*	 GmT  	 + #1## ((HHW# $ 	 4-	 s-   BA6*BB6B
B	B

Bc                   V ^8  d   QhRR/# )r   r   Iterator[Path]r   )r   s   "r   r    r    .  s      ^ r!   c               #     "   \        4        F  p  V P                  4        V x  K  	  R#   \        \        \        3 d     K7  i ; i5i)zClean all metadata cache files.N)r   unlinkPermissionErrorFileNotFoundErrorIsADirectoryError)r^   s    r   clean_cacher   .  sE     !	KKM J "  !24EF 	 		s%   A+
AAAAAc                    V ^8  d   QhRRRR/# )r   rT   rU   r   rz   r   )r   s   "r   r    r    <  s      5 . r!   c              #     "   \        V .R7       F  p VP                  4        Vx  K  	  R#   \        \        \        3 d     K7  i ; i5i)zClean all metadata directories.rZ   N)r   r|   r}   r~   r   )rT   r^   s   & r   	clean_tosr   <  sJ     %(D	KKM J E  !24EF 	 		s%   A.
AAAAA)APPVEYOR
BITRISE_IOBUDDY	BUILDKITEr   CIRCLECI	CIRRUS_CICONCOURSE_CIDRONEGITHUB_ACTIONS	GITLAB_CISAIL_CI	SEMAPHORETF_BUILDTRAVISWERCKERWOODPECKER_CI)BAMBOO_BUILDKEYCODEBUILD_BUILD_IDHEROKU_TEST_RUN_IDJENKINS_URLTEAMCITY_VERSION)
containerddockerkubepodslxcpodman)AZURE_HTTP_USER_AGENTBUILD_IDBUILD_NUMBER	BUILD_URLBUILDKITE_BUILD_IDCIRCLE_BUILD_NUMCIRCLE_PROJECT_REPONAME
GITHUB_JOBGITHUB_REPOSITORYGITHUB_WORKFLOWGITLAB_PROJECT_IDGITLAB_USER_IDJOB_NAMERUNNER_ARCH	RUNNER_OS	WORKSPACE)1__conditional_annotations____doc__
__future__r   r-   pathlibr   typingr   conda.auxlib.type_coercionr   conda.models.channelr   
exceptionsr   localr   r	   r
   modelsr   r   r^   r   r   r_   r   collections.abcr   r   r   r   __annotations__r   r   r   r<   rC   r   r.   rF   rR   rd   rg   rq   rt   rx   r   r   )r   s   @r   <module>r      s    R " 	    . ( , J J ) 8 '2
 , %  e  (%TPQ: HE  -.NN299=M3N N
" 
F6J K 8r!   