We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Use `__future__.annotations` everywhere in the Optuna code base
### Motivation

Optuna drops Python 3.6 from v3.1, so we can use `__future__.annotations`, which simplifies the code base. See [PEP 563](https://peps.python.org/pep-0563/), [PEP584](https://peps.python.org/pep-0584/), [PEP 585](https://peps.python.org/pep-0585/), and [PEP 604](https://peps.python.org/pep-0604/) for more details. This issue suggests to use the module and simplifies the code base.

### Suggestion

Use `__future__.annotations` for each file and simplify the type annotations. The list of classes whose type annotations can be simplified is [here](https://peps.python.org/pep-0585/#implementation). The list of files where the `__future__.annotations` can be used is as follows. In order to reduce review costs and to encourage more contributors to work on it, please, as a rule, fix one file per PR.

- [x] optuna/_convert_positional_args.py
- [x] optuna/visualization/_optimization_history.py
- [x] optuna/visualization/_hypervolume_history.py
- [x] optuna/visualization/_edf.py
- [x] optuna/visualization/_pareto_front.py
- [x] optuna/visualization/matplotlib/_optimization_history.py
- [x] optuna/visualization/matplotlib/_hypervolume_history.py
- [x] optuna/visualization/matplotlib/_edf.py
- [x] optuna/visualization/matplotlib/_pareto_front.py
- [x] optuna/visualization/matplotlib/_contour.py
- [x] optuna/visualization/_utils.py
- [x] optuna/logging.py
- [ ] optuna/storages/_base.py
- [ ] optuna/storages/_cached_storage.py
- [ ] optuna/storages/__init__.py
- [ ] optuna/storages/_heartbeat.py
- [ ] optuna/storages/_in_memory.py
- [ ] optuna/storages/_rdb/models.py
- [ ] optuna/storages/_rdb/storage.py
- [ ] optuna/storages/_rdb/alembic/versions/v3.0.0.c.py
- [ ] optuna/storages/_rdb/alembic/versions/v3.0.0.d.py
- [ ] optuna/storages/_rdb/alembic/versions/v3.0.0.a.py
- [ ] optuna/storages/_journal/file.py
- [ ] optuna/storages/_journal/redis.py
- [ ] optuna/storages/_journal/storage.py
- [ ] optuna/storages/_journal/base.py
- [ ] optuna/study/_dataframe.py
- [ ] optuna/study/_optimize.py
- [ ] optuna/study/_tell.py
- [ ] optuna/study/_multi_objective.py
- [ ] optuna/study/_frozen.py
- [ ] optuna/study/study.py
- [ ] optuna/study/_study_summary.py
- [ ] optuna/search_space/group_decomposed.py
- [ ] optuna/search_space/intersection.py
- [ ] optuna/_typing.py
- [ ] optuna/_deprecated.py
- [ ] optuna/pruners/_hyperband.py
- [ ] optuna/pruners/_patient.py
- [ ] optuna/pruners/_successive_halving.py
- [ ] optuna/pruners/_percentile.py
- [ ] optuna/pruners/_threshold.py
- [ ] optuna/trial/_base.py
- [ ] optuna/trial/_fixed.py
- [ ] optuna/trial/_trial.py
- [ ] optuna/trial/_frozen.py
- [ ] optuna/integration/cma.py
- [ ] optuna/integration/shap.py
- [ ] optuna/integration/lightgbm.py
- [ ] optuna/integration/pytorch_distributed.py
- [ ] optuna/integration/_lightgbm_tuner/optimize.py
- [ ] optuna/integration/_lightgbm_tuner/alias.py
- [ ] optuna/integration/mlflow.py
- [ ] optuna/integration/wandb.py
- [ ] optuna/integration/catboost.py
- [ ] optuna/integration/skopt.py
- [ ] optuna/integration/botorch.py
- [ ] optuna/integration/dask.py
- [x] optuna/integration/sklearn.py
- [ ] optuna/integration/tensorboard.py
- [ ] optuna/terminator/callback.py
- [ ] optuna/terminator/terminator.py
- [ ] optuna/terminator/improvement/_preprocessing.py
- [ ] optuna/terminator/improvement/gp/botorch.py
- [ ] optuna/terminator/improvement/gp/base.py
- [ ] optuna/terminator/improvement/evaluator.py
- [ ] optuna/importance/_base.py
- [ ] optuna/importance/_mean_decrease_impurity.py
- [ ] optuna/importance/__init__.py
- [ ] optuna/importance/_fanova/_fanova.py
- [ ] optuna/importance/_fanova/_evaluator.py
- [ ] optuna/importance/_fanova/_tree.py
- [ ] optuna/_imports.py
- [ ] optuna/testing/tempfile_pool.py
- [ ] optuna/testing/threading.py
- [ ] optuna/testing/distributions.py
- [ ] optuna/testing/samplers.py
- [ ] optuna/testing/storages.py
- [ ] optuna/distributions.py
- [ ] optuna/cli.py
- [ ] optuna/multi_objective/visualization/_pareto_front.py
- [ ] optuna/multi_objective/trial.py
- [ ] optuna/multi_objective/samplers/_base.py
- [ ] optuna/multi_objective/samplers/_nsga2.py
- [ ] optuna/multi_objective/samplers/_adapter.py
- [ ] optuna/multi_objective/samplers/_random.py
- [ ] optuna/multi_objective/samplers/_motpe.py
- [ ] optuna/multi_objective/study.py
- [ ] optuna/_experimental.py
- [ ] optuna/samplers/_base.py
- [ ] optuna/samplers/nsgaii/_crossovers/_undx.py
- [ ] optuna/samplers/nsgaii/_crossovers/_spx.py
- [ ] optuna/samplers/nsgaii/_crossovers/_sbx.py
- [ ] optuna/samplers/nsgaii/_crossovers/_vsbx.py
- [ ] optuna/samplers/nsgaii/_sampler.py
- [ ] optuna/samplers/nsgaii/_crossover.py
- [ ] optuna/samplers/_search_space/intersection.py
- [ ] optuna/samplers/_qmc.py
- [ ] optuna/samplers/_tpe/probability_distributions.py
- [ ] optuna/samplers/_tpe/_truncnorm.py
- [ ] optuna/samplers/_tpe/multi_objective_sampler.py
- [ ] optuna/samplers/_tpe/parzen_estimator.py
- [ ] optuna/samplers/_tpe/sampler.py
- [ ] optuna/samplers/_random.py
- [ ] optuna/samplers/_cmaes.py
- [ ] optuna/samplers/_partial_fixed.py
- [ ] optuna/samplers/_brute_force.py
- [ ] optuna/samplers/_nsgaiii.py
- [ ] optuna/samplers/_grid.py
- [ ] optuna/_hypervolume/wfg.py
- [ ] optuna/_hypervolume/hssp.py
- [ ] optuna/progress_bar.py
- [ ] optuna/_transform.py
- [ ] optuna/_callbacks.py
- [ ] tests/multi_objective_tests/test_study.py
- [ ] tests/multi_objective_tests/samplers_tests/test_motpe.py
- [ ] tests/multi_objective_tests/samplers_tests/test_nsga2.py
- [ ] tests/multi_objective_tests/test_trial.py
- [ ] tests/multi_objective_tests/visualization_tests/test_pareto_front.py
- [ ] tests/trial_tests/test_frozen.py
- [ ] tests/trial_tests/test_trials.py
- [ ] tests/trial_tests/test_trial.py
- [ ] tests/pruners_tests/test_percentile.py
- [ ] tests/pruners_tests/test_median.py
- [ ] tests/pruners_tests/test_patient.py
- [ ] tests/pruners_tests/test_successive_halving.py
- [ ] tests/study_tests/test_optimize.py
- [ ] tests/study_tests/test_study.py
- [ ] tests/hypervolume_tests/test_hssp.py
- [x] tests/integration_tests/test_skopt.py
- [x] tests/integration_tests/test_pytorch_lightning.py
- [ ] tests/integration_tests/test_shap.py
- [ ] tests/integration_tests/test_cma.py
- [ ] tests/integration_tests/test_pytorch_distributed.py
- [ ] tests/integration_tests/lightgbm_tuner_tests/test_optimize.py
- [ ] tests/integration_tests/lightgbm_tuner_tests/test_alias.py
- [ ] tests/integration_tests/test_botorch.py
- [ ] tests/integration_tests/test_mlflow.py
- [ ] tests/integration_tests/test_mxnet.py
- [ ] tests/integration_tests/test_wandb.py
- [ ] tests/importance_tests/fanova_tests/test_tree.py
- [ ] tests/importance_tests/test_mean_decrease_impurity.py
- [ ] tests/importance_tests/test_fanova.py
- [ ] tests/importance_tests/test_init.py
- [ ] tests/test_convert_positional_args.py
- [ ] tests/test_deprecated.py
- [ ] tests/storages_tests/test_journal.py
- [ ] tests/storages_tests/test_heartbeat.py
- [ ] tests/storages_tests/test_storages.py
- [ ] tests/storages_tests/rdb_tests/test_storage.py
- [ ] tests/storages_tests/rdb_tests/create_db.py
- [ ] tests/storages_tests/test_with_server.py
- [ ] tests/samplers_tests/test_grid.py
- [ ] tests/samplers_tests/tpe_tests/test_parzen_estimator.py
- [ ] tests/samplers_tests/tpe_tests/test_multi_objective_sampler.py
- [ ] tests/samplers_tests/tpe_tests/test_sampler.py
- [ ] tests/samplers_tests/test_cmaes.py
- [ ] tests/samplers_tests/test_samplers.py
- [x] tests/samplers_tests/test_nsgaii.py
- [x] tests/samplers_tests/test_nsgaiii.py
- [ ] tests/samplers_tests/test_qmc.py
- [ ] tests/test_distributions.py
- [ ] tests/test_multi_objective.py
- [ ] tests/test_cli.py
- [ ] tests/visualization_tests/test_hypervolume_history.py
- [ ] tests/visualization_tests/test_pareto_front.py
- [ ] tests/terminator_tests/improvement_tests/test_evaluator.py
- [ ] benchmarks/kurobako/problems/wfg/transformation_functions.py
- [ ] benchmarks/bayesmark/report_bayesmark.py
- [ ] benchmarks/bayesmark/optuna_optimizer.py


### Additional context (optional)

The above list is generated by the following script.

<details>
<summary>script</summary>

```python
import os
import pathlib


PATTERS = [
    "from typing import Union",
    "from typing import Optional",
    "from typing import Tuple",
    "from typing import List",
    "from typing import Dict",
    "from typing import Set",
    "from typing import FrozenSet",
    "from typing import Type",
    "from typing import FrozenSet",
    "from typing import Sequence",
]


def get_filenames_to_be_simplified(dir_path):
    ret = []
    for f in os.listdir(dir_path):
        file_path = os.path.join(dir_path, f)
        if not os.path.isfile(file_path):
            ret.extend(get_filenames_to_be_simplified(file_path))
        else:
            try:
                with open(file_path) as fd:
                    contents = fd.read()
                    if any([s in contents for s in PATTERS]):
                        ret.append(str(file_path))
            except UnicodeDecodeError as e:
                pass
    return ret


def main():
    dirs = ["optuna", "tests", "benchmarks"]

    for dir_name in dirs:
        filenames = get_filenames_to_be_simplified(pathlib.Path(dir_name))
        for filename in filenames:
            print(f"- [ ] {filename}")

if __name__ == "__main__":
    main()
```

</details>

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `optuna/study/_frozen.py`
Content:
```
1 from typing import Any
2 from typing import Dict
3 from typing import List
4 from typing import Optional
5 from typing import Sequence
6 
7 from optuna import logging
8 from optuna.study._study_direction import StudyDirection
9 
10 
11 _logger = logging.get_logger(__name__)
12 
13 
14 class FrozenStudy:
15     """Basic attributes of a :class:`~optuna.study.Study`.
16 
17     This class is private and not referenced by Optuna users.
18 
19     Attributes:
20         study_name:
21             Name of the :class:`~optuna.study.Study`.
22         direction:
23             :class:`~optuna.study.StudyDirection` of the :class:`~optuna.study.Study`.
24 
25             .. note::
26                 This attribute is only available during single-objective optimization.
27         directions:
28             A list of :class:`~optuna.study.StudyDirection` objects.
29         user_attrs:
30             Dictionary that contains the attributes of the :class:`~optuna.study.Study` set with
31             :func:`optuna.study.Study.set_user_attr`.
32         system_attrs:
33             Dictionary that contains the attributes of the :class:`~optuna.study.Study` internally
34             set by Optuna.
35 
36     """
37 
38     def __init__(
39         self,
40         study_name: str,
41         direction: Optional[StudyDirection],
42         user_attrs: Dict[str, Any],
43         system_attrs: Dict[str, Any],
44         study_id: int,
45         *,
46         directions: Optional[Sequence[StudyDirection]] = None,
47     ):
48         self.study_name = study_name
49         if direction is None and directions is None:
50             raise ValueError("Specify one of `direction` and `directions`.")
51         elif directions is not None:
52             self._directions = list(directions)
53         elif direction is not None:
54             self._directions = [direction]
55         else:
56             raise ValueError("Specify only one of `direction` and `directions`.")
57         self.user_attrs = user_attrs
58         self.system_attrs = system_attrs
59         self._study_id = study_id
60 
61     def __eq__(self, other: Any) -> bool:
62         if not isinstance(other, FrozenStudy):
63             return NotImplemented
64 
65         return other.__dict__ == self.__dict__
66 
67     def __lt__(self, other: Any) -> bool:
68         if not isinstance(other, FrozenStudy):
69             return NotImplemented
70 
71         return self._study_id < other._study_id
72 
73     def __le__(self, other: Any) -> bool:
74         if not isinstance(other, FrozenStudy):
75             return NotImplemented
76 
77         return self._study_id <= other._study_id
78 
79     @property
80     def direction(self) -> StudyDirection:
81         if len(self._directions) > 1:
82             raise RuntimeError(
83                 "This attribute is not available during multi-objective optimization."
84             )
85 
86         return self._directions[0]
87 
88     @property
89     def directions(self) -> List[StudyDirection]:
90         return self._directions
91
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/optuna/study/_frozen.py b/optuna/study/_frozen.py
--- a/optuna/study/_frozen.py
+++ b/optuna/study/_frozen.py
@@ -1,8 +1,7 @@
+from __future__ import annotations
+
+from collections.abc import Sequence
 from typing import Any
-from typing import Dict
-from typing import List
-from typing import Optional
-from typing import Sequence
 
 from optuna import logging
 from optuna.study._study_direction import StudyDirection
@@ -38,12 +37,12 @@
     def __init__(
         self,
         study_name: str,
-        direction: Optional[StudyDirection],
-        user_attrs: Dict[str, Any],
-        system_attrs: Dict[str, Any],
+        direction: StudyDirection | None,
+        user_attrs: dict[str, Any],
+        system_attrs: dict[str, Any],
         study_id: int,
         *,
-        directions: Optional[Sequence[StudyDirection]] = None,
+        directions: Sequence[StudyDirection] | None = None,
     ):
         self.study_name = study_name
         if direction is None and directions is None:
@@ -86,5 +85,5 @@
         return self._directions[0]
 
     @property
-    def directions(self) -> List[StudyDirection]:
+    def directions(self) -> list[StudyDirection]:
         return self._directions

{"golden_diff": "diff --git a/optuna/study/_frozen.py b/optuna/study/_frozen.py\n--- a/optuna/study/_frozen.py\n+++ b/optuna/study/_frozen.py\n@@ -1,8 +1,7 @@\n+from __future__ import annotations\n+\n+from collections.abc import Sequence\n from typing import Any\n-from typing import Dict\n-from typing import List\n-from typing import Optional\n-from typing import Sequence\n \n from optuna import logging\n from optuna.study._study_direction import StudyDirection\n@@ -38,12 +37,12 @@\n     def __init__(\n         self,\n         study_name: str,\n-        direction: Optional[StudyDirection],\n-        user_attrs: Dict[str, Any],\n-        system_attrs: Dict[str, Any],\n+        direction: StudyDirection | None,\n+        user_attrs: dict[str, Any],\n+        system_attrs: dict[str, Any],\n         study_id: int,\n         *,\n-        directions: Optional[Sequence[StudyDirection]] = None,\n+        directions: Sequence[StudyDirection] | None = None,\n     ):\n         self.study_name = study_name\n         if direction is None and directions is None:\n@@ -86,5 +85,5 @@\n         return self._directions[0]\n \n     @property\n-    def directions(self) -> List[StudyDirection]:\n+    def directions(self) -> list[StudyDirection]:\n         return self._directions\n", "issue": "Use `__future__.annotations` everywhere in the Optuna code base\n### Motivation\r\n\r\nOptuna drops Python 3.6 from v3.1, so we can use `__future__.annotations`, which simplifies the code base. See [PEP 563](https://peps.python.org/pep-0563/), [PEP584](https://peps.python.org/pep-0584/), [PEP 585](https://peps.python.org/pep-0585/), and [PEP 604](https://peps.python.org/pep-0604/) for more details. This issue suggests to use the module and simplifies the code base.\r\n\r\n### Suggestion\r\n\r\nUse `__future__.annotations` for each file and simplify the type annotations. The list of classes whose type annotations can be simplified is [here](https://peps.python.org/pep-0585/#implementation). The list of files where the `__future__.annotations` can be used is as follows. In order to reduce review costs and to encourage more contributors to work on it, please, as a rule, fix one file per PR.\r\n\r\n- [x] optuna/_convert_positional_args.py\r\n- [x] optuna/visualization/_optimization_history.py\r\n- [x] optuna/visualization/_hypervolume_history.py\r\n- [x] optuna/visualization/_edf.py\r\n- [x] optuna/visualization/_pareto_front.py\r\n- [x] optuna/visualization/matplotlib/_optimization_history.py\r\n- [x] optuna/visualization/matplotlib/_hypervolume_history.py\r\n- [x] optuna/visualization/matplotlib/_edf.py\r\n- [x] optuna/visualization/matplotlib/_pareto_front.py\r\n- [x] optuna/visualization/matplotlib/_contour.py\r\n- [x] optuna/visualization/_utils.py\r\n- [x] optuna/logging.py\r\n- [ ] optuna/storages/_base.py\r\n- [ ] optuna/storages/_cached_storage.py\r\n- [ ] optuna/storages/__init__.py\r\n- [ ] optuna/storages/_heartbeat.py\r\n- [ ] optuna/storages/_in_memory.py\r\n- [ ] optuna/storages/_rdb/models.py\r\n- [ ] optuna/storages/_rdb/storage.py\r\n- [ ] optuna/storages/_rdb/alembic/versions/v3.0.0.c.py\r\n- [ ] optuna/storages/_rdb/alembic/versions/v3.0.0.d.py\r\n- [ ] optuna/storages/_rdb/alembic/versions/v3.0.0.a.py\r\n- [ ] optuna/storages/_journal/file.py\r\n- [ ] optuna/storages/_journal/redis.py\r\n- [ ] optuna/storages/_journal/storage.py\r\n- [ ] optuna/storages/_journal/base.py\r\n- [ ] optuna/study/_dataframe.py\r\n- [ ] optuna/study/_optimize.py\r\n- [ ] optuna/study/_tell.py\r\n- [ ] optuna/study/_multi_objective.py\r\n- [ ] optuna/study/_frozen.py\r\n- [ ] optuna/study/study.py\r\n- [ ] optuna/study/_study_summary.py\r\n- [ ] optuna/search_space/group_decomposed.py\r\n- [ ] optuna/search_space/intersection.py\r\n- [ ] optuna/_typing.py\r\n- [ ] optuna/_deprecated.py\r\n- [ ] optuna/pruners/_hyperband.py\r\n- [ ] optuna/pruners/_patient.py\r\n- [ ] optuna/pruners/_successive_halving.py\r\n- [ ] optuna/pruners/_percentile.py\r\n- [ ] optuna/pruners/_threshold.py\r\n- [ ] optuna/trial/_base.py\r\n- [ ] optuna/trial/_fixed.py\r\n- [ ] optuna/trial/_trial.py\r\n- [ ] optuna/trial/_frozen.py\r\n- [ ] optuna/integration/cma.py\r\n- [ ] optuna/integration/shap.py\r\n- [ ] optuna/integration/lightgbm.py\r\n- [ ] optuna/integration/pytorch_distributed.py\r\n- [ ] optuna/integration/_lightgbm_tuner/optimize.py\r\n- [ ] optuna/integration/_lightgbm_tuner/alias.py\r\n- [ ] optuna/integration/mlflow.py\r\n- [ ] optuna/integration/wandb.py\r\n- [ ] optuna/integration/catboost.py\r\n- [ ] optuna/integration/skopt.py\r\n- [ ] optuna/integration/botorch.py\r\n- [ ] optuna/integration/dask.py\r\n- [x] optuna/integration/sklearn.py\r\n- [ ] optuna/integration/tensorboard.py\r\n- [ ] optuna/terminator/callback.py\r\n- [ ] optuna/terminator/terminator.py\r\n- [ ] optuna/terminator/improvement/_preprocessing.py\r\n- [ ] optuna/terminator/improvement/gp/botorch.py\r\n- [ ] optuna/terminator/improvement/gp/base.py\r\n- [ ] optuna/terminator/improvement/evaluator.py\r\n- [ ] optuna/importance/_base.py\r\n- [ ] optuna/importance/_mean_decrease_impurity.py\r\n- [ ] optuna/importance/__init__.py\r\n- [ ] optuna/importance/_fanova/_fanova.py\r\n- [ ] optuna/importance/_fanova/_evaluator.py\r\n- [ ] optuna/importance/_fanova/_tree.py\r\n- [ ] optuna/_imports.py\r\n- [ ] optuna/testing/tempfile_pool.py\r\n- [ ] optuna/testing/threading.py\r\n- [ ] optuna/testing/distributions.py\r\n- [ ] optuna/testing/samplers.py\r\n- [ ] optuna/testing/storages.py\r\n- [ ] optuna/distributions.py\r\n- [ ] optuna/cli.py\r\n- [ ] optuna/multi_objective/visualization/_pareto_front.py\r\n- [ ] optuna/multi_objective/trial.py\r\n- [ ] optuna/multi_objective/samplers/_base.py\r\n- [ ] optuna/multi_objective/samplers/_nsga2.py\r\n- [ ] optuna/multi_objective/samplers/_adapter.py\r\n- [ ] optuna/multi_objective/samplers/_random.py\r\n- [ ] optuna/multi_objective/samplers/_motpe.py\r\n- [ ] optuna/multi_objective/study.py\r\n- [ ] optuna/_experimental.py\r\n- [ ] optuna/samplers/_base.py\r\n- [ ] optuna/samplers/nsgaii/_crossovers/_undx.py\r\n- [ ] optuna/samplers/nsgaii/_crossovers/_spx.py\r\n- [ ] optuna/samplers/nsgaii/_crossovers/_sbx.py\r\n- [ ] optuna/samplers/nsgaii/_crossovers/_vsbx.py\r\n- [ ] optuna/samplers/nsgaii/_sampler.py\r\n- [ ] optuna/samplers/nsgaii/_crossover.py\r\n- [ ] optuna/samplers/_search_space/intersection.py\r\n- [ ] optuna/samplers/_qmc.py\r\n- [ ] optuna/samplers/_tpe/probability_distributions.py\r\n- [ ] optuna/samplers/_tpe/_truncnorm.py\r\n- [ ] optuna/samplers/_tpe/multi_objective_sampler.py\r\n- [ ] optuna/samplers/_tpe/parzen_estimator.py\r\n- [ ] optuna/samplers/_tpe/sampler.py\r\n- [ ] optuna/samplers/_random.py\r\n- [ ] optuna/samplers/_cmaes.py\r\n- [ ] optuna/samplers/_partial_fixed.py\r\n- [ ] optuna/samplers/_brute_force.py\r\n- [ ] optuna/samplers/_nsgaiii.py\r\n- [ ] optuna/samplers/_grid.py\r\n- [ ] optuna/_hypervolume/wfg.py\r\n- [ ] optuna/_hypervolume/hssp.py\r\n- [ ] optuna/progress_bar.py\r\n- [ ] optuna/_transform.py\r\n- [ ] optuna/_callbacks.py\r\n- [ ] tests/multi_objective_tests/test_study.py\r\n- [ ] tests/multi_objective_tests/samplers_tests/test_motpe.py\r\n- [ ] tests/multi_objective_tests/samplers_tests/test_nsga2.py\r\n- [ ] tests/multi_objective_tests/test_trial.py\r\n- [ ] tests/multi_objective_tests/visualization_tests/test_pareto_front.py\r\n- [ ] tests/trial_tests/test_frozen.py\r\n- [ ] tests/trial_tests/test_trials.py\r\n- [ ] tests/trial_tests/test_trial.py\r\n- [ ] tests/pruners_tests/test_percentile.py\r\n- [ ] tests/pruners_tests/test_median.py\r\n- [ ] tests/pruners_tests/test_patient.py\r\n- [ ] tests/pruners_tests/test_successive_halving.py\r\n- [ ] tests/study_tests/test_optimize.py\r\n- [ ] tests/study_tests/test_study.py\r\n- [ ] tests/hypervolume_tests/test_hssp.py\r\n- [x] tests/integration_tests/test_skopt.py\r\n- [x] tests/integration_tests/test_pytorch_lightning.py\r\n- [ ] tests/integration_tests/test_shap.py\r\n- [ ] tests/integration_tests/test_cma.py\r\n- [ ] tests/integration_tests/test_pytorch_distributed.py\r\n- [ ] tests/integration_tests/lightgbm_tuner_tests/test_optimize.py\r\n- [ ] tests/integration_tests/lightgbm_tuner_tests/test_alias.py\r\n- [ ] tests/integration_tests/test_botorch.py\r\n- [ ] tests/integration_tests/test_mlflow.py\r\n- [ ] tests/integration_tests/test_mxnet.py\r\n- [ ] tests/integration_tests/test_wandb.py\r\n- [ ] tests/importance_tests/fanova_tests/test_tree.py\r\n- [ ] tests/importance_tests/test_mean_decrease_impurity.py\r\n- [ ] tests/importance_tests/test_fanova.py\r\n- [ ] tests/importance_tests/test_init.py\r\n- [ ] tests/test_convert_positional_args.py\r\n- [ ] tests/test_deprecated.py\r\n- [ ] tests/storages_tests/test_journal.py\r\n- [ ] tests/storages_tests/test_heartbeat.py\r\n- [ ] tests/storages_tests/test_storages.py\r\n- [ ] tests/storages_tests/rdb_tests/test_storage.py\r\n- [ ] tests/storages_tests/rdb_tests/create_db.py\r\n- [ ] tests/storages_tests/test_with_server.py\r\n- [ ] tests/samplers_tests/test_grid.py\r\n- [ ] tests/samplers_tests/tpe_tests/test_parzen_estimator.py\r\n- [ ] tests/samplers_tests/tpe_tests/test_multi_objective_sampler.py\r\n- [ ] tests/samplers_tests/tpe_tests/test_sampler.py\r\n- [ ] tests/samplers_tests/test_cmaes.py\r\n- [ ] tests/samplers_tests/test_samplers.py\r\n- [x] tests/samplers_tests/test_nsgaii.py\r\n- [x] tests/samplers_tests/test_nsgaiii.py\r\n- [ ] tests/samplers_tests/test_qmc.py\r\n- [ ] tests/test_distributions.py\r\n- [ ] tests/test_multi_objective.py\r\n- [ ] tests/test_cli.py\r\n- [ ] tests/visualization_tests/test_hypervolume_history.py\r\n- [ ] tests/visualization_tests/test_pareto_front.py\r\n- [ ] tests/terminator_tests/improvement_tests/test_evaluator.py\r\n- [ ] benchmarks/kurobako/problems/wfg/transformation_functions.py\r\n- [ ] benchmarks/bayesmark/report_bayesmark.py\r\n- [ ] benchmarks/bayesmark/optuna_optimizer.py\r\n\r\n\r\n### Additional context (optional)\r\n\r\nThe above list is generated by the following script.\r\n\r\n<details>\r\n<summary>script</summary>\r\n\r\n```python\r\nimport os\r\nimport pathlib\r\n\r\n\r\nPATTERS = [\r\n    \"from typing import Union\",\r\n    \"from typing import Optional\",\r\n    \"from typing import Tuple\",\r\n    \"from typing import List\",\r\n    \"from typing import Dict\",\r\n    \"from typing import Set\",\r\n    \"from typing import FrozenSet\",\r\n    \"from typing import Type\",\r\n    \"from typing import FrozenSet\",\r\n    \"from typing import Sequence\",\r\n]\r\n\r\n\r\ndef get_filenames_to_be_simplified(dir_path):\r\n    ret = []\r\n    for f in os.listdir(dir_path):\r\n        file_path = os.path.join(dir_path, f)\r\n        if not os.path.isfile(file_path):\r\n            ret.extend(get_filenames_to_be_simplified(file_path))\r\n        else:\r\n            try:\r\n                with open(file_path) as fd:\r\n                    contents = fd.read()\r\n                    if any([s in contents for s in PATTERS]):\r\n                        ret.append(str(file_path))\r\n            except UnicodeDecodeError as e:\r\n                pass\r\n    return ret\r\n\r\n\r\ndef main():\r\n    dirs = [\"optuna\", \"tests\", \"benchmarks\"]\r\n\r\n    for dir_name in dirs:\r\n        filenames = get_filenames_to_be_simplified(pathlib.Path(dir_name))\r\n        for filename in filenames:\r\n            print(f\"- [ ] {filename}\")\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n```\r\n\r\n</details>\n", "before_files": [{"content": "from typing import Any\nfrom typing import Dict\nfrom typing import List\nfrom typing import Optional\nfrom typing import Sequence\n\nfrom optuna import logging\nfrom optuna.study._study_direction import StudyDirection\n\n\n_logger = logging.get_logger(__name__)\n\n\nclass FrozenStudy:\n    \"\"\"Basic attributes of a :class:`~optuna.study.Study`.\n\n    This class is private and not referenced by Optuna users.\n\n    Attributes:\n        study_name:\n            Name of the :class:`~optuna.study.Study`.\n        direction:\n            :class:`~optuna.study.StudyDirection` of the :class:`~optuna.study.Study`.\n\n            .. note::\n                This attribute is only available during single-objective optimization.\n        directions:\n            A list of :class:`~optuna.study.StudyDirection` objects.\n        user_attrs:\n            Dictionary that contains the attributes of the :class:`~optuna.study.Study` set with\n            :func:`optuna.study.Study.set_user_attr`.\n        system_attrs:\n            Dictionary that contains the attributes of the :class:`~optuna.study.Study` internally\n            set by Optuna.\n\n    \"\"\"\n\n    def __init__(\n        self,\n        study_name: str,\n        direction: Optional[StudyDirection],\n        user_attrs: Dict[str, Any],\n        system_attrs: Dict[str, Any],\n        study_id: int,\n        *,\n        directions: Optional[Sequence[StudyDirection]] = None,\n    ):\n        self.study_name = study_name\n        if direction is None and directions is None:\n            raise ValueError(\"Specify one of `direction` and `directions`.\")\n        elif directions is not None:\n            self._directions = list(directions)\n        elif direction is not None:\n            self._directions = [direction]\n        else:\n            raise ValueError(\"Specify only one of `direction` and `directions`.\")\n        self.user_attrs = user_attrs\n        self.system_attrs = system_attrs\n        self._study_id = study_id\n\n    def __eq__(self, other: Any) -> bool:\n        if not isinstance(other, FrozenStudy):\n            return NotImplemented\n\n        return other.__dict__ == self.__dict__\n\n    def __lt__(self, other: Any) -> bool:\n        if not isinstance(other, FrozenStudy):\n            return NotImplemented\n\n        return self._study_id < other._study_id\n\n    def __le__(self, other: Any) -> bool:\n        if not isinstance(other, FrozenStudy):\n            return NotImplemented\n\n        return self._study_id <= other._study_id\n\n    @property\n    def direction(self) -> StudyDirection:\n        if len(self._directions) > 1:\n            raise RuntimeError(\n                \"This attribute is not available during multi-objective optimization.\"\n            )\n\n        return self._directions[0]\n\n    @property\n    def directions(self) -> List[StudyDirection]:\n        return self._directions\n", "path": "optuna/study/_frozen.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom collections.abc import Sequence\nfrom typing import Any\n\nfrom optuna import logging\nfrom optuna.study._study_direction import StudyDirection\n\n\n_logger = logging.get_logger(__name__)\n\n\nclass FrozenStudy:\n    \"\"\"Basic attributes of a :class:`~optuna.study.Study`.\n\n    This class is private and not referenced by Optuna users.\n\n    Attributes:\n        study_name:\n            Name of the :class:`~optuna.study.Study`.\n        direction:\n            :class:`~optuna.study.StudyDirection` of the :class:`~optuna.study.Study`.\n\n            .. note::\n                This attribute is only available during single-objective optimization.\n        directions:\n            A list of :class:`~optuna.study.StudyDirection` objects.\n        user_attrs:\n            Dictionary that contains the attributes of the :class:`~optuna.study.Study` set with\n            :func:`optuna.study.Study.set_user_attr`.\n        system_attrs:\n            Dictionary that contains the attributes of the :class:`~optuna.study.Study` internally\n            set by Optuna.\n\n    \"\"\"\n\n    def __init__(\n        self,\n        study_name: str,\n        direction: StudyDirection | None,\n        user_attrs: dict[str, Any],\n        system_attrs: dict[str, Any],\n        study_id: int,\n        *,\n        directions: Sequence[StudyDirection] | None = None,\n    ):\n        self.study_name = study_name\n        if direction is None and directions is None:\n            raise ValueError(\"Specify one of `direction` and `directions`.\")\n        elif directions is not None:\n            self._directions = list(directions)\n        elif direction is not None:\n            self._directions = [direction]\n        else:\n            raise ValueError(\"Specify only one of `direction` and `directions`.\")\n        self.user_attrs = user_attrs\n        self.system_attrs = system_attrs\n        self._study_id = study_id\n\n    def __eq__(self, other: Any) -> bool:\n        if not isinstance(other, FrozenStudy):\n            return NotImplemented\n\n        return other.__dict__ == self.__dict__\n\n    def __lt__(self, other: Any) -> bool:\n        if not isinstance(other, FrozenStudy):\n            return NotImplemented\n\n        return self._study_id < other._study_id\n\n    def __le__(self, other: Any) -> bool:\n        if not isinstance(other, FrozenStudy):\n            return NotImplemented\n\n        return self._study_id <= other._study_id\n\n    @property\n    def direction(self) -> StudyDirection:\n        if len(self._directions) > 1:\n            raise RuntimeError(\n                \"This attribute is not available during multi-objective optimization.\"\n            )\n\n        return self._directions[0]\n\n    @property\n    def directions(self) -> list[StudyDirection]:\n        return self._directions\n", "path": "optuna/study/_frozen.py"}]}