code: def apply_log_filter(log_filter):
      """
      User contextmanager to control the scope of applying one log filter.
      Currently, it is to filter some lightning's log messages.
      But we can easily extend it to cover more loggers.
  
      Parameters
      ----------
      log_filter
          Log filter.
      """
      try:
          add_log_filter(logging.getLogger(), log_filter)
          add_log_filter(logging.getLogger("lightning"), log_filter)
          add_log_filter(
              logging.getLogger("lightning.pytorch"), log_filter
          )
          yield
  
      finally:
          remove_log_filter(logging.getLogger(), log_filter)
          remove_log_filter(logging.getLogger("lightning"), log_filter)
          remove_log_filter(
              logging.getLogger("lightning.pytorch"), log_filter
          )
  
file_path: autogluon/multimodal/src/autogluon/multimodal/utils/log.py
imports: import datetime
  import logging
  import os
  from contextlib import contextmanager
  from typing import Dict, List, Optional, Tuple, Union
  import pytz
  import torch
  from autogluon.common.utils.system_info import get_ag_system_info
label_desc: Use image node_id 4 for calling a global function with example usage: apply_log_filter(log_filter) without return types