code: def _truncate_error(err: str, max_length: int = 10_000) -> str:
      if len(err) <= max_length:
          return err
      half = max_length // 2
      return (
          err[:half]
          + "\n\n*** Error message is too long, truncated ***\n\n"
          + err[-half:]
      )
  
imports: import logging
  import os
  import posixpath
  from abc import ABC, ABCMeta, abstractmethod
  from concurrent.futures import ThreadPoolExecutor, as_completed
  from typing import List, Optional
  from mlflow.entities.file_info import FileInfo
  from mlflow.entities.multipart_upload import CreateMultipartUploadResponse, MultipartUploadPart
  from mlflow.environment_variables import MLFLOW_ENABLE_ARTIFACTS_PROGRESS_BAR
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE, RESOURCE_DOES_NOT_EXIST
  from mlflow.utils.annotations import developer_stable
  from mlflow.utils.file_utils import ArtifactProgressBar, create_tmp_dir
  from mlflow.utils.validation import bad_path_message, path_not_unique
label_desc: Use image node_id 1 for calling a global function with example usage: _truncate_error(err, max_length) and returns: unknown, err