code: def test_hadoop_filesystem():
      fs = HadoopFileSystem(host="localhost", port=8020)
  
      test_dir = "/tmp/test/test_hadoop_fs"
      fs.mkdir(test_dir)
      test_file = f"{test_dir}/my_file.txt"
      test_file_content = b"text for text"
      with fs.open(test_file, "wb") as f:
          f.write(test_file_content)
      with fs.open(test_file, "rb") as f:
          assert test_file_content == f.read()
      # test file with hdfs:// prefix
      assert fs.exists(f"hdfs://{test_dir}")
  
file_path: mars/mars/lib/filesystem/tests/test_filesystem.py
imports: import glob
  import os
  import tempfile
  import numpy
  import pytest
  from ....tests.core import require_hadoop
  from ....utils import lazy_import
  from ..None import glob, FileSystem, LocalFileSystem, FSMap
label_desc: Use image node_id 4 for calling a global function with example usage: test_hadoop_filesystem() without return types