code: def determine_array_memtype(X):
      try:
          return X.mem_type
      except AttributeError:
          pass
      if hasattr(X, "__cuda_array_interface__"):
          return MemoryType.device
      if hasattr(X, "__array_interface__"):
          return MemoryType.host
      if isinstance(X, (CudfDataFrame, CudfSeries)):
          return MemoryType.device
      if isinstance(X, (PandasDataFrame, PandasSeries)):
          return MemoryType.host
      return None
  
imports: import functools
  import operator
  import re
  from functools import wraps
  from cuml.internals.global_settings import GlobalSettings
  from cuml.internals.device_support import GPU_ENABLED
  from cuml.internals.mem_type import MemoryType
  from cuml.internals.output_type import INTERNAL_VALID_OUTPUT_TYPES, VALID_OUTPUT_TYPES
  from cuml.internals.safe_imports import cpu_only_import_from, gpu_only_import_from, UnavailableNullContext
label_desc: Use image node_id 7 for calling a global function with example usage: determine_array_memtype(X) and returns: None, X, MemoryType, MemoryType, MemoryType, MemoryType