code: def test_unscale_log(direction: StudyDirection) -> None:
      trials_before = [
          create_trial(
              params={
                  "categorical": 0,
                  "float": 1,
                  "float_log": 2,
                  "int": 3,
                  "int_log": 4,
              },
              distributions={
                  "categorical": CategoricalDistribution((0, 1, 2)),
                  "float": FloatDistribution(1, 10),
                  "float_log": FloatDistribution(1, 10, log=True),
                  "int": IntDistribution(1, 10),
                  "int_log": IntDistribution(1, 10, log=True),
              },
              value=1.0,
          ),
      ]
      p = _preprocessing.UnscaleLog()
      trials_after = p.apply(trials_before, direction)
  
      assert len(trials_before) == len(trials_after) == 1
      assert trials_before[0].value == trials_after[0].value
  
      # Assert that the trial has no log distribution.
      for d in trials_after[0].distributions:
          if isinstance(d, (IntDistribution, FloatDistribution)):
              assert not d.log
  
      # Assert that the parameters and distributions are identical for the non-log distributions.
      for name in ["float", "int", "categorical"]:
          assert (
              trials_before[0].params[name]
              == trials_after[0].params[name]
          )
          assert (
              trials_before[0].distributions[name]
              == trials_after[0].distributions[name]
          )
  
      # Assert that the parameters and distributions are unscaled for the log distributions.
      for name in ["float_log", "int_log"]:
          assert (
              np.log(trials_before[0].params[name])
              == trials_after[0].params[name]
          )
  
          dist_before = trials_before[0].distributions[name]
          dist_after = trials_after[0].distributions[name]
  
          assert isinstance(
              dist_before, (IntDistribution, FloatDistribution)
          )
          assert isinstance(
              dist_after, (IntDistribution, FloatDistribution)
          )
          assert np.log(dist_before.low) == dist_after.low
          assert np.log(dist_before.high) == dist_after.high
  
file_path: optuna/tests/terminator_tests/improvement_tests/test_preprocessing.py
imports: from __future__ import annotations
  from unittest import mock
  import numpy
  import pytest
  from optuna.distributions import CategoricalDistribution
  from optuna.distributions import FloatDistribution
  from optuna.distributions import IntDistribution
  from optuna.study._study_direction import StudyDirection
  from optuna.terminator.improvement import _preprocessing
  from optuna.trial import create_trial
  from optuna.trial import FrozenTrial
label_desc: Use image node_id 4 for calling a global function with example usage: test_unscale_log(direction) without return types