'Does this pattern exactly match a sequence of nodes?'

def match_seq(self, nodes, results=None):

    for (c, r) in self.generate_matches(nodes):
        if (c == len(nodes)):
            if (results is not None):
                results.update(r)
                if self.name:
                    results[self.name] = list(nodes)
            return True
    return False
