def METHOD_NAME(parsed_response, query: str, expected: Optional[str] = None):
    """
    Check that the JMES path given in 'query' is present in the given response
    Args:
        parsed_response: Response list or dict
        query: JMES query
        expected: Possible value to match against. If None,
            'query' will just check that _something_ is present
    """
    actual = jmespath.search(query, parsed_response)
    msg = "JMES path '{}' not found in response".format(query)
    if actual is None:
        raise exceptions.JMESError(msg)
    if expected is not None:
        # Reuse dict util helper as it should behave the same
        check_keys_match_recursive(expected, actual, [], True)
    elif not actual and not (actual == expected):
        # This can return an empty list, but it might be what we expect. if not,
        # raise an exception
        raise exceptions.JMESError(msg)
    return actual