code: def dev(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      as_native: bool = False,
  ) -> Union[ivy.Device, ivy.NativeDevice]:
      """Get the native device handle for input array x.
  
      Parameters
      ----------
          x
              array for which to get the device handle.
          as_native
              Whether or not to return the dev in native format. Default is ``False``.
  
      Returns
      -------
          ret
              Device handle for the array.
  
      Examples
      --------
      With :class:`ivy.Array` input:
  
      >>> x = ivy.array([3, 1, 4, 5])
      >>> y = ivy.dev(x)
      >>> print(y)
      cpu
  
      With :class:`ivy.NativeArray` input:
  
      >>> x = ivy.native_array([[2, 5, 4], [3, 1, 5]])
      >>> y = ivy.dev(x, as_native=True)
      >>> print(y)
      cpu
      """
      return ivy.current_backend(x).dev(x, as_native=as_native)
  
imports: import os
  import gc
  import abc
  import math
  import psutil
  import warnings
  import types
  from typing import Type, Optional, Tuple
  from typing import Union, Callable, Iterable, Any
  import ivy
  from ivy.func_wrapper import handle_out_argument, to_native_arrays_and_back, inputs_to_native_arrays, handle_nestable, handle_array_like_without_promotion, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 9 for calling a global function with example usage: dev() and returns: ivy