code: def device(x):
      """Hardware device the array data resides on.
  
      Parameters
      ----------
      x : array
          Array instance from NumPy or an array API compatible library.
  
      Returns
      -------
      out : device
          `device` object (see the "Device Support" section of the array API spec).
      """
      if isinstance(x, (numpy.ndarray, numpy.generic)):
          return "cpu"
      return x.device
  
imports: import math
  from functools import wraps
  import numpy
  import scipy.special
  from .._config import get_config
  from .fixes import parse_version
label_desc: Use image node_id 2 for calling a global function with example usage: device(x) and returns: x, str