Dirichlet Boundary Conditions on Subdomains in FEniCSx

Given V as a mixed function space, how can I find the corresponding coordinates of the DOF with the all zero rows?

My attempt is attached. Any suggestions on improvement?

for i in range(V.num_sub_spaces):
    v_sub, sub_to_parent = V.sub(i).collapse()
    
    if len(zero_rows_values_local) > 0:
        coords = v_sub.tabulate_dof_coordinates()
        for dof in zero_rows_values_local:
            if dof in sub_to_parent:
                index = sub_to_parent.index(dof)
                print(f"Found coordinates: {dof = }, {coords[index] = }", flush = True)