def METHOD_NAME(self, raw_selector_string):
    selector = Selector(raw_selector_string)
    with self.lock:
        node = self.parent
        while node is not None:
            if selector.match(node):
                break
            node = node.parent
    return node