code: def _win_detached_subprocess(args: Sequence[str], **kwargs) -> int:
      assert os.name == "nt"
  
      from subprocess import (  # type: ignore[attr-defined]
          CREATE_NEW_PROCESS_GROUP,
          CREATE_NO_WINDOW,
          STARTF_USESHOWWINDOW,
          STARTUPINFO,
      )
  
      # https://stackoverflow.com/a/7006424
      # https://bugs.python.org/issue41619
      creationflags = CREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW
  
      startupinfo = STARTUPINFO()
      startupinfo.dwFlags |= STARTF_USESHOWWINDOW
      popen = subprocess.Popen(
          args,
          close_fds=True,
          shell=False,  # noqa: S603
          startupinfo=startupinfo,
          creationflags=creationflags,
          **kwargs,
      )
      _suppress_resource_warning(popen)
      return popen.pid
  
imports: import inspect
  import logging
  import os
  import subprocess
  import sys
  from contextlib import nullcontext
  from typing import TYPE_CHECKING, Any, List, Mapping, Optional, Sequence, Union
  from dvc.log import logger
  from dvc.env import DVC_DAEMON, DVC_DAEMON_LOGFILE
  from dvc.utils import fix_env, is_binary
  from dvc.utils.collections import ensure_list
label_desc: Use image node_id 2 for calling a global function with example usage: _win_detached_subprocess(args) and returns: popen