code: def windows_build(args):
      logging.info("Using vcvars environment:\n{}".format(args.vcvars))
      if args.vcvars_ver:
          logging.info(
              "Using vcvars version:\n{}".format(args.vcvars_ver)
          )
  
      path = args.output
  
      mxnet_root = get_mxnet_root()
      logging.info("Found MXNet root: {}".format(mxnet_root))
  
      # cuda thrust / CUB + VS 2019 is flaky: try multiple times if fail
      MAXIMUM_TRY = 1
      build_try = 0
  
      while build_try < MAXIMUM_TRY:
          if os.path.exists(path):
              shutil.rmtree(path)
          os.makedirs(path, exist_ok=True)
  
          with remember_cwd():
              os.chdir(path)
              env = os.environ.copy()
              if "GPU" in args.flavour:
                  env["CXXFLAGS"] = "/FS /MD /O2 /Ob2"
              if not args.vcvars_ver:
                  cmd = '"{}" && cmake -GNinja {} {}'.format(
                      args.vcvars, CMAKE_FLAGS[args.flavour], mxnet_root
                  )
              else:
                  cmd = '"{}" -vcvars_ver={} && cmake -GNinja {} {}'.format(
                      args.vcvars,
                      args.vcvars_ver,
                      CMAKE_FLAGS[args.flavour],
                      mxnet_root,
                  )
              logging.info(
                  "Generating project with CMake:\n{}".format(cmd)
              )
              check_call(cmd, shell=True, env=env)
  
              if not args.vcvars_ver:
                  cmd = '"{}" && ninja'.format(args.vcvars)
              else:
                  cmd = '"{}" -vcvars_ver={} && ninja'.format(
                      args.vcvars, args.vcvars_ver
                  )
              logging.info("Building:\n{}".format(cmd))
  
              t0 = int(time.time())
              ret = call(cmd, shell=True)
  
              if ret != 0:
                  build_try += 1
                  logging.info(
                      "{} build(s) have failed".format(build_try)
                  )
              else:
                  logging.info(
                      'Build flavour: {} complete in directory: "{}"'.format(
                          args.flavour, os.path.abspath(path)
                      )
                  )
                  logging.info(
                      "Build took {}".format(
                          datetime.timedelta(
                              seconds=int(time.time() - t0)
                          )
                      )
                  )
                  break
  
      if ret == 0:
          windows_package(args)
      else:
          logging.info("Build failed")
          sys.exit(1)
  
imports: import argparse
  import datetime
  import glob
  import logging
  import os
  import platform
  import shutil
  import sys
  import tempfile
  import time
  import zipfile
  import requests
  from distutils.dir_util import copy_tree
  from enum import Enum
  from subprocess import check_call, call
  from util import *
label_desc: Use image node_id 1 for calling a global function with example usage: windows_build(args) without return types