
    2Bf	                     ^   d Z ddlZddlmZ ddlmZmZ ddlm	Z	m
Z
mZmZ  edd      Zdee	e
f   dee	e
f   fd	Zd
ee	e
f   de
dee	e
f   fdZej                   dej                  e	e
f   dee
e	f   fd       Zej                   dee	e
f   dee
e	f   fd       Zdee	e
f   dee
e	f   fdZy)z0Functions for iterating over items in a mapping.    N)Mapping)chainrepeat   )KTVT	IterItemsMapOrIterItemsargreturnc                 `    t        t        | t              r| j                               S |       S )zYield the items in *arg*.

    If *arg* is a :class:`~collections.abc.Mapping`, return an iterator over its items.
    Otherwise return an iterator over *arg* itself.
    )iter
isinstancer   itemsr   s    L/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/bidict/_iter.py_iteritems_mapping_or_iterabler      s&     z#w7		AASAA    argskwc                      t        |       }|dkD  rt        d|       d}| r| d   }|rt        |      }|r)t        |j	                               }|rt        ||      n|}|xs t        S )zYield the items from the positional argument (if given) and then any from *kw*.

    :raises TypeError: if more than one positional argument is given.
    r   z,Expected at most 1 positional argument, got Nr   )len	TypeErrorr   r   r   r   _NULL_IT)r   r   args_len	itemchainr   iterkws         r   _iteritems_args_kwr      ss    
 4yH!|FxjQRRI1g6s;I	bhhj!09E)V,v	  r   c                      y N r   s    r   invertedr"   1   s    <?r   c                      y r    r!   r   s    r   r"   r"   3   s    ;>r   c                 d    t        | dd      }t        |      r |       S d t        |       D        S )a;  Yield the inverse items of the provided object.

    If *arg* has a :func:`callable` ``__inverted__`` attribute,
    return the result of calling it.

    Otherwise, return an iterator over the items in `arg`,
    inverting each item on the fly.

    *See also* :attr:`bidict.BidirectionalMapping.__inverted__`
    __inverted__Nc              3   *   K   | ]  \  }}||f  y wr    r!   ).0keyvals      r   	<genexpr>zinverted.<locals>.<genexpr>C   s     M:CS#JMs   )getattrcallabler   )r   invs     r   r"   r"   5   s1     #~t
,C}uM)G)LMMr   )__doc__typing_tcollections.abcr   	itertoolsr   r   _typingr   r   r	   r
   r   r   r   overloadr"   r!   r   r   <module>r5      s   7  # # 6 6 $?Br2v(> B9RQSVCT B!nRV4 !B !9RQSVCT !&  ?"**RV$ ?2r6): ?  ? >)BF# >	"b&(9 >  >N.R( NYr2v-> Nr   