def __init__(self, server="<STR_LIT>", timeout=<NUM_LIT>, bulk_size=<NUM_LIT>,<EOL>encoder=None, decoder=None,<EOL>max_retries=<NUM_LIT:3>,<EOL>retry_time=<NUM_LIT>,<EOL>default_indices=None,<EOL>default_types=None,<EOL>log_curl=False,<EOL>dump_curl=False,<EOL>model=ElasticSearchModel,<EOL>basic_auth=None,<EOL>raise_on_bulk_item_failure=False,<EOL>document_object_field=None,<EOL>bulker_class=ListBulker,<EOL>cert_reqs='<STR_LIT>'):
if default_indices is None:<EOL><INDENT>default_indices = ["<STR_LIT>"]<EOL><DEDENT>self.timeout = timeout<EOL>self.default_indices = default_indices<EOL>self.max_retries = max_retries<EOL>self.retry_time = retry_time<EOL>self.cluster = None<EOL>self.debug_dump = False<EOL>self.cluster_name = "<STR_LIT>"<EOL>self.basic_auth = basic_auth<EOL>self.connection = None<EOL>self._mappings = None<EOL>self.document_object_field = document_object_field<EOL>if model is None:<EOL><INDENT>model = lambda connection, model: model<EOL><DEDENT>self.model = model<EOL>self.log_curl = log_curl<EOL>if dump_curl:<EOL><INDENT>if isinstance(dump_curl, six.string_types):<EOL><INDENT>self.dump_curl = codecs.open(dump_curl, "<STR_LIT:wb>", "<STR_LIT:utf8>")<EOL><DEDENT>elif hasattr(dump_curl, '<STR_LIT>'):<EOL><INDENT>self.dump_curl = dump_curl<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.dump_curl = None<EOL><DEDENT>self._bulk_size = bulk_size  <EOL>self.bulker = bulker_class(weakref.proxy(self), bulk_size=bulk_size,<EOL>raise_on_bulk_item_failure=raise_on_bulk_item_failure)<EOL>self.bulker_class = bulker_class<EOL>self._raise_on_bulk_item_failure = raise_on_bulk_item_failure<EOL>connection_http.CERT_REQS = cert_reqs<EOL>self.info = {}  <EOL>if encoder:<EOL><INDENT>self.encoder = encoder<EOL><DEDENT>if decoder:<EOL><INDENT>self.decoder = decoder<EOL><DEDENT>if isinstance(server, six.string_types):<EOL><INDENT>self.servers = [server]<EOL><DEDENT>elif isinstance(server, tuple):<EOL><INDENT>self.servers = [server]<EOL><DEDENT>else:<EOL><INDENT>self.servers = server<EOL><DEDENT>self.indices = Indices(weakref.proxy(self))<EOL>self.cluster = Cluster(weakref.proxy(self))<EOL>self.default_types = default_types or []<EOL>self._check_servers()<EOL>self._init_connection()<EOL>
Init a es object.
Servers can be defined in different forms:

- host:port with protocol guess (i.e. 127.0.0.1:9200 protocol -> http
                                    127.0.0.1:9500  protocol -> thrift )
- type://host:port (i.e. http://127.0.0.1:9200  https://127.0.0.1:9200 thrift://127.0.0.1:9500)

- (type, host, port) (i.e. tuple ("http", "127.0.0.1", "9200") ("https", "127.0.0.1", "9200")
                                 ("thrift", "127.0.0.1", "9500")). This is the prefered form.

:param server: the server name, it can be a list of servers.
:param timeout: timeout for a call
:param bulk_size: size of bulk operation
:param encoder: tojson encoder
:param max_retries: number of max retries for server if a server is down
:param retry_time: number of seconds between retries
:param basic_auth: Dictionary with 'username' and 'password' keys for HTTP Basic Auth.
:param model: used to objectify the dictinary. If None, the raw dict is returned.


:param dump_curl: If truthy, this will dump every query to a curl file.  If
this is set to a string value, it names the file that output is sent
to.  Otherwise, it should be set to an object with a write() method,
which output will be written to.

:param raise_on_bulk_item_failure: raises an exception if an item in a
bulk operation fails

:param document_object_field: a class to use as base document field in mapper