def json_query(data, expr):
 if (not HAS_LIB):
  raise AnsibleError('You need to install "jmespath" prior to running json_query filter')
 return jmespath.search(expr, data)

def json_query ( data , expr ) : if ( not HAS_LIB ) : raise AnsibleError ( 'You need to install "jmespath" prior to running json_query filter' ) return jmespath . search ( expr , data )
query data using jmespath query language .