code: def _set_room_id_for_address(self, address: Address, room_id: Optional[_RoomID] = None):
          
  
          assert not room_id or room_id in self._client.rooms, 'Invalid room_id'
          address_hex: AddressHex = to_checksum_address(address)
          # filter_private=False to preserve public rooms on the list, even if we require privacy
          room_ids = self._get_room_ids_for_address(address, filter_private=False)
  
          with self._account_data_lock:
              # no need to deepcopy, we don't modify lists in-place
              # cast generic Dict[str, Any] to types we expect, to satisfy mypy, runtime no-op
              _address_to_room_ids = cast(
                  Dict[AddressHex, List[_RoomID]],
                  self._client.account_data.get('network.raiden.rooms', {}).copy(),
              )
  
              changed = False
              if not room_id:  # falsy room_id => clear list
                  changed = address_hex in _address_to_room_ids
                  _address_to_room_ids.pop(address_hex, None)
              else:
                  # push to front
                  room_ids = [room_id] + [r for r in room_ids if r != room_id]
                  if room_ids != _address_to_room_ids.get(address_hex):
                      _address_to_room_ids[address_hex] = room_ids
                      changed = True
  
              if changed:
                  # dict will be set at the end of _clean_unused_rooms
                  self._leave_unused_rooms(_address_to_room_ids)
docs: Uses GMatrixClient.set_account_data to keep updated mapping of addresses->rooms
  
          If room_id is falsy, clean list of rooms. Else, push room_id to front of the list