code: def update_bokehjs_versions(
      config: Config, system: System
  ) -> ActionReturn:
      def update_package_json(content: dict[str, Any]) -> None:
          content["version"] = config.js_version
  
      def update_package_lock_json(content: dict[str, Any]) -> None:
          assert (
              content["lockfileVersion"] == 3
          ), "Expected lock file v3"
          content["version"] = config.js_version
          for pkg in content["packages"].values():
              if pkg.get("name", "").startswith("@bokeh/"):
                  pkg["version"] = config.js_version
  
      files: dict[str, Callable[[dict[str, Any]], None]] = {
          "package.json": update_package_json,
          "make/package.json": update_package_json,
          "src/compiler/package.json": update_package_json,
          "src/lib/package.json": update_package_json,
          "src/server/package.json": update_package_json,
          "test/package.json": update_package_json,
          "package-lock.json": update_package_lock_json,
      }
  
      system.pushd("bokehjs")
  
      for filename, action in files.items():
          content = json.load(open(filename))
          try:
              action(content)
  
              with open(filename, "w") as f:
                  json.dump(content, f, indent=2)
                  f.write("\n")
              config.add_modified(f"bokehjs/{filename}")
          except Exception as e:
              return FAILED(
                  f"Unable to write new version to file {filename!r}",
                  details=e.args,
              )
  
      system.popd()
  
      return PASSED(
          f"Updated version to {config.js_version!r} in files: {list(files.keys())!r}"
      )
  
imports: from __future__ import annotations
  import json
  from typing import Any, Callable
  from .action import FAILED, PASSED, ActionReturn
  from .config import Config
  from .system import System
  from .util import skip_for_prerelease
label_desc: Use image node_id 10 for calling a global function with example usage: update_bokehjs_versions(config, system) and returns: PASSED, FAILED