<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _build_grp_constraints(roles, network_constraints):
 """Generate constraints at the group level, It expands the group names and deal with symetric constraints. """

    # generate defaults constraints
    constraints = _generate_default_grp_constraints(roles,
                                                    network_constraints)
    # Updating the constraints if necessary
    if 'constraints' in network_constraints:
        actual = _generate_actual_grp_constraints(network_constraints)
        _merge_constraints(constraints, actual)

    return constraints