code: def _endprint(x, flag, fval, maxfun, xtol, disp):
      if flag == 0:
          if disp > 1:
              print(
                  "\nOptimization terminated successfully;\n"
                  "The returned value satisfies the termination criteria\n"
                  "(using xtol = ",
                  xtol,
                  ")",
              )
      if flag == 1:
          if disp:
              print(
                  "\nMaximum number of function evaluations exceeded --- "
                  "increase maxfun argument.\n"
              )
      if flag == 2:
          if disp:
              print("\n{}".format(_status_message["nan"]))
      return
  
imports: import cupy
label_desc: Use image node_id 1 for calling a global function with example usage: _endprint(x, flag, fval, maxfun, xtol, disp) without return types