docstr: Directory tree generator, like os.walk.
  
  Generator version of what is in s3fs, which yields a flattened list of
  files.
docstr_tok: ["Directory","tree","generator",",","like","os.walk",".","Generator","version","of","what","is","in","s3fs",",","which","yields","a","flattened","list","of","files","."]
code: def walk(self, path, refresh=False):
      """
      Directory tree generator, like os.walk.
  
      Generator version of what is in s3fs, which yields a flattened list of
      files.
      """
      path = _sanitize_s3(_stringify_path(path))
      directories = set()
      files = set()
  
      for key in list(self.fs._ls(path, refresh=refresh)):
          path = key["Key"]
          if key["StorageClass"] == "DIRECTORY":
              directories.add(path)
          elif key["StorageClass"] == "BUCKET":
              pass
          else:
              files.add(path)
  
      # s3fs creates duplicate 'DIRECTORY' entries
      files = sorted(
          [posixpath.split(f)[1] for f in files if f not in directories]
      )
      directories = sorted([posixpath.split(x)[1] for x in directories])
  
      yield path, directories, files
  
      for directory in directories:
          yield from self.walk(directory, refresh=refresh)
  
imports: import os
  import posixpath
  import sys
  import urllib.parse
  import warnings
  from os.path import join
  import pyarrow
  from pyarrow.util import doc, _stringify_path, _is_path_like, _DEPR_MSG
label_desc: Use image node_id 3 for calling the S3FSWrapper obj's underlying member method code with example usage: obj.walk(path, refresh) without return types