def nodes(self, type=None, failed=False, participant_id=None):
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 participant_id is not None:<EOL><INDENT>if failed == "<STR_LIT:all>":<EOL><INDENT>return type.query.filter_by(<EOL>network_id=self.id, participant_id=participant_id<EOL>).all()<EOL><DEDENT>else:<EOL><INDENT>return type.query.filter_by(<EOL>network_id=self.id, participant_id=participant_id, failed=failed<EOL>).all()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if failed == "<STR_LIT:all>":<EOL><INDENT>return type.query.filter_by(network_id=self.id).all()<EOL><DEDENT>else:<EOL><INDENT>return type.query.filter_by(failed=failed, network_id=self.id).all()<EOL><DEDENT><DEDENT>
Get nodes in the network.

        type specifies the type of Node. Failed can be "all", False
        (default) or True. If a participant_id is passed only
        nodes with that participant_id will be returned.