def compare_connexion(conn1, conn2):
    """See if two connexions are the same.
    Because the :class:`connexion` could store the two components in different
    orders, or have different instances of the same component object, direct
    comparison may fail. This function explicitly compares both possible
    combinations of serial numbers.

    Parameters
    ----------
    conn1 : :obj:`connexion`
        The first connexion object.
    conn2 : :obj:`connexion`
        The second connexion object.

    Returns
    -------
    :obj:`True` if the connexions are the same, :obj:`False` otherwise.
    """
    sn11 = conn1.comp1.sn
    sn12 = conn1.comp2.sn
    sn21 = conn2.comp1.sn
    sn22 = conn2.comp2.sn

    if (sn11 == sn21 and sn12 == sn22) or (sn11 == sn22 and sn12 == sn21):
        return True
    else:
        return False