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: Shut down the server by trying to terminate/kill its process.
  
  First we attempt to terminate the server process gracefully (sending SIGTERM signal). However after
  _TIME_TO_KILL seconds if the process didn't shutdown, we forcefully kill it with a SIGKILL signal.
docstr_tok: ["Shut","down","the","server","by","trying","to","terminate\/kill","its","process",".","First","we","attempt","to","terminate","the","server","process","gracefully","(","sending","SIGTERM","signal",")",".","However","after","_TIME_TO_KILL","seconds","if","the","process","did","n't","shutdown",",","we","forcefully","kill","it","with","a","SIGKILL","signal","."]
code: def shutdown(self):
      """
      Shut down the server by trying to terminate/kill its process.
  
      First we attempt to terminate the server process gracefully (sending SIGTERM signal). However after
      _TIME_TO_KILL seconds if the process didn't shutdown, we forcefully kill it with a SIGKILL signal.
      """
      if not self._process:
          return
      try:
          kill_time = time.time() + self._TIME_TO_KILL
          while (
              self._process.poll() is None and time.time() < kill_time
          ):
              self._process.terminate()
              time.sleep(0.2)
          if self._process().poll() is None:
              self._process.kill()
              time.sleep(0.2)
          if self._verbose:
              print(
                  "Local H2O server %s:%s stopped."
                  % (self.ip, self.port)
              )
      except:
          pass
      self._process = 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 3 for calling the H2OLocalServer obj's underlying member method code with example usage: obj.shutdown() without return types