def __init__(self, resource, location, name, func):
        """Initialize the switch."""
        super().__init__(resource, location, name)
        self._func = func

        request = requests.get('{}/{}'.format(self._resource, self._func),
                               timeout=10)

        if request.status_code is not 200:
            _LOGGER.error("Can't find function. Is device offline?")
            return

        try:
            request.json()['return_value']
        except KeyError:
            _LOGGER.error("No return_value received. "
                          "Is the function name correct.")
        except __HOLE__:
            _LOGGER.error("Response invalid. Is the function name correct.")
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/switch/arest.py/ArestSwitchFunction.__init__