def nodes(self, type=None, failed=False):
if type is None:<EOL><INDENT>type = Node<EOL><DEDENT>if not issubclass(type, Node):<EOL><INDENT>raise TypeError("<STR_LIT>".format(type))<EOL><DEDENT>if failed not in ["<STR_LIT:all>", False, True]:<EOL><INDENT>raise ValueError("<STR_LIT>".format(failed))<EOL><DEDENT>if failed == "<STR_LIT:all>":<EOL><INDENT>return type.query.filter_by(participant_id=self.id).all()<EOL><DEDENT>else:<EOL><INDENT>return type.query.filter_by(failed=failed, participant_id=self.id).all()<EOL><DEDENT>
Get nodes associated with this participant.

        Return a list of nodes associated with the participant. If specified,
        ``type`` filters by class. By default failed nodes are excluded, to
        include only failed nodes use ``failed=True``, for all nodes use
        ``failed=all``.