def sm_filter_opcodes(sm_opcodes, code='equal'):
    """Filter SequenceMatcher opcodes

    Parameters
    ----------
    sm_opcodes : sequence
        The result of difflib.SequenceMatcher.get_opcodes()

    code : string
        The code to remove.

    Returns
    -------
    result : The sequence with the specified operation removed.

    """

    # Define the filter function
    condition = lambda opcode: opcode[0] != code

    # do the filtering
    return list(filter(condition, sm_opcodes))