code: def check_xpu(use_xpu):
      """
      Log error and exit when set use_xpu=true in paddlepaddle
      cpu/gpu/npu version.
      """
      err = (
          "Config use_xpu cannot be set as true while you are "
          "using paddlepaddle cpu/gpu/npu version ! \nPlease try: \n"
          "\t1. Install paddlepaddle-xpu to run model on XPU \n"
          "\t2. Set use_xpu as false in config file to run "
          "model on CPU/GPU/NPU"
      )
  
      try:
          if use_xpu and not paddle.is_compiled_with_xpu():
              logger.error(err)
              sys.exit(1)
      except Exception as e:
          pass
  
file_path: PaddleDetection/ppdet/utils/check.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  import paddle
  import six
  import paddle.version
  from .logger import setup_logger
label_desc: Use image node_id 3 for calling a global function with example usage: check_xpu(use_xpu) without return types