code: def update_pyproject_toml(
      dependencies: dict[str, dict[str, list[str] | str]]
  ):
      file_content = PYPROJECT_TOML_FILE_PATH.read_text()
      result_content: list[str] = []
      copying = True
      current_type: str | None = None
      line_count: int = 0
      for line in file_content.splitlines():
          if copying:
              result_content.append(line)
          if line.strip().startswith(GENERATED_DEPENDENCIES_START):
              copying = False
              generate_dependencies(result_content, dependencies)
          elif line.strip().startswith(GENERATED_DEPENDENCIES_END):
              copying = True
              result_content.append(line)
          elif line.strip().startswith("# START OF "):
              current_type = line.strip().replace("# START OF ", "")
              type_enum = get_dependency_type(current_type)
              if type_enum is None:
                  console.print(
                      f"[red]Wrong start of section '{current_type}' in {PYPROJECT_TOML_FILE_PATH} "
                      f"at line {line_count}: Unknown section type"
                  )
                  sys.exit(1)
          elif line.strip().startswith("# END OF "):
              end_type = line.strip().replace("# END OF ", "")
              if end_type != current_type:
                  console.print(
                      f"[red]Wrong end of section {end_type} in {PYPROJECT_TOML_FILE_PATH} at line {line_count}"
                  )
                  sys.exit(1)
          if current_type:
              if line.strip().endswith(" = ["):
                  FOUND_EXTRAS[current_type].append(
                      line.split(" = [")[0].strip()
                  )
          line_count += 1
      PYPROJECT_TOML_FILE_PATH.write_text(
          "\n".join(result_content) + "\n"
      )
  
imports: from __future__ import annotations
  import hashlib
  import json
  import os
  import sys
  from ast import Import, ImportFrom, NodeVisitor, parse
  from collections import defaultdict
  from enum import Enum
  from pathlib import Path
  from typing import Any, List
  import yaml
  from rich.console import Console
label_desc: Use image node_id 12 for calling a global function with example usage: update_pyproject_toml(dependencies) without return types