parameters: (index, retry=3)
docstring: connect to ES with retry
docstring_summary: connect to ES with retry
docstring_tokens: connect to ES with retry
function: def safe_check_index(index, retry=3):
      """ connect to ES with retry """
      if not retry:
          print("Out of retries. Bailing out...")
          sys.exit(1)
      try:
          status = es.indices.exists(index)
          return status
      except exceptions.ConnectionError as e:
          print("Unable to connect to ES. Retrying in 5 secs...")
          time.sleep(5)
          safe_check_index(index, retry-1)
function_tokens: def safe_check_index ( index , retry = 3 ) : if not retry : print ( "Out of retries. Bailing out..." ) sys . exit ( 1 ) try : status = es . indices . exists ( index ) return status except exceptions . ConnectionError as e : print ( "Unable to connect to ES. Retrying in 5 secs..." ) time . sleep ( 5 ) safe_check_index ( index , retry - 1 )