code: def test_artifacts_read_bad_name(tmp_dir, dvc, caplog):
      bad_name_dvcyaml = deepcopy(dvcyaml)
      bad_name_dvcyaml["artifacts"]["_bad_name_"] = {
          "type": "model",
          "path": "bad.pkl",
      }
  
      (tmp_dir / "dvc.yaml").dump(bad_name_dvcyaml)
  
      artifacts = {
          name: Artifact(**values)
          for name, values in bad_name_dvcyaml["artifacts"].items()
      }
  
      with caplog.at_level(logging.WARNING):
          assert tmp_dir.dvc.artifacts.read() == {"dvc.yaml": artifacts}
          assert (
              "Can't use '_bad_name_' as artifact name (ID)"
              in caplog.text
          )
  
file_path: dvc/tests/func/artifacts/test_artifacts.py
imports: import logging
  import os
  from copy import deepcopy
  import pytest
  from dvc.annotations import Artifact
  from dvc.exceptions import ArtifactNotFoundError, InvalidArgumentError
  from dvc.repo.artifacts import check_name_format
  from dvc.utils.strictyaml import YAMLSyntaxError, YAMLValidationError
label_desc: Use image node_id 2 for calling a global function with example usage: test_artifacts_read_bad_name(tmp_dir, dvc, caplog) without return types