code: def test_gfile_GFile_writable(fs, patchs, monkeypatch):
      uri, path_to, read, _, _, _, _ = fs
      mock_patchs(monkeypatch, patchs)
  
      fname = path_to("test_gfile_GFile_writable")
      assert tf.io.gfile.exists(fname) is False
  
      num_lines = 10
      base_body = b"abcdefghijklmn\n"
      body = base_body * num_lines
  
      # Simple
      with tf.io.gfile.GFile(fname, "wb") as f:
          f.write(body)
          f.flush()
          assert read(fname) == body
  
      # Append
      # TODO(vnvo2409): implement `az` appendable file.
      # TODO(vnvo2409): implement `hdfs` appendable file.
      if uri != AZ_URI and uri != HDFS_URI:
          with tf.io.gfile.GFile(fname, "ab") as f:
              f.write(base_body)
              f.flush()
              assert read(fname) == body + base_body
  
imports: import functools
  import os
  import posixpath
  import random
  import socket
  import sys
  import time
  from urllib.parse import urlparse
  import pytest
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 17 for calling a global function with example usage: test_gfile_GFile_writable(fs, patchs, monkeypatch) without return types