def get_ndx_groups(ndx, **kwargs):
fd, tmp_ndx = tempfile.mkstemp(suffix='<STR_LIT>')<EOL>kwargs['<STR_LIT:o>'] = tmp_ndx<EOL>try:<EOL><INDENT>g = parse_ndxlist(make_ndx_captured(n=ndx, **kwargs)[<NUM_LIT:1>])<EOL><DEDENT>finally:<EOL><INDENT>utilities.unlink_gmx(tmp_ndx)<EOL><DEDENT>return g<EOL>
Return a list of index groups in the index file *ndx*.

    :Arguments:
        - *ndx*  is a Gromacs index file.
        - kwargs are passed to :func:`make_ndx_captured`.

    :Returns:
        list of groups as supplied by :func:`parse_ndxlist`

    Alternatively, load the index file with
    :class:`gromacs.formats.NDX` for full control.