prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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.
  
  </issue>
  <code>
  [start of optuna/pruners/_nop.py]
  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 of optuna/pruners/_nop.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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
  
verification_info: {"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"}]}