docstr: This method enables to list files under the provided path from the Drive in a blocking fashion.
  
  Arguments:
      path: The relative path you want to list files from the Drive.
      component_name: By default, the Drive lists files across all components.
          If you provide a component name, the listing is specific to this component.
docstr_tok: ["This","method","enables","to","list","files","under","the","provided","path","from","the","Drive","in","a","blocking","fashion",".","Arguments",":","path",":","The","relative","path","you","want","to","list","files","from","the","Drive",".","component_name",":","By","default",",","the","Drive","lists","files","across","all","components",".","If","you","provide","a","component","name",",","the","listing","is","specific","to","this","component","."]
code: def list(
      self,
      path: Optional[str] = ".",
      component_name: Optional[str] = None,
  ) -> List[str]:
      """This method enables to list files under the provided path from the Drive in a blocking fashion.
  
      Arguments:
          path: The relative path you want to list files from the Drive.
          component_name: By default, the Drive lists files across all components.
              If you provide a component name, the listing is specific to this component.
  
      """
      if _is_flow_context():
          raise Exception(
              "The flow isn't allowed to list files from a Drive."
          )
  
      if component_name:
          paths = [
              self._to_shared_path(
                  path,
                  component_name=component_name,
              )
          ]
      else:
          paths = [
              self._to_shared_path(
                  path,
                  component_name=component_name,
              )
              for component_name in self._collect_component_names()
          ]
  
      files = []
      sep = "\\" if sys.platform == "win32" else "/"
      prefix_len = len(str(self.root).split(sep))
      for p in paths:
          if self.fs.exists(p):
              for f in self.fs.ls(p):
                  files.append(
                      str(
                          pathlib.Path(
                              *pathlib.Path(f).parts[prefix_len:]
                          )
                      )
                  )
      return files
  
imports: import os
  import pathlib
  import shutil
  import sys
  from copy import deepcopy
  from time import sleep, time
  from typing import Dict, List, Optional, Union
  from lightning.app.storage.path import LocalFileSystem, _filesystem, _shared_storage_path
  from lightning.app.utilities.component import _is_flow_context
label_desc: Use image node_id 5 for calling the Drive obj's underlying member method code with example usage: obj.list(path, component_name) and returns: files