def __init__(self,
               module_configuration,
               host,
               balanced_port,
               api_host,
               api_port,
               auth_domain,
               runtime_stderr_loglevel,
               php_config,
               python_config,
               java_config,
               custom_config,
               cloud_sql_config,
               vm_config,
               default_version_port,
               port_registry,
               request_data,
               dispatcher,
               max_instances,
               use_mtime_file_watcher,
               automatic_restarts,
               allow_skipped_files,
               threadsafe_override):
    self._module_configuration = module_configuration
    self._name = module_configuration.module_name
    self._version = module_configuration.major_version
    self._app_name_external = module_configuration.application_external_name
    self._host = host
    self._api_host = api_host
    self._api_port = api_port
    self._auth_domain = auth_domain
    self._runtime_stderr_loglevel = runtime_stderr_loglevel
    self._balanced_port = balanced_port
    self._php_config = php_config
    self._python_config = python_config
    self._java_config = java_config
    self._custom_config = custom_config
    self._cloud_sql_config = cloud_sql_config
    self._vm_config = vm_config
    self._request_data = request_data
    self._allow_skipped_files = allow_skipped_files
    self._threadsafe_override = threadsafe_override
    self._dispatcher = dispatcher
    self._max_instances = max_instances
    self._automatic_restarts = automatic_restarts
    self._use_mtime_file_watcher = use_mtime_file_watcher
    self._default_version_port = default_version_port
    self._port_registry = port_registry

    if self.effective_runtime == 'custom':
      if self._custom_config.runtime and self._custom_config.custom_entrypoint:
        raise errors.InvalidAppConfigError(
            'Cannot set both --runtime and --custom_entrypoint.')
      elif self._custom_config.runtime:
        actual_runtime = self._custom_config.runtime
        self._module_configuration.effective_runtime = actual_runtime
      elif not self._custom_config.custom_entrypoint:
        raise errors.InvalidAppConfigError(
            'Must set either --runtime or --custom_entrypoint.  For a '
            'standard runtime, set the --runtime flag with one of %s.  '
            'For a custom runtime, set the --custom_entrypoint with a '
            'command to start your app.' % runtime_factories.valid_runtimes())

    self._instance_factory = self._create_instance_factory(
        self._module_configuration)
    if self._automatic_restarts:
      self._watcher = file_watcher.get_file_watcher(
          [self._module_configuration.application_root] +
          self._instance_factory.get_restart_directories(),
          self._use_mtime_file_watcher)
    else:
      self._watcher = None
    self._handler_lock = threading.Lock()
    self._handlers = self._create_url_handlers()
    self._balanced_module = wsgi_server.WsgiServer(
        (self._host, self._balanced_port), self)
    self._quit_event = threading.Event()  # Set when quit() has been called.

    # TODO: Remove after the Files API is really gone.
    if self._module_configuration.runtime.startswith('python'):
      self._filesapi_warning_message = _FILESAPI_DEPRECATION_WARNING_PYTHON
    elif self._module_configuration.runtime.startswith('java'):
      self._filesapi_warning_message = _FILESAPI_DEPRECATION_WARNING_JAVA
    elif self._module_configuration.runtime.startswith('go'):
      self._filesapi_warning_message = _FILESAPI_DEPRECATION_WARNING_GO
    else:
      self._filesapi_warning_message = None
Initializer for Module.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/module.py/Module.__init__