"""
This type stub file was generated by pyright.
"""

from datetime import tzinfo

from kombu.utils.objects import cached_property

"""Utilities related to dates, times, intervals, and timezones."""
__all__ = (
    "LocalTimezone",
    "timezone",
    "maybe_timedelta",
    "delta_resolution",
    "remaining",
    "rate",
    "weekday",
    "humanize_seconds",
    "maybe_iso8601",
    "is_naive",
    "make_aware",
    "localize",
    "to_utc",
    "maybe_make_aware",
    "ffwd",
    "utcoffset",
    "adjust_timestamp",
    "get_exponential_backoff_interval",
)
C_REMDEBUG = ...
DAYNAMES = ...
WEEKDAYS = ...
RATE_MODIFIER_MAP = ...
TIME_UNITS = ...
ZERO = ...
_local_timezone = ...

class LocalTimezone(tzinfo):
    """Local time implementation.

    Note:
        Used only when the :setting:`enable_utc` setting is disabled.
    """

    _offset_cache = ...
    def __init__(self) -> None: ...
    def __repr__(self): ...
    def utcoffset(self, dt): ...
    def dst(self, dt): ...
    def tzname(self, dt): ...
    def fromutc(self, dt): ...

class _Zone:
    def tz_or_local(self, tzinfo=...): ...
    def to_local(self, dt, local=..., orig=...): ...
    def to_system(self, dt): ...
    def to_local_fallback(self, dt): ...
    def get_timezone(self, zone): ...
    @cached_property
    def local(self): ...
    @cached_property
    def utc(self): ...

timezone = ...

def maybe_timedelta(delta):  # -> timedelta:
    """Convert integer to timedelta, if argument is an integer."""
    ...

def delta_resolution(dt, delta):  # -> datetime:
    """Round a :class:`~datetime.datetime` to the resolution of timedelta.

    If the :class:`~datetime.timedelta` is in days, the
    :class:`~datetime.datetime` will be rounded to the nearest days,
    if the :class:`~datetime.timedelta` is in hours the
    :class:`~datetime.datetime` will be rounded to the nearest hour,
    and so on until seconds, which will just return the original
    :class:`~datetime.datetime`.
    """
    ...

def remaining(start, ends_in, now=..., relative=...):  # -> timedelta:
    """Calculate the remaining time for a start date and a timedelta.

    For example, "how many seconds left for 30 seconds after start?"

    Arguments:
        start (~datetime.datetime): Starting date.
        ends_in (~datetime.timedelta): The end delta.
        relative (bool): If enabled the end time will be calculated
            using :func:`delta_resolution` (i.e., rounded to the
            resolution of `ends_in`).
        now (Callable): Function returning the current time and date.
            Defaults to :func:`datetime.utcnow`.

    Returns:
        ~datetime.timedelta: Remaining time.
    """
    ...

def rate(r):  # -> Literal[0]:
    """Convert rate string (`"100/m"`, `"2/h"` or `"0.5/s"`) to seconds."""
    ...

def weekday(name):  # -> int:
    """Return the position of a weekday: 0 - 7, where 0 is Sunday.

    Example:
        >>> weekday('sunday'), weekday('sun'), weekday('mon')
        (0, 0, 1)
    """
    ...

def humanize_seconds(secs, prefix=..., sep=..., now=..., microseconds=...):  # -> str:
    """Show seconds in human form.

    For example, 60 becomes "1 minute", and 7200 becomes "2 hours".

    Arguments:
        prefix (str): can be used to add a preposition to the output
            (e.g., 'in' will give 'in 1 second', but add nothing to 'now').
        now (str): Literal 'now'.
        microseconds (bool): Include microseconds.
    """
    ...

def maybe_iso8601(dt):  # -> datetime | None:
    """Either ``datetime | str -> datetime`` or ``None -> None``."""
    ...

def is_naive(dt):  # -> bool:
    """Return :const:`True` if :class:`~datetime.datetime` is naive."""
    ...

def make_aware(dt, tz):
    """Set timezone for a :class:`~datetime.datetime` object."""
    ...

def localize(dt, tz):
    """Convert aware :class:`~datetime.datetime` to another timezone."""
    ...

def to_utc(dt):
    """Convert naive :class:`~datetime.datetime` to UTC."""
    ...

def METHOD_NAME(dt, tz=...):
    """Convert dt to aware datetime, do nothing if dt is already aware."""
    ...

class ffwd:
    """Version of ``dateutil.relativedelta`` that only supports addition."""

    def __init__(
        self,
        year=...,
        month=...,
        weeks=...,
        weekday=...,
        day=...,
        hour=...,
        minute=...,
        second=...,
        microsecond=...,
        **kwargs
    ) -> None: ...
    def __repr__(self): ...
    def __radd__(self, other): ...

def utcoffset(time=..., localtime=...):  # -> int:
    """Return the current offset to UTC in hours."""
    ...

def adjust_timestamp(ts, offset, here=...):
    """Adjust timestamp based on provided utcoffset."""
    ...

def get_exponential_backoff_interval(
    factor, retries, maximum, full_jitter=...
):  # -> int:
    """Calculate the exponential backoff wait time."""
    ...