code: def _map_log_level_to_flag() -> Optional[str]:
      flags = {logging.DEBUG: "-v", logging.TRACE: "-vv"}  # type: ignore[attr-defined]
      return flags.get(logger.getEffectiveLevel())
  
imports: import inspect
  import logging
  import os
  import subprocess
  import sys
  from contextlib import nullcontext
  from typing import TYPE_CHECKING, Any, List, Mapping, Optional, Sequence, Union
  from dvc.log import logger
  from dvc.env import DVC_DAEMON, DVC_DAEMON_LOGFILE
  from dvc.utils import fix_env, is_binary
  from dvc.utils.collections import ensure_list
label_desc: Use image node_id 7 for calling a global function with example usage: _map_log_level_to_flag() and returns: flags