docstr: Prettify exception message.
docstr_tok: ["Prettify","exception","message","."]
code: def __pretty_exc__(self, **kwargs: Any) -> None:
      """Prettify exception message."""
      from collections.abc import Mapping
  
      lines: List[object] = []
      data = parse_yaml_for_update(self.text, self.path)
      if isinstance(data, Mapping):
          lines.extend(self._prepare_context(data))
  
      cause = ""
      if lines:
          # we should not add a newline after the main message
          # if there are no other outputs
          lines.insert(0, "")
      else:
          # if we don't have any context to show, we'll fallback to what we
          # got from voluptuous and print them in the same line.
          cause = f": {self.exc}"
  
      lines.insert(0, _prepare_message(f"{self}{cause}."))
      for line in lines:
          ui.error_write(line, styled=True)
  
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 3 for calling the YAMLValidationError obj's underlying member method code with example usage: obj.__pretty_exc__() without return types