# Path: simplemonitor/Monitors/monitor.py
# class Monitor:
# class MonitorFail(Monitor):
# class MonitorNull(Monitor):
#     def __init__(
#         self, name: str = "unnamed", config_options: Optional[dict] = None
#     ) -> None:
#     def get_config_option(
#         self,
#         key: str,
#         *,
#         default: Any = None,
#         required: bool = False,
#         required_type: str = "str",
#         allowed_values: Any = None,
#         allow_empty: bool = True,
#         minimum: Optional[Union[int, float]] = None,
#         maximum: Optional[Union[int, float]] = None,
#     ) -> Any:
#     def dependencies(self) -> List[str]:
#     def dependencies(self, dependency_list: List[str]) -> None:
#     def remaining_dependencies(self) -> List[str]:
#     def is_remote(self) -> bool:
#     def run_test(self) -> Union[NoReturn, bool]:
#     def virtual_fail_count(self) -> int:
#     def test_success(self) -> bool:
#     def first_failure(self) -> bool:
#     def state(self) -> MonitorState:
#     def get_result(self) -> str:
#     def reset_dependencies(self) -> None:
#     def dependency_succeeded(self, dependency: str) -> None:
#     def log_result(self, name: str, logger: Any) -> None:
#     def get_params(self) -> Tuple:
#     def set_mon_refs(self, mmm: Any) -> None:
#     def minimum_gap(self) -> int:
#     def minimum_gap(self, gap: int) -> None:
#     def describe(self) -> str:
#     def is_windows(allow_cygwin: bool = True) -> bool:
#     def _add_unavailable_seconds(self) -> None:
#     def record_fail(self, message: str = "") -> bool:
#     def record_success(self, message: str = "") -> bool:
#     def record_skip(self, which_dep: Optional[str]) -> bool:
#     def uptime(self) -> Optional[datetime.timedelta]:
#     def skipped(self) -> bool:
#     def get_success_count(self) -> int:
#     def all_better_now(self) -> bool:
#     def availability(self) -> float:
#     def first_failure_time(self) -> Optional[arrow.Arrow]:
#     def notify(self) -> bool:
#     def notify(self, value: bool) -> None:
#     def urgent(self) -> bool:
#     def urgent(self, value: Union[bool, int]) -> None:
#     def was_skipped(self) -> bool:
#     def should_run(self) -> bool:
#     def last_virtual_fail_count(self) -> int:
#     def attempt_recover(self) -> None:
#     def run_recovered(self) -> None:
#     def post_config_setup(self) -> None:
#     def __getstate__(self) -> dict:
#     def __setstate__(self, state: dict) -> None:
#     def _set_monitor_logger(self) -> None:
#     def to_python_dict(self) -> dict:
#     def from_python_dict(
#         cls: Any, load_dict: dict
#     ) -> "Monitor":  # can't return Monitor type as flake8 gets cross
#     def get_downtime(self) -> UpDownTime:
#     def get_wasdowntime(self) -> UpDownTime:
#     def get_uptime(self) -> UpDownTime:
#     def state_dict(self) -> dict:
#     def __str__(self) -> str:
#     def __init__(self, name: str, config_options: dict):
#     def run_test(self) -> bool:
#     def describe(self) -> str:
#     def get_params(self) -> Tuple:
#     def run_test(self) -> bool:
#     def get_params(self) -> Tuple:


from typing import Dict, List, Optional, Tuple, cast
from weakref import WeakValueDictionary
from .monitor import Monitor, register
            self.get_config_option(
                "min_fail", required_type="int", default=len(self.monitors), minimum=1
            ),
        )

    def run_test(self) -> bool:
        # we depend on the other tests to run, just check them
        failcount = self.min_fail
        # this check actually doesn't work, since the sub-monitors run AFTER the compound ones...
        if self.m is not None:
            for i in self.monitors:
                if self.m[i].get_success_count() > 0 and self.m[i].tests_run > 0:
                    failcount -= 1
        if failcount < self.min_fail:
            return self.record_success(
                "{} monitors failed (min: {})".format(failcount, self.min_fail)
            )
        return self.record_fail(
            "{} monitors failed (min: {})".format(failcount, self.min_fail)
        )

    def describe(self) -> str:
        """Explains what we do."""
        return "Checking that these monitors all succeeded: {0}".format(
            ", ".join(self.monitors)
        )

    def get_params(self) -> Tuple:
        return (self.monitors,)


# Path: simplemonitor/Monitors/monitor.py
# class Monitor:
# class MonitorFail(Monitor):
# class MonitorNull(Monitor):
#     def __init__(
#         self, name: str = "unnamed", config_options: Optional[dict] = None
#     ) -> None:
#     def get_config_option(
#         self,
#         key: str,
#         *,
#         default: Any = None,
#         required: bool = False,
#         required_type: str = "str",
#         allowed_values: Any = None,
#         allow_empty: bool = True,
#         minimum: Optional[Union[int, float]] = None,
#         maximum: Optional[Union[int, float]] = None,
#     ) -> Any:
#     def dependencies(self) -> List[str]:
#     def dependencies(self, dependency_list: List[str]) -> None:
#     def remaining_dependencies(self) -> List[str]:
#     def is_remote(self) -> bool:
#     def run_test(self) -> Union[NoReturn, bool]:
#     def virtual_fail_count(self) -> int:
#     def test_success(self) -> bool:
#     def first_failure(self) -> bool:
#     def state(self) -> MonitorState:
#     def get_result(self) -> str:
#     def reset_dependencies(self) -> None:
#     def dependency_succeeded(self, dependency: str) -> None:
#     def log_result(self, name: str, logger: Any) -> None:
#     def get_params(self) -> Tuple:
#     def set_mon_refs(self, mmm: Any) -> None:
#     def minimum_gap(self) -> int:
#     def minimum_gap(self, gap: int) -> None:
#     def describe(self) -> str:
#     def is_windows(allow_cygwin: bool = True) -> bool:
#     def _add_unavailable_seconds(self) -> None:
#     def record_fail(self, message: str = "") -> bool:
#     def record_success(self, message: str = "") -> bool:
#     def record_skip(self, which_dep: Optional[str]) -> bool:
#     def uptime(self) -> Optional[datetime.timedelta]:
#     def skipped(self) -> bool:
#     def get_success_count(self) -> int:
#     def all_better_now(self) -> bool:
#     def availability(self) -> float:
#     def first_failure_time(self) -> Optional[arrow.Arrow]:
#     def notify(self) -> bool:
#     def notify(self, value: bool) -> None:
#     def urgent(self) -> bool:
#     def urgent(self, value: Union[bool, int]) -> None:
#     def was_skipped(self) -> bool:
#     def should_run(self) -> bool:
#     def last_virtual_fail_count(self) -> int:
#     def attempt_recover(self) -> None:
#     def run_recovered(self) -> None:
#     def post_config_setup(self) -> None:
#     def __getstate__(self) -> dict:
#     def __setstate__(self, state: dict) -> None:
#     def _set_monitor_logger(self) -> None:
#     def to_python_dict(self) -> dict:
#     def from_python_dict(
#         cls: Any, load_dict: dict
#     ) -> "Monitor":  # can't return Monitor type as flake8 gets cross
#     def get_downtime(self) -> UpDownTime:
#     def get_wasdowntime(self) -> UpDownTime:
#     def get_uptime(self) -> UpDownTime:
#     def state_dict(self) -> dict:
#     def __str__(self) -> str:
#     def __init__(self, name: str, config_options: dict):
#     def run_test(self) -> bool:
#     def describe(self) -> str:
#     def get_params(self) -> Tuple:
#     def run_test(self) -> bool:
#     def get_params(self) -> Tuple:


# Path: simplemonitor/Monitors/compound.py
from typing import Dict, List, Optional, Tuple, cast
from weakref import WeakValueDictionary
from .monitor import Monitor, register

            self.get_config_option(
                "min_fail", required_type="int", default=len(self.monitors), minimum=1
            ),
        )

    def run_test(self) -> bool:
        # we depend on the other tests to run, just check them
        failcount = self.min_fail
        # this check actually doesn't work, since the sub-monitors run AFTER the compound ones...
        if self.m is not None:
            for i in self.monitors:
                if self.m[i].get_success_count() > 0 and self.m[i].tests_run > 0:
                    failcount -= 1
        if failcount < self.min_fail:
            return self.record_success(
                "{} monitors failed (min: {})".format(failcount, self.min_fail)
            )
        return self.record_fail(
            "{} monitors failed (min: {})".format(failcount, self.min_fail)
        )

    def describe(self) -> str:
        """Explains what we do."""
        return "Checking that these monitors all succeeded: {0}".format(
            ", ".join(self.monitors)
        )

    def get_params(self) -> Tuple:
        return (self.monitors,)


    def set_mon_refs(self, mmm: Dict[str, Monitor]) -> None: