prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Documentation for the v2 of the configuration file
  At first, I was thinking to automate this given the schema, but the spec isn't very large so we can just hand-write this without too much effort.
  
  </issue>
  <code>
  [start of docs/doc_extensions.py]
  1 """
  2 Read the Docs documentation extensions for Sphinx
  3 
  4 Adds the following roles:
  5 
  6 djangosetting
  7     Output an inline literal of the corresponding setting value. Useful for
  8     keeping documentation up to date without editing on settings changes.
  9 """
  10 
  11 from docutils import nodes, utils
  12 
  13 from django.conf import settings
  14 
  15 from readthedocs.projects.models import Feature
  16 
  17 
  18 def django_setting_role(typ, rawtext, text, lineno, inliner, options=None,
  19                         content=None):
  20     """Always up to date Django settings from the application"""
  21     dj_setting = getattr(settings, utils.unescape(text), 'None')
  22     node = nodes.literal(dj_setting, dj_setting)
  23     return [node], []
  24 
  25 
  26 def feature_flags_role(typ, rawtext, text, lineno, inliner, options=None,
  27                         content=None):
  28     """Up to date feature flags from the application."""
  29     all_features = Feature.FEATURES
  30     requested_feature = utils.unescape(text)
  31     for feature in all_features:
  32         if requested_feature.lower() == feature[0].lower():
  33             desc = nodes.Text(feature[1], feature[1])
  34     return [desc], []
  35 
  36 
  37 def setup(_):
  38     from docutils.parsers.rst import roles
  39     roles.register_local_role(
  40         'djangosetting',
  41         django_setting_role
  42     )
  43     roles.register_local_role(
  44         'featureflags',
  45         feature_flags_role
  46     )
  47 
  48     return {
  49         'version': 'builtin',
  50         'parallel_read_safe': True,
  51         'parallel_write_safe': True,
  52     }
  53
  [end of docs/doc_extensions.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/docs/doc_extensions.py b/docs/doc_extensions.py
  --- a/docs/doc_extensions.py
  +++ b/docs/doc_extensions.py
  @@ -6,11 +6,14 @@
   djangosetting
       Output an inline literal of the corresponding setting value. Useful for
       keeping documentation up to date without editing on settings changes.
  -"""
   
  -from docutils import nodes, utils
  +buildpyversions
  +    Output a comma separated list of the supported python versions for a
  +    Read the Docs build image.
  +"""
   
   from django.conf import settings
  +from docutils import nodes, utils
   
   from readthedocs.projects.models import Feature
   
  @@ -23,8 +26,23 @@
       return [node], []
   
   
  +def python_supported_versions_role(typ, rawtext, text, lineno, inliner,
  +                                   options=None, content=None):
  +    """Up to date supported python versions for each build image."""
  +    image = '{}:{}'.format(settings.DOCKER_DEFAULT_IMAGE, text)
  +    image_settings = settings.DOCKER_IMAGE_SETTINGS[image]
  +    python_versions = image_settings['python']['supported_versions']
  +    node_list = []
  +    separator = ', '
  +    for i, version in enumerate(python_versions):
  +        node_list.append(nodes.literal(version, version))
  +        if i < len(python_versions) - 1:
  +            node_list.append(nodes.Text(separator))
  +    return (node_list, [])
  +
  +
   def feature_flags_role(typ, rawtext, text, lineno, inliner, options=None,
  -                        content=None):
  +                       content=None):
       """Up to date feature flags from the application."""
       all_features = Feature.FEATURES
       requested_feature = utils.unescape(text)
  @@ -40,9 +58,13 @@
           'djangosetting',
           django_setting_role
       )
  +    roles.register_local_role(
  +        'buildpyversions',
  +        python_supported_versions_role,
  +    )
       roles.register_local_role(
           'featureflags',
  -        feature_flags_role
  +        feature_flags_role,
       )
   
       return {
  
verification_info: {"golden_diff": "diff --git a/docs/doc_extensions.py b/docs/doc_extensions.py\n--- a/docs/doc_extensions.py\n+++ b/docs/doc_extensions.py\n@@ -6,11 +6,14 @@\n djangosetting\n     Output an inline literal of the corresponding setting value. Useful for\n     keeping documentation up to date without editing on settings changes.\n-\"\"\"\n \n-from docutils import nodes, utils\n+buildpyversions\n+    Output a comma separated list of the supported python versions for a\n+    Read the Docs build image.\n+\"\"\"\n \n from django.conf import settings\n+from docutils import nodes, utils\n \n from readthedocs.projects.models import Feature\n \n@@ -23,8 +26,23 @@\n     return [node], []\n \n \n+def python_supported_versions_role(typ, rawtext, text, lineno, inliner,\n+                                   options=None, content=None):\n+    \"\"\"Up to date supported python versions for each build image.\"\"\"\n+    image = '{}:{}'.format(settings.DOCKER_DEFAULT_IMAGE, text)\n+    image_settings = settings.DOCKER_IMAGE_SETTINGS[image]\n+    python_versions = image_settings['python']['supported_versions']\n+    node_list = []\n+    separator = ', '\n+    for i, version in enumerate(python_versions):\n+        node_list.append(nodes.literal(version, version))\n+        if i < len(python_versions) - 1:\n+            node_list.append(nodes.Text(separator))\n+    return (node_list, [])\n+\n+\n def feature_flags_role(typ, rawtext, text, lineno, inliner, options=None,\n-                        content=None):\n+                       content=None):\n     \"\"\"Up to date feature flags from the application.\"\"\"\n     all_features = Feature.FEATURES\n     requested_feature = utils.unescape(text)\n@@ -40,9 +58,13 @@\n         'djangosetting',\n         django_setting_role\n     )\n+    roles.register_local_role(\n+        'buildpyversions',\n+        python_supported_versions_role,\n+    )\n     roles.register_local_role(\n         'featureflags',\n-        feature_flags_role\n+        feature_flags_role,\n     )\n \n     return {\n", "issue": "Documentation for the v2 of the configuration file\nAt first, I was thinking to automate this given the schema, but the spec isn't very large so we can just hand-write this without too much effort.\n", "before_files": [{"content": "\"\"\"\nRead the Docs documentation extensions for Sphinx\n\nAdds the following roles:\n\ndjangosetting\n    Output an inline literal of the corresponding setting value. Useful for\n    keeping documentation up to date without editing on settings changes.\n\"\"\"\n\nfrom docutils import nodes, utils\n\nfrom django.conf import settings\n\nfrom readthedocs.projects.models import Feature\n\n\ndef django_setting_role(typ, rawtext, text, lineno, inliner, options=None,\n                        content=None):\n    \"\"\"Always up to date Django settings from the application\"\"\"\n    dj_setting = getattr(settings, utils.unescape(text), 'None')\n    node = nodes.literal(dj_setting, dj_setting)\n    return [node], []\n\n\ndef feature_flags_role(typ, rawtext, text, lineno, inliner, options=None,\n                        content=None):\n    \"\"\"Up to date feature flags from the application.\"\"\"\n    all_features = Feature.FEATURES\n    requested_feature = utils.unescape(text)\n    for feature in all_features:\n        if requested_feature.lower() == feature[0].lower():\n            desc = nodes.Text(feature[1], feature[1])\n    return [desc], []\n\n\ndef setup(_):\n    from docutils.parsers.rst import roles\n    roles.register_local_role(\n        'djangosetting',\n        django_setting_role\n    )\n    roles.register_local_role(\n        'featureflags',\n        feature_flags_role\n    )\n\n    return {\n        'version': 'builtin',\n        'parallel_read_safe': True,\n        'parallel_write_safe': True,\n    }\n", "path": "docs/doc_extensions.py"}]}