class_docstr: Handle to an H2O server launched locally.
  
  Public interface::
  
      hs = H2OLocalServer.start(...)  # launch a new local H2O server
      hs.is_running()                 # check if the server is running
      hs.shutdown()                   # shut down the server
      hs.scheme                       # either "http" or "https"
      hs.ip                           # ip address of the server, typically "127.0.0.1"
      hs.port                         # port on which the server is listening
  
  Once started, the server will run until the script terminates, or until you call ``.shutdown()`` on it. Moreover,
  if the server terminates with an exception, then the server will not stop and will continue to run even after
  Python process exits. This runaway process may end up being in a bad shape (e.g. frozen), then the only way to
  terminate it is to end the Java process from the terminal.
  
  Alternatively, it is possible to start the server as a context manager, in which case it will be automatically
  shut down even if an exception occurs in Python (but not if the Python process is killed)::
  
      with H2OLocalServer.start() as hs:
          # do something with the server -- probably connect to it
class_docstr_tok: ["Handle","to","an","H2O","server","launched","locally",".","Public","interface",":",":","hs","=","H2OLocalServer.start","(","...",")","#","launch","a","new","local","H2O","server","hs.is_running","(",")","#","check","if","the","server","is","running","hs.shutdown","(",")","#","shut","down","the","server","hs.scheme","#","either","``","http","''","or","``","https","''","hs.ip","#","ip","address","of","the","server",",","typically","``","127.0.0.1","''","hs.port","#","port","on","which","the","server","is","listening","Once","started",",","the","server","will","run","until","the","script","terminates",",","or","until","you","call","``",".shutdown","(",")","``","on","it",".","Moreover",",","if","the","server","terminates","with","an","exception",",","then","the","server","will","not","stop","and","will","continue","to","run","even","after","Python","process","exits",".","This","runaway","process","may","end","up","being","in","a","bad","shape","(","e.g",".","frozen",")",",","then","the","only","way","to","terminate","it","is","to","end","the","Java","process","from","the","terminal",".","Alternatively",",","it","is","possible","to","start","the","server","as","a","context","manager",",","in","which","case","it","will","be","automatically","shut","down","even","if","an","exception","occurs","in","Python","(","but","not","if","the","Python","process","is","killed",")",":",":","with","H2OLocalServer.start","(",")","as","hs",":","#","do","something","with","the","server","--","probably","connect","to","it"]
docstr: Check server's output log, and determine its scheme / IP / port (helper method for `._launch_server()`).
  
  This method is polled during process startup. It looks at the server output log and checks for a presence of
  a particular string ("INFO: Open H2O Flow in your web browser:") which indicates that the server is
  up-and-running. If the method detects this string, it extracts the server's scheme, ip and port and returns
  them; otherwise it returns None.
  
  :returns: (scheme, ip, port) tuple if the server has already started, None otherwise.
docstr_tok: ["Check","server","'s","output","log",",","and","determine","its","scheme","\/","IP","\/","port","(","helper","method","for","`","._launch_server","(",")","`",")",".","This","method","is","polled","during","process","startup",".","It","looks","at","the","server","output","log","and","checks","for","a","presence","of","a","particular","string","(","``","INFO",":","Open","H2O","Flow","in","your","web","browser",":","''",")","which","indicates","that","the","server","is","up-and-running",".","If","the","method","detects","this","string",",","it","extracts","the","server","'s","scheme",",","ip","and","port","and","returns","them",";","otherwise","it","returns","None",".",":","returns",":","(","scheme",",","ip",",","port",")","tuple","if","the","server","has","already","started",",","None","otherwise","."]
code: def _get_server_info_from_logs(self):
      """
      Check server's output log, and determine its scheme / IP / port (helper method for `._launch_server()`).
  
      This method is polled during process startup. It looks at the server output log and checks for a presence of
      a particular string ("INFO: Open H2O Flow in your web browser:") which indicates that the server is
      up-and-running. If the method detects this string, it extracts the server's scheme, ip and port and returns
      them; otherwise it returns None.
  
      :returns: (scheme, ip, port) tuple if the server has already started, None otherwise.
      """
      searchstr = ": Open H2O Flow in your web browser:"
      with open(self._stdout, "rt", encoding="utf-8") as f:
          for line in f:
              if searchstr in line:
                  url = (
                      line[line.index(searchstr) + len(searchstr) :]
                      .strip()
                      .rstrip("/")
                  )
                  parts = url.split(":")
                  assert (
                      len(parts) == 3
                      and (parts[0] == "http" or parts[1] == "https")
                      and parts[2].isdigit()
                  ), ("Unexpected URL: %s" % url)
                  return parts[0], parts[1][2:], int(parts[2])
      return None
  
imports: from h2o.utils.compatibility import *
  import atexit
  import os
  import subprocess
  import sys
  import tempfile
  import time
  import re
  from random import choice
  from sysconfig import get_config_var
  from warnings import warn
  from h2o.exceptions import H2OServerError, H2OStartupError, H2OValueError
  from h2o.utils.typechecks import assert_is_type, assert_satisfies, BoundInt, I, is_type
label_desc: Use image node_id 16 for calling the H2OLocalServer obj's underlying member method code with example usage: obj._get_server_info_from_logs() and returns: None, parts,  parts,  int