code: def _libhdfs_walk_files_dirs(top_path, contents):
      files = []
      directories = []
      for c in contents:
          scrubbed_name = posixpath.split(c["name"])[1]
          if c["kind"] == "file":
              files.append(scrubbed_name)
          else:
              directories.append(scrubbed_name)
  
      return directories, files
  
imports: import os
  import posixpath
  import sys
  import warnings
  from pyarrow.util import doc, _DEPR_MSG
  from pyarrow.filesystem import FileSystem
  import pyarrow._hdfsio
label_desc: Use image node_id 4 for calling a global function with example usage: _libhdfs_walk_files_dirs(top_path, contents) and returns: directories,  files