Scan for all ids in the given sls and return them in a dict; {name: state}

def find_sls_ids(sls, high):
    '''
    Scan for all ids in the given sls and return them in a dict; {name: state}
    '''
    ret = []
    for nid, item in six.iteritems(high):
        try:
            sls_tgt = item['__sls__']
        except TypeError:
            if nid != '__exclude__':
                log.error(
                    'Invalid non-dict item \'%s\' in high data. Value: %r',
                    nid, item
                )
            continue
        else:
            if sls_tgt == sls:
                for st_ in item:
                    if st_.startswith('__'):
                        continue
                    ret.append((nid, st_))
    return ret