code: def __init__(
      self,
      theme: Optional[Dict] = None,
      defaults: Optional[Dict] = None,
  ) -> None:
      from collections import defaultdict
  
      theme = theme or {
          "success": {"color": "green", "style": "bold"},
          "warn": {"color": "yellow"},
          "error": {"color": "red", "style": "bold"},
      }
      self.theme = defaultdict(lambda: defaults or {}, theme)
  
imports: from contextlib import contextmanager, nullcontext
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, Optional, Sequence, TextIO, Type, Union
  import colorama
  from dvc.utils.objects import cached_property
label_desc: Use image node_id 1 to create a new Formatter object  with example: obj = Formatter(theme, defaults)