def _get_value_complex(doc, key):
    """
    Extracts a value from a nested set of dictionaries 'doc' based on
    a 'key' string.
    The key is expected to be a jsonpath_rw expression:
    http://jsonpath-rw.readthedocs.io/en/stable/

    Returns the extracted value from the key specified (if found)
    Returns None if the key can not be found
    """
    jsonpath_expr = parse(key)
    matches = jsonpath_expr.find(doc)
    value = None if len(matches) < 1 else matches[0].value
    return value

    Extracts a value from a nested set of dictionaries 'doc' based on
    a 'key' string.
    The key is expected to be a jsonpath_rw expression:
    http://jsonpath-rw.readthedocs.io/en/stable/

    Returns the extracted value from the key specified (if found)
    Returns None if the key can not be found
    
st2client/st2client/utils/jsutil.py