+
    LV-j  ã                   óX   € R t ^ RIt^RIHt ^RIHtHtHtHt . ROt	R t
]R3R ltR tR# )z
Commonly useful converters.
N)Ú_AnnotationExtractor)ÚNOTHINGÚ	ConverterÚFactoryÚpipec                óœ  a € \        S \        4      '       d   V 3R lpMV 3R lp\        S 4      pVP                  4       pV'       d%   \        P
                  V,          VP                  R&   VP                  4       pV'       d%   \        P
                  V,          VP                  R&   \        S \        4      '       d   \        VRRR7      # V# )a;  
A converter that allows an attribute to be optional. An optional attribute
is one which can be set to `None`.

Type annotations will be inferred from the wrapped converter's, if it has
any.

Args:
    converter (typing.Callable):
        the converter that is used for non-`None` values.

.. versionadded:: 17.1.0
c                 ó"   <€ V f   R # S! WV4      # ©N© )ÚvalÚinstÚfieldÚ	converters   &&&€Ú`/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/attr/converters.pyÚoptional_converterÚ$optional.<locals>.optional_converter&   s   ø€ ØŠ{ÙÙ˜S¨Ó.Ð.ó    c                 ó    <€ V f   R # S! V 4      # r	   r
   )r   r   s   &€r   r   r   -   s   ø€ ØŠ{ÙÙ˜S“>Ð!r   r   ÚreturnT)Ú
takes_selfÚtakes_field)Ú
isinstancer   r   Úget_first_param_typeÚtypingÚOptionalÚ__annotations__Úget_return_type)r   r   ÚxtrÚtÚrts   f    r   Úoptionalr       s¡   ø€ ô �)œY×'Ò'ö	/õ	"ô
 ˜yÓ
)€Cà× Ñ Ó"€AßÜ4:·O±OÀAÕ4FÐ×*Ñ*¨5Ñ1à	×	Ñ	Ó	€Bß	Ü7=·±ÀrÕ7JÐ×*Ñ*¨8Ñ4ä�)œY×'Ò'ÜÐ+¸È$ÔOÐOàÐr   c                ó  a € S \         J d   Vf   Rp\        V4      hS \         Jd   Ve   Rp\        V4      hVe   \        V4      o \        S \        4      '       d(   S P                  '       d   Rp\        V4      hV 3R lpV# V 3R lpV# )a–  
A converter that allows to replace `None` values by *default* or the result
of *factory*.

Args:
    default:
        Value to be used if `None` is passed. Passing an instance of
        `attrs.Factory` is supported, however the ``takes_self`` option is
        *not*.

    factory (typing.Callable):
        A callable that takes no parameters whose result is used if `None`
        is passed.

Raises:
    TypeError: If **neither** *default* or *factory* is passed.

    TypeError: If **both** *default* and *factory* are passed.

    ValueError:
        If an instance of `attrs.Factory` is passed with
        ``takes_self=True``.

.. versionadded:: 18.2.0
z(Must pass either `default` or `factory`.z5Must pass either `default` or `factory` but not both.z1`takes_self` is not supported by default_if_none.c                 ó0   <€ V e   V # SP                  4       # r	   )Úfactory©r   Údefaults   &€r   Údefault_if_none_converterÚ2default_if_none.<locals>.default_if_none_converterl   s   ø€ ØŠØ�
à—?‘?Ó$Ð$r   c                 ó   <€ V e   V # S# r	   r
   r$   s   &€r   r&   r'   t   s   ø€ ØŠØ�
àˆNr   )r   Ú	TypeErrorr   r   r   Ú
ValueError)r%   r#   Úmsgr&   s   f&  r   Údefault_if_noner,   B   sŽ   ø€ ð4 ”'Ó˜gšoØ8ˆÜ˜‹nÐà”gÓ 'Ò"5ØEˆÜ˜‹nÐàÒÜ˜'Ó"ˆä�'œ7×#Ò#Ø××ÐØEˆCÜ˜S“/Ð!õ	%ð %Ð$õ	ð %Ð$r   c                ó”   € \        V \        4      '       d   V P                  4       p V R9   d   R# V R9   d   R# RV : 2p\        V4      h)a„  
Convert "boolean" strings (for example, from environment variables) to real
booleans.

Values mapping to `True`:

- ``True``
- ``"true"`` / ``"t"``
- ``"yes"`` / ``"y"``
- ``"on"``
- ``"1"``
- ``1``

Values mapping to `False`:

- ``False``
- ``"false"`` / ``"f"``
- ``"no"`` / ``"n"``
- ``"off"``
- ``"0"``
- ``0``

Raises:
    ValueError: For any other value.

.. versionadded:: 21.3.0
TFzCannot convert value to bool: )TÚtruer   ÚyesÚyÚonÚ1é   )FÚfalseÚfÚnoÚnÚoffÚ0é    )r   ÚstrÚlowerr*   )r   r+   s   & r   Úto_boolr=   }   sJ   € ô8 �#”s×ÒØ�i‰i‹kˆà
Ð;Ô;ÙØ
Ð=Ô=Ùà*¨3©'Ð
2€CÜ
�S‹/Ðr   )r,   r    r   r=   )Ú__doc__r   Ú_compatr   Ú_maker   r   r   r   Ú__all__r    r,   r=   r
   r   r   Ú<module>rB      s7   ðñó å )ß 4Ó 4ò€ò*ðZ $¨Tô 8%ôv%r   