# Path: django_lightweight_queue/types.py
# class Logger(Protocol):
#     def log(
#         self,
#         level: int,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def debug(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def info(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def warning(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def error(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def exception(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
# 
# Path: django_lightweight_queue/utils.py
# @lru_cache()
# def get_backend(queue: QueueName) -> 'BaseBackend':
#     return get_path(app_settings.BACKEND_OVERRIDES.get(
#         queue,
#         app_settings.BACKEND,
#     ))()
# 
# Path: django_lightweight_queue/backends/base.py
# class BackendWithPause(BaseBackend, metaclass=ABCMeta):
#     @abstractmethod
#     def pause(self, queue: QueueName, until: datetime.datetime) -> None:
#         raise NotImplementedError()
# 
#     @abstractmethod
#     def is_paused(self, queue: QueueName) -> bool:
#         raise NotImplementedError()


import re
import argparse
import datetime
from django.core.management.base import BaseCommand, CommandError
from ...types import QueueName
from ...utils import get_backend
from ...backends.base import BackendWithPause
        )

        group = parser.add_mutually_exclusive_group(required=True)
        group.add_argument(
            '--for',
            dest='until',
            action='store',
            type=parse_duration_to_time,
            help=(
                "The duration to pause the queue for. Specify a value like 1h2m3s, "
                "all levels of precision are optional, so 5m and 1h are both valid."
            ),
        )
        group.add_argument(
            '--until',
            action='store',
            type=parse_time,
            help=(
                "The time at which the queue should reactivate. Specify as an "
                "ISO 8601 value, specifically one parsable via datetime.strptime "
                f"using {TIME_FORMAT.replace('%', r'%%')!r}, such as {utcnow():{TIME_FORMAT}}."
            ),
        )

    def handle(self, queue: QueueName, until: datetime.datetime, **options: object) -> None:
        if until < utcnow():
            raise CommandError("Refusing to pause until a time in the past.")

        backend = get_backend(queue)


# Path: django_lightweight_queue/types.py
# class Logger(Protocol):
#     def log(
#         self,
#         level: int,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def debug(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def info(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def warning(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def error(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def exception(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
# 
# Path: django_lightweight_queue/utils.py
# @lru_cache()
# def get_backend(queue: QueueName) -> 'BaseBackend':
#     return get_path(app_settings.BACKEND_OVERRIDES.get(
#         queue,
#         app_settings.BACKEND,
#     ))()
# 
# Path: django_lightweight_queue/backends/base.py
# class BackendWithPause(BaseBackend, metaclass=ABCMeta):
#     @abstractmethod
#     def pause(self, queue: QueueName, until: datetime.datetime) -> None:
#         raise NotImplementedError()
# 
#     @abstractmethod
#     def is_paused(self, queue: QueueName) -> bool:
#         raise NotImplementedError()


# Path: django_lightweight_queue/management/commands/queue_pause.py
import re
import argparse
import datetime
from django.core.management.base import BaseCommand, CommandError
from ...types import QueueName
from ...utils import get_backend
from ...backends.base import BackendWithPause

        )

        group = parser.add_mutually_exclusive_group(required=True)
        group.add_argument(
            '--for',
            dest='until',
            action='store',
            type=parse_duration_to_time,
            help=(
                "The duration to pause the queue for. Specify a value like 1h2m3s, "
                "all levels of precision are optional, so 5m and 1h are both valid."
            ),
        )
        group.add_argument(
            '--until',
            action='store',
            type=parse_time,
            help=(
                "The time at which the queue should reactivate. Specify as an "
                "ISO 8601 value, specifically one parsable via datetime.strptime "
                f"using {TIME_FORMAT.replace('%', r'%%')!r}, such as {utcnow():{TIME_FORMAT}}."
            ),
        )

    def handle(self, queue: QueueName, until: datetime.datetime, **options: object) -> None:
        if until < utcnow():
            raise CommandError("Refusing to pause until a time in the past.")

        backend = get_backend(queue)


        if not isinstance(backend, BackendWithPause):