format_labeled: Pretty-print an expression with labels substituted
Description
Recursive analogue of expr_name() that substitutes user-supplied
labels (see set_label()) for sub-expressions wherever they are set,
falling back to the structural name on unlabelled nodes. Mirrors
CVXPY's Expression.format_labeled.