def reshape_bygroups(items, bygroup_columns='formatted', bygroup_as_index=
    True, bygroup_formatted_suffix='_f', bygroup_collision_suffix='_by'):
    """
    Convert current By group representation to the specified representation

    Parameters
    ----------
    items : :class:`SASDataFrame` or list of :class:`SASDataFrames`
        The DataFrames to process.
    bygroup_columns : string, optional
        The way By group columns should be represented in the output table.  The
        options are 'none' (only use metadata), 'formatted', 'raw', or 'both'.
    bygroup_as_index : boolean, optional
        Specifies whether the By group columns should be converted to indices.
    bygroup_formatted_suffix : string, optional
        The suffix to use on formatted columns if the names collide with existing
        columns.
    bygroup_collision_suffix : string, optional
        The suffix to use on By group columns if there is also a data column
        with the same name.

    See Also
    --------
    :meth:`SASDataFrame.reshape_bygroups`

    Returns
    -------
    :class:`SASDataFrame` or list of :class:`SASDataFrame` objects

    """
    if hasattr(items, 'reshape_bygroups'):
        return items.reshape_bygroups(bygroup_columns=bygroup_columns,
            bygroup_as_index=bygroup_as_index, bygroup_formatted_suffix=
            bygroup_formatted_suffix, bygroup_collision_suffix=
            bygroup_collision_suffix)
    out = []
    for item in items:
        if hasattr(item, 'reshape_bygroups'):
            out.append(item.reshape_bygroups(bygroup_columns=
                bygroup_columns, bygroup_as_index=bygroup_as_index,
                bygroup_formatted_suffix=bygroup_formatted_suffix,
                bygroup_collision_suffix=bygroup_collision_suffix))
        else:
            out.append(item)
    return out
