def jsonpath_query(value, query):
    """Extracts data from an object `value` using a JSONPath `query`.
    :link: https://github.com/kennknowles/python-jsonpath-rw
    :param value: a object (dict, array, etc) to query
    :param query: a JSONPath query expression (string)
    :returns: the result of the query executed on the value
    :rtype: dict, array, int, string, bool
    """
    expr = jsonpath_rw.parse(query)

    matches = [match.value for match in expr.find(value)]

    if not matches:
        return None

    return matches
Extracts data from an object `value` using a JSONPath `query`.
    :link: https://github.com/kennknowles/python-jsonpath-rw
    :param value: a object (dict, array, etc) to query
    :param query: a JSONPath query expression (string)
    :returns: the result of the query executed on the value
    :rtype: dict, array, int, string, bool
    
st2common/st2common/expressions/functions/data.py