#NEWLINE# @ classmethod #NEWLINE# def _query( cls , args ) : #NEWLINE# #INDENT# api . _timeout = args . timeout #NEWLINE# res = api . Infrastructure . search ( q = args . query ) #NEWLINE# report_warnings ( res ) #NEWLINE# report_errors ( res ) #NEWLINE# if ( format == 'pretty' ) : #NEWLINE# #INDENT# for ( facet , results ) in list ( res [ 'results' ] . items ( ) ) : #NEWLINE# #INDENT# for ( idx , result ) in enumerate ( results ) : #NEWLINE# #INDENT# if ( idx == 0 ) : #NEWLINE# #INDENT# print ( '\n' ) #NEWLINE# print ( ( '%s\t%s' % ( facet , result ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( ( '%s\t%s' % ( ( ' ' * len ( facet ) ) , result ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( format == 'raw' ) : #NEWLINE# #INDENT# print ( json . dumps ( res ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for ( facet , results ) in list ( res [ 'results' ] . items ( ) ) : #NEWLINE# #INDENT# for result in results : #NEWLINE# #INDENT# print ( ( '%s\t%s' % ( facet , result ) ) )