#NEWLINE# def search( self , query , entity_type = None ) : #NEWLINE# #INDENT# '\n        Return entities with names matching the given query.\n\n        Query terms are space separated. Matches must contain all terms\n        from the query.\n\n        Will by default return all types of entities available. Limit to one\n        type (politician, individual, organization, industry) with the\n        ``entity_type`` parameter.\n        ' #NEWLINE# if entity_type : #NEWLINE# #INDENT# return self . _get_url_json ( 'entities.json' , ** { #NEWLINE# #INDENT# 'search' : query . encode ( 'ascii' , 'ignore' ) , #NEWLINE# 'type' : self , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . _get_url_json ( 'entities.json' , search = query . encode ( 'ascii' , 'ignore' ) )