o
    °3Ihý  ã                   @   s   ddd„Z d S )Nc                 C   sL   t | ƒ}t||ƒ}zt|ƒ}W n
 ty   Y |S w d ||¡}|p%t|ƒ‚)a(  If *iterable* has only one item, return it.
    If it has zero items, return *default*.
    If it has more than one item, raise the exception given by *too_long*,
    which is ``ValueError`` by default.
    >>> only([], default='missing')
    'missing'
    >>> only([1])
    1
    >>> only([1, 2])  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    ValueError: Expected exactly one item in iterable, but got 1, 2,
     and perhaps more.'
    >>> only([1, 2], too_long=TypeError)  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    TypeError
    Note that :func:`only` attempts to advance *iterable* twice to ensure there
    is only one item.  See :func:`spy` or :func:`peekable` to check
    iterable contents less destructively.
    zLExpected exactly one item in iterable, but got {!r}, {!r}, and perhaps more.)ÚiterÚnextÚStopIterationÚformatÚ
ValueError)ÚiterableÚdefaultÚtoo_longÚitÚfirst_valueÚsecond_valueÚmsg© r   ú^/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/importlib_resources/_itertools.pyÚonly   s   
÷þr   )NN)r   r   r   r   r   Ú<module>   s   