class_docstr: Performs storage operations on artifacts controlled by a Databricks-hosted model registry.
  
  Signed access URIs for the appropriate cloud storage locations are fetched from the
  MLflow service and used to download model artifacts.
  
  The artifact_uri is expected to be of the form
  - `models:/<model_name>/<model_version>`
  - `models:/<model_name>/<stage>`  (refers to the latest model version in the given stage)
  - `models:/<model_name>/latest`  (refers to the latest of all model versions)
  - `models://<profile>/<model_name>/<model_version or stage or 'latest'>`
  
  Note : This artifact repository is meant is to be instantiated by the ModelsArtifactRepository
  when the client is pointing to a Databricks-hosted model registry.
class_docstr_tok: ["Performs","storage","operations","on","artifacts","controlled","by","a","Databricks-hosted","model","registry",".","Signed","access","URIs","for","the","appropriate","cloud","storage","locations","are","fetched","from","the","MLflow","service","and","used","to","download","model","artifacts",".","The","artifact_uri","is","expected","to","be","of","the","form","-","`","models",":","\/","<","model_name",">","\/","<","model_version",">","`","-","`","models",":","\/","<","model_name",">","\/","<","stage",">","`","(","refers","to","the","latest","model","version","in","the","given","stage",")","-","`","models",":","\/","<","model_name",">","\/latest","`","(","refers","to","the","latest","of","all","model","versions",")","-","`","models",":","\/\/","<","profile",">","\/","<","model_name",">","\/","<","model_version","or","stage","or","'latest","'",">","`","Note",":","This","artifact","repository","is","meant","is","to","be","instantiated","by","the","ModelsArtifactRepository","when","the","client","is","pointing","to","a","Databricks-hosted","model","registry","."]
code: def _download_file(self, remote_file_path, local_path):
      try:
          parent_dir, _ = posixpath.split(remote_file_path)
          file_infos = self.list_artifacts(parent_dir)
          file_info = [
              info
              for info in file_infos
              if info.path == remote_file_path
          ]
          file_size = (
              file_info[0].file_size if len(file_info) == 1 else None
          )
          signed_uri, raw_headers = self._get_signed_download_uri(
              remote_file_path
          )
          headers = {}
          if raw_headers is not None:
              # Don't send None to _extract_headers_from_signed_url
              headers = self._extract_headers_from_signed_url(
                  raw_headers
              )
          if (
              not file_size
              or file_size <= MLFLOW_MULTIPART_DOWNLOAD_CHUNK_SIZE.get()
              or not MLFLOW_ENABLE_MULTIPART_DOWNLOAD.get()
          ):
              download_file_using_http_uri(
                  signed_uri,
                  local_path,
                  MLFLOW_MULTIPART_DOWNLOAD_CHUNK_SIZE.get(),
                  headers,
              )
          else:
              self._parallelized_download_from_cloud(
                  signed_uri,
                  headers,
                  file_size,
                  local_path,
                  remote_file_path,
              )
  
      except Exception as err:
          raise MlflowException(err)
  
imports: import json
  import logging
  import os
  import posixpath
  import mlflow.tracking
  from mlflow.entities import FileInfo
  from mlflow.environment_variables import MLFLOW_ENABLE_MULTIPART_DOWNLOAD, MLFLOW_MULTIPART_DOWNLOAD_CHUNK_SIZE
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
  from mlflow.store.artifact.artifact_repo import ArtifactRepository
  from mlflow.store.artifact.utils.models import get_model_name_and_version, is_using_databricks_registry
  from mlflow.utils.databricks_utils import get_databricks_host_creds, warn_on_deprecated_cross_workspace_registry_uri
  from mlflow.utils.file_utils import download_chunk_retries, download_file_using_http_uri, parallelized_download_file_using_http_uri, remove_on_error
  from mlflow.utils.rest_utils import http_request
  from mlflow.utils.uri import get_databricks_profile_uri_from_artifact_uri
label_desc: Use image node_id 8 for calling the DatabricksModelsArtifactRepository obj's underlying member method code with example usage: obj._download_file(remote_file_path, local_path) without return types