code: def atomic_write(path, writer_cls=AtomicWriter, **cls_kwargs):
      """
      Simple atomic writes. This wraps :py:class:`AtomicWriter`::
  
          with atomic_write(path) as f:
              f.write(...)
  
      :param path: The target path to write to.
      :param writer_cls: The writer class to use. This parameter is useful if you
          subclassed :py:class:`AtomicWriter` to change some behavior and want to
          use that new subclass.
  
      Additional keyword arguments are passed to the writer class. See
      :py:class:`AtomicWriter`.
      """
      return writer_cls(path, **cls_kwargs).open()
  
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 4 for calling a global function with example usage: atomic_write(path, writer_cls) and returns: writer_cls