code: def average_onto_face(mesh, per_vert_attrib):
      """Average per-vert attribute onto faces."""
      assert per_vert_attrib.shape[0] == mesh.vertices.shape[0]
      assert len(per_vert_attrib.shape) == 1
      per_face_attrib = per_vert_attrib[mesh.faces]
      per_face_attrib = np.mean(per_face_attrib, axis=1)
      return per_face_attrib
  
imports: import numpy
  from scipy import sparse
  from scipy import spatial
  import trimesh
label_desc: Use image node_id 3 for calling a global function with example usage: average_onto_face(mesh, per_vert_attrib) and returns: per_face_attrib