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: Download an artifact file or directory to a local directory/file if applicable, and
  return a local path for it.
  The caller is responsible for managing the lifecycle of the downloaded artifacts.
  
  (self.path contains the base path - hdfs:/some/path/run_id/artifacts)
  
  :param artifact_path: Relative source path to the desired artifacts file or directory.
  :param dst_path: Absolute path of the local filesystem destination directory to which
                   to download the specified artifacts. This directory must already
                   exist. If unspecified, the artifacts will be downloaded to a new,
                   uniquely-named
                   directory on the local filesystem.
  
  :return: Absolute path of the local filesystem location containing the downloaded
  artifacts - file/directory.
docstr_tok: ["Download","an","artifact","file","or","directory","to","a","local","directory\/file","if","applicable",",","and","return","a","local","path","for","it",".","The","caller","is","responsible","for","managing","the","lifecycle","of","the","downloaded","artifacts",".","(","self.path","contains","the","base","path","-","hdfs",":","\/some\/path\/run_id\/artifacts",")",":","param","artifact_path",":","Relative","source","path","to","the","desired","artifacts","file","or","directory",".",":","param","dst_path",":","Absolute","path","of","the","local","filesystem","destination","directory","to","which","to","download","the","specified","artifacts",".","This","directory","must","already","exist",".","If","unspecified",",","the","artifacts","will","be","downloaded","to","a","new",",","uniquely-named","directory","on","the","local","filesystem",".",":","return",":","Absolute","path","of","the","local","filesystem","location","containing","the","downloaded","artifacts","-","file\/directory","."]
code: def download_artifacts(self, artifact_path, dst_path=None):
      """
      Download an artifact file or directory to a local directory/file if applicable, and
      return a local path for it.
      The caller is responsible for managing the lifecycle of the downloaded artifacts.
  
      (self.path contains the base path - hdfs:/some/path/run_id/artifacts)
  
      :param artifact_path: Relative source path to the desired artifacts file or directory.
      :param dst_path: Absolute path of the local filesystem destination directory to which
                       to download the specified artifacts. This directory must already
                       exist. If unspecified, the artifacts will be downloaded to a new,
                       uniquely-named
                       directory on the local filesystem.
  
      :return: Absolute path of the local filesystem location containing the downloaded
      artifacts - file/directory.
      """
  
      hdfs_base_path = _resolve_base_path(self.path, artifact_path)
      if dst_path and os.path.exists(dst_path):
          local_dir = os.path.abspath(dst_path)
      else:
          local_dir = _tmp_dir(dst_path)
  
      with hdfs_system(
          scheme=self.scheme, host=self.host, port=self.port
      ) as hdfs:
          if not hdfs.isdir(hdfs_base_path):
              local_path = os.path.join(
                  local_dir, os.path.normpath(artifact_path)
              )
              _download_hdfs_file(hdfs, hdfs_base_path, local_path)
              return local_path
  
          for path, is_dir, _ in self._walk_path(hdfs, hdfs_base_path):
              relative_path = _relative_path_remote(
                  hdfs_base_path, path
              )
              local_path = (
                  os.path.join(local_dir, relative_path)
                  if relative_path
                  else local_dir
              )
  
              if is_dir:
                  mkdir(local_path)
              else:
                  _download_hdfs_file(hdfs, path, local_path)
          return local_dir
  
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 6 for calling the HdfsArtifactRepository obj's underlying member method code with example usage: obj.download_artifacts(artifact_path, dst_path) and returns: local_dir, local_path