code: def logging_setup() -> Generator[None, None, None]:
      # We need to reconstruct our default handler to properly capture stderr.
      logging._reset_library_root_logger()
      logging.enable_default_handler()
      logging.set_verbosity(logging.INFO)
      logging.enable_propagation()
  
      yield
  
      # After testing, restore default propagation setting.
      logging.disable_propagation()
  
imports: from typing import Callable
  from typing import Generator
  from typing import Optional
  from unittest import mock
  from _pytest.logging import LogCaptureFixture
  import pytest
  from optuna import create_study
  from optuna import logging
  from optuna import Trial
  from optuna import TrialPruned
  from optuna.study import _optimize
  from optuna.study._tell import _tell_with_warning
  from optuna.study._tell import STUDY_TELL_WARNING_KEY
  from optuna.testing.objectives import fail_objective
  from optuna.testing.storages import STORAGE_MODES
  from optuna.testing.storages import StorageSupplier
  from optuna.trial import TrialState
label_desc: Use image node_id 1 for calling a global function with example usage: logging_setup() without return types