code: def reset_loglevel(request, caplog):
      """
      Use it to ensure log level at the start of each test
      regardless of dvc.logger.setup(), Repo configs or whatever.
      """
      ini_opt = None
      with suppress(ValueError):
          ini_opt = request.config.getini("log_level")
  
      level = request.config.getoption("--log-level") or ini_opt
      if level:
          with caplog.at_level(level.upper(), logger="dvc"):
              yield
      else:
          yield
  
imports: import json
  import os
  import sys
  from contextlib import suppress
  import pytest
  from dvc import env
  from dvc.stage import PipelineStage
  from dvc.testing.fixtures import *
  from .dir_helpers import *
  from .remotes import *
  from .scripts import *
label_desc: Use image node_id 1 for calling a global function with example usage: reset_loglevel(request, caplog) without return types