We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Use function annotation syntax for Type Hints.
After dropping Python 2.7 support at #710, we can define type hints with function annotation syntax. 
~~Do you have a plan to update the coding style guideline?~~
https://github.com/optuna/optuna/wiki/Coding-Style-Conventions

## Progress

- [x] `optuna/integration/sklearn.py` (#1735)
- [x] `optuna/study.py` - assigned to harpy

## Note to the questioner

We still cannot use variable annotation syntax introduced by [PEP 526](https://www.python.org/dev/peps/pep-0526/) because we supports Python 3.5.

--- 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/pruners/_nop.py`
Content:
```
1 from optuna.pruners import BasePruner
2 from optuna import type_checking
3 
4 if type_checking.TYPE_CHECKING:
5     from optuna.study import Study  # NOQA
6     from optuna.trial import FrozenTrial  # NOQA
7 
8 
9 class NopPruner(BasePruner):
10     """Pruner which never prunes trials.
11 
12     Example:
13 
14         .. testcode::
15 
16             import numpy as np
17             from sklearn.datasets import load_iris
18             from sklearn.linear_model import SGDClassifier
19             from sklearn.model_selection import train_test_split
20 
21             import optuna
22 
23             X, y = load_iris(return_X_y=True)
24             X_train, X_valid, y_train, y_valid = train_test_split(X, y)
25             classes = np.unique(y)
26 
27             def objective(trial):
28                 alpha = trial.suggest_uniform('alpha', 0.0, 1.0)
29                 clf = SGDClassifier(alpha=alpha)
30                 n_train_iter = 100
31 
32                 for step in range(n_train_iter):
33                     clf.partial_fit(X_train, y_train, classes=classes)
34 
35                     intermediate_value = clf.score(X_valid, y_valid)
36                     trial.report(intermediate_value, step)
37 
38                     if trial.should_prune():
39                         assert False, "should_prune() should always return False with this pruner."
40                         raise optuna.TrialPruned()
41 
42                 return clf.score(X_valid, y_valid)
43 
44             study = optuna.create_study(direction='maximize',
45                                         pruner=optuna.pruners.NopPruner())
46             study.optimize(objective, n_trials=20)
47     """
48 
49     def prune(self, study, trial):
50         # type: (Study, FrozenTrial) -> bool
51 
52         return False
53
```
--- 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/pruners/_nop.py b/optuna/pruners/_nop.py
--- a/optuna/pruners/_nop.py
+++ b/optuna/pruners/_nop.py
@@ -1,9 +1,5 @@
+import optuna
 from optuna.pruners import BasePruner
-from optuna import type_checking
-
-if type_checking.TYPE_CHECKING:
-    from optuna.study import Study  # NOQA
-    from optuna.trial import FrozenTrial  # NOQA
 
 
 class NopPruner(BasePruner):
@@ -46,7 +42,6 @@
             study.optimize(objective, n_trials=20)
     """
 
-    def prune(self, study, trial):
-        # type: (Study, FrozenTrial) -> bool
+    def prune(self, study: "optuna.study.Study", trial: "optuna.trial.FrozenTrial") -> bool:
 
         return False

{"golden_diff": "diff --git a/optuna/pruners/_nop.py b/optuna/pruners/_nop.py\n--- a/optuna/pruners/_nop.py\n+++ b/optuna/pruners/_nop.py\n@@ -1,9 +1,5 @@\n+import optuna\n from optuna.pruners import BasePruner\n-from optuna import type_checking\n-\n-if type_checking.TYPE_CHECKING:\n-    from optuna.study import Study  # NOQA\n-    from optuna.trial import FrozenTrial  # NOQA\n \n \n class NopPruner(BasePruner):\n@@ -46,7 +42,6 @@\n             study.optimize(objective, n_trials=20)\n     \"\"\"\n \n-    def prune(self, study, trial):\n-        # type: (Study, FrozenTrial) -> bool\n+    def prune(self, study: \"optuna.study.Study\", trial: \"optuna.trial.FrozenTrial\") -> bool:\n \n         return False\n", "issue": "Use function annotation syntax for Type Hints.\nAfter dropping Python 2.7 support at #710, we can define type hints with function annotation syntax. \r\n~~Do you have a plan to update the coding style guideline?~~\r\nhttps://github.com/optuna/optuna/wiki/Coding-Style-Conventions\r\n\r\n## Progress\r\n\r\n- [x] `optuna/integration/sklearn.py` (#1735)\r\n- [x] `optuna/study.py` - assigned to harpy\r\n\r\n## Note to the questioner\r\n\r\nWe still cannot use variable annotation syntax introduced by [PEP 526](https://www.python.org/dev/peps/pep-0526/) because we supports Python 3.5.\n", "before_files": [{"content": "from optuna.pruners import BasePruner\nfrom optuna import type_checking\n\nif type_checking.TYPE_CHECKING:\n    from optuna.study import Study  # NOQA\n    from optuna.trial import FrozenTrial  # NOQA\n\n\nclass NopPruner(BasePruner):\n    \"\"\"Pruner which never prunes trials.\n\n    Example:\n\n        .. testcode::\n\n            import numpy as np\n            from sklearn.datasets import load_iris\n            from sklearn.linear_model import SGDClassifier\n            from sklearn.model_selection import train_test_split\n\n            import optuna\n\n            X, y = load_iris(return_X_y=True)\n            X_train, X_valid, y_train, y_valid = train_test_split(X, y)\n            classes = np.unique(y)\n\n            def objective(trial):\n                alpha = trial.suggest_uniform('alpha', 0.0, 1.0)\n                clf = SGDClassifier(alpha=alpha)\n                n_train_iter = 100\n\n                for step in range(n_train_iter):\n                    clf.partial_fit(X_train, y_train, classes=classes)\n\n                    intermediate_value = clf.score(X_valid, y_valid)\n                    trial.report(intermediate_value, step)\n\n                    if trial.should_prune():\n                        assert False, \"should_prune() should always return False with this pruner.\"\n                        raise optuna.TrialPruned()\n\n                return clf.score(X_valid, y_valid)\n\n            study = optuna.create_study(direction='maximize',\n                                        pruner=optuna.pruners.NopPruner())\n            study.optimize(objective, n_trials=20)\n    \"\"\"\n\n    def prune(self, study, trial):\n        # type: (Study, FrozenTrial) -> bool\n\n        return False\n", "path": "optuna/pruners/_nop.py"}], "after_files": [{"content": "import optuna\nfrom optuna.pruners import BasePruner\n\n\nclass NopPruner(BasePruner):\n    \"\"\"Pruner which never prunes trials.\n\n    Example:\n\n        .. testcode::\n\n            import numpy as np\n            from sklearn.datasets import load_iris\n            from sklearn.linear_model import SGDClassifier\n            from sklearn.model_selection import train_test_split\n\n            import optuna\n\n            X, y = load_iris(return_X_y=True)\n            X_train, X_valid, y_train, y_valid = train_test_split(X, y)\n            classes = np.unique(y)\n\n            def objective(trial):\n                alpha = trial.suggest_uniform('alpha', 0.0, 1.0)\n                clf = SGDClassifier(alpha=alpha)\n                n_train_iter = 100\n\n                for step in range(n_train_iter):\n                    clf.partial_fit(X_train, y_train, classes=classes)\n\n                    intermediate_value = clf.score(X_valid, y_valid)\n                    trial.report(intermediate_value, step)\n\n                    if trial.should_prune():\n                        assert False, \"should_prune() should always return False with this pruner.\"\n                        raise optuna.TrialPruned()\n\n                return clf.score(X_valid, y_valid)\n\n            study = optuna.create_study(direction='maximize',\n                                        pruner=optuna.pruners.NopPruner())\n            study.optimize(objective, n_trials=20)\n    \"\"\"\n\n    def prune(self, study: \"optuna.study.Study\", trial: \"optuna.trial.FrozenTrial\") -> bool:\n\n        return False\n", "path": "optuna/pruners/_nop.py"}]}