class_docstr: Stores artifacts on HDFS.
  
  This repository is used with URIs of the form ``hdfs:/<path>``. The repository can only be used
  together with the RestStore.
docstr: Lists files and directories under artifacts directory for the current run_id.
  (self.path contains the base path - hdfs:/some/path/run_id/artifacts)
  
  :param path: Relative source path. Possible subdirectory existing under
               hdfs:/some/path/run_id/artifacts
  :return: List of FileInfos under given path
docstr_tok: ["Lists","files","and","directories","under","artifacts","directory","for","the","current","run_id",".","(","self.path","contains","the","base","path","-","hdfs",":","\/some\/path\/run_id\/artifacts",")",":","param","path",":","Relative","source","path",".","Possible","subdirectory","existing","under","hdfs",":","\/some\/path\/run_id\/artifacts",":","return",":","List","of","FileInfos","under","given","path"]
code: def list_artifacts(self, path=None):
      """
      Lists files and directories under artifacts directory for the current run_id.
      (self.path contains the base path - hdfs:/some/path/run_id/artifacts)
  
      :param path: Relative source path. Possible subdirectory existing under
                   hdfs:/some/path/run_id/artifacts
      :return: List of FileInfos under given path
      """
      hdfs_base_path = _resolve_base_path(self.path, path)
  
      with hdfs_system(
          scheme=self.scheme, host=self.host, port=self.port
      ) as hdfs:
          paths = []
          if hdfs.exists(hdfs_base_path):
              for file_detail in hdfs.ls(hdfs_base_path, detail=True):
                  file_name = file_detail.get("name")
  
                  # file_name is hdfs_base_path and not a child of that path
                  if file_name == hdfs_base_path:
                      continue
  
                  # Strip off anything that comes before the artifact root e.g. hdfs://name
                  offset = file_name.index(self.path)
                  rel_path = _relative_path_remote(
                      self.path, file_name[offset:]
                  )
                  is_dir = file_detail.get("kind") == "directory"
                  size = file_detail.get("size")
                  paths.append(
                      FileInfo(rel_path, is_dir=is_dir, file_size=size)
                  )
          return sorted(paths, key=lambda f: paths)
  
imports: import os
  import posixpath
  import tempfile
  import urllib.parse
  from contextlib import contextmanager
  import packaging.version
  from mlflow.entities import FileInfo
  from mlflow.environment_variables import MLFLOW_KERBEROS_TICKET_CACHE, MLFLOW_KERBEROS_USER, MLFLOW_PYARROW_EXTRA_CONF
  from mlflow.exceptions import MlflowException
  from mlflow.store.artifact.artifact_repo import ArtifactRepository
  from mlflow.utils.file_utils import mkdir, relative_path_to_artifact_path
label_desc: Use image node_id 4 for calling the HdfsArtifactRepository obj's underlying member method code with example usage: obj.list_artifacts(path) and returns: sorted