def calc_info(node):
    """Return a string with the summary of the state of a CalculationNode."""
    from aiida.orm import ProcessNode, WorkChainNode
    if not isinstance(node, ProcessNode):
        raise TypeError('Unknown type: {}'.format(type(node)))
    process_label = node.process_label
    process_state = node.process_state.value.capitalize()
    exit_status = node.exit_status
    if exit_status is not None:
        string = '{}<{}> {} [{}]'.format(process_label, node.pk,
            process_state, exit_status)
    else:
        string = '{}<{}> {}'.format(process_label, node.pk, process_state)
    if isinstance(node, WorkChainNode) and node.stepper_state_info:
        string += ' [{}]'.format(node.stepper_state_info)
    return string
