code: def transmissions(self, direction="outgoing", status="all", failed=False):
          if direction not in ["incoming", "outgoing", "all"]:
              raise(ValueError("You cannot get transmissions of direction {}."
                               .format(direction) +
                    "Type can only be incoming, outgoing or all."))
          if status not in ["all", "pending", "received"]:
              raise(ValueError("You cannot get transmission of status {}."
                               .format(status) +
                    "Status can only be pending, received or all"))
          if failed not in ["all", False, True]:
              raise ValueError("{} is not a valid transmission failed"
                               .format(failed))
          if direction == "all":
              if status == "all":
                  return Transmission.query\
                      .filter(and_(Transmission.failed == False,
                                   or_(Transmission.destination_id == self.id,
                                       Transmission.origin_id == self.id)))\
                      .all()
              else:
                  return Transmission.query\
                      .filter(and_(Transmission.failed == False,
                                   Transmission.status == status,
                                   or_(Transmission.destination_id == self.id,
                                       Transmission.origin_id == self.id)))\
                      .all()
          if direction == "incoming":
              if status == "all":
                  return Transmission.query\
                      .filter_by(failed=False, destination_id=self.id)\
                      .all()
              else:
                  return Transmission.query\
                      .filter(and_(Transmission.failed == False,
                                   Transmission.destination_id == self.id,
                                   Transmission.status == status))\
                      .all()
          if direction == "outgoing":
              if status == "all":
                  return Transmission.query\
                      .filter_by(failed=False, origin_id=self.id)\
                      .all()
              else:
                  return Transmission.query\
                      .filter(and_(Transmission.failed == False,
                                   Transmission.origin_id == self.id,
                                   Transmission.status == status))\
                      .all()