<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def triangulate_quads(quads):
 """ Given a set of quad faces, return them as triangle faces. Parameters quads: (n, 4) int Vertex indices of quad faces Returns faces : (m, 3) int Vertex indices of triangular faces """

    if len(quads) == 0:
        return quads
    quads = np.asanyarray(quads)
    faces = np.vstack((quads[:, [0, 1, 2]],
                       quads[:, [2, 3, 0]]))
    return faces