code: def set(self, key, value):
          
          if key in self.callbacks:
              self.callbacks[key](value)
          else:
              self.prefs[key] = value
docs: Set the value of `key` preference to `value`.