code: def walk(self, pred=None, recursive=True):
          
          for entry in self.get_dir():
              if pred and pred(entry) is False:
                  continue
  
              yield entry
  
              if recursive:
                  if isinstance(entry, DirectoryEntry):
                      self.cwd(entry.name)
                      for e in self.walk(pred):
                          yield e
                      self.cwd("..")
          return
docs: Iterate over all target entries recursively.
  
          Args:
              pred (function, optional):
                  Callback(:class:`ftpsync.resources._Resource`) should return `False` to
                  ignore entry. Default: `None`.
              recursive (bool, optional):
                  Pass `False` to generate top level entries only. Default: `True`.
          Yields:
              :class:`ftpsync.resources._Resource`