def METHOD_NAME(pnode, key, value):
    '''
    Assuming you have some identifier property (such as graph node id)
    being set on the path nodes, you may use this API to determine if
    the current path has a node with the specified key/value property.
    Example:
        if searchPathLoop(pnode, 'nid', 5):
            continue
    '''
    parent = pnode
    while parent is not None:
        parent, kids, props = parent
        if props.get(key) == value:
            return True
    return False