prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Make `LXMLMixin.lxmlize` use scraper's `session`, rather than a raw `request.get()`
  Otherwise it slows down `--fast` scrapes because it doesn't use cached responses.
  
  </issue>
  <code>
  [start of openstates/utils/lxmlize.py]
  1 import requests
  2 import lxml.html
  3 
  4 
  5 class LXMLMixin(object):
  6     """Mixin for adding LXML helper functions to Open States code."""
  7 
  8     def lxmlize(self, url, raise_exceptions=False):
  9         """Parses document into an LXML object and makes links absolute.
  10 
  11         Args:
  12             url (str): URL of the document to parse.
  13         Returns:
  14             Element: Document node representing the page.
  15         """
  16         try:
  17             response = requests.get(url)
  18         except requests.exceptions.SSLError:
  19             self.warning('`self.lxmlize()` failed due to SSL error, trying'\
  20                 'an unverified `requests.get()`')
  21             response = requests.get(url, verify=False)
  22 
  23         if raise_exceptions:
  24             response.raise_for_status()
  25 
  26         page = lxml.html.fromstring(response.text)
  27         page.make_links_absolute(url)
  28 
  29         return page
  30 
  31     def get_node(self, base_node, xpath_query):
  32         """Searches for node in an element tree.
  33 
  34         Attempts to return only the first node found for an xpath query. Meant
  35         to cut down on exception handling boilerplate.
  36 
  37         Args:
  38             base_node (Element): Document node to begin querying from.
  39             xpath_query (str): XPath query to define nodes to search for.
  40         Returns:
  41             Element: First node found that matches the query.
  42         """
  43         try:
  44             node = base_node.xpath(xpath_query)[0]
  45         except IndexError:
  46             node = None
  47 
  48         return node
  49 
  50     def get_nodes(self, base_node, xpath_query):
  51         """Searches for nodes in an element tree.
  52 
  53         Attempts to return all nodes found for an xpath query. Meant to cut
  54         down on exception handling boilerplate.
  55 
  56         Args:
  57             base_node (Element): Document node to begin querying from.
  58             xpath_query (str): Xpath query to define nodes to search for.
  59         Returns:
  60             List[Element]: All nodes found that match the query.
  61         """
  62         return base_node.xpath(xpath_query)
  63
  [end of openstates/utils/lxmlize.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/openstates/utils/lxmlize.py b/openstates/utils/lxmlize.py
  --- a/openstates/utils/lxmlize.py
  +++ b/openstates/utils/lxmlize.py
  @@ -14,11 +14,13 @@
               Element: Document node representing the page.
           """
           try:
  -            response = requests.get(url)
  +            # This class is always mixed into subclasses of `billy.Scraper`,
  +            # which have a `get` method defined.
  +            response = self.get(url)
           except requests.exceptions.SSLError:
               self.warning('`self.lxmlize()` failed due to SSL error, trying'\
  -                'an unverified `requests.get()`')
  -            response = requests.get(url, verify=False)
  +                'an unverified `self.get()` (i.e. `requests.get()`)')
  +            response = self.get(url, verify=False)
   
           if raise_exceptions:
               response.raise_for_status()
  
verification_info: {"golden_diff": "diff --git a/openstates/utils/lxmlize.py b/openstates/utils/lxmlize.py\n--- a/openstates/utils/lxmlize.py\n+++ b/openstates/utils/lxmlize.py\n@@ -14,11 +14,13 @@\n             Element: Document node representing the page.\n         \"\"\"\n         try:\n-            response = requests.get(url)\n+            # This class is always mixed into subclasses of `billy.Scraper`,\n+            # which have a `get` method defined.\n+            response = self.get(url)\n         except requests.exceptions.SSLError:\n             self.warning('`self.lxmlize()` failed due to SSL error, trying'\\\n-                'an unverified `requests.get()`')\n-            response = requests.get(url, verify=False)\n+                'an unverified `self.get()` (i.e. `requests.get()`)')\n+            response = self.get(url, verify=False)\n \n         if raise_exceptions:\n             response.raise_for_status()\n", "issue": "Make `LXMLMixin.lxmlize` use scraper's `session`, rather than a raw `request.get()`\nOtherwise it slows down `--fast` scrapes because it doesn't use cached responses.\n", "before_files": [{"content": "import requests\nimport lxml.html\n\n\nclass LXMLMixin(object):\n    \"\"\"Mixin for adding LXML helper functions to Open States code.\"\"\"\n\n    def lxmlize(self, url, raise_exceptions=False):\n        \"\"\"Parses document into an LXML object and makes links absolute.\n\n        Args:\n            url (str): URL of the document to parse.\n        Returns:\n            Element: Document node representing the page.\n        \"\"\"\n        try:\n            response = requests.get(url)\n        except requests.exceptions.SSLError:\n            self.warning('`self.lxmlize()` failed due to SSL error, trying'\\\n                'an unverified `requests.get()`')\n            response = requests.get(url, verify=False)\n\n        if raise_exceptions:\n            response.raise_for_status()\n\n        page = lxml.html.fromstring(response.text)\n        page.make_links_absolute(url)\n\n        return page\n\n    def get_node(self, base_node, xpath_query):\n        \"\"\"Searches for node in an element tree.\n\n        Attempts to return only the first node found for an xpath query. Meant\n        to cut down on exception handling boilerplate.\n\n        Args:\n            base_node (Element): Document node to begin querying from.\n            xpath_query (str): XPath query to define nodes to search for.\n        Returns:\n            Element: First node found that matches the query.\n        \"\"\"\n        try:\n            node = base_node.xpath(xpath_query)[0]\n        except IndexError:\n            node = None\n\n        return node\n\n    def get_nodes(self, base_node, xpath_query):\n        \"\"\"Searches for nodes in an element tree.\n\n        Attempts to return all nodes found for an xpath query. Meant to cut\n        down on exception handling boilerplate.\n\n        Args:\n            base_node (Element): Document node to begin querying from.\n            xpath_query (str): Xpath query to define nodes to search for.\n        Returns:\n            List[Element]: All nodes found that match the query.\n        \"\"\"\n        return base_node.xpath(xpath_query)\n", "path": "openstates/utils/lxmlize.py"}]}