def next_rising_utc(hass, entity_id=None):
    """UTC datetime object of the next sun rising."""
    entity_id = entity_id or ENTITY_ID

    state = hass.states.get(ENTITY_ID)

    try:
        return dt_util.parse_datetime(state.attributes[STATE_ATTR_NEXT_RISING])
    except (__HOLE__, KeyError):
        # AttributeError if state is None
        # KeyError if STATE_ATTR_NEXT_RISING does not exist
        return None
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/sun.py/next_rising_utc