def get_service(hass, config):
    """Get the instapush notification service."""
    if not validate_config({DOMAIN: config},
                           {DOMAIN: [CONF_API_KEY,
                                     'app_secret',
                                     'event',
                                     'tracker']},
                           _LOGGER):
        return None

    headers = {'x-instapush-appid': config[CONF_API_KEY],
               'x-instapush-appsecret': config['app_secret']}

    try:
        response = requests.get(_RESOURCE + 'events/list',
                                headers=headers).json()
    except __HOLE__:
        _LOGGER.error('Unexpected answer from Instapush API.')
        return None

    if 'error' in response:
        _LOGGER.error(response['msg'])
        return None

    if len([app for app in response if app['title'] == config['event']]) == 0:
        _LOGGER.error(
            "No app match your given value. "
            "Please create an app at https://instapush.im")
        return None

    return InstapushNotificationService(
        config[CONF_API_KEY], config['app_secret'], config['event'],
        config['tracker'])


# pylint: disable=too-few-public-methods
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/notify/instapush.py/get_service