class_docstr: Creates a file explorer component that allows users to browse and select files on the machine hosting the Gradio app.
  Preprocessing: passes the selected file or directory as a {str} path (relative to root) or {list[str}} depending on `file_count`
  Postprocessing: expects function to return a {str} path to a file, or {List[str]} consisting of paths to files.
  Examples-format: a {str} path to a local file that populates the component.
  Demos: zip_to_json, zip_files
class_docstr_tok: ["Creates","a","file","explorer","component","that","allows","users","to","browse","and","select","files","on","the","machine","hosting","the","Gradio","app",".","Preprocessing",":","passes","the","selected","file","or","directory","as","a","{","str","}","path","(","relative","to","root",")","or","{","list","[","str","}","}","depending","on","`","file_count","`","Postprocessing",":","expects","function","to","return","a","{","str","}","path","to","a","file",",","or","{","List","[","str","]","}","consisting","of","paths","to","files",".","Examples-format",":","a","{","str","}","path","to","a","local","file","that","populates","the","component",".","Demos",":","zip_to_json",",","zip_files"]
code: def preprocess(
      self, payload: FileExplorerData | None
  ) -> list[str] | str | None:
      if payload is None:
          return None
  
      if self.file_count == "single":
          if len(payload.root) > 1:
              raise ValueError(
                  f"Expected only one file, but {len(payload.root)} were selected."
              )
          elif len(payload.root) == 0:
              return None
          else:
              return self._safe_join(payload.root[0])
      files = []
      for file in payload.root:
          file_ = self._safe_join(file)
          files.append(file_)
      return files
  
imports: from __future__ import annotations
  import itertools
  import os
  import re
  import warnings
  from pathlib import Path
  from typing import Any, Callable, List, Literal
  from gradio_client.documentation import document, set_documentation_group
  from gradio.components.base import Component, server
  from gradio.data_classes import GradioRootModel
label_desc: Use image node_id 3 for calling the FileExplorer obj's underlying member method code with example usage: obj.preprocess(payload) and returns: files, None, None, self