@classmethod
def from_dict(cls, dictionary):
    states = (None if ('states' not in dictionary) else dictionary['states'])
    transitions = dictionary['transitions']
    data_flows = dictionary['data_flows']
    state = cls(name=dictionary['name'], state_id=dictionary['state_id'], input_data_ports=dictionary['input_data_ports'], output_data_ports=dictionary['output_data_ports'], outcomes=dictionary['outcomes'], states=None, transitions=(transitions if states else None), data_flows=(data_flows if states else None), scoped_variables=dictionary['scoped_variables'], load_from_storage=True)
    try:
        state.description = dictionary['description']
    except (TypeError, KeyError):
        import traceback
        formatted_lines = traceback.format_exc().splitlines()
        logger.warning("Erroneous description for state '{1}': {0}".format(formatted_lines[(- 1)], dictionary['name']))
    if states:
        return state
    else:
        return (state, dictionary['transitions'], dictionary['data_flows'])
@classmethod
def from_dict(cls, dictionary):
    states = (None if ('states' not in dictionary) else dictionary['states'])
    transitions = dictionary['transitions']
    data_flows = dictionary['data_flows']
    state = cls(name=dictionary['name'], state_id=dictionary['state_id'], input_data_ports=dictionary['input_data_ports'], output_data_ports=dictionary['output_data_ports'], outcomes=dictionary['outcomes'], states=None, transitions=(transitions if states else None), data_flows=(data_flows if states else None), scoped_variables=dictionary['scoped_variables'], load_from_storage=True)
    try:
        state.description = dictionary['description']
    except (TypeError, KeyError):
        import traceback
        formatted_lines = traceback.format_exc().splitlines()
        logger.warning("Erroneous description for state '{1}': {0}".format(formatted_lines[(- 1)], dictionary['name']))
    if states:
        return state
    else:
        return (state, dictionary['transitions'], dictionary['data_flows'])