def _tgrep_node_label_pred_use_action(_s, _l, tokens):
    assert len(tokens) == 1
    assert tokens[0].startswith('=')
    node_label = tokens[0][1:]
    def node_label_use_pred(n, m=None, l=None):
        # look up the bound node using its label
        if l is None or node_label not in l:
            raise TgrepException('node_label ={0} not bound in pattern'.format(
                node_label))
        node = l[node_label]
        # truth means the given node is this node
        return n is node
    return node_label_use_pred
Builds a lambda function representing a predicate on a tree node
dataset/ETHPy150Open nltk/nltk/nltk/tgrep.py/_tgrep_node_label_pred_use_action