'Filter the given member list: members are skipped if
- they are private (except if given explicitly)
- they are undocumented (except if undoc-members is given)
The user can override the skipping decision by connecting to the
``autodoc-skip-member`` event.'

def filter_members(self, members, want_all):

    ret = []
    namespace = '.'.join(self.objpath)
    if self.analyzer:
        attr_docs = self.analyzer.find_attr_docs()
    else:
        attr_docs = {}
    for (membername, member) in members:
        isattr = False
        if (want_all and membername.startswith('_')):
            skip = True
        elif ((namespace, membername) in attr_docs):
            skip = False
            isattr = True
        else:
            doc = self.get_attr(member, '__doc__', None)
            skip = ((not self.options.undoc_members) and (not doc))
        if self.env.app:
            skip_user = self.env.app.emit_firstresult('autodoc-skip-member', self.objtype, membername, member, skip, self.options)
            if (skip_user is not None):
                skip = skip_user
        if skip:
            continue
        ret.append((membername, member, isattr))
    return ret
