# Path: src/apscheduler/abc.py
# class Trigger(Iterator[datetime], metaclass=ABCMeta):
#     """Abstract base class that defines the interface that every trigger must implement."""
# 
#     __slots__ = ()
# 
#     @abstractmethod
#     def next(self) -> datetime | None:
#         """
#         Return the next datetime to fire on.
# 
#         If no such datetime can be calculated, ``None`` is returned.
#         :raises apscheduler.exceptions.MaxIterationsReached:
#         """
# 
#     @abstractmethod
#     def __getstate__(self):
#         """Return the (JSON compatible) serializable state of the trigger."""
# 
#     @abstractmethod
#     def __setstate__(self, state):
#         """Initialize an empty instance from an existing state."""
# 
#     def __iter__(self):
#         return self
# 
#     def __next__(self) -> datetime:
#         dateval = self.next()
#         if dateval is None:
#             raise StopIteration
#         else:
#             return dateval
# 
# Path: src/apscheduler/exceptions.py
# class DeserializationError(Exception):
#     """Raised when a serializer fails to deserialize the given object."""


import sys
import attrs
from datetime import date, datetime, timedelta, timezone, tzinfo
from typing import Any
from attrs import Attribute
from tzlocal import get_localzone
from .abc import Trigger
from .exceptions import DeserializationError
    from zoneinfo import ZoneInfo
    from backports.zoneinfo import ZoneInfo
            raise ValueError(f'{name} must be positive')

    raise TypeError(f'{name} must be an integer, got {value.__class__.__name__} instead')


def as_timedelta(value: timedelta | float) -> timedelta:
    if isinstance(value, (int, float)):
        return timedelta(seconds=value)
    elif isinstance(value, timedelta):
        return value

    # raise TypeError(f'{attribute.name} must be a timedelta or number of seconds, got '
    #                 f'{value.__class__.__name__} instead')


def as_list(value, element_type: type, name: str) -> list:
    value = list(value)
    for i, element in enumerate(value):
        if not isinstance(element, element_type):
            raise TypeError(f'Element at index {i} of {name} is not of the expected type '
                            f'({element_type.__name__}')

    return value


def aware_datetime(instance: Any, attribute: Attribute, value: datetime) -> None:
    if not value.tzinfo:
        raise ValueError(f'{attribute.name} must be a timezone aware datetime')



# Path: src/apscheduler/abc.py
# class Trigger(Iterator[datetime], metaclass=ABCMeta):
#     """Abstract base class that defines the interface that every trigger must implement."""
# 
#     __slots__ = ()
# 
#     @abstractmethod
#     def next(self) -> datetime | None:
#         """
#         Return the next datetime to fire on.
# 
#         If no such datetime can be calculated, ``None`` is returned.
#         :raises apscheduler.exceptions.MaxIterationsReached:
#         """
# 
#     @abstractmethod
#     def __getstate__(self):
#         """Return the (JSON compatible) serializable state of the trigger."""
# 
#     @abstractmethod
#     def __setstate__(self, state):
#         """Initialize an empty instance from an existing state."""
# 
#     def __iter__(self):
#         return self
# 
#     def __next__(self) -> datetime:
#         dateval = self.next()
#         if dateval is None:
#             raise StopIteration
#         else:
#             return dateval
# 
# Path: src/apscheduler/exceptions.py
# class DeserializationError(Exception):
#     """Raised when a serializer fails to deserialize the given object."""


# Path: src/apscheduler/validators.py
import sys
import attrs
from datetime import date, datetime, timedelta, timezone, tzinfo
from typing import Any
from attrs import Attribute
from tzlocal import get_localzone
from .abc import Trigger
from .exceptions import DeserializationError
    from zoneinfo import ZoneInfo
    from backports.zoneinfo import ZoneInfo

            raise ValueError(f'{name} must be positive')

    raise TypeError(f'{name} must be an integer, got {value.__class__.__name__} instead')


def as_timedelta(value: timedelta | float) -> timedelta:
    if isinstance(value, (int, float)):
        return timedelta(seconds=value)
    elif isinstance(value, timedelta):
        return value

    # raise TypeError(f'{attribute.name} must be a timedelta or number of seconds, got '
    #                 f'{value.__class__.__name__} instead')


def as_list(value, element_type: type, name: str) -> list:
    value = list(value)
    for i, element in enumerate(value):
        if not isinstance(element, element_type):
            raise TypeError(f'Element at index {i} of {name} is not of the expected type '
                            f'({element_type.__name__}')

    return value


def aware_datetime(instance: Any, attribute: Attribute, value: datetime) -> None:
    if not value.tzinfo:
        raise ValueError(f'{attribute.name} must be a timezone aware datetime')



def require_state_version(trigger: Trigger, state: dict[str, Any], max_version: int) -> None: