

def findall(elem, path):
    try:
        selector = _cache[path]
    except KeyError:
        if (len(_cache) > 100):
            _cache.clear()
        if (path[:1] == '/'):
            raise SyntaxError('cannot use absolute path on element')
        stream = iter(xpath_tokenizer(path))
        next = stream.next
        token = next()
        selector = []
        while 1:
            try:
                selector.append(ops[stream[0]](next, token))
            except StopIteration:
                raise SyntaxError('invalid path')
            try:
                token = next()
                if (token[0] == '/'):
                    token = next()
            except StopIteration:
                break
        _cache[path] = selector
    result = [elem]
    context = _SelectorContext(elem)
    for select in selector:
        result = select(context, result)
    return result

dataset/ETHPy150Open CollabQ/CollabQ/vendor/elementtree/ElementPath.py findall/VarMisuse@110/135 `token`->`stream`