prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Jupyter Notebook tutorials
  We need to figure out how to render Jupyter Notebooks in our documentation so that we can provide easy-to-use tutorials for new users. This should work similarly to https://pytorch.org/tutorials/.
  
  Ideally I would like to be able to test these tutorials so that they stay up-to-date.
  
  </issue>
  <code>
  [start of docs/conf.py]
  1 # Configuration file for the Sphinx documentation builder.
  2 #
  3 # This file only contains a selection of the most common options. For a full
  4 # list see the documentation:
  5 # https://www.sphinx-doc.org/en/master/usage/configuration.html
  6 
  7 # -- Path setup --------------------------------------------------------------
  8 
  9 import os
  10 import sys
  11 
  12 import pytorch_sphinx_theme
  13 
  14 # If extensions (or modules to document with autodoc) are in another directory,
  15 # add these directories to sys.path here. If the directory is relative to the
  16 # documentation root, use os.path.abspath to make it absolute, like shown here.
  17 sys.path.insert(0, os.path.abspath(".."))
  18 
  19 import torchgeo  # noqa: E402
  20 
  21 # -- Project information -----------------------------------------------------
  22 
  23 project = "torchgeo"
  24 copyright = "2021, Microsoft Corporation"
  25 author = "Adam J. Stewart"
  26 version = ".".join(torchgeo.__version__.split(".")[:2])
  27 release = torchgeo.__version__
  28 
  29 
  30 # -- General configuration ---------------------------------------------------
  31 
  32 # Add any Sphinx extension module names here, as strings. They can be
  33 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  34 # ones.
  35 extensions = [
  36     "sphinx.ext.autodoc",
  37     "sphinx.ext.autosectionlabel",
  38     "sphinx.ext.intersphinx",
  39     "sphinx.ext.napoleon",
  40     "sphinx.ext.todo",
  41     "sphinx.ext.viewcode",
  42 ]
  43 
  44 # List of patterns, relative to source directory, that match files and
  45 # directories to ignore when looking for source files.
  46 # This pattern also affects html_static_path and html_extra_path.
  47 exclude_patterns = ["_build"]
  48 
  49 # Sphinx 3.0+ required for:
  50 # autodoc_typehints = "description"
  51 needs_sphinx = "3.0"
  52 
  53 nitpicky = True
  54 nitpick_ignore = [
  55     # https://github.com/sphinx-doc/sphinx/issues/8127
  56     ("py:class", ".."),
  57     # TODO: can't figure out why this isn't found
  58     ("py:class", "LightningDataModule"),
  59 ]
  60 
  61 
  62 # -- Options for HTML output -------------------------------------------------
  63 
  64 # The theme to use for HTML and HTML Help pages.  See the documentation for
  65 # a list of builtin themes.
  66 html_theme = "pytorch_sphinx_theme"
  67 html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
  68 
  69 # Theme options are theme-specific and customize the look and feel of a theme
  70 # further.  For a list of options available for each theme, see the
  71 # documentation.
  72 html_theme_options = {
  73     "collapse_navigation": False,
  74     "display_version": True,
  75     "logo_only": True,
  76     "pytorch_project": "docs",
  77     "navigation_with_keys": True,
  78     "analytics_id": "UA-117752657-2",
  79 }
  80 
  81 # -- Extension configuration -------------------------------------------------
  82 
  83 # sphinx.ext.autodoc
  84 autodoc_default_options = {
  85     "members": True,
  86     "special-members": True,
  87     "show-inheritance": True,
  88 }
  89 autodoc_member_order = "bysource"
  90 autodoc_typehints = "description"
  91 
  92 # sphinx.ext.intersphinx
  93 intersphinx_mapping = {
  94     "python": ("https://docs.python.org/3", None),
  95     "pytorch-lightning": ("https://pytorch-lightning.readthedocs.io/en/latest/", None),
  96     "rasterio": ("https://rasterio.readthedocs.io/en/latest/", None),
  97     "rtree": ("https://rtree.readthedocs.io/en/latest/", None),
  98     "torch": ("https://pytorch.org/docs/stable", None),
  99 }
  100
  [end of docs/conf.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/conf.py b/docs/conf.py
  --- a/docs/conf.py
  +++ b/docs/conf.py
  @@ -34,11 +34,11 @@
   # ones.
   extensions = [
       "sphinx.ext.autodoc",
  -    "sphinx.ext.autosectionlabel",
       "sphinx.ext.intersphinx",
       "sphinx.ext.napoleon",
       "sphinx.ext.todo",
       "sphinx.ext.viewcode",
  +    "nbsphinx",
   ]
   
   # List of patterns, relative to source directory, that match files and
  @@ -97,3 +97,17 @@
       "rtree": ("https://rtree.readthedocs.io/en/latest/", None),
       "torch": ("https://pytorch.org/docs/stable", None),
   }
  +
  +# nbsphinx
  +nbsphinx_execute = "never"
  +# TODO: branch/tag should change depending on which version of docs you look at
  +# TODO: :width: may be broken
  +nbsphinx_prolog = """
  +{% set colab = "https://colab.research.google.com" %}
  +{% set repo = "microsoft/torchgeo" %}
  +{% set branch = "main" %}
  +
  +.. image:: {{ colab }}/assets/colab-badge.svg
  +    :alt: Open in Colab
  +    :target: {{ colab }}/github/{{ repo }}/blob/{{ branch }}/docs/{{ env.docname }}
  +"""
  
verification_info: {"golden_diff": "diff --git a/docs/conf.py b/docs/conf.py\n--- a/docs/conf.py\n+++ b/docs/conf.py\n@@ -34,11 +34,11 @@\n # ones.\n extensions = [\n     \"sphinx.ext.autodoc\",\n-    \"sphinx.ext.autosectionlabel\",\n     \"sphinx.ext.intersphinx\",\n     \"sphinx.ext.napoleon\",\n     \"sphinx.ext.todo\",\n     \"sphinx.ext.viewcode\",\n+    \"nbsphinx\",\n ]\n \n # List of patterns, relative to source directory, that match files and\n@@ -97,3 +97,17 @@\n     \"rtree\": (\"https://rtree.readthedocs.io/en/latest/\", None),\n     \"torch\": (\"https://pytorch.org/docs/stable\", None),\n }\n+\n+# nbsphinx\n+nbsphinx_execute = \"never\"\n+# TODO: branch/tag should change depending on which version of docs you look at\n+# TODO: :width: may be broken\n+nbsphinx_prolog = \"\"\"\n+{% set colab = \"https://colab.research.google.com\" %}\n+{% set repo = \"microsoft/torchgeo\" %}\n+{% set branch = \"main\" %}\n+\n+.. image:: {{ colab }}/assets/colab-badge.svg\n+    :alt: Open in Colab\n+    :target: {{ colab }}/github/{{ repo }}/blob/{{ branch }}/docs/{{ env.docname }}\n+\"\"\"\n", "issue": "Jupyter Notebook tutorials\nWe need to figure out how to render Jupyter Notebooks in our documentation so that we can provide easy-to-use tutorials for new users. This should work similarly to https://pytorch.org/tutorials/.\r\n\r\nIdeally I would like to be able to test these tutorials so that they stay up-to-date.\n", "before_files": [{"content": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options. For a full\n# list see the documentation:\n# https://www.sphinx-doc.org/en/master/usage/configuration.html\n\n# -- Path setup --------------------------------------------------------------\n\nimport os\nimport sys\n\nimport pytorch_sphinx_theme\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\nsys.path.insert(0, os.path.abspath(\"..\"))\n\nimport torchgeo  # noqa: E402\n\n# -- Project information -----------------------------------------------------\n\nproject = \"torchgeo\"\ncopyright = \"2021, Microsoft Corporation\"\nauthor = \"Adam J. Stewart\"\nversion = \".\".join(torchgeo.__version__.split(\".\")[:2])\nrelease = torchgeo.__version__\n\n\n# -- General configuration ---------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.autosectionlabel\",\n    \"sphinx.ext.intersphinx\",\n    \"sphinx.ext.napoleon\",\n    \"sphinx.ext.todo\",\n    \"sphinx.ext.viewcode\",\n]\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This pattern also affects html_static_path and html_extra_path.\nexclude_patterns = [\"_build\"]\n\n# Sphinx 3.0+ required for:\n# autodoc_typehints = \"description\"\nneeds_sphinx = \"3.0\"\n\nnitpicky = True\nnitpick_ignore = [\n    # https://github.com/sphinx-doc/sphinx/issues/8127\n    (\"py:class\", \"..\"),\n    # TODO: can't figure out why this isn't found\n    (\"py:class\", \"LightningDataModule\"),\n]\n\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\nhtml_theme = \"pytorch_sphinx_theme\"\nhtml_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\nhtml_theme_options = {\n    \"collapse_navigation\": False,\n    \"display_version\": True,\n    \"logo_only\": True,\n    \"pytorch_project\": \"docs\",\n    \"navigation_with_keys\": True,\n    \"analytics_id\": \"UA-117752657-2\",\n}\n\n# -- Extension configuration -------------------------------------------------\n\n# sphinx.ext.autodoc\nautodoc_default_options = {\n    \"members\": True,\n    \"special-members\": True,\n    \"show-inheritance\": True,\n}\nautodoc_member_order = \"bysource\"\nautodoc_typehints = \"description\"\n\n# sphinx.ext.intersphinx\nintersphinx_mapping = {\n    \"python\": (\"https://docs.python.org/3\", None),\n    \"pytorch-lightning\": (\"https://pytorch-lightning.readthedocs.io/en/latest/\", None),\n    \"rasterio\": (\"https://rasterio.readthedocs.io/en/latest/\", None),\n    \"rtree\": (\"https://rtree.readthedocs.io/en/latest/\", None),\n    \"torch\": (\"https://pytorch.org/docs/stable\", None),\n}\n", "path": "docs/conf.py"}]}