class_docstr: File-like object that buffers output and only writes if content changed.
  
  Use this class like when writing to a file to avoid touching the original
  file if the content hasn't changed. This is useful in scenarios where file
  mtime is used to invalidate caches or trigger new behavior.
  
  When writing to this file handle, all writes are buffered until the object
  is closed.
  
  Objects can be used as context managers.
class_docstr_tok: ["File-like","object","that","buffers","output","and","only","writes","if","content","changed",".","Use","this","class","like","when","writing","to","a","file","to","avoid","touching","the","original","file","if","the","content","has","n't","changed",".","This","is","useful","in","scenarios","where","file","mtime","is","used","to","invalidate","caches","or","trigger","new","behavior",".","When","writing","to","this","file","handle",",","all","writes","are","buffered","until","the","object","is","closed",".","Objects","can","be","used","as","context","managers","."]
code: def write(self, data: str) -> None:
      if not self._io:
          self._io = StringIO()
      self._io.write(data)
  
imports: from __future__ import annotations
  import contextlib
  import filecmp
  import os
  import re
  import shutil
  import sys
  import unicodedata
  from io import StringIO
  from os import path
  from typing import TYPE_CHECKING, Any
  from sphinx.deprecation import _deprecation_warning
label_desc: Use image node_id 2 for calling the FileAvoidWrite obj's underlying member method code with example usage: obj.write(data) without return types