def METHOD_NAME(node, nbr):
    # find the common edge
    for u, v in pairwise(faces[nbr] + faces[nbr][0:1]):
        if u in faces[node] and v in faces[node]:
            # node and nbr have edge u-v in common
            i = faces[node].index(u)
            j = faces[node].index(v)
            if i == j - 1 or (j == 0 and u == faces[node][-1]):
                # if the traversal of a neighboring halfedge
                # is in the same direction
                # flip the neighbor
                faces[nbr][:] = faces[nbr][::-1]
                return