code: def _validate_port_mapped_to_hostname(uri_parse):
      # This check is to catch an mlflow-artifacts uri that has a port designated but no
      # hostname specified. `urllib.parse.urlparse` will treat such a uri as a filesystem
      # definition, mapping the provided port as a hostname value if this condition is not
      # validated.
      if (
          uri_parse.hostname
          and _check_if_host_is_numeric(uri_parse.hostname)
          and not uri_parse.port
      ):
          raise MlflowException(
              "The mlflow-artifacts uri was supplied with a port number: "
              f"{uri_parse.hostname}, but no host was defined."
          )
  
file_path: mlflow/mlflow/store/artifact/mlflow_artifacts_repo.py
imports: import re
  from urllib.parse import urlparse, urlunparse
  from mlflow.exceptions import MlflowException
  from mlflow.store.artifact.http_artifact_repo import HttpArtifactRepository
  from mlflow.tracking._tracking_service.utils import get_tracking_uri
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_port_mapped_to_hostname(uri_parse) without return types