def METHOD_NAME() -> Generator[int, None, None]:
    """
    Returns all parent process PIDs, starting with the closest parent
    """
    try:
        import psutil
        pid = os.getpid()
        while pid > 0:
            pid = psutil.Process(pid).ppid()
            yield pid
    except psutil.NoSuchProcess:
        # Parent process not found, likely terminated, nothing we can do
        pass