# Path: sacred/observers/base.py
# class RunObserver:
#     """Defines the interface for all run observers."""
# 
#     priority = 0
# 
#     def queued_event(
#         self, ex_info, command, host_info, queue_time, config, meta_info, _id
#     ):
#         pass
# 
#     def started_event(
#         self, ex_info, command, host_info, start_time, config, meta_info, _id
#     ):
#         pass
# 
#     def heartbeat_event(self, info, captured_out, beat_time, result):
#         pass
# 
#     def completed_event(self, stop_time, result):
#         pass
# 
#     def interrupted_event(self, interrupt_time, status):
#         pass
# 
#     def failed_event(self, fail_time, fail_trace):
#         pass
# 
#     def resource_event(self, filename):
#         pass
# 
#     def artifact_event(self, name, filename, metadata=None, content_type=None):
#         pass
# 
#     def log_metrics(self, metrics_by_name, info):
#         pass
# 
#     def join(self):
#         pass
# 
# Path: sacred/utils.py
# class IntervalTimer(threading.Thread):
#     @classmethod
#     def create(cls, func, interval=10):
#         stop_event = threading.Event()
#         timer_thread = cls(stop_event, func, interval)
#         return stop_event, timer_thread
# 
#     def __init__(self, event, func, interval=10.0):
#         super().__init__()
#         self.stopped = event
#         self.func = func
#         self.interval = interval
# 
#     def run(self):
#         while not self.stopped.wait(self.interval):
#             self.func()
#         self.func()


from collections import namedtuple
from queue import Queue
from sacred.observers.base import RunObserver
from sacred.utils import IntervalTimer
import traceback
import logging
    def __init__(
        self,
        covered_observer: RunObserver,
        interval: float = 20.0,
        retry_interval: float = 10.0,
    ):
        """Initialize QueueObserver.

        Parameters
        ----------
        covered_observer
            The real observer that is being wrapped.
        interval
            The interval in seconds at which the background thread is woken up to process new events.
        retry_interval
            The interval in seconds to wait if an event failed to be processed.
        """
        self._covered_observer = covered_observer
        self._retry_interval = retry_interval
        self._interval = interval
        self._queue = None
        self._worker = None
        self._stop_worker_event = None
        logger.debug("just testing")

    def queued_event(self, *args, **kwargs):
        self._queue.put(WrappedEvent("queued_event", args, kwargs))

    def started_event(self, *args, **kwargs):
        self._queue = Queue()

# Path: sacred/observers/base.py
# class RunObserver:
#     """Defines the interface for all run observers."""
# 
#     priority = 0
# 
#     def queued_event(
#         self, ex_info, command, host_info, queue_time, config, meta_info, _id
#     ):
#         pass
# 
#     def started_event(
#         self, ex_info, command, host_info, start_time, config, meta_info, _id
#     ):
#         pass
# 
#     def heartbeat_event(self, info, captured_out, beat_time, result):
#         pass
# 
#     def completed_event(self, stop_time, result):
#         pass
# 
#     def interrupted_event(self, interrupt_time, status):
#         pass
# 
#     def failed_event(self, fail_time, fail_trace):
#         pass
# 
#     def resource_event(self, filename):
#         pass
# 
#     def artifact_event(self, name, filename, metadata=None, content_type=None):
#         pass
# 
#     def log_metrics(self, metrics_by_name, info):
#         pass
# 
#     def join(self):
#         pass
# 
# Path: sacred/utils.py
# class IntervalTimer(threading.Thread):
#     @classmethod
#     def create(cls, func, interval=10):
#         stop_event = threading.Event()
#         timer_thread = cls(stop_event, func, interval)
#         return stop_event, timer_thread
# 
#     def __init__(self, event, func, interval=10.0):
#         super().__init__()
#         self.stopped = event
#         self.func = func
#         self.interval = interval
# 
#     def run(self):
#         while not self.stopped.wait(self.interval):
#             self.func()
#         self.func()


# Path: sacred/observers/queue.py
from collections import namedtuple
from queue import Queue
from sacred.observers.base import RunObserver
from sacred.utils import IntervalTimer
import traceback
import logging

    def __init__(
        self,
        covered_observer: RunObserver,
        interval: float = 20.0,
        retry_interval: float = 10.0,
    ):
        """Initialize QueueObserver.

        Parameters
        ----------
        covered_observer
            The real observer that is being wrapped.
        interval
            The interval in seconds at which the background thread is woken up to process new events.
        retry_interval
            The interval in seconds to wait if an event failed to be processed.
        """
        self._covered_observer = covered_observer
        self._retry_interval = retry_interval
        self._interval = interval
        self._queue = None
        self._worker = None
        self._stop_worker_event = None
        logger.debug("just testing")

    def queued_event(self, *args, **kwargs):
        self._queue.put(WrappedEvent("queued_event", args, kwargs))

    def started_event(self, *args, **kwargs):
        self._queue = Queue()

        self._stop_worker_event, self._worker = IntervalTimer.create(