code: def announce(
      version: str, template_name: str, doc_version: str
  ) -> None:
      """Generates a new release announcement entry in the docs."""
      # Get our list of authors
      stdout = check_output(
          ["git", "describe", "--abbrev=0", "--tags"], encoding="UTF-8"
      )
      last_version = stdout.strip()
  
      stdout = check_output(
          ["git", "log", f"{last_version}..HEAD", "--format=%aN"],
          encoding="UTF-8",
      )
  
      contributors = {
          name
          for name in stdout.splitlines()
          if not name.endswith("[bot]") and name != "pytest bot"
      }
  
      template_text = (
          Path(__file__)
          .parent.joinpath(template_name)
          .read_text(encoding="UTF-8")
      )
  
      contributors_text = (
          "\n".join(f"* {name}" for name in sorted(contributors)) + "\n"
      )
      text = template_text.format(
          version=version,
          contributors=contributors_text,
          doc_version=doc_version,
      )
  
      target = Path(__file__).parent.joinpath(
          f"../doc/en/announce/release-{version}.rst"
      )
      target.write_text(text, encoding="UTF-8")
      print(
          f"{Fore.CYAN}[generate.announce] {Fore.RESET}Generated {target.name}"
      )
  
      # Update index with the new release entry
      index_path = Path(__file__).parent.joinpath(
          "../doc/en/announce/index.rst"
      )
      lines = index_path.read_text(encoding="UTF-8").splitlines()
      indent = "   "
      for index, line in enumerate(lines):
          if line.startswith(f"{indent}release-"):
              new_line = indent + target.stem
              if line != new_line:
                  lines.insert(index, new_line)
                  index_path.write_text(
                      "\n".join(lines) + "\n", encoding="UTF-8"
                  )
                  print(
                      f"{Fore.CYAN}[generate.announce] {Fore.RESET}Updated {index_path.name}"
                  )
              else:
                  print(
                      f"{Fore.CYAN}[generate.announce] {Fore.RESET}Skip {index_path.name} (already contains release)"
                  )
              break
  
      check_call(["git", "add", str(target)])
  
file_path: pytest/scripts/release.py
imports: import argparse
  import os
  from pathlib import Path
  from subprocess import call
  from subprocess import check_call
  from subprocess import check_output
  from colorama import Fore
  from colorama import init
label_desc: Use image node_id 1 for calling a global function with example usage: announce(version, template_name, doc_version) without return types