def vectors(self, direction="<STR_LIT:all>", failed=False):
<EOL>if direction not in ["<STR_LIT:all>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(direction)<EOL>)<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>if direction == "<STR_LIT:all>":<EOL><INDENT>return Vector.query.filter(<EOL>or_(Vector.destination_id == self.id, Vector.origin_id == self.id)<EOL>).all()<EOL><DEDENT>if direction == "<STR_LIT>":<EOL><INDENT>return Vector.query.filter_by(destination_id=self.id).all()<EOL><DEDENT>if direction == "<STR_LIT>":<EOL><INDENT>return Vector.query.filter_by(origin_id=self.id).all()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if direction == "<STR_LIT:all>":<EOL><INDENT>return Vector.query.filter(<EOL>and_(<EOL>Vector.failed == failed,<EOL>or_(<EOL>Vector.destination_id == self.id,<EOL>Vector.origin_id == self.id,<EOL>),<EOL>)<EOL>).all()<EOL><DEDENT>if direction == "<STR_LIT>":<EOL><INDENT>return Vector.query.filter_by(<EOL>destination_id=self.id, failed=failed<EOL>).all()<EOL><DEDENT>if direction == "<STR_LIT>":<EOL><INDENT>return Vector.query.filter_by(origin_id=self.id, failed=failed).all()<EOL><DEDENT><DEDENT>
Get vectors that connect at this node.

        Direction can be "incoming", "outgoing" or "all" (default).
        Failed can be True, False or all