def _port_ev_code_to_str (code):
    d = { _widcomm.PORT_EV_RXFLAG : "Received certain character",
          _widcomm.PORT_EV_TXEMPTY : "Transmit Queue Empty",
          _widcomm.PORT_EV_CTS : "CTS changed state",
          _widcomm.PORT_EV_DSR : "DSR changed state",
          _widcomm.PORT_EV_RLSD : "RLSD changed state",
          _widcomm.PORT_EV_BREAK : "BREAK received",
          _widcomm.PORT_EV_ERR : "Line status error occurred",
          _widcomm.PORT_EV_RING : "Ring signal detected",
          _widcomm.PORT_EV_CTSS : "CTS state",
          _widcomm.PORT_EV_DSRS : "DSR state",
          _widcomm.PORT_EV_RLSDS : "RLSD state",
          _widcomm.PORT_EV_OVERRUN : "Receiver buffer overrun",
          _widcomm.PORT_EV_TXCHAR : "Any character transmitted",
          _widcomm.PORT_EV_CONNECTED : "RFCOMM connection established",
          _widcomm.PORT_EV_CONNECT_ERR : "Was not able to establish " \
                                         "connection or disconnected",
          _widcomm.PORT_EV_FC : "Flow control enabled flag changed by remote",
          _widcomm.PORT_EV_FCS : "Flow control status true = enabled" }
    result = []
    for k, v in d.items ():
        if code & k:
            result.append (v)
    if len (result) == 0:
        return code % "Invalid event code %d"
    else:
        return "\n".join (result)
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/pybluez/bluetooth/widcomm.py/_port_ev_code_to_str/swapped operands of `%`