def get_ndx_group_index(ndxfile, index_strings):
    """Gets the atom group index for the given strings.
    
    INPUT
    ndxfile        - index file *.ndx filename
    index_strings  - either a single string, or a *list* of strings
                     This string MUST be in the form 'Example' 
                     where the field in the *.ndx file is '[ Example ]'
    
    RETURNS
    results        - if a single string supplied, the index (int)
                   - elif a list of strings supples, a list of ints

    """

    assert ((type(index_strings) == str) | (type(index_strings) == list))

    # get all the lines with index headers
    fin = open(ndxfile, 'r')
    index_lines = [ line.strip() for line in fin.readlines() if line.count('[') > 0 ]
    fin.close()

    print('ndxfile', ndxfile)
    print('index_strings', index_strings)
    print('index_lines', index_lines)

    if type(index_strings) == str:
        return index_lines.index( '[ '+index_strings+' ]' )
    if type(index_strings) == list:
        return [ index_lines.index( '[ '+s+' ]' ) for s in index_strings]

    return None