Post the full contents of the configuration, in the same format as
        returned by :func:`.config`. The configuration will be saved to disk
        and the ``configInSync`` flag set to ``False``. Restart Syncthing to
        activate.

def set_config(self, config, and_restart=False):
        """ Post the full contents of the configuration, in the same format as
        returned by :func:`.config`. The configuration will be saved to disk
        and the ``configInSync`` flag set to ``False``. Restart Syncthing to
        activate."""
        assert isinstance(config, dict)
        self.post('config', data=config)
        if and_restart:
            self.restart()