def face_areas(faces, axis=<NUM_LIT:1>):
faces = np.asarray(faces)<EOL>if len(faces.shape) == <NUM_LIT:2>:<EOL><INDENT>if faces.shape[<NUM_LIT:1>] != <NUM_LIT:3>: faces = faces.T<EOL>n = <NUM_LIT:2> * (np.max(faces) + <NUM_LIT:1>)<EOL>if axis == <NUM_LIT:0>: tmp = np.reshape(np.arange(n), (<NUM_LIT:2>,-<NUM_LIT:1>)).T<EOL>else:         tmp = np.reshape(np.arange(n), (-<NUM_LIT:1>,<NUM_LIT:2>))<EOL>faces = np.reshape(tmp[faces.flat], (-<NUM_LIT:1>,<NUM_LIT:3>,<NUM_LIT:2>))<EOL><DEDENT>faces = faces.flatten()<EOL>return compose(TriangleArea2DPotential(), part(Ellipsis, faces))<EOL>
face_areas(faces) yields a potential function f(x) that calculates the unsigned area of each
  faces represented by the simplices matrix faces.

If faces is None, then the parameters must arrive in the form of a flattened (n x 3 x 2) matrix
where n is the number of triangles. Otherwise, the faces matrix must be either (n x 3) or (n x 3
x s); if the former, each row must list the vertex indices for the faces where the vertex matrix
is presumed to be shaped (V x 2). Alternately, faces may be a full (n x 3 x 2) simplex array of
the indices into the parameters.

The optional argument axis (default: 1) may be set to 0 if the faces argument is a matrix but
the coordinate matrix will be (2 x V) instead of (V x 2).