prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Document link extractor usage outside CrawlSpider rules
  https://docs.scrapy.org/en/latest/topics/link-extractors.html mentions that link extractors may be used outside `CrawlSpider`, but it does not go into detail on how to do that.
  
  Also, there are broken references to `scrapy.link.Link`, we should provide reference documentation for that class.
  
  </issue>
  <code>
  [start of scrapy/link.py]
  1 """
  2 This module defines the Link object used in Link extractors.
  3 
  4 For actual link extractors implementation see scrapy.linkextractors, or
  5 its documentation in: docs/topics/link-extractors.rst
  6 """
  7 
  8 
  9 class Link:
  10     """Link objects represent an extracted link by the LinkExtractor."""
  11 
  12     __slots__ = ['url', 'text', 'fragment', 'nofollow']
  13 
  14     def __init__(self, url, text='', fragment='', nofollow=False):
  15         if not isinstance(url, str):
  16             got = url.__class__.__name__
  17             raise TypeError(f"Link urls must be str objects, got {got}")
  18         self.url = url
  19         self.text = text
  20         self.fragment = fragment
  21         self.nofollow = nofollow
  22 
  23     def __eq__(self, other):
  24         return (
  25             self.url == other.url
  26             and self.text == other.text
  27             and self.fragment == other.fragment
  28             and self.nofollow == other.nofollow
  29         )
  30 
  31     def __hash__(self):
  32         return hash(self.url) ^ hash(self.text) ^ hash(self.fragment) ^ hash(self.nofollow)
  33 
  34     def __repr__(self):
  35         return (
  36             f'Link(url={self.url!r}, text={self.text!r}, '
  37             f'fragment={self.fragment!r}, nofollow={self.nofollow!r})'
  38         )
  39
  [end of scrapy/link.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/scrapy/link.py b/scrapy/link.py
  --- a/scrapy/link.py
  +++ b/scrapy/link.py
  @@ -7,7 +7,22 @@
   
   
   class Link:
  -    """Link objects represent an extracted link by the LinkExtractor."""
  +    """Link objects represent an extracted link by the LinkExtractor.
  +
  +    Using the anchor tag sample below to illustrate the parameters::
  +
  +            <a href="https://example.com/nofollow.html#foo" rel="nofollow">Dont follow this one</a>
  +
  +    :param url: the absolute url being linked to in the anchor tag.
  +                From the sample, this is ``https://example.com/nofollow.html``.
  +
  +    :param text: the text in the anchor tag. From the sample, this is ``Dont follow this one``.
  +
  +    :param fragment: the part of the url after the hash symbol. From the sample, this is ``foo``.
  +
  +    :param nofollow: an indication of the presence or absence of a nofollow value in the ``rel`` attribute
  +                    of the anchor tag.
  +    """
   
       __slots__ = ['url', 'text', 'fragment', 'nofollow']
  
verification_info: {"golden_diff": "diff --git a/scrapy/link.py b/scrapy/link.py\n--- a/scrapy/link.py\n+++ b/scrapy/link.py\n@@ -7,7 +7,22 @@\n \n \n class Link:\n-    \"\"\"Link objects represent an extracted link by the LinkExtractor.\"\"\"\n+    \"\"\"Link objects represent an extracted link by the LinkExtractor.\n+\n+    Using the anchor tag sample below to illustrate the parameters::\n+\n+            <a href=\"https://example.com/nofollow.html#foo\" rel=\"nofollow\">Dont follow this one</a>\n+\n+    :param url: the absolute url being linked to in the anchor tag.\n+                From the sample, this is ``https://example.com/nofollow.html``.\n+\n+    :param text: the text in the anchor tag. From the sample, this is ``Dont follow this one``.\n+\n+    :param fragment: the part of the url after the hash symbol. From the sample, this is ``foo``.\n+\n+    :param nofollow: an indication of the presence or absence of a nofollow value in the ``rel`` attribute\n+                    of the anchor tag.\n+    \"\"\"\n \n     __slots__ = ['url', 'text', 'fragment', 'nofollow']\n", "issue": "Document link extractor usage outside CrawlSpider rules\nhttps://docs.scrapy.org/en/latest/topics/link-extractors.html mentions that link extractors may be used outside `CrawlSpider`, but it does not go into detail on how to do that.\r\n\r\nAlso, there are broken references to `scrapy.link.Link`, we should provide reference documentation for that class.\n", "before_files": [{"content": "\"\"\"\nThis module defines the Link object used in Link extractors.\n\nFor actual link extractors implementation see scrapy.linkextractors, or\nits documentation in: docs/topics/link-extractors.rst\n\"\"\"\n\n\nclass Link:\n    \"\"\"Link objects represent an extracted link by the LinkExtractor.\"\"\"\n\n    __slots__ = ['url', 'text', 'fragment', 'nofollow']\n\n    def __init__(self, url, text='', fragment='', nofollow=False):\n        if not isinstance(url, str):\n            got = url.__class__.__name__\n            raise TypeError(f\"Link urls must be str objects, got {got}\")\n        self.url = url\n        self.text = text\n        self.fragment = fragment\n        self.nofollow = nofollow\n\n    def __eq__(self, other):\n        return (\n            self.url == other.url\n            and self.text == other.text\n            and self.fragment == other.fragment\n            and self.nofollow == other.nofollow\n        )\n\n    def __hash__(self):\n        return hash(self.url) ^ hash(self.text) ^ hash(self.fragment) ^ hash(self.nofollow)\n\n    def __repr__(self):\n        return (\n            f'Link(url={self.url!r}, text={self.text!r}, '\n            f'fragment={self.fragment!r}, nofollow={self.nofollow!r})'\n        )\n", "path": "scrapy/link.py"}]}