<s> from avocado . query import pipeline <EOL> from serrano . resources . query . base import QueryBase <EOL> class QueryStatsResource ( QueryBase ) : <EOL> def is_not_found ( self , request , response , ** kwargs ) : <EOL> return self . get_object ( request , ** kwargs ) is None <EOL> def get ( self , request , ** kwargs ) : <EOL> params = self . get_params ( request ) <EOL> instance = self . get_object ( request , ** kwargs ) <EOL> QueryProcessor = pipeline . query_processors [ params [ '<STR_LIT>' ] ] <EOL> processor = QueryProcessor ( tree = params [ '<STR_LIT>' ] ) <EOL> queryset = processor . get_queryset ( request = request ) <EOL> return { <EOL> '<STR_LIT>' : instance . context . count ( queryset = queryset ) , <EOL> '<STR_LIT>' : instance . count ( queryset = queryset ) <EOL> } </s>
