def _parse_asn_query(self, query_str):
<EOL>query_str_parts = self._get_query_parts(query_str)<EOL>query_parts = list()<EOL>for query_str_part in query_str_parts:<EOL><INDENT>is_int = True<EOL>try:<EOL><INDENT>int(query_str_part['<STR_LIT:string>'])<EOL><DEDENT>except ValueError:<EOL><INDENT>is_int = False<EOL><DEDENT>if is_int:<EOL><INDENT>self._logger.debug("<STR_LIT>" + query_str_part['<STR_LIT:string>'] + "<STR_LIT>")<EOL>query_parts.append({<EOL>'<STR_LIT>': {<EOL>'<STR_LIT:string>': query_str_part['<STR_LIT:string>'],<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': query_str_part['<STR_LIT:string>']<EOL>})<EOL><DEDENT>else:<EOL><INDENT>self._logger.debug("<STR_LIT>" + query_str_part['<STR_LIT:string>'] + "<STR_LIT>")<EOL>query_parts.append({<EOL>'<STR_LIT>': {<EOL>'<STR_LIT:string>': query_str_part['<STR_LIT:string>'],<EOL>'<STR_LIT>': '<STR_LIT:text>',<EOL>'<STR_LIT>': '<STR_LIT:name>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT:name>',<EOL>'<STR_LIT>': query_str_part['<STR_LIT:string>']<EOL>})<EOL><DEDENT><DEDENT>query = {}<EOL>if len(query_parts) > <NUM_LIT:0>:<EOL><INDENT>query = query_parts[<NUM_LIT:0>]<EOL><DEDENT>if len(query_parts) > <NUM_LIT:1>:<EOL><INDENT>for query_part in query_parts[<NUM_LIT:1>:]:<EOL><INDENT>query = {<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': query_part,<EOL>'<STR_LIT>': query<EOL>}<EOL><DEDENT><DEDENT>return True, query<EOL>
Parse a smart search query for ASNs

            This is a helper function to smart_search_asn for easier unit
            testing of the parser.