code: def walk(self, top):
          
          if not top:
              raise ValueError("Empty path")
          if isinstance(top, basestring):
              top = self.get_path_info(top)
          yield top
          if top['kind'] == 'directory':
              for info in self.list_directory(top['name']):
                  for item in self.walk(info):
                      yield item
docs: Generate infos for all paths in the tree rooted at ``top`` (included).
  
          The ``top`` parameter can be either an HDFS path string or a
          dictionary of properties as returned by :meth:`get_path_info`.
  
          :type top: str, dict
          :param top: an HDFS path or path info dict
          :rtype: iterator
          :return: path infos of files and directories in the tree rooted at
            ``top``
          :raises: :exc:`~exceptions.IOError`; :exc:`~exceptions.ValueError`
            if ``top`` is empty