query_extract.py