class_docstr: Handler for fsspec-based Python filesystems.
  
  https://filesystem-spec.readthedocs.io/en/latest/index.html
  
  Parameters
  ----------
  fs : FSSpec-compliant filesystem instance
  
  Examples
  --------
  >>> PyFileSystem(FSSpecHandler(fsspec_fs)) # doctest: +SKIP
code: def get_file_info_selector(self, selector):
      if not self.fs.isdir(selector.base_dir):
          if self.fs.exists(selector.base_dir):
              raise NotADirectoryError(selector.base_dir)
          else:
              if selector.allow_not_found:
                  return []
              else:
                  raise FileNotFoundError(selector.base_dir)
  
      if selector.recursive:
          maxdepth = None
      else:
          maxdepth = 1
  
      infos = []
      selected_files = self.fs.find(
          selector.base_dir,
          maxdepth=maxdepth,
          withdirs=True,
          detail=True,
      )
      for path, info in selected_files.items():
          _path = path.strip("/")
          base_dir = selector.base_dir.strip("/")
          # Need to exclude base directory from selected files if present
          # (fsspec filesystems, see GH-37555)
          if _path != base_dir:
              infos.append(self._create_file_info(path, info))
  
      return infos
  
imports: from pyarrow.util import _is_path_like, _stringify_path
  from pyarrow._fs import FileSelector, FileType, FileInfo, FileSystem, LocalFileSystem, SubTreeFileSystem, _MockFileSystem, FileSystemHandler, PyFileSystem, _copy_files, _copy_files_selector
label_desc: Use image node_id 8 for calling the FSSpecHandler obj's underlying member method code with example usage: obj.get_file_info_selector(selector) and returns: infos, list