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 list_artifacts(self, path=None):
      infos = []
      page_token = None
      if not path:
          path = ""
      while True:
          json_body = self._make_json_body(path, page_token)
          response = self._call_endpoint(
              json_body, REGISTRY_LIST_ARTIFACTS_ENDPOINT
          )
          try:
              response.raise_for_status()
              json_response = json.loads(response.text)
          except Exception:
              raise MlflowException(
                  f"API request to list files under path `{path}` failed with status code "
                  f"{response.status_code}. Response body: {response.text}"
              )
          artifact_list = json_response.get("files", [])
          next_page_token = json_response.get("next_page_token", None)
          # If `path` is a file, ListArtifacts returns a single list element with the
          # same name as `path`. The list_artifacts API expects us to return an empty list in this
          # case, so we do so here.
          if (
              len(artifact_list) == 1
              and artifact_list[0]["path"] == path
              and not artifact_list[0]["is_dir"]
          ):
              return []
          for output_file in artifact_list:
              artifact_size = (
                  None
                  if output_file["is_dir"]
                  else output_file["file_size"]
              )
              infos.append(
                  FileInfo(
                      output_file["path"],
                      output_file["is_dir"],
                      artifact_size,
                  )
              )
          if len(artifact_list) == 0 or not next_page_token:
              break
          page_token = next_page_token
      return infos
  
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 4 for calling the DatabricksModelsArtifactRepository obj's underlying member method code with example usage: obj.list_artifacts(path) and returns: infos, list