code: def get_hosting_devices_qry(self, context, hosting_device_ids,
                                  load_agent=True):
          
          query = context.session.query(hd_models.HostingDevice)
          if load_agent:
              query = query.options(joinedload('cfg_agent'))
          if len(hosting_device_ids) > 1:
              query = query.filter(hd_models.HostingDevice.id.in_(
                  hosting_device_ids))
          else:
              query = query.filter(hd_models.HostingDevice.id ==
                                   hosting_device_ids[0])
          return query
docs: Returns hosting devices with <hosting_device_ids>.