+
    ¾¾jƒ  ã                  óª   € R t ^ RIHt ^ RIHtHtHt ^ RIHtHt ]'       d	   ^ RI	H
t
Ht R R ltR R ltR	 R
 ltR R ltR R ltR R lt. ROtR# )z Utility functions for icalendar.)Úannotations)ÚdateÚdatetimeÚtzinfo)ÚTYPE_CHECKINGÚcast)Ú	TypeGuardÚTypeIsc               ó    € V ^8„  d   QhRRRR/# )é   Údtúdate | datetimeÚreturnÚbool© )Úformats   "ÚN/home/ralf/ical-fahrzeuge/venv/lib/python3.14/site-packages/icalendar/tools.pyÚ__annotate__r      s   € ÷ Añ A�ð A Dñ Aó    c                ó\   € \        V \        4      ;'       d    \        V \        4      '       * # )aD  Check if a value is a date but not a datetime.

This function distinguishes between ``date`` and ``datetime`` objects,
returning ``True`` only for pure ``date`` instances.

Parameters:
    dt: The date or datetime object to check.

Returns:
    ``True`` if the value is a ``date`` but not a ``datetime``,
    ``False`` otherwise.

Example:
    .. code-block:: pycon

        >>> from datetime import date, datetime
        >>> from icalendar.tools import is_date
        >>> is_date(date(2024, 1, 15))
        True
        >>> is_date(datetime(2024, 1, 15, 10, 30))
        False
)Ú
isinstancer   r   ©r   s   &r   Úis_dater      s#   € ô. �bœ$Ó×@Ð@¬
°2´xÓ(@Ô$@Ð@r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   zTypeIs[datetime]r   )r   s   "r   r   r   &   s   € ÷ $ñ $�Oð $Ð(8ñ $r   c                ó"   € \        V \        4      # )aÀ  Check if a value is a datetime.

Parameters:
    dt: The date or datetime object to check.

Returns:
    ``True`` if the value is a ``datetime``, ``False`` if it is
    only a ``date``.

Example:
    .. code-block:: pycon

        >>> from datetime import date, datetime
        >>> from icalendar.tools import is_datetime
        >>> is_datetime(datetime(2024, 1, 15, 10, 30))
        True
        >>> is_datetime(date(2024, 1, 15))
        False
)r   r   r   s   &r   Úis_datetimer   &   s   € ô( �bœ(Ó#Ð#r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   r   =   s   € ÷  ñ  �Oð  ¨ñ  r   c                ó’   € \        V 4      '       d,   \        V P                  V P                  V P                  4      # \        RV 4      # )a¦  Convert a date to a datetime.

If the input is already a ``datetime``, it is returned unchanged.
If the input is a ``date``, it is converted to a ``datetime`` at midnight.

Parameters:
    dt: The date or datetime to convert.

Returns:
    A ``datetime`` object. If the input was a ``date``, the time
    component will be set to midnight (00:00:00).

Example:
    .. code-block:: pycon

        >>> from datetime import date, datetime
        >>> from icalendar.tools import to_datetime
        >>> to_datetime(date(2024, 1, 15))
        datetime.datetime(2024, 1, 15, 0, 0)
        >>> to_datetime(datetime(2024, 1, 15, 10, 30))
        datetime.datetime(2024, 1, 15, 10, 30)
r   )r   r   ÚyearÚmonthÚdayr   r   s   &r   Úto_datetimer!   =   s5   € ô. ˆr‡{‚{Ü˜Ÿ™ §¡¨2¯6©6Ó2Ð2Ü�
˜BÓÐr   c               ó    € V ^8„  d   QhRRRR/# )r   Útzr   r   r   r   )r   s   "r   r   r   Y   s   € ÷ #ñ #�ð #˜4ñ #r   c                ó   € \        V R4      # )aO  Check if a timezone is a pytz timezone.

pytz timezones require special handling with ``localize()`` and
``normalize()`` methods for correct timezone calculations.

Parameters:
    tz: The timezone info object to check.

Returns:
    ``True`` if the timezone is a pytz timezone (has a ``localize``
    attribute), ``False`` otherwise.
Úlocalize)Úhasattr)r#   s   &r   Úis_pytzr'   Y   s   € ô �2�zÓ"Ð"r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   zTypeGuard[datetime]r   )r   s   "r   r   r   i   s   € ÷ Uñ U�?ð UÐ':ñ Ur   c                ón   € \        V 4      ;'       d$    V P                  ;pRJ;'       d    \        V4      # )aV  Check if a datetime uses a pytz timezone.

This function checks whether the datetime has a timezone attached
and whether that timezone is a pytz timezone requiring special handling.

Parameters:
    dt: The date or datetime object to check.

Returns:
    ``True`` if the value is a ``datetime`` with a pytz timezone,
    ``False`` otherwise.
N)r   r   r'   )r   r   s   & r   Ú
is_pytz_dtr*   i   s0   € ô �r‹?×TÐT¨"¯)©)Ð 3 ¸DÐ@×TÐTÄWÈVÃ_ÐTr   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r   )r   s   "r   r   r   y   s   € ÷ ñ �ð ¨?ñ r   c                ó^   € \        V 4      '       d   V P                  P                  V 4      # V # )ay  Normalize a datetime after calculations when using pytz.

pytz requires the ``normalize()`` function to be called after arithmetic
operations to correctly adjust the timezone offset, especially around
daylight saving time transitions.

Parameters:
    dt: The date or datetime to normalize.

Returns:
    The normalized datetime if it uses pytz, otherwise the input unchanged.
)r*   r   Ú	normalizer   s   &r   Únormalize_pytzr.   y   s'   € ô �"‡~‚~Ø�y‰y×"Ñ" 2Ó&Ð&Ø€Ir   N)r   r   r'   r*   r.   r!   )Ú__doc__Ú
__future__r   r   r   r   Útypingr   r   Úicalendar.compatibilityr   r	   r   r   r!   r'   r*   r.   Ú__all__r   r   r   Ú<module>r4      sA   ðÙ &å "ç +Ñ +ß &çß9õAõ4$õ. õ8#õ Uõ ò$‚r   