def METHOD_NAME(R, t, spin_inverse=False):
    for atm, idx in atmgrp.items():
        x = coords[idx]
        xt = np.dot(x, R.T) + t
        if not spin_inverse:
            x_xt = np.concatenate((x,xt))
        else:
            x_xt = np.concatenate((coords[atmgrp_spin_inv[atm]],xt))
        x_xt = np.mod(x_xt, 1)
        x_xt = np.round(x_xt, -np.log10(tol).astype(int))
        x_xt = np.mod(x_xt, 1)
        sorted_idx = np.lexsort(x_xt.T)
        x_xt = x_xt[sorted_idx]
        diff = np.dot(x_xt[::2] - x_xt[1::2], a)
        if (np.abs(diff) > tol).any():
            return False
    return True