code: def get_devices(filename, bundled):
      
  
      loader = Loader(filename, bundled)
  
      data = loader.data
  
      devices = Devices()
  
      # Iterate through the resources and generate each individual device
      # on demand.
  
      for resource_name, resource_dict in data.get('resources', {}).items():
          device_name = resource_dict['device']
  
          dd = loader.get_device_dict(device_name,
                                      resource_dict.get('filename', None),
                                      resource_dict.get('bundled', False),
                                      SPEC_VERSION_TUPLE[0])
  
          devices.add_device(resource_name,
                             get_device(device_name, dd, loader, resource_dict))
  
      return devices
docs: Get a Devices object from a file.
  
      :param filename: full path of the file to parse or name of the resource.
      :param is_resource: boolean indicating if it is a resource.
      :rtype: Devices