docstr: Open a file to write some content to it.
  
  Exit if we have already written to that file, unless one (and no more
  than one) of the writes has the override parameter set to True.
docstr_tok: ["Open","a","file","to","write","some","content","to","it",".","Exit","if","we","have","already","written","to","that","file",",","unless","one","(","and","no","more","than","one",")","of","the","writes","has","the","override","parameter","set","to","True","."]
code: def _open_w(self, filename, encoding, override=False):
      """Open a file to write some content to it.
  
      Exit if we have already written to that file, unless one (and no more
      than one) of the writes has the override parameter set to True.
      """
      if filename in self._overridden_files:
          if override:
              raise RuntimeError(
                  "File %s is set to be overridden twice" % filename
              )
          logger.info("Skipping %s", filename)
          filename = os.devnull
      elif filename in self._written_files:
          if override:
              logger.info("Overwriting %s", filename)
          else:
              raise RuntimeError(
                  "File %s is to be overwritten" % filename
              )
      if override:
          self._overridden_files.add(filename)
      self._written_files.add(filename)
      return open(filename, "w", encoding=encoding)
  
file_path: pelican/pelican/writers.py
imports: import logging
  import os
  from posixpath import join
  from urllib.parse import urljoin
  from feedgenerator import Atom1Feed, Rss201rev2Feed, get_tag_uri
  from markupsafe import Markup
  from pelican.paginator import Paginator
  from pelican.plugins import signals
  from pelican.utils import get_relative_path, path_to_url, sanitised_join, set_date_tzinfo
label_desc: Use image node_id 4 for calling the Writer obj's underlying member method code with example usage: obj._open_w(filename, encoding, override) and returns: open