def index_get(index, hosts=None, profile=None):
 es = _get_instance(hosts, profile)
 try:
  if index_exists(index):
   ret = es.indices.get(index=index)
   return ret
 except elasticsearch.exceptions.NotFoundError:
  return None
 return None

def index_get ( index , hosts = None , profile = None ) : es = _get_instance ( hosts , profile ) try : if index_exists ( index ) : ret = es . indices . get ( index = index ) return ret except elasticsearch . exceptions . NotFoundError : return None return None
check for the existence of an index and if it exists .