def update(self):
        if platform.system().lower() == "windows":
            ping_cmd = "ping -n 1 -w {} {}"\
                .format(DEFAULT_PING_TIMEOUT * 1000, self._host)
        else:
            ping_cmd = "ping -c 1 -W {} {}"\
                .format(DEFAULT_PING_TIMEOUT, self._host)

        status = sp.getstatusoutput(ping_cmd)[0]

        self._state = not bool(status)
Encode ricorsive embedded models and django models
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/switch/wake_on_lan.py/WOLSwitch.update--crossover with--dataset/ETHPy150Open aparo/django-elasticsearch/django_elasticsearch/serializer.py/Encoder.encode_django