code: def root_relative_path(filename: str) -> str:
      try:
          return Path(filename).absolute().relative_to(ROOT).as_posix()
      except ValueError:
          # Not relative to root, just return original path.
          return filename
  
file_path: cpython/Tools/cases_generator/generators_common.py
imports: from pathlib import Path
  from typing import TextIO
  from analyzer import Instruction, Uop, analyze_files, Properties, Skip
  from cwriter import CWriter
  from typing import Callable, Mapping, TextIO, Iterator
  from lexer import Token
  from stack import StackOffset, Stack
label_desc: Use image node_id 1 for calling a global function with example usage: root_relative_path(filename) and returns: Path, filename