<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def shared_edges(faces_a, faces_b):
 """ Given two sets of faces, find the edges which are in both sets. Parameters --------- faces_a: (n,3) int, set of faces faces_b: (m,3) int, set of faces Returns --------- shared: (p, 2) int, set of edges """

    e_a = np.sort(faces_to_edges(faces_a), axis=1)
    e_b = np.sort(faces_to_edges(faces_b), axis=1)
    shared = grouping.boolean_rows(e_a, e_b, operation=np.intersect1d)
    return shared