parameters: (self, path, maxdepth=None, **kwargs)
docstring: Return all files belows path
  
          List all files, recursing into subdirectories; output is iterator-style,
          like ``os.walk()``. For a simple list of files, ``find()`` is available.
  
          Note that the "files" outputted will include anything that is not
          a directory, such as links.
  
          Parameters
          ----------
          path: str
              Root to recurse into
          maxdepth: int
              Maximum recursion depth. None means limitless, but not recommended
              on link-based file-systems.
          kwargs: passed to ``ls``
docstring_summary: Return all files belows path
docstring_tokens: Return all files belows path
function: def walk(self, path, maxdepth=None, **kwargs):
          """ Return all files belows path
  
          List all files, recursing into subdirectories; output is iterator-style,
          like ``os.walk()``. For a simple list of files, ``find()`` is available.
  
          Note that the "files" outputted will include anything that is not
          a directory, such as links.
  
          Parameters
          ----------
          path: str
              Root to recurse into
          maxdepth: int
              Maximum recursion depth. None means limitless, but not recommended
              on link-based file-systems.
          kwargs: passed to ``ls``
          """
          path = self._strip_protocol(path)
          full_dirs = {}
          dirs = {}
          files = {}
  
          detail = kwargs.pop("detail", False)
          try:
              listing = self.ls(path, detail=True, **kwargs)
          except (FileNotFoundError, IOError):
              return [], [], []
  
          for info in listing:
              # each info name must be at least [path]/part , but here
              # we check also for names like [path]/part/
              pathname = info["name"].rstrip("/")
              name = pathname.rsplit("/", 1)[-1]
              if info["type"] == "directory" and pathname != path:
                  # do not include "self" path
                  full_dirs[pathname] = info
                  dirs[name] = info
              elif pathname == path:
                  # file-like with same name as give path
                  files[""] = info
              else:
                  files[name] = info
  
          if detail:
              yield path, dirs, files
          else:
              yield path, list(dirs), list(files)
  
          if maxdepth is not None:
              maxdepth -= 1
              if maxdepth < 1:
                  return
  
          for d in full_dirs:
              yield from self.walk(d, maxdepth=maxdepth, detail=detail, **kwargs)
function_tokens: def walk ( self , path , maxdepth = None , * * kwargs ) : path = self . _strip_protocol ( path ) full_dirs = { } dirs = { } files = { } detail = kwargs . pop ( "detail" , False ) try : listing = self . ls ( path , detail = True , * * kwargs ) except ( FileNotFoundError , IOError ) : return [ ] , [ ] , [ ] for info in listing : # each info name must be at least [path]/part , but here # we check also for names like [path]/part/ pathname = info [ "name" ] . rstrip ( "/" ) name = pathname . rsplit ( "/" , 1 ) [ - 1 ] if info [ "type" ] == "directory" and pathname != path : # do not include "self" path full_dirs [ pathname ] = info dirs [ name ] = info elif pathname == path : # file-like with same name as give path files [ "" ] = info else : files [ name ] = info if detail : yield path , dirs , files else : yield path , list ( dirs ) , list ( files ) if maxdepth is not None : maxdepth -= 1 if maxdepth < 1 : return for d in full_dirs : yield from self . walk ( d , maxdepth = maxdepth , detail = detail , * * kwargs )