def py_split(pd_series, group_by_list, typ="indices"):
    """
    Returns groups defined by the group_by_list
    The group names are the index labels for
    the pd_series (?)
    

    Args:
        typ (str): can be one of ['indices', 'groups']

    Note:
        indices returns the index numbers of the groupings,
        so for example if you group by some value
        then for that value you will get a list of indexes
        within the pd_series in which that value matches
        (Numerical indexes)
        groups returns the index labels of the groupings,
        so not the numerical value but the index label.
    """
    grouped_series = pd_series.groupby(by=group_by_list)

    if typ == "indices":
        return grouped_series.indices
    elif typ == "groups":
        return grouped_series.groups
    else:
        raise Exception("Did not recognize split type")