code: def build_engine(flags):
      cmake_shell = (
          os.path.abspath(os.path.dirname(__file__))
          + "/../cmake/cmake-build-%s.sh" % flags.target_abi
      )
      os.environ["BUILD_DIR"] = flags.build_dir + "/" + flags.target_abi
      if flags.runtime:
          os.environ["RUNTIME"] = config_parser.parse_device_type(
              flags.runtime
          ).name
      if flags.gencode_model:
          os.environ["RUNMODE"] = "code"
      device.execute("bash " + cmake_shell)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import os
  import tempfile
  import shutil
  import numpy
  from apu_utils import get_apu_so_paths
  from py_proto import mace_pb2
  from utils import util
  from utils import device
  from utils import config_parser
  from utils.config_parser import DeviceType
  from utils.target import Target
  from utils.config_parser import ModelKeys
  from utils.util import ABIType
  from utils.util import MaceLogger
  from utils.util import mace_check
  import run_target
  import validate
label_desc: Use image node_id 2 for calling a global function with example usage: build_engine(flags) without return types