def METHOD_NAME(event: ProcessStateEvent) -> None:
    global starting_processes
    proc: Subprocess = event.process
    if isinstance(event, ProcessStateStartingEvent):
        # process is starting
        # if proc not in starting_processes:
        starting_processes.append(proc)
    else:
        # not starting
        starting_processes = [p for p in starting_processes if p.pid is not proc.pid]