code: def listdir(path: str) -> List[str]:
      """
  
      List file and directory names in a directory.
      It supports local, hdfs. S3 file systems is not implemented.
  
      :param path: directory path string.
      """
      if path.startswith("s3"):  # s3://bucket/file_path
          invalidOperationError(False, "not implement")
          return []
      elif path.startswith("hdfs://"):
          return file_utils.get_file_list(path)
      else:
          if path.startswith("file://"):
              path = path[len("file://") :]
          return os.listdir(path)
  
imports: import os
  import subprocess
  import logging
  import shutil
  import functools
  import glob
  from distutils.dir_util import copy_tree
  from bigdl.dllib.utils.log4Error import invalidOperationError
  from bigdl.dllib.utils import file_utils
  from typing import TYPE_CHECKING, List, Callable, Union, Optional
label_desc: Use image node_id 5 for calling a global function with example usage: listdir(path) and returns: list, file_utils, os