code: def build(
      build_system,
      arc_root,
      out_root,
      tail_args,
      should_build_widget,
      should_build_with_cuda,
  ):
      os.chdir(
          os.path.join(
              arc_root, "catboost", "python-package", "catboost"
          )
      )
  
      py_trait = PythonTrait(
          build_system, arc_root, out_root, tail_args
      )
      ver = get_version(os.path.join(os.getcwd(), "version.py"))
      pkg_name = os.environ.get("CATBOOST_PACKAGE_NAME", "catboost")
  
      for task_type in (
          ["GPU", "CPU"] if should_build_with_cuda else ["CPU"]
      ):
          try:
              print(
                  "Trying to build {} version".format(task_type),
                  file=sys.stderr,
              )
  
              dst_so_modules = {}
              for module_name, arc_path, dst_subdir in (
                  (
                      "_catboost",
                      os.path.join(
                          "catboost", "python-package", "catboost"
                      ),
                      "",
                  ),
                  (
                      "_hnsw",
                      os.path.join("library", "python", "hnsw", "hnsw"),
                      "hnsw",
                  ),
              ):
                  print(
                      "Trying to build {} native library".format(
                          module_name
                      ),
                      file=sys.stderr,
                  )
  
                  cmd = py_trait.gen_cmd(
                      arc_path, module_name, task_type
                  )
                  print(" ".join(cmd), file=sys.stderr)
                  subprocess.check_call(cmd)
                  print(
                      "Build {} native library: OK".format(module_name),
                      file=sys.stderr,
                  )
                  src = os.path.join(
                      py_trait.out_root,
                      arc_path,
                      py_trait.built_so_name(module_name),
                  )
                  dst = ".".join([src, task_type])
                  shutil.move(src, dst)
                  dst_so_modules[module_name] = (dst, dst_subdir)
  
              print(
                  "Build {} version: OK".format(task_type),
                  file=sys.stderr,
              )
              if should_build_widget:
                  build_widget(arc_root)
              wheel_name = os.path.join(
                  py_trait.arc_root,
                  "catboost",
                  "python-package",
                  "{}-{}-{}-none-{}.whl".format(
                      pkg_name,
                      ver,
                      py_trait.lang,
                      py_trait.platform_tag_string,
                  ),
              )
              make_wheel(
                  wheel_name,
                  pkg_name,
                  ver,
                  build_system,
                  arc_root,
                  dst_so_modules,
                  should_build_widget,
              )
              return wheel_name
          except Exception as e:
              print(
                  "{} version build failed: {}".format(task_type, e),
                  file=sys.stderr,
              )
      raise Exception("Nothing built")
  
imports: from __future__ import print_function
  import glob
  import subprocess
  import shutil
  import os
  import stat
  import sys
  import platform
  import tempfile
  import hashlib
  from base64 import urlsafe_b64encode
  from argparse import ArgumentParser
  from enum import Enum
label_desc: Use image node_id 14 for calling a global function with example usage: build(build_system, arc_root, out_root, tail_args, should_build_widget, should_build_with_cuda) and returns: wheel_name