code: def array_to_memory_order(arr, default="C"):
      """
      Given an array-like object, determine its memory order
  
      If arr is C-contiguous, the string 'C' will be returned; if
      F-contiguous 'F'. If arr is neither C nor F contiguous, None will be
      returned. If an arr is both C and F contiguous, the indicated default
      will be returned. If a default of None or 'K' is given and the arr is both
      C and F contiguous, 'C' will be returned.
      """
      try:
          return arr.order
      except AttributeError:
          pass
      try:
          array_interface = arr.__cuda_array_interface__
      except AttributeError:
          try:
              array_interface = arr.__array_interface__
          except AttributeError:
              return array_to_memory_order(
                  CumlArray.from_input(arr, order="K")
              )
      strides = array_interface.get("strides", None)
      if strides is None:
          try:
              strides = arr.strides
          except AttributeError:
              pass
      return _determine_memory_order(
          array_interface["shape"],
          strides,
          array_interface["typestr"],
          default=default,
      )
  
imports: import copy
  import operator
  import pickle
  from cuml.internals.global_settings import GlobalSettings
  from cuml.internals.logger import debug
  from cuml.internals.mem_type import MemoryType, MemoryTypeError
  from cuml.internals.memory_utils import class_with_cupy_rmm, with_cupy_rmm
  from cuml.internals.safe_imports import cpu_only_import, cpu_only_import_from, gpu_only_import, gpu_only_import_from, null_decorator, return_false, safe_import, safe_import_from
  from typing import Tuple
label_desc: Use image node_id 3 for calling a global function with example usage: array_to_memory_order(arr, default) and returns: _determine_memory_order, arr, array_to_memory_order