code: def test_download_from_uri():
      class TestArtifactRepo:
          def __init__(self, scheme):
              self.scheme = scheme
  
          def download_artifacts(
              self, artifact_path, **kwargs
          ):  # pylint: disable=unused-argument
              return (self.scheme, artifact_path)
  
      def test_get_artifact_repository(artifact_uri):
          return TestArtifactRepo(artifact_uri)
  
      pairs = [
          ("path", ("", "path")),
          ("path/", ("path", "")),
          ("/path", ("/", "path")),
          ("/path/", ("/path", "")),
          ("path/to/dir", ("path/to", "dir")),
          ("file:", ("file:", "")),
          ("file:path", ("file:", "path")),
          ("file:path/", ("file:path", "")),
          ("file:path/to/dir", ("file:path/to", "dir")),
          ("file:/", ("file:///", "")),
          ("file:/path", ("file:///", "path")),
          ("file:/path/", ("file:///path", "")),
          ("file:/path/to/dir", ("file:///path/to", "dir")),
          ("file:///", ("file:///", "")),
          ("file:///path", ("file:///", "path")),
          ("file:///path/", ("file:///path", "")),
          ("file:///path/to/dir", ("file:///path/to", "dir")),
          ("s3://", ("s3:", "")),
          (
              "s3://path",
              ("s3://path", ""),
          ),  # path is netloc in this case
          ("s3://path/", ("s3://path/", "")),
          ("s3://path/to/", ("s3://path/to", "")),
          ("s3://path/to", ("s3://path/", "to")),
          ("s3://path/to/dir", ("s3://path/to", "dir")),
      ]
      with mock.patch(
          "mlflow.tracking.artifact_utils.get_artifact_repository"
      ) as get_artifact_repo_mock:
          get_artifact_repo_mock.side_effect = (
              test_get_artifact_repository
          )
  
          for uri, expected_result in pairs:
              actual_result = _download_artifact_from_uri(uri)
              assert expected_result == actual_result
  
file_path: mlflow/tests/store/artifact/test_cli.py
imports: import json
  import pathlib
  from unittest import mock
  import pytest
  from click.testing import CliRunner
  import mlflow
  import mlflow.pyfunc
  from mlflow.entities import FileInfo
  from mlflow.store.artifact.cli import _file_infos_to_json, download_artifacts
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
label_desc: Use image node_id 3 for calling a global function with example usage: test_download_from_uri() and returns: TestArtifactRepo, self,  artifact_path