class_docstr: Device specification.
class_docstr_tok: ["Device","specification","."]
code: def __init__(
      self,
      host_address,
      host_device=None,
      device_type=DeviceType.CPU,
      device_index=None,
  ):
      self.host_address = host_address
      self.device_type = device_type
      if self.device_type is DeviceType.GPU:
          self.device_index = device_index
          if host_device is not None:
              if host_device.device_type is not DeviceType.CPU:
                  raise ValueError("Host device must be a CPU")
          else:
              self.host_device = DeviceSpec(host_address)
      else:
          self.device_index = device_index
          self.host_device = self
  
imports: import os
  import re
  from enum import Enum
  from typing import NamedTuple, Optional, Dict
  import yaml
  import paramiko
  from autodist.utils import logging
  from autodist.utils.network import is_loopback_address, is_local_address
label_desc: Use image node_id 1 to create a new DeviceSpec object  with example: obj = DeviceSpec(host_address, host_device, device_type, device_index)