code: def write(self, path=None):
          
          if not self._path and not path:
              raise ConfigException('no config path given')
          if path:
              self._path = path
          if '~' in self._path:
              self._path = os.path.expanduser(self._path)
          f = open(self._path, 'w')
          f.write(json.dumps(self._data))
          f.close()
docs: Write config data to disk. If this config object already has a path,
           it will write to it. If it doesn't, one must be passed during this
           call.
  
          :param str path: path to config file