Ë
    Ìiç  ã                   óJ   — d dl mZmZ d dlmZ dd„Zeeffd„Z G d„ d«      Z	y)	é    )ÚdefaultdictÚdeque)ÚfilterfalseNc              #   óÌ   K  — t        «       }|j                  }|€(t        |j                  | «      D ]  } ||«       |–— Œ y| D ]  } ||«      }||vsŒ ||«       |–— Œ y­w)zHList unique elements, preserving order. Remember all elements ever seen.N)ÚsetÚaddr   Ú__contains__)ÚiterableÚkeyÚseenÚseen_addÚelementÚks         ú^/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/importlib_metadata/_itertools.pyÚunique_everseenr      ss   è ø€ ô ‹5€DØ�x‰x€HØ
€{Ü" 4×#4Ñ#4°hÓ?ò 	ˆGÙ�WÔØ‹Mñ	ð  ò 	ˆGÙ�G“ˆAØ˜Š}Ù˜”Ø“ñ		ùs   ‚AA$ÁA$c                 óž   — | €t        d«      S |�t        | |«      rt        | f«      S 	 t        | «      S # t        $ r t        | f«      cY S w xY w)ax  If *obj* is iterable, return an iterator over its items::

        >>> obj = (1, 2, 3)
        >>> list(always_iterable(obj))
        [1, 2, 3]

    If *obj* is not iterable, return a one-item iterable containing *obj*::

        >>> obj = 1
        >>> list(always_iterable(obj))
        [1]

    If *obj* is ``None``, return an empty iterable:

        >>> obj = None
        >>> list(always_iterable(None))
        []

    By default, binary and text strings are not considered iterable::

        >>> obj = 'foo'
        >>> list(always_iterable(obj))
        ['foo']

    If *base_type* is set, objects for which ``isinstance(obj, base_type)``
    returns ``True`` won't be considered iterable.

        >>> obj = {'a': 1}
        >>> list(always_iterable(obj))  # Iterate over the dict's keys
        ['a']
        >>> list(always_iterable(obj, base_type=dict))  # Treat dicts as a unit
        [{'a': 1}]

    Set *base_type* to ``None`` to avoid any special handling and treat objects
    Python considers iterable as iterable:

        >>> obj = 'foo'
        >>> list(always_iterable(obj, base_type=None))
        ['f', 'o', 'o']
    © )ÚiterÚ
isinstanceÚ	TypeError)ÚobjÚ	base_types     r   Úalways_iterabler      sX   € ðR €{Ü�B‹xˆàÐ¤:¨c°9Ô#=Ü�S�F‹|ÐðÜ�C‹yÐøÜò Ü�S�F‹|Òðús   ©
4 ´AÁAc                   ó0   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ Zy)	Úbucketaâ  Wrap *iterable* and return an object that buckets the iterable into
    child iterables based on a *key* function.

        >>> iterable = ['a1', 'b1', 'c1', 'a2', 'b2', 'c2', 'b3']
        >>> s = bucket(iterable, key=lambda x: x[0])  # Bucket by 1st character
        >>> sorted(list(s))  # Get the keys
        ['a', 'b', 'c']
        >>> a_iterable = s['a']
        >>> next(a_iterable)
        'a1'
        >>> next(a_iterable)
        'a2'
        >>> list(s['b'])
        ['b1', 'b2', 'b3']

    The original iterable will be advanced and its items will be cached until
    they are used by the child iterables. This may require significant storage.

    By default, attempting to select a bucket to which no items belong  will
    exhaust the iterable and cache all values.
    If you specify a *validator* function, selected buckets will instead be
    checked against it.

        >>> from itertools import count
        >>> it = count(1, 2)  # Infinite sequence of odd numbers
        >>> key = lambda x: x % 10  # Bucket by last digit
        >>> validator = lambda x: x in {1, 3, 5, 7, 9}  # Odd digits only
        >>> s = bucket(it, key=key, validator=validator)
        >>> 2 in s
        False
        >>> list(s[2])
        []

    Nc                 ór   — t        |«      | _        || _        t        t        «      | _        |xs d„ | _        y )Nc                  ó   — y)NTr   )Úxs    r   ú<lambda>z!bucket.__init__.<locals>.<lambda>v   s   � ó    )r   Ú_itÚ_keyr   r   Ú_cacheÚ
_validator)Úselfr
   r   Ú	validators       r   Ú__init__zbucket.__init__r   s,   € Ü˜“>ˆŒØˆŒ	Ü!¤%Ó(ˆŒØ#Ò7©ˆ�r    c                 ó    — | j                  |«      sy	 t        | |   «      }| j                  |   j                  |«       y# t        $ r Y yw xY w)NFT)r$   Únextr#   Ú
appendleftÚStopIteration)r%   ÚvalueÚitems      r   r	   zbucket.__contains__x   sT   € Ø�‰˜uÔ%Øð	0Ü˜˜U™Ó$ˆDð �K‰K˜Ñ×)Ñ)¨$Ô/àøô ò 	Ùð	ús   ”A Á	AÁAc              #   óN  K  — 	 | j                   |   r | j                   |   j                  «       –— nb	 	 t        | j                  «      }| j                  |«      }||k(  r|–— n0| j                  |«      r| j                   |   j                  |«       ŒaŒ’# t        $ r Y yw xY w­w)z²
        Helper to yield items from the parent iterator that match *value*.
        Items that don't match are stored in the local cache as they
        are encountered.
        N)r#   Úpopleftr)   r!   r+   r"   r$   Úappend)r%   r,   r-   Ú
item_values       r   Ú_get_valueszbucket._get_values…   s§   è ø€ ð ð �{‰{˜5Ò!Ø—k‘k %Ñ(×0Ñ0Ó2Ó2ð ðÜ# D§H¡H›~˜ð "&§¡¨4£�JØ! UÒ*Ø"š
ØØŸ™¨Ô4ØŸ™ JÑ/×6Ñ6°tÔ<ð ð øô )ò Ùðüs)   ‚2B%µB Á
AB%Â	B"ÂB%Â!B"Â"B%c              #   óø   K  — | j                   D ]C  }| j                  |«      }| j                  |«      sŒ&| j                  |   j	                  |«       ŒE | j                  j                  «       E d {  –—†  y 7 Œ­w©N)r!   r"   r$   r#   r0   Úkeys)r%   r-   r1   s      r   Ú__iter__zbucket.__iter__Ÿ   sa   è ø€ Ø—H‘Hò 	5ˆDØŸ™ 4›ˆJØ�‰˜zÕ*Ø—‘˜JÑ'×.Ñ.¨tÕ4ð	5ð
 —;‘;×#Ñ#Ó%×%Ò%ús   ‚2A:µ=A:Á2A8Á3A:c                 ó\   — | j                  |«      st        d«      S | j                  |«      S )Nr   )r$   r   r2   )r%   r,   s     r   Ú__getitem__zbucket.__getitem__§   s(   € Ø�‰˜uÔ%Ü˜“8ˆOà×Ñ Ó&Ð&r    r4   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r'   r	   r2   r6   r8   r   r    r   r   r   N   s!   „ ñ!óF8òò=ò4&ó'r    r   r4   )
Úcollectionsr   r   Ú	itertoolsr   r   ÚstrÚbytesr   r   r   r    r   ú<module>rA      s+   ðß *Ý !óð& %(¨ <ó 2÷l]'ò ]'r    