prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  responsetypes.py ResponseTypes.from_headers typo as 'Content-type'
  Shall this line:
  
  https://github.com/scrapy/scrapy/blob/8845773d44329194ee73fa4985a94e768bf664e7/scrapy/responsetypes.py#L74
  
  be changed to below?
  `
  content_type=headers[b'Content-Type'],
  `
  I guess this typo is with all the versions until today.
  
  </issue>
  <code>
  [start of scrapy/responsetypes.py]
  1 """
  2 This module implements a class which returns the appropriate Response class
  3 based on different criteria.
  4 """
  5 from mimetypes import MimeTypes
  6 from pkgutil import get_data
  7 from io import StringIO
  8 
  9 from scrapy.http import Response
  10 from scrapy.utils.misc import load_object
  11 from scrapy.utils.python import binary_is_text, to_bytes, to_unicode
  12 
  13 
  14 class ResponseTypes:
  15 
  16     CLASSES = {
  17         'text/html': 'scrapy.http.HtmlResponse',
  18         'application/atom+xml': 'scrapy.http.XmlResponse',
  19         'application/rdf+xml': 'scrapy.http.XmlResponse',
  20         'application/rss+xml': 'scrapy.http.XmlResponse',
  21         'application/xhtml+xml': 'scrapy.http.HtmlResponse',
  22         'application/vnd.wap.xhtml+xml': 'scrapy.http.HtmlResponse',
  23         'application/xml': 'scrapy.http.XmlResponse',
  24         'application/json': 'scrapy.http.TextResponse',
  25         'application/x-json': 'scrapy.http.TextResponse',
  26         'application/json-amazonui-streaming': 'scrapy.http.TextResponse',
  27         'application/javascript': 'scrapy.http.TextResponse',
  28         'application/x-javascript': 'scrapy.http.TextResponse',
  29         'text/xml': 'scrapy.http.XmlResponse',
  30         'text/*': 'scrapy.http.TextResponse',
  31     }
  32 
  33     def __init__(self):
  34         self.classes = {}
  35         self.mimetypes = MimeTypes()
  36         mimedata = get_data('scrapy', 'mime.types').decode('utf8')
  37         self.mimetypes.readfp(StringIO(mimedata))
  38         for mimetype, cls in self.CLASSES.items():
  39             self.classes[mimetype] = load_object(cls)
  40 
  41     def from_mimetype(self, mimetype):
  42         """Return the most appropriate Response class for the given mimetype"""
  43         if mimetype is None:
  44             return Response
  45         elif mimetype in self.classes:
  46             return self.classes[mimetype]
  47         else:
  48             basetype = "%s/*" % mimetype.split('/')[0]
  49             return self.classes.get(basetype, Response)
  50 
  51     def from_content_type(self, content_type, content_encoding=None):
  52         """Return the most appropriate Response class from an HTTP Content-Type
  53         header """
  54         if content_encoding:
  55             return Response
  56         mimetype = to_unicode(content_type).split(';')[0].strip().lower()
  57         return self.from_mimetype(mimetype)
  58 
  59     def from_content_disposition(self, content_disposition):
  60         try:
  61             filename = to_unicode(content_disposition,
  62                 encoding='latin-1', errors='replace').split(';')[1].split('=')[1]
  63             filename = filename.strip('"\'')
  64             return self.from_filename(filename)
  65         except IndexError:
  66             return Response
  67 
  68     def from_headers(self, headers):
  69         """Return the most appropriate Response class by looking at the HTTP
  70         headers"""
  71         cls = Response
  72         if b'Content-Type' in headers:
  73             cls = self.from_content_type(
  74                 content_type=headers[b'Content-type'],
  75                 content_encoding=headers.get(b'Content-Encoding')
  76             )
  77         if cls is Response and b'Content-Disposition' in headers:
  78             cls = self.from_content_disposition(headers[b'Content-Disposition'])
  79         return cls
  80 
  81     def from_filename(self, filename):
  82         """Return the most appropriate Response class from a file name"""
  83         mimetype, encoding = self.mimetypes.guess_type(filename)
  84         if mimetype and not encoding:
  85             return self.from_mimetype(mimetype)
  86         else:
  87             return Response
  88 
  89     def from_body(self, body):
  90         """Try to guess the appropriate response based on the body content.
  91         This method is a bit magic and could be improved in the future, but
  92         it's not meant to be used except for special cases where response types
  93         cannot be guess using more straightforward methods."""
  94         chunk = body[:5000]
  95         chunk = to_bytes(chunk)
  96         if not binary_is_text(chunk):
  97             return self.from_mimetype('application/octet-stream')
  98         elif b"<html>" in chunk.lower():
  99             return self.from_mimetype('text/html')
  100         elif b"<?xml" in chunk.lower():
  101             return self.from_mimetype('text/xml')
  102         else:
  103             return self.from_mimetype('text')
  104 
  105     def from_args(self, headers=None, url=None, filename=None, body=None):
  106         """Guess the most appropriate Response class based on
  107         the given arguments."""
  108         cls = Response
  109         if headers is not None:
  110             cls = self.from_headers(headers)
  111         if cls is Response and url is not None:
  112             cls = self.from_filename(url)
  113         if cls is Response and filename is not None:
  114             cls = self.from_filename(filename)
  115         if cls is Response and body is not None:
  116             cls = self.from_body(body)
  117         return cls
  118 
  119 
  120 responsetypes = ResponseTypes()
  121
  [end of scrapy/responsetypes.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/responsetypes.py b/scrapy/responsetypes.py
  --- a/scrapy/responsetypes.py
  +++ b/scrapy/responsetypes.py
  @@ -71,7 +71,7 @@
           cls = Response
           if b'Content-Type' in headers:
               cls = self.from_content_type(
  -                content_type=headers[b'Content-type'],
  +                content_type=headers[b'Content-Type'],
                   content_encoding=headers.get(b'Content-Encoding')
               )
           if cls is Response and b'Content-Disposition' in headers:
  
verification_info: {"golden_diff": "diff --git a/scrapy/responsetypes.py b/scrapy/responsetypes.py\n--- a/scrapy/responsetypes.py\n+++ b/scrapy/responsetypes.py\n@@ -71,7 +71,7 @@\n         cls = Response\n         if b'Content-Type' in headers:\n             cls = self.from_content_type(\n-                content_type=headers[b'Content-type'],\n+                content_type=headers[b'Content-Type'],\n                 content_encoding=headers.get(b'Content-Encoding')\n             )\n         if cls is Response and b'Content-Disposition' in headers:\n", "issue": "responsetypes.py ResponseTypes.from_headers typo as 'Content-type'\nShall this line:\r\n\r\nhttps://github.com/scrapy/scrapy/blob/8845773d44329194ee73fa4985a94e768bf664e7/scrapy/responsetypes.py#L74\r\n\r\nbe changed to below?\r\n`\r\ncontent_type=headers[b'Content-Type'],\r\n`\r\nI guess this typo is with all the versions until today.\n", "before_files": [{"content": "\"\"\"\nThis module implements a class which returns the appropriate Response class\nbased on different criteria.\n\"\"\"\nfrom mimetypes import MimeTypes\nfrom pkgutil import get_data\nfrom io import StringIO\n\nfrom scrapy.http import Response\nfrom scrapy.utils.misc import load_object\nfrom scrapy.utils.python import binary_is_text, to_bytes, to_unicode\n\n\nclass ResponseTypes:\n\n    CLASSES = {\n        'text/html': 'scrapy.http.HtmlResponse',\n        'application/atom+xml': 'scrapy.http.XmlResponse',\n        'application/rdf+xml': 'scrapy.http.XmlResponse',\n        'application/rss+xml': 'scrapy.http.XmlResponse',\n        'application/xhtml+xml': 'scrapy.http.HtmlResponse',\n        'application/vnd.wap.xhtml+xml': 'scrapy.http.HtmlResponse',\n        'application/xml': 'scrapy.http.XmlResponse',\n        'application/json': 'scrapy.http.TextResponse',\n        'application/x-json': 'scrapy.http.TextResponse',\n        'application/json-amazonui-streaming': 'scrapy.http.TextResponse',\n        'application/javascript': 'scrapy.http.TextResponse',\n        'application/x-javascript': 'scrapy.http.TextResponse',\n        'text/xml': 'scrapy.http.XmlResponse',\n        'text/*': 'scrapy.http.TextResponse',\n    }\n\n    def __init__(self):\n        self.classes = {}\n        self.mimetypes = MimeTypes()\n        mimedata = get_data('scrapy', 'mime.types').decode('utf8')\n        self.mimetypes.readfp(StringIO(mimedata))\n        for mimetype, cls in self.CLASSES.items():\n            self.classes[mimetype] = load_object(cls)\n\n    def from_mimetype(self, mimetype):\n        \"\"\"Return the most appropriate Response class for the given mimetype\"\"\"\n        if mimetype is None:\n            return Response\n        elif mimetype in self.classes:\n            return self.classes[mimetype]\n        else:\n            basetype = \"%s/*\" % mimetype.split('/')[0]\n            return self.classes.get(basetype, Response)\n\n    def from_content_type(self, content_type, content_encoding=None):\n        \"\"\"Return the most appropriate Response class from an HTTP Content-Type\n        header \"\"\"\n        if content_encoding:\n            return Response\n        mimetype = to_unicode(content_type).split(';')[0].strip().lower()\n        return self.from_mimetype(mimetype)\n\n    def from_content_disposition(self, content_disposition):\n        try:\n            filename = to_unicode(content_disposition,\n                encoding='latin-1', errors='replace').split(';')[1].split('=')[1]\n            filename = filename.strip('\"\\'')\n            return self.from_filename(filename)\n        except IndexError:\n            return Response\n\n    def from_headers(self, headers):\n        \"\"\"Return the most appropriate Response class by looking at the HTTP\n        headers\"\"\"\n        cls = Response\n        if b'Content-Type' in headers:\n            cls = self.from_content_type(\n                content_type=headers[b'Content-type'],\n                content_encoding=headers.get(b'Content-Encoding')\n            )\n        if cls is Response and b'Content-Disposition' in headers:\n            cls = self.from_content_disposition(headers[b'Content-Disposition'])\n        return cls\n\n    def from_filename(self, filename):\n        \"\"\"Return the most appropriate Response class from a file name\"\"\"\n        mimetype, encoding = self.mimetypes.guess_type(filename)\n        if mimetype and not encoding:\n            return self.from_mimetype(mimetype)\n        else:\n            return Response\n\n    def from_body(self, body):\n        \"\"\"Try to guess the appropriate response based on the body content.\n        This method is a bit magic and could be improved in the future, but\n        it's not meant to be used except for special cases where response types\n        cannot be guess using more straightforward methods.\"\"\"\n        chunk = body[:5000]\n        chunk = to_bytes(chunk)\n        if not binary_is_text(chunk):\n            return self.from_mimetype('application/octet-stream')\n        elif b\"<html>\" in chunk.lower():\n            return self.from_mimetype('text/html')\n        elif b\"<?xml\" in chunk.lower():\n            return self.from_mimetype('text/xml')\n        else:\n            return self.from_mimetype('text')\n\n    def from_args(self, headers=None, url=None, filename=None, body=None):\n        \"\"\"Guess the most appropriate Response class based on\n        the given arguments.\"\"\"\n        cls = Response\n        if headers is not None:\n            cls = self.from_headers(headers)\n        if cls is Response and url is not None:\n            cls = self.from_filename(url)\n        if cls is Response and filename is not None:\n            cls = self.from_filename(filename)\n        if cls is Response and body is not None:\n            cls = self.from_body(body)\n        return cls\n\n\nresponsetypes = ResponseTypes()\n", "path": "scrapy/responsetypes.py"}]}