
    si                         S r SSKJr  SSKJrJr  SSKJr  SSKJr  SSK	J
r
   " S S	\5      r\S
S 4S jr\S
S 4S jrg
)zCommon collection classes.    )reduce)MappingSet)
frozendict   )
deprecated)
isiterablec                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )AttrDict   zSub-classes dict, and further allows attribute-like access to dictionary items.

Examples:
    >>> d = AttrDict({'a': 1})
    >>> d.a, d['a'], d.get('a')
    (1, 1, 1)
    >>> d.b = 2
    >>> d.b, d['b']
    (2, 2)
c                 2   > [         TU ]  " U0 UD6  X l        g N)super__init____dict__)selfargskwargs	__class__s      7lib/python3.13/site-packages/conda/auxlib/collection.pyr   AttrDict.__init__   s    $)&)    )r   )__name__
__module____qualname____firstlineno____doc__r   __static_attributes____classcell__)r   s   @r   r   r      s    	 r   r   Nc                     U $ r    xs    r   <lambda>r$      s    qr   c                 j   ^^ [        UU4S jU  5       [        U5      (       a  U" 5       5      $ U5      $ )a  Give the first value that satisfies the key test.

Args:
    seq (iterable):
    key (callable): test for each element of iterable
    default: returned when all elements fail test
    apply (callable): applied to element before return, but not to default value

Returns: first element in seq that passes key, mutated with optional apply

Examples:
    >>> first([0, False, None, [], (), 42])
    42
    >>> first([0, False, None, [], ()]) is None
    True
    >>> first([0, False, None, [], ()], default='ohai')
    'ohai'
    >>> import re
    >>> m = first(re.match(regex, 'abc') for regex in ['b.*', 'a(.*)'])
    >>> m.group(1)
    'bc'

    The optional `key` argument specifies a one-argument predicate function
    like that used for `filter()`.  The `key` argument, if supplied, must be
    in keyword form.  For example:
    >>> first([1, 1, 3, 4, 5], key=lambda x: x % 2 == 0)
    4

c              3   R   >#    U  H  nT" U5      (       d  M  T" U5      v   M     g 7fr   r!   .0r#   applykeys     r   	<genexpr>first.<locals>.<genexpr>:   s     13a#a&q3   '')nextcallableseqr*   defaultr)   s    ` `r   firstr3      s-    < 131@Q@Q79__W^__r   c                     U $ r   r!   r"   s    r   r$   r$   =   s    ar   c                 F   ^^ [        UU4S j[        U 5       5       U5      $ )Nc              3   R   >#    U  H  nT" U5      (       d  M  T" U5      v   M     g 7fr   r!   r'   s     r   r+   last.<locals>.<genexpr>>   s     ;=aCFq=r-   )r.   reversedr0   s    ` `r   lastr9   =   s    ;8C=;WEEr   )r   	functoolsr   collections.abcr   r   r   deprecationsr   common.compatr	   dictr   boolr3   r9   r!   r   r   <module>r@      sB       ( ! % &t   [ `B K Fr   