<commit_before>"""Define a SimpliSafe system (attached to a location)."""
import logging
from enum import Enum
from typing import Dict, Union

from .sensor import SensorV2, SensorV3
from .util.string import convert_to_underscore

_LOGGER = logging.getLogger(__name__)


class SystemStates(Enum):
    """Define states that the system can be in."""

    alarm_count = 1
    away = 2
    away_count = 3
    entry_delay = 4
    error = 5
    exit_delay = 6
    home = 7
    home_count = 8
    off = 9
    unknown = 99


class System:
    """Define a system."""

    def __init__(self, api, location_info: dict) -> None:
        """Initialize."""
        self._location_info = location_info
        self.api = api
        self.sensors = {}  # type: Dict[str, Union[SensorV2, SensorV3]]

        self._state = self._coerce_state_from_string(
            location_info["system"]["alarmState"]
        )

    @property
    def address(self) -> bool:
        """Return whether the alarm is going off."""
        return self._location_info["street1"]

    @property
    def alarm_going_off(self) -> bool:
        """Return whether the alarm is going off."""
        return self._location_info["system"]["isAlarming"]

    @property
    def serial(self) -> str:
        """Return the system's serial number."""
        return self._location_info["system"]["serial"]

    @property
    def state(self) -> Enum:<commit_msg>Fix a stale docstring<commit_after>"""Define a SimpliSafe system (attached to a location)."""
import logging
from enum import Enum
from typing import Dict, Union

from .sensor import SensorV2, SensorV3
from .util.string import convert_to_underscore

_LOGGER = logging.getLogger(__name__)


class SystemStates(Enum):
    """Define states that the system can be in."""

    alarm_count = 1
    away = 2
    away_count = 3
    entry_delay = 4
    error = 5
    exit_delay = 6
    home = 7
    home_count = 8
    off = 9
    unknown = 99


class System:
    """Define a system."""

    def __init__(self, api, location_info: dict) -> None:
        """Initialize."""
        self._location_info = location_info
        self.api = api
        self.sensors = {}  # type: Dict[str, Union[SensorV2, SensorV3]]

        self._state = self._coerce_state_from_string(
            location_info["system"]["alarmState"]
        )

    @property
    def address(self) -> bool:
        """Return the street address of the system."""
        return self._location_info["street1"]

    @property
    def alarm_going_off(self) -> bool:
        """Return whether the alarm is going off."""
        return self._location_info["system"]["isAlarming"]

    @property
    def serial(self) -> str:
        """Return the system's serial number."""
        return self._location_info["system"]["serial"]

    @property
    def state(self) -> Enum:
{'fraction_non_alphanumeric': 0.11448763250883393, 'fraction_numerical': 0.011307420494699646, 'mean_word_length': 2.7348284960422165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4357885', 'n_tokens_mistral': 876, 'n_tokens_neox': 836, 'n_words': 252}