code: def __init__(self, *args: t.Any, **config: t.Any):
      assert "working_dir" in config, "`working_dir` is required"
  
      configure_server_logging()
      component_context.component_type = "observer"
  
      super().__init__(*args, **config)
  
      # circus/plugins/__init__.py:282 -> converts all given configs to dict[str, str]
      self.name = self.config.get("name")
      self.bentoml_home = self.config["bentoml_home"]
      self.working_dir = self.config["working_dir"]
  
      # a list of folders to watch for changes
      watch_dirs = [
          self.working_dir,
          os.path.join(self.bentoml_home, "models"),
      ]
  
      if not is_pypi_installed_bentoml():
          # bentoml src from this __file__
          logger.info(
              "BentoML is installed via development mode, adding source root to 'watch_dirs'."
          )
          watch_dirs.append(t.cast(str, source_locations("bentoml")))
  
      logger.info("Watching directories: %s", watch_dirs)
      self.watch_dirs = watch_dirs
  
      self.create_spec()
  
      # a thread to restart circus
      self.exit_event = Event()
  
      self.file_changes = watch(
          *self.watch_dirs,
          watch_filter=None,
          yield_on_timeout=True,  # stop hanging on our tests, doesn't affect the behaviour
          stop_event=self.exit_event,
          rust_timeout=0,  # we should set timeout to zero for no timeout
      )
  
imports: from __future__ import annotations
  import logging
  import os
  import typing
  from pathlib import Path
  from threading import Event
  from threading import Thread
  from typing import TYPE_CHECKING
  import fs
  from circus.plugins import CircusPlugin
  from watchfiles import watch
  from ...bento.build_config import BentoBuildConfig
  from ...bento.build_config import BentoPathSpec
  from ...configuration import is_pypi_installed_bentoml
  from ...context import component_context
  from ...log import configure_server_logging
  from ...utils.pkg import source_locations
label_desc: Use image node_id 1 to create a new ServiceReloaderPlugin object from inherited base classes: CircusPlugin with example: obj = ServiceReloaderPlugin()