class_docstr: A helper class for performing atomic writes. Usage::
  
      with AtomicWriter(path).open() as f:
          f.write(...)
  
  :param path: The destination filepath. May or may not exist.
  :param mode: The filemode for the temporary file. This defaults to `wb` in
      Python 2 and `w` in Python 3.
  :param overwrite: If set to false, an error is raised if ``path`` exists.
      Errors are only raised after the file has been written to.  Either way,
      the operation is atomic.
  :param open_kwargs: Keyword-arguments to pass to the underlying
      :py:func:`open` call. This can be used to set the encoding when opening
      files in text-mode.
  
  If you need further control over the exact behavior, you are encouraged to
  subclass.
class_docstr_tok: ["A","helper","class","for","performing","atomic","writes",".","Usage",":",":","with","AtomicWriter","(","path",")",".open","(",")","as","f",":","f.write","(","...",")",":","param","path",":","The","destination","filepath",".","May","or","may","not","exist",".",":","param","mode",":","The","filemode","for","the","temporary","file",".","This","defaults","to","`","wb","`","in","Python","2","and","`","w","`","in","Python","3.",":","param","overwrite",":","If","set","to","false",",","an","error","is","raised","if","``","path","``","exists",".","Errors","are","only","raised","after","the","file","has","been","written","to",".","Either","way",",","the","operation","is","atomic",".",":","param","open_kwargs",":","Keyword-arguments","to","pass","to","the","underlying",":","py",":","func",":","`","open","`","call",".","This","can","be","used","to","set","the","encoding","when","opening","files","in","text-mode",".","If","you","need","further","control","over","the","exact","behavior",",","you","are","encouraged","to","subclass","."]
docstr: responsible for clearing as many file caches as possible before
  commit
docstr_tok: ["responsible","for","clearing","as","many","file","caches","as","possible","before","commit"]
code: def sync(self, f):
      """responsible for clearing as many file caches as possible before
      commit"""
      f.flush()
      _proper_fsync(f.fileno())
  
file_path: catboost/contrib/python/atomicwrites/py3/atomicwrites/__init__.py
imports: import contextlib
  import io
  import os
  import sys
  import tempfile
label_desc: Use image node_id 5 for calling the AtomicWriter obj's underlying member method code with example usage: obj.sync(f) without return types