code: def as_ivy_dev(device):
      if isinstance(device, str):
          return ivy.Device(device)
      if device is None:
          return None
      # if mx device context is passed
      p, dev_id = (device.device_type, device.device_id)
      if p == "cpu":
          return ivy.Device(p)
      return ivy.Device(p + ":" + str(dev_id))
  
file_path: ivy/ivy/functional/backends/mxnet/device.py
imports: import mxnet
  from typing import Union, Optional
  import ivy
  from ivy.functional.ivy.device import Profiler
  from ivy.utils.exceptions import IvyNotImplementedException
label_desc: Use image node_id 3 for calling a global function with example usage: as_ivy_dev(device) and returns: ivy, ivy, None, ivy