code: def sort_whatsnew_note(content: str) -> int:
      new_lines = []
      block: list[str] = []
      lines = content.splitlines(keepends=True)
      for line in lines:
          if line.startswith("- ") and pattern.search(line) is not None:
              block.append(line)
          else:
              block = sorted(block)
              new_lines.extend(block)
              new_lines.append(line)
              block = []
      if sorted(new_lines) != sorted(lines):  # pragma: no cover
          # Defensive check - this script should only reorder lines, not modify any
          # content.
          raise AssertionError(
              "Script modified content of file. Something is wrong, please don't "
              "trust it."
          )
      return "".join(new_lines)
  
imports: from __future__ import annotations
  import argparse
  import re
  import sys
  from typing import TYPE_CHECKING
label_desc: Use image node_id 1 for calling a global function with example usage: sort_whatsnew_note(content) and returns: str