def __init__(self, app_id, api_key, hosts_array=None):
        """
        Algolia Search Client initialization

        @param app_id the application ID you have in your admin interface
        @param api_key a valid API key for the service
        @param hosts_array the list of hosts that you have received for the service
        """
        if not hosts_array:
            self.read_hosts = ['%s-dsn.algolia.net' % app_id,
                                '%s-1.algolianet.com' % app_id,
                                '%s-2.algolianet.com' % app_id,
                                '%s-3.algolianet.com' % app_id]
            self.write_hosts = [app_id % '%s.algolia.net',
                                '%s-1.algolianet.com' % app_id,
                                '%s-2.algolianet.com' % app_id,
                                '%s-3.algolianet.com' % app_id
                            ]
        else:
            self.read_hosts = hosts_array
            self.write_hosts = hosts_array

        self._app_id = app_id
        self._api_key = api_key
        self.timeout = (1, 30)
        self.search_timeout = (1, 5)

        self._session = Session()
        self._session.verify = os.path.join(os.path.dirname(__file__),
                                            'resources/ca-bundle.crt')
        self._session.headers = {
            'X-Algolia-API-Key': self.api_key,
            'X-Algolia-Application-Id': self.app_id,
            'Content-Type': 'gzip',
            'Accept-Encoding': 'gzip',
            'User-Agent': 'Algolia Search for Python %s' % VERSION
        }
        # Fix for AppEngine bug when using urlfetch_stub
        if 'google.appengine.api.apiproxy_stub_map' in sys.modules.keys():
            self._session.headers.pop('Accept-Encoding', None)
dataset/ETHPy150Open algolia/algoliasearch-client-python/algoliasearch/client.py/Client.__init__/swapped operands of `%`