prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Consistently use lazy loading for all `skimage.*` submodules
  ### Description:
  
  With `lazy_loader` successfully being used for `skimage`, `skimage.data` and `skimage.filters` why not use it for every of our public submodules? I see no significant disadvantage here (when using the approach with PYI files) and it is what is proposed in [SPEC 1](https://scientific-python.org/specs/spec-0001/).
  
  Feel free to remove the good first issue label if there are concerns. Otherwise I would suggest to tackle this with separate PRs for each module that copy the examples mentioned above.
  
  </issue>
  <code>
  [start of skimage/metrics/__init__.py]
  1 from ._adapted_rand_error import adapted_rand_error
  2 from ._contingency_table import contingency_table
  3 from ._structural_similarity import structural_similarity
  4 from ._variation_of_information import variation_of_information
  5 from .set_metrics import hausdorff_distance, hausdorff_pair
  6 from .simple_metrics import (
  7     mean_squared_error,
  8     normalized_mutual_information,
  9     normalized_root_mse,
  10     peak_signal_noise_ratio,
  11 )
  12 
  13 __all__ = [
  14     "adapted_rand_error",
  15     "variation_of_information",
  16     "contingency_table",
  17     "mean_squared_error",
  18     "normalized_mutual_information",
  19     "normalized_root_mse",
  20     "peak_signal_noise_ratio",
  21     "structural_similarity",
  22     "hausdorff_distance",
  23     "hausdorff_pair",
  24 ]
  25
  [end of skimage/metrics/__init__.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/skimage/metrics/__init__.py b/skimage/metrics/__init__.py
  --- a/skimage/metrics/__init__.py
  +++ b/skimage/metrics/__init__.py
  @@ -1,24 +1,3 @@
  -from ._adapted_rand_error import adapted_rand_error
  -from ._contingency_table import contingency_table
  -from ._structural_similarity import structural_similarity
  -from ._variation_of_information import variation_of_information
  -from .set_metrics import hausdorff_distance, hausdorff_pair
  -from .simple_metrics import (
  -    mean_squared_error,
  -    normalized_mutual_information,
  -    normalized_root_mse,
  -    peak_signal_noise_ratio,
  -)
  +import lazy_loader as lazy
   
  -__all__ = [
  -    "adapted_rand_error",
  -    "variation_of_information",
  -    "contingency_table",
  -    "mean_squared_error",
  -    "normalized_mutual_information",
  -    "normalized_root_mse",
  -    "peak_signal_noise_ratio",
  -    "structural_similarity",
  -    "hausdorff_distance",
  -    "hausdorff_pair",
  -]
  +__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
  
verification_info: {"golden_diff": "diff --git a/skimage/metrics/__init__.py b/skimage/metrics/__init__.py\n--- a/skimage/metrics/__init__.py\n+++ b/skimage/metrics/__init__.py\n@@ -1,24 +1,3 @@\n-from ._adapted_rand_error import adapted_rand_error\n-from ._contingency_table import contingency_table\n-from ._structural_similarity import structural_similarity\n-from ._variation_of_information import variation_of_information\n-from .set_metrics import hausdorff_distance, hausdorff_pair\n-from .simple_metrics import (\n-    mean_squared_error,\n-    normalized_mutual_information,\n-    normalized_root_mse,\n-    peak_signal_noise_ratio,\n-)\n+import lazy_loader as lazy\n \n-__all__ = [\n-    \"adapted_rand_error\",\n-    \"variation_of_information\",\n-    \"contingency_table\",\n-    \"mean_squared_error\",\n-    \"normalized_mutual_information\",\n-    \"normalized_root_mse\",\n-    \"peak_signal_noise_ratio\",\n-    \"structural_similarity\",\n-    \"hausdorff_distance\",\n-    \"hausdorff_pair\",\n-]\n+__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)\n", "issue": "Consistently use lazy loading for all `skimage.*` submodules\n### Description:\r\n\r\nWith `lazy_loader` successfully being used for `skimage`, `skimage.data` and `skimage.filters` why not use it for every of our public submodules? I see no significant disadvantage here (when using the approach with PYI files) and it is what is proposed in [SPEC 1](https://scientific-python.org/specs/spec-0001/).\r\n\r\nFeel free to remove the good first issue label if there are concerns. Otherwise I would suggest to tackle this with separate PRs for each module that copy the examples mentioned above.\n", "before_files": [{"content": "from ._adapted_rand_error import adapted_rand_error\nfrom ._contingency_table import contingency_table\nfrom ._structural_similarity import structural_similarity\nfrom ._variation_of_information import variation_of_information\nfrom .set_metrics import hausdorff_distance, hausdorff_pair\nfrom .simple_metrics import (\n    mean_squared_error,\n    normalized_mutual_information,\n    normalized_root_mse,\n    peak_signal_noise_ratio,\n)\n\n__all__ = [\n    \"adapted_rand_error\",\n    \"variation_of_information\",\n    \"contingency_table\",\n    \"mean_squared_error\",\n    \"normalized_mutual_information\",\n    \"normalized_root_mse\",\n    \"peak_signal_noise_ratio\",\n    \"structural_similarity\",\n    \"hausdorff_distance\",\n    \"hausdorff_pair\",\n]\n", "path": "skimage/metrics/__init__.py"}]}