code: def __init__(
      self,
      exc: "MultipleInvalid",
      path: Optional[str] = None,
      text: Optional[str] = None,
      rev: Optional[str] = None,
  ) -> None:
      self.text = text or ""
      self.exc = exc
  
      rel = make_relpath(path) if path else ""
      self.path = path or ""
  
      message = f"'{rel}' validation failed"
      message += f" in revision '{rev[:7]}'" if rev else ""
      if len(self.exc.errors) > 1:
          message += f": {len(self.exc.errors)} errors"
      super().__init__(f"{message}")
  
imports: import re
  import typing
  from contextlib import suppress
  from typing import TYPE_CHECKING, Any, Callable, List, Optional, Tuple, TypeVar
  from dvc.exceptions import PrettyDvcException
  from dvc.ui import ui
  from dvc.utils.serialize import EncodingError, YAMLFileCorruptedError, parse_yaml, parse_yaml_for_update
label_desc: Use image node_id 1 to create a new YAMLValidationError object from inherited base classes: PrettyDvcException with example: obj = YAMLValidationError(exc, path, text, rev)