code: def get_device(name, device_dict, loader, resource_dict):
      
      device = Device(name, device_dict.get('delimiter', ';').encode('utf-8'))
  
      device_dict = get_bases(device_dict, loader)
  
      err = device_dict.get('error', {})
      device.add_error_handler(err)
  
      for itype, eom_dict in device_dict.get('eom', {}).items():
          device.add_eom(itype, *_get_pair(eom_dict))
  
      update_component(name, device, device_dict)
  
      for ch_name, ch_dict in device_dict.get('channels', {}).items():
          device.add_channels(ch_name, get_channel(device, ch_name, ch_dict,
                                                   loader, resource_dict))
  
      return device
docs: Get a device from a device dictionary.
  
      :param name: name of the device
      :param device_dict: device dictionary
      :rtype: Device