docstr: Returns intersection of devices with available devices. If no intersection, returns mx.cpu()
  :param devices: list of requested devices
  :return: list of devices that are actually available
docstr_tok: ["Returns","intersection","of","devices","with","available","devices",".","If","no","intersection",",","returns","mx.cpu","(",")",":","param","devices",":","list","of","requested","devices",":","return",":","list","of","devices","that","are","actually","available"]
code: def _sanitize_device_list(
      devices: List[mx.Context],
  ) -> List[mx.Context]:
      """
      Returns intersection of devices with available devices. If no intersection, returns mx.cpu()
      :param devices: list of requested devices
      :return: list of devices that are actually available
      """
      actual_device = [mx.cpu()] + [
          mx.gpu(i) for i in mx.test_utils.list_gpus()
      ]
      intersection = [dev for dev in devices if dev in actual_device]
      if len(intersection) == 0:
          intersection = [mx.cpu()]
          screen.log(
              "Requested devices {} not available. Default to CPU context.".format(
                  devices
              )
          )
      elif len(intersection) < len(devices):
          screen.log(
              "{} not available, using {}.".format(
                  [dev for dev in devices if dev not in intersection],
                  intersection,
              )
          )
      return intersection
  
imports: import copy
  from typing import Any, Dict, Generator, List, Tuple, Union
  import numpy
  import mxnet
  from mxnet import autograd, gluon, nd
  from mxnet.ndarray import NDArray
  from rl_coach.architectures.architecture import Architecture
  from rl_coach.architectures.mxnet_components.heads.head import LOSS_OUT_TYPE_LOSS, LOSS_OUT_TYPE_REGULARIZATION
  from rl_coach.architectures.mxnet_components import utils
  from rl_coach.architectures.mxnet_components.savers import ParameterDictSaver, OnnxSaver
  from rl_coach.base_parameters import AgentParameters
  from rl_coach.logger import screen
  from rl_coach.saver import SaverCollection
  from rl_coach.spaces import SpacesDefinition
  from rl_coach.utils import force_list, squeeze_list
label_desc: Use image node_id 3 for calling the MxnetArchitecture obj's underlying member method code with example usage: obj._sanitize_device_list(devices) and returns: intersection