def METHOD_NAME(proc: subprocess.Popen) -> Optional[str]:
    while True:
        output = proc.stdout.readline().decode()
        if "Created sweep with ID: " in output:
            sweep_id = output.split("ID: ")[1].rstrip()
            return sweep_id
        if proc.poll() is not None:
            break
    return None