def getHeaders(document):
 return domhelpers.findElements(document, (lambda n, m=re.compile('h[23]$').match: m(n.nodeName)))

def getHeaders ( document ) : return domhelpers . findElements ( document , ( lambda n , m = re . compile ( 'h[23]$' ) . match : m ( n . nodeName ) ) )
return all h2 and h3 nodes in the given document .