(node, objtypes)
return None
Traverse up the node's parents until you hit the ``objtypes`` referenced.

    Can either be a single type,
    or a tuple of types.
Traverse up the node's parents until you hit the ``objtypes`` referenced.
Traverse up the node s parents until you hit the objtypes referenced .
def _traverse_parent(node, objtypes):
    """
    Traverse up the node's parents until you hit the ``objtypes`` referenced.

    Can either be a single type,
    or a tuple of types.
    """
    curr_node = node.parent
    while curr_node is not None:
        if isinstance(curr_node, objtypes):
            return curr_node
        curr_node = curr_node.parent
    return None
def _traverse_parent ( node , objtypes ) : curr_node = node . parent while curr_node is not None : if isinstance ( curr_node , objtypes ) : return curr_node curr_node = curr_node . parent return None