code: def muc_set_role(self, nick, role, *, reason=None):
          
  
          if nick is None:
              raise ValueError("nick must not be None")
  
          if role is None:
              raise ValueError("role must not be None")
  
          iq = aioxmpp.stanza.IQ(
              type_=aioxmpp.structs.IQType.SET,
              to=self._mucjid
          )
  
          iq.payload = muc_xso.AdminQuery(
              items=[
                  muc_xso.AdminItem(nick=nick,
                                    reason=reason,
                                    role=role)
              ]
          )
  
          yield from self.service.client.send(iq)
docs: Change the role of an occupant.
  
          :param nick: The nickname of the occupant whose role shall be changed.
          :type nick: :class:`str`
          :param role: The new role for the occupant.
          :type role: :class:`str`
          :param reason: An optional reason to show to the occupant (and all
              others).
  
          Change the role of an occupant, identified by their `nick`, to the
          given new `role`. Optionally, a `reason` for the role change can be
          provided.
  
          Setting the different roles require different privilegues of the local
          user. The details can be checked in :xep:`0045` and are enforced solely
          by the server, not local code.
  
          The coroutine returns when the role change has been acknowledged by the
          server. If the server returns an error, an appropriate
          :class:`aioxmpp.errors.XMPPError` subclass is raised.