prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add decode_content parameter to top-level APIs
  Like the title says, add `decode_content` to the top-level APIs `urllib3.request()`.
  
  See https://github.com/urllib3/urllib3/commit/ddf7361ac0467431a2f3df6ba346c9c506c29d56 for an example.
  
  </issue>
  <code>
  [start of src/urllib3/__init__.py]
  1 """
  2 Python HTTP library with thread-safe connection pooling, file post support, user friendly, and more
  3 """
  4 
  5 # Set default logging handler to avoid "No handler found" warnings.
  6 import logging
  7 import warnings
  8 from logging import NullHandler
  9 from typing import Mapping, Optional, Type, Union
  10 
  11 from . import exceptions
  12 from ._collections import HTTPHeaderDict
  13 from ._version import __version__
  14 from .connection import _TYPE_BODY
  15 from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  16 from .filepost import _TYPE_FIELDS, encode_multipart_formdata
  17 from .poolmanager import PoolManager, ProxyManager, proxy_from_url
  18 from .response import BaseHTTPResponse, HTTPResponse
  19 from .util.request import make_headers
  20 from .util.retry import Retry
  21 from .util.timeout import Timeout
  22 
  23 __author__ = "Andrey Petrov (andrey.petrov@shazow.net)"
  24 __license__ = "MIT"
  25 __version__ = __version__
  26 
  27 __all__ = (
  28     "HTTPConnectionPool",
  29     "HTTPHeaderDict",
  30     "HTTPSConnectionPool",
  31     "PoolManager",
  32     "ProxyManager",
  33     "HTTPResponse",
  34     "Retry",
  35     "Timeout",
  36     "add_stderr_logger",
  37     "connection_from_url",
  38     "disable_warnings",
  39     "encode_multipart_formdata",
  40     "make_headers",
  41     "proxy_from_url",
  42     "request",
  43 )
  44 
  45 logging.getLogger(__name__).addHandler(NullHandler())
  46 
  47 
  48 def add_stderr_logger(level: int = logging.DEBUG) -> logging.StreamHandler:
  49     """
  50     Helper for quickly adding a StreamHandler to the logger. Useful for
  51     debugging.
  52 
  53     Returns the handler after adding it.
  54     """
  55     # This method needs to be in this __init__.py to get the __name__ correct
  56     # even if urllib3 is vendored within another package.
  57     logger = logging.getLogger(__name__)
  58     handler = logging.StreamHandler()
  59     handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %(message)s"))
  60     logger.addHandler(handler)
  61     logger.setLevel(level)
  62     logger.debug("Added a stderr logging handler to logger: %s", __name__)
  63     return handler
  64 
  65 
  66 # ... Clean up.
  67 del NullHandler
  68 
  69 
  70 # All warning filters *must* be appended unless you're really certain that they
  71 # shouldn't be: otherwise, it's very hard for users to use most Python
  72 # mechanisms to silence them.
  73 # SecurityWarning's always go off by default.
  74 warnings.simplefilter("always", exceptions.SecurityWarning, append=True)
  75 # InsecurePlatformWarning's don't vary between requests, so we keep it default.
  76 warnings.simplefilter("default", exceptions.InsecurePlatformWarning, append=True)
  77 # SNIMissingWarnings should go off only once.
  78 warnings.simplefilter("default", exceptions.SNIMissingWarning, append=True)
  79 
  80 
  81 def disable_warnings(category: Type[Warning] = exceptions.HTTPWarning) -> None:
  82     """
  83     Helper for quickly disabling all urllib3 warnings.
  84     """
  85     warnings.simplefilter("ignore", category)
  86 
  87 
  88 _DEFAULT_POOL = PoolManager()
  89 
  90 
  91 def request(
  92     method: str,
  93     url: str,
  94     *,
  95     body: Optional[_TYPE_BODY] = None,
  96     fields: Optional[_TYPE_FIELDS] = None,
  97     headers: Optional[Mapping[str, str]] = None,
  98     preload_content: Optional[bool] = True,
  99     redirect: Optional[bool] = True,
  100     retries: Optional[Union[Retry, bool, int]] = None,
  101     timeout: Optional[Union[Timeout, float, int]] = 3,
  102 ) -> BaseHTTPResponse:
  103     """
  104     A convenience, top-level request method. It uses a module-global ``PoolManager`` instance.
  105     Therefore, its side effects could be shared across dependencies relying on it.
  106     To avoid side effects create a new ``PoolManager`` instance and use it instead.
  107     The method does not accept low-level ``**urlopen_kw`` keyword arguments.
  108     """
  109 
  110     return _DEFAULT_POOL.request(
  111         method,
  112         url,
  113         body=body,
  114         fields=fields,
  115         headers=headers,
  116         preload_content=preload_content,
  117         redirect=redirect,
  118         retries=retries,
  119         timeout=timeout,
  120     )
  121
  [end of src/urllib3/__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/src/urllib3/__init__.py b/src/urllib3/__init__.py
  --- a/src/urllib3/__init__.py
  +++ b/src/urllib3/__init__.py
  @@ -96,6 +96,7 @@
       fields: Optional[_TYPE_FIELDS] = None,
       headers: Optional[Mapping[str, str]] = None,
       preload_content: Optional[bool] = True,
  +    decode_content: Optional[bool] = True,
       redirect: Optional[bool] = True,
       retries: Optional[Union[Retry, bool, int]] = None,
       timeout: Optional[Union[Timeout, float, int]] = 3,
  @@ -114,6 +115,7 @@
           fields=fields,
           headers=headers,
           preload_content=preload_content,
  +        decode_content=decode_content,
           redirect=redirect,
           retries=retries,
           timeout=timeout,
  
verification_info: {"golden_diff": "diff --git a/src/urllib3/__init__.py b/src/urllib3/__init__.py\n--- a/src/urllib3/__init__.py\n+++ b/src/urllib3/__init__.py\n@@ -96,6 +96,7 @@\n     fields: Optional[_TYPE_FIELDS] = None,\n     headers: Optional[Mapping[str, str]] = None,\n     preload_content: Optional[bool] = True,\n+    decode_content: Optional[bool] = True,\n     redirect: Optional[bool] = True,\n     retries: Optional[Union[Retry, bool, int]] = None,\n     timeout: Optional[Union[Timeout, float, int]] = 3,\n@@ -114,6 +115,7 @@\n         fields=fields,\n         headers=headers,\n         preload_content=preload_content,\n+        decode_content=decode_content,\n         redirect=redirect,\n         retries=retries,\n         timeout=timeout,\n", "issue": "Add decode_content parameter to top-level APIs\nLike the title says, add `decode_content` to the top-level APIs `urllib3.request()`.\r\n\r\nSee https://github.com/urllib3/urllib3/commit/ddf7361ac0467431a2f3df6ba346c9c506c29d56 for an example.\n", "before_files": [{"content": "\"\"\"\nPython HTTP library with thread-safe connection pooling, file post support, user friendly, and more\n\"\"\"\n\n# Set default logging handler to avoid \"No handler found\" warnings.\nimport logging\nimport warnings\nfrom logging import NullHandler\nfrom typing import Mapping, Optional, Type, Union\n\nfrom . import exceptions\nfrom ._collections import HTTPHeaderDict\nfrom ._version import __version__\nfrom .connection import _TYPE_BODY\nfrom .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url\nfrom .filepost import _TYPE_FIELDS, encode_multipart_formdata\nfrom .poolmanager import PoolManager, ProxyManager, proxy_from_url\nfrom .response import BaseHTTPResponse, HTTPResponse\nfrom .util.request import make_headers\nfrom .util.retry import Retry\nfrom .util.timeout import Timeout\n\n__author__ = \"Andrey Petrov (andrey.petrov@shazow.net)\"\n__license__ = \"MIT\"\n__version__ = __version__\n\n__all__ = (\n    \"HTTPConnectionPool\",\n    \"HTTPHeaderDict\",\n    \"HTTPSConnectionPool\",\n    \"PoolManager\",\n    \"ProxyManager\",\n    \"HTTPResponse\",\n    \"Retry\",\n    \"Timeout\",\n    \"add_stderr_logger\",\n    \"connection_from_url\",\n    \"disable_warnings\",\n    \"encode_multipart_formdata\",\n    \"make_headers\",\n    \"proxy_from_url\",\n    \"request\",\n)\n\nlogging.getLogger(__name__).addHandler(NullHandler())\n\n\ndef add_stderr_logger(level: int = logging.DEBUG) -> logging.StreamHandler:\n    \"\"\"\n    Helper for quickly adding a StreamHandler to the logger. Useful for\n    debugging.\n\n    Returns the handler after adding it.\n    \"\"\"\n    # This method needs to be in this __init__.py to get the __name__ correct\n    # even if urllib3 is vendored within another package.\n    logger = logging.getLogger(__name__)\n    handler = logging.StreamHandler()\n    handler.setFormatter(logging.Formatter(\"%(asctime)s %(levelname)s %(message)s\"))\n    logger.addHandler(handler)\n    logger.setLevel(level)\n    logger.debug(\"Added a stderr logging handler to logger: %s\", __name__)\n    return handler\n\n\n# ... Clean up.\ndel NullHandler\n\n\n# All warning filters *must* be appended unless you're really certain that they\n# shouldn't be: otherwise, it's very hard for users to use most Python\n# mechanisms to silence them.\n# SecurityWarning's always go off by default.\nwarnings.simplefilter(\"always\", exceptions.SecurityWarning, append=True)\n# InsecurePlatformWarning's don't vary between requests, so we keep it default.\nwarnings.simplefilter(\"default\", exceptions.InsecurePlatformWarning, append=True)\n# SNIMissingWarnings should go off only once.\nwarnings.simplefilter(\"default\", exceptions.SNIMissingWarning, append=True)\n\n\ndef disable_warnings(category: Type[Warning] = exceptions.HTTPWarning) -> None:\n    \"\"\"\n    Helper for quickly disabling all urllib3 warnings.\n    \"\"\"\n    warnings.simplefilter(\"ignore\", category)\n\n\n_DEFAULT_POOL = PoolManager()\n\n\ndef request(\n    method: str,\n    url: str,\n    *,\n    body: Optional[_TYPE_BODY] = None,\n    fields: Optional[_TYPE_FIELDS] = None,\n    headers: Optional[Mapping[str, str]] = None,\n    preload_content: Optional[bool] = True,\n    redirect: Optional[bool] = True,\n    retries: Optional[Union[Retry, bool, int]] = None,\n    timeout: Optional[Union[Timeout, float, int]] = 3,\n) -> BaseHTTPResponse:\n    \"\"\"\n    A convenience, top-level request method. It uses a module-global ``PoolManager`` instance.\n    Therefore, its side effects could be shared across dependencies relying on it.\n    To avoid side effects create a new ``PoolManager`` instance and use it instead.\n    The method does not accept low-level ``**urlopen_kw`` keyword arguments.\n    \"\"\"\n\n    return _DEFAULT_POOL.request(\n        method,\n        url,\n        body=body,\n        fields=fields,\n        headers=headers,\n        preload_content=preload_content,\n        redirect=redirect,\n        retries=retries,\n        timeout=timeout,\n    )\n", "path": "src/urllib3/__init__.py"}]}