def _create_embedded_row(value, out_row, out_col_ndx, config, group_values):
    """
    Copies the given output row and assigns the given pattern match
    group values to the corresponding output row columns defined by
    the configuration.

    :return: the new output row
    """
    # Make a new output row.
    row = out_row.copy()
    # Set the embedded column.
    row[out_col_ndx] = value
    # Assign the match group values to the associated output column.
    for grp_col, grp_value in group_values.items():
        # Map the output columns to output values.
        value_dict = config.values_dict.get(grp_col)
        value = value_dict.get(grp_value, grp_value) if value_dict else grp_value
        col_ndx = config.out_col_ndx_map[grp_col]
        row[col_ndx] = value

    return row