code: def _write_config(config, newlines=2):
      '''
      Writes the given parameter config into the config file.
      '''
      text = config
      if isinstance(config, dict) and len(list(list(config.keys()))) == 1:
          key = next(six.iterkeys(config))
          text = config[key]
  
      try:
          with salt.utils.files.fopen(__SYSLOG_NG_CONFIG_FILE, 'a') as fha:
              fha.write(salt.utils.stringutils.to_str(text))
  
              for _ in range(0, newlines):
                  fha.write(salt.utils.stringutils.to_str(os.linesep))
          return True
      except Exception as err:
          log.error(six.text_type(err))
          return Falsf _write_config(config, newlines=2):
      '''
      Writes the given parameter config into the config file.
      '''
      text = config
      if isinstance(config, dict) and len(list(list(config.keys()))) == 1:
          key = next(six.iterkeys(config))
          text = config[key]
  
      try:
          with salt.utils.files.fopen(__SYSLOG_NG_CONFIG_FILE, 'a') as fha:
              fha.write(salt.utils.stringutils.to_str(text))
  
              for _ in range(0, newlines):
                  fha.write(salt.utils.stringutils.to_str(os.linesep))
          return True
      except Exception as err:
          log.error(six.text_type(err))
          return False
docs: Writes the given parameter config into the config file.