def METHOD_NAME(df_groupby, item):
    try:
        hash(item)
        hashable = True
    except TypeError:
        hashable = False
    if hashable and item in df_groupby.dtypes:
        output_types = [OutputType.series_groupby]
    elif isinstance(item, Iterable) and all(it in df_groupby.dtypes for it in item):
        output_types = [OutputType.dataframe_groupby]
    else:
        raise NameError(f"Cannot slice groupby with {item!r}")
    if df_groupby.selection:
        raise IndexError(f"Column(s) {df_groupby.selection!r} already selected")
    op = GroupByIndex(selection=item, output_types=output_types)
    return op(df_groupby)