code: def _ensure_device_active(self, device):
          '''Ensure a single device is in an active state
  
          :param device: ManagementRoot object -- device to inspect
          :raises: UnexpectedClusterState
          '''
  
          act = device.tm.cm.devices.device.load(
              name=get_device_info(device).name,
              partition=self.partition
          )
          if act.failoverState != 'active':
              msg = "A device in the cluster was not in the 'Active' state."
              raise UnexpectedDeviceGroupState(msgf _ensure_device_active(self, device):
          '''Ensure a single device is in an active state
  
          :param device: ManagementRoot object -- device to inspect
          :raises: UnexpectedClusterState
          '''
  
          act = device.tm.cm.devices.device.load(
              name=get_device_info(device).name,
              partition=self.partition
          )
          if act.failoverState != 'active':
              msg = "A device in the cluster was not in the 'Active' state."
              raise UnexpectedDeviceGroupState(msg)
docs: Ensure a single device is in an active state
  
          :param device: ManagementRoot object -- device to inspect
          :raises: UnexpectedClusterState