def get_es(hosts=None, timeout=None, **settings):
 hosts = (hosts or getattr(dj_settings, 'ES_HOSTS', DEFAULT_HOSTS))
 timeout = (timeout if (timeout is not None) else getattr(dj_settings, 'ES_TIMEOUT', DEFAULT_TIMEOUT))
 return Elasticsearch(hosts, timeout=timeout, **settings)

def get_es ( hosts = None , timeout = None , ** settings ) : hosts = ( hosts or getattr ( dj_settings , 'ES_HOSTS' , DEFAULT_HOSTS ) ) timeout = ( timeout if ( timeout is not None ) else getattr ( dj_settings , 'ES_TIMEOUT' , DEFAULT_TIMEOUT ) ) return Elasticsearch ( hosts , timeout = timeout , ** settings )
create an es object and return it .