def manage_groups(dset):
    """
manage_groups
    description:
        Prompts the user with options to manage group assignments on the Dataset instance:
            - Assign indices to a group
            - View assigned group indices
            - Get data by group
        Returns a boolean indicating whether the user is finished with assigning groups.
        (this function gets called again if False is returned)
    parameters:
        dset (lipydomics.data.Dataset) -- lipidomics dataset instance
    returns:
        (bool) -- finished managing groups
"""
    print('Managing groups... What would you like to do?')
    print("\t1. Assign group")
    print("\t2. View assigned groups")
    print("\t3. Get data by group(s)")
    print('\t"back" to go back')
    option = input('> ')

    if option == "1":
        print("Please provide a name for a group and its indices in order of name > starting index > ending index."
              "\n\t* group name should not contain spaces\n\t* indices start at 0\n\t* example: 'A 1 3'")
        group = input('> ')
        group = group.split()
        name = group[0]
        indices = [_ for _ in range(int(group[1]), int(group[2]) + 1)]
        try:
            dset.assign_groups({name: indices})
            print('! INFO: Assigned indices: {} to group: "{}"'.format(dset.group_indices[name], name))
        except ValueError as ve:
            print('! ERROR:', ve)
            print("! ERROR: Failed to assign group, please check your formatting and try again")

    elif option == "2":
        for group in dset.group_indices:
            print('\t"{}": {}'.format(group, dset.group_indices[group]))
        return False

    elif option == "3":
        print("Which group would you like to view?")
        name = input('> ')
        print(dset.get_data_bygroup(name))
        return False

    elif option == 'back':
        return True

    else:
        print('! ERROR: unrecognized option: "{}"'.format(option))
        return False