code: def get_cai_ptr(X):
      """
      Function gets the pointer from an object that supports the
      __cuda_array_interface__. Raises TypeError if `X` does not support it.
      """
      if hasattr(X, "__cuda_array_interface__"):
          return X.__cuda_array_interface__["data"][0]
      else:
          raise TypeError("X must support `__cuda_array_interface__`")
  
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 5 for calling a global function with example usage: get_cai_ptr(X) and returns: X