code: def testWriteFileCreateDir(self):
      cases = ["", "Some contents"]
      for contents in cases:
          contents = compat.as_bytes(contents)
          subdir = os.path.join(self.get_temp_dir(), "subdir1")
          filepath = os.path.join(subdir, "subdir2", "filename")
          with self.cached_session() as sess:
              w = io_ops.write_file(filepath, contents)
              self.evaluate(w)
              with open(filepath, "rb") as f:
                  file_contents = f.read()
              self.assertEqual(file_contents, contents)
          shutil.rmtree(subdir)
  
file_path: tensorflow/tensorflow/python/kernel_tests/io_ops/io_ops_test.py
imports: import os
  import shutil
  import tempfile
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import io_ops
  from tensorflow.python.platform import test
  from tensorflow.python.util import compat
label_desc: Use image node_id 3 for calling the IoOpsTest obj's underlying member method code with example usage: obj.testWriteFileCreateDir() without return types