<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _list_gids():
    '''
    Return a list of gids in use
    '''
    output = __salt__['cmd.run'](
        ['dscacheutil', '-q', 'group'],
        output_loglevel='quiet',
        python_shell=False
    )
    ret = set()
    for line in salt.utils.itertools.split(output, '\n'):
        if line.startswith('gid:'):
            ret.update(line.split()[1:])
    return sorted(ret)