def set_hosts(hosts, use_ssl=False, ssl_cert_path=None):
if type(hosts) != list:<EOL><INDENT>hosts = [hosts]<EOL><DEDENT>conn_params = {<EOL>"<STR_LIT>": hosts,<EOL>"<STR_LIT>": <NUM_LIT:20><EOL>}<EOL>if use_ssl:<EOL><INDENT>conn_params['<STR_LIT>'] = True<EOL>if ssl_cert_path:<EOL><INDENT>conn_params['<STR_LIT>'] = True<EOL>conn_params['<STR_LIT>'] = ssl_cert_path<EOL><DEDENT>else:<EOL><INDENT>conn_params['<STR_LIT>'] = False<EOL><DEDENT><DEDENT>connections.create_connection(**conn_params)<EOL>
Sets the Elasticsearch hosts to use

Args:
    hosts (str): A single hostname or URL, or list of hostnames or URLs
    use_ssl (bool): Use a HTTPS connection to the server
    ssl_cert_path (str): Path to the certificate chain