code: def model_func_call(X, model_func, gpu_model=False):
      """
      Function to call `model_func(X)` using either `NumPy` arrays if
      gpu_model is False or X directly if model_gpu based is True.
      Returns the results as CuPy arrays.
      """
      if gpu_model:
          y = input_to_cupy_array(X=model_func(X), order="K").array
      else:
          try:
              y = input_to_cupy_array(model_func(cp.asnumpy(X))).array
          except TypeError:
              raise TypeError(
                  "Explainer can only explain models that can "
                  "take GPU data or NumPy arrays as input."
              )
  
      return y
  
file_path: cuml/python/cuml/explainer/common.py
imports: from cuml.internals.base import Base
  from cuml.internals.input_utils import input_to_cupy_array
  from pylibraft.common.handle import Handle
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 4 for calling a global function with example usage: model_func_call(X, model_func, gpu_model) and returns: y