def _add_instance(self):
    inst = self._instance_factory.new_instance(0)
    wsgi_servr = wsgi_server.WsgiServer(
        (self._host, 0), functools.partial(self._handle_request, inst=inst))
    wsgi_servr.start()
    self._port_registry.add(wsgi_servr.port, self, inst)

    with self._condition:
      if self._quit_event.is_set():
        return
      self._wsgi_server = wsgi_servr
      self._instance = inst
      suspended = self._suspended
    if not suspended:
      self._async_start_instance(wsgi_servr, inst)
Creates and adds a new instance.Instance to the Module.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/module.py/ExternalModule._add_instance