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