code: def create_package(
      package_file,
      clean=False,
      dist_dir=None,
      upload_repo=False,
      sign=False,
      identity=None,
      user=None,
      password=None,
      skip_existing=False,
      comment=None,
      capture_output=False,
  ):
      # Use a separate OS process as setup assumes it's running as a
      # command line op.
      cmd = [sys.executable, "-um", "guild.package_main"]
      env = {}
      env.update(util.safe_osenv())
      env.update(
          {
              "COMMENT": comment or "",
              "DEBUG": log.getEffectiveLevel() <= logging.DEBUG
              and "1"
              or "",
              "DIST_DIR": dist_dir or "",
              "IDENTITY": identity or "",
              "LOG_LEVEL": str(log.getEffectiveLevel()),
              "PACKAGE_FILE": package_file,
              "PASSWORD": password or "",
              "PYTHONPATH": _python_path(),
              "SIGN": "1" if sign else "",
              "SKIP_EXISTING": skip_existing and "1" or "",
              "UPLOAD_REPO": upload_repo or "",
              "USER": user or "",
          }
      )
      if clean:
          env["CLEAN_SETUP"] = "1"
      _apply_twine_env_creds(env)
      cwd = os.path.dirname(package_file)
      if capture_output:
          stdout = subprocess.PIPE
          stderr = subprocess.STDOUT
      else:
          stdout = None
          stderr = None
      log.debug("package cmd: %s", cmd)
      log.debug("package env: %s", env)
      log.debug("package cwd: %s", cwd)
      p = subprocess.Popen(
          cmd, env=env, cwd=cwd, stdout=stdout, stderr=stderr
      )
      out, _err = p.communicate()
      if p.returncode != 0:
          if capture_output:
              raise SystemExit(p.returncode, out.decode())
          raise SystemExit(p.returncode)
      return out
  
file_path: guildai/guild/package.py
imports: import logging
  import os
  import subprocess
  import sys
  import yaml
  from guild import resource
  from guild import resourcedef
  from guild import util
label_desc: Use image node_id 1 for calling a global function with example usage: create_package(package_file, clean, dist_dir, upload_repo, sign, identity, user, password, skip_existing, comment, capture_output) and returns: out