code: def test_infer_artifact_type_and_ext(
      is_file, artifact, artifact_type, ext, tmp_path, cm_fn_tuple
  ):
      if is_file:
          artifact_representation = tmp_path / f"test.{ext}"
          artifact(artifact_representation)
      else:
          artifact_representation = artifact
      (
          inferred_from_path,
          inferred_type,
          inferred_ext,
      ) = _infer_artifact_type_and_ext(
          f"{ext}_{artifact_type.__name__}_artifact",
          artifact_representation,
          cm_fn_tuple,
      )
      assert not is_file ^ inferred_from_path
      assert inferred_type is artifact_type
      assert inferred_ext == f".{ext}"
  
file_path: mlflow/tests/models/test_artifacts.py
imports: import json
  import pathlib
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  from mlflow.exceptions import MlflowException
  from mlflow.models.evaluation.artifacts import CsvEvaluationArtifact, ImageEvaluationArtifact, JsonEvaluationArtifact, NumpyEvaluationArtifact, ParquetEvaluationArtifact, PickleEvaluationArtifact, TextEvaluationArtifact, _infer_artifact_type_and_ext
  from mlflow.models.evaluation.default_evaluator import _CustomArtifact
label_desc: Use image node_id 3 for calling a global function with example usage: test_infer_artifact_type_and_ext(is_file, artifact, artifact_type, ext, tmp_path, cm_fn_tuple) without return types