class_docstr: HttpServer
  
  Flask HTTP server. Defines two routes, `/parameters` to GET current
  parameters held by this server, and `/update` which can be used to
  POST updates.
class_docstr_tok: ["HttpServer","Flask","HTTP","server",".","Defines","two","routes",",","`","\/parameters","`","to","GET","current","parameters","held","by","this","server",",","and","`","\/update","`","which","can","be","used","to","POST","updates","."]
docstr: Initializes and HTTP server from a serialized Keras model
  a parallelisation mode and a port to run the Flask application on. In
  hogwild mode no read- or write-locks will be acquired, in asynchronous
  mode this is the case.
  
  :param model: Serialized Keras model
  :param mode: parallelization mode, either `asynchronous` or `hogwild`
  :param port: int, port to run the application on
  :param debug: boolean, Flask debug mode
  :param threaded: boolean, Flask threaded application mode
  :param use_reloader: boolean, Flask `use_reloader` argument
docstr_tok: ["Initializes","and","HTTP","server","from","a","serialized","Keras","model","a","parallelisation","mode","and","a","port","to","run","the","Flask","application","on",".","In","hogwild","mode","no","read-","or","write-locks","will","be","acquired",",","in","asynchronous","mode","this","is","the","case",".",":","param","model",":","Serialized","Keras","model",":","param","mode",":","parallelization","mode",",","either","`","asynchronous","`","or","`","hogwild","`",":","param","port",":","int",",","port","to","run","the","application","on",":","param","debug",":","boolean",",","Flask","debug","mode",":","param","threaded",":","boolean",",","Flask","threaded","application","mode",":","param","use_reloader",":","boolean",",","Flask","`","use_reloader","`","argument"]
code: def __init__(self, model: Model, port: int, mode: str, **kwargs):
      """Initializes and HTTP server from a serialized Keras model
      a parallelisation mode and a port to run the Flask application on. In
      hogwild mode no read- or write-locks will be acquired, in asynchronous
      mode this is the case.
  
      :param model: Serialized Keras model
      :param mode: parallelization mode, either `asynchronous` or `hogwild`
      :param port: int, port to run the application on
      :param debug: boolean, Flask debug mode
      :param threaded: boolean, Flask threaded application mode
      :param use_reloader: boolean, Flask `use_reloader` argument
      """
  
      super().__init__(model, port, mode, **kwargs)
      self.master_url = None
  
      if is_running_in_notebook():
          self.threaded = False
          self.use_reloader = False
          self.debug = False
      else:
          self.debug = kwargs.get("debug", True)
          self.threaded = kwargs.get("threaded", True)
          self.use_reloader = kwargs.get("use_reloader", False)
  
      self.lock = Lock()
      self.pickled_weights = None
      self.weights = self.master_network.get_weights()
  
      self.server = Process(target=self.start_flask_service)
  
imports: import abc
  import pickle
  import socket
  from threading import Thread
  from flask import Flask, request
  from multiprocessing import Process
  from tensorflow.keras.models import Model
  from elephas.utils.sockets import determine_master
  from elephas.utils.sockets import receive, send
  from elephas.utils.serialization import dict_to_model
  from elephas.utils.rwlock import RWLock
  from elephas.utils.notebook_utils import is_running_in_notebook
  from elephas.utils import subtract_params
label_desc: Use image node_id 1 to create a new HttpServer object from inherited base classes: BaseParameterServer with example: obj = HttpServer(model, port, mode)