

def getMatchedNodes(tr):
    matchedLeafs = []
    for (tree, outcome) in zip(tr.trees, tr.targets):
        matchedLeaf = {
            'text': [],
            'tail': [],
            'attrib': [],
            'content': [],
        }
        for x in tree.iter():
            if (x.text and (outcome in x.text)):
                matchedLeaf['text'].append(x)
            if (x.tail and (outcome in x.tail)):
                matchedLeaf['tail'].append(y)
            if (x.attrib and any([(outcome in y) for y in x.attrib.values()])):
                matchedLeaf['attrib'].append(x)
        matchedLeafs.append(matchedLeaf)
    return matchedLeafs

dataset/ETHPy150Open kootenpv/sky/sky/legacy/scraper.py getMatchedNodes/VarMisuse@128/160 `x`->`y`