def transmissions(self, direction="<STR_LIT>", status="<STR_LIT:all>", failed=False):
<EOL>if direction not in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT:all>"]:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(direction)<EOL>+ "<STR_LIT>"<EOL>)<EOL><DEDENT>if status not in ["<STR_LIT:all>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(status)<EOL>+ "<STR_LIT>"<EOL>)<EOL><DEDENT>if failed not in ["<STR_LIT:all>", False, True]:<EOL><INDENT>raise ValueError("<STR_LIT>".format(failed))<EOL><DEDENT>if direction == "<STR_LIT:all>":<EOL><INDENT>if status == "<STR_LIT:all>":<EOL><INDENT>return (<EOL>Transmission.query.filter(<EOL>and_(<EOL>Transmission.failed == false(),<EOL>or_(<EOL>Transmission.destination_id == self.id,<EOL>Transmission.origin_id == self.id,<EOL>),<EOL>)<EOL>)<EOL>.order_by("<STR_LIT>")<EOL>.all()<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return (<EOL>Transmission.query.filter(<EOL>and_(<EOL>Transmission.failed == false(),<EOL>Transmission.status == status,<EOL>or_(<EOL>Transmission.destination_id == self.id,<EOL>Transmission.origin_id == self.id,<EOL>),<EOL>)<EOL>)<EOL>.order_by("<STR_LIT>")<EOL>.all()<EOL>)<EOL><DEDENT><DEDENT>if direction == "<STR_LIT>":<EOL><INDENT>if status == "<STR_LIT:all>":<EOL><INDENT>return (<EOL>Transmission.query.filter_by(failed=False, destination_id=self.id)<EOL>.order_by("<STR_LIT>")<EOL>.all()<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return (<EOL>Transmission.query.filter(<EOL>and_(<EOL>Transmission.failed == false(),<EOL>Transmission.destination_id == self.id,<EOL>Transmission.status == status,<EOL>)<EOL>)<EOL>.order_by("<STR_LIT>")<EOL>.all()<EOL>)<EOL><DEDENT><DEDENT>if direction == "<STR_LIT>":<EOL><INDENT>if status == "<STR_LIT:all>":<EOL><INDENT>return (<EOL>Transmission.query.filter_by(failed=False, origin_id=self.id)<EOL>.order_by("<STR_LIT>")<EOL>.all()<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return (<EOL>Transmission.query.filter(<EOL>and_(<EOL>Transmission.failed == false(),<EOL>Transmission.origin_id == self.id,<EOL>Transmission.status == status,<EOL>)<EOL>)<EOL>.order_by("<STR_LIT>")<EOL>.all()<EOL>)<EOL><DEDENT><DEDENT>
Get transmissions sent to or from this node.

        Direction can be "all", "incoming" or "outgoing" (default).
        Status can be "all" (default), "pending", or "received".
        failed can be True, False or "all"