code: def set_throttle(self, name):
          
          if name.lower() == "null":
              name = "NULL"
          if name.lower() == "none":
              name = ''
  
          if name not in self._engine.known_throttle_names:
              if self._engine._rpc.throttle.up.max(xmlrpc.NOHASH, name) == -1:
                  if self._engine._rpc.throttle.down.max(xmlrpc.NOHASH, name) == -1:
                      raise error.UserError("Unknown throttle name '{}'".format(name))
              self._engine.known_throttle_names.add(name)
  
          if (name or "NONE") == self.throttle:
              self._engine.LOG.debug("Keeping throttle %r on torrent #%s" % (self.throttle, self._fields["hash"]))
              return
  
          active = self.is_active
          if active:
              self._engine.LOG.debug("Torrent #%s stopped for throttling" % (self._fields["hash"],))
              self.stop()
          self._make_it_so("setting throttle %r on" % (name,), ["throttle_name.set"], name)
          if active:
              self._engine.LOG.debug("Torrent #%s restarted after throttling" % (self._fields["hash"],))
              self.start()
docs: Assign to throttle group.