code: def install(
      reqs,
      index_urls=None,
      upgrade=False,
      pre_releases=False,
      no_cache=False,
      no_deps=False,
      reinstall=False,
      target=None,
  ):
      _reset_env_for_install()
      args = [sys.executable, "-m", "pip", "install"]
      if pre_releases:
          args.append("--pre")
      if upgrade:
          args.append("--upgrade")
      if no_cache:
          args.append("--no-cache-dir")
      if no_deps:
          args.append("--no-deps")
      if reinstall:
          args.append("--force-reinstall")
      if index_urls:
          args.extend(["--index-url", index_urls[0]])
          for url in index_urls[1:]:
              args.extend(["--extra-index-url", url])
      if target:
          args.extend(["--target", target])
  
      for req in reqs:
          if req.endswith("requirements.txt"):
              args.append("--requirement")
          args.append(req)
  
      try:
          return subprocess.check_call(args)
      except subprocess.CalledProcessError as e:
          raise InstallError(str(e)) from e
  
imports: import logging
  import os
  import re
  import subprocess
  import sys
  from guild import util
label_desc: Use image node_id 1 for calling a global function with example usage: install(reqs, index_urls, upgrade, pre_releases, no_cache, no_deps, reinstall, target) and returns: subprocess