code: def atomic_file(path):
      """Atomically saves data to a target path.
  
      Any existing data at the target path will be overwritten.
  
      Args:
        path: target path at which to save file
  
      Yields:
        file-like object
      """
      with tempfile.NamedTemporaryFile() as tmp:
          yield tmp
          tmp.flush()
          tf.gfile.Copy(tmp.name, "%s.tmp" % path, overwrite=True)
      tf.gfile.Rename("%s.tmp" % path, path, overwrite=True)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import datetime
  import numbers
  import pdb
  import tempfile
  import time
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: atomic_file(path) without return types