code: def SetDeviceProperties(self, object_path, properties):
      '''Convenience method to Set a device's properties.
  
      object_path: the device to update
      properties: dictionary of keys to dbus variants.
  
      If the 1.0 API is being mocked, changing this property will trigger
      the device's PropertiesChanged signal; otherwise, the older
      org.freedesktop.UPower DeviceChanged signal will be emitted.
      '''
      device = dbusmock.get_object(object_path)
  
      # set the properties
      for key, value in properties.items():
          device.Set(DEVICE_IFACE, key, value)
  
      # notify the listeners
      if not self.api1:
          self.EmitSignal(MAIN_IFACE, 'DeviceChanged', 's', [object_path]f SetDeviceProperties(self, object_path, properties):
      '''Convenience method to Set a device's properties.
  
      object_path: the device to update
      properties: dictionary of keys to dbus variants.
  
      If the 1.0 API is being mocked, changing this property will trigger
      the device's PropertiesChanged signal; otherwise, the older
      org.freedesktop.UPower DeviceChanged signal will be emitted.
      '''
      device = dbusmock.get_object(object_path)
  
      # set the properties
      for key, value in properties.items():
          device.Set(DEVICE_IFACE, key, value)
  
      # notify the listeners
      if not self.api1:
          self.EmitSignal(MAIN_IFACE, 'DeviceChanged', 's', [object_path])
docs: Convenience method to Set a device's properties.
  
      object_path: the device to update
      properties: dictionary of keys to dbus variants.
  
      If the 1.0 API is being mocked, changing this property will trigger
      the device's PropertiesChanged signal; otherwise, the older
      org.freedesktop.UPower DeviceChanged signal will be emitted.