code: def test_append_existing_file():
      """Test case for append an existing HDFS file"""
  
      address = socket.gethostbyname(socket.gethostname())
      print(f"ADDRESS: {address}")
      body1 = b"1234567"
      body2 = b"7654321"
  
      # create a new file
      filepath = f"hdfs://{address}:9000/to_be_appended.txt"
      tf.io.write_file(filepath, body1)
  
      # append to the file
      f = tf.io.gfile.GFile(filepath, "a")
      f.write(body2)
      f.flush()
  
      content = tf.io.read_file(filepath)
      print(f"CONTENT: {content}")
      assert content == body1 + body2
      f.close()
  
file_path: io/tests/test_hdfs.py
imports: import os
  import sys
  import socket
  import time
  import tempfile
  import tensorflow
  import tensorflow_io
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_append_existing_file() without return types