def fix_trigger_debounce(message_type, msg_tow, numofmsg, debouncetime):
    """
    Rids all false triggers caused by switch debounce

    Parameters
    ----------
    message_type : list
      names of message type
    msg_tow : list
      TOW values of the corresponding messages
    numofmsg : integer
      Count of the number of messages in the list
    debouncetime = integer
      Time in ms of how long to consider a debounce
    """
    prev_trigger_tow = 0
    itt = 0
    while itt < numofmsg:
        if msg_tow[itt] - prev_trigger_tow < debouncetime and message_type[itt
            ] == 'MsgExtEvent':
            msg_tow[itt] = 0
        elif message_type[itt] == 'MsgExtEvent':
            prev_trigger_tow = msg_tow[itt]
        itt += 1
    return
