prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add retries to tox
  Tox fails when trying to check links within our docs if the link is temporarily down/unresponsive. Adding retries to sphinx config should take care of that.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `docs/conf.py`
  Content:
  ```
  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 # If extensions (or modules to document with autodoc) are in another directory,
  10 # add these directories to sys.path here. If the directory is relative to the
  11 # documentation root, use os.path.abspath to make it absolute, like shown here.
  12 #
  13 # import os
  14 # import sys
  15 # sys.path.insert(0, os.path.abspath('.'))
  16 
  17 from __future__ import unicode_literals
  18 import re
  19 
  20 from recommonmark.parser import CommonMarkParser
  21 from recommonmark.transform import AutoStructify
  22 from docutils import nodes, transforms
  23 
  24 # -- Project information -----------------------------------------------------
  25 
  26 project = 'Turbinia'
  27 copyright = '2020, Google Inc'
  28 author = 'Turbinia maintainers'
  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', 'sphinx.ext.doctest', 'sphinx.ext.coverage',
  37     'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'sphinx_markdown_tables',
  38     'recommonmark'
  39 ]
  40 
  41 # Add any paths that contain templates here, relative to this directory.
  42 templates_path = ['_templates']
  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', 'Thumbs.db', '.DS_Store', 'design/*']
  48 
  49 # -- Options for HTML output -------------------------------------------------
  50 
  51 # The theme to use for HTML and HTML Help pages.  See the documentation for
  52 # a list of builtin themes.
  53 #
  54 html_theme = 'sphinx_rtd_theme'
  55 
  56 # The master toctree document.
  57 master_doc = 'index'
  58 
  59 # The name of the Pygments (syntax highlighting) style to use.
  60 pygments_style = 'sphinx'
  61 
  62 # Add any paths that contain custom static files (such as style sheets) here,
  63 # relative to this directory. They are copied after the builtin static files,
  64 # so a file named "default.css" will overwrite the builtin "default.css".
  65 html_static_path = ['_static']
  66 
  67 # The default sidebars (for documents that don't match any pattern) are
  68 # defined by theme itself.  Builtin themes are using these templates by
  69 # default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
  70 # 'searchbox.html']``.
  71 #
  72 html_sidebars = {
  73     '**': [
  74         'sidebar.html', 'localtoc.html', 'relations.html', 'sourcelink.html',
  75         'searchbox.html'
  76     ]
  77 }
  78 
  79 
  80 # Output file base name for HTML help builder.
  81 htmlhelp_basename = 'turbiniadoc'
  82 
  83 html_logo = "images/turbinia-logo.jpg"
  84 
  85 
  86 class ProcessLink(transforms.Transform):
  87   """Transform definition to parse .md references to internal pages."""
  88 
  89   default_priority = 1000
  90 
  91   def find_replace(self, node):
  92     """Parses URIs containing .md and replaces them with their HTML page."""
  93     if isinstance(node, nodes.reference) and 'refuri' in node:
  94       r = node['refuri']
  95       if r.endswith('.md'):
  96         r = r[:-3] + '.html'
  97         node['refuri'] = r
  98 
  99     return node
  100 
  101   def traverse(self, node):
  102     """Traverse the document tree rooted at node.
  103     node : docutil node
  104         current root node to traverse
  105     """
  106     self.find_replace(node)
  107 
  108     for c in node.children:
  109       self.traverse(c)
  110 
  111   # pylint: disable=arguments-differ,attribute-defined-outside-init
  112   # this was taken from GRR's config file for documentation
  113   def apply(self):
  114     self.current_level = 0
  115     self.traverse(self.document)
  116 
  117 
  118 def setup(app):
  119   """Add custom parsers to Sphinx generation."""
  120   app.add_config_value(
  121       'recommonmark_config', {
  122           'enable_auto_doc_ref': False,
  123       }, True)
  124   app.add_transform(AutoStructify)
  125   app.add_transform(ProcessLink)
  126
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/docs/conf.py b/docs/conf.py
  --- a/docs/conf.py
  +++ b/docs/conf.py
  @@ -76,6 +76,8 @@
       ]
   }
   
  +# Adding retries to linkchecks before declaring a link broken
  +linkcheck_retries = 3
   
   # Output file base name for HTML help builder.
   htmlhelp_basename = 'turbiniadoc'
  
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@@ -76,6 +76,8 @@\n     ]\n }\n \n+# Adding retries to linkchecks before declaring a link broken\n+linkcheck_retries = 3\n \n # Output file base name for HTML help builder.\n htmlhelp_basename = 'turbiniadoc'\n", "issue": "Add retries to tox\nTox fails when trying to check links within our docs if the link is temporarily down/unresponsive. Adding retries to sphinx config should take care of that.\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\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.\n#\n# import os\n# import sys\n# sys.path.insert(0, os.path.abspath('.'))\n\nfrom __future__ import unicode_literals\nimport re\n\nfrom recommonmark.parser import CommonMarkParser\nfrom recommonmark.transform import AutoStructify\nfrom docutils import nodes, transforms\n\n# -- Project information -----------------------------------------------------\n\nproject = 'Turbinia'\ncopyright = '2020, Google Inc'\nauthor = 'Turbinia maintainers'\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', 'sphinx.ext.doctest', 'sphinx.ext.coverage',\n    'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'sphinx_markdown_tables',\n    'recommonmark'\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\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', 'Thumbs.db', '.DS_Store', 'design/*']\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.\n#\nhtml_theme = 'sphinx_rtd_theme'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# The default sidebars (for documents that don't match any pattern) are\n# defined by theme itself.  Builtin themes are using these templates by\n# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',\n# 'searchbox.html']``.\n#\nhtml_sidebars = {\n    '**': [\n        'sidebar.html', 'localtoc.html', 'relations.html', 'sourcelink.html',\n        'searchbox.html'\n    ]\n}\n\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'turbiniadoc'\n\nhtml_logo = \"images/turbinia-logo.jpg\"\n\n\nclass ProcessLink(transforms.Transform):\n  \"\"\"Transform definition to parse .md references to internal pages.\"\"\"\n\n  default_priority = 1000\n\n  def find_replace(self, node):\n    \"\"\"Parses URIs containing .md and replaces them with their HTML page.\"\"\"\n    if isinstance(node, nodes.reference) and 'refuri' in node:\n      r = node['refuri']\n      if r.endswith('.md'):\n        r = r[:-3] + '.html'\n        node['refuri'] = r\n\n    return node\n\n  def traverse(self, node):\n    \"\"\"Traverse the document tree rooted at node.\n    node : docutil node\n        current root node to traverse\n    \"\"\"\n    self.find_replace(node)\n\n    for c in node.children:\n      self.traverse(c)\n\n  # pylint: disable=arguments-differ,attribute-defined-outside-init\n  # this was taken from GRR's config file for documentation\n  def apply(self):\n    self.current_level = 0\n    self.traverse(self.document)\n\n\ndef setup(app):\n  \"\"\"Add custom parsers to Sphinx generation.\"\"\"\n  app.add_config_value(\n      'recommonmark_config', {\n          'enable_auto_doc_ref': False,\n      }, True)\n  app.add_transform(AutoStructify)\n  app.add_transform(ProcessLink)\n", "path": "docs/conf.py"}], "after_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\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.\n#\n# import os\n# import sys\n# sys.path.insert(0, os.path.abspath('.'))\n\nfrom __future__ import unicode_literals\nimport re\n\nfrom recommonmark.parser import CommonMarkParser\nfrom recommonmark.transform import AutoStructify\nfrom docutils import nodes, transforms\n\n# -- Project information -----------------------------------------------------\n\nproject = 'Turbinia'\ncopyright = '2020, Google Inc'\nauthor = 'Turbinia maintainers'\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', 'sphinx.ext.doctest', 'sphinx.ext.coverage',\n    'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'sphinx_markdown_tables',\n    'recommonmark'\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\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', 'Thumbs.db', '.DS_Store', 'design/*']\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.\n#\nhtml_theme = 'sphinx_rtd_theme'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# The default sidebars (for documents that don't match any pattern) are\n# defined by theme itself.  Builtin themes are using these templates by\n# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',\n# 'searchbox.html']``.\n#\nhtml_sidebars = {\n    '**': [\n        'sidebar.html', 'localtoc.html', 'relations.html', 'sourcelink.html',\n        'searchbox.html'\n    ]\n}\n\n# Adding retries to linkchecks before declaring a link broken\nlinkcheck_retries = 3\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'turbiniadoc'\n\nhtml_logo = \"images/turbinia-logo.jpg\"\n\n\nclass ProcessLink(transforms.Transform):\n  \"\"\"Transform definition to parse .md references to internal pages.\"\"\"\n\n  default_priority = 1000\n\n  def find_replace(self, node):\n    \"\"\"Parses URIs containing .md and replaces them with their HTML page.\"\"\"\n    if isinstance(node, nodes.reference) and 'refuri' in node:\n      r = node['refuri']\n      if r.endswith('.md'):\n        r = r[:-3] + '.html'\n        node['refuri'] = r\n\n    return node\n\n  def traverse(self, node):\n    \"\"\"Traverse the document tree rooted at node.\n    node : docutil node\n        current root node to traverse\n    \"\"\"\n    self.find_replace(node)\n\n    for c in node.children:\n      self.traverse(c)\n\n  # pylint: disable=arguments-differ,attribute-defined-outside-init\n  # this was taken from GRR's config file for documentation\n  def apply(self):\n    self.current_level = 0\n    self.traverse(self.document)\n\n\ndef setup(app):\n  \"\"\"Add custom parsers to Sphinx generation.\"\"\"\n  app.add_config_value(\n      'recommonmark_config', {\n          'enable_auto_doc_ref': False,\n      }, True)\n  app.add_transform(AutoStructify)\n  app.add_transform(ProcessLink)\n", "path": "docs/conf.py"}]}