def matches(self, elem):
        if self.name is not None and elem.name != self.name:
            return False
        if self.id is not None and elem.id != self.id:
            return False
        for c in self.classes:
            if c not in elem.classes:
                return False
        for attr in self.attribs:
            if not elem.attributes.has_key(attr):
                return False
            value = elem.attributes[attr]
            if attr.op == '=' and value != attr.value:
                return False
            elif attr.op == '~=' and attr.value not in value.split():
                return False
            elif attr.op == '|=':
                pre = attr.value.split('-')
                if value.split('-')[:len(pre)] != pre:
                    return False
        for pseudo in self.pseudos:
            if pseudo.name not in elem.pseudo_classes:
                return False
        return True
Determines if the selector matches the given element.  Returns True
dataset/ETHPy150Open ardekantur/pyglet/contrib/layout/layout/css.py/SimpleSelector.matches