def write_landmarks(path, lms, orientation='xy'):
    """
    Write landmarks to path. 
    Standard orientation is ij, to store coordinates as xy, 
    one should be set orientation to 'xy' (this is default behavior).
    """
    if orientation == 'xy':
        lms = lms.copy()
        lms[:, [0, 1]] = lms[:, [1, 0]]
    with open(path, 'w') as fout:
        for lm in lms:            
            fout.write('\t%d\t%d\n' % (lm[0], lm[1]))
dataset/ETHPy150Open dfdx/masque/masque/utils.py/write_landmarks/original