code: def WriteConfig(self, config_file=None):
      
      config_file = config_file or self.config_file
      config_name = os.path.splitext(os.path.basename(config_file))[0]
      config_lock = (
          '%s/lock/google_%s.lock' % (constants.LOCALSTATEDIR, config_name))
      with file_utils.LockFile(config_lock):
        with open(config_file, 'w') as config_fp:
          if self.config_header:
            self._AddHeader(config_fp)
          self.config.write(config_fp)
docs: Write the config values to a given file.
  
      Args:
        config_file: string, the file location of the config file to write.