def _hasclass(context, *cls):
 node_classes = set(context.context_node.attrib.get('class', '').split())
 return node_classes.issuperset(cls)

def _hasclass ( context , * cls ) : node_classes = set ( context . context_node . attrib . get ( 'class' , '' ) . split ( ) ) return node_classes . issuperset ( cls )
checks if the context node has all the classes passed as arguments .