docstr: Read artifacts from dvc.yaml.
docstr_tok: ["Read","artifacts","from","dvc.yaml","."]
code: def read(self) -> Dict[str, Dict[str, Artifact]]:
      """Read artifacts from dvc.yaml."""
      artifacts: Dict[str, Dict[str, Artifact]] = {}
      for (
          dvcfile,
          dvcfile_artifacts,
      ) in self.repo.index._artifacts.items():
          dvcyaml = relpath(dvcfile, self.repo.root_dir)
          artifacts[dvcyaml] = {}
          for name, value in dvcfile_artifacts.items():
              try:
                  check_name_format(name)
              except InvalidArgumentError as e:
                  logger.warning(e.msg)
              artifacts[dvcyaml][name] = Artifact(**value)
      return artifacts
  
imports: import os
  import posixpath
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
  from dvc.annotations import Artifact
  from dvc.dvcfile import PROJECT_FILE
  from dvc.exceptions import ArtifactNotFoundError, DvcException, FileExistsLocallyError, InvalidArgumentError
  from dvc.log import logger
  from dvc.utils import relpath, resolve_output
  from dvc.utils.objects import cached_property
  from dvc.utils.serialize import modify_yaml
label_desc: Use image node_id 3 for calling the Artifacts obj's underlying member method code with example usage: obj.read() and returns: artifacts