code: def resolve_relative_path(path: str) -> PurePath:
      path = PurePath(path)
      if path.is_absolute():
          raise ValueError("Path should be relative")
      stack = []
      for part in path.parts:
          if part == "..":
              if not stack:
                  raise ValueError("Path is outside of the repo")
              stack.pop()
          else:
              stack.append(part)
      return PurePath(*stack)
  
imports: import os
  from pathlib import Path, PurePath
  from typing import Union
label_desc: Use image node_id 2 for calling a global function with example usage: resolve_relative_path(path) and returns: PurePath