def _find_all(self, name, attrs, text, limit, generator, **kwargs):
            "Iterates over a generator looking for things that match."

            if isinstance(name, SoupStrainer):
                strainer = name
            elif text is None and not limit and not attrs and not kwargs:
                # Optimization to find all tags.
                if name is True or name is None:
                    return [element for element in generator
                            if isinstance(element, Tag)]
                # Optimization to find all tags with a given name.
                elif isinstance(name, basestring):
                    return [element for element in generator
                            if isinstance(element, Tag) and element.name == name]
                else:
                    strainer = SoupStrainer(name, attrs, text, **kwargs)
            else:
                # Build a SoupStrainer
                strainer = SoupStrainer(name, attrs, text, **kwargs)
            results = ResultSet(strainer)
            while True:
                try:
                    i = next(generator)
                except __HOLE__:
                    break
                if i:
                    found = strainer.search(i)
                    if found:
                        results.append(found)
                        if limit and len(results) >= limit:
                            break
            return results

        #These generators can be used to navigate starting from both
        #NavigableStrings and Tags.
dataset/ETHPy150Open mtlevolio/pylinkchecker/pylinkchecker/bs4/element.py/PageElement._find_all