def get_service(hass, config):
    """Get the PushBullet notification service."""
    from pushbullet import PushBullet
    from pushbullet import InvalidKeyError

    if CONF_API_KEY not in config:
        _LOGGER.error("Unable to find config key '%s'", CONF_API_KEY)
        return None

    try:
        pushbullet = PushBullet(config[CONF_API_KEY])
    except InvalidKeyError:
        _LOGGER.error(
            "Wrong API key supplied. "
            "Get it at https://www.pushbullet.com/account")
        return None

    return PushBulletNotificationService(pushbullet)


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