def row_to_event(row):
    """Convert a databse row to an event."""
    try:
        return Event(row[1], json.loads(row[2]), EventOrigin(row[3]),
                     dt_util.utc_from_timestamp(row[5]))
    except __HOLE__:
        # When json.loads fails
        _LOGGER.exception("Error converting row to event: %s", row)
        return None
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/recorder.py/row_to_event